@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
|
@@ -0,0 +1,84 @@
|
|
|
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 useImageListStyles = TS.import(script, script.Parent, "ImageList.styles").default
|
|
5
|
+
local function ImageList(props)
|
|
6
|
+
local _binding = props
|
|
7
|
+
local items = _binding.items
|
|
8
|
+
local cols = _binding.cols
|
|
9
|
+
local gap = _binding.gap
|
|
10
|
+
local itemSize = _binding.itemSize
|
|
11
|
+
local onItemActivated = _binding.onItemActivated
|
|
12
|
+
local className = _binding.className
|
|
13
|
+
local sx = _binding.sx
|
|
14
|
+
local id = _binding.id
|
|
15
|
+
local ref = _binding.ref
|
|
16
|
+
local styles = useImageListStyles({
|
|
17
|
+
cols = cols,
|
|
18
|
+
gap = gap,
|
|
19
|
+
itemSize = itemSize,
|
|
20
|
+
})
|
|
21
|
+
local _attributes = {}
|
|
22
|
+
local _condition = id
|
|
23
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
24
|
+
_condition = "ImageList"
|
|
25
|
+
end
|
|
26
|
+
_attributes.key = _condition
|
|
27
|
+
_attributes.ref = ref
|
|
28
|
+
for _k, _v in styles.root do
|
|
29
|
+
_attributes[_k] = _v
|
|
30
|
+
end
|
|
31
|
+
if className then
|
|
32
|
+
for _k, _v in className do
|
|
33
|
+
_attributes[_k] = _v
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
if sx then
|
|
37
|
+
for _k, _v in sx do
|
|
38
|
+
_attributes[_k] = _v
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
local _attributes_1 = table.clone(styles.grid)
|
|
42
|
+
setmetatable(_attributes_1, nil)
|
|
43
|
+
local _exp = React.createElement("uigridlayout", _attributes_1)
|
|
44
|
+
-- ▼ ReadonlyArray.map ▼
|
|
45
|
+
local _newValue = table.create(#items)
|
|
46
|
+
local _callback = function(item, index)
|
|
47
|
+
local _attributes_2 = {
|
|
48
|
+
key = `Tile-{index}`,
|
|
49
|
+
}
|
|
50
|
+
for _k, _v in styles.tile do
|
|
51
|
+
_attributes_2[_k] = _v
|
|
52
|
+
end
|
|
53
|
+
_attributes_2.LayoutOrder = index
|
|
54
|
+
_attributes_2.Event = {
|
|
55
|
+
Activated = function()
|
|
56
|
+
local _result = onItemActivated
|
|
57
|
+
if _result ~= nil then
|
|
58
|
+
_result = _result(index)
|
|
59
|
+
end
|
|
60
|
+
return _result
|
|
61
|
+
end,
|
|
62
|
+
}
|
|
63
|
+
local _attributes_3 = table.clone(styles.corner)
|
|
64
|
+
setmetatable(_attributes_3, nil)
|
|
65
|
+
local _exp_1 = React.createElement("uicorner", _attributes_3)
|
|
66
|
+
local _attributes_4 = {
|
|
67
|
+
key = "Image",
|
|
68
|
+
}
|
|
69
|
+
for _k, _v in styles.image do
|
|
70
|
+
_attributes_4[_k] = _v
|
|
71
|
+
end
|
|
72
|
+
_attributes_4.Image = item.src
|
|
73
|
+
return React.createElement("imagebutton", _attributes_2, _exp_1, React.createElement("imagelabel", _attributes_4))
|
|
74
|
+
end
|
|
75
|
+
for _k, _v in items do
|
|
76
|
+
_newValue[_k] = _callback(_v, _k - 1, items)
|
|
77
|
+
end
|
|
78
|
+
-- ▲ ReadonlyArray.map ▲
|
|
79
|
+
return React.createElement("frame", _attributes, _exp, _newValue)
|
|
80
|
+
end
|
|
81
|
+
local default = ImageList
|
|
82
|
+
return {
|
|
83
|
+
default = default,
|
|
84
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 _imageListLayout = TS.import(script, script.Parent, "imageListLayout")
|
|
7
|
+
local imageListCols = _imageListLayout.imageListCols
|
|
8
|
+
local imageListGap = _imageListLayout.imageListGap
|
|
9
|
+
local imageListItemSize = _imageListLayout.imageListItemSize
|
|
10
|
+
local useImageListStyles = componentStyles("ImageList", function(theme, _param)
|
|
11
|
+
local cols = _param.cols
|
|
12
|
+
local gap = _param.gap
|
|
13
|
+
local itemSize = _param.itemSize
|
|
14
|
+
local size = imageListItemSize(itemSize)
|
|
15
|
+
local pad = theme.spacing.calc(imageListGap(gap))
|
|
16
|
+
return createStyles({
|
|
17
|
+
root = {
|
|
18
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
19
|
+
Size = UDim2.fromScale(0, 0),
|
|
20
|
+
BackgroundTransparency = 1,
|
|
21
|
+
BorderSizePixel = 0,
|
|
22
|
+
},
|
|
23
|
+
grid = {
|
|
24
|
+
CellSize = UDim2.fromOffset(size, size),
|
|
25
|
+
CellPadding = UDim2.fromOffset(pad, pad),
|
|
26
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
27
|
+
FillDirectionMaxCells = imageListCols(cols),
|
|
28
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
29
|
+
StartCorner = Enum.StartCorner.TopLeft,
|
|
30
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Left,
|
|
31
|
+
VerticalAlignment = Enum.VerticalAlignment.Top,
|
|
32
|
+
},
|
|
33
|
+
tile = {
|
|
34
|
+
Size = UDim2.fromOffset(size, size),
|
|
35
|
+
BackgroundColor3 = theme.palette.surface.input,
|
|
36
|
+
BorderSizePixel = 0,
|
|
37
|
+
AutoButtonColor = false,
|
|
38
|
+
Text = "",
|
|
39
|
+
},
|
|
40
|
+
corner = {
|
|
41
|
+
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
42
|
+
},
|
|
43
|
+
image = {
|
|
44
|
+
Size = UDim2.fromScale(1, 1),
|
|
45
|
+
BackgroundTransparency = 1,
|
|
46
|
+
BorderSizePixel = 0,
|
|
47
|
+
ScaleType = Enum.ScaleType.Crop,
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
end)
|
|
51
|
+
local default = useImageListStyles
|
|
52
|
+
return {
|
|
53
|
+
default = default,
|
|
54
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function imageListCols(cols)
|
|
3
|
+
if cols == nil or cols < 1 then
|
|
4
|
+
return 3
|
|
5
|
+
end
|
|
6
|
+
return math.floor(cols)
|
|
7
|
+
end
|
|
8
|
+
local function imageListGap(gap)
|
|
9
|
+
if gap == nil or gap < 0 then
|
|
10
|
+
return 1
|
|
11
|
+
end
|
|
12
|
+
return gap
|
|
13
|
+
end
|
|
14
|
+
local function imageListItemSize(itemSize)
|
|
15
|
+
if itemSize == nil or itemSize < 1 then
|
|
16
|
+
return 96
|
|
17
|
+
end
|
|
18
|
+
return math.floor(itemSize)
|
|
19
|
+
end
|
|
20
|
+
return {
|
|
21
|
+
imageListCols = imageListCols,
|
|
22
|
+
imageListGap = imageListGap,
|
|
23
|
+
imageListItemSize = imageListItemSize,
|
|
24
|
+
}
|
|
@@ -3,8 +3,10 @@ export * from "./skeleton/index";
|
|
|
3
3
|
export * from "./divider/index";
|
|
4
4
|
export * from "./errorBoundary/index";
|
|
5
5
|
export * from "./icon/index";
|
|
6
|
+
export * from "./imageList/index";
|
|
6
7
|
export * from "./iconButton/index";
|
|
7
8
|
export * from "./input/index";
|
|
9
|
+
export * from "./formText/index";
|
|
8
10
|
export * from "./layout/index";
|
|
9
11
|
export * from "./preloader/index";
|
|
10
12
|
export * from "./progressBar/index";
|
|
@@ -30,6 +32,7 @@ export * from "./cframeEditor/index";
|
|
|
30
32
|
export * from "./enumPicker/index";
|
|
31
33
|
export * from "./popup/index";
|
|
32
34
|
export * from "./modal/index";
|
|
35
|
+
export * from "./backdrop/index";
|
|
33
36
|
export * from "./dialog/index";
|
|
34
37
|
export * from "./paper/index";
|
|
35
38
|
export * from "./card/index";
|
|
@@ -47,6 +50,14 @@ export * from "./accordion/index";
|
|
|
47
50
|
export * from "./snackbar/index";
|
|
48
51
|
export * from "./table/index";
|
|
49
52
|
export * from "./autocomplete/index";
|
|
53
|
+
export * from "./fab/index";
|
|
54
|
+
export * from "./speedDial/index";
|
|
55
|
+
export * from "./appBar/index";
|
|
56
|
+
export * from "./bottomNavigation/index";
|
|
57
|
+
export * from "./alert/index";
|
|
58
|
+
export * from "./toggleButton/index";
|
|
59
|
+
export * from "./link/index";
|
|
60
|
+
export * from "./rating/index";
|
|
50
61
|
export * from "./listItem/index";
|
|
51
62
|
export * from "./menu/index";
|
|
52
63
|
export * from "./motion/index";
|
|
@@ -16,12 +16,18 @@ end
|
|
|
16
16
|
for _k, _v in TS.import(script, script, "icon") or {} do
|
|
17
17
|
exports[_k] = _v
|
|
18
18
|
end
|
|
19
|
+
for _k, _v in TS.import(script, script, "imageList") or {} do
|
|
20
|
+
exports[_k] = _v
|
|
21
|
+
end
|
|
19
22
|
for _k, _v in TS.import(script, script, "iconButton") or {} do
|
|
20
23
|
exports[_k] = _v
|
|
21
24
|
end
|
|
22
25
|
for _k, _v in TS.import(script, script, "input") or {} do
|
|
23
26
|
exports[_k] = _v
|
|
24
27
|
end
|
|
28
|
+
for _k, _v in TS.import(script, script, "formText") or {} do
|
|
29
|
+
exports[_k] = _v
|
|
30
|
+
end
|
|
25
31
|
for _k, _v in TS.import(script, script, "layout") or {} do
|
|
26
32
|
exports[_k] = _v
|
|
27
33
|
end
|
|
@@ -97,6 +103,9 @@ end
|
|
|
97
103
|
for _k, _v in TS.import(script, script, "modal") or {} do
|
|
98
104
|
exports[_k] = _v
|
|
99
105
|
end
|
|
106
|
+
for _k, _v in TS.import(script, script, "backdrop") or {} do
|
|
107
|
+
exports[_k] = _v
|
|
108
|
+
end
|
|
100
109
|
for _k, _v in TS.import(script, script, "dialog") or {} do
|
|
101
110
|
exports[_k] = _v
|
|
102
111
|
end
|
|
@@ -148,6 +157,30 @@ end
|
|
|
148
157
|
for _k, _v in TS.import(script, script, "autocomplete") or {} do
|
|
149
158
|
exports[_k] = _v
|
|
150
159
|
end
|
|
160
|
+
for _k, _v in TS.import(script, script, "fab") or {} do
|
|
161
|
+
exports[_k] = _v
|
|
162
|
+
end
|
|
163
|
+
for _k, _v in TS.import(script, script, "speedDial") or {} do
|
|
164
|
+
exports[_k] = _v
|
|
165
|
+
end
|
|
166
|
+
for _k, _v in TS.import(script, script, "appBar") or {} do
|
|
167
|
+
exports[_k] = _v
|
|
168
|
+
end
|
|
169
|
+
for _k, _v in TS.import(script, script, "bottomNavigation") or {} do
|
|
170
|
+
exports[_k] = _v
|
|
171
|
+
end
|
|
172
|
+
for _k, _v in TS.import(script, script, "alert") or {} do
|
|
173
|
+
exports[_k] = _v
|
|
174
|
+
end
|
|
175
|
+
for _k, _v in TS.import(script, script, "toggleButton") or {} do
|
|
176
|
+
exports[_k] = _v
|
|
177
|
+
end
|
|
178
|
+
for _k, _v in TS.import(script, script, "link") or {} do
|
|
179
|
+
exports[_k] = _v
|
|
180
|
+
end
|
|
181
|
+
for _k, _v in TS.import(script, script, "rating") or {} do
|
|
182
|
+
exports[_k] = _v
|
|
183
|
+
end
|
|
151
184
|
for _k, _v in TS.import(script, script, "listItem") or {} do
|
|
152
185
|
exports[_k] = _v
|
|
153
186
|
end
|
|
@@ -5,6 +5,7 @@ export type DefaultInputComponent = Frame;
|
|
|
5
5
|
export interface InputProps {
|
|
6
6
|
color?: InputColor;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
loading?: boolean;
|
|
8
9
|
hasError?: boolean;
|
|
9
10
|
helperText?: string;
|
|
10
11
|
margin?: InputMargin;
|
|
@@ -15,6 +16,7 @@ export interface InputProps {
|
|
|
15
16
|
rounded?: boolean;
|
|
16
17
|
clearsTextOnFocus?: boolean;
|
|
17
18
|
size?: ControlSize;
|
|
19
|
+
reducedMotion?: boolean;
|
|
18
20
|
startAdornment?: React.Element;
|
|
19
21
|
endAdornment?: React.Element;
|
|
20
22
|
onTextChanged?: (text: string) => void;
|
|
@@ -5,7 +5,12 @@ local React = _react
|
|
|
5
5
|
local useEffect = _react.useEffect
|
|
6
6
|
local useRef = _react.useRef
|
|
7
7
|
local useState = _react.useState
|
|
8
|
-
local
|
|
8
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
9
|
+
local cx = _theme.cx
|
|
10
|
+
local useTheme = _theme.useTheme
|
|
11
|
+
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
12
|
+
local spinnerPixels = TS.import(script, script.Parent.Parent.Parent, "button", "components", "buttonLook").spinnerPixels
|
|
13
|
+
local CircularProgress = TS.import(script, script.Parent.Parent.Parent, "circularProgress").CircularProgress
|
|
9
14
|
local Divider = TS.import(script, script.Parent.Parent.Parent, "divider").Divider
|
|
10
15
|
local Orientations = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Orientations
|
|
11
16
|
local useInputStyles = TS.import(script, script.Parent, "Input.styles").default
|
|
@@ -31,14 +36,20 @@ local function Input(props)
|
|
|
31
36
|
if disabled == nil then
|
|
32
37
|
disabled = false
|
|
33
38
|
end
|
|
39
|
+
local loading = _binding.loading
|
|
40
|
+
if loading == nil then
|
|
41
|
+
loading = false
|
|
42
|
+
end
|
|
34
43
|
local hasError = _binding.hasError
|
|
35
44
|
if hasError == nil then
|
|
36
45
|
hasError = false
|
|
37
46
|
end
|
|
38
47
|
local rounded = _binding.rounded
|
|
39
48
|
if rounded == nil then
|
|
40
|
-
rounded =
|
|
49
|
+
rounded = true
|
|
41
50
|
end
|
|
51
|
+
local size = _binding.size
|
|
52
|
+
local reducedMotion = _binding.reducedMotion
|
|
42
53
|
local startAdornment = _binding.startAdornment
|
|
43
54
|
local endAdornment = _binding.endAdornment
|
|
44
55
|
local onTextChanged = _binding.onTextChanged
|
|
@@ -58,23 +69,27 @@ local function Input(props)
|
|
|
58
69
|
end
|
|
59
70
|
local draft, setDraft = useState(_condition)
|
|
60
71
|
local focused, setFocused = useState(false)
|
|
72
|
+
local _binding_1 = useTheme()
|
|
73
|
+
local theme = _binding_1.theme
|
|
74
|
+
local editable = canActivate(disabled, loading)
|
|
75
|
+
local endSlotContent = if loading then nil else endAdornment
|
|
61
76
|
local _object = table.clone(props)
|
|
62
77
|
setmetatable(_object, nil)
|
|
63
78
|
_object.focused = focused
|
|
64
|
-
local
|
|
65
|
-
local root =
|
|
66
|
-
local font =
|
|
67
|
-
local margin =
|
|
68
|
-
local shell =
|
|
69
|
-
local box =
|
|
70
|
-
local startSlot =
|
|
71
|
-
local endSlot =
|
|
72
|
-
local helper =
|
|
73
|
-
local errorColorFrame =
|
|
74
|
-
local errorColorText =
|
|
75
|
-
local divider =
|
|
76
|
-
local corner =
|
|
77
|
-
local stroke =
|
|
79
|
+
local _binding_2 = useInputStyles(_object)
|
|
80
|
+
local root = _binding_2.root
|
|
81
|
+
local font = _binding_2.font
|
|
82
|
+
local margin = _binding_2.margin
|
|
83
|
+
local shell = _binding_2.shell
|
|
84
|
+
local box = _binding_2.box
|
|
85
|
+
local startSlot = _binding_2.startSlot
|
|
86
|
+
local endSlot = _binding_2.endSlot
|
|
87
|
+
local helper = _binding_2.helper
|
|
88
|
+
local errorColorFrame = _binding_2.errorColorFrame
|
|
89
|
+
local errorColorText = _binding_2.errorColorText
|
|
90
|
+
local divider = _binding_2.divider
|
|
91
|
+
local corner = _binding_2.corner
|
|
92
|
+
local stroke = _binding_2.stroke
|
|
78
93
|
useEffect(function()
|
|
79
94
|
setDraft(function(current)
|
|
80
95
|
return syncInputDraft(focusedRef.current, text, current)
|
|
@@ -145,7 +160,8 @@ local function Input(props)
|
|
|
145
160
|
for _k, _v in box do
|
|
146
161
|
_attributes_3[_k] = _v
|
|
147
162
|
end
|
|
148
|
-
_attributes_3.Active =
|
|
163
|
+
_attributes_3.Active = editable
|
|
164
|
+
_attributes_3.TextEditable = editable
|
|
149
165
|
_attributes_3.Text = draft
|
|
150
166
|
_attributes_3.PlaceholderText = placeholder
|
|
151
167
|
for _k, _v in cx(hasError and errorColorText) do
|
|
@@ -153,6 +169,9 @@ local function Input(props)
|
|
|
153
169
|
end
|
|
154
170
|
_attributes_3.Change = {
|
|
155
171
|
Text = function(rbx)
|
|
172
|
+
if not editable then
|
|
173
|
+
return nil
|
|
174
|
+
end
|
|
156
175
|
setDraft(rbx.Text)
|
|
157
176
|
if focusedRef.current and onInput then
|
|
158
177
|
onInput(rbx.Text)
|
|
@@ -161,6 +180,9 @@ local function Input(props)
|
|
|
161
180
|
}
|
|
162
181
|
_attributes_3.Event = {
|
|
163
182
|
Focused = function()
|
|
183
|
+
if not editable then
|
|
184
|
+
return nil
|
|
185
|
+
end
|
|
164
186
|
focusedRef.current = true
|
|
165
187
|
entered.current = false
|
|
166
188
|
setFocused(true)
|
|
@@ -169,7 +191,7 @@ local function Input(props)
|
|
|
169
191
|
end
|
|
170
192
|
end,
|
|
171
193
|
ReturnPressedFromOnScreenKeyboard = function(rbx)
|
|
172
|
-
if entered.current or not onEnterPressed then
|
|
194
|
+
if not editable or entered.current or not onEnterPressed then
|
|
173
195
|
return nil
|
|
174
196
|
end
|
|
175
197
|
entered.current = true
|
|
@@ -179,10 +201,10 @@ local function Input(props)
|
|
|
179
201
|
focusedRef.current = false
|
|
180
202
|
setFocused(false)
|
|
181
203
|
local committed = rbx.Text
|
|
182
|
-
if onTextChanged then
|
|
204
|
+
if editable and onTextChanged then
|
|
183
205
|
onTextChanged(committed)
|
|
184
206
|
end
|
|
185
|
-
if enterPressed and not entered.current and onEnterPressed then
|
|
207
|
+
if editable and enterPressed and not entered.current and onEnterPressed then
|
|
186
208
|
onEnterPressed(committed)
|
|
187
209
|
end
|
|
188
210
|
entered.current = false
|
|
@@ -197,7 +219,7 @@ local function Input(props)
|
|
|
197
219
|
end,
|
|
198
220
|
}
|
|
199
221
|
local _exp = React.createElement("textbox", _attributes_3)
|
|
200
|
-
local _condition_5 =
|
|
222
|
+
local _condition_5 = loading
|
|
201
223
|
if _condition_5 then
|
|
202
224
|
local _attributes_4 = {
|
|
203
225
|
key = "End",
|
|
@@ -205,16 +227,31 @@ local function Input(props)
|
|
|
205
227
|
for _k, _v in endSlot do
|
|
206
228
|
_attributes_4[_k] = _v
|
|
207
229
|
end
|
|
208
|
-
_condition_5 = (React.createElement("frame", _attributes_4, adornmentAlign(),
|
|
230
|
+
_condition_5 = (React.createElement("frame", _attributes_4, adornmentAlign(), React.createElement(CircularProgress, {
|
|
231
|
+
size = spinnerPixels(size),
|
|
232
|
+
thickness = 2,
|
|
233
|
+
color = theme.palette.text.secondary,
|
|
234
|
+
reducedMotion = reducedMotion,
|
|
235
|
+
})))
|
|
236
|
+
end
|
|
237
|
+
local _condition_6 = endSlotContent ~= nil
|
|
238
|
+
if _condition_6 then
|
|
239
|
+
local _attributes_4 = {
|
|
240
|
+
key = "End",
|
|
241
|
+
}
|
|
242
|
+
for _k, _v in endSlot do
|
|
243
|
+
_attributes_4[_k] = _v
|
|
244
|
+
end
|
|
245
|
+
_condition_6 = (React.createElement("frame", _attributes_4, adornmentAlign(), endSlotContent))
|
|
209
246
|
end
|
|
210
|
-
local _exp_1 = React.createElement("frame", _attributes_2, _condition_2, _condition_3, _condition_4, _exp, _condition_5)
|
|
247
|
+
local _exp_1 = React.createElement("frame", _attributes_2, _condition_2, _condition_3, _condition_4, _exp, _condition_5, _condition_6)
|
|
211
248
|
local _exp_2 = variant == "standard" and (React.createElement(Divider, {
|
|
212
249
|
padding = 0,
|
|
213
250
|
orientation = Orientations.Horizontal,
|
|
214
251
|
className = cx(divider, hasError and errorColorFrame),
|
|
215
252
|
}))
|
|
216
|
-
local
|
|
217
|
-
if
|
|
253
|
+
local _condition_7 = helperText ~= nil
|
|
254
|
+
if _condition_7 then
|
|
218
255
|
local _attributes_4 = {
|
|
219
256
|
key = "HelperText",
|
|
220
257
|
}
|
|
@@ -228,9 +265,9 @@ local function Input(props)
|
|
|
228
265
|
_attributes_4[_k] = _v
|
|
229
266
|
end
|
|
230
267
|
_attributes_4.Text = helperText
|
|
231
|
-
|
|
268
|
+
_condition_7 = (React.createElement("textlabel", _attributes_4))
|
|
232
269
|
end
|
|
233
|
-
return React.createElement("frame", _attributes, React.createElement("frame", _attributes_1, _exp_1, _exp_2,
|
|
270
|
+
return React.createElement("frame", _attributes, React.createElement("frame", _attributes_1, _exp_1, _exp_2, _condition_7))
|
|
234
271
|
end
|
|
235
272
|
local default = Input
|
|
236
273
|
return {
|
|
@@ -20,7 +20,7 @@ local useInputStyles = componentStyles("Input", function(theme, _param)
|
|
|
20
20
|
end
|
|
21
21
|
local width = _param.width
|
|
22
22
|
if width == nil then
|
|
23
|
-
width = UDim.new(0, theme.spacing.calc(
|
|
23
|
+
width = UDim.new(0, theme.spacing.calc(12))
|
|
24
24
|
end
|
|
25
25
|
local helperText = _param.helperText
|
|
26
26
|
local clearsTextOnFocus = _param.clearsTextOnFocus
|
|
@@ -29,6 +29,10 @@ local useInputStyles = componentStyles("Input", function(theme, _param)
|
|
|
29
29
|
end
|
|
30
30
|
local startAdornment = _param.startAdornment
|
|
31
31
|
local endAdornment = _param.endAdornment
|
|
32
|
+
local loading = _param.loading
|
|
33
|
+
if loading == nil then
|
|
34
|
+
loading = false
|
|
35
|
+
end
|
|
32
36
|
local focused = _param.focused
|
|
33
37
|
if focused == nil then
|
|
34
38
|
focused = false
|
|
@@ -40,7 +44,7 @@ local useInputStyles = componentStyles("Input", function(theme, _param)
|
|
|
40
44
|
local size = _param.size
|
|
41
45
|
local metrics = controlMetrics(theme.density, size)
|
|
42
46
|
local hasStart = startAdornment ~= nil
|
|
43
|
-
local hasEnd = endAdornment ~= nil
|
|
47
|
+
local hasEnd = endAdornment ~= nil or loading
|
|
44
48
|
local icon = metrics.icon
|
|
45
49
|
local gap = theme.padding.calc(1)
|
|
46
50
|
local insets = inputInsets(hasStart, hasEnd, icon, gap)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
2
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
+
import { BoxPad } from "./boxPad";
|
|
4
|
+
import { BoxBg } from "./Box.styles";
|
|
5
|
+
export interface BoxProps {
|
|
6
|
+
padding?: BoxPad;
|
|
7
|
+
bgcolor?: BoxBg;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare function Box(props: CustomizedProps<Frame, BoxProps>): JSX.Element;
|
|
11
|
+
export default Box;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local useBoxStyles = TS.import(script, script.Parent, "Box.styles").default
|
|
5
|
+
local function Box(props)
|
|
6
|
+
local _binding = props
|
|
7
|
+
local padding = _binding.padding
|
|
8
|
+
local bgcolor = _binding.bgcolor
|
|
9
|
+
local children = _binding.children
|
|
10
|
+
local className = _binding.className
|
|
11
|
+
local sx = _binding.sx
|
|
12
|
+
local id = _binding.id
|
|
13
|
+
local ref = _binding.ref
|
|
14
|
+
local styles = useBoxStyles({
|
|
15
|
+
padding = padding,
|
|
16
|
+
bgcolor = bgcolor,
|
|
17
|
+
})
|
|
18
|
+
local _attributes = {}
|
|
19
|
+
local _condition = id
|
|
20
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
21
|
+
_condition = "Box"
|
|
22
|
+
end
|
|
23
|
+
_attributes.key = _condition
|
|
24
|
+
_attributes.ref = ref
|
|
25
|
+
for _k, _v in styles.root do
|
|
26
|
+
_attributes[_k] = _v
|
|
27
|
+
end
|
|
28
|
+
if className then
|
|
29
|
+
for _k, _v in className do
|
|
30
|
+
_attributes[_k] = _v
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
if sx then
|
|
34
|
+
for _k, _v in sx do
|
|
35
|
+
_attributes[_k] = _v
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
local _condition_1 = padding ~= nil
|
|
39
|
+
if _condition_1 then
|
|
40
|
+
local _attributes_1 = table.clone(styles.padding)
|
|
41
|
+
setmetatable(_attributes_1, nil)
|
|
42
|
+
_condition_1 = React.createElement("uipadding", _attributes_1)
|
|
43
|
+
end
|
|
44
|
+
return React.createElement("frame", _attributes, _condition_1, children)
|
|
45
|
+
end
|
|
46
|
+
local default = Box
|
|
47
|
+
return {
|
|
48
|
+
default = default,
|
|
49
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BoxPad } from "./boxPad";
|
|
2
|
+
export type BoxBg = "transparent" | "paper" | "elevated" | "input";
|
|
3
|
+
declare const useBoxStyles: (props: {
|
|
4
|
+
padding?: BoxPad;
|
|
5
|
+
bgcolor?: BoxBg;
|
|
6
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
7
|
+
export default useBoxStyles;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
|
+
local componentStyles = _theme.componentStyles
|
|
5
|
+
local createStyles = _theme.createStyles
|
|
6
|
+
local boxPadSides = TS.import(script, script.Parent, "boxPad").boxPadSides
|
|
7
|
+
local useBoxStyles = componentStyles("Box", function(theme, _param)
|
|
8
|
+
local padding = _param.padding
|
|
9
|
+
local bgcolor = _param.bgcolor
|
|
10
|
+
if bgcolor == nil then
|
|
11
|
+
bgcolor = "transparent"
|
|
12
|
+
end
|
|
13
|
+
local sides = boxPadSides(padding)
|
|
14
|
+
local fill = if bgcolor == "paper" then theme.palette.surface.paper elseif bgcolor == "elevated" then theme.palette.surface.elevated elseif bgcolor == "input" then theme.palette.surface.input else theme.palette.surface.paper
|
|
15
|
+
return createStyles({
|
|
16
|
+
root = {
|
|
17
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
18
|
+
Size = UDim2.fromScale(0, 0),
|
|
19
|
+
BackgroundColor3 = fill,
|
|
20
|
+
BackgroundTransparency = if bgcolor == "transparent" then 1 else 0,
|
|
21
|
+
BorderSizePixel = 0,
|
|
22
|
+
},
|
|
23
|
+
padding = {
|
|
24
|
+
PaddingTop = UDim.new(0, theme.spacing.calc(sides.top)),
|
|
25
|
+
PaddingRight = UDim.new(0, theme.spacing.calc(sides.right)),
|
|
26
|
+
PaddingBottom = UDim.new(0, theme.spacing.calc(sides.bottom)),
|
|
27
|
+
PaddingLeft = UDim.new(0, theme.spacing.calc(sides.left)),
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
end)
|
|
31
|
+
local default = useBoxStyles
|
|
32
|
+
return {
|
|
33
|
+
default = default,
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
2
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
+
import { ContainerMaxWidth } from "./containerWidth";
|
|
4
|
+
export interface ContainerProps {
|
|
5
|
+
maxWidth?: ContainerMaxWidth;
|
|
6
|
+
disableGutters?: boolean;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare function Container(props: CustomizedProps<Frame, ContainerProps>): JSX.Element;
|
|
10
|
+
export default Container;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local useContainerStyles = TS.import(script, script.Parent, "Container.styles").default
|
|
5
|
+
local function Container(props)
|
|
6
|
+
local _binding = props
|
|
7
|
+
local maxWidth = _binding.maxWidth
|
|
8
|
+
local disableGutters = _binding.disableGutters
|
|
9
|
+
local children = _binding.children
|
|
10
|
+
local className = _binding.className
|
|
11
|
+
local sx = _binding.sx
|
|
12
|
+
local id = _binding.id
|
|
13
|
+
local ref = _binding.ref
|
|
14
|
+
local styles = useContainerStyles({
|
|
15
|
+
maxWidth = maxWidth,
|
|
16
|
+
disableGutters = disableGutters,
|
|
17
|
+
})
|
|
18
|
+
local _attributes = {}
|
|
19
|
+
local _condition = id
|
|
20
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
21
|
+
_condition = "Container"
|
|
22
|
+
end
|
|
23
|
+
_attributes.key = _condition
|
|
24
|
+
_attributes.ref = ref
|
|
25
|
+
for _k, _v in styles.root do
|
|
26
|
+
_attributes[_k] = _v
|
|
27
|
+
end
|
|
28
|
+
if className then
|
|
29
|
+
for _k, _v in className do
|
|
30
|
+
_attributes[_k] = _v
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
if sx then
|
|
34
|
+
for _k, _v in sx do
|
|
35
|
+
_attributes[_k] = _v
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
local _attributes_1 = {
|
|
39
|
+
key = "Inner",
|
|
40
|
+
}
|
|
41
|
+
for _k, _v in styles.inner do
|
|
42
|
+
_attributes_1[_k] = _v
|
|
43
|
+
end
|
|
44
|
+
local _attributes_2 = table.clone(styles.constraint)
|
|
45
|
+
setmetatable(_attributes_2, nil)
|
|
46
|
+
local _exp = React.createElement("uisizeconstraint", _attributes_2)
|
|
47
|
+
local _attributes_3 = table.clone(styles.gutter)
|
|
48
|
+
setmetatable(_attributes_3, nil)
|
|
49
|
+
return React.createElement("frame", _attributes, React.createElement("frame", _attributes_1, _exp, React.createElement("uipadding", _attributes_3), children))
|
|
50
|
+
end
|
|
51
|
+
local default = Container
|
|
52
|
+
return {
|
|
53
|
+
default = default,
|
|
54
|
+
}
|