@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
|
@@ -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 _colorPicker = TS.import(script, script.Parent.Parent.Parent, "colorPicker")
|
|
5
6
|
local ColorSequenceEditor = _colorPicker.ColorSequenceEditor
|
|
6
7
|
local NumberSequenceEditor = _colorPicker.NumberSequenceEditor
|
|
@@ -21,33 +22,28 @@ local function GradientEditor(props)
|
|
|
21
22
|
local id = _binding.id
|
|
22
23
|
local ref = _binding.ref
|
|
23
24
|
local styles = useGradientEditorStyles()
|
|
24
|
-
local _attributes = {
|
|
25
|
+
local _attributes = {
|
|
26
|
+
tag = "frame",
|
|
27
|
+
}
|
|
25
28
|
local _condition = id
|
|
26
29
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
27
30
|
_condition = "GradientEditor"
|
|
28
31
|
end
|
|
29
32
|
_attributes.key = _condition
|
|
30
|
-
_attributes.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
if sx then
|
|
40
|
-
for _k, _v in sx do
|
|
41
|
-
_attributes[_k] = _v
|
|
42
|
-
end
|
|
43
|
-
end
|
|
33
|
+
_attributes.hostRef = ref
|
|
34
|
+
_attributes.base = styles.root
|
|
35
|
+
_attributes.className = className
|
|
36
|
+
_attributes.sx = sx
|
|
37
|
+
_attributes.state = {
|
|
38
|
+
disabled = disabled,
|
|
39
|
+
}
|
|
44
40
|
local _attributes_1 = table.clone(styles.column)
|
|
45
41
|
setmetatable(_attributes_1, nil)
|
|
46
42
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
47
43
|
local _attributes_2 = {
|
|
48
44
|
key = "Color",
|
|
49
45
|
}
|
|
50
|
-
for _k, _v in styles.
|
|
46
|
+
for _k, _v in styles.block do
|
|
51
47
|
_attributes_2[_k] = _v
|
|
52
48
|
end
|
|
53
49
|
_attributes_2.LayoutOrder = 1
|
|
@@ -57,6 +53,7 @@ local function GradientEditor(props)
|
|
|
57
53
|
local _attributes_4 = table.clone(styles.label)
|
|
58
54
|
setmetatable(_attributes_4, nil)
|
|
59
55
|
_attributes_4.Text = "Color"
|
|
56
|
+
_attributes_4.LayoutOrder = 1
|
|
60
57
|
local _exp_2 = React.createElement("frame", _attributes_2, _exp_1, React.createElement("textlabel", _attributes_4), React.createElement(ColorSequenceEditor, {
|
|
61
58
|
value = value.color,
|
|
62
59
|
disabled = disabled,
|
|
@@ -70,7 +67,7 @@ local function GradientEditor(props)
|
|
|
70
67
|
local _attributes_5 = {
|
|
71
68
|
key = "Transparency",
|
|
72
69
|
}
|
|
73
|
-
for _k, _v in styles.
|
|
70
|
+
for _k, _v in styles.block do
|
|
74
71
|
_attributes_5[_k] = _v
|
|
75
72
|
end
|
|
76
73
|
_attributes_5.LayoutOrder = 2
|
|
@@ -80,6 +77,7 @@ local function GradientEditor(props)
|
|
|
80
77
|
local _attributes_7 = table.clone(styles.label)
|
|
81
78
|
setmetatable(_attributes_7, nil)
|
|
82
79
|
_attributes_7.Text = "Transparency"
|
|
80
|
+
_attributes_7.LayoutOrder = 1
|
|
83
81
|
local _exp_4 = React.createElement("frame", _attributes_5, _exp_3, React.createElement("textlabel", _attributes_7), React.createElement(NumberSequenceEditor, {
|
|
84
82
|
value = value.transparency,
|
|
85
83
|
disabled = disabled,
|
|
@@ -91,40 +89,56 @@ local function GradientEditor(props)
|
|
|
91
89
|
end,
|
|
92
90
|
}))
|
|
93
91
|
local _attributes_8 = {
|
|
94
|
-
key = "
|
|
92
|
+
key = "Metrics",
|
|
95
93
|
}
|
|
96
|
-
for _k, _v in styles.
|
|
94
|
+
for _k, _v in styles.metrics do
|
|
97
95
|
_attributes_8[_k] = _v
|
|
98
96
|
end
|
|
99
97
|
_attributes_8.LayoutOrder = 3
|
|
100
|
-
local _attributes_9 = table.clone(styles.
|
|
98
|
+
local _attributes_9 = table.clone(styles.metricsRow)
|
|
101
99
|
setmetatable(_attributes_9, nil)
|
|
102
100
|
local _exp_5 = React.createElement("uilistlayout", _attributes_9)
|
|
103
|
-
local _attributes_10 =
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
local _attributes_10 = {
|
|
102
|
+
key = "Rotation",
|
|
103
|
+
}
|
|
104
|
+
for _k, _v in styles.metric do
|
|
105
|
+
_attributes_10[_k] = _v
|
|
106
|
+
end
|
|
107
|
+
_attributes_10.LayoutOrder = 1
|
|
108
|
+
local _attributes_11 = table.clone(styles.metricInner)
|
|
109
|
+
setmetatable(_attributes_11, nil)
|
|
110
|
+
local _exp_6 = React.createElement("uilistlayout", _attributes_11)
|
|
111
|
+
local _attributes_12 = table.clone(styles.metricLabel)
|
|
112
|
+
setmetatable(_attributes_12, nil)
|
|
113
|
+
_attributes_12.Text = "Rotation"
|
|
114
|
+
_attributes_12.LayoutOrder = 1
|
|
115
|
+
local _exp_7 = React.createElement("textlabel", _attributes_12)
|
|
116
|
+
local _attributes_13 = table.clone(styles.metricField)
|
|
117
|
+
setmetatable(_attributes_13, nil)
|
|
118
|
+
_attributes_13.LayoutOrder = 2
|
|
119
|
+
local _exp_8 = React.createElement("frame", _attributes_10, _exp_6, _exp_7, React.createElement("frame", _attributes_13, React.createElement(NumberInput, {
|
|
107
120
|
value = value.rotation,
|
|
108
121
|
disabled = disabled,
|
|
109
122
|
width = UDim.new(1, 0),
|
|
110
123
|
onChange = function(rotation)
|
|
111
124
|
return onChange(patchGradientRotation(value, rotation))
|
|
112
125
|
end,
|
|
113
|
-
}))
|
|
114
|
-
local
|
|
126
|
+
})))
|
|
127
|
+
local _attributes_14 = {
|
|
115
128
|
key = "Offset",
|
|
116
129
|
}
|
|
117
|
-
for _k, _v in styles.
|
|
118
|
-
|
|
130
|
+
for _k, _v in styles.metric do
|
|
131
|
+
_attributes_14[_k] = _v
|
|
119
132
|
end
|
|
120
|
-
|
|
121
|
-
local
|
|
122
|
-
setmetatable(
|
|
123
|
-
local
|
|
124
|
-
local
|
|
125
|
-
setmetatable(
|
|
126
|
-
|
|
127
|
-
|
|
133
|
+
_attributes_14.LayoutOrder = 2
|
|
134
|
+
local _attributes_15 = table.clone(styles.column)
|
|
135
|
+
setmetatable(_attributes_15, nil)
|
|
136
|
+
local _exp_9 = React.createElement("uilistlayout", _attributes_15)
|
|
137
|
+
local _attributes_16 = table.clone(styles.metricLabel)
|
|
138
|
+
setmetatable(_attributes_16, nil)
|
|
139
|
+
_attributes_16.Text = "Offset"
|
|
140
|
+
_attributes_16.LayoutOrder = 1
|
|
141
|
+
local _exp_10 = React.createElement("frame", _attributes_8, _exp_5, _exp_8, React.createElement("frame", _attributes_14, _exp_9, React.createElement("textlabel", _attributes_16), React.createElement(VectorEditor, {
|
|
128
142
|
value = value.offset,
|
|
129
143
|
disabled = disabled,
|
|
130
144
|
onChange = function(offset)
|
|
@@ -133,15 +147,15 @@ local function GradientEditor(props)
|
|
|
133
147
|
_object.offset = offset
|
|
134
148
|
return onChange(_object)
|
|
135
149
|
end,
|
|
136
|
-
}))
|
|
137
|
-
local
|
|
150
|
+
})))
|
|
151
|
+
local _attributes_17 = {
|
|
138
152
|
key = "Enabled",
|
|
139
153
|
}
|
|
140
|
-
for _k, _v in styles.
|
|
141
|
-
|
|
154
|
+
for _k, _v in styles.block do
|
|
155
|
+
_attributes_17[_k] = _v
|
|
142
156
|
end
|
|
143
|
-
|
|
144
|
-
return React.createElement(
|
|
157
|
+
_attributes_17.LayoutOrder = 4
|
|
158
|
+
return React.createElement(SxHost, _attributes, _exp, _exp_2, _exp_4, _exp_10, React.createElement("frame", _attributes_17, React.createElement(Switch, {
|
|
145
159
|
value = value.enabled,
|
|
146
160
|
disabled = disabled,
|
|
147
161
|
label = "Enabled",
|
|
@@ -13,22 +13,55 @@ local useGradientEditorStyles = componentStyles("GradientEditor", function(theme
|
|
|
13
13
|
},
|
|
14
14
|
column = {
|
|
15
15
|
FillDirection = Enum.FillDirection.Vertical,
|
|
16
|
-
Padding = UDim.new(0, theme.padding.calc(
|
|
16
|
+
Padding = UDim.new(0, theme.padding.calc(0.5)),
|
|
17
17
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
18
18
|
},
|
|
19
|
-
|
|
19
|
+
block = {
|
|
20
20
|
Size = UDim2.new(1, 0, 0, 0),
|
|
21
21
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
22
22
|
BackgroundTransparency = 1,
|
|
23
23
|
},
|
|
24
24
|
label = {
|
|
25
|
-
Size = UDim2.new(1, 0, 0, theme.spacing.calc(
|
|
25
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(2)),
|
|
26
26
|
BackgroundTransparency = 1,
|
|
27
27
|
Font = theme.typography.fontFamilies.default,
|
|
28
|
-
TextSize = theme.typography.fontSizes.
|
|
28
|
+
TextSize = theme.typography.fontSizes.button,
|
|
29
29
|
TextColor3 = theme.palette.text.secondary,
|
|
30
30
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
31
31
|
},
|
|
32
|
+
metrics = {
|
|
33
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
34
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
35
|
+
BackgroundTransparency = 1,
|
|
36
|
+
},
|
|
37
|
+
metricsRow = {
|
|
38
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
39
|
+
Padding = UDim.new(0, theme.padding.calc(1)),
|
|
40
|
+
VerticalAlignment = Enum.VerticalAlignment.Top,
|
|
41
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
42
|
+
},
|
|
43
|
+
metric = {
|
|
44
|
+
Size = UDim2.new(0.5, -theme.padding.calc(0.5), 0, 0),
|
|
45
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
46
|
+
BackgroundTransparency = 1,
|
|
47
|
+
},
|
|
48
|
+
metricInner = {
|
|
49
|
+
FillDirection = Enum.FillDirection.Vertical,
|
|
50
|
+
Padding = UDim.new(0, theme.padding.calc(0.5)),
|
|
51
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
52
|
+
},
|
|
53
|
+
metricLabel = {
|
|
54
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(2)),
|
|
55
|
+
BackgroundTransparency = 1,
|
|
56
|
+
Font = theme.typography.fontFamilies.default,
|
|
57
|
+
TextSize = theme.typography.fontSizes.button,
|
|
58
|
+
TextColor3 = theme.palette.text.secondary,
|
|
59
|
+
TextXAlignment = Enum.TextXAlignment.Left,
|
|
60
|
+
},
|
|
61
|
+
metricField = {
|
|
62
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(3)),
|
|
63
|
+
BackgroundTransparency = 1,
|
|
64
|
+
},
|
|
32
65
|
})
|
|
33
66
|
end)
|
|
34
67
|
local default = useGradientEditorStyles
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
2
|
+
import { StyleState } from "../../../../theme/styles/utilities/resolveStyle";
|
|
3
|
+
import { SxInput } from "../../../../theme/styles/utilities/resolveSx";
|
|
4
|
+
export interface SxHostProps {
|
|
5
|
+
tag?: string;
|
|
6
|
+
base?: object;
|
|
7
|
+
className?: object;
|
|
8
|
+
sx?: SxInput | object;
|
|
9
|
+
state?: StyleState;
|
|
10
|
+
hostRef?: React.Ref<any>;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
declare function SxHost(props: SxHostProps): React.ReactElement<{
|
|
15
|
+
ref: (instance: GuiObject) => void;
|
|
16
|
+
children: React.Element<any, string | React.JSXElementConstructor<any>>[];
|
|
17
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
18
|
+
export default SxHost;
|
|
@@ -0,0 +1,210 @@
|
|
|
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 React = _react
|
|
5
|
+
local useEffect = _react.useEffect
|
|
6
|
+
local useRef = _react.useRef
|
|
7
|
+
local useState = _react.useState
|
|
8
|
+
local observeViewport = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "hooks", "viewportObserver").observeViewport
|
|
9
|
+
local useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").useTheme
|
|
10
|
+
local _hostRules = TS.import(script, script.Parent.Parent, "hostRules")
|
|
11
|
+
local elementProps = _hostRules.elementProps
|
|
12
|
+
local elementType = _hostRules.elementType
|
|
13
|
+
local hostKind = _hostRules.hostKind
|
|
14
|
+
local hostRest = _hostRules.hostRest
|
|
15
|
+
local layoutGapPatch = _hostRules.layoutGapPatch
|
|
16
|
+
local sxUsesBreakpoints = _hostRules.sxUsesBreakpoints
|
|
17
|
+
local paintHostStyle = TS.import(script, script.Parent.Parent, "hostPaint").paintHostStyle
|
|
18
|
+
local function setRef(hostRef, instance)
|
|
19
|
+
if hostRef == nil then
|
|
20
|
+
return nil
|
|
21
|
+
end
|
|
22
|
+
local _hostRef = hostRef
|
|
23
|
+
if type(_hostRef) == "function" then
|
|
24
|
+
hostRef(instance)
|
|
25
|
+
return nil
|
|
26
|
+
end
|
|
27
|
+
hostRef.current = instance
|
|
28
|
+
end
|
|
29
|
+
local function SxHost(props)
|
|
30
|
+
local _condition = props.tag
|
|
31
|
+
if _condition == nil then
|
|
32
|
+
_condition = "frame"
|
|
33
|
+
end
|
|
34
|
+
local tag = _condition
|
|
35
|
+
local sx = props.sx
|
|
36
|
+
local _binding = useTheme()
|
|
37
|
+
local theme = _binding.theme
|
|
38
|
+
local bound = useRef()
|
|
39
|
+
local width, setWidth = useState(nil)
|
|
40
|
+
local hover, setHover = useState(false)
|
|
41
|
+
local pressed, setPressed = useState(false)
|
|
42
|
+
local focused, setFocused = useState(false)
|
|
43
|
+
useEffect(function()
|
|
44
|
+
local host = bound.current
|
|
45
|
+
if host == nil or not sxUsesBreakpoints(sx) then
|
|
46
|
+
return nil
|
|
47
|
+
end
|
|
48
|
+
return observeViewport(host, function(size)
|
|
49
|
+
setWidth(function(prev)
|
|
50
|
+
return if prev == size.width then prev else size.width
|
|
51
|
+
end)
|
|
52
|
+
end)
|
|
53
|
+
end, { sx })
|
|
54
|
+
local passed = props.state
|
|
55
|
+
local _result = passed
|
|
56
|
+
if _result ~= nil then
|
|
57
|
+
_result = _result.disabled
|
|
58
|
+
end
|
|
59
|
+
local locked = _result == true
|
|
60
|
+
local _exp = props.base
|
|
61
|
+
local _exp_1 = props.className
|
|
62
|
+
local _object = {
|
|
63
|
+
hover = hover,
|
|
64
|
+
pressed = pressed,
|
|
65
|
+
focused = focused,
|
|
66
|
+
}
|
|
67
|
+
if passed then
|
|
68
|
+
for _k, _v in passed do
|
|
69
|
+
_object[_k] = _v
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
local paint = paintHostStyle(theme, _exp, _exp_1, sx, width, _object)
|
|
73
|
+
local rest = hostRest(props)
|
|
74
|
+
local caller = rest.Event
|
|
75
|
+
local pressable = tag == "textbutton" or tag == "imagebutton"
|
|
76
|
+
local _object_1 = {}
|
|
77
|
+
if caller then
|
|
78
|
+
for _k, _v in caller do
|
|
79
|
+
_object_1[_k] = _v
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
_object_1.MouseEnter = function(...)
|
|
83
|
+
local args = { ... }
|
|
84
|
+
if not locked then
|
|
85
|
+
setHover(true)
|
|
86
|
+
end
|
|
87
|
+
local _result_1 = caller
|
|
88
|
+
if _result_1 ~= nil then
|
|
89
|
+
_result_1 = _result_1.MouseEnter
|
|
90
|
+
if _result_1 ~= nil then
|
|
91
|
+
_result_1(unpack(args))
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
_object_1.MouseLeave = function(...)
|
|
96
|
+
local args = { ... }
|
|
97
|
+
setHover(false)
|
|
98
|
+
setPressed(false)
|
|
99
|
+
local _result_1 = caller
|
|
100
|
+
if _result_1 ~= nil then
|
|
101
|
+
_result_1 = _result_1.MouseLeave
|
|
102
|
+
if _result_1 ~= nil then
|
|
103
|
+
_result_1(unpack(args))
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
_object_1.SelectionGained = function(...)
|
|
108
|
+
local args = { ... }
|
|
109
|
+
if not locked then
|
|
110
|
+
setFocused(true)
|
|
111
|
+
end
|
|
112
|
+
local _result_1 = caller
|
|
113
|
+
if _result_1 ~= nil then
|
|
114
|
+
_result_1 = _result_1.SelectionGained
|
|
115
|
+
if _result_1 ~= nil then
|
|
116
|
+
_result_1(unpack(args))
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
_object_1.SelectionLost = function(...)
|
|
121
|
+
local args = { ... }
|
|
122
|
+
setFocused(false)
|
|
123
|
+
local _result_1 = caller
|
|
124
|
+
if _result_1 ~= nil then
|
|
125
|
+
_result_1 = _result_1.SelectionLost
|
|
126
|
+
if _result_1 ~= nil then
|
|
127
|
+
_result_1(unpack(args))
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
rest.Event = _object_1
|
|
132
|
+
-- GuiButton-only; Frames reject MouseButton1* and crash Select/Menu hosts.
|
|
133
|
+
if pressable then
|
|
134
|
+
local events = rest.Event
|
|
135
|
+
events.MouseButton1Down = function(...)
|
|
136
|
+
local args = { ... }
|
|
137
|
+
if not locked then
|
|
138
|
+
setPressed(true)
|
|
139
|
+
end
|
|
140
|
+
local _result_1 = caller
|
|
141
|
+
if _result_1 ~= nil then
|
|
142
|
+
_result_1 = _result_1.MouseButton1Down
|
|
143
|
+
if _result_1 ~= nil then
|
|
144
|
+
_result_1(unpack(args))
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
events.MouseButton1Up = function(...)
|
|
149
|
+
local args = { ... }
|
|
150
|
+
setPressed(false)
|
|
151
|
+
local _result_1 = caller
|
|
152
|
+
if _result_1 ~= nil then
|
|
153
|
+
_result_1 = _result_1.MouseButton1Up
|
|
154
|
+
if _result_1 ~= nil then
|
|
155
|
+
_result_1(unpack(args))
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
local nodes = React.Children.toArray(props.children)
|
|
161
|
+
local painted = {}
|
|
162
|
+
local hasPad = false
|
|
163
|
+
local hasCorner = false
|
|
164
|
+
local hasGradient = false
|
|
165
|
+
for _, node in nodes do
|
|
166
|
+
if not React.isValidElement(node) then
|
|
167
|
+
continue
|
|
168
|
+
end
|
|
169
|
+
local kind = hostKind(elementType(node))
|
|
170
|
+
if kind == "uipadding" then
|
|
171
|
+
hasPad = true
|
|
172
|
+
end
|
|
173
|
+
if kind == "uicorner" then
|
|
174
|
+
hasCorner = true
|
|
175
|
+
end
|
|
176
|
+
if kind == "uigradient" then
|
|
177
|
+
hasGradient = true
|
|
178
|
+
end
|
|
179
|
+
local patch = if kind ~= nil then layoutGapPatch(kind, elementProps(node), paint.gap) else nil
|
|
180
|
+
local _arg0 = if patch ~= nil then React.cloneElement(node, patch) else node
|
|
181
|
+
table.insert(painted, _arg0)
|
|
182
|
+
end
|
|
183
|
+
if not hasPad and paint.padding ~= nil then
|
|
184
|
+
local _arg0 = React.createElement("uipadding", paint.padding)
|
|
185
|
+
table.insert(painted, _arg0)
|
|
186
|
+
end
|
|
187
|
+
if not hasCorner and paint.corner ~= nil then
|
|
188
|
+
local _arg0 = React.createElement("uicorner", paint.corner)
|
|
189
|
+
table.insert(painted, _arg0)
|
|
190
|
+
end
|
|
191
|
+
if not hasGradient and paint.gradient ~= nil then
|
|
192
|
+
local _arg0 = React.createElement("uigradient", paint.gradient)
|
|
193
|
+
table.insert(painted, _arg0)
|
|
194
|
+
end
|
|
195
|
+
local _object_2 = table.clone(paint.props)
|
|
196
|
+
setmetatable(_object_2, nil)
|
|
197
|
+
for _k, _v in rest do
|
|
198
|
+
_object_2[_k] = _v
|
|
199
|
+
end
|
|
200
|
+
_object_2.ref = function(instance)
|
|
201
|
+
bound.current = instance
|
|
202
|
+
setRef(props.hostRef, instance)
|
|
203
|
+
end
|
|
204
|
+
_object_2.children = painted
|
|
205
|
+
return React.createElement(tag, _object_2)
|
|
206
|
+
end
|
|
207
|
+
local default = SxHost
|
|
208
|
+
return {
|
|
209
|
+
default = default,
|
|
210
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { resolveSx, ResolvedSx, SxInput } from "../../../theme/styles/utilities/resolveSx";
|
|
2
|
+
import { StyleState } from "../../../theme/styles/utilities/resolveStyle";
|
|
3
|
+
export interface HostPaint {
|
|
4
|
+
props: {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
padding?: ResolvedSx["padding"];
|
|
8
|
+
corner?: ResolvedSx["corner"];
|
|
9
|
+
gradient?: ResolvedSx["gradient"];
|
|
10
|
+
gap?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function paintHostStyle(theme: Parameters<typeof resolveSx>[0], base: object | undefined, className: object | undefined, sx: SxInput | undefined, width: number | undefined, state: StyleState | undefined): HostPaint;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local resolveSx = TS.import(script, script.Parent.Parent.Parent.Parent, "theme", "styles", "utilities", "resolveSx").resolveSx
|
|
4
|
+
local resolveStyle = TS.import(script, script.Parent.Parent.Parent.Parent, "theme", "styles", "utilities", "resolveStyle").resolveStyle
|
|
5
|
+
local function paintHostStyle(theme, base, className, sx, width, state)
|
|
6
|
+
local resolved = resolveSx(theme, sx, width)
|
|
7
|
+
local _object = {}
|
|
8
|
+
local _spread = (base or {})
|
|
9
|
+
if _spread then
|
|
10
|
+
for _k, _v in _spread do
|
|
11
|
+
_object[_k] = _v
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
local _spread_1 = (className or {})
|
|
15
|
+
if _spread_1 then
|
|
16
|
+
for _k, _v in _spread_1 do
|
|
17
|
+
_object[_k] = _v
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
for _k, _v in resolved.root do
|
|
21
|
+
_object[_k] = _v
|
|
22
|
+
end
|
|
23
|
+
local merged = _object
|
|
24
|
+
return {
|
|
25
|
+
props = resolveStyle(merged, state or {}),
|
|
26
|
+
padding = resolved.padding,
|
|
27
|
+
corner = resolved.corner,
|
|
28
|
+
gradient = resolved.gradient,
|
|
29
|
+
gap = resolved.gap,
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
return {
|
|
33
|
+
paintHostStyle = paintHostStyle,
|
|
34
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function sxUsesBreakpoints(sx: object | undefined): boolean;
|
|
2
|
+
export declare function elementProps(element: unknown): {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
export declare function elementType(element: unknown): unknown;
|
|
6
|
+
export declare function hostKind(typeName: unknown): string | undefined;
|
|
7
|
+
/** Explicit layout padding wins. Otherwise sx `gap` fills the empty field. */
|
|
8
|
+
export declare function layoutGapPatch(kind: string, props: {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}, gap: number | undefined): {
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
} | undefined;
|
|
13
|
+
export declare function hostRest(props: object): {
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local SKIP = {
|
|
3
|
+
tag = true,
|
|
4
|
+
base = true,
|
|
5
|
+
className = true,
|
|
6
|
+
sx = true,
|
|
7
|
+
state = true,
|
|
8
|
+
hostRef = true,
|
|
9
|
+
children = true,
|
|
10
|
+
}
|
|
11
|
+
local function sxUsesBreakpoints(sx)
|
|
12
|
+
if sx == nil then
|
|
13
|
+
return false
|
|
14
|
+
end
|
|
15
|
+
for _, value in pairs(sx) do
|
|
16
|
+
if typeof(value) ~= "table" then
|
|
17
|
+
continue
|
|
18
|
+
end
|
|
19
|
+
local record = value
|
|
20
|
+
if record.phone ~= nil or record.tablet ~= nil or record.desktop ~= nil then
|
|
21
|
+
return true
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
return false
|
|
25
|
+
end
|
|
26
|
+
local function elementProps(element)
|
|
27
|
+
local _element = element
|
|
28
|
+
if typeof(_element) ~= "table" then
|
|
29
|
+
return {}
|
|
30
|
+
end
|
|
31
|
+
local props = element.props
|
|
32
|
+
if typeof(props) ~= "table" then
|
|
33
|
+
return {}
|
|
34
|
+
end
|
|
35
|
+
return props
|
|
36
|
+
end
|
|
37
|
+
local function elementType(element)
|
|
38
|
+
local _element = element
|
|
39
|
+
if typeof(_element) ~= "table" then
|
|
40
|
+
return nil
|
|
41
|
+
end
|
|
42
|
+
return element.type
|
|
43
|
+
end
|
|
44
|
+
local function hostKind(typeName)
|
|
45
|
+
local _typeName = typeName
|
|
46
|
+
if not (type(_typeName) == "string") then
|
|
47
|
+
return nil
|
|
48
|
+
end
|
|
49
|
+
return string.lower(typeName)
|
|
50
|
+
end
|
|
51
|
+
--* Explicit layout padding wins. Otherwise sx `gap` fills the empty field.
|
|
52
|
+
local function layoutGapPatch(kind, props, gap)
|
|
53
|
+
if gap == nil then
|
|
54
|
+
return nil
|
|
55
|
+
end
|
|
56
|
+
if kind == "uilistlayout" then
|
|
57
|
+
if props.Padding ~= nil then
|
|
58
|
+
return nil
|
|
59
|
+
end
|
|
60
|
+
return {
|
|
61
|
+
Padding = UDim.new(0, gap),
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
if kind == "uigridlayout" then
|
|
65
|
+
if props.CellPadding ~= nil then
|
|
66
|
+
return nil
|
|
67
|
+
end
|
|
68
|
+
return {
|
|
69
|
+
CellPadding = UDim2.new(0, gap, 0, gap),
|
|
70
|
+
}
|
|
71
|
+
end
|
|
72
|
+
return nil
|
|
73
|
+
end
|
|
74
|
+
local function hostRest(props)
|
|
75
|
+
local rest = {}
|
|
76
|
+
for key, value in pairs(props) do
|
|
77
|
+
local name = key
|
|
78
|
+
if SKIP[name] == true then
|
|
79
|
+
continue
|
|
80
|
+
end
|
|
81
|
+
rest[name] = value
|
|
82
|
+
end
|
|
83
|
+
return rest
|
|
84
|
+
end
|
|
85
|
+
return {
|
|
86
|
+
sxUsesBreakpoints = sxUsesBreakpoints,
|
|
87
|
+
elementProps = elementProps,
|
|
88
|
+
elementType = elementType,
|
|
89
|
+
hostKind = hostKind,
|
|
90
|
+
layoutGapPatch = layoutGapPatch,
|
|
91
|
+
hostRest = hostRest,
|
|
92
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
exports.SxHost = TS.import(script, script, "components", "SxHost").default
|
|
5
|
+
exports.paintHostStyle = TS.import(script, script, "hostPaint").paintHostStyle
|
|
6
|
+
local _hostRules = TS.import(script, script, "hostRules")
|
|
7
|
+
exports.elementProps = _hostRules.elementProps
|
|
8
|
+
exports.elementType = _hostRules.elementType
|
|
9
|
+
exports.hostKind = _hostRules.hostKind
|
|
10
|
+
exports.hostRest = _hostRules.hostRest
|
|
11
|
+
exports.layoutGapPatch = _hostRules.layoutGapPatch
|
|
12
|
+
exports.sxUsesBreakpoints = _hostRules.sxUsesBreakpoints
|
|
13
|
+
return exports
|
|
@@ -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 useIconStyles = TS.import(script, script.Parent, "Icon.styles").default
|
|
5
6
|
local function Icon(props)
|
|
6
7
|
local _binding = props
|
|
@@ -12,29 +13,21 @@ local function Icon(props)
|
|
|
12
13
|
local ref = _binding.ref
|
|
13
14
|
local _binding_1 = useIconStyles(props)
|
|
14
15
|
local container = _binding_1.container
|
|
15
|
-
local _attributes = {
|
|
16
|
+
local _attributes = {
|
|
17
|
+
tag = "imagelabel",
|
|
18
|
+
}
|
|
16
19
|
local _condition = id
|
|
17
20
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
18
21
|
_condition = "Icon"
|
|
19
22
|
end
|
|
20
23
|
_attributes.key = _condition
|
|
21
|
-
_attributes.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if className then
|
|
26
|
-
for _k, _v in className do
|
|
27
|
-
_attributes[_k] = _v
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
if sx then
|
|
31
|
-
for _k, _v in sx do
|
|
32
|
-
_attributes[_k] = _v
|
|
33
|
-
end
|
|
34
|
-
end
|
|
24
|
+
_attributes.hostRef = ref
|
|
25
|
+
_attributes.base = container
|
|
26
|
+
_attributes.className = className
|
|
27
|
+
_attributes.sx = sx
|
|
35
28
|
_attributes.Image = tostring(icon)
|
|
36
29
|
_attributes.ImageColor3 = tint or container.ImageColor3
|
|
37
|
-
return React.createElement(
|
|
30
|
+
return React.createElement(SxHost, _attributes)
|
|
38
31
|
end
|
|
39
32
|
local default = Icon
|
|
40
33
|
return {
|