@rbxts/uiblox 0.2.0-alpha.3 → 0.2.0-alpha.30
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 +27 -109
- package/out/hooks/index.d.ts +1 -0
- package/out/hooks/init.luau +3 -0
- package/out/hooks/useBreakpoints.luau +2 -11
- package/out/hooks/viewportObserver.d.ts +10 -0
- package/out/hooks/viewportObserver.luau +75 -0
- package/out/theme/interfaces/theme/Theme.d.ts +15 -0
- package/out/theme/styles/utilities/componentStyles.luau +45 -3
- package/out/theme/styles/utilities/componentTheme.d.ts +15 -0
- package/out/theme/styles/utilities/index.d.ts +2 -0
- package/out/theme/styles/utilities/init.luau +7 -0
- package/out/theme/styles/utilities/resolveStyle.d.ts +10 -2
- package/out/theme/styles/utilities/resolveStyle.luau +7 -3
- package/out/theme/styles/utilities/resolveSx.d.ts +110 -0
- package/out/theme/styles/utilities/resolveSx.luau +479 -0
- package/out/theme/styles/utilities/styleCache.d.ts +2 -0
- package/out/theme/styles/utilities/styleCache.luau +9 -0
- package/out/ui/packages/accordion/components/Accordion.d.ts +2 -0
- package/out/ui/packages/accordion/components/Accordion.luau +46 -30
- 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 +48 -42
- 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 +47 -36
- package/out/ui/packages/appBar/components/AppBar.styles.d.ts +2 -0
- package/out/ui/packages/appBar/components/AppBar.styles.luau +16 -5
- package/out/ui/packages/assetField/components/AssetField.luau +12 -16
- 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 +27 -26
- 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 +51 -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 +32 -24
- 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 +20 -18
- 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 +67 -40
- 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/BrickColorPicker.luau +12 -16
- package/out/ui/packages/button/components/Button.luau +28 -22
- package/out/ui/packages/card/components/Card.d.ts +3 -1
- package/out/ui/packages/card/components/Card.luau +10 -0
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +75 -53
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +26 -9
- package/out/ui/packages/checkbox/components/Checkbox.luau +16 -16
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
- package/out/ui/packages/chip/components/Chip.d.ts +6 -1
- package/out/ui/packages/chip/components/Chip.luau +61 -17
- package/out/ui/packages/chip/components/Chip.styles.d.ts +6 -0
- package/out/ui/packages/chip/components/Chip.styles.luau +54 -9
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +29 -18
- package/out/ui/packages/colorPicker/components/ColorPicker.luau +16 -20
- package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +34 -20
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +34 -35
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +65 -62
- package/out/ui/packages/dialog/components/Dialog.d.ts +3 -2
- package/out/ui/packages/dialog/components/Dialog.luau +41 -21
- package/out/ui/packages/divider/components/Divider.d.ts +1 -0
- package/out/ui/packages/divider/components/Divider.luau +52 -17
- package/out/ui/packages/divider/components/Divider.styles.luau +32 -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 +3 -1
- package/out/ui/packages/drawer/components/Drawer.luau +71 -37
- 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 +79 -37
- package/out/ui/packages/fab/components/Fab.styles.d.ts +3 -0
- package/out/ui/packages/fab/components/Fab.styles.luau +39 -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/fontEditor/components/FontEditor.luau +12 -16
- package/out/ui/packages/formText/components/FormHelperText.d.ts +8 -0
- package/out/ui/packages/formText/components/FormHelperText.luau +40 -0
- package/out/ui/packages/formText/components/FormLabel.d.ts +9 -0
- package/out/ui/packages/formText/components/FormLabel.luau +42 -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/gradientEditor/components/GradientEditor.luau +56 -42
- package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +37 -4
- package/out/ui/packages/host/components/SxHost.d.ts +18 -0
- package/out/ui/packages/host/components/SxHost.luau +202 -0
- package/out/ui/packages/host/hostPaint.d.ts +11 -0
- package/out/ui/packages/host/hostPaint.luau +33 -0
- package/out/ui/packages/host/hostRules.d.ts +15 -0
- package/out/ui/packages/host/hostRules.luau +92 -0
- package/out/ui/packages/host/index.d.ts +3 -0
- package/out/ui/packages/host/init.luau +13 -0
- package/out/ui/packages/icon/components/Icon.luau +9 -16
- package/out/ui/packages/iconButton/components/IconButton.luau +22 -17
- 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 +93 -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 +8 -0
- package/out/ui/packages/init.luau +24 -0
- package/out/ui/packages/input/components/Input.d.ts +1 -0
- package/out/ui/packages/input/components/Input.luau +22 -19
- package/out/ui/packages/layout/components/Box.d.ts +11 -0
- package/out/ui/packages/layout/components/Box.luau +40 -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 +45 -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 +40 -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 +41 -19
- package/out/ui/packages/layout/components/List.luau +9 -16
- package/out/ui/packages/layout/components/Stack.d.ts +14 -0
- package/out/ui/packages/layout/components/Stack.luau +44 -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 +80 -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 +4 -1
- package/out/ui/packages/listItem/components/ListItem.luau +44 -4
- 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 +7 -1
- package/out/ui/packages/loadingStroke/components/LoadingStroke.luau +23 -19
- package/out/ui/packages/loadingStroke/components/loadingStrokeSx.d.ts +11 -0
- package/out/ui/packages/loadingStroke/components/loadingStrokeSx.luau +2 -0
- package/out/ui/packages/markdown/components/Markdown.d.ts +6 -0
- package/out/ui/packages/markdown/components/Markdown.luau +221 -0
- package/out/ui/packages/markdown/components/Markdown.styles.d.ts +2 -0
- package/out/ui/packages/markdown/components/Markdown.styles.luau +101 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.d.ts +16 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.luau +315 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +6 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +132 -0
- package/out/ui/packages/markdown/htmlToMarkdown.d.ts +2 -0
- package/out/ui/packages/markdown/htmlToMarkdown.luau +350 -0
- package/out/ui/packages/markdown/index.d.ts +8 -0
- package/out/ui/packages/markdown/init.luau +11 -0
- package/out/ui/packages/markdown/parseMarkdown.d.ts +42 -0
- package/out/ui/packages/markdown/parseMarkdown.luau +459 -0
- package/out/ui/packages/menu/components/Menu.d.ts +7 -1
- package/out/ui/packages/menu/components/Menu.luau +68 -26
- package/out/ui/packages/menu/components/Menu.styles.luau +5 -1
- package/out/ui/packages/modal/components/Modal.d.ts +2 -1
- package/out/ui/packages/modal/components/Modal.luau +79 -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 +16 -3
- package/out/ui/packages/numberInput/components/numberValue.d.ts +1 -0
- package/out/ui/packages/numberInput/components/numberValue.luau +45 -0
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +12 -16
- package/out/ui/packages/pagination/components/Pagination.d.ts +6 -1
- package/out/ui/packages/pagination/components/Pagination.luau +62 -38
- 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 +4 -2
- package/out/ui/packages/paper/components/Paper.luau +31 -9
- 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 +63 -38
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +21 -7
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +2 -0
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +14 -0
- package/out/ui/packages/popup/components/Popup.d.ts +2 -1
- package/out/ui/packages/popup/components/Popup.luau +35 -18
- package/out/ui/packages/popup/index.d.ts +1 -0
- package/out/ui/packages/popup/init.luau +1 -0
- package/out/ui/packages/preloader/components/Preloader.luau +9 -16
- package/out/ui/packages/progressBar/components/ProgressBar.luau +12 -16
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +16 -18
- 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 +97 -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/rayEditor/components/RayEditor.luau +12 -16
- package/out/ui/packages/rectEditor/components/RectEditor.luau +86 -43
- package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +30 -7
- package/out/ui/packages/select/components/Select.d.ts +5 -0
- package/out/ui/packages/select/components/Select.luau +61 -77
- package/out/ui/packages/select/components/Select.styles.luau +1 -1
- package/out/ui/packages/shadow/components/Shadow.d.ts +2 -1
- package/out/ui/packages/shadow/components/Shadow.luau +39 -17
- package/out/ui/packages/shadow/components/Shadow.styles.luau +7 -2
- package/out/ui/packages/sidebar/components/Sidebar.luau +9 -16
- package/out/ui/packages/skeleton/components/Skeleton.luau +22 -30
- 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 +47 -19
- 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 +97 -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 +13 -17
- 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 +872 -881
- package/out/ui/packages/stepper/components/Stepper.d.ts +1 -0
- package/out/ui/packages/stepper/components/Stepper.luau +16 -17
- 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 +21 -16
- package/out/ui/packages/switch/components/Switch.styles.d.ts +2 -0
- package/out/ui/packages/switch/components/Switch.styles.luau +6 -1
- package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
- package/out/ui/packages/table/components/Table.d.ts +1 -0
- package/out/ui/packages/table/components/Table.luau +15 -19
- 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 +24 -19
- 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 +41 -13
- package/out/ui/packages/toast/components/Toast.styles.luau +23 -5
- package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +21 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +129 -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/tooltip/components/Tooltip.luau +9 -16
- package/out/ui/packages/treeView/components/TreeView.luau +9 -16
- package/out/ui/packages/typography/components/Typography.luau +13 -14
- package/out/ui/packages/udimEditor/components/UDimEditor.luau +12 -16
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +12 -16
- package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +7 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.luau +43 -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/components/VirtualList.luau +9 -16
- 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/ui/packages/select/components/selectMotion.d.ts +0 -2
- package/out/ui/packages/select/components/selectMotion.luau +0 -12
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
2
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
+
import { FlexItemAlign } from "./flexItemMode";
|
|
4
|
+
export interface FlexItemProps {
|
|
5
|
+
grow?: number;
|
|
6
|
+
shrink?: number;
|
|
7
|
+
fill?: boolean;
|
|
8
|
+
alignSelf?: FlexItemAlign;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare function FlexItem(props: CustomizedProps<Frame, FlexItemProps>): JSX.Element;
|
|
12
|
+
export default FlexItem;
|
|
@@ -0,0 +1,40 @@
|
|
|
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 SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
5
|
+
local useFlexItemStyles = TS.import(script, script.Parent, "FlexItem.styles").default
|
|
6
|
+
local function FlexItem(props)
|
|
7
|
+
local _binding = props
|
|
8
|
+
local grow = _binding.grow
|
|
9
|
+
local shrink = _binding.shrink
|
|
10
|
+
local fill = _binding.fill
|
|
11
|
+
local alignSelf = _binding.alignSelf
|
|
12
|
+
local children = _binding.children
|
|
13
|
+
local className = _binding.className
|
|
14
|
+
local sx = _binding.sx
|
|
15
|
+
local id = _binding.id
|
|
16
|
+
local ref = _binding.ref
|
|
17
|
+
local styles = useFlexItemStyles({
|
|
18
|
+
grow = grow,
|
|
19
|
+
shrink = shrink,
|
|
20
|
+
fill = fill,
|
|
21
|
+
alignSelf = alignSelf,
|
|
22
|
+
})
|
|
23
|
+
local _attributes = {}
|
|
24
|
+
local _condition = id
|
|
25
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
26
|
+
_condition = "FlexItem"
|
|
27
|
+
end
|
|
28
|
+
_attributes.key = _condition
|
|
29
|
+
_attributes.hostRef = ref
|
|
30
|
+
_attributes.base = styles.root
|
|
31
|
+
_attributes.className = className
|
|
32
|
+
_attributes.sx = sx
|
|
33
|
+
local _attributes_1 = table.clone(styles.flex)
|
|
34
|
+
setmetatable(_attributes_1, nil)
|
|
35
|
+
return React.createElement(SxHost, _attributes, React.createElement("uiflexitem", _attributes_1), children)
|
|
36
|
+
end
|
|
37
|
+
local default = FlexItem
|
|
38
|
+
return {
|
|
39
|
+
default = default,
|
|
40
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FlexItemAlign } from "./flexItemMode";
|
|
2
|
+
declare const useFlexItemStyles: (props: {
|
|
3
|
+
grow?: number;
|
|
4
|
+
shrink?: number;
|
|
5
|
+
fill?: boolean;
|
|
6
|
+
alignSelf?: FlexItemAlign;
|
|
7
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
8
|
+
export default useFlexItemStyles;
|
|
@@ -0,0 +1,66 @@
|
|
|
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 _flexItemMode = TS.import(script, script.Parent, "flexItemMode")
|
|
7
|
+
local flexItemAlignKey = _flexItemMode.flexItemAlignKey
|
|
8
|
+
local flexItemGrowRatio = _flexItemMode.flexItemGrowRatio
|
|
9
|
+
local flexItemMode = _flexItemMode.flexItemMode
|
|
10
|
+
local flexItemShrinkRatio = _flexItemMode.flexItemShrinkRatio
|
|
11
|
+
local function modeEnum(mode)
|
|
12
|
+
if mode == "grow" then
|
|
13
|
+
return Enum.UIFlexMode.Grow
|
|
14
|
+
end
|
|
15
|
+
if mode == "shrink" then
|
|
16
|
+
return Enum.UIFlexMode.Shrink
|
|
17
|
+
end
|
|
18
|
+
if mode == "fill" then
|
|
19
|
+
return Enum.UIFlexMode.Fill
|
|
20
|
+
end
|
|
21
|
+
if mode == "custom" then
|
|
22
|
+
return Enum.UIFlexMode.Custom
|
|
23
|
+
end
|
|
24
|
+
return Enum.UIFlexMode.None
|
|
25
|
+
end
|
|
26
|
+
local function alignEnum(align)
|
|
27
|
+
if align == "start" then
|
|
28
|
+
return Enum.ItemLineAlignment.Start
|
|
29
|
+
end
|
|
30
|
+
if align == "center" then
|
|
31
|
+
return Enum.ItemLineAlignment.Center
|
|
32
|
+
end
|
|
33
|
+
if align == "end" then
|
|
34
|
+
return Enum.ItemLineAlignment.End
|
|
35
|
+
end
|
|
36
|
+
if align == "stretch" then
|
|
37
|
+
return Enum.ItemLineAlignment.Stretch
|
|
38
|
+
end
|
|
39
|
+
return Enum.ItemLineAlignment.Automatic
|
|
40
|
+
end
|
|
41
|
+
local useFlexItemStyles = componentStyles("FlexItem", function(_, _param)
|
|
42
|
+
local grow = _param.grow
|
|
43
|
+
local shrink = _param.shrink
|
|
44
|
+
local fill = _param.fill
|
|
45
|
+
local alignSelf = _param.alignSelf
|
|
46
|
+
local mode = flexItemMode(grow, shrink, fill)
|
|
47
|
+
local align = flexItemAlignKey(alignSelf)
|
|
48
|
+
return createStyles({
|
|
49
|
+
root = {
|
|
50
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
51
|
+
Size = UDim2.fromScale(0, 0),
|
|
52
|
+
BackgroundTransparency = 1,
|
|
53
|
+
BorderSizePixel = 0,
|
|
54
|
+
},
|
|
55
|
+
flex = {
|
|
56
|
+
FlexMode = modeEnum(mode),
|
|
57
|
+
GrowRatio = flexItemGrowRatio(grow),
|
|
58
|
+
ShrinkRatio = flexItemShrinkRatio(shrink),
|
|
59
|
+
ItemLineAlignment = alignEnum(align),
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
end)
|
|
63
|
+
local default = useFlexItemStyles
|
|
64
|
+
return {
|
|
65
|
+
default = default,
|
|
66
|
+
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { GridCorner } from "./gridProps";
|
|
2
3
|
export interface GridProps {
|
|
3
4
|
cellPadding?: UDim2;
|
|
4
5
|
cellSize?: UDim2;
|
|
6
|
+
gap?: number;
|
|
7
|
+
columns?: number;
|
|
8
|
+
maxColumns?: number;
|
|
5
9
|
fillDirection?: Enum.FillDirection;
|
|
6
10
|
fillDirectionMaxCells?: number;
|
|
7
11
|
sortOrder?: Enum.SortOrder;
|
|
8
|
-
startCorner
|
|
12
|
+
startCorner?: Enum.StartCorner | GridCorner;
|
|
9
13
|
horizontalAlignment?: Enum.HorizontalAlignment;
|
|
10
14
|
verticalAlignment?: Enum.VerticalAlignment;
|
|
11
15
|
}
|
|
@@ -4,7 +4,33 @@ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
4
4
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
5
5
|
local componentStyles = _theme.componentStyles
|
|
6
6
|
local createStyles = _theme.createStyles
|
|
7
|
-
local
|
|
7
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
8
|
+
local _gridProps = TS.import(script, script.Parent, "gridProps")
|
|
9
|
+
local gridCornerKey = _gridProps.gridCornerKey
|
|
10
|
+
local gridMaxCells = _gridProps.gridMaxCells
|
|
11
|
+
local function cornerEnum(corner)
|
|
12
|
+
if corner == nil then
|
|
13
|
+
return nil
|
|
14
|
+
end
|
|
15
|
+
local _corner = corner
|
|
16
|
+
if not (type(_corner) == "string") then
|
|
17
|
+
return corner
|
|
18
|
+
end
|
|
19
|
+
local key = gridCornerKey(corner)
|
|
20
|
+
if key == "top-right" then
|
|
21
|
+
return Enum.StartCorner.TopRight
|
|
22
|
+
end
|
|
23
|
+
if key == "bottom-left" then
|
|
24
|
+
return Enum.StartCorner.BottomLeft
|
|
25
|
+
end
|
|
26
|
+
if key == "bottom-right" then
|
|
27
|
+
return Enum.StartCorner.BottomRight
|
|
28
|
+
end
|
|
29
|
+
return Enum.StartCorner.TopLeft
|
|
30
|
+
end
|
|
31
|
+
local useGridStyles = componentStyles("Grid", function(theme, props)
|
|
32
|
+
local cells = gridMaxCells(props.columns, props.maxColumns, props.fillDirectionMaxCells)
|
|
33
|
+
local pad = if props.gap ~= nil then UDim2.fromOffset(theme.spacing.calc(props.gap), theme.spacing.calc(props.gap)) else props.cellPadding
|
|
8
34
|
return createStyles({
|
|
9
35
|
baseGrid = {
|
|
10
36
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -13,12 +39,12 @@ local useGridStyles = componentStyles("Grid", function(_, props)
|
|
|
13
39
|
BorderSizePixel = 0,
|
|
14
40
|
},
|
|
15
41
|
baseLayout = {
|
|
16
|
-
CellPadding =
|
|
42
|
+
CellPadding = pad,
|
|
17
43
|
CellSize = props.cellSize,
|
|
18
44
|
FillDirection = props.fillDirection,
|
|
19
|
-
FillDirectionMaxCells =
|
|
45
|
+
FillDirectionMaxCells = cells,
|
|
20
46
|
SortOrder = props.sortOrder,
|
|
21
|
-
StartCorner = props.startCorner,
|
|
47
|
+
StartCorner = cornerEnum(props.startCorner),
|
|
22
48
|
HorizontalAlignment = props.horizontalAlignment,
|
|
23
49
|
VerticalAlignment = props.verticalAlignment,
|
|
24
50
|
},
|
|
@@ -34,6 +60,9 @@ local function Grid(props)
|
|
|
34
60
|
if cellSize == nil then
|
|
35
61
|
cellSize = UDim2.fromOffset(100, 100)
|
|
36
62
|
end
|
|
63
|
+
local gap = _binding.gap
|
|
64
|
+
local columns = _binding.columns
|
|
65
|
+
local maxColumns = _binding.maxColumns
|
|
37
66
|
local fillDirection = _binding.fillDirection
|
|
38
67
|
if fillDirection == nil then
|
|
39
68
|
fillDirection = Enum.FillDirection.Horizontal
|
|
@@ -66,6 +95,9 @@ local function Grid(props)
|
|
|
66
95
|
local _binding_1 = useGridStyles({
|
|
67
96
|
cellPadding = cellPadding,
|
|
68
97
|
cellSize = cellSize,
|
|
98
|
+
gap = gap,
|
|
99
|
+
columns = columns,
|
|
100
|
+
maxColumns = maxColumns,
|
|
69
101
|
fillDirection = fillDirection,
|
|
70
102
|
fillDirectionMaxCells = fillDirectionMaxCells,
|
|
71
103
|
sortOrder = sortOrder,
|
|
@@ -81,27 +113,17 @@ local function Grid(props)
|
|
|
81
113
|
_condition = "Grid"
|
|
82
114
|
end
|
|
83
115
|
_attributes.key = _condition
|
|
84
|
-
_attributes.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if className then
|
|
89
|
-
for _k, _v in className do
|
|
90
|
-
_attributes[_k] = _v
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
if sx then
|
|
94
|
-
for _k, _v in sx do
|
|
95
|
-
_attributes[_k] = _v
|
|
96
|
-
end
|
|
97
|
-
end
|
|
116
|
+
_attributes.hostRef = ref
|
|
117
|
+
_attributes.base = baseGrid
|
|
118
|
+
_attributes.className = className
|
|
119
|
+
_attributes.sx = sx
|
|
98
120
|
local _attributes_1 = {
|
|
99
121
|
key = "GridLayout",
|
|
100
122
|
}
|
|
101
123
|
for _k, _v in baseLayout do
|
|
102
124
|
_attributes_1[_k] = _v
|
|
103
125
|
end
|
|
104
|
-
return React.createElement(
|
|
126
|
+
return React.createElement(SxHost, _attributes, React.createElement("uigridlayout", _attributes_1), children)
|
|
105
127
|
end
|
|
106
128
|
local default = Grid
|
|
107
129
|
return {
|
|
@@ -4,6 +4,7 @@ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
4
4
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
5
5
|
local componentStyles = _theme.componentStyles
|
|
6
6
|
local createStyles = _theme.createStyles
|
|
7
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
7
8
|
local useListStyles = componentStyles("List", function(_, props)
|
|
8
9
|
return createStyles({
|
|
9
10
|
baseList = {
|
|
@@ -75,33 +76,25 @@ local function List(props)
|
|
|
75
76
|
})
|
|
76
77
|
local baseList = _binding_1.baseList
|
|
77
78
|
local baseLayout = _binding_1.baseLayout
|
|
78
|
-
local _attributes = {
|
|
79
|
+
local _attributes = {
|
|
80
|
+
tag = "frame",
|
|
81
|
+
}
|
|
79
82
|
local _condition = id
|
|
80
83
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
81
84
|
_condition = "List"
|
|
82
85
|
end
|
|
83
86
|
_attributes.key = _condition
|
|
84
|
-
_attributes.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if className then
|
|
89
|
-
for _k, _v in className do
|
|
90
|
-
_attributes[_k] = _v
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
if sx then
|
|
94
|
-
for _k, _v in sx do
|
|
95
|
-
_attributes[_k] = _v
|
|
96
|
-
end
|
|
97
|
-
end
|
|
87
|
+
_attributes.hostRef = ref
|
|
88
|
+
_attributes.base = baseList
|
|
89
|
+
_attributes.className = className
|
|
90
|
+
_attributes.sx = sx
|
|
98
91
|
local _attributes_1 = {
|
|
99
92
|
key = "ListLayout",
|
|
100
93
|
}
|
|
101
94
|
for _k, _v in baseLayout do
|
|
102
95
|
_attributes_1[_k] = _v
|
|
103
96
|
end
|
|
104
|
-
return React.createElement(
|
|
97
|
+
return React.createElement(SxHost, _attributes, React.createElement("uilistlayout", _attributes_1), children)
|
|
105
98
|
end
|
|
106
99
|
local default = List
|
|
107
100
|
return {
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
gap?: number;
|
|
8
|
+
wrap?: boolean;
|
|
9
|
+
alignItems?: StackAlign;
|
|
10
|
+
justifyContent?: StackJustify;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare function Stack(props: CustomizedProps<Frame, StackProps>): JSX.Element;
|
|
14
|
+
export default Stack;
|
|
@@ -0,0 +1,44 @@
|
|
|
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 SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
5
|
+
local useStackStyles = TS.import(script, script.Parent, "Stack.styles").default
|
|
6
|
+
local function Stack(props)
|
|
7
|
+
local _binding = props
|
|
8
|
+
local direction = _binding.direction
|
|
9
|
+
local spacing = _binding.spacing
|
|
10
|
+
local gap = _binding.gap
|
|
11
|
+
local wrap = _binding.wrap
|
|
12
|
+
local alignItems = _binding.alignItems
|
|
13
|
+
local justifyContent = _binding.justifyContent
|
|
14
|
+
local children = _binding.children
|
|
15
|
+
local className = _binding.className
|
|
16
|
+
local sx = _binding.sx
|
|
17
|
+
local id = _binding.id
|
|
18
|
+
local ref = _binding.ref
|
|
19
|
+
local styles = useStackStyles({
|
|
20
|
+
direction = direction,
|
|
21
|
+
spacing = spacing,
|
|
22
|
+
gap = gap,
|
|
23
|
+
wrap = wrap,
|
|
24
|
+
alignItems = alignItems,
|
|
25
|
+
justifyContent = justifyContent,
|
|
26
|
+
})
|
|
27
|
+
local _attributes = {}
|
|
28
|
+
local _condition = id
|
|
29
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
30
|
+
_condition = "Stack"
|
|
31
|
+
end
|
|
32
|
+
_attributes.key = _condition
|
|
33
|
+
_attributes.hostRef = ref
|
|
34
|
+
_attributes.base = styles.root
|
|
35
|
+
_attributes.className = className
|
|
36
|
+
_attributes.sx = sx
|
|
37
|
+
local _attributes_1 = table.clone(styles.list)
|
|
38
|
+
setmetatable(_attributes_1, nil)
|
|
39
|
+
return React.createElement(SxHost, _attributes, React.createElement("uilistlayout", _attributes_1), children)
|
|
40
|
+
end
|
|
41
|
+
local default = Stack
|
|
42
|
+
return {
|
|
43
|
+
default = default,
|
|
44
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StackAlign, StackDirection, StackJustify } from "./stackAlign";
|
|
2
|
+
declare const useStackStyles: (props: {
|
|
3
|
+
direction?: StackDirection;
|
|
4
|
+
spacing?: number;
|
|
5
|
+
gap?: number;
|
|
6
|
+
wrap?: boolean;
|
|
7
|
+
alignItems?: StackAlign;
|
|
8
|
+
justifyContent?: StackJustify;
|
|
9
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
10
|
+
export default useStackStyles;
|
|
@@ -0,0 +1,101 @@
|
|
|
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 stackNeedsMainFill = _stackAlign.stackNeedsMainFill
|
|
12
|
+
local stackRootAutomaticSize = _stackAlign.stackRootAutomaticSize
|
|
13
|
+
local stackUsesFlex = _stackAlign.stackUsesFlex
|
|
14
|
+
local function horizontalAlign(key)
|
|
15
|
+
if key == "center" then
|
|
16
|
+
return Enum.HorizontalAlignment.Center
|
|
17
|
+
end
|
|
18
|
+
if key == "end" then
|
|
19
|
+
return Enum.HorizontalAlignment.Right
|
|
20
|
+
end
|
|
21
|
+
return Enum.HorizontalAlignment.Left
|
|
22
|
+
end
|
|
23
|
+
local function verticalAlign(key)
|
|
24
|
+
if key == "center" then
|
|
25
|
+
return Enum.VerticalAlignment.Center
|
|
26
|
+
end
|
|
27
|
+
if key == "end" then
|
|
28
|
+
return Enum.VerticalAlignment.Bottom
|
|
29
|
+
end
|
|
30
|
+
return Enum.VerticalAlignment.Top
|
|
31
|
+
end
|
|
32
|
+
local function mainFlex(justify)
|
|
33
|
+
if justify == "space-between" then
|
|
34
|
+
return Enum.UIFlexAlignment.SpaceBetween
|
|
35
|
+
end
|
|
36
|
+
if justify == "space-around" then
|
|
37
|
+
return Enum.UIFlexAlignment.SpaceAround
|
|
38
|
+
end
|
|
39
|
+
if justify == "space-evenly" then
|
|
40
|
+
return Enum.UIFlexAlignment.SpaceEvenly
|
|
41
|
+
end
|
|
42
|
+
return Enum.UIFlexAlignment.None
|
|
43
|
+
end
|
|
44
|
+
local function lineAlign(align)
|
|
45
|
+
if align == "center" then
|
|
46
|
+
return Enum.ItemLineAlignment.Center
|
|
47
|
+
end
|
|
48
|
+
if align == "end" then
|
|
49
|
+
return Enum.ItemLineAlignment.End
|
|
50
|
+
end
|
|
51
|
+
if align == "stretch" then
|
|
52
|
+
return Enum.ItemLineAlignment.Stretch
|
|
53
|
+
end
|
|
54
|
+
return Enum.ItemLineAlignment.Start
|
|
55
|
+
end
|
|
56
|
+
local function automaticSize(key)
|
|
57
|
+
if key == "X" then
|
|
58
|
+
return Enum.AutomaticSize.X
|
|
59
|
+
end
|
|
60
|
+
if key == "Y" then
|
|
61
|
+
return Enum.AutomaticSize.Y
|
|
62
|
+
end
|
|
63
|
+
return Enum.AutomaticSize.XY
|
|
64
|
+
end
|
|
65
|
+
local useStackStyles = componentStyles("Stack", function(theme, _param)
|
|
66
|
+
local direction = _param.direction
|
|
67
|
+
local spacing = _param.spacing
|
|
68
|
+
local gap = _param.gap
|
|
69
|
+
local wrap = _param.wrap
|
|
70
|
+
local alignItems = _param.alignItems
|
|
71
|
+
local justifyContent = _param.justifyContent
|
|
72
|
+
local row = stackIsRow(direction)
|
|
73
|
+
local cross = stackAlignKey(alignItems)
|
|
74
|
+
local main = stackJustifyKey(justifyContent)
|
|
75
|
+
local flex = if stackUsesFlex(main) then mainFlex(main) else Enum.UIFlexAlignment.None
|
|
76
|
+
local fillMain = stackNeedsMainFill(wrap, main)
|
|
77
|
+
local auto = stackRootAutomaticSize(row, fillMain)
|
|
78
|
+
return createStyles({
|
|
79
|
+
root = {
|
|
80
|
+
AutomaticSize = automaticSize(auto),
|
|
81
|
+
Size = if fillMain then if row then UDim2.new(1, 0, 0, 0) else UDim2.new(0, 0, 1, 0) else UDim2.fromScale(0, 0),
|
|
82
|
+
BackgroundTransparency = 1,
|
|
83
|
+
BorderSizePixel = 0,
|
|
84
|
+
},
|
|
85
|
+
list = {
|
|
86
|
+
FillDirection = if row then Enum.FillDirection.Horizontal else Enum.FillDirection.Vertical,
|
|
87
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
88
|
+
Padding = UDim.new(0, theme.spacing.calc(stackGap(spacing, gap))),
|
|
89
|
+
Wraps = wrap == true,
|
|
90
|
+
ItemLineAlignment = lineAlign(cross),
|
|
91
|
+
HorizontalAlignment = if row then horizontalAlign(main) else horizontalAlign(if cross == "stretch" then "start" else cross),
|
|
92
|
+
VerticalAlignment = if row then verticalAlign(if cross == "stretch" then "start" else cross) else verticalAlign(main),
|
|
93
|
+
HorizontalFlex = if row then flex else Enum.UIFlexAlignment.None,
|
|
94
|
+
VerticalFlex = if row then Enum.UIFlexAlignment.None else flex,
|
|
95
|
+
},
|
|
96
|
+
})
|
|
97
|
+
end)
|
|
98
|
+
local default = useStackStyles
|
|
99
|
+
return {
|
|
100
|
+
default = default,
|
|
101
|
+
}
|
|
@@ -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,6 @@
|
|
|
1
|
+
export type FlexItemAlign = "auto" | "start" | "center" | "end" | "stretch";
|
|
2
|
+
export type FlexItemModeName = "none" | "grow" | "shrink" | "fill" | "custom";
|
|
3
|
+
export declare function flexItemMode(grow?: number, shrink?: number, fill?: boolean): FlexItemModeName;
|
|
4
|
+
export declare function flexItemGrowRatio(grow?: number): number;
|
|
5
|
+
export declare function flexItemShrinkRatio(shrink?: number): number;
|
|
6
|
+
export declare function flexItemAlignKey(align?: FlexItemAlign): FlexItemAlign;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function flexItemMode(grow, shrink, fill)
|
|
3
|
+
if fill then
|
|
4
|
+
return "fill"
|
|
5
|
+
end
|
|
6
|
+
local g = grow ~= nil and grow > 0
|
|
7
|
+
local s = shrink ~= nil and shrink > 0
|
|
8
|
+
if g and s then
|
|
9
|
+
return "custom"
|
|
10
|
+
end
|
|
11
|
+
if g then
|
|
12
|
+
return "grow"
|
|
13
|
+
end
|
|
14
|
+
if s then
|
|
15
|
+
return "shrink"
|
|
16
|
+
end
|
|
17
|
+
return "none"
|
|
18
|
+
end
|
|
19
|
+
local function flexItemGrowRatio(grow)
|
|
20
|
+
return if grow == nil then 0 else grow
|
|
21
|
+
end
|
|
22
|
+
local function flexItemShrinkRatio(shrink)
|
|
23
|
+
return if shrink == nil then 0 else shrink
|
|
24
|
+
end
|
|
25
|
+
local function flexItemAlignKey(align)
|
|
26
|
+
if align == "start" or align == "center" or align == "end" or align == "stretch" then
|
|
27
|
+
return align
|
|
28
|
+
end
|
|
29
|
+
return "auto"
|
|
30
|
+
end
|
|
31
|
+
return {
|
|
32
|
+
flexItemMode = flexItemMode,
|
|
33
|
+
flexItemGrowRatio = flexItemGrowRatio,
|
|
34
|
+
flexItemShrinkRatio = flexItemShrinkRatio,
|
|
35
|
+
flexItemAlignKey = flexItemAlignKey,
|
|
36
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type GridCorner = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
2
|
+
export declare function gridMaxCells(columns?: number, maxColumns?: number, fillDirectionMaxCells?: number): number;
|
|
3
|
+
export declare function gridCornerKey(corner?: GridCorner): GridCorner;
|