@rbxts/uiblox 0.2.0-alpha.0 → 0.2.0-alpha.10
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/README.md +51 -34
- package/out/theme/constants/NumberConstants.d.ts +4 -2
- package/out/theme/constants/NumberConstants.luau +6 -4
- package/out/theme/context/ThemeProvider.d.ts +1 -1
- package/out/theme/hooks/useTheme.d.ts +1 -1
- package/out/theme/interfaces/palette/colorTokens/ColorTokens.d.ts +1 -1
- package/out/theme/interfaces/spacing/Shape.d.ts +3 -0
- package/out/theme/interfaces/typography/FontSizes.d.ts +1 -1
- package/out/theme/interfaces/typography/FontSizes.luau +15 -8
- package/out/theme/interfaces/typography/ThemeTypography.d.ts +3 -0
- package/out/theme/interfaces/typography/Variants.d.ts +14 -15
- package/out/theme/interfaces/typography/Variants.luau +68 -18
- package/out/theme/styles/utilities/index.d.ts +1 -1
- package/out/theme/styles/utilities/init.luau +3 -1
- package/out/theme/styles/utilities/resolveStyle.d.ts +32 -0
- package/out/theme/styles/utilities/resolveStyle.luau +66 -0
- package/out/theme/themes/DarkTheme.luau +4 -0
- package/out/theme/themes/LightTheme.luau +4 -0
- package/out/theme/types/types.d.ts +1 -1
- package/out/ui/packages/accordion/components/Accordion.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.luau +5 -0
- package/out/ui/packages/accordion/components/Accordion.styles.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.styles.luau +4 -2
- package/out/ui/packages/alert/components/Alert.d.ts +10 -0
- package/out/ui/packages/alert/components/Alert.luau +98 -0
- package/out/ui/packages/alert/components/Alert.styles.d.ts +6 -0
- package/out/ui/packages/alert/components/Alert.styles.luau +93 -0
- package/out/ui/packages/alert/components/alertTone.d.ts +2 -0
- package/out/ui/packages/alert/components/alertTone.luau +7 -0
- package/out/ui/packages/alert/index.d.ts +3 -0
- package/out/ui/packages/alert/init.luau +6 -0
- package/out/ui/packages/appBar/components/AppBar.d.ts +10 -0
- package/out/ui/packages/appBar/components/AppBar.luau +77 -0
- package/out/ui/packages/appBar/components/AppBar.styles.d.ts +6 -0
- package/out/ui/packages/appBar/components/AppBar.styles.luau +66 -0
- package/out/ui/packages/appBar/index.d.ts +3 -0
- package/out/ui/packages/appBar/init.luau +5 -0
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +10 -0
- 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/bottomNavigation/components/BottomNavigation.d.ts +10 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +86 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.d.ts +2 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +58 -0
- package/out/ui/packages/bottomNavigation/index.d.ts +2 -0
- package/out/ui/packages/bottomNavigation/init.luau +5 -0
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +58 -24
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +9 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +68 -0
- package/out/ui/packages/breadcrumbs/index.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/init.luau +3 -0
- package/out/ui/packages/brickColorPicker/components/brickColorCatalog.luau +1 -1
- package/out/ui/packages/button/components/Button.luau +9 -5
- package/out/ui/packages/button/components/Button.styles.luau +0 -6
- package/out/ui/packages/button/components/buttonLook.d.ts +2 -2
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
- package/out/ui/packages/chip/components/Chip.d.ts +3 -1
- package/out/ui/packages/chip/components/Chip.luau +39 -2
- package/out/ui/packages/chip/components/Chip.styles.d.ts +3 -0
- package/out/ui/packages/chip/components/Chip.styles.luau +40 -6
- 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/fab/components/Fab.d.ts +14 -0
- package/out/ui/packages/fab/components/Fab.luau +160 -0
- package/out/ui/packages/fab/components/Fab.styles.d.ts +8 -0
- package/out/ui/packages/fab/components/Fab.styles.luau +65 -0
- package/out/ui/packages/fab/components/fabSize.d.ts +4 -0
- package/out/ui/packages/fab/components/fabSize.luau +33 -0
- package/out/ui/packages/fab/index.d.ts +3 -0
- package/out/ui/packages/fab/init.luau +9 -0
- package/out/ui/packages/formText/components/FormHelperText.d.ts +8 -0
- package/out/ui/packages/formText/components/FormHelperText.luau +44 -0
- package/out/ui/packages/formText/components/FormLabel.d.ts +9 -0
- package/out/ui/packages/formText/components/FormLabel.luau +46 -0
- package/out/ui/packages/formText/components/FormText.styles.d.ts +5 -0
- package/out/ui/packages/formText/components/FormText.styles.luau +33 -0
- package/out/ui/packages/formText/index.d.ts +4 -0
- package/out/ui/packages/formText/init.luau +6 -0
- package/out/ui/packages/icon/components/Icon.styles.luau +4 -4
- package/out/ui/packages/iconButton/components/IconButton.luau +7 -2
- package/out/ui/packages/iconButton/components/IconButton.styles.luau +7 -4
- 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 +11 -0
- package/out/ui/packages/init.luau +33 -0
- package/out/ui/packages/input/components/Input.d.ts +2 -0
- package/out/ui/packages/input/components/Input.luau +64 -27
- package/out/ui/packages/input/components/Input.styles.luau +6 -2
- 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/Stack.d.ts +12 -0
- package/out/ui/packages/layout/components/Stack.luau +49 -0
- package/out/ui/packages/layout/components/Stack.styles.d.ts +8 -0
- package/out/ui/packages/layout/components/Stack.styles.luau +72 -0
- package/out/ui/packages/layout/components/boxPad.d.ts +14 -0
- package/out/ui/packages/layout/components/boxPad.luau +59 -0
- package/out/ui/packages/layout/components/containerWidth.d.ts +2 -0
- package/out/ui/packages/layout/components/containerWidth.luau +17 -0
- package/out/ui/packages/layout/components/stackAlign.d.ts +8 -0
- package/out/ui/packages/layout/components/stackAlign.luau +29 -0
- package/out/ui/packages/layout/index.d.ts +10 -0
- package/out/ui/packages/layout/init.luau +4 -0
- package/out/ui/packages/link/components/Link.d.ts +11 -0
- package/out/ui/packages/link/components/Link.luau +83 -0
- package/out/ui/packages/link/components/Link.styles.d.ts +8 -0
- package/out/ui/packages/link/components/Link.styles.luau +59 -0
- package/out/ui/packages/link/index.d.ts +3 -0
- package/out/ui/packages/link/init.luau +5 -0
- package/out/ui/packages/listItem/components/ListItem.d.ts +1 -0
- package/out/ui/packages/listItem/components/ListItem.luau +5 -0
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +10 -5
- package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +2 -0
- package/out/ui/packages/loadingStroke/components/LoadingStroke.luau +23 -19
- package/out/ui/packages/menu/components/Menu.d.ts +3 -0
- package/out/ui/packages/menu/components/Menu.luau +48 -23
- package/out/ui/packages/menu/components/Menu.styles.luau +5 -1
- package/out/ui/packages/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/numberInput/components/NumberInput.d.ts +2 -0
- package/out/ui/packages/numberInput/components/NumberInput.luau +4 -0
- package/out/ui/packages/pagination/components/Pagination.d.ts +2 -0
- package/out/ui/packages/pagination/components/Pagination.luau +37 -21
- package/out/ui/packages/pagination/components/Pagination.styles.luau +9 -0
- package/out/ui/packages/pagination/components/pageRange.d.ts +2 -1
- package/out/ui/packages/pagination/components/pageRange.luau +91 -8
- package/out/ui/packages/pagination/index.d.ts +1 -0
- package/out/ui/packages/pagination/init.luau +1 -0
- package/out/ui/packages/paper/components/Paper.d.ts +1 -0
- package/out/ui/packages/paper/components/Paper.luau +8 -3
- 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/rating/components/Rating.d.ts +9 -0
- package/out/ui/packages/rating/components/Rating.luau +95 -0
- package/out/ui/packages/rating/components/Rating.styles.d.ts +4 -0
- package/out/ui/packages/rating/components/Rating.styles.luau +39 -0
- package/out/ui/packages/rating/index.d.ts +2 -0
- package/out/ui/packages/rating/init.luau +5 -0
- package/out/ui/packages/select/components/Select.d.ts +6 -0
- package/out/ui/packages/select/components/Select.luau +74 -27
- package/out/ui/packages/select/components/Select.styles.luau +3 -3
- package/out/ui/packages/sidebar/components/Sidebar.styles.luau +2 -2
- package/out/ui/packages/skeleton/components/Skeleton.luau +3 -2
- package/out/ui/packages/skeleton/components/Skeleton.styles.luau +7 -2
- package/out/ui/packages/skeleton/components/skeletonMotion.luau +1 -1
- 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/slider/components/Slider.d.ts +1 -0
- package/out/ui/packages/slider/components/Slider.luau +24 -1
- package/out/ui/packages/slider/components/Slider.styles.luau +8 -0
- package/out/ui/packages/slider/components/sliderMarks.d.ts +1 -0
- package/out/ui/packages/slider/components/sliderMarks.luau +37 -0
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +17 -0
- package/out/ui/packages/speedDial/components/SpeedDial.luau +92 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +2 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +26 -0
- package/out/ui/packages/speedDial/index.d.ts +2 -0
- package/out/ui/packages/speedDial/init.luau +5 -0
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stateMatrix.d.ts +2 -0
- package/out/ui/packages/stateMatrix.luau +1843 -1335
- package/out/ui/packages/switch/components/Switch.styles.luau +1 -1
- 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/out/ui/packages/toggleButton/components/ToggleButton.d.ts +17 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +126 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +5 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +58 -0
- package/out/ui/packages/toggleButton/index.d.ts +2 -0
- package/out/ui/packages/toggleButton/init.luau +7 -0
- package/out/ui/packages/treeView/components/TreeView.luau +3 -3
- package/out/ui/packages/treeView/components/TreeView.styles.luau +3 -3
- package/out/ui/packages/typography/components/Typography.styles.luau +4 -5
- package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +6 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.luau +32 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.d.ts +5 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.luau +26 -0
- package/out/ui/packages/virtualList/index.d.ts +2 -0
- package/out/ui/packages/virtualList/init.luau +1 -0
- package/package.json +2 -2
- package/out/theme/styles/utilities/interaction.d.ts +0 -13
- package/out/theme/styles/utilities/interaction.luau +0 -68
|
@@ -8,6 +8,7 @@ local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
|
8
8
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
9
9
|
local commitNumber = TS.import(script, script.Parent.Parent.Parent, "numberInput", "components", "numberValue").commitNumber
|
|
10
10
|
local useSliderStyles = TS.import(script, script.Parent, "Slider.styles").default
|
|
11
|
+
local sliderMarkValues = TS.import(script, script.Parent, "sliderMarks").sliderMarkValues
|
|
11
12
|
local _sliderNudge = TS.import(script, script.Parent, "sliderNudge")
|
|
12
13
|
local isSliderDrag = _sliderNudge.isSliderDrag
|
|
13
14
|
local isSliderMove = _sliderNudge.isSliderMove
|
|
@@ -23,6 +24,7 @@ local function Slider(props)
|
|
|
23
24
|
local step = _binding.step
|
|
24
25
|
local disabled = _binding.disabled
|
|
25
26
|
local size = _binding.size
|
|
27
|
+
local marks = _binding.marks
|
|
26
28
|
local className = _binding.className
|
|
27
29
|
local sx = _binding.sx
|
|
28
30
|
local id = _binding.id
|
|
@@ -36,6 +38,7 @@ local function Slider(props)
|
|
|
36
38
|
local knob = _binding_1.knob
|
|
37
39
|
local corner = _binding_1.corner
|
|
38
40
|
local stroke = _binding_1.stroke
|
|
41
|
+
local mark = _binding_1.mark
|
|
39
42
|
local active = canActivate(disabled)
|
|
40
43
|
local focused, setFocused = useState(false)
|
|
41
44
|
local hovering, setHovering = useState(false)
|
|
@@ -45,6 +48,8 @@ local function Slider(props)
|
|
|
45
48
|
local ratio = if max > min then (math.clamp(value, min, max) - min) / (max - min) else 0
|
|
46
49
|
local faded = disabled == true
|
|
47
50
|
local showFocus = focused and active
|
|
51
|
+
local markValues = sliderMarkValues(min, max, step, marks)
|
|
52
|
+
local span = max - min
|
|
48
53
|
local update = function(rbx, x)
|
|
49
54
|
local width = rbx.AbsoluteSize.X
|
|
50
55
|
if width <= 0 then
|
|
@@ -165,6 +170,24 @@ local function Slider(props)
|
|
|
165
170
|
setmetatable(_attributes_3, nil)
|
|
166
171
|
_condition_1 = React.createElement("uistroke", _attributes_3)
|
|
167
172
|
end
|
|
173
|
+
-- ▼ ReadonlyArray.map ▼
|
|
174
|
+
local _newValue = table.create(#markValues)
|
|
175
|
+
local _callback = function(markValue, index)
|
|
176
|
+
local markRatio = if span > 0 then (markValue - min) / span else 0
|
|
177
|
+
local _attributes_3 = {
|
|
178
|
+
key = `Mark-{index}`,
|
|
179
|
+
}
|
|
180
|
+
for _k, _v in mark do
|
|
181
|
+
_attributes_3[_k] = _v
|
|
182
|
+
end
|
|
183
|
+
_attributes_3.Position = UDim2.fromScale(markRatio, 0.5)
|
|
184
|
+
_attributes_3.BackgroundTransparency = if faded then 0.7 else 0.35
|
|
185
|
+
return React.createElement("frame", _attributes_3)
|
|
186
|
+
end
|
|
187
|
+
for _k, _v in markValues do
|
|
188
|
+
_newValue[_k] = _callback(_v, _k - 1, markValues)
|
|
189
|
+
end
|
|
190
|
+
-- ▲ ReadonlyArray.map ▲
|
|
168
191
|
local _attributes_3 = {
|
|
169
192
|
key = "Fill",
|
|
170
193
|
}
|
|
@@ -196,7 +219,7 @@ local function Slider(props)
|
|
|
196
219
|
_attributes_7.Thickness = 1
|
|
197
220
|
_condition_2 = React.createElement("uistroke", _attributes_7)
|
|
198
221
|
end
|
|
199
|
-
return React.createElement("frame", _attributes, React.createElement("frame", _attributes_1, _exp, _condition_1, _exp_1, React.createElement("frame", _attributes_5, _exp_2, _condition_2)))
|
|
222
|
+
return React.createElement("frame", _attributes, React.createElement("frame", _attributes_1, _exp, _condition_1, _newValue, _exp_1, React.createElement("frame", _attributes_5, _exp_2, _condition_2)))
|
|
200
223
|
end
|
|
201
224
|
local default = Slider
|
|
202
225
|
return {
|
|
@@ -39,6 +39,14 @@ local useSliderStyles = componentStyles("Slider", function(theme, _param)
|
|
|
39
39
|
Thickness = 2,
|
|
40
40
|
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
41
41
|
},
|
|
42
|
+
mark = {
|
|
43
|
+
Size = UDim2.new(0, 2, 0, metrics.sliderTrack + 4),
|
|
44
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
45
|
+
BackgroundColor3 = theme.palette.text.secondary,
|
|
46
|
+
BackgroundTransparency = 0.35,
|
|
47
|
+
BorderSizePixel = 0,
|
|
48
|
+
ZIndex = 1,
|
|
49
|
+
},
|
|
42
50
|
})
|
|
43
51
|
end)
|
|
44
52
|
local default = useSliderStyles
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sliderMarkValues(min: number, max: number, step: number | undefined, marks: boolean | ReadonlyArray<number> | undefined): number[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function sliderMarkValues(min, max, step, marks)
|
|
3
|
+
if marks == nil or marks == false then
|
|
4
|
+
return {}
|
|
5
|
+
end
|
|
6
|
+
if marks ~= true then
|
|
7
|
+
local out = {}
|
|
8
|
+
for _, value in marks do
|
|
9
|
+
if value >= min and value <= max then
|
|
10
|
+
table.insert(out, value)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
return out
|
|
14
|
+
end
|
|
15
|
+
local span = max - min
|
|
16
|
+
if span <= 0 then
|
|
17
|
+
return { min }
|
|
18
|
+
end
|
|
19
|
+
local increment = if step ~= nil and step > 0 then step else span
|
|
20
|
+
local out = {}
|
|
21
|
+
local value = min
|
|
22
|
+
local guard = 0
|
|
23
|
+
while value <= max + increment * 1e-9 and guard < 64 do
|
|
24
|
+
local _arg0 = math.clamp(value, min, max)
|
|
25
|
+
table.insert(out, _arg0)
|
|
26
|
+
value += increment
|
|
27
|
+
guard += 1
|
|
28
|
+
end
|
|
29
|
+
if out[#out] ~= max then
|
|
30
|
+
local _max = max
|
|
31
|
+
table.insert(out, _max)
|
|
32
|
+
end
|
|
33
|
+
return out
|
|
34
|
+
end
|
|
35
|
+
return {
|
|
36
|
+
sliderMarkValues = sliderMarkValues,
|
|
37
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { Icons } from "../../../enums/index";
|
|
3
|
+
export interface SpeedDialAction {
|
|
4
|
+
icon: Icons;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface SpeedDialProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
onOpenChange: (open: boolean) => void;
|
|
11
|
+
actions: SpeedDialAction[];
|
|
12
|
+
icon?: Icons;
|
|
13
|
+
openIcon?: Icons;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare function SpeedDial(props: CustomizedProps<Frame, SpeedDialProps>): JSX.Element;
|
|
17
|
+
export default SpeedDial;
|
|
@@ -0,0 +1,92 @@
|
|
|
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 Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
|
|
5
|
+
local Fab = TS.import(script, script.Parent.Parent.Parent, "fab").Fab
|
|
6
|
+
local useSpeedDialStyles = TS.import(script, script.Parent, "SpeedDial.styles").default
|
|
7
|
+
local function SpeedDial(props)
|
|
8
|
+
local _binding = props
|
|
9
|
+
local open = _binding.open
|
|
10
|
+
local onOpenChange = _binding.onOpenChange
|
|
11
|
+
local actions = _binding.actions
|
|
12
|
+
local icon = _binding.icon
|
|
13
|
+
if icon == nil then
|
|
14
|
+
icon = Icons.OpenBox
|
|
15
|
+
end
|
|
16
|
+
local openIcon = _binding.openIcon
|
|
17
|
+
if openIcon == nil then
|
|
18
|
+
openIcon = Icons.Close
|
|
19
|
+
end
|
|
20
|
+
local disabled = _binding.disabled
|
|
21
|
+
local className = _binding.className
|
|
22
|
+
local sx = _binding.sx
|
|
23
|
+
local id = _binding.id
|
|
24
|
+
local ref = _binding.ref
|
|
25
|
+
local styles = useSpeedDialStyles()
|
|
26
|
+
local _attributes = {}
|
|
27
|
+
local _condition = id
|
|
28
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
29
|
+
_condition = "SpeedDial"
|
|
30
|
+
end
|
|
31
|
+
_attributes.key = _condition
|
|
32
|
+
_attributes.ref = ref
|
|
33
|
+
for _k, _v in styles.root do
|
|
34
|
+
_attributes[_k] = _v
|
|
35
|
+
end
|
|
36
|
+
if className then
|
|
37
|
+
for _k, _v in className do
|
|
38
|
+
_attributes[_k] = _v
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
if sx then
|
|
42
|
+
for _k, _v in sx do
|
|
43
|
+
_attributes[_k] = _v
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
local _attributes_1 = table.clone(styles.list)
|
|
47
|
+
setmetatable(_attributes_1, nil)
|
|
48
|
+
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
49
|
+
local _condition_1 = open
|
|
50
|
+
if _condition_1 then
|
|
51
|
+
-- ▼ ReadonlyArray.map ▼
|
|
52
|
+
local _newValue = table.create(#actions)
|
|
53
|
+
local _callback = function(action, index)
|
|
54
|
+
return React.createElement(Fab, {
|
|
55
|
+
key = `Action-{index}`,
|
|
56
|
+
icon = action.icon,
|
|
57
|
+
size = "small",
|
|
58
|
+
disabled = disabled == true or action.disabled == true,
|
|
59
|
+
onClick = function()
|
|
60
|
+
local _result = action.onClick
|
|
61
|
+
if _result ~= nil then
|
|
62
|
+
_result()
|
|
63
|
+
end
|
|
64
|
+
onOpenChange(false)
|
|
65
|
+
end,
|
|
66
|
+
className = {
|
|
67
|
+
LayoutOrder = index,
|
|
68
|
+
},
|
|
69
|
+
})
|
|
70
|
+
end
|
|
71
|
+
for _k, _v in actions do
|
|
72
|
+
_newValue[_k] = _callback(_v, _k - 1, actions)
|
|
73
|
+
end
|
|
74
|
+
-- ▲ ReadonlyArray.map ▲
|
|
75
|
+
_condition_1 = _newValue
|
|
76
|
+
end
|
|
77
|
+
return React.createElement("frame", _attributes, _exp, _condition_1, React.createElement(Fab, {
|
|
78
|
+
key = "Main",
|
|
79
|
+
icon = if open then openIcon else icon,
|
|
80
|
+
disabled = disabled,
|
|
81
|
+
onClick = function()
|
|
82
|
+
return onOpenChange(not open)
|
|
83
|
+
end,
|
|
84
|
+
className = {
|
|
85
|
+
LayoutOrder = 1000,
|
|
86
|
+
},
|
|
87
|
+
}))
|
|
88
|
+
end
|
|
89
|
+
local default = SpeedDial
|
|
90
|
+
return {
|
|
91
|
+
default = default,
|
|
92
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 useSpeedDialStyles = componentStyles("SpeedDial", function(theme)
|
|
7
|
+
return createStyles({
|
|
8
|
+
root = {
|
|
9
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
10
|
+
Size = UDim2.fromScale(0, 0),
|
|
11
|
+
BackgroundTransparency = 1,
|
|
12
|
+
BorderSizePixel = 0,
|
|
13
|
+
},
|
|
14
|
+
list = {
|
|
15
|
+
FillDirection = Enum.FillDirection.Vertical,
|
|
16
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Center,
|
|
17
|
+
VerticalAlignment = Enum.VerticalAlignment.Bottom,
|
|
18
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
19
|
+
Padding = UDim.new(0, theme.padding.calc(1)),
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
end)
|
|
23
|
+
local default = useSpeedDialStyles
|
|
24
|
+
return {
|
|
25
|
+
default = default,
|
|
26
|
+
}
|
|
@@ -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.7 | 0.55 | 0.35;
|
|
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;
|