@rbxts/uiblox 0.2.0-alpha.3 → 0.2.0-alpha.31
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 +120 -0
- package/out/theme/styles/utilities/resolveSx.luau +524 -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 +210 -0
- package/out/ui/packages/host/hostPaint.d.ts +12 -0
- package/out/ui/packages/host/hostPaint.luau +34 -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
|
@@ -4,6 +4,7 @@ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
4
4
|
local React = _react
|
|
5
5
|
local useRef = _react.useRef
|
|
6
6
|
local useState = _react.useState
|
|
7
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
7
8
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
8
9
|
local NumberInput = TS.import(script, script.Parent.Parent.Parent, "numberInput").NumberInput
|
|
9
10
|
local useColorPickerStyles = TS.import(script, script.Parent, "ColorPicker.styles").default
|
|
@@ -44,26 +45,21 @@ local function NumberSequenceEditor(props)
|
|
|
44
45
|
end
|
|
45
46
|
return math.clamp((position.X - rbx.AbsolutePosition.X) / width, 0, 1)
|
|
46
47
|
end
|
|
47
|
-
local _attributes = {
|
|
48
|
+
local _attributes = {
|
|
49
|
+
tag = "frame",
|
|
50
|
+
}
|
|
48
51
|
local _condition = id
|
|
49
52
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
50
53
|
_condition = "NumberSequenceEditor"
|
|
51
54
|
end
|
|
52
55
|
_attributes.key = _condition
|
|
53
|
-
_attributes.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
if sx then
|
|
63
|
-
for _k, _v in sx do
|
|
64
|
-
_attributes[_k] = _v
|
|
65
|
-
end
|
|
66
|
-
end
|
|
56
|
+
_attributes.hostRef = ref
|
|
57
|
+
_attributes.base = styles.root
|
|
58
|
+
_attributes.className = className
|
|
59
|
+
_attributes.sx = sx
|
|
60
|
+
_attributes.state = {
|
|
61
|
+
disabled = disabled,
|
|
62
|
+
}
|
|
67
63
|
_attributes.Selectable = false
|
|
68
64
|
local _attributes_1 = table.clone(styles.column)
|
|
69
65
|
setmetatable(_attributes_1, nil)
|
|
@@ -71,10 +67,10 @@ local function NumberSequenceEditor(props)
|
|
|
71
67
|
local _attributes_2 = {
|
|
72
68
|
key = "Bar",
|
|
73
69
|
}
|
|
74
|
-
for _k, _v in styles.
|
|
70
|
+
for _k, _v in styles.sequenceBar do
|
|
75
71
|
_attributes_2[_k] = _v
|
|
76
72
|
end
|
|
77
|
-
_attributes_2.BackgroundColor3 = Color3.new(
|
|
73
|
+
_attributes_2.BackgroundColor3 = Color3.new(1, 1, 1)
|
|
78
74
|
_attributes_2.LayoutOrder = 1
|
|
79
75
|
_attributes_2.Active = active
|
|
80
76
|
_attributes_2.Event = {
|
|
@@ -126,57 +122,64 @@ local function NumberSequenceEditor(props)
|
|
|
126
122
|
local _attributes_3 = table.clone(styles.corner)
|
|
127
123
|
setmetatable(_attributes_3, nil)
|
|
128
124
|
local _exp_1 = React.createElement("uicorner", _attributes_3)
|
|
129
|
-
local
|
|
125
|
+
local _attributes_4 = table.clone(styles.swatchStroke)
|
|
126
|
+
setmetatable(_attributes_4, nil)
|
|
127
|
+
local _exp_2 = React.createElement("uistroke", _attributes_4)
|
|
128
|
+
local _exp_3 = React.createElement("uigradient", {
|
|
130
129
|
Transparency = value,
|
|
131
130
|
})
|
|
132
131
|
-- ▼ ReadonlyArray.map ▼
|
|
133
132
|
local _newValue = table.create(#stops)
|
|
134
133
|
local _callback = function(stop, stopIndex)
|
|
135
|
-
local
|
|
134
|
+
local _attributes_5 = {
|
|
136
135
|
key = `Stop-{stopIndex}`,
|
|
137
136
|
}
|
|
138
|
-
for _k, _v in styles.
|
|
139
|
-
|
|
137
|
+
for _k, _v in styles.stop do
|
|
138
|
+
_attributes_5[_k] = _v
|
|
140
139
|
end
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
_attributes_5.BackgroundColor3 = Color3.new(0.85, 0.85, 0.85)
|
|
141
|
+
_attributes_5.Position = UDim2.fromScale(stop.t, 0.5)
|
|
142
|
+
_attributes_5.ZIndex = if stopIndex == index then 2 else 1
|
|
143
|
+
return React.createElement("frame", _attributes_5, React.createElement("uicorner", {
|
|
144
|
+
CornerRadius = UDim.new(0, 2),
|
|
145
|
+
}), React.createElement("uistroke", {
|
|
146
|
+
Thickness = if stopIndex == index then 2 else 1,
|
|
147
|
+
Color = Color3.new(1, 1, 1),
|
|
148
|
+
}))
|
|
146
149
|
end
|
|
147
150
|
for _k, _v in stops do
|
|
148
151
|
_newValue[_k] = _callback(_v, _k - 1, stops)
|
|
149
152
|
end
|
|
150
153
|
-- ▲ ReadonlyArray.map ▲
|
|
151
|
-
local
|
|
152
|
-
local
|
|
154
|
+
local _exp_4 = React.createElement("frame", _attributes_2, _exp_1, _exp_2, _exp_3, React.createElement(React.Fragment, nil, _newValue))
|
|
155
|
+
local _attributes_5 = {
|
|
153
156
|
key = "Fields",
|
|
154
157
|
}
|
|
155
158
|
for _k, _v in styles.row do
|
|
156
|
-
|
|
159
|
+
_attributes_5[_k] = _v
|
|
157
160
|
end
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
local
|
|
162
|
-
setmetatable(
|
|
163
|
-
local
|
|
164
|
-
local
|
|
161
|
+
_attributes_5.LayoutOrder = 2
|
|
162
|
+
_attributes_5.Size = UDim2.new(1, 0, 0, 0)
|
|
163
|
+
_attributes_5.AutomaticSize = Enum.AutomaticSize.Y
|
|
164
|
+
local _attributes_6 = table.clone(styles.rowLayout)
|
|
165
|
+
setmetatable(_attributes_6, nil)
|
|
166
|
+
local _exp_5 = React.createElement("uilistlayout", _attributes_6)
|
|
167
|
+
local _attributes_7 = {
|
|
165
168
|
key = "Value",
|
|
166
169
|
}
|
|
167
170
|
for _k, _v in styles.channel do
|
|
168
|
-
|
|
171
|
+
_attributes_7[_k] = _v
|
|
169
172
|
end
|
|
170
|
-
local
|
|
171
|
-
setmetatable(_attributes_7, nil)
|
|
172
|
-
local _exp_5 = React.createElement("uilistlayout", _attributes_7)
|
|
173
|
-
local _attributes_8 = table.clone(styles.label)
|
|
173
|
+
local _attributes_8 = table.clone(styles.rowLayout)
|
|
174
174
|
setmetatable(_attributes_8, nil)
|
|
175
|
-
|
|
176
|
-
local
|
|
177
|
-
local _attributes_9 = table.clone(styles.channelField)
|
|
175
|
+
local _exp_6 = React.createElement("uilistlayout", _attributes_8)
|
|
176
|
+
local _attributes_9 = table.clone(styles.label)
|
|
178
177
|
setmetatable(_attributes_9, nil)
|
|
179
|
-
|
|
178
|
+
_attributes_9.Text = "V"
|
|
179
|
+
local _exp_7 = React.createElement("textlabel", _attributes_9)
|
|
180
|
+
local _attributes_10 = table.clone(styles.channelField)
|
|
181
|
+
setmetatable(_attributes_10, nil)
|
|
182
|
+
local _exp_8 = React.createElement("frame", _attributes_7, _exp_6, _exp_7, React.createElement("frame", _attributes_10, React.createElement(NumberInput, {
|
|
180
183
|
value = current.value,
|
|
181
184
|
disabled = disabled,
|
|
182
185
|
width = UDim.new(1, 0),
|
|
@@ -186,22 +189,22 @@ local function NumberSequenceEditor(props)
|
|
|
186
189
|
}))
|
|
187
190
|
end,
|
|
188
191
|
})))
|
|
189
|
-
local
|
|
192
|
+
local _attributes_11 = {
|
|
190
193
|
key = "Envelope",
|
|
191
194
|
}
|
|
192
195
|
for _k, _v in styles.channel do
|
|
193
|
-
|
|
196
|
+
_attributes_11[_k] = _v
|
|
194
197
|
end
|
|
195
|
-
local
|
|
196
|
-
setmetatable(_attributes_11, nil)
|
|
197
|
-
local _exp_8 = React.createElement("uilistlayout", _attributes_11)
|
|
198
|
-
local _attributes_12 = table.clone(styles.label)
|
|
198
|
+
local _attributes_12 = table.clone(styles.rowLayout)
|
|
199
199
|
setmetatable(_attributes_12, nil)
|
|
200
|
-
|
|
201
|
-
local
|
|
202
|
-
local _attributes_13 = table.clone(styles.channelField)
|
|
200
|
+
local _exp_9 = React.createElement("uilistlayout", _attributes_12)
|
|
201
|
+
local _attributes_13 = table.clone(styles.label)
|
|
203
202
|
setmetatable(_attributes_13, nil)
|
|
204
|
-
|
|
203
|
+
_attributes_13.Text = "E"
|
|
204
|
+
local _exp_10 = React.createElement("textlabel", _attributes_13)
|
|
205
|
+
local _attributes_14 = table.clone(styles.channelField)
|
|
206
|
+
setmetatable(_attributes_14, nil)
|
|
207
|
+
local _exp_11 = React.createElement("frame", _attributes_5, _exp_5, _exp_8, React.createElement("frame", _attributes_11, _exp_9, _exp_10, React.createElement("frame", _attributes_14, React.createElement(NumberInput, {
|
|
205
208
|
value = current.envelope,
|
|
206
209
|
disabled = disabled,
|
|
207
210
|
width = UDim.new(1, 0),
|
|
@@ -213,15 +216,15 @@ local function NumberSequenceEditor(props)
|
|
|
213
216
|
}))))
|
|
214
217
|
local _condition_1 = #stops > 2 and index > 0 and index < #stops - 1
|
|
215
218
|
if _condition_1 then
|
|
216
|
-
local
|
|
219
|
+
local _attributes_15 = {
|
|
217
220
|
key = "Remove",
|
|
218
221
|
}
|
|
219
222
|
for _k, _v in styles.link do
|
|
220
|
-
|
|
223
|
+
_attributes_15[_k] = _v
|
|
221
224
|
end
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
+
_attributes_15.Text = "Remove stop"
|
|
226
|
+
_attributes_15.LayoutOrder = 3
|
|
227
|
+
_attributes_15.Event = {
|
|
225
228
|
Activated = function()
|
|
226
229
|
if not active then
|
|
227
230
|
return nil
|
|
@@ -230,9 +233,9 @@ local function NumberSequenceEditor(props)
|
|
|
230
233
|
setSelected(math.max(0, index - 1))
|
|
231
234
|
end,
|
|
232
235
|
}
|
|
233
|
-
_condition_1 = (React.createElement("textbutton",
|
|
236
|
+
_condition_1 = (React.createElement("textbutton", _attributes_15))
|
|
234
237
|
end
|
|
235
|
-
return React.createElement(
|
|
238
|
+
return React.createElement(SxHost, _attributes, _exp, _exp_4, _exp_11, _condition_1)
|
|
236
239
|
end
|
|
237
240
|
local default = NumberSequenceEditor
|
|
238
241
|
return {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
2
3
|
export interface DialogProps {
|
|
3
4
|
host?: Instance;
|
|
4
5
|
open: boolean;
|
|
5
|
-
title
|
|
6
|
+
title?: string;
|
|
6
7
|
onClose: () => void;
|
|
7
8
|
children?: React.ReactNode;
|
|
8
9
|
actions?: React.ReactNode;
|
|
9
10
|
}
|
|
10
|
-
declare function Dialog(props: DialogProps): JSX.Element;
|
|
11
|
+
declare function Dialog(props: CustomizedProps<Frame, DialogProps>): JSX.Element;
|
|
11
12
|
export default Dialog;
|
|
@@ -1,6 +1,7 @@
|
|
|
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
|
|
4
5
|
local Modal = TS.import(script, script.Parent.Parent.Parent, "modal").Modal
|
|
5
6
|
local useDialogStyles = TS.import(script, script.Parent, "Dialog.styles").default
|
|
6
7
|
local function Dialog(props)
|
|
@@ -11,44 +12,63 @@ local function Dialog(props)
|
|
|
11
12
|
local onClose = _binding.onClose
|
|
12
13
|
local children = _binding.children
|
|
13
14
|
local actions = _binding.actions
|
|
15
|
+
local className = _binding.className
|
|
16
|
+
local sx = _binding.sx
|
|
17
|
+
local id = _binding.id
|
|
18
|
+
local ref = _binding.ref
|
|
14
19
|
local styles = useDialogStyles()
|
|
20
|
+
local hasTitle = title ~= nil and title ~= ""
|
|
21
|
+
local hasActions = actions ~= nil
|
|
15
22
|
local _attributes = {
|
|
16
|
-
|
|
23
|
+
tag = "frame",
|
|
17
24
|
}
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
local _condition = id
|
|
26
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
27
|
+
_condition = "Column"
|
|
20
28
|
end
|
|
29
|
+
_attributes.key = _condition
|
|
30
|
+
_attributes.hostRef = ref
|
|
31
|
+
_attributes.base = styles.column
|
|
32
|
+
_attributes.className = className
|
|
33
|
+
_attributes.sx = sx
|
|
21
34
|
local _attributes_1 = table.clone(styles.columnList)
|
|
22
35
|
setmetatable(_attributes_1, nil)
|
|
23
36
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
24
|
-
local
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
local _condition_1 = hasTitle
|
|
38
|
+
if _condition_1 then
|
|
39
|
+
local _attributes_2 = {
|
|
40
|
+
key = "Title",
|
|
41
|
+
}
|
|
42
|
+
for _k, _v in styles.title do
|
|
43
|
+
_attributes_2[_k] = _v
|
|
44
|
+
end
|
|
45
|
+
_attributes_2.Text = title
|
|
46
|
+
_condition_1 = React.createElement("textlabel", _attributes_2)
|
|
29
47
|
end
|
|
30
|
-
_attributes_2
|
|
31
|
-
local _exp_1 = React.createElement("textlabel", _attributes_2)
|
|
32
|
-
local _attributes_3 = {
|
|
48
|
+
local _attributes_2 = {
|
|
33
49
|
key = "Body",
|
|
34
50
|
}
|
|
35
51
|
for _k, _v in styles.body do
|
|
36
|
-
|
|
52
|
+
_attributes_2[_k] = _v
|
|
37
53
|
end
|
|
38
|
-
local
|
|
39
|
-
local
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
54
|
+
local _exp_1 = React.createElement("frame", _attributes_2, children)
|
|
55
|
+
local _condition_2 = hasActions
|
|
56
|
+
if _condition_2 then
|
|
57
|
+
local _attributes_3 = {
|
|
58
|
+
key = "Actions",
|
|
59
|
+
}
|
|
60
|
+
for _k, _v in styles.actions do
|
|
61
|
+
_attributes_3[_k] = _v
|
|
62
|
+
end
|
|
63
|
+
local _attributes_4 = table.clone(styles.actionList)
|
|
64
|
+
setmetatable(_attributes_4, nil)
|
|
65
|
+
_condition_2 = (React.createElement("frame", _attributes_3, React.createElement("uilistlayout", _attributes_4), actions))
|
|
44
66
|
end
|
|
45
|
-
local _attributes_5 = table.clone(styles.actionList)
|
|
46
|
-
setmetatable(_attributes_5, nil)
|
|
47
67
|
return React.createElement(Modal, {
|
|
48
68
|
host = host,
|
|
49
69
|
open = open,
|
|
50
70
|
onClose = onClose,
|
|
51
|
-
}, React.createElement(
|
|
71
|
+
}, React.createElement(SxHost, _attributes, _exp, _condition_1, _exp_1, _condition_2))
|
|
52
72
|
end
|
|
53
73
|
local default = Dialog
|
|
54
74
|
return {
|
|
@@ -9,6 +9,7 @@ export interface DividerProps {
|
|
|
9
9
|
transparency?: number;
|
|
10
10
|
weight?: number;
|
|
11
11
|
anchorPoint?: Vector2;
|
|
12
|
+
text?: string;
|
|
12
13
|
}
|
|
13
14
|
declare function Divider<T extends DefaultDividerComponent>(props: CustomizedProps<T, DividerProps>): JSX.Element;
|
|
14
15
|
export default Divider;
|
|
@@ -1,37 +1,72 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local Orientations = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Orientations
|
|
5
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
|
+
local dividerLabel = TS.import(script, script.Parent, "dividerLabel").dividerLabel
|
|
4
7
|
local useDividerStyles = TS.import(script, script.Parent, "Divider.styles").default
|
|
5
8
|
local function Divider(props)
|
|
6
9
|
local _binding = props
|
|
10
|
+
local text = _binding.text
|
|
11
|
+
local orientation = _binding.orientation
|
|
7
12
|
local className = _binding.className
|
|
8
13
|
local sx = _binding.sx
|
|
9
14
|
local id = _binding.id
|
|
10
15
|
local ref = _binding.ref
|
|
11
16
|
local _binding_1 = useDividerStyles(props)
|
|
12
17
|
local root = _binding_1.root
|
|
13
|
-
local
|
|
18
|
+
local shell = _binding_1.shell
|
|
19
|
+
local line = _binding_1.line
|
|
20
|
+
local caption = _binding_1.caption
|
|
21
|
+
local captionPad = _binding_1.captionPad
|
|
22
|
+
local label = dividerLabel(text)
|
|
23
|
+
if label ~= nil and orientation ~= Orientations.Vertical then
|
|
24
|
+
local _attributes = {
|
|
25
|
+
tag = "frame",
|
|
26
|
+
}
|
|
27
|
+
local _condition = id
|
|
28
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
29
|
+
_condition = "Divider"
|
|
30
|
+
end
|
|
31
|
+
_attributes.key = _condition
|
|
32
|
+
_attributes.hostRef = ref
|
|
33
|
+
_attributes.base = shell
|
|
34
|
+
_attributes.className = className
|
|
35
|
+
_attributes.sx = sx
|
|
36
|
+
local _attributes_1 = {
|
|
37
|
+
key = "Line",
|
|
38
|
+
}
|
|
39
|
+
for _k, _v in line do
|
|
40
|
+
_attributes_1[_k] = _v
|
|
41
|
+
end
|
|
42
|
+
local _exp = React.createElement("frame", _attributes_1)
|
|
43
|
+
local _attributes_2 = {
|
|
44
|
+
key = "Label",
|
|
45
|
+
}
|
|
46
|
+
for _k, _v in caption do
|
|
47
|
+
_attributes_2[_k] = _v
|
|
48
|
+
end
|
|
49
|
+
_attributes_2.Text = label
|
|
50
|
+
local _attributes_3 = table.clone(captionPad)
|
|
51
|
+
setmetatable(_attributes_3, nil)
|
|
52
|
+
return React.createElement(SxHost, _attributes, _exp, React.createElement("textlabel", _attributes_2, React.createElement("uipadding", _attributes_3)))
|
|
53
|
+
end
|
|
54
|
+
local _attributes = {
|
|
55
|
+
tag = "frame",
|
|
56
|
+
}
|
|
14
57
|
local _condition = id
|
|
15
58
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
16
59
|
_condition = "Divider"
|
|
17
60
|
end
|
|
18
61
|
_attributes.key = _condition
|
|
19
|
-
_attributes.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_attributes.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
if sx ~= 0 and sx == sx and sx ~= "" and sx then
|
|
30
|
-
for _k, _v in sx do
|
|
31
|
-
_attributes[_k] = _v
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
return React.createElement("frame", _attributes)
|
|
62
|
+
_attributes.hostRef = ref
|
|
63
|
+
local _object = table.clone(root)
|
|
64
|
+
setmetatable(_object, nil)
|
|
65
|
+
_object.BorderSizePixel = 0
|
|
66
|
+
_attributes.base = _object
|
|
67
|
+
_attributes.className = className
|
|
68
|
+
_attributes.sx = sx
|
|
69
|
+
return React.createElement(SxHost, _attributes)
|
|
35
70
|
end
|
|
36
71
|
local default = Divider
|
|
37
72
|
return {
|
|
@@ -32,6 +32,38 @@ local useDividerStyles = componentStyles("Divider", function(theme, props)
|
|
|
32
32
|
anchorPoint = Vector2.new(0, 0)
|
|
33
33
|
end
|
|
34
34
|
return createStyles({
|
|
35
|
+
shell = {
|
|
36
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(2)),
|
|
37
|
+
BackgroundTransparency = 1,
|
|
38
|
+
BorderSizePixel = 0,
|
|
39
|
+
ClipsDescendants = true,
|
|
40
|
+
},
|
|
41
|
+
line = {
|
|
42
|
+
Size = UDim2.new(1, 0, 0, weight),
|
|
43
|
+
Position = UDim2.new(0, 0, 0.5, 0),
|
|
44
|
+
AnchorPoint = Vector2.new(0, 0.5),
|
|
45
|
+
BackgroundColor3 = color,
|
|
46
|
+
BackgroundTransparency = transparency,
|
|
47
|
+
BorderSizePixel = 0,
|
|
48
|
+
},
|
|
49
|
+
caption = {
|
|
50
|
+
AutomaticSize = Enum.AutomaticSize.X,
|
|
51
|
+
Size = UDim2.new(0, 0, 1, 0),
|
|
52
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
53
|
+
Position = UDim2.new(0.5, 0, 0.5, 0),
|
|
54
|
+
BackgroundColor3 = theme.palette.surface.canvas,
|
|
55
|
+
BorderSizePixel = 0,
|
|
56
|
+
Font = theme.typography.fontFamilies.default,
|
|
57
|
+
TextSize = theme.typography.fontSizes.caption,
|
|
58
|
+
TextColor3 = theme.palette.text.secondary,
|
|
59
|
+
TextTruncate = Enum.TextTruncate.AtEnd,
|
|
60
|
+
TextXAlignment = Enum.TextXAlignment.Center,
|
|
61
|
+
ZIndex = 2,
|
|
62
|
+
},
|
|
63
|
+
captionPad = {
|
|
64
|
+
PaddingLeft = UDim.new(0, theme.padding.calc(1)),
|
|
65
|
+
PaddingRight = UDim.new(0, theme.padding.calc(1)),
|
|
66
|
+
},
|
|
35
67
|
root = {
|
|
36
68
|
Position = position or UDim2.new(0, 0, 0, 0),
|
|
37
69
|
Size = UDim2.new(if orientation == Orientations.Horizontal then 1 else 0, if orientation == Orientations.Horizontal then -padding * 2 else weight, if orientation == Orientations.Vertical then 1 else 0, if orientation == Orientations.Vertical then -padding * 2 else weight),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dividerLabel(text?: string): string | undefined;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
2
3
|
import { DrawerEdge } from "./drawerPlacement";
|
|
3
4
|
export interface DrawerProps {
|
|
4
5
|
host?: Instance;
|
|
5
6
|
open: boolean;
|
|
6
7
|
edge?: DrawerEdge;
|
|
8
|
+
width?: number;
|
|
7
9
|
onClose: () => void;
|
|
8
10
|
children?: React.ReactNode;
|
|
9
11
|
}
|
|
10
|
-
declare function Drawer(props: DrawerProps): JSX.Element
|
|
12
|
+
declare function Drawer(props: CustomizedProps<Frame, DrawerProps>): JSX.Element;
|
|
11
13
|
export default Drawer;
|
|
@@ -4,9 +4,13 @@ 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 useState = _react.useState
|
|
7
8
|
local UserInputService = TS.import(script, TS.getModule(script, "@rbxts", "services")).UserInputService
|
|
8
|
-
local
|
|
9
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
9
10
|
local isDismissInput = TS.import(script, script.Parent.Parent.Parent, "modal", "components", "dismissInput").isDismissInput
|
|
11
|
+
local _popup = TS.import(script, script.Parent.Parent.Parent, "popup")
|
|
12
|
+
local Portal = _popup.Portal
|
|
13
|
+
local portalTarget = _popup.portalTarget
|
|
10
14
|
local drawerAnchor = TS.import(script, script.Parent, "drawerPlacement").drawerAnchor
|
|
11
15
|
local useDrawerStyles = TS.import(script, script.Parent, "Drawer.styles").default
|
|
12
16
|
local function Drawer(props)
|
|
@@ -17,11 +21,25 @@ local function Drawer(props)
|
|
|
17
21
|
if edge == nil then
|
|
18
22
|
edge = "left"
|
|
19
23
|
end
|
|
24
|
+
local width = _binding.width
|
|
20
25
|
local onClose = _binding.onClose
|
|
21
26
|
local children = _binding.children
|
|
22
|
-
local
|
|
27
|
+
local className = _binding.className
|
|
28
|
+
local sx = _binding.sx
|
|
29
|
+
local id = _binding.id
|
|
30
|
+
local ref = _binding.ref
|
|
31
|
+
local styles = useDrawerStyles({
|
|
32
|
+
width = width,
|
|
33
|
+
})
|
|
23
34
|
local close = useRef(onClose)
|
|
35
|
+
local anchor = useRef()
|
|
36
|
+
local layer, setLayer = useState(function()
|
|
37
|
+
return portalTarget(host)
|
|
38
|
+
end)
|
|
24
39
|
close.current = onClose
|
|
40
|
+
useEffect(function()
|
|
41
|
+
setLayer(portalTarget(host or anchor.current))
|
|
42
|
+
end, { host, open })
|
|
25
43
|
useEffect(function()
|
|
26
44
|
if not open then
|
|
27
45
|
return nil
|
|
@@ -34,42 +52,58 @@ local function Drawer(props)
|
|
|
34
52
|
return function()
|
|
35
53
|
return connection:Disconnect()
|
|
36
54
|
end
|
|
37
|
-
end, { open })
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
end, { open, layer })
|
|
56
|
+
local placement = drawerAnchor(edge)
|
|
57
|
+
local panelStyle = styles.panel
|
|
58
|
+
local _exp = React.createElement("frame", {
|
|
59
|
+
key = "DrawerAnchor",
|
|
60
|
+
ref = anchor,
|
|
61
|
+
Size = UDim2.fromOffset(0, 0),
|
|
62
|
+
BackgroundTransparency = 1,
|
|
63
|
+
BorderSizePixel = 0,
|
|
64
|
+
})
|
|
65
|
+
local _condition = open and layer ~= nil
|
|
66
|
+
if _condition then
|
|
67
|
+
local _attributes = {
|
|
68
|
+
key = "Drawer",
|
|
69
|
+
}
|
|
70
|
+
for _k, _v in styles.root do
|
|
71
|
+
_attributes[_k] = _v
|
|
72
|
+
end
|
|
73
|
+
local _attributes_1 = {
|
|
74
|
+
key = "Backdrop",
|
|
75
|
+
}
|
|
76
|
+
for _k, _v in styles.backdrop do
|
|
77
|
+
_attributes_1[_k] = _v
|
|
78
|
+
end
|
|
79
|
+
_attributes_1.Event = {
|
|
80
|
+
Activated = function()
|
|
81
|
+
return close.current()
|
|
82
|
+
end,
|
|
83
|
+
}
|
|
84
|
+
local _exp_1 = React.createElement("textbutton", _attributes_1)
|
|
85
|
+
local _attributes_2 = {
|
|
86
|
+
tag = "frame",
|
|
87
|
+
}
|
|
88
|
+
local _condition_1 = id
|
|
89
|
+
if not (_condition_1 ~= 0 and _condition_1 == _condition_1 and _condition_1 ~= "" and _condition_1) then
|
|
90
|
+
_condition_1 = "Panel"
|
|
91
|
+
end
|
|
92
|
+
_attributes_2.key = _condition_1
|
|
93
|
+
_attributes_2.hostRef = ref
|
|
94
|
+
_attributes_2.base = panelStyle
|
|
95
|
+
_attributes_2.className = className
|
|
96
|
+
_attributes_2.sx = sx
|
|
97
|
+
_attributes_2.AnchorPoint = Vector2.new(placement, 0)
|
|
98
|
+
_attributes_2.Position = UDim2.fromScale(placement, 0)
|
|
99
|
+
_attributes_2.ZIndex = panelStyle.ZIndex
|
|
100
|
+
local _attributes_3 = table.clone(styles.padding)
|
|
101
|
+
setmetatable(_attributes_3, nil)
|
|
102
|
+
_condition = (React.createElement(Portal, {
|
|
103
|
+
host = layer,
|
|
104
|
+
}, React.createElement("frame", _attributes, _exp_1, React.createElement(SxHost, _attributes_2, React.createElement("uipadding", _attributes_3), children))))
|
|
65
105
|
end
|
|
66
|
-
|
|
67
|
-
_attributes_2.Position = UDim2.fromScale(anchor, 0)
|
|
68
|
-
local _attributes_3 = table.clone(styles.padding)
|
|
69
|
-
setmetatable(_attributes_3, nil)
|
|
70
|
-
return React.createElement(Portal, {
|
|
71
|
-
host = host,
|
|
72
|
-
}, React.createElement("frame", _attributes, _exp, React.createElement("frame", _attributes_2, React.createElement("uipadding", _attributes_3), children)))
|
|
106
|
+
return React.createElement(React.Fragment, nil, _exp, _condition)
|
|
73
107
|
end
|
|
74
108
|
local default = Drawer
|
|
75
109
|
return {
|
|
@@ -3,7 +3,8 @@ local TS = _G[script]
|
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local componentStyles = _theme.componentStyles
|
|
5
5
|
local createStyles = _theme.createStyles
|
|
6
|
-
local useDrawerStyles = componentStyles("Drawer", function(theme)
|
|
6
|
+
local useDrawerStyles = componentStyles("Drawer", function(theme, _param)
|
|
7
|
+
local width = _param.width
|
|
7
8
|
return createStyles({
|
|
8
9
|
root = {
|
|
9
10
|
Size = UDim2.fromScale(1, 1),
|
|
@@ -21,7 +22,7 @@ local useDrawerStyles = componentStyles("Drawer", function(theme)
|
|
|
21
22
|
ZIndex = 30000,
|
|
22
23
|
},
|
|
23
24
|
panel = {
|
|
24
|
-
Size = UDim2.new(0, theme.spacing.calc(20), 1, 0),
|
|
25
|
+
Size = UDim2.new(0, if width ~= nil and width > 0 then width else theme.spacing.calc(20), 1, 0),
|
|
25
26
|
BackgroundColor3 = theme.palette.surface.elevated,
|
|
26
27
|
BorderSizePixel = 0,
|
|
27
28
|
ZIndex = 30001,
|