@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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
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
|
+
local controlMetrics = _theme.controlMetrics
|
|
5
6
|
local createStyles = _theme.createStyles
|
|
6
7
|
local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
7
8
|
local selected = _param.selected
|
|
@@ -12,32 +13,76 @@ local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
|
12
13
|
if disabled == nil then
|
|
13
14
|
disabled = false
|
|
14
15
|
end
|
|
16
|
+
local deletable = _param.deletable
|
|
17
|
+
if deletable == nil then
|
|
18
|
+
deletable = false
|
|
19
|
+
end
|
|
20
|
+
local size = _param.size
|
|
21
|
+
local variant = _param.variant
|
|
22
|
+
if variant == nil then
|
|
23
|
+
variant = "filled"
|
|
24
|
+
end
|
|
25
|
+
local color = _param.color
|
|
26
|
+
if color == nil then
|
|
27
|
+
color = "default"
|
|
28
|
+
end
|
|
29
|
+
local metrics = controlMetrics(theme.density, size)
|
|
30
|
+
local padY = if size == "small" then 0.25 elseif size == "large" then 0.75 else 0.5
|
|
31
|
+
local padX = if size == "small" then 1 elseif size == "large" then 2 else 1.5
|
|
32
|
+
local deletePx = metrics.icon
|
|
33
|
+
local primary = color == "primary"
|
|
34
|
+
local ink = if disabled then theme.palette.text.disabled elseif primary then if variant == "outlined" then theme.palette.primary.main else theme.palette.primary.on else theme.palette.text.primary
|
|
15
35
|
return createStyles({
|
|
16
36
|
root = {
|
|
17
37
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
18
38
|
Size = UDim2.fromScale(0, 0),
|
|
19
|
-
BackgroundColor3 = if selected then theme.palette.action.selected else theme.palette.surface.input,
|
|
39
|
+
BackgroundColor3 = if primary and variant ~= "outlined" then theme.palette.primary.main elseif selected then theme.palette.action.selected else theme.palette.surface.input,
|
|
40
|
+
BackgroundTransparency = if variant == "outlined" and selected ~= true then 1 else 0,
|
|
20
41
|
BorderSizePixel = 0,
|
|
21
42
|
AutoButtonColor = false,
|
|
22
43
|
Active = not disabled,
|
|
23
44
|
Selectable = not disabled,
|
|
24
|
-
TextColor3 =
|
|
45
|
+
TextColor3 = ink,
|
|
25
46
|
Font = theme.typography.fontFamilies.default,
|
|
26
|
-
TextSize =
|
|
47
|
+
TextSize = metrics.font,
|
|
27
48
|
},
|
|
28
49
|
padding = {
|
|
29
|
-
PaddingTop = UDim.new(0, theme.padding.calc(
|
|
30
|
-
PaddingBottom = UDim.new(0, theme.padding.calc(
|
|
31
|
-
PaddingLeft = UDim.new(0, theme.padding.calc(
|
|
32
|
-
PaddingRight = UDim.new(0, theme.padding.calc(
|
|
50
|
+
PaddingTop = UDim.new(0, theme.padding.calc(padY)),
|
|
51
|
+
PaddingBottom = UDim.new(0, theme.padding.calc(padY)),
|
|
52
|
+
PaddingLeft = UDim.new(0, theme.padding.calc(padX)),
|
|
53
|
+
PaddingRight = UDim.new(0, theme.padding.calc(if deletable then 0.5 else padX)),
|
|
33
54
|
},
|
|
34
55
|
corner = {
|
|
35
56
|
CornerRadius = UDim.new(theme.shape.pillScale, 0),
|
|
36
57
|
},
|
|
37
58
|
stroke = {
|
|
38
|
-
Color = theme.palette.border,
|
|
59
|
+
Color = if primary then theme.palette.primary.main else theme.palette.border,
|
|
39
60
|
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
40
|
-
Transparency = if selected then 1 else 0,
|
|
61
|
+
Transparency = if variant == "outlined" then (if disabled then 0.5 else 0) elseif primary or selected then 1 else 0,
|
|
62
|
+
},
|
|
63
|
+
row = {
|
|
64
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
65
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
66
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
67
|
+
Padding = UDim.new(0, theme.padding.calc(0.5)),
|
|
68
|
+
},
|
|
69
|
+
label = {
|
|
70
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
71
|
+
Size = UDim2.fromScale(0, 0),
|
|
72
|
+
BackgroundTransparency = 1,
|
|
73
|
+
BorderSizePixel = 0,
|
|
74
|
+
TextColor3 = ink,
|
|
75
|
+
Font = theme.typography.fontFamilies.default,
|
|
76
|
+
TextSize = metrics.font,
|
|
77
|
+
LayoutOrder = 1,
|
|
78
|
+
},
|
|
79
|
+
delete = {
|
|
80
|
+
Size = UDim2.fromOffset(deletePx, deletePx),
|
|
81
|
+
BackgroundTransparency = 1,
|
|
82
|
+
BorderSizePixel = 0,
|
|
83
|
+
AutoButtonColor = false,
|
|
84
|
+
ImageColor3 = if disabled then theme.palette.text.disabled elseif primary and variant ~= "outlined" then theme.palette.primary.on else theme.palette.text.secondary,
|
|
85
|
+
LayoutOrder = 2,
|
|
41
86
|
},
|
|
42
87
|
})
|
|
43
88
|
end)
|
|
@@ -6,10 +6,12 @@ local useEffect = _react.useEffect
|
|
|
6
6
|
local useRef = _react.useRef
|
|
7
7
|
local useReducedMotion = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "hooks").useReducedMotion
|
|
8
8
|
local useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").useTheme
|
|
9
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
9
10
|
local _motion = TS.import(script, script.Parent.Parent.Parent, "motion")
|
|
10
11
|
local arcKeys = _motion.arcKeys
|
|
11
12
|
local loopProperty = _motion.loopProperty
|
|
12
13
|
local progressSpin = _motion.progressSpin
|
|
14
|
+
local spinArcKeys = _motion.spinArcKeys
|
|
13
15
|
local function CircularProgress(props)
|
|
14
16
|
local _binding = props
|
|
15
17
|
local value = _binding.value
|
|
@@ -38,7 +40,17 @@ local function CircularProgress(props)
|
|
|
38
40
|
local shown = if indeterminate then (if motion == "spin" then nil else 0.25) else value
|
|
39
41
|
local _result
|
|
40
42
|
if shown == nil then
|
|
41
|
-
|
|
43
|
+
local _exp = spinArcKeys()
|
|
44
|
+
-- ▼ ReadonlyArray.map ▼
|
|
45
|
+
local _newValue = table.create(#_exp)
|
|
46
|
+
local _callback = function(key)
|
|
47
|
+
return NumberSequenceKeypoint.new(key.time, key.transparency)
|
|
48
|
+
end
|
|
49
|
+
for _k, _v in _exp do
|
|
50
|
+
_newValue[_k] = _callback(_v, _k - 1, _exp)
|
|
51
|
+
end
|
|
52
|
+
-- ▲ ReadonlyArray.map ▲
|
|
53
|
+
_result = NumberSequence.new(_newValue)
|
|
42
54
|
else
|
|
43
55
|
local _exp = arcKeys(shown)
|
|
44
56
|
-- ▼ ReadonlyArray.map ▼
|
|
@@ -66,32 +78,31 @@ local function CircularProgress(props)
|
|
|
66
78
|
end
|
|
67
79
|
gradient.Rotation = -90
|
|
68
80
|
end, { motion })
|
|
69
|
-
local _attributes = {
|
|
81
|
+
local _attributes = {
|
|
82
|
+
tag = "frame",
|
|
83
|
+
}
|
|
70
84
|
local _condition = id
|
|
71
85
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
72
86
|
_condition = "CircularProgress"
|
|
73
87
|
end
|
|
74
88
|
_attributes.key = _condition
|
|
75
|
-
_attributes.
|
|
76
|
-
_attributes.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
return React.createElement("frame", _attributes, React.createElement("uicorner", {
|
|
89
|
+
_attributes.hostRef = ref
|
|
90
|
+
_attributes.base = {
|
|
91
|
+
Size = UDim2.new(0, size, 0, size),
|
|
92
|
+
BackgroundTransparency = 1,
|
|
93
|
+
BorderSizePixel = 0,
|
|
94
|
+
}
|
|
95
|
+
_attributes.className = className
|
|
96
|
+
_attributes.sx = sx
|
|
97
|
+
_attributes.state = {
|
|
98
|
+
disabled = disabled,
|
|
99
|
+
}
|
|
100
|
+
return React.createElement(SxHost, _attributes, React.createElement("uicorner", {
|
|
90
101
|
CornerRadius = UDim.new(1, 0),
|
|
91
102
|
}), React.createElement("uistroke", {
|
|
92
103
|
Color = tint,
|
|
93
104
|
Thickness = thickness,
|
|
94
|
-
Transparency = if disabled then 0.
|
|
105
|
+
Transparency = if disabled then 0.85 else 0.82,
|
|
95
106
|
}), React.createElement("uistroke", {
|
|
96
107
|
Color = tint,
|
|
97
108
|
Thickness = thickness,
|
|
@@ -7,6 +7,7 @@ local useRef = _react.useRef
|
|
|
7
7
|
local useState = _react.useState
|
|
8
8
|
local UserInputService = TS.import(script, TS.getModule(script, "@rbxts", "services")).UserInputService
|
|
9
9
|
local useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").useTheme
|
|
10
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
10
11
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
11
12
|
local Input = TS.import(script, script.Parent.Parent.Parent, "input").Input
|
|
12
13
|
local NumberInput = TS.import(script, script.Parent.Parent.Parent, "numberInput").NumberInput
|
|
@@ -348,7 +349,7 @@ local function ColorPanel(props)
|
|
|
348
349
|
_newValue[_k] = _callback(_v, _k - 1, recents)
|
|
349
350
|
end
|
|
350
351
|
-- ▲ ReadonlyArray.map ▲
|
|
351
|
-
_condition = (React.createElement("frame", _attributes_20, _exp_14, _newValue))
|
|
352
|
+
_condition = (React.createElement("frame", _attributes_20, _exp_14, React.createElement(React.Fragment, nil, _newValue)))
|
|
352
353
|
end
|
|
353
354
|
return React.createElement("frame", _attributes, _exp, _exp_4, _exp_9, _exp_12, _exp_13, _condition)
|
|
354
355
|
end
|
|
@@ -391,26 +392,21 @@ local function ColorPicker(props)
|
|
|
391
392
|
return connection:Disconnect()
|
|
392
393
|
end
|
|
393
394
|
end, { shown, value })
|
|
394
|
-
local _attributes = {
|
|
395
|
+
local _attributes = {
|
|
396
|
+
tag = "frame",
|
|
397
|
+
}
|
|
395
398
|
local _condition = id
|
|
396
399
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
397
400
|
_condition = "ColorPicker"
|
|
398
401
|
end
|
|
399
402
|
_attributes.key = _condition
|
|
400
|
-
_attributes.
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
end
|
|
408
|
-
end
|
|
409
|
-
if sx then
|
|
410
|
-
for _k, _v in sx do
|
|
411
|
-
_attributes[_k] = _v
|
|
412
|
-
end
|
|
413
|
-
end
|
|
403
|
+
_attributes.hostRef = ref
|
|
404
|
+
_attributes.base = styles.field
|
|
405
|
+
_attributes.className = className
|
|
406
|
+
_attributes.sx = sx
|
|
407
|
+
_attributes.state = {
|
|
408
|
+
disabled = disabled,
|
|
409
|
+
}
|
|
414
410
|
local _attributes_1 = table.clone(styles.rowLayout)
|
|
415
411
|
setmetatable(_attributes_1, nil)
|
|
416
412
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
@@ -488,15 +484,15 @@ local function ColorPicker(props)
|
|
|
488
484
|
local _attributes_7 = table.clone(styles.corner)
|
|
489
485
|
setmetatable(_attributes_7, nil)
|
|
490
486
|
local _exp_4 = React.createElement("uicorner", _attributes_7)
|
|
491
|
-
local _attributes_8 = table.clone(styles.
|
|
487
|
+
local _attributes_8 = table.clone(styles.shellStroke)
|
|
492
488
|
setmetatable(_attributes_8, nil)
|
|
493
489
|
local _exp_5 = React.createElement("uistroke", _attributes_8)
|
|
494
490
|
local _attributes_9 = table.clone(styles.shellPad)
|
|
495
491
|
setmetatable(_attributes_9, nil)
|
|
496
492
|
_condition_1 = (React.createElement(Popup, {
|
|
497
493
|
anchor = anchor,
|
|
498
|
-
preferredWidth = theme.spacing.calc(
|
|
499
|
-
preferredHeight = theme.spacing.calc(
|
|
494
|
+
preferredWidth = theme.spacing.calc(20),
|
|
495
|
+
preferredHeight = theme.spacing.calc(22),
|
|
500
496
|
onDismiss = close,
|
|
501
497
|
}, React.createElement("frame", _attributes_6, _exp_4, _exp_5, React.createElement("uipadding", _attributes_9), React.createElement(ColorPanel, {
|
|
502
498
|
value = value,
|
|
@@ -504,7 +500,7 @@ local function ColorPicker(props)
|
|
|
504
500
|
onChange = onChange,
|
|
505
501
|
}))))
|
|
506
502
|
end
|
|
507
|
-
return React.createElement(
|
|
503
|
+
return React.createElement(SxHost, _attributes, _exp, _exp_2, _exp_3, _condition_1)
|
|
508
504
|
end
|
|
509
505
|
local default = ColorPicker
|
|
510
506
|
return {
|
|
@@ -15,22 +15,22 @@ local useColorPickerStyles = componentStyles("ColorPicker", function(theme)
|
|
|
15
15
|
},
|
|
16
16
|
column = {
|
|
17
17
|
FillDirection = Enum.FillDirection.Vertical,
|
|
18
|
-
Padding = UDim.new(0, theme.padding.calc(
|
|
18
|
+
Padding = UDim.new(0, theme.padding.calc(0.75)),
|
|
19
19
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
20
20
|
},
|
|
21
21
|
row = {
|
|
22
|
-
Size = UDim2.new(1, 0, 0, theme.spacing.calc(
|
|
22
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(3)),
|
|
23
23
|
BackgroundTransparency = 1,
|
|
24
24
|
BorderSizePixel = 0,
|
|
25
25
|
},
|
|
26
26
|
rowLayout = {
|
|
27
27
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
28
|
-
Padding = UDim.new(0, theme.padding.calc(
|
|
28
|
+
Padding = UDim.new(0, theme.padding.calc(0.5)),
|
|
29
29
|
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
30
30
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
31
31
|
},
|
|
32
32
|
swatch = {
|
|
33
|
-
Size = UDim2.fromOffset(theme.spacing.calc(
|
|
33
|
+
Size = UDim2.fromOffset(theme.spacing.calc(3), theme.spacing.calc(3)),
|
|
34
34
|
BorderSizePixel = 0,
|
|
35
35
|
},
|
|
36
36
|
swatchStroke = {
|
|
@@ -41,11 +41,11 @@ local useColorPickerStyles = componentStyles("ColorPicker", function(theme)
|
|
|
41
41
|
CornerRadius = UDim.new(0, theme.padding.calc(0.5)),
|
|
42
42
|
},
|
|
43
43
|
hex = {
|
|
44
|
-
Size = UDim2.new(1, -theme.spacing.calc(
|
|
44
|
+
Size = UDim2.new(1, -theme.spacing.calc(4), 1, 0),
|
|
45
45
|
BackgroundTransparency = 1,
|
|
46
46
|
},
|
|
47
47
|
plane = {
|
|
48
|
-
Size = UDim2.new(1, 0, 0, theme.spacing.calc(
|
|
48
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(10)),
|
|
49
49
|
BorderSizePixel = 0,
|
|
50
50
|
Active = true,
|
|
51
51
|
},
|
|
@@ -55,7 +55,7 @@ local useColorPickerStyles = componentStyles("ColorPicker", function(theme)
|
|
|
55
55
|
BorderSizePixel = 0,
|
|
56
56
|
},
|
|
57
57
|
cursor = {
|
|
58
|
-
Size = UDim2.fromOffset(theme.spacing.calc(1), theme.spacing.calc(1)),
|
|
58
|
+
Size = UDim2.fromOffset(theme.spacing.calc(1.25), theme.spacing.calc(1.25)),
|
|
59
59
|
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
60
60
|
BackgroundTransparency = 1,
|
|
61
61
|
BorderSizePixel = 0,
|
|
@@ -65,45 +65,55 @@ local useColorPickerStyles = componentStyles("ColorPicker", function(theme)
|
|
|
65
65
|
Thickness = 2,
|
|
66
66
|
},
|
|
67
67
|
hue = {
|
|
68
|
-
Size = UDim2.new(1, 0, 0, theme.spacing.calc(1.
|
|
68
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(1.75)),
|
|
69
69
|
BorderSizePixel = 0,
|
|
70
70
|
Active = true,
|
|
71
71
|
},
|
|
72
72
|
hueKnob = {
|
|
73
|
-
Size = UDim2.fromOffset(theme.padding.calc(1), theme.spacing.calc(1.
|
|
73
|
+
Size = UDim2.fromOffset(theme.padding.calc(1.25), theme.spacing.calc(1.75)),
|
|
74
74
|
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
75
75
|
BackgroundColor3 = theme.palette.text.primary,
|
|
76
76
|
BorderSizePixel = 0,
|
|
77
77
|
},
|
|
78
|
+
sequenceBar = {
|
|
79
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(3)),
|
|
80
|
+
BorderSizePixel = 0,
|
|
81
|
+
Active = true,
|
|
82
|
+
},
|
|
83
|
+
stop = {
|
|
84
|
+
Size = UDim2.fromOffset(theme.spacing.calc(1.5), theme.spacing.calc(1.5)),
|
|
85
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
86
|
+
BorderSizePixel = 0,
|
|
87
|
+
},
|
|
78
88
|
channel = {
|
|
79
|
-
Size = UDim2.new(1 / 3, -theme.padding.calc(
|
|
89
|
+
Size = UDim2.new(1 / 3, -theme.padding.calc(0.5), 0, theme.spacing.calc(3)),
|
|
80
90
|
BackgroundTransparency = 1,
|
|
81
91
|
},
|
|
82
92
|
label = {
|
|
83
|
-
Size = UDim2.new(0, theme.spacing.calc(1), 1, 0),
|
|
93
|
+
Size = UDim2.new(0, theme.spacing.calc(1.5), 1, 0),
|
|
84
94
|
BackgroundTransparency = 1,
|
|
85
95
|
Font = theme.typography.fontFamilies.default,
|
|
86
|
-
TextSize = theme.typography.fontSizes.
|
|
96
|
+
TextSize = theme.typography.fontSizes.button,
|
|
87
97
|
TextColor3 = theme.palette.text.secondary,
|
|
88
98
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
89
99
|
},
|
|
90
100
|
channelField = {
|
|
91
|
-
Size = UDim2.new(1, -theme.spacing.calc(1), 1, 0),
|
|
101
|
+
Size = UDim2.new(1, -theme.spacing.calc(1.5), 1, 0),
|
|
92
102
|
BackgroundTransparency = 1,
|
|
93
103
|
},
|
|
94
104
|
field = {
|
|
95
|
-
Size = UDim2.new(1, 0, 0, theme.spacing.calc(
|
|
105
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(3)),
|
|
96
106
|
BackgroundTransparency = 1,
|
|
97
107
|
BorderSizePixel = 0,
|
|
98
108
|
},
|
|
99
109
|
swatchButton = {
|
|
100
|
-
Size = UDim2.fromOffset(theme.spacing.calc(
|
|
110
|
+
Size = UDim2.fromOffset(theme.spacing.calc(3), theme.spacing.calc(3)),
|
|
101
111
|
BorderSizePixel = 0,
|
|
102
112
|
AutoButtonColor = false,
|
|
103
113
|
Text = "",
|
|
104
114
|
},
|
|
105
115
|
value = {
|
|
106
|
-
Size = UDim2.new(1, -theme.spacing.calc(
|
|
116
|
+
Size = UDim2.new(1, -theme.spacing.calc(4), 1, 0),
|
|
107
117
|
BackgroundTransparency = 1,
|
|
108
118
|
},
|
|
109
119
|
shell = {
|
|
@@ -117,23 +127,27 @@ local useColorPickerStyles = componentStyles("ColorPicker", function(theme)
|
|
|
117
127
|
PaddingLeft = UDim.new(0, theme.padding.calc(1)),
|
|
118
128
|
PaddingRight = UDim.new(0, theme.padding.calc(1)),
|
|
119
129
|
},
|
|
130
|
+
shellStroke = {
|
|
131
|
+
Color = theme.palette.divider,
|
|
132
|
+
Thickness = 1,
|
|
133
|
+
},
|
|
120
134
|
recent = {
|
|
121
|
-
Size = UDim2.new(1, 0, 0, theme.spacing.calc(
|
|
135
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(2)),
|
|
122
136
|
BackgroundTransparency = 1,
|
|
123
137
|
},
|
|
124
138
|
recentChip = {
|
|
125
|
-
Size = UDim2.fromOffset(theme.spacing.calc(
|
|
139
|
+
Size = UDim2.fromOffset(theme.spacing.calc(2), theme.spacing.calc(2)),
|
|
126
140
|
BorderSizePixel = 0,
|
|
127
141
|
AutoButtonColor = false,
|
|
128
142
|
Text = "",
|
|
129
143
|
},
|
|
130
144
|
link = {
|
|
131
|
-
Size = UDim2.new(0, 0, 0, theme.spacing.calc(
|
|
145
|
+
Size = UDim2.new(0, 0, 0, theme.spacing.calc(2)),
|
|
132
146
|
AutomaticSize = Enum.AutomaticSize.X,
|
|
133
147
|
BackgroundTransparency = 1,
|
|
134
148
|
AutoButtonColor = false,
|
|
135
149
|
Font = theme.typography.fontFamilies.default,
|
|
136
|
-
TextSize = theme.typography.fontSizes.
|
|
150
|
+
TextSize = theme.typography.fontSizes.button,
|
|
137
151
|
TextColor3 = theme.palette.text.secondary,
|
|
138
152
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
139
153
|
},
|
|
@@ -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 ColorPicker = TS.import(script, script.Parent, "ColorPicker").default
|
|
9
10
|
local useColorPickerStyles = TS.import(script, script.Parent, "ColorPicker.styles").default
|
|
@@ -43,26 +44,21 @@ local function ColorSequenceEditor(props)
|
|
|
43
44
|
end
|
|
44
45
|
return math.clamp((position.X - rbx.AbsolutePosition.X) / width, 0, 1)
|
|
45
46
|
end
|
|
46
|
-
local _attributes = {
|
|
47
|
+
local _attributes = {
|
|
48
|
+
tag = "frame",
|
|
49
|
+
}
|
|
47
50
|
local _condition = id
|
|
48
51
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
49
52
|
_condition = "ColorSequenceEditor"
|
|
50
53
|
end
|
|
51
54
|
_attributes.key = _condition
|
|
52
|
-
_attributes.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
if sx then
|
|
62
|
-
for _k, _v in sx do
|
|
63
|
-
_attributes[_k] = _v
|
|
64
|
-
end
|
|
65
|
-
end
|
|
55
|
+
_attributes.hostRef = ref
|
|
56
|
+
_attributes.base = styles.root
|
|
57
|
+
_attributes.className = className
|
|
58
|
+
_attributes.sx = sx
|
|
59
|
+
_attributes.state = {
|
|
60
|
+
disabled = disabled,
|
|
61
|
+
}
|
|
66
62
|
_attributes.Selectable = false
|
|
67
63
|
local _attributes_1 = table.clone(styles.column)
|
|
68
64
|
setmetatable(_attributes_1, nil)
|
|
@@ -70,7 +66,7 @@ local function ColorSequenceEditor(props)
|
|
|
70
66
|
local _attributes_2 = {
|
|
71
67
|
key = "Bar",
|
|
72
68
|
}
|
|
73
|
-
for _k, _v in styles.
|
|
69
|
+
for _k, _v in styles.sequenceBar do
|
|
74
70
|
_attributes_2[_k] = _v
|
|
75
71
|
end
|
|
76
72
|
_attributes_2.LayoutOrder = 1
|
|
@@ -124,24 +120,27 @@ local function ColorSequenceEditor(props)
|
|
|
124
120
|
local _attributes_3 = table.clone(styles.corner)
|
|
125
121
|
setmetatable(_attributes_3, nil)
|
|
126
122
|
local _exp_1 = React.createElement("uicorner", _attributes_3)
|
|
127
|
-
local
|
|
123
|
+
local _attributes_4 = table.clone(styles.swatchStroke)
|
|
124
|
+
setmetatable(_attributes_4, nil)
|
|
125
|
+
local _exp_2 = React.createElement("uistroke", _attributes_4)
|
|
126
|
+
local _exp_3 = React.createElement("uigradient", {
|
|
128
127
|
Color = value,
|
|
129
128
|
})
|
|
130
129
|
-- ▼ ReadonlyArray.map ▼
|
|
131
130
|
local _newValue = table.create(#stops)
|
|
132
131
|
local _callback = function(stop, stopIndex)
|
|
133
|
-
local
|
|
132
|
+
local _attributes_5 = {
|
|
134
133
|
key = `Stop-{stopIndex}`,
|
|
135
134
|
}
|
|
136
|
-
for _k, _v in styles.
|
|
137
|
-
|
|
135
|
+
for _k, _v in styles.stop do
|
|
136
|
+
_attributes_5[_k] = _v
|
|
138
137
|
end
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
138
|
+
_attributes_5.BackgroundColor3 = stop.color
|
|
139
|
+
_attributes_5.Position = UDim2.fromScale(stop.t, 0.5)
|
|
140
|
+
_attributes_5.ZIndex = if stopIndex == index then 2 else 1
|
|
141
|
+
return React.createElement("frame", _attributes_5, React.createElement("uicorner", {
|
|
142
|
+
CornerRadius = UDim.new(0, 2),
|
|
143
|
+
}), React.createElement("uistroke", {
|
|
145
144
|
Thickness = if stopIndex == index then 2 else 1,
|
|
146
145
|
Color = Color3.new(1, 1, 1),
|
|
147
146
|
}))
|
|
@@ -150,8 +149,8 @@ local function ColorSequenceEditor(props)
|
|
|
150
149
|
_newValue[_k] = _callback(_v, _k - 1, stops)
|
|
151
150
|
end
|
|
152
151
|
-- ▲ ReadonlyArray.map ▲
|
|
153
|
-
local
|
|
154
|
-
local
|
|
152
|
+
local _exp_4 = React.createElement("frame", _attributes_2, _exp_1, _exp_2, _exp_3, React.createElement(React.Fragment, nil, _newValue))
|
|
153
|
+
local _exp_5 = React.createElement(ColorPicker, {
|
|
155
154
|
key = "StopColor",
|
|
156
155
|
value = current.color,
|
|
157
156
|
disabled = disabled,
|
|
@@ -163,15 +162,15 @@ local function ColorSequenceEditor(props)
|
|
|
163
162
|
})
|
|
164
163
|
local _condition_1 = #stops > 2 and index > 0 and index < #stops - 1
|
|
165
164
|
if _condition_1 then
|
|
166
|
-
local
|
|
165
|
+
local _attributes_5 = {
|
|
167
166
|
key = "Remove",
|
|
168
167
|
}
|
|
169
168
|
for _k, _v in styles.link do
|
|
170
|
-
|
|
169
|
+
_attributes_5[_k] = _v
|
|
171
170
|
end
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
_attributes_5.Text = "Remove stop"
|
|
172
|
+
_attributes_5.LayoutOrder = 3
|
|
173
|
+
_attributes_5.Event = {
|
|
175
174
|
Activated = function()
|
|
176
175
|
if not active then
|
|
177
176
|
return nil
|
|
@@ -180,9 +179,9 @@ local function ColorSequenceEditor(props)
|
|
|
180
179
|
setSelected(math.max(0, index - 1))
|
|
181
180
|
end,
|
|
182
181
|
}
|
|
183
|
-
_condition_1 = (React.createElement("textbutton",
|
|
182
|
+
_condition_1 = (React.createElement("textbutton", _attributes_5))
|
|
184
183
|
end
|
|
185
|
-
return React.createElement(
|
|
184
|
+
return React.createElement(SxHost, _attributes, _exp, _exp_4, _exp_5, _condition_1)
|
|
186
185
|
end
|
|
187
186
|
local default = ColorSequenceEditor
|
|
188
187
|
return {
|