@rbxts/uiblox 0.2.0-alpha.28 → 0.2.0-alpha.3
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 +109 -27
- package/out/hooks/index.d.ts +0 -1
- package/out/hooks/init.luau +0 -3
- package/out/hooks/useBreakpoints.luau +11 -2
- package/out/theme/interfaces/theme/Theme.d.ts +0 -15
- package/out/theme/styles/utilities/componentStyles.luau +3 -45
- package/out/theme/styles/utilities/componentTheme.d.ts +0 -15
- package/out/theme/styles/utilities/index.d.ts +0 -2
- package/out/theme/styles/utilities/init.luau +0 -7
- package/out/theme/styles/utilities/resolveStyle.d.ts +2 -10
- package/out/theme/styles/utilities/resolveStyle.luau +3 -7
- package/out/theme/styles/utilities/styleCache.d.ts +0 -2
- package/out/theme/styles/utilities/styleCache.luau +0 -9
- package/out/ui/packages/accordion/components/Accordion.d.ts +0 -2
- package/out/ui/packages/accordion/components/Accordion.luau +30 -46
- package/out/ui/packages/accordion/components/Accordion.styles.d.ts +0 -1
- package/out/ui/packages/accordion/components/Accordion.styles.luau +4 -16
- package/out/ui/packages/accordion/components/accordionOpen.d.ts +0 -1
- package/out/ui/packages/accordion/components/accordionOpen.luau +0 -4
- package/out/ui/packages/alert/components/Alert.d.ts +0 -2
- package/out/ui/packages/alert/components/Alert.luau +42 -48
- package/out/ui/packages/alert/components/Alert.styles.d.ts +0 -2
- package/out/ui/packages/alert/components/Alert.styles.luau +8 -17
- package/out/ui/packages/appBar/components/AppBar.d.ts +1 -2
- package/out/ui/packages/appBar/components/AppBar.luau +16 -14
- package/out/ui/packages/appBar/components/AppBar.styles.d.ts +0 -2
- package/out/ui/packages/appBar/components/AppBar.styles.luau +2 -6
- package/out/ui/packages/assetField/components/AssetField.luau +16 -12
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +0 -8
- package/out/ui/packages/avatar/components/Avatar.d.ts +0 -2
- package/out/ui/packages/avatar/components/Avatar.luau +26 -27
- package/out/ui/packages/avatar/components/Avatar.styles.d.ts +0 -2
- package/out/ui/packages/avatar/components/Avatar.styles.luau +1 -5
- package/out/ui/packages/badge/components/Badge.d.ts +0 -3
- package/out/ui/packages/badge/components/Badge.luau +24 -32
- package/out/ui/packages/badge/components/Badge.styles.d.ts +1 -5
- package/out/ui/packages/badge/components/Badge.styles.luau +8 -20
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +0 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +18 -20
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.d.ts +1 -3
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +2 -6
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +0 -1
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +40 -67
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +0 -9
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +0 -68
- package/out/ui/packages/breadcrumbs/index.d.ts +0 -1
- package/out/ui/packages/breadcrumbs/init.luau +0 -3
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +16 -12
- package/out/ui/packages/button/components/Button.luau +22 -28
- package/out/ui/packages/card/components/Card.d.ts +1 -3
- package/out/ui/packages/card/components/Card.luau +0 -10
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +53 -75
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +9 -26
- 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 +1 -6
- package/out/ui/packages/chip/components/Chip.luau +17 -61
- package/out/ui/packages/chip/components/Chip.styles.d.ts +0 -6
- package/out/ui/packages/chip/components/Chip.styles.luau +9 -54
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +18 -29
- package/out/ui/packages/colorPicker/components/ColorPicker.luau +20 -16
- package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +20 -34
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +35 -34
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +62 -65
- package/out/ui/packages/dialog/components/Dialog.d.ts +2 -3
- package/out/ui/packages/dialog/components/Dialog.luau +21 -41
- package/out/ui/packages/divider/components/Divider.d.ts +0 -1
- package/out/ui/packages/divider/components/Divider.luau +17 -52
- package/out/ui/packages/divider/components/Divider.styles.luau +0 -32
- package/out/ui/packages/drawer/components/Drawer.d.ts +1 -3
- package/out/ui/packages/drawer/components/Drawer.luau +37 -71
- package/out/ui/packages/drawer/components/Drawer.styles.d.ts +1 -3
- package/out/ui/packages/drawer/components/Drawer.styles.luau +2 -3
- package/out/ui/packages/fab/components/Fab.d.ts +0 -3
- package/out/ui/packages/fab/components/Fab.luau +37 -79
- package/out/ui/packages/fab/components/Fab.styles.d.ts +0 -3
- package/out/ui/packages/fab/components/Fab.styles.luau +3 -39
- package/out/ui/packages/fab/components/fabSize.d.ts +0 -1
- package/out/ui/packages/fab/components/fabSize.luau +0 -4
- package/out/ui/packages/fab/index.d.ts +1 -1
- package/out/ui/packages/fab/init.luau +0 -1
- package/out/ui/packages/fontEditor/components/FontEditor.luau +16 -12
- package/out/ui/packages/gradientEditor/components/GradientEditor.luau +42 -56
- package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +4 -37
- package/out/ui/packages/icon/components/Icon.luau +16 -9
- package/out/ui/packages/iconButton/components/IconButton.luau +17 -22
- package/out/ui/packages/iconButton/components/IconButton.styles.luau +0 -3
- package/out/ui/packages/index.d.ts +0 -8
- package/out/ui/packages/init.luau +0 -24
- package/out/ui/packages/input/components/Input.d.ts +0 -1
- package/out/ui/packages/input/components/Input.luau +19 -22
- package/out/ui/packages/layout/components/Grid.d.ts +1 -5
- package/out/ui/packages/layout/components/Grid.luau +19 -41
- package/out/ui/packages/layout/components/List.luau +16 -9
- package/out/ui/packages/layout/index.d.ts +0 -14
- package/out/ui/packages/layout/init.luau +0 -5
- package/out/ui/packages/listItem/components/ListItem.d.ts +1 -4
- package/out/ui/packages/listItem/components/ListItem.luau +4 -44
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +0 -1
- package/out/ui/packages/listItem/components/ListItem.styles.luau +5 -16
- package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +1 -7
- package/out/ui/packages/loadingStroke/components/LoadingStroke.luau +19 -23
- package/out/ui/packages/menu/components/Menu.d.ts +1 -7
- package/out/ui/packages/menu/components/Menu.luau +26 -68
- package/out/ui/packages/menu/components/Menu.styles.luau +1 -5
- package/out/ui/packages/modal/components/Modal.d.ts +1 -2
- package/out/ui/packages/modal/components/Modal.luau +37 -79
- package/out/ui/packages/motion/index.d.ts +1 -1
- package/out/ui/packages/motion/init.luau +0 -1
- package/out/ui/packages/motion/unit.d.ts +0 -5
- package/out/ui/packages/motion/unit.luau +0 -23
- package/out/ui/packages/numberInput/components/NumberInput.d.ts +0 -2
- package/out/ui/packages/numberInput/components/NumberInput.luau +3 -16
- package/out/ui/packages/numberInput/components/numberValue.d.ts +0 -1
- package/out/ui/packages/numberInput/components/numberValue.luau +0 -45
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +16 -12
- package/out/ui/packages/pagination/components/Pagination.d.ts +1 -6
- package/out/ui/packages/pagination/components/Pagination.luau +38 -62
- package/out/ui/packages/pagination/components/Pagination.styles.d.ts +1 -6
- package/out/ui/packages/pagination/components/Pagination.styles.luau +4 -36
- package/out/ui/packages/pagination/components/pageRange.d.ts +1 -2
- package/out/ui/packages/pagination/components/pageRange.luau +8 -91
- package/out/ui/packages/pagination/index.d.ts +0 -1
- package/out/ui/packages/pagination/init.luau +0 -1
- package/out/ui/packages/paper/components/Paper.d.ts +2 -4
- package/out/ui/packages/paper/components/Paper.luau +8 -28
- package/out/ui/packages/paper/components/Paper.styles.d.ts +1 -1
- package/out/ui/packages/paper/components/Paper.styles.luau +0 -6
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +38 -63
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +7 -21
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +0 -2
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +0 -14
- package/out/ui/packages/popup/components/Popup.d.ts +1 -2
- package/out/ui/packages/popup/components/Popup.luau +18 -35
- package/out/ui/packages/popup/index.d.ts +0 -1
- package/out/ui/packages/popup/init.luau +0 -1
- package/out/ui/packages/preloader/components/Preloader.luau +16 -9
- package/out/ui/packages/progressBar/components/ProgressBar.luau +16 -12
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +0 -1
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +18 -16
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +0 -1
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +1 -4
- package/out/ui/packages/rayEditor/components/RayEditor.luau +16 -12
- package/out/ui/packages/rectEditor/components/RectEditor.luau +43 -86
- package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +7 -30
- package/out/ui/packages/select/components/Select.d.ts +0 -5
- package/out/ui/packages/select/components/Select.luau +77 -61
- package/out/ui/packages/select/components/Select.styles.luau +1 -1
- package/out/ui/packages/select/components/selectMotion.d.ts +2 -0
- package/out/ui/packages/select/components/selectMotion.luau +12 -0
- package/out/ui/packages/shadow/components/Shadow.d.ts +1 -2
- package/out/ui/packages/shadow/components/Shadow.luau +17 -39
- package/out/ui/packages/shadow/components/Shadow.styles.luau +2 -7
- package/out/ui/packages/sidebar/components/Sidebar.luau +16 -9
- package/out/ui/packages/skeleton/components/Skeleton.luau +30 -22
- package/out/ui/packages/skeleton/components/Skeleton.styles.luau +2 -7
- package/out/ui/packages/skeleton/components/skeletonMotion.luau +1 -1
- package/out/ui/packages/slider/components/Slider.d.ts +0 -3
- package/out/ui/packages/slider/components/Slider.luau +19 -47
- package/out/ui/packages/slider/components/Slider.styles.d.ts +0 -2
- package/out/ui/packages/slider/components/Slider.styles.luau +1 -14
- package/out/ui/packages/snackbar/components/Snackbar.d.ts +0 -2
- package/out/ui/packages/snackbar/components/Snackbar.luau +0 -5
- package/out/ui/packages/splitPane/components/SplitPane.luau +17 -13
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stateMatrix.d.ts +0 -2
- package/out/ui/packages/stateMatrix.luau +445 -1632
- package/out/ui/packages/stepper/components/Stepper.d.ts +0 -1
- package/out/ui/packages/stepper/components/Stepper.luau +17 -16
- package/out/ui/packages/stepper/components/Stepper.styles.d.ts +1 -3
- package/out/ui/packages/stepper/components/Stepper.styles.luau +2 -6
- package/out/ui/packages/switch/components/Switch.d.ts +0 -2
- package/out/ui/packages/switch/components/Switch.luau +16 -21
- package/out/ui/packages/switch/components/Switch.styles.d.ts +0 -2
- package/out/ui/packages/switch/components/Switch.styles.luau +1 -6
- package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
- package/out/ui/packages/table/components/Table.d.ts +0 -1
- package/out/ui/packages/table/components/Table.luau +19 -15
- package/out/ui/packages/table/components/Table.styles.d.ts +1 -3
- package/out/ui/packages/table/components/Table.styles.luau +6 -10
- package/out/ui/packages/tabs/components/Tabs.d.ts +0 -3
- package/out/ui/packages/tabs/components/Tabs.luau +19 -24
- package/out/ui/packages/tabs/components/Tabs.styles.d.ts +1 -5
- package/out/ui/packages/tabs/components/Tabs.styles.luau +10 -26
- package/out/ui/packages/tabs/index.d.ts +0 -1
- package/out/ui/packages/tabs/init.luau +0 -1
- package/out/ui/packages/toast/components/Toast.d.ts +0 -2
- package/out/ui/packages/toast/components/Toast.luau +13 -41
- package/out/ui/packages/toast/components/Toast.styles.luau +5 -23
- package/out/ui/packages/tooltip/components/Tooltip.luau +16 -9
- package/out/ui/packages/treeView/components/TreeView.luau +16 -9
- package/out/ui/packages/typography/components/Typography.luau +14 -13
- package/out/ui/packages/udimEditor/components/UDimEditor.luau +16 -12
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +16 -12
- package/out/ui/packages/virtualList/components/VirtualList.luau +16 -9
- package/out/ui/packages/virtualList/index.d.ts +0 -2
- package/out/ui/packages/virtualList/init.luau +0 -1
- package/package.json +2 -2
- package/out/hooks/viewportObserver.d.ts +0 -10
- package/out/hooks/viewportObserver.luau +0 -75
- package/out/theme/styles/utilities/resolveSx.d.ts +0 -110
- package/out/theme/styles/utilities/resolveSx.luau +0 -479
- package/out/ui/packages/backdrop/components/Backdrop.d.ts +0 -10
- package/out/ui/packages/backdrop/components/Backdrop.luau +0 -51
- package/out/ui/packages/backdrop/components/Backdrop.styles.d.ts +0 -4
- package/out/ui/packages/backdrop/components/Backdrop.styles.luau +0 -24
- package/out/ui/packages/backdrop/index.d.ts +0 -2
- package/out/ui/packages/backdrop/init.luau +0 -5
- package/out/ui/packages/divider/components/dividerLabel.d.ts +0 -1
- package/out/ui/packages/divider/components/dividerLabel.luau +0 -10
- package/out/ui/packages/formText/components/FormHelperText.d.ts +0 -8
- package/out/ui/packages/formText/components/FormHelperText.luau +0 -40
- package/out/ui/packages/formText/components/FormLabel.d.ts +0 -9
- package/out/ui/packages/formText/components/FormLabel.luau +0 -42
- package/out/ui/packages/formText/components/FormText.styles.d.ts +0 -5
- package/out/ui/packages/formText/components/FormText.styles.luau +0 -33
- package/out/ui/packages/formText/index.d.ts +0 -4
- package/out/ui/packages/formText/init.luau +0 -6
- package/out/ui/packages/host/components/SxHost.d.ts +0 -18
- package/out/ui/packages/host/components/SxHost.luau +0 -202
- package/out/ui/packages/host/hostPaint.d.ts +0 -11
- package/out/ui/packages/host/hostPaint.luau +0 -33
- package/out/ui/packages/host/hostRules.d.ts +0 -15
- package/out/ui/packages/host/hostRules.luau +0 -92
- package/out/ui/packages/host/index.d.ts +0 -3
- package/out/ui/packages/host/init.luau +0 -13
- package/out/ui/packages/imageList/components/ImageList.d.ts +0 -14
- package/out/ui/packages/imageList/components/ImageList.luau +0 -93
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +0 -6
- package/out/ui/packages/imageList/components/ImageList.styles.luau +0 -73
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +0 -4
- package/out/ui/packages/imageList/components/imageListLayout.luau +0 -31
- package/out/ui/packages/imageList/index.d.ts +0 -2
- package/out/ui/packages/imageList/init.luau +0 -5
- package/out/ui/packages/layout/components/Box.d.ts +0 -11
- package/out/ui/packages/layout/components/Box.luau +0 -40
- package/out/ui/packages/layout/components/Box.styles.d.ts +0 -7
- package/out/ui/packages/layout/components/Box.styles.luau +0 -34
- package/out/ui/packages/layout/components/Container.d.ts +0 -10
- package/out/ui/packages/layout/components/Container.luau +0 -45
- package/out/ui/packages/layout/components/Container.styles.d.ts +0 -6
- package/out/ui/packages/layout/components/Container.styles.luau +0 -41
- package/out/ui/packages/layout/components/FlexItem.d.ts +0 -12
- package/out/ui/packages/layout/components/FlexItem.luau +0 -40
- package/out/ui/packages/layout/components/FlexItem.styles.d.ts +0 -8
- package/out/ui/packages/layout/components/FlexItem.styles.luau +0 -66
- package/out/ui/packages/layout/components/Stack.d.ts +0 -14
- package/out/ui/packages/layout/components/Stack.luau +0 -44
- package/out/ui/packages/layout/components/Stack.styles.d.ts +0 -10
- package/out/ui/packages/layout/components/Stack.styles.luau +0 -101
- package/out/ui/packages/layout/components/boxPad.d.ts +0 -14
- package/out/ui/packages/layout/components/boxPad.luau +0 -59
- package/out/ui/packages/layout/components/containerWidth.d.ts +0 -2
- package/out/ui/packages/layout/components/containerWidth.luau +0 -17
- package/out/ui/packages/layout/components/flexItemMode.d.ts +0 -6
- package/out/ui/packages/layout/components/flexItemMode.luau +0 -36
- package/out/ui/packages/layout/components/gridProps.d.ts +0 -3
- package/out/ui/packages/layout/components/gridProps.luau +0 -20
- package/out/ui/packages/layout/components/stackAlign.d.ts +0 -10
- package/out/ui/packages/layout/components/stackAlign.luau +0 -43
- package/out/ui/packages/link/components/Link.d.ts +0 -11
- package/out/ui/packages/link/components/Link.luau +0 -80
- package/out/ui/packages/link/components/Link.styles.d.ts +0 -8
- package/out/ui/packages/link/components/Link.styles.luau +0 -59
- package/out/ui/packages/link/index.d.ts +0 -3
- package/out/ui/packages/link/init.luau +0 -5
- package/out/ui/packages/loadingStroke/components/loadingStrokeSx.d.ts +0 -11
- package/out/ui/packages/loadingStroke/components/loadingStrokeSx.luau +0 -2
- package/out/ui/packages/markdown/components/Markdown.d.ts +0 -6
- package/out/ui/packages/markdown/components/Markdown.luau +0 -221
- package/out/ui/packages/markdown/components/Markdown.styles.d.ts +0 -2
- package/out/ui/packages/markdown/components/Markdown.styles.luau +0 -101
- package/out/ui/packages/markdown/components/MarkdownEditor.d.ts +0 -16
- package/out/ui/packages/markdown/components/MarkdownEditor.luau +0 -315
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +0 -6
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +0 -132
- package/out/ui/packages/markdown/htmlToMarkdown.d.ts +0 -2
- package/out/ui/packages/markdown/htmlToMarkdown.luau +0 -350
- package/out/ui/packages/markdown/index.d.ts +0 -8
- package/out/ui/packages/markdown/init.luau +0 -11
- package/out/ui/packages/markdown/parseMarkdown.d.ts +0 -42
- package/out/ui/packages/markdown/parseMarkdown.luau +0 -459
- package/out/ui/packages/rating/components/Rating.d.ts +0 -11
- package/out/ui/packages/rating/components/Rating.luau +0 -97
- package/out/ui/packages/rating/components/Rating.styles.d.ts +0 -6
- package/out/ui/packages/rating/components/Rating.styles.luau +0 -44
- package/out/ui/packages/rating/index.d.ts +0 -2
- package/out/ui/packages/rating/init.luau +0 -5
- package/out/ui/packages/skeleton/components/skeletonTone.d.ts +0 -20
- package/out/ui/packages/skeleton/components/skeletonTone.luau +0 -14
- package/out/ui/packages/slider/components/sliderMarks.d.ts +0 -1
- package/out/ui/packages/slider/components/sliderMarks.luau +0 -37
- package/out/ui/packages/snackbar/components/snackbarAction.d.ts +0 -1
- package/out/ui/packages/snackbar/components/snackbarAction.luau +0 -10
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +0 -19
- package/out/ui/packages/speedDial/components/SpeedDial.luau +0 -97
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +0 -5
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +0 -31
- package/out/ui/packages/speedDial/index.d.ts +0 -3
- package/out/ui/packages/speedDial/init.luau +0 -5
- package/out/ui/packages/tabs/components/tabsOrientation.d.ts +0 -2
- package/out/ui/packages/tabs/components/tabsOrientation.luau +0 -7
- package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +0 -21
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +0 -129
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +0 -9
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +0 -69
- package/out/ui/packages/toggleButton/index.d.ts +0 -2
- package/out/ui/packages/toggleButton/init.luau +0 -7
- package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +0 -7
- package/out/ui/packages/virtualList/components/EmptyListHint.luau +0 -43
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.d.ts +0 -5
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.luau +0 -26
|
@@ -4,33 +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
|
|
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
|
|
7
|
+
local useGridStyles = componentStyles("Grid", function(_, props)
|
|
34
8
|
return createStyles({
|
|
35
9
|
baseGrid = {
|
|
36
10
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -39,12 +13,12 @@ local useGridStyles = componentStyles("Grid", function(theme, props)
|
|
|
39
13
|
BorderSizePixel = 0,
|
|
40
14
|
},
|
|
41
15
|
baseLayout = {
|
|
42
|
-
CellPadding =
|
|
16
|
+
CellPadding = props.cellPadding,
|
|
43
17
|
CellSize = props.cellSize,
|
|
44
18
|
FillDirection = props.fillDirection,
|
|
45
|
-
FillDirectionMaxCells =
|
|
19
|
+
FillDirectionMaxCells = props.fillDirectionMaxCells,
|
|
46
20
|
SortOrder = props.sortOrder,
|
|
47
|
-
StartCorner =
|
|
21
|
+
StartCorner = props.startCorner,
|
|
48
22
|
HorizontalAlignment = props.horizontalAlignment,
|
|
49
23
|
VerticalAlignment = props.verticalAlignment,
|
|
50
24
|
},
|
|
@@ -60,9 +34,6 @@ local function Grid(props)
|
|
|
60
34
|
if cellSize == nil then
|
|
61
35
|
cellSize = UDim2.fromOffset(100, 100)
|
|
62
36
|
end
|
|
63
|
-
local gap = _binding.gap
|
|
64
|
-
local columns = _binding.columns
|
|
65
|
-
local maxColumns = _binding.maxColumns
|
|
66
37
|
local fillDirection = _binding.fillDirection
|
|
67
38
|
if fillDirection == nil then
|
|
68
39
|
fillDirection = Enum.FillDirection.Horizontal
|
|
@@ -95,9 +66,6 @@ local function Grid(props)
|
|
|
95
66
|
local _binding_1 = useGridStyles({
|
|
96
67
|
cellPadding = cellPadding,
|
|
97
68
|
cellSize = cellSize,
|
|
98
|
-
gap = gap,
|
|
99
|
-
columns = columns,
|
|
100
|
-
maxColumns = maxColumns,
|
|
101
69
|
fillDirection = fillDirection,
|
|
102
70
|
fillDirectionMaxCells = fillDirectionMaxCells,
|
|
103
71
|
sortOrder = sortOrder,
|
|
@@ -113,17 +81,27 @@ local function Grid(props)
|
|
|
113
81
|
_condition = "Grid"
|
|
114
82
|
end
|
|
115
83
|
_attributes.key = _condition
|
|
116
|
-
_attributes.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
84
|
+
_attributes.ref = ref
|
|
85
|
+
for _k, _v in baseGrid do
|
|
86
|
+
_attributes[_k] = _v
|
|
87
|
+
end
|
|
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
|
|
120
98
|
local _attributes_1 = {
|
|
121
99
|
key = "GridLayout",
|
|
122
100
|
}
|
|
123
101
|
for _k, _v in baseLayout do
|
|
124
102
|
_attributes_1[_k] = _v
|
|
125
103
|
end
|
|
126
|
-
return React.createElement(
|
|
104
|
+
return React.createElement("frame", _attributes, React.createElement("uigridlayout", _attributes_1), children)
|
|
127
105
|
end
|
|
128
106
|
local default = Grid
|
|
129
107
|
return {
|
|
@@ -4,7 +4,6 @@ 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
|
|
8
7
|
local useListStyles = componentStyles("List", function(_, props)
|
|
9
8
|
return createStyles({
|
|
10
9
|
baseList = {
|
|
@@ -76,25 +75,33 @@ local function List(props)
|
|
|
76
75
|
})
|
|
77
76
|
local baseList = _binding_1.baseList
|
|
78
77
|
local baseLayout = _binding_1.baseLayout
|
|
79
|
-
local _attributes = {
|
|
80
|
-
tag = "frame",
|
|
81
|
-
}
|
|
78
|
+
local _attributes = {}
|
|
82
79
|
local _condition = id
|
|
83
80
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
84
81
|
_condition = "List"
|
|
85
82
|
end
|
|
86
83
|
_attributes.key = _condition
|
|
87
|
-
_attributes.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
_attributes.ref = ref
|
|
85
|
+
for _k, _v in baseList do
|
|
86
|
+
_attributes[_k] = _v
|
|
87
|
+
end
|
|
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
|
|
91
98
|
local _attributes_1 = {
|
|
92
99
|
key = "ListLayout",
|
|
93
100
|
}
|
|
94
101
|
for _k, _v in baseLayout do
|
|
95
102
|
_attributes_1[_k] = _v
|
|
96
103
|
end
|
|
97
|
-
return React.createElement(
|
|
104
|
+
return React.createElement("frame", _attributes, React.createElement("uilistlayout", _attributes_1), children)
|
|
98
105
|
end
|
|
99
106
|
local default = List
|
|
100
107
|
return {
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
export { default as Grid } from "./components/Grid";
|
|
2
2
|
export { GridProps } from "./components/Grid";
|
|
3
|
-
export { GridCorner } from "./components/gridProps";
|
|
4
3
|
export * from "./components/Grid";
|
|
5
4
|
export { default as List } from "./components/List";
|
|
6
5
|
export { ListProps } from "./components/List";
|
|
7
6
|
export * from "./components/List";
|
|
8
|
-
export { default as Stack } from "./components/Stack";
|
|
9
|
-
export { StackProps } from "./components/Stack";
|
|
10
|
-
export { StackAlign, StackDirection, StackJustify } from "./components/stackAlign";
|
|
11
|
-
export { default as FlexItem } from "./components/FlexItem";
|
|
12
|
-
export { FlexItemProps } from "./components/FlexItem";
|
|
13
|
-
export { FlexItemAlign, FlexItemModeName } from "./components/flexItemMode";
|
|
14
|
-
export { default as Box } from "./components/Box";
|
|
15
|
-
export { BoxProps } from "./components/Box";
|
|
16
|
-
export { BoxPad } from "./components/boxPad";
|
|
17
|
-
export { BoxBg } from "./components/Box.styles";
|
|
18
|
-
export { default as Container } from "./components/Container";
|
|
19
|
-
export { ContainerProps } from "./components/Container";
|
|
20
|
-
export { ContainerMaxWidth, containerMaxPx } from "./components/containerWidth";
|
|
@@ -9,9 +9,4 @@ exports.List = TS.import(script, script, "components", "List").default
|
|
|
9
9
|
for _k, _v in TS.import(script, script, "components", "List") or {} do
|
|
10
10
|
exports[_k] = _v
|
|
11
11
|
end
|
|
12
|
-
exports.Stack = TS.import(script, script, "components", "Stack").default
|
|
13
|
-
exports.FlexItem = TS.import(script, script, "components", "FlexItem").default
|
|
14
|
-
exports.Box = TS.import(script, script, "components", "Box").default
|
|
15
|
-
exports.Container = TS.import(script, script, "components", "Container").default
|
|
16
|
-
exports.containerMaxPx = TS.import(script, script, "components", "containerWidth").containerMaxPx
|
|
17
12
|
return exports
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { CustomizedProps } from "../../../../theme/index";
|
|
2
1
|
export interface ListItemProps {
|
|
3
2
|
text: string;
|
|
4
3
|
secondary?: string;
|
|
5
4
|
selected?: boolean;
|
|
6
5
|
disabled?: boolean;
|
|
7
|
-
dense?: boolean;
|
|
8
|
-
divider?: boolean;
|
|
9
6
|
onActivated?: () => void;
|
|
10
7
|
}
|
|
11
|
-
declare function ListItem(props:
|
|
8
|
+
declare function ListItem(props: ListItemProps): JSX.Element;
|
|
12
9
|
export default ListItem;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
-
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
5
4
|
local useListItemStyles = TS.import(script, script.Parent, "ListItem.styles").default
|
|
6
5
|
local function ListItem(props)
|
|
7
6
|
local _binding = props
|
|
@@ -15,44 +14,17 @@ local function ListItem(props)
|
|
|
15
14
|
if disabled == nil then
|
|
16
15
|
disabled = false
|
|
17
16
|
end
|
|
18
|
-
local dense = _binding.dense
|
|
19
|
-
if dense == nil then
|
|
20
|
-
dense = false
|
|
21
|
-
end
|
|
22
|
-
local divider = _binding.divider
|
|
23
|
-
if divider == nil then
|
|
24
|
-
divider = false
|
|
25
|
-
end
|
|
26
17
|
local onActivated = _binding.onActivated
|
|
27
|
-
local className = _binding.className
|
|
28
|
-
local sx = _binding.sx
|
|
29
|
-
local id = _binding.id
|
|
30
|
-
local ref = _binding.ref
|
|
31
18
|
local styles = useListItemStyles({
|
|
32
19
|
selected = selected,
|
|
33
20
|
disabled = disabled,
|
|
34
|
-
dense = dense,
|
|
35
21
|
})
|
|
36
22
|
local _attributes = {
|
|
37
|
-
|
|
23
|
+
key = "ListItem",
|
|
38
24
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_condition = "ListItem"
|
|
25
|
+
for _k, _v in styles.root do
|
|
26
|
+
_attributes[_k] = _v
|
|
42
27
|
end
|
|
43
|
-
_attributes.key = _condition
|
|
44
|
-
_attributes.hostRef = ref
|
|
45
|
-
_attributes.base = styles.root
|
|
46
|
-
_attributes.className = className
|
|
47
|
-
_attributes.sx = sx
|
|
48
|
-
_attributes.state = {
|
|
49
|
-
disabled = disabled,
|
|
50
|
-
selected = selected,
|
|
51
|
-
}
|
|
52
|
-
_attributes.Text = ""
|
|
53
|
-
_attributes.Active = not disabled
|
|
54
|
-
_attributes.Selectable = not disabled
|
|
55
|
-
_attributes.AutoButtonColor = false
|
|
56
28
|
_attributes.Event = {
|
|
57
29
|
Activated = function()
|
|
58
30
|
if not disabled and onActivated ~= nil then
|
|
@@ -87,19 +59,7 @@ local function ListItem(props)
|
|
|
87
59
|
else
|
|
88
60
|
_result = nil
|
|
89
61
|
end
|
|
90
|
-
|
|
91
|
-
if divider == true then
|
|
92
|
-
local _attributes_4 = {
|
|
93
|
-
key = "Divider",
|
|
94
|
-
}
|
|
95
|
-
for _k, _v in styles.divider do
|
|
96
|
-
_attributes_4[_k] = _v
|
|
97
|
-
end
|
|
98
|
-
_result_1 = React.createElement("frame", _attributes_4)
|
|
99
|
-
else
|
|
100
|
-
_result_1 = nil
|
|
101
|
-
end
|
|
102
|
-
return React.createElement(SxHost, _attributes, _exp, _exp_1, _exp_2, _result, _result_1)
|
|
62
|
+
return React.createElement("textbutton", _attributes, _exp, _exp_1, _exp_2, _result)
|
|
103
63
|
end
|
|
104
64
|
local default = ListItem
|
|
105
65
|
return {
|
|
@@ -12,11 +12,6 @@ local useListItemStyles = componentStyles("ListItem", function(theme, _param)
|
|
|
12
12
|
if disabled == nil then
|
|
13
13
|
disabled = false
|
|
14
14
|
end
|
|
15
|
-
local dense = _param.dense
|
|
16
|
-
if dense == nil then
|
|
17
|
-
dense = false
|
|
18
|
-
end
|
|
19
|
-
local pad = theme.padding.calc(if dense == true then 0.5 else 1)
|
|
20
15
|
return createStyles({
|
|
21
16
|
root = {
|
|
22
17
|
Size = UDim2.new(1, 0, 0, 0),
|
|
@@ -30,10 +25,10 @@ local useListItemStyles = componentStyles("ListItem", function(theme, _param)
|
|
|
30
25
|
Selectable = not disabled,
|
|
31
26
|
},
|
|
32
27
|
padding = {
|
|
33
|
-
PaddingTop = UDim.new(0,
|
|
34
|
-
PaddingBottom = UDim.new(0,
|
|
35
|
-
PaddingLeft = UDim.new(0,
|
|
36
|
-
PaddingRight = UDim.new(0,
|
|
28
|
+
PaddingTop = UDim.new(0, theme.padding.calc(1)),
|
|
29
|
+
PaddingBottom = UDim.new(0, theme.padding.calc(1)),
|
|
30
|
+
PaddingLeft = UDim.new(0, theme.padding.calc(1)),
|
|
31
|
+
PaddingRight = UDim.new(0, theme.padding.calc(1)),
|
|
37
32
|
},
|
|
38
33
|
list = {
|
|
39
34
|
FillDirection = Enum.FillDirection.Vertical,
|
|
@@ -46,7 +41,7 @@ local useListItemStyles = componentStyles("ListItem", function(theme, _param)
|
|
|
46
41
|
BackgroundTransparency = 1,
|
|
47
42
|
BorderSizePixel = 0,
|
|
48
43
|
Font = theme.typography.fontFamilies.default,
|
|
49
|
-
TextSize =
|
|
44
|
+
TextSize = theme.typography.fontSizes.body,
|
|
50
45
|
TextColor3 = if disabled then theme.palette.text.disabled else theme.palette.text.primary,
|
|
51
46
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
52
47
|
},
|
|
@@ -61,12 +56,6 @@ local useListItemStyles = componentStyles("ListItem", function(theme, _param)
|
|
|
61
56
|
TextColor3 = theme.palette.text.secondary,
|
|
62
57
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
63
58
|
},
|
|
64
|
-
divider = {
|
|
65
|
-
LayoutOrder = 3,
|
|
66
|
-
Size = UDim2.new(1, 0, 0, 1),
|
|
67
|
-
BackgroundColor3 = theme.palette.divider,
|
|
68
|
-
BorderSizePixel = 0,
|
|
69
|
-
},
|
|
70
59
|
})
|
|
71
60
|
end)
|
|
72
61
|
local default = useListItemStyles
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
-
import { LoadingStrokeStyle } from "./loadingStrokeSx";
|
|
3
2
|
export interface LoadingStrokeProps {
|
|
4
3
|
animating?: boolean;
|
|
5
|
-
color?: Color3;
|
|
6
|
-
thickness?: number;
|
|
7
4
|
}
|
|
8
|
-
declare function LoadingStroke(props:
|
|
9
|
-
className?: LoadingStrokeStyle;
|
|
10
|
-
sx?: LoadingStrokeStyle;
|
|
11
|
-
}): JSX.Element;
|
|
5
|
+
declare function LoadingStroke(props: CustomizedProps<UIStroke, LoadingStrokeProps>): JSX.Element;
|
|
12
6
|
export default LoadingStroke;
|
|
@@ -4,41 +4,37 @@ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
4
4
|
local React = _react
|
|
5
5
|
local useEffect = _react.useEffect
|
|
6
6
|
local useRef = _react.useRef
|
|
7
|
-
local
|
|
8
|
-
local loopProperty = TS.import(script, script.Parent.Parent.Parent, "motion").loopProperty
|
|
7
|
+
local TweenService = TS.import(script, TS.getModule(script, "@rbxts", "services")).TweenService
|
|
9
8
|
local function LoadingStroke(props)
|
|
10
9
|
local _binding = props
|
|
11
10
|
local animating = _binding.animating
|
|
12
11
|
if animating == nil then
|
|
13
12
|
animating = false
|
|
14
13
|
end
|
|
15
|
-
local color = _binding.color
|
|
16
|
-
local thickness = _binding.thickness
|
|
17
|
-
if thickness == nil then
|
|
18
|
-
thickness = 2
|
|
19
|
-
end
|
|
20
14
|
local className = _binding.className
|
|
21
15
|
local sx = _binding.sx
|
|
22
16
|
local children = _binding.children
|
|
23
17
|
local id = _binding.id
|
|
24
18
|
local ref = _binding.ref
|
|
25
|
-
local _binding_1 = useTheme()
|
|
26
|
-
local theme = _binding_1.theme
|
|
27
19
|
local gradientRef = useRef()
|
|
28
|
-
local stroke = color or theme.palette.primary.on
|
|
29
20
|
useEffect(function()
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
21
|
+
if gradientRef.current then
|
|
22
|
+
if animating then
|
|
23
|
+
local tween = TweenService:Create(gradientRef.current, TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1, false), {
|
|
24
|
+
Rotation = 360,
|
|
25
|
+
})
|
|
26
|
+
tween:Play()
|
|
27
|
+
return function()
|
|
28
|
+
return tween:Destroy()
|
|
29
|
+
end
|
|
30
|
+
else
|
|
31
|
+
gradientRef.current.Rotation = 0
|
|
32
|
+
end
|
|
39
33
|
end
|
|
40
|
-
gradient.Rotation = 0
|
|
41
34
|
end, { animating })
|
|
35
|
+
-- Decorative shimmer; not a semantic text/surface token.
|
|
36
|
+
local stroke = Color3.fromRGB(255, 255, 255)
|
|
37
|
+
local mid = Color3.fromRGB(235, 235, 235)
|
|
42
38
|
local _attributes = {}
|
|
43
39
|
local _condition = id
|
|
44
40
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
@@ -47,7 +43,7 @@ local function LoadingStroke(props)
|
|
|
47
43
|
_attributes.key = _condition
|
|
48
44
|
_attributes.ref = ref
|
|
49
45
|
_attributes.Color = stroke
|
|
50
|
-
_attributes.Thickness =
|
|
46
|
+
_attributes.Thickness = 2
|
|
51
47
|
_attributes.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
|
|
52
48
|
if className then
|
|
53
49
|
for _k, _v in className do
|
|
@@ -61,9 +57,9 @@ local function LoadingStroke(props)
|
|
|
61
57
|
end
|
|
62
58
|
return React.createElement("uistroke", _attributes, React.createElement("uigradient", {
|
|
63
59
|
ref = gradientRef,
|
|
64
|
-
Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.
|
|
60
|
+
Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.5, 0), NumberSequenceKeypoint.new(1, 1) }),
|
|
65
61
|
Rotation = 0,
|
|
66
|
-
Color = ColorSequence.new(stroke),
|
|
62
|
+
Color = ColorSequence.new({ ColorSequenceKeypoint.new(0, stroke), ColorSequenceKeypoint.new(0.5, mid), ColorSequenceKeypoint.new(1, stroke) }),
|
|
67
63
|
}), children)
|
|
68
64
|
end
|
|
69
65
|
local default = LoadingStroke
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import React from "@rbxts/react";
|
|
2
|
-
import { CustomizedProps } from "../../../../theme/index";
|
|
3
1
|
export interface MenuItem {
|
|
4
2
|
id: string;
|
|
5
3
|
text: string;
|
|
@@ -11,10 +9,6 @@ export interface MenuProps {
|
|
|
11
9
|
items: MenuItem[];
|
|
12
10
|
onSelect: (id: string) => void;
|
|
13
11
|
onClose: () => void;
|
|
14
|
-
emptyText?: string;
|
|
15
|
-
empty?: React.Element;
|
|
16
|
-
dense?: boolean;
|
|
17
|
-
selected?: string;
|
|
18
12
|
}
|
|
19
|
-
declare function Menu(props:
|
|
13
|
+
declare function Menu(props: MenuProps): JSX.Element | undefined;
|
|
20
14
|
export default Menu;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
-
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
5
4
|
local ListItem = TS.import(script, script.Parent.Parent.Parent, "listItem").ListItem
|
|
6
5
|
local Popup = TS.import(script, script.Parent.Parent.Parent, "popup").Popup
|
|
7
|
-
local EmptyListHint = TS.import(script, script.Parent.Parent.Parent, "virtualList").EmptyListHint
|
|
8
6
|
local useMenuStyles = TS.import(script, script.Parent, "Menu.styles").default
|
|
9
7
|
local ROW = 28
|
|
10
|
-
local ROW_DENSE = 22
|
|
11
8
|
local function Menu(props)
|
|
12
9
|
local _binding = props
|
|
13
10
|
local anchor = _binding.anchor
|
|
@@ -15,86 +12,47 @@ local function Menu(props)
|
|
|
15
12
|
local items = _binding.items
|
|
16
13
|
local onSelect = _binding.onSelect
|
|
17
14
|
local onClose = _binding.onClose
|
|
18
|
-
local emptyText = _binding.emptyText
|
|
19
|
-
local empty = _binding.empty
|
|
20
|
-
local dense = _binding.dense
|
|
21
|
-
local selected = _binding.selected
|
|
22
|
-
local className = _binding.className
|
|
23
|
-
local sx = _binding.sx
|
|
24
|
-
local id = _binding.id
|
|
25
|
-
local ref = _binding.ref
|
|
26
15
|
local styles = useMenuStyles()
|
|
27
16
|
if not open then
|
|
28
17
|
return nil
|
|
29
18
|
end
|
|
30
|
-
local vacant = #items == 0
|
|
31
|
-
local row = if dense == true then ROW_DENSE else ROW
|
|
32
|
-
local height = if vacant then row else #items * row
|
|
33
19
|
local _attributes = {
|
|
34
|
-
|
|
20
|
+
key = "Surface",
|
|
35
21
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
_condition = "Surface"
|
|
22
|
+
for _k, _v in styles.surface do
|
|
23
|
+
_attributes[_k] = _v
|
|
39
24
|
end
|
|
40
|
-
_attributes.key = _condition
|
|
41
|
-
_attributes.hostRef = ref
|
|
42
|
-
_attributes.base = styles.surface
|
|
43
|
-
_attributes.className = className
|
|
44
|
-
_attributes.sx = sx
|
|
45
25
|
local _attributes_1 = table.clone(styles.corner)
|
|
46
26
|
setmetatable(_attributes_1, nil)
|
|
47
27
|
local _exp = React.createElement("uicorner", _attributes_1)
|
|
48
|
-
local _attributes_2 = table.clone(styles.
|
|
28
|
+
local _attributes_2 = table.clone(styles.list)
|
|
49
29
|
setmetatable(_attributes_2, nil)
|
|
50
|
-
local _exp_1 = React.createElement("
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
local
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
end
|
|
67
|
-
_result = _condition_1
|
|
68
|
-
else
|
|
69
|
-
-- ▼ ReadonlyArray.map ▼
|
|
70
|
-
local _newValue = table.create(#items)
|
|
71
|
-
local _callback = function(item)
|
|
72
|
-
return React.createElement(ListItem, {
|
|
73
|
-
key = item.id,
|
|
74
|
-
text = item.text,
|
|
75
|
-
disabled = item.disabled,
|
|
76
|
-
dense = dense,
|
|
77
|
-
selected = item.id == selected,
|
|
78
|
-
onActivated = function()
|
|
79
|
-
if item.disabled == true then
|
|
80
|
-
return nil
|
|
81
|
-
end
|
|
82
|
-
onSelect(item.id)
|
|
83
|
-
onClose()
|
|
84
|
-
end,
|
|
85
|
-
})
|
|
86
|
-
end
|
|
87
|
-
for _k, _v in items do
|
|
88
|
-
_newValue[_k] = _callback(_v, _k - 1, items)
|
|
89
|
-
end
|
|
90
|
-
-- ▲ ReadonlyArray.map ▲
|
|
91
|
-
_result = (React.createElement(React.Fragment, nil, _newValue))
|
|
30
|
+
local _exp_1 = React.createElement("uilistlayout", _attributes_2)
|
|
31
|
+
-- ▼ ReadonlyArray.map ▼
|
|
32
|
+
local _newValue = table.create(#items)
|
|
33
|
+
local _callback = function(item)
|
|
34
|
+
return React.createElement(ListItem, {
|
|
35
|
+
key = item.id,
|
|
36
|
+
text = item.text,
|
|
37
|
+
disabled = item.disabled,
|
|
38
|
+
onActivated = function()
|
|
39
|
+
if item.disabled == true then
|
|
40
|
+
return nil
|
|
41
|
+
end
|
|
42
|
+
onSelect(item.id)
|
|
43
|
+
onClose()
|
|
44
|
+
end,
|
|
45
|
+
})
|
|
92
46
|
end
|
|
47
|
+
for _k, _v in items do
|
|
48
|
+
_newValue[_k] = _callback(_v, _k - 1, items)
|
|
49
|
+
end
|
|
50
|
+
-- ▲ ReadonlyArray.map ▲
|
|
93
51
|
return React.createElement(Popup, {
|
|
94
52
|
anchor = anchor,
|
|
95
|
-
preferredHeight =
|
|
53
|
+
preferredHeight = #items * ROW,
|
|
96
54
|
onDismiss = onClose,
|
|
97
|
-
}, React.createElement(
|
|
55
|
+
}, React.createElement("frame", _attributes, _exp, _exp_1, _newValue))
|
|
98
56
|
end
|
|
99
57
|
local default = Menu
|
|
100
58
|
return {
|
|
@@ -8,16 +8,12 @@ local useMenuStyles = componentStyles("Menu", function(theme)
|
|
|
8
8
|
surface = {
|
|
9
9
|
Size = UDim2.new(1, 0, 0, 0),
|
|
10
10
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
11
|
-
BackgroundColor3 = theme.palette.surface.
|
|
11
|
+
BackgroundColor3 = theme.palette.surface.paper,
|
|
12
12
|
BorderSizePixel = 0,
|
|
13
13
|
},
|
|
14
14
|
corner = {
|
|
15
15
|
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
16
16
|
},
|
|
17
|
-
stroke = {
|
|
18
|
-
Color = theme.palette.border,
|
|
19
|
-
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
20
|
-
},
|
|
21
17
|
list = {
|
|
22
18
|
FillDirection = Enum.FillDirection.Vertical,
|
|
23
19
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
|
-
import { CustomizedProps } from "../../../../theme/index";
|
|
3
2
|
export interface ModalProps {
|
|
4
3
|
host?: Instance;
|
|
5
4
|
open: boolean;
|
|
6
5
|
onClose: () => void;
|
|
7
6
|
children?: React.ReactNode;
|
|
8
7
|
}
|
|
9
|
-
declare function Modal(props:
|
|
8
|
+
declare function Modal(props: ModalProps): JSX.Element | undefined;
|
|
10
9
|
export default Modal;
|