@rbxts/uiblox 0.2.0-alpha.2 → 0.2.0-alpha.21
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 +2 -0
- package/out/theme/constants/NumberConstants.d.ts +2 -0
- package/out/theme/constants/NumberConstants.luau +3 -0
- 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/themes/DarkTheme.luau +4 -0
- package/out/theme/themes/LightTheme.luau +4 -0
- package/out/ui/packages/accordion/components/Accordion.d.ts +2 -0
- package/out/ui/packages/accordion/components/Accordion.luau +36 -16
- package/out/ui/packages/accordion/components/Accordion.styles.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.styles.luau +16 -4
- package/out/ui/packages/accordion/components/accordionOpen.d.ts +1 -0
- package/out/ui/packages/accordion/components/accordionOpen.luau +4 -0
- package/out/ui/packages/alert/components/Alert.d.ts +2 -0
- package/out/ui/packages/alert/components/Alert.luau +40 -27
- package/out/ui/packages/alert/components/Alert.styles.d.ts +2 -0
- package/out/ui/packages/alert/components/Alert.styles.luau +17 -8
- package/out/ui/packages/appBar/components/AppBar.d.ts +2 -1
- package/out/ui/packages/appBar/components/AppBar.luau +5 -0
- package/out/ui/packages/appBar/components/AppBar.styles.d.ts +2 -0
- package/out/ui/packages/appBar/components/AppBar.styles.luau +6 -2
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +8 -0
- package/out/ui/packages/avatar/components/Avatar.d.ts +2 -0
- package/out/ui/packages/avatar/components/Avatar.luau +20 -12
- package/out/ui/packages/avatar/components/Avatar.styles.d.ts +2 -0
- package/out/ui/packages/avatar/components/Avatar.styles.luau +5 -1
- 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.d.ts +3 -0
- package/out/ui/packages/badge/components/Badge.luau +23 -8
- package/out/ui/packages/badge/components/Badge.styles.d.ts +5 -1
- package/out/ui/packages/badge/components/Badge.styles.luau +20 -8
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +1 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +9 -3
- 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/breadcrumbs/components/Breadcrumbs.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +59 -25
- 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/card/components/Card.d.ts +1 -0
- package/out/ui/packages/card/components/Card.luau +2 -0
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +1 -1
- package/out/ui/packages/chip/components/Chip.d.ts +6 -1
- package/out/ui/packages/chip/components/Chip.luau +49 -2
- package/out/ui/packages/chip/components/Chip.styles.d.ts +6 -0
- package/out/ui/packages/chip/components/Chip.styles.luau +55 -10
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +13 -2
- 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/dialog/components/Dialog.d.ts +1 -1
- package/out/ui/packages/dialog/components/Dialog.luau +27 -18
- package/out/ui/packages/divider/components/Divider.d.ts +1 -0
- package/out/ui/packages/divider/components/Divider.luau +48 -0
- package/out/ui/packages/divider/components/Divider.styles.luau +29 -0
- package/out/ui/packages/divider/components/dividerLabel.d.ts +1 -0
- package/out/ui/packages/divider/components/dividerLabel.luau +10 -0
- package/out/ui/packages/drawer/components/Drawer.d.ts +1 -0
- package/out/ui/packages/drawer/components/Drawer.luau +4 -1
- package/out/ui/packages/drawer/components/Drawer.styles.d.ts +3 -1
- package/out/ui/packages/drawer/components/Drawer.styles.luau +3 -2
- package/out/ui/packages/fab/components/Fab.d.ts +3 -0
- package/out/ui/packages/fab/components/Fab.luau +62 -25
- package/out/ui/packages/fab/components/Fab.styles.d.ts +3 -0
- package/out/ui/packages/fab/components/Fab.styles.luau +33 -3
- package/out/ui/packages/fab/components/fabSize.d.ts +1 -0
- package/out/ui/packages/fab/components/fabSize.luau +4 -0
- package/out/ui/packages/fab/index.d.ts +1 -1
- package/out/ui/packages/fab/init.luau +1 -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/iconButton/components/IconButton.luau +7 -2
- package/out/ui/packages/iconButton/components/IconButton.styles.luau +3 -0
- package/out/ui/packages/imageList/components/ImageList.d.ts +14 -0
- package/out/ui/packages/imageList/components/ImageList.luau +100 -0
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +6 -0
- package/out/ui/packages/imageList/components/ImageList.styles.luau +73 -0
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +4 -0
- package/out/ui/packages/imageList/components/imageListLayout.luau +31 -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 +7 -0
- package/out/ui/packages/init.luau +21 -0
- package/out/ui/packages/input/components/Input.d.ts +1 -0
- package/out/ui/packages/input/components/Input.luau +8 -3
- 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/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 +14 -0
- package/out/ui/packages/layout/components/Stack.luau +53 -0
- package/out/ui/packages/layout/components/Stack.styles.d.ts +10 -0
- package/out/ui/packages/layout/components/Stack.styles.luau +101 -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/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 +10 -0
- package/out/ui/packages/layout/components/stackAlign.luau +43 -0
- package/out/ui/packages/layout/index.d.ts +14 -0
- package/out/ui/packages/layout/init.luau +5 -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 +2 -0
- package/out/ui/packages/listItem/components/ListItem.luau +22 -1
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +16 -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 +5 -0
- package/out/ui/packages/menu/components/Menu.luau +54 -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 +1 -0
- package/out/ui/packages/numberInput/components/NumberInput.luau +2 -0
- package/out/ui/packages/pagination/components/Pagination.d.ts +6 -1
- package/out/ui/packages/pagination/components/Pagination.luau +51 -23
- package/out/ui/packages/pagination/components/Pagination.styles.d.ts +6 -1
- package/out/ui/packages/pagination/components/Pagination.styles.luau +36 -4
- 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 +2 -1
- package/out/ui/packages/paper/components/Paper.luau +14 -3
- package/out/ui/packages/paper/components/Paper.styles.d.ts +1 -1
- package/out/ui/packages/paper/components/Paper.styles.luau +6 -0
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +1 -1
- 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 +5 -3
- 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 +11 -0
- package/out/ui/packages/rating/components/Rating.luau +101 -0
- package/out/ui/packages/rating/components/Rating.styles.d.ts +6 -0
- package/out/ui/packages/rating/components/Rating.styles.luau +44 -0
- package/out/ui/packages/rating/index.d.ts +2 -0
- package/out/ui/packages/rating/init.luau +5 -0
- package/out/ui/packages/rectEditor/components/RectEditor.luau +1 -1
- package/out/ui/packages/select/components/Select.d.ts +5 -0
- package/out/ui/packages/select/components/Select.luau +48 -24
- package/out/ui/packages/select/components/Select.styles.luau +1 -1
- package/out/ui/packages/skeleton/components/Skeleton.luau +4 -3
- 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 +3 -0
- package/out/ui/packages/slider/components/Slider.luau +32 -3
- package/out/ui/packages/slider/components/Slider.styles.d.ts +2 -0
- package/out/ui/packages/slider/components/Slider.styles.luau +14 -1
- 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/snackbar/components/Snackbar.d.ts +2 -0
- package/out/ui/packages/snackbar/components/Snackbar.luau +5 -0
- package/out/ui/packages/snackbar/components/snackbarAction.d.ts +1 -0
- package/out/ui/packages/snackbar/components/snackbarAction.luau +10 -0
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +19 -0
- package/out/ui/packages/speedDial/components/SpeedDial.luau +101 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +5 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +31 -0
- package/out/ui/packages/speedDial/index.d.ts +3 -0
- package/out/ui/packages/speedDial/init.luau +5 -0
- package/out/ui/packages/splitPane/components/SplitPane.luau +1 -1
- package/out/ui/packages/stateMatrix.d.ts +2 -0
- package/out/ui/packages/stateMatrix.luau +881 -253
- package/out/ui/packages/stepper/components/Stepper.d.ts +1 -0
- package/out/ui/packages/stepper/components/Stepper.luau +8 -2
- 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/Switch.d.ts +2 -0
- package/out/ui/packages/switch/components/Switch.luau +5 -0
- package/out/ui/packages/switch/components/Switch.styles.d.ts +2 -0
- package/out/ui/packages/switch/components/Switch.styles.luau +7 -2
- package/out/ui/packages/table/components/Table.d.ts +1 -0
- package/out/ui/packages/table/components/Table.luau +7 -4
- 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/tabs/components/Tabs.d.ts +3 -0
- package/out/ui/packages/tabs/components/Tabs.luau +13 -4
- package/out/ui/packages/tabs/components/Tabs.styles.d.ts +5 -1
- package/out/ui/packages/tabs/components/Tabs.styles.luau +26 -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.d.ts +2 -0
- package/out/ui/packages/toast/components/Toast.luau +26 -1
- package/out/ui/packages/toast/components/Toast.styles.luau +22 -4
- package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +21 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +137 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +9 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +69 -0
- package/out/ui/packages/toggleButton/index.d.ts +2 -0
- package/out/ui/packages/toggleButton/init.luau +7 -0
- package/out/ui/packages/typography/components/Typography.styles.luau +4 -5
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +1 -1
- 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
|
@@ -2,6 +2,74 @@
|
|
|
2
2
|
local function breadcrumbCurrent(index, count)
|
|
3
3
|
return count > 0 and index == count - 1
|
|
4
4
|
end
|
|
5
|
+
--* Collapse middle items when over maxItems (keep ends).
|
|
6
|
+
local function breadcrumbVisible(items, maxItems)
|
|
7
|
+
local count = #items
|
|
8
|
+
if maxItems == nil or maxItems < 1 or count <= maxItems then
|
|
9
|
+
local out = {}
|
|
10
|
+
do
|
|
11
|
+
local i = 0
|
|
12
|
+
local _shouldIncrement = false
|
|
13
|
+
while true do
|
|
14
|
+
if _shouldIncrement then
|
|
15
|
+
i += 1
|
|
16
|
+
else
|
|
17
|
+
_shouldIncrement = true
|
|
18
|
+
end
|
|
19
|
+
if not (i < count) then
|
|
20
|
+
break
|
|
21
|
+
end
|
|
22
|
+
local _arg0 = {
|
|
23
|
+
label = items[i + 1].label,
|
|
24
|
+
index = i,
|
|
25
|
+
}
|
|
26
|
+
table.insert(out, _arg0)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
return out
|
|
30
|
+
end
|
|
31
|
+
if maxItems == 1 then
|
|
32
|
+
return { {
|
|
33
|
+
label = items[count].label,
|
|
34
|
+
index = count - 1,
|
|
35
|
+
} }
|
|
36
|
+
end
|
|
37
|
+
local keepEnd = 1
|
|
38
|
+
local rawStart = maxItems - keepEnd - 1
|
|
39
|
+
local keepStart = if rawStart < 1 then 1 else rawStart
|
|
40
|
+
local out = {}
|
|
41
|
+
do
|
|
42
|
+
local i = 0
|
|
43
|
+
local _shouldIncrement = false
|
|
44
|
+
while true do
|
|
45
|
+
if _shouldIncrement then
|
|
46
|
+
i += 1
|
|
47
|
+
else
|
|
48
|
+
_shouldIncrement = true
|
|
49
|
+
end
|
|
50
|
+
if not (i < keepStart) then
|
|
51
|
+
break
|
|
52
|
+
end
|
|
53
|
+
local _arg0 = {
|
|
54
|
+
label = items[i + 1].label,
|
|
55
|
+
index = i,
|
|
56
|
+
}
|
|
57
|
+
table.insert(out, _arg0)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
table.insert(out, {
|
|
61
|
+
label = "…",
|
|
62
|
+
index = -1,
|
|
63
|
+
ellipsis = true,
|
|
64
|
+
})
|
|
65
|
+
local _arg0 = {
|
|
66
|
+
label = items[count].label,
|
|
67
|
+
index = count - 1,
|
|
68
|
+
}
|
|
69
|
+
table.insert(out, _arg0)
|
|
70
|
+
return out
|
|
71
|
+
end
|
|
5
72
|
return {
|
|
6
73
|
breadcrumbCurrent = breadcrumbCurrent,
|
|
74
|
+
breadcrumbVisible = breadcrumbVisible,
|
|
7
75
|
}
|
|
@@ -2,4 +2,7 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local exports = {}
|
|
4
4
|
exports.Breadcrumbs = TS.import(script, script, "components", "Breadcrumbs").default
|
|
5
|
+
local _breadcrumbItems = TS.import(script, script, "components", "breadcrumbItems")
|
|
6
|
+
exports.breadcrumbCurrent = _breadcrumbItems.breadcrumbCurrent
|
|
7
|
+
exports.breadcrumbVisible = _breadcrumbItems.breadcrumbVisible
|
|
5
8
|
return exports
|
|
@@ -4,6 +4,7 @@ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
4
4
|
local React = _react
|
|
5
5
|
local useEffect = _react.useEffect
|
|
6
6
|
local useState = _react.useState
|
|
7
|
+
local useReducedMotion = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "hooks").useReducedMotion
|
|
7
8
|
local useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").useTheme
|
|
8
9
|
local CircularProgress = TS.import(script, script.Parent.Parent.Parent, "circularProgress").CircularProgress
|
|
9
10
|
local LoadingStroke = TS.import(script, script.Parent.Parent.Parent, "loadingStroke").LoadingStroke
|
|
@@ -36,10 +37,10 @@ local function Button(props)
|
|
|
36
37
|
if loadingPosition == nil then
|
|
37
38
|
loadingPosition = "center"
|
|
38
39
|
end
|
|
39
|
-
local
|
|
40
|
+
local reducedProp = _binding.reducedMotion
|
|
40
41
|
local rounded = _binding.rounded
|
|
41
42
|
if rounded == nil then
|
|
42
|
-
rounded =
|
|
43
|
+
rounded = true
|
|
43
44
|
end
|
|
44
45
|
local hoveringDisabled = _binding.hoveringDisabled
|
|
45
46
|
if hoveringDisabled == nil then
|
|
@@ -69,12 +70,14 @@ local function Button(props)
|
|
|
69
70
|
local stroke = _binding_1.stroke
|
|
70
71
|
local _binding_2 = useTheme()
|
|
71
72
|
local theme = _binding_2.theme
|
|
73
|
+
local reducedMotion = useReducedMotion(reducedProp)
|
|
72
74
|
local hovering, setHovering = useState(false)
|
|
73
75
|
local focused, setFocused = useState(false)
|
|
74
76
|
local active = canActivate(disabled, loading)
|
|
75
77
|
local pressed = disabled or (not hoveringDisabled and active and (hovering or focused))
|
|
76
78
|
local face = buttonFace(text, loading, loadingLabel)
|
|
77
79
|
local place = spinnerPlace(loadingPosition)
|
|
80
|
+
local busy = loading or animating
|
|
78
81
|
local branded = (props.color or "primary") == "primary"
|
|
79
82
|
local spinnerColor = if variant == "contained" then if branded then theme.palette.primary.on else theme.palette.text.inverse elseif branded then theme.palette.primary.main else theme.palette.text.primary
|
|
80
83
|
useEffect(function()
|
|
@@ -186,14 +189,15 @@ local function Button(props)
|
|
|
186
189
|
end
|
|
187
190
|
end,
|
|
188
191
|
}
|
|
189
|
-
local _condition_1 = variant == "outlined" and not
|
|
192
|
+
local _condition_1 = variant == "outlined" and not busy
|
|
190
193
|
if _condition_1 then
|
|
191
194
|
local _attributes_1 = table.clone(stroke)
|
|
192
195
|
setmetatable(_attributes_1, nil)
|
|
193
196
|
_condition_1 = React.createElement("uistroke", _attributes_1)
|
|
194
197
|
end
|
|
195
|
-
local _exp =
|
|
196
|
-
animating =
|
|
198
|
+
local _exp = busy and React.createElement(LoadingStroke, {
|
|
199
|
+
animating = busy and not reducedMotion,
|
|
200
|
+
color = spinnerColor,
|
|
197
201
|
})
|
|
198
202
|
local _condition_2 = rounded
|
|
199
203
|
if _condition_2 then
|
|
@@ -11,6 +11,7 @@ local function Card(props)
|
|
|
11
11
|
if elevation == nil then
|
|
12
12
|
elevation = "flat"
|
|
13
13
|
end
|
|
14
|
+
local square = _binding.square
|
|
14
15
|
local actions = _binding.actions
|
|
15
16
|
local children = _binding.children
|
|
16
17
|
local styles = useCardStyles()
|
|
@@ -66,6 +67,7 @@ local function Card(props)
|
|
|
66
67
|
end
|
|
67
68
|
return React.createElement(Paper, {
|
|
68
69
|
elevation = elevation,
|
|
70
|
+
square = square,
|
|
69
71
|
}, React.createElement("frame", _attributes, _exp, _condition, _condition_1, _exp_1, _condition_2))
|
|
70
72
|
end
|
|
71
73
|
local default = Card
|
|
@@ -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 {
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { CustomizedProps } from "../../../../theme/index";
|
|
1
|
+
import { ControlSize, CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { ChipColor } from "./Chip.styles";
|
|
2
3
|
export interface ChipProps {
|
|
3
4
|
label: string;
|
|
4
5
|
selected?: boolean;
|
|
5
6
|
disabled?: boolean;
|
|
7
|
+
size?: ControlSize;
|
|
8
|
+
variant?: "filled" | "outlined";
|
|
9
|
+
color?: ChipColor;
|
|
6
10
|
onActivated?: () => void;
|
|
11
|
+
onDelete?: () => void;
|
|
7
12
|
}
|
|
8
13
|
declare function Chip(props: CustomizedProps<TextButton, ChipProps>): JSX.Element;
|
|
9
14
|
export default Chip;
|
|
@@ -1,20 +1,36 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
|
|
4
5
|
local useChipStyles = TS.import(script, script.Parent, "Chip.styles").default
|
|
5
6
|
local function Chip(props)
|
|
6
7
|
local _binding = props
|
|
7
8
|
local label = _binding.label
|
|
8
9
|
local selected = _binding.selected
|
|
9
10
|
local disabled = _binding.disabled
|
|
11
|
+
local size = _binding.size
|
|
12
|
+
local variant = _binding.variant
|
|
13
|
+
if variant == nil then
|
|
14
|
+
variant = "filled"
|
|
15
|
+
end
|
|
16
|
+
local color = _binding.color
|
|
17
|
+
if color == nil then
|
|
18
|
+
color = "default"
|
|
19
|
+
end
|
|
10
20
|
local onActivated = _binding.onActivated
|
|
21
|
+
local onDelete = _binding.onDelete
|
|
11
22
|
local className = _binding.className
|
|
12
23
|
local sx = _binding.sx
|
|
13
24
|
local id = _binding.id
|
|
14
25
|
local ref = _binding.ref
|
|
26
|
+
local deletable = onDelete ~= nil
|
|
15
27
|
local styles = useChipStyles({
|
|
16
28
|
selected = selected,
|
|
17
29
|
disabled = disabled,
|
|
30
|
+
deletable = deletable,
|
|
31
|
+
size = size,
|
|
32
|
+
variant = variant,
|
|
33
|
+
color = color,
|
|
18
34
|
})
|
|
19
35
|
local _attributes = {}
|
|
20
36
|
local _condition = id
|
|
@@ -36,7 +52,7 @@ local function Chip(props)
|
|
|
36
52
|
_attributes[_k] = _v
|
|
37
53
|
end
|
|
38
54
|
end
|
|
39
|
-
_attributes.Text = label
|
|
55
|
+
_attributes.Text = if deletable then "" else label
|
|
40
56
|
_attributes.Event = {
|
|
41
57
|
Activated = function()
|
|
42
58
|
if disabled ~= true then
|
|
@@ -55,7 +71,38 @@ local function Chip(props)
|
|
|
55
71
|
local _exp_1 = React.createElement("uicorner", _attributes_2)
|
|
56
72
|
local _attributes_3 = table.clone(styles.stroke)
|
|
57
73
|
setmetatable(_attributes_3, nil)
|
|
58
|
-
|
|
74
|
+
local _exp_2 = React.createElement("uistroke", _attributes_3)
|
|
75
|
+
local _condition_1 = deletable
|
|
76
|
+
if _condition_1 then
|
|
77
|
+
local _attributes_4 = table.clone(styles.row)
|
|
78
|
+
setmetatable(_attributes_4, nil)
|
|
79
|
+
local _exp_3 = React.createElement("uilistlayout", _attributes_4)
|
|
80
|
+
local _attributes_5 = {
|
|
81
|
+
key = "Label",
|
|
82
|
+
}
|
|
83
|
+
for _k, _v in styles.label do
|
|
84
|
+
_attributes_5[_k] = _v
|
|
85
|
+
end
|
|
86
|
+
_attributes_5.Text = label
|
|
87
|
+
local _exp_4 = React.createElement("textlabel", _attributes_5)
|
|
88
|
+
local _attributes_6 = {
|
|
89
|
+
key = "Delete",
|
|
90
|
+
}
|
|
91
|
+
for _k, _v in styles.delete do
|
|
92
|
+
_attributes_6[_k] = _v
|
|
93
|
+
end
|
|
94
|
+
_attributes_6.Image = tostring(Icons.Close)
|
|
95
|
+
_attributes_6.Active = disabled ~= true
|
|
96
|
+
_attributes_6.Event = {
|
|
97
|
+
Activated = function()
|
|
98
|
+
if disabled ~= true then
|
|
99
|
+
onDelete()
|
|
100
|
+
end
|
|
101
|
+
end,
|
|
102
|
+
}
|
|
103
|
+
_condition_1 = (React.createElement(React.Fragment, nil, _exp_3, _exp_4, React.createElement("imagebutton", _attributes_6)))
|
|
104
|
+
end
|
|
105
|
+
return React.createElement("textbutton", _attributes, _exp, _exp_1, _exp_2, _condition_1)
|
|
59
106
|
end
|
|
60
107
|
local default = Chip
|
|
61
108
|
return {
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { ControlSize } from "../../../../theme/index";
|
|
2
|
+
export type ChipColor = "default" | "primary";
|
|
1
3
|
declare const useChipStyles: (props: {
|
|
2
4
|
selected?: boolean;
|
|
3
5
|
disabled?: boolean;
|
|
6
|
+
deletable?: boolean;
|
|
7
|
+
size?: ControlSize;
|
|
8
|
+
variant?: "filled" | "outlined";
|
|
9
|
+
color?: ChipColor;
|
|
4
10
|
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
5
11
|
export default useChipStyles;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local componentStyles = _theme.componentStyles
|
|
5
|
+
local controlMetrics = _theme.controlMetrics
|
|
5
6
|
local createStyles = _theme.createStyles
|
|
6
7
|
local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
7
8
|
local selected = _param.selected
|
|
@@ -12,32 +13,76 @@ local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
|
12
13
|
if disabled == nil then
|
|
13
14
|
disabled = false
|
|
14
15
|
end
|
|
16
|
+
local deletable = _param.deletable
|
|
17
|
+
if deletable == nil then
|
|
18
|
+
deletable = false
|
|
19
|
+
end
|
|
20
|
+
local size = _param.size
|
|
21
|
+
local variant = _param.variant
|
|
22
|
+
if variant == nil then
|
|
23
|
+
variant = "filled"
|
|
24
|
+
end
|
|
25
|
+
local color = _param.color
|
|
26
|
+
if color == nil then
|
|
27
|
+
color = "default"
|
|
28
|
+
end
|
|
29
|
+
local metrics = controlMetrics(theme.density, size)
|
|
30
|
+
local padY = if size == "small" then 0.25 elseif size == "large" then 0.75 else 0.5
|
|
31
|
+
local padX = if size == "small" then 1 elseif size == "large" then 2 else 1.5
|
|
32
|
+
local deletePx = metrics.icon
|
|
33
|
+
local primary = color == "primary"
|
|
34
|
+
local ink = if disabled then theme.palette.text.disabled elseif primary then if variant == "outlined" then theme.palette.primary.main else theme.palette.primary.on else theme.palette.text.primary
|
|
15
35
|
return createStyles({
|
|
16
36
|
root = {
|
|
17
37
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
18
38
|
Size = UDim2.fromScale(0, 0),
|
|
19
|
-
BackgroundColor3 = if selected then theme.palette.action.selected else theme.palette.surface.input,
|
|
39
|
+
BackgroundColor3 = if primary and variant ~= "outlined" then theme.palette.primary.main elseif selected then theme.palette.action.selected else theme.palette.surface.input,
|
|
40
|
+
BackgroundTransparency = if variant == "outlined" and selected ~= true then 1 else 0,
|
|
20
41
|
BorderSizePixel = 0,
|
|
21
42
|
AutoButtonColor = false,
|
|
22
43
|
Active = not disabled,
|
|
23
44
|
Selectable = not disabled,
|
|
24
|
-
TextColor3 =
|
|
45
|
+
TextColor3 = ink,
|
|
25
46
|
Font = theme.typography.fontFamilies.default,
|
|
26
|
-
TextSize =
|
|
47
|
+
TextSize = metrics.font,
|
|
27
48
|
},
|
|
28
49
|
padding = {
|
|
29
|
-
PaddingTop = UDim.new(0, theme.padding.calc(
|
|
30
|
-
PaddingBottom = UDim.new(0, theme.padding.calc(
|
|
31
|
-
PaddingLeft = UDim.new(0, theme.padding.calc(
|
|
32
|
-
PaddingRight = UDim.new(0, theme.padding.calc(
|
|
50
|
+
PaddingTop = UDim.new(0, theme.padding.calc(padY)),
|
|
51
|
+
PaddingBottom = UDim.new(0, theme.padding.calc(padY)),
|
|
52
|
+
PaddingLeft = UDim.new(0, theme.padding.calc(padX)),
|
|
53
|
+
PaddingRight = UDim.new(0, theme.padding.calc(if deletable then 0.5 else padX)),
|
|
33
54
|
},
|
|
34
55
|
corner = {
|
|
35
|
-
CornerRadius = UDim.new(
|
|
56
|
+
CornerRadius = UDim.new(theme.shape.pillScale, 0),
|
|
36
57
|
},
|
|
37
58
|
stroke = {
|
|
38
|
-
Color = theme.palette.border,
|
|
59
|
+
Color = if primary then theme.palette.primary.main else theme.palette.border,
|
|
39
60
|
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
40
|
-
Transparency = if selected then 1 else 0,
|
|
61
|
+
Transparency = if variant == "outlined" then (if disabled then 0.5 else 0) elseif primary or selected then 1 else 0,
|
|
62
|
+
},
|
|
63
|
+
row = {
|
|
64
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
65
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
66
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
67
|
+
Padding = UDim.new(0, theme.padding.calc(0.5)),
|
|
68
|
+
},
|
|
69
|
+
label = {
|
|
70
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
71
|
+
Size = UDim2.fromScale(0, 0),
|
|
72
|
+
BackgroundTransparency = 1,
|
|
73
|
+
BorderSizePixel = 0,
|
|
74
|
+
TextColor3 = ink,
|
|
75
|
+
Font = theme.typography.fontFamilies.default,
|
|
76
|
+
TextSize = metrics.font,
|
|
77
|
+
LayoutOrder = 1,
|
|
78
|
+
},
|
|
79
|
+
delete = {
|
|
80
|
+
Size = UDim2.fromOffset(deletePx, deletePx),
|
|
81
|
+
BackgroundTransparency = 1,
|
|
82
|
+
BorderSizePixel = 0,
|
|
83
|
+
AutoButtonColor = false,
|
|
84
|
+
ImageColor3 = if disabled then theme.palette.text.disabled elseif primary and variant ~= "outlined" then theme.palette.primary.on else theme.palette.text.secondary,
|
|
85
|
+
LayoutOrder = 2,
|
|
41
86
|
},
|
|
42
87
|
})
|
|
43
88
|
end)
|
|
@@ -10,6 +10,7 @@ local _motion = TS.import(script, script.Parent.Parent.Parent, "motion")
|
|
|
10
10
|
local arcKeys = _motion.arcKeys
|
|
11
11
|
local loopProperty = _motion.loopProperty
|
|
12
12
|
local progressSpin = _motion.progressSpin
|
|
13
|
+
local spinArcKeys = _motion.spinArcKeys
|
|
13
14
|
local function CircularProgress(props)
|
|
14
15
|
local _binding = props
|
|
15
16
|
local value = _binding.value
|
|
@@ -38,7 +39,17 @@ local function CircularProgress(props)
|
|
|
38
39
|
local shown = if indeterminate then (if motion == "spin" then nil else 0.25) else value
|
|
39
40
|
local _result
|
|
40
41
|
if shown == nil then
|
|
41
|
-
|
|
42
|
+
local _exp = spinArcKeys()
|
|
43
|
+
-- ▼ ReadonlyArray.map ▼
|
|
44
|
+
local _newValue = table.create(#_exp)
|
|
45
|
+
local _callback = function(key)
|
|
46
|
+
return NumberSequenceKeypoint.new(key.time, key.transparency)
|
|
47
|
+
end
|
|
48
|
+
for _k, _v in _exp do
|
|
49
|
+
_newValue[_k] = _callback(_v, _k - 1, _exp)
|
|
50
|
+
end
|
|
51
|
+
-- ▲ ReadonlyArray.map ▲
|
|
52
|
+
_result = NumberSequence.new(_newValue)
|
|
42
53
|
else
|
|
43
54
|
local _exp = arcKeys(shown)
|
|
44
55
|
-- ▼ ReadonlyArray.map ▼
|
|
@@ -91,7 +102,7 @@ local function CircularProgress(props)
|
|
|
91
102
|
}), React.createElement("uistroke", {
|
|
92
103
|
Color = tint,
|
|
93
104
|
Thickness = thickness,
|
|
94
|
-
Transparency = if disabled then 0.
|
|
105
|
+
Transparency = if disabled then 0.85 else 0.82,
|
|
95
106
|
}), React.createElement("uistroke", {
|
|
96
107
|
Color = tint,
|
|
97
108
|
Thickness = thickness,
|
|
@@ -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
|
}
|
|
@@ -12,6 +12,8 @@ local function Dialog(props)
|
|
|
12
12
|
local children = _binding.children
|
|
13
13
|
local actions = _binding.actions
|
|
14
14
|
local styles = useDialogStyles()
|
|
15
|
+
local hasTitle = title ~= nil and title ~= ""
|
|
16
|
+
local hasActions = actions ~= nil
|
|
15
17
|
local _attributes = {
|
|
16
18
|
key = "Column",
|
|
17
19
|
}
|
|
@@ -21,34 +23,41 @@ local function Dialog(props)
|
|
|
21
23
|
local _attributes_1 = table.clone(styles.columnList)
|
|
22
24
|
setmetatable(_attributes_1, nil)
|
|
23
25
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
24
|
-
local
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
local _condition = hasTitle
|
|
27
|
+
if _condition then
|
|
28
|
+
local _attributes_2 = {
|
|
29
|
+
key = "Title",
|
|
30
|
+
}
|
|
31
|
+
for _k, _v in styles.title do
|
|
32
|
+
_attributes_2[_k] = _v
|
|
33
|
+
end
|
|
34
|
+
_attributes_2.Text = title
|
|
35
|
+
_condition = React.createElement("textlabel", _attributes_2)
|
|
29
36
|
end
|
|
30
|
-
_attributes_2
|
|
31
|
-
local _exp_1 = React.createElement("textlabel", _attributes_2)
|
|
32
|
-
local _attributes_3 = {
|
|
37
|
+
local _attributes_2 = {
|
|
33
38
|
key = "Body",
|
|
34
39
|
}
|
|
35
40
|
for _k, _v in styles.body do
|
|
36
|
-
|
|
41
|
+
_attributes_2[_k] = _v
|
|
37
42
|
end
|
|
38
|
-
local
|
|
39
|
-
local
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
local _exp_1 = React.createElement("frame", _attributes_2, children)
|
|
44
|
+
local _condition_1 = hasActions
|
|
45
|
+
if _condition_1 then
|
|
46
|
+
local _attributes_3 = {
|
|
47
|
+
key = "Actions",
|
|
48
|
+
}
|
|
49
|
+
for _k, _v in styles.actions do
|
|
50
|
+
_attributes_3[_k] = _v
|
|
51
|
+
end
|
|
52
|
+
local _attributes_4 = table.clone(styles.actionList)
|
|
53
|
+
setmetatable(_attributes_4, nil)
|
|
54
|
+
_condition_1 = (React.createElement("frame", _attributes_3, React.createElement("uilistlayout", _attributes_4), actions))
|
|
44
55
|
end
|
|
45
|
-
local _attributes_5 = table.clone(styles.actionList)
|
|
46
|
-
setmetatable(_attributes_5, nil)
|
|
47
56
|
return React.createElement(Modal, {
|
|
48
57
|
host = host,
|
|
49
58
|
open = open,
|
|
50
59
|
onClose = onClose,
|
|
51
|
-
}, React.createElement("frame", _attributes, _exp,
|
|
60
|
+
}, React.createElement("frame", _attributes, _exp, _condition, _exp_1, _condition_1))
|
|
52
61
|
end
|
|
53
62
|
local default = Dialog
|
|
54
63
|
return {
|
|
@@ -9,6 +9,7 @@ export interface DividerProps {
|
|
|
9
9
|
transparency?: number;
|
|
10
10
|
weight?: number;
|
|
11
11
|
anchorPoint?: Vector2;
|
|
12
|
+
text?: string;
|
|
12
13
|
}
|
|
13
14
|
declare function Divider<T extends DefaultDividerComponent>(props: CustomizedProps<T, DividerProps>): JSX.Element;
|
|
14
15
|
export default Divider;
|
|
@@ -1,15 +1,63 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local Orientations = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Orientations
|
|
5
|
+
local dividerLabel = TS.import(script, script.Parent, "dividerLabel").dividerLabel
|
|
4
6
|
local useDividerStyles = TS.import(script, script.Parent, "Divider.styles").default
|
|
5
7
|
local function Divider(props)
|
|
6
8
|
local _binding = props
|
|
9
|
+
local text = _binding.text
|
|
10
|
+
local orientation = _binding.orientation
|
|
7
11
|
local className = _binding.className
|
|
8
12
|
local sx = _binding.sx
|
|
9
13
|
local id = _binding.id
|
|
10
14
|
local ref = _binding.ref
|
|
11
15
|
local _binding_1 = useDividerStyles(props)
|
|
12
16
|
local root = _binding_1.root
|
|
17
|
+
local shell = _binding_1.shell
|
|
18
|
+
local line = _binding_1.line
|
|
19
|
+
local caption = _binding_1.caption
|
|
20
|
+
local captionPad = _binding_1.captionPad
|
|
21
|
+
local label = dividerLabel(text)
|
|
22
|
+
if label ~= nil and orientation ~= Orientations.Vertical then
|
|
23
|
+
local _attributes = {}
|
|
24
|
+
local _condition = id
|
|
25
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
26
|
+
_condition = "Divider"
|
|
27
|
+
end
|
|
28
|
+
_attributes.key = _condition
|
|
29
|
+
_attributes.ref = ref
|
|
30
|
+
for _k, _v in shell do
|
|
31
|
+
_attributes[_k] = _v
|
|
32
|
+
end
|
|
33
|
+
if className ~= 0 and className == className and className ~= "" and className then
|
|
34
|
+
for _k, _v in className do
|
|
35
|
+
_attributes[_k] = _v
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
if sx ~= 0 and sx == sx and sx ~= "" and sx then
|
|
39
|
+
for _k, _v in sx do
|
|
40
|
+
_attributes[_k] = _v
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
local _attributes_1 = {
|
|
44
|
+
key = "Line",
|
|
45
|
+
}
|
|
46
|
+
for _k, _v in line do
|
|
47
|
+
_attributes_1[_k] = _v
|
|
48
|
+
end
|
|
49
|
+
local _exp = React.createElement("frame", _attributes_1)
|
|
50
|
+
local _attributes_2 = {
|
|
51
|
+
key = "Label",
|
|
52
|
+
}
|
|
53
|
+
for _k, _v in caption do
|
|
54
|
+
_attributes_2[_k] = _v
|
|
55
|
+
end
|
|
56
|
+
_attributes_2.Text = label
|
|
57
|
+
local _attributes_3 = table.clone(captionPad)
|
|
58
|
+
setmetatable(_attributes_3, nil)
|
|
59
|
+
return React.createElement("frame", _attributes, _exp, React.createElement("textlabel", _attributes_2, React.createElement("uipadding", _attributes_3)))
|
|
60
|
+
end
|
|
13
61
|
local _attributes = {}
|
|
14
62
|
local _condition = id
|
|
15
63
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
@@ -32,6 +32,35 @@ local useDividerStyles = componentStyles("Divider", function(theme, props)
|
|
|
32
32
|
anchorPoint = Vector2.new(0, 0)
|
|
33
33
|
end
|
|
34
34
|
return createStyles({
|
|
35
|
+
shell = {
|
|
36
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(2)),
|
|
37
|
+
BackgroundTransparency = 1,
|
|
38
|
+
BorderSizePixel = 0,
|
|
39
|
+
},
|
|
40
|
+
line = {
|
|
41
|
+
Size = UDim2.new(1, 0, 0, weight),
|
|
42
|
+
Position = UDim2.new(0, 0, 0.5, 0),
|
|
43
|
+
AnchorPoint = Vector2.new(0, 0.5),
|
|
44
|
+
BackgroundColor3 = color,
|
|
45
|
+
BackgroundTransparency = transparency,
|
|
46
|
+
BorderSizePixel = 0,
|
|
47
|
+
},
|
|
48
|
+
caption = {
|
|
49
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
50
|
+
Size = UDim2.fromScale(0, 0),
|
|
51
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
52
|
+
Position = UDim2.new(0.5, 0, 0.5, 0),
|
|
53
|
+
BackgroundColor3 = theme.palette.surface.canvas,
|
|
54
|
+
BorderSizePixel = 0,
|
|
55
|
+
Font = theme.typography.fontFamilies.default,
|
|
56
|
+
TextSize = theme.typography.fontSizes.caption,
|
|
57
|
+
TextColor3 = theme.palette.text.secondary,
|
|
58
|
+
ZIndex = 2,
|
|
59
|
+
},
|
|
60
|
+
captionPad = {
|
|
61
|
+
PaddingLeft = UDim.new(0, theme.padding.calc(1)),
|
|
62
|
+
PaddingRight = UDim.new(0, theme.padding.calc(1)),
|
|
63
|
+
},
|
|
35
64
|
root = {
|
|
36
65
|
Position = position or UDim2.new(0, 0, 0, 0),
|
|
37
66
|
Size = UDim2.new(if orientation == Orientations.Horizontal then 1 else 0, if orientation == Orientations.Horizontal then -padding * 2 else weight, if orientation == Orientations.Vertical then 1 else 0, if orientation == Orientations.Vertical then -padding * 2 else weight),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dividerLabel(text?: string): string | undefined;
|