@rbxts/uiblox 0.2.0-alpha.1 → 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 +11 -8
- package/out/theme/constants/NumberConstants.d.ts +3 -1
- package/out/theme/constants/NumberConstants.luau +3 -0
- 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/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/autocomplete/components/Autocomplete.luau +8 -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/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/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 +1 -0
- package/out/ui/packages/fab/components/Fab.luau +57 -25
- package/out/ui/packages/fab/components/Fab.styles.d.ts +1 -0
- package/out/ui/packages/fab/components/Fab.styles.luau +26 -1
- 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 +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 +8 -0
- package/out/ui/packages/init.luau +24 -0
- package/out/ui/packages/input/components/Input.luau +1 -1
- 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/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 +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 +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 -1437
- package/out/ui/packages/switch/components/Switch.styles.luau +1 -1
- package/out/ui/packages/switch/components/switchLook.d.ts +3 -3
- 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/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
|
@@ -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";
|
|
@@ -48,8 +51,13 @@ export * from "./snackbar/index";
|
|
|
48
51
|
export * from "./table/index";
|
|
49
52
|
export * from "./autocomplete/index";
|
|
50
53
|
export * from "./fab/index";
|
|
54
|
+
export * from "./speedDial/index";
|
|
51
55
|
export * from "./appBar/index";
|
|
52
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";
|
|
53
61
|
export * from "./listItem/index";
|
|
54
62
|
export * from "./menu/index";
|
|
55
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
|
|
@@ -151,12 +160,27 @@ end
|
|
|
151
160
|
for _k, _v in TS.import(script, script, "fab") or {} do
|
|
152
161
|
exports[_k] = _v
|
|
153
162
|
end
|
|
163
|
+
for _k, _v in TS.import(script, script, "speedDial") or {} do
|
|
164
|
+
exports[_k] = _v
|
|
165
|
+
end
|
|
154
166
|
for _k, _v in TS.import(script, script, "appBar") or {} do
|
|
155
167
|
exports[_k] = _v
|
|
156
168
|
end
|
|
157
169
|
for _k, _v in TS.import(script, script, "bottomNavigation") or {} do
|
|
158
170
|
exports[_k] = _v
|
|
159
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
|
|
160
184
|
for _k, _v in TS.import(script, script, "listItem") or {} do
|
|
161
185
|
exports[_k] = _v
|
|
162
186
|
end
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 containerMaxPx = TS.import(script, script.Parent, "containerWidth").containerMaxPx
|
|
7
|
+
local useContainerStyles = componentStyles("Container", function(theme, _param)
|
|
8
|
+
local maxWidth = _param.maxWidth
|
|
9
|
+
local disableGutters = _param.disableGutters
|
|
10
|
+
local maxPx = containerMaxPx(maxWidth)
|
|
11
|
+
local gutter = theme.spacing.calc(2)
|
|
12
|
+
return createStyles({
|
|
13
|
+
root = {
|
|
14
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
15
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
16
|
+
BackgroundTransparency = 1,
|
|
17
|
+
BorderSizePixel = 0,
|
|
18
|
+
},
|
|
19
|
+
inner = {
|
|
20
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
21
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
22
|
+
Position = UDim2.new(0.5, 0, 0, 0),
|
|
23
|
+
AnchorPoint = Vector2.new(0.5, 0),
|
|
24
|
+
BackgroundTransparency = 1,
|
|
25
|
+
BorderSizePixel = 0,
|
|
26
|
+
},
|
|
27
|
+
constraint = {
|
|
28
|
+
MaxSize = if maxPx ~= nil then Vector2.new(maxPx, math.huge) else Vector2.new(math.huge, math.huge),
|
|
29
|
+
},
|
|
30
|
+
gutter = {
|
|
31
|
+
PaddingTop = UDim.new(0, 0),
|
|
32
|
+
PaddingBottom = UDim.new(0, 0),
|
|
33
|
+
PaddingLeft = UDim.new(0, if disableGutters == true then 0 else gutter),
|
|
34
|
+
PaddingRight = UDim.new(0, if disableGutters == true then 0 else gutter),
|
|
35
|
+
},
|
|
36
|
+
})
|
|
37
|
+
end)
|
|
38
|
+
local default = useContainerStyles
|
|
39
|
+
return {
|
|
40
|
+
default = default,
|
|
41
|
+
}
|
|
@@ -5,7 +5,7 @@ export interface GridProps {
|
|
|
5
5
|
fillDirection?: Enum.FillDirection;
|
|
6
6
|
fillDirectionMaxCells?: number;
|
|
7
7
|
sortOrder?: Enum.SortOrder;
|
|
8
|
-
startCorner
|
|
8
|
+
startCorner?: Enum.StartCorner;
|
|
9
9
|
horizontalAlignment?: Enum.HorizontalAlignment;
|
|
10
10
|
verticalAlignment?: Enum.VerticalAlignment;
|
|
11
11
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
2
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
+
import { StackAlign, StackDirection, StackJustify } from "./stackAlign";
|
|
4
|
+
export interface StackProps {
|
|
5
|
+
direction?: StackDirection;
|
|
6
|
+
spacing?: number;
|
|
7
|
+
alignItems?: StackAlign;
|
|
8
|
+
justifyContent?: StackJustify;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare function Stack(props: CustomizedProps<Frame, StackProps>): JSX.Element;
|
|
12
|
+
export default Stack;
|
|
@@ -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 useStackStyles = TS.import(script, script.Parent, "Stack.styles").default
|
|
5
|
+
local function Stack(props)
|
|
6
|
+
local _binding = props
|
|
7
|
+
local direction = _binding.direction
|
|
8
|
+
local spacing = _binding.spacing
|
|
9
|
+
local alignItems = _binding.alignItems
|
|
10
|
+
local justifyContent = _binding.justifyContent
|
|
11
|
+
local children = _binding.children
|
|
12
|
+
local className = _binding.className
|
|
13
|
+
local sx = _binding.sx
|
|
14
|
+
local id = _binding.id
|
|
15
|
+
local ref = _binding.ref
|
|
16
|
+
local styles = useStackStyles({
|
|
17
|
+
direction = direction,
|
|
18
|
+
spacing = spacing,
|
|
19
|
+
alignItems = alignItems,
|
|
20
|
+
justifyContent = justifyContent,
|
|
21
|
+
})
|
|
22
|
+
local _attributes = {}
|
|
23
|
+
local _condition = id
|
|
24
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
25
|
+
_condition = "Stack"
|
|
26
|
+
end
|
|
27
|
+
_attributes.key = _condition
|
|
28
|
+
_attributes.ref = ref
|
|
29
|
+
for _k, _v in styles.root do
|
|
30
|
+
_attributes[_k] = _v
|
|
31
|
+
end
|
|
32
|
+
if className then
|
|
33
|
+
for _k, _v in className do
|
|
34
|
+
_attributes[_k] = _v
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
if sx then
|
|
38
|
+
for _k, _v in sx do
|
|
39
|
+
_attributes[_k] = _v
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
local _attributes_1 = table.clone(styles.list)
|
|
43
|
+
setmetatable(_attributes_1, nil)
|
|
44
|
+
return React.createElement("frame", _attributes, React.createElement("uilistlayout", _attributes_1), children)
|
|
45
|
+
end
|
|
46
|
+
local default = Stack
|
|
47
|
+
return {
|
|
48
|
+
default = default,
|
|
49
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StackAlign, StackDirection, StackJustify } from "./stackAlign";
|
|
2
|
+
declare const useStackStyles: (props: {
|
|
3
|
+
direction?: StackDirection;
|
|
4
|
+
spacing?: number;
|
|
5
|
+
alignItems?: StackAlign;
|
|
6
|
+
justifyContent?: StackJustify;
|
|
7
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
8
|
+
export default useStackStyles;
|
|
@@ -0,0 +1,72 @@
|
|
|
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 _stackAlign = TS.import(script, script.Parent, "stackAlign")
|
|
7
|
+
local stackAlignKey = _stackAlign.stackAlignKey
|
|
8
|
+
local stackGap = _stackAlign.stackGap
|
|
9
|
+
local stackIsRow = _stackAlign.stackIsRow
|
|
10
|
+
local stackJustifyKey = _stackAlign.stackJustifyKey
|
|
11
|
+
local stackUsesFlex = _stackAlign.stackUsesFlex
|
|
12
|
+
local function horizontalAlign(key)
|
|
13
|
+
if key == "center" then
|
|
14
|
+
return Enum.HorizontalAlignment.Center
|
|
15
|
+
end
|
|
16
|
+
if key == "end" then
|
|
17
|
+
return Enum.HorizontalAlignment.Right
|
|
18
|
+
end
|
|
19
|
+
return Enum.HorizontalAlignment.Left
|
|
20
|
+
end
|
|
21
|
+
local function verticalAlign(key)
|
|
22
|
+
if key == "center" then
|
|
23
|
+
return Enum.VerticalAlignment.Center
|
|
24
|
+
end
|
|
25
|
+
if key == "end" then
|
|
26
|
+
return Enum.VerticalAlignment.Bottom
|
|
27
|
+
end
|
|
28
|
+
return Enum.VerticalAlignment.Top
|
|
29
|
+
end
|
|
30
|
+
local function mainFlex(justify)
|
|
31
|
+
if justify == "space-between" then
|
|
32
|
+
return Enum.UIFlexAlignment.SpaceBetween
|
|
33
|
+
end
|
|
34
|
+
if justify == "space-around" then
|
|
35
|
+
return Enum.UIFlexAlignment.SpaceAround
|
|
36
|
+
end
|
|
37
|
+
if justify == "space-evenly" then
|
|
38
|
+
return Enum.UIFlexAlignment.SpaceEvenly
|
|
39
|
+
end
|
|
40
|
+
return Enum.UIFlexAlignment.None
|
|
41
|
+
end
|
|
42
|
+
local useStackStyles = componentStyles("Stack", function(theme, _param)
|
|
43
|
+
local direction = _param.direction
|
|
44
|
+
local spacing = _param.spacing
|
|
45
|
+
local alignItems = _param.alignItems
|
|
46
|
+
local justifyContent = _param.justifyContent
|
|
47
|
+
local row = stackIsRow(direction)
|
|
48
|
+
local cross = stackAlignKey(alignItems)
|
|
49
|
+
local main = stackJustifyKey(justifyContent)
|
|
50
|
+
local flex = if stackUsesFlex(main) then mainFlex(main) else Enum.UIFlexAlignment.None
|
|
51
|
+
return createStyles({
|
|
52
|
+
root = {
|
|
53
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
54
|
+
Size = UDim2.fromScale(0, 0),
|
|
55
|
+
BackgroundTransparency = 1,
|
|
56
|
+
BorderSizePixel = 0,
|
|
57
|
+
},
|
|
58
|
+
list = {
|
|
59
|
+
FillDirection = if row then Enum.FillDirection.Horizontal else Enum.FillDirection.Vertical,
|
|
60
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
61
|
+
Padding = UDim.new(0, theme.spacing.calc(stackGap(spacing))),
|
|
62
|
+
HorizontalAlignment = if row then horizontalAlign(main) else horizontalAlign(cross),
|
|
63
|
+
VerticalAlignment = if row then verticalAlign(cross) else verticalAlign(main),
|
|
64
|
+
HorizontalFlex = if row then flex else Enum.UIFlexAlignment.None,
|
|
65
|
+
VerticalFlex = if row then Enum.UIFlexAlignment.None else flex,
|
|
66
|
+
},
|
|
67
|
+
})
|
|
68
|
+
end)
|
|
69
|
+
local default = useStackStyles
|
|
70
|
+
return {
|
|
71
|
+
default = default,
|
|
72
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type BoxPad = number | {
|
|
2
|
+
x?: number;
|
|
3
|
+
y?: number;
|
|
4
|
+
top?: number;
|
|
5
|
+
right?: number;
|
|
6
|
+
bottom?: number;
|
|
7
|
+
left?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function boxPadSides(padding?: BoxPad): {
|
|
10
|
+
top: number;
|
|
11
|
+
right: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
left: number;
|
|
14
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function boxPadSides(padding)
|
|
3
|
+
if padding == nil then
|
|
4
|
+
return {
|
|
5
|
+
top = 0,
|
|
6
|
+
right = 0,
|
|
7
|
+
bottom = 0,
|
|
8
|
+
left = 0,
|
|
9
|
+
}
|
|
10
|
+
end
|
|
11
|
+
local _padding = padding
|
|
12
|
+
if type(_padding) == "number" then
|
|
13
|
+
return {
|
|
14
|
+
top = padding,
|
|
15
|
+
right = padding,
|
|
16
|
+
bottom = padding,
|
|
17
|
+
left = padding,
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
local _condition = padding.x
|
|
21
|
+
if _condition == nil then
|
|
22
|
+
_condition = 0
|
|
23
|
+
end
|
|
24
|
+
local x = _condition
|
|
25
|
+
local _condition_1 = padding.y
|
|
26
|
+
if _condition_1 == nil then
|
|
27
|
+
_condition_1 = 0
|
|
28
|
+
end
|
|
29
|
+
local y = _condition_1
|
|
30
|
+
local _object = {}
|
|
31
|
+
local _left = "top"
|
|
32
|
+
local _condition_2 = padding.top
|
|
33
|
+
if _condition_2 == nil then
|
|
34
|
+
_condition_2 = y
|
|
35
|
+
end
|
|
36
|
+
_object[_left] = _condition_2
|
|
37
|
+
local _left_1 = "right"
|
|
38
|
+
local _condition_3 = padding.right
|
|
39
|
+
if _condition_3 == nil then
|
|
40
|
+
_condition_3 = x
|
|
41
|
+
end
|
|
42
|
+
_object[_left_1] = _condition_3
|
|
43
|
+
local _left_2 = "bottom"
|
|
44
|
+
local _condition_4 = padding.bottom
|
|
45
|
+
if _condition_4 == nil then
|
|
46
|
+
_condition_4 = y
|
|
47
|
+
end
|
|
48
|
+
_object[_left_2] = _condition_4
|
|
49
|
+
local _left_3 = "left"
|
|
50
|
+
local _condition_5 = padding.left
|
|
51
|
+
if _condition_5 == nil then
|
|
52
|
+
_condition_5 = x
|
|
53
|
+
end
|
|
54
|
+
_object[_left_3] = _condition_5
|
|
55
|
+
return _object
|
|
56
|
+
end
|
|
57
|
+
return {
|
|
58
|
+
boxPadSides = boxPadSides,
|
|
59
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local WIDTHS = {
|
|
3
|
+
xs = 444,
|
|
4
|
+
sm = 600,
|
|
5
|
+
md = 900,
|
|
6
|
+
lg = 1200,
|
|
7
|
+
xl = 1536,
|
|
8
|
+
}
|
|
9
|
+
local function containerMaxPx(maxWidth)
|
|
10
|
+
if maxWidth == false then
|
|
11
|
+
return nil
|
|
12
|
+
end
|
|
13
|
+
return WIDTHS[maxWidth or "lg"]
|
|
14
|
+
end
|
|
15
|
+
return {
|
|
16
|
+
containerMaxPx = containerMaxPx,
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type StackDirection = "row" | "column";
|
|
2
|
+
export type StackAlign = "start" | "center" | "end";
|
|
3
|
+
export type StackJustify = "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly";
|
|
4
|
+
export declare function stackIsRow(direction?: StackDirection): direction is "row";
|
|
5
|
+
export declare function stackGap(spacing?: number): number;
|
|
6
|
+
export declare function stackUsesFlex(justify?: StackJustify): justify is "space-between" | "space-around" | "space-evenly";
|
|
7
|
+
export declare function stackAlignKey(align?: StackAlign): StackAlign;
|
|
8
|
+
export declare function stackJustifyKey(justify?: StackJustify): StackJustify;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function stackIsRow(direction)
|
|
3
|
+
return direction == "row"
|
|
4
|
+
end
|
|
5
|
+
local function stackGap(spacing)
|
|
6
|
+
return if spacing == nil then 1 else spacing
|
|
7
|
+
end
|
|
8
|
+
local function stackUsesFlex(justify)
|
|
9
|
+
return justify == "space-between" or justify == "space-around" or justify == "space-evenly"
|
|
10
|
+
end
|
|
11
|
+
local function stackAlignKey(align)
|
|
12
|
+
if align == "center" or align == "end" then
|
|
13
|
+
return align
|
|
14
|
+
end
|
|
15
|
+
return "start"
|
|
16
|
+
end
|
|
17
|
+
local function stackJustifyKey(justify)
|
|
18
|
+
if justify == "center" or justify == "end" or justify == "space-between" or justify == "space-around" or justify == "space-evenly" then
|
|
19
|
+
return justify
|
|
20
|
+
end
|
|
21
|
+
return "start"
|
|
22
|
+
end
|
|
23
|
+
return {
|
|
24
|
+
stackIsRow = stackIsRow,
|
|
25
|
+
stackGap = stackGap,
|
|
26
|
+
stackUsesFlex = stackUsesFlex,
|
|
27
|
+
stackAlignKey = stackAlignKey,
|
|
28
|
+
stackJustifyKey = stackJustifyKey,
|
|
29
|
+
}
|
|
@@ -4,3 +4,13 @@ export * from "./components/Grid";
|
|
|
4
4
|
export { default as List } from "./components/List";
|
|
5
5
|
export { ListProps } from "./components/List";
|
|
6
6
|
export * from "./components/List";
|
|
7
|
+
export { default as Stack } from "./components/Stack";
|
|
8
|
+
export { StackProps } from "./components/Stack";
|
|
9
|
+
export { StackAlign, StackDirection, StackJustify } from "./components/stackAlign";
|
|
10
|
+
export { default as Box } from "./components/Box";
|
|
11
|
+
export { BoxProps } from "./components/Box";
|
|
12
|
+
export { BoxPad } from "./components/boxPad";
|
|
13
|
+
export { BoxBg } from "./components/Box.styles";
|
|
14
|
+
export { default as Container } from "./components/Container";
|
|
15
|
+
export { ContainerProps } from "./components/Container";
|
|
16
|
+
export { ContainerMaxWidth, containerMaxPx } from "./components/containerWidth";
|