@rbxts/uiblox 0.2.0-alpha.36 → 0.2.0-alpha.38
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 +1 -18
- package/out/theme/constants/NumberConstants.d.ts +10 -0
- package/out/theme/constants/NumberConstants.luau +12 -0
- package/out/theme/interfaces/density/controlMetrics.luau +2 -2
- package/out/theme/interfaces/palette/Palette.d.ts +7 -0
- package/out/theme/interfaces/spacing/Shape.d.ts +6 -0
- package/out/theme/interfaces/theme/Theme.d.ts +6 -0
- package/out/theme/interfaces/typography/FontFamilies.luau +1 -0
- package/out/theme/interfaces/typography/FontFamilyOptions.d.ts +1 -1
- package/out/theme/interfaces/typography/FontSizeOptions.d.ts +1 -1
- package/out/theme/interfaces/typography/FontSizes.luau +2 -0
- package/out/theme/interfaces/typography/Variants.d.ts +3 -1
- package/out/theme/interfaces/typography/Variants.luau +25 -1
- package/out/theme/styles/utilities/focusRing.d.ts +7 -0
- package/out/theme/styles/utilities/focusRing.luau +14 -0
- package/out/theme/styles/utilities/index.d.ts +1 -0
- package/out/theme/styles/utilities/init.luau +3 -0
- package/out/theme/styles/utilities/resolveSx.d.ts +6 -1
- package/out/theme/styles/utilities/resolveSx.luau +53 -12
- package/out/theme/themes/DarkTheme.luau +4 -0
- package/out/theme/themes/LightTheme.luau +4 -0
- package/out/theme/themes/createPalette.luau +15 -0
- package/out/ui/packages/accordion/components/Accordion.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.luau +112 -32
- package/out/ui/packages/accordion/components/Accordion.styles.luau +70 -32
- package/out/ui/packages/accordion/components/accordionNote.d.ts +2 -0
- package/out/ui/packages/accordion/components/accordionNote.luau +11 -0
- package/out/ui/packages/alert/components/Alert.d.ts +2 -0
- package/out/ui/packages/alert/components/Alert.luau +39 -12
- package/out/ui/packages/alert/components/Alert.styles.luau +44 -22
- package/out/ui/packages/alert/components/alertAction.d.ts +2 -0
- package/out/ui/packages/alert/components/alertAction.luau +11 -0
- package/out/ui/packages/appBar/components/AppBar.d.ts +1 -0
- package/out/ui/packages/appBar/components/AppBar.luau +88 -22
- package/out/ui/packages/appBar/components/AppBar.styles.luau +41 -11
- package/out/ui/packages/appBar/components/appBarSubtitle.d.ts +2 -0
- package/out/ui/packages/appBar/components/appBarSubtitle.luau +11 -0
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +4 -0
- package/out/ui/packages/avatar/components/Avatar.d.ts +2 -0
- package/out/ui/packages/avatar/components/Avatar.luau +9 -2
- package/out/ui/packages/avatar/components/Avatar.styles.luau +7 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.d.ts +14 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.luau +107 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.d.ts +6 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.luau +55 -0
- package/out/ui/packages/avatarGroup/components/avatarGroupCut.d.ts +2 -0
- package/out/ui/packages/avatarGroup/components/avatarGroupCut.luau +11 -0
- package/out/ui/packages/avatarGroup/index.d.ts +3 -0
- package/out/ui/packages/avatarGroup/init.luau +6 -0
- package/out/ui/packages/badge/components/Badge.luau +14 -11
- package/out/ui/packages/badge/components/Badge.styles.luau +5 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +4 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +19 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +24 -3
- package/out/ui/packages/bottomNavigation/components/navBadge.d.ts +2 -0
- package/out/ui/packages/bottomNavigation/components/navBadge.luau +14 -0
- package/out/ui/packages/bottomNavigation/index.d.ts +1 -1
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +21 -6
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.styles.luau +10 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +2 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +8 -0
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +20 -2
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.styles.luau +72 -66
- package/out/ui/packages/button/components/Button.d.ts +2 -0
- package/out/ui/packages/button/components/Button.luau +112 -36
- package/out/ui/packages/button/components/Button.styles.luau +2 -0
- package/out/ui/packages/button/components/buttonLook.d.ts +2 -0
- package/out/ui/packages/button/components/buttonLook.luau +11 -0
- package/out/ui/packages/button/components/buttonPaint.d.ts +16 -0
- package/out/ui/packages/button/components/buttonPaint.luau +70 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.d.ts +14 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.luau +117 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.styles.d.ts +5 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.styles.luau +57 -0
- package/out/ui/packages/buttonGroup/components/buttonGroupEdge.d.ts +2 -0
- package/out/ui/packages/buttonGroup/components/buttonGroupEdge.luau +16 -0
- package/out/ui/packages/buttonGroup/index.d.ts +3 -0
- package/out/ui/packages/buttonGroup/init.luau +6 -0
- package/out/ui/packages/card/components/Card.d.ts +1 -0
- package/out/ui/packages/card/components/Card.luau +21 -2
- package/out/ui/packages/card/components/Card.styles.d.ts +3 -1
- package/out/ui/packages/card/components/Card.styles.luau +20 -9
- package/out/ui/packages/card/components/cardWidth.d.ts +10 -0
- package/out/ui/packages/card/components/cardWidth.luau +36 -0
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +18 -5
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +50 -32
- package/out/ui/packages/cframeEditor/components/cframeValue.d.ts +1 -0
- package/out/ui/packages/cframeEditor/components/cframeValue.luau +13 -0
- package/out/ui/packages/checkbox/components/Checkbox.luau +7 -5
- package/out/ui/packages/checkbox/components/Checkbox.styles.luau +2 -0
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +2 -2
- package/out/ui/packages/checkbox/components/checkboxLook.luau +2 -2
- package/out/ui/packages/chip/components/Chip.luau +16 -14
- package/out/ui/packages/chip/components/Chip.styles.d.ts +2 -1
- package/out/ui/packages/chip/components/Chip.styles.luau +15 -9
- package/out/ui/packages/chip/components/chipTone.d.ts +3 -0
- package/out/ui/packages/chip/components/chipTone.luau +11 -0
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +10 -3
- package/out/ui/packages/codeEditor/components/CodeEditor.d.ts +12 -0
- package/out/ui/packages/codeEditor/components/CodeEditor.luau +262 -0
- package/out/ui/packages/codeEditor/components/CodeEditor.styles.d.ts +6 -0
- package/out/ui/packages/codeEditor/components/CodeEditor.styles.luau +124 -0
- package/out/ui/packages/codeEditor/highlightCode.d.ts +11 -0
- package/out/ui/packages/codeEditor/highlightCode.luau +503 -0
- package/out/ui/packages/codeEditor/index.d.ts +2 -0
- package/out/ui/packages/codeEditor/init.luau +5 -0
- package/out/ui/packages/collapse/components/Collapse.d.ts +8 -0
- package/out/ui/packages/collapse/components/Collapse.luau +34 -0
- package/out/ui/packages/collapse/components/Collapse.styles.d.ts +2 -0
- package/out/ui/packages/collapse/components/Collapse.styles.luau +20 -0
- package/out/ui/packages/collapse/components/collapseOpen.d.ts +1 -0
- package/out/ui/packages/collapse/components/collapseOpen.luau +7 -0
- package/out/ui/packages/collapse/index.d.ts +3 -0
- package/out/ui/packages/collapse/init.luau +6 -0
- package/out/ui/packages/colorPicker/components/ColorPicker.luau +9 -1
- package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +74 -67
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +16 -6
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +16 -6
- package/out/ui/packages/colorPicker/components/sequenceValue.d.ts +2 -0
- package/out/ui/packages/colorPicker/components/sequenceValue.luau +8 -0
- package/out/ui/packages/colorPicker/index.d.ts +1 -1
- package/out/ui/packages/colorPicker/init.luau +2 -0
- package/out/ui/packages/copyButton/components/CopyButton.d.ts +8 -0
- package/out/ui/packages/copyButton/components/CopyButton.luau +32 -0
- package/out/ui/packages/copyButton/components/copyInvoke.d.ts +2 -0
- package/out/ui/packages/copyButton/components/copyInvoke.luau +12 -0
- package/out/ui/packages/copyButton/index.d.ts +3 -0
- package/out/ui/packages/copyButton/init.luau +6 -0
- package/out/ui/packages/cover/components/Cover.d.ts +8 -0
- package/out/ui/packages/cover/components/Cover.luau +47 -0
- package/out/ui/packages/cover/components/coverFill.d.ts +2 -0
- package/out/ui/packages/cover/components/coverFill.luau +14 -0
- package/out/ui/packages/cover/index.d.ts +3 -0
- package/out/ui/packages/cover/init.luau +6 -0
- package/out/ui/packages/dateRange/components/DateRangePicker.d.ts +3 -0
- package/out/ui/packages/dateRange/components/DateRangePicker.luau +186 -95
- package/out/ui/packages/dateRange/dateRangeValue.d.ts +5 -0
- package/out/ui/packages/dateRange/dateRangeValue.luau +34 -0
- package/out/ui/packages/dateRange/index.d.ts +1 -1
- package/out/ui/packages/dateRange/init.luau +3 -0
- package/out/ui/packages/dialog/components/Dialog.d.ts +1 -0
- package/out/ui/packages/dialog/components/Dialog.luau +55 -6
- package/out/ui/packages/dialog/components/Dialog.styles.luau +9 -5
- package/out/ui/packages/dialog/components/dialogWidth.d.ts +7 -0
- package/out/ui/packages/dialog/components/dialogWidth.luau +35 -0
- package/out/ui/packages/divider/components/Divider.luau +60 -13
- package/out/ui/packages/divider/components/Divider.styles.luau +1 -0
- package/out/ui/packages/divider/components/dividerLabel.d.ts +2 -0
- package/out/ui/packages/divider/components/dividerLabel.luau +11 -0
- package/out/ui/packages/drawer/components/Drawer.d.ts +2 -0
- package/out/ui/packages/drawer/components/Drawer.luau +51 -7
- package/out/ui/packages/drawer/components/Drawer.styles.luau +13 -5
- package/out/ui/packages/drawer/components/drawerPlacement.d.ts +15 -1
- package/out/ui/packages/drawer/components/drawerPlacement.luau +46 -0
- package/out/ui/packages/editorFace.d.ts +22 -0
- package/out/ui/packages/editorFace.luau +49 -0
- package/out/ui/packages/fab/components/Fab.luau +19 -6
- package/out/ui/packages/fab/components/Fab.styles.luau +4 -3
- package/out/ui/packages/fontEditor/components/FontEditor.luau +13 -3
- package/out/ui/packages/fontEditor/components/FontEditor.styles.luau +36 -27
- package/out/ui/packages/gradientEditor/components/GradientEditor.luau +21 -13
- package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +52 -44
- package/out/ui/packages/icon/components/DrawnGlyph.d.ts +11 -0
- package/out/ui/packages/icon/components/DrawnGlyph.luau +87 -0
- package/out/ui/packages/icon/components/Icon.d.ts +6 -2
- package/out/ui/packages/icon/components/Icon.luau +23 -3
- package/out/ui/packages/icon/components/Icon.styles.luau +3 -0
- package/out/ui/packages/icon/components/glyphs.d.ts +28 -0
- package/out/ui/packages/icon/components/glyphs.luau +64 -0
- package/out/ui/packages/icon/index.d.ts +1 -0
- package/out/ui/packages/iconButton/components/IconButton.d.ts +6 -1
- package/out/ui/packages/iconButton/components/IconButton.luau +112 -11
- package/out/ui/packages/iconButton/components/IconButton.styles.luau +4 -27
- package/out/ui/packages/iconButton/components/iconButtonBox.d.ts +11 -0
- package/out/ui/packages/iconButton/components/iconButtonBox.luau +48 -0
- package/out/ui/packages/iconButton/components/transportGlyph.d.ts +10 -0
- package/out/ui/packages/iconButton/components/transportGlyph.luau +77 -0
- package/out/ui/packages/imageList/components/ImageList.d.ts +4 -0
- package/out/ui/packages/imageList/components/ImageList.luau +28 -7
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +1 -0
- package/out/ui/packages/imageList/components/ImageList.styles.luau +17 -10
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +8 -0
- package/out/ui/packages/imageList/components/imageListLayout.luau +36 -0
- package/out/ui/packages/index.d.ts +12 -0
- package/out/ui/packages/init.luau +36 -0
- package/out/ui/packages/input/components/Input.d.ts +4 -0
- package/out/ui/packages/input/components/Input.luau +74 -37
- package/out/ui/packages/input/components/Input.styles.d.ts +1 -0
- package/out/ui/packages/input/components/Input.styles.luau +45 -18
- package/out/ui/packages/input/components/clampText.d.ts +2 -0
- package/out/ui/packages/input/components/clampText.luau +16 -0
- package/out/ui/packages/input/components/fieldChrome.d.ts +5 -0
- package/out/ui/packages/input/components/fieldChrome.luau +11 -0
- package/out/ui/packages/input/components/multilineHeight.d.ts +1 -0
- package/out/ui/packages/input/components/multilineHeight.luau +11 -0
- package/out/ui/packages/layout/components/Box.luau +92 -13
- package/out/ui/packages/layout/components/Box.styles.d.ts +0 -2
- package/out/ui/packages/layout/components/Box.styles.luau +0 -9
- package/out/ui/packages/layout/components/Grid.luau +81 -16
- package/out/ui/packages/layout/components/Pad.d.ts +24 -0
- package/out/ui/packages/layout/components/Pad.luau +88 -0
- package/out/ui/packages/layout/components/Stack.luau +79 -13
- package/out/ui/packages/link/components/Link.luau +17 -7
- package/out/ui/packages/link/components/Link.styles.d.ts +0 -1
- package/out/ui/packages/link/components/Link.styles.luau +3 -5
- package/out/ui/packages/listItem/components/ListItem.d.ts +6 -0
- package/out/ui/packages/listItem/components/ListItem.luau +155 -40
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +4 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +70 -31
- package/out/ui/packages/listItem/components/listItemInk.d.ts +3 -0
- package/out/ui/packages/listItem/components/listItemInk.luau +14 -0
- package/out/ui/packages/listItem/components/listItemLayout.d.ts +22 -0
- package/out/ui/packages/listItem/components/listItemLayout.luau +68 -0
- package/out/ui/packages/markdown/components/Markdown.d.ts +2 -0
- package/out/ui/packages/markdown/components/Markdown.luau +244 -46
- package/out/ui/packages/markdown/components/Markdown.styles.luau +125 -51
- package/out/ui/packages/markdown/components/MarkdownEditor.luau +215 -146
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +1 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +153 -83
- package/out/ui/packages/markdown/index.d.ts +2 -2
- package/out/ui/packages/markdown/init.luau +2 -0
- package/out/ui/packages/markdown/parseMarkdown.d.ts +30 -2
- package/out/ui/packages/markdown/parseMarkdown.luau +453 -25
- package/out/ui/packages/menu/components/Menu.d.ts +4 -1
- package/out/ui/packages/menu/components/Menu.luau +76 -28
- package/out/ui/packages/menu/components/Menu.styles.luau +6 -1
- package/out/ui/packages/menu/components/menuIcon.d.ts +6 -0
- package/out/ui/packages/menu/components/menuIcon.luau +32 -0
- package/out/ui/packages/numberInput/components/NumberInput.d.ts +1 -0
- package/out/ui/packages/numberInput/components/NumberInput.luau +82 -1
- package/out/ui/packages/numberInput/components/numberValue.d.ts +2 -0
- package/out/ui/packages/numberInput/components/numberValue.luau +10 -0
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +9 -1
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.styles.luau +23 -16
- package/out/ui/packages/pager/components/Pager.d.ts +11 -0
- package/out/ui/packages/pager/components/Pager.luau +114 -0
- package/out/ui/packages/pager/components/Pager.styles.d.ts +2 -0
- package/out/ui/packages/pager/components/Pager.styles.luau +66 -0
- package/out/ui/packages/pager/components/pagerStep.d.ts +3 -0
- package/out/ui/packages/pager/components/pagerStep.luau +24 -0
- package/out/ui/packages/pager/index.d.ts +3 -0
- package/out/ui/packages/pager/init.luau +9 -0
- package/out/ui/packages/pagination/components/Pagination.styles.luau +4 -1
- package/out/ui/packages/paper/components/Paper.luau +17 -11
- package/out/ui/packages/paper/components/Paper.styles.luau +12 -5
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +14 -1
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +24 -19
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +5 -0
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +22 -0
- package/out/ui/packages/popover/components/Popover.d.ts +12 -0
- package/out/ui/packages/popover/components/Popover.luau +52 -0
- package/out/ui/packages/popover/components/Popover.styles.d.ts +2 -0
- package/out/ui/packages/popover/components/Popover.styles.luau +32 -0
- package/out/ui/packages/popover/index.d.ts +2 -0
- package/out/ui/packages/popover/init.luau +5 -0
- package/out/ui/packages/popup/components/Popup.d.ts +2 -0
- package/out/ui/packages/popup/components/Popup.luau +64 -2
- package/out/ui/packages/popup/components/placement.luau +6 -4
- package/out/ui/packages/progressBar/components/ProgressBar.luau +1 -1
- package/out/ui/packages/progressBar/components/ProgressBar.styles.luau +3 -2
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +4 -1
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +53 -9
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +26 -2
- package/out/ui/packages/radioGroup/components/radioHint.d.ts +2 -0
- package/out/ui/packages/radioGroup/components/radioHint.luau +11 -0
- package/out/ui/packages/radioGroup/index.d.ts +1 -1
- package/out/ui/packages/rating/components/Rating.d.ts +1 -1
- package/out/ui/packages/rating/components/Rating.luau +48 -4
- package/out/ui/packages/rating/components/Rating.styles.luau +1 -1
- package/out/ui/packages/rating/components/ratingCommit.d.ts +2 -0
- package/out/ui/packages/rating/components/ratingCommit.luau +11 -0
- package/out/ui/packages/rayEditor/components/RayEditor.luau +9 -1
- package/out/ui/packages/rayEditor/components/RayEditor.styles.luau +17 -11
- package/out/ui/packages/rectEditor/components/RectEditor.luau +9 -1
- package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +49 -42
- package/out/ui/packages/scroll/components/ScrollView.luau +76 -7
- package/out/ui/packages/select/components/Select.d.ts +2 -0
- package/out/ui/packages/select/components/Select.luau +164 -105
- package/out/ui/packages/select/components/Select.styles.d.ts +2 -0
- package/out/ui/packages/select/components/Select.styles.luau +30 -9
- package/out/ui/packages/select/components/selectWidth.d.ts +2 -0
- package/out/ui/packages/select/components/selectWidth.luau +15 -0
- package/out/ui/packages/shadow/components/Shadow.luau +202 -21
- package/out/ui/packages/sidebar/components/Sidebar.styles.luau +1 -0
- package/out/ui/packages/skeleton/components/Skeleton.luau +4 -0
- package/out/ui/packages/slider/components/RangeSlider.d.ts +16 -0
- package/out/ui/packages/slider/components/RangeSlider.luau +232 -0
- package/out/ui/packages/slider/components/RangeSlider.styles.d.ts +7 -0
- package/out/ui/packages/slider/components/RangeSlider.styles.luau +48 -0
- package/out/ui/packages/slider/components/Slider.d.ts +1 -0
- package/out/ui/packages/slider/components/Slider.luau +53 -25
- package/out/ui/packages/slider/components/Slider.styles.d.ts +1 -0
- package/out/ui/packages/slider/components/Slider.styles.luau +19 -5
- package/out/ui/packages/slider/components/rangeValue.d.ts +21 -0
- package/out/ui/packages/slider/components/rangeValue.luau +77 -0
- package/out/ui/packages/slider/components/sliderLabel.d.ts +4 -0
- package/out/ui/packages/slider/components/sliderLabel.luau +30 -0
- package/out/ui/packages/slider/index.d.ts +3 -0
- package/out/ui/packages/slider/init.luau +6 -0
- package/out/ui/packages/snackbar/components/Snackbar.d.ts +1 -0
- package/out/ui/packages/snackbar/components/Snackbar.luau +2 -0
- package/out/ui/packages/sparkline/components/Sparkline.d.ts +3 -0
- package/out/ui/packages/sparkline/components/Sparkline.luau +72 -8
- package/out/ui/packages/sparkline/index.d.ts +1 -1
- package/out/ui/packages/sparkline/init.luau +6 -1
- package/out/ui/packages/sparkline/sparklineLayout.d.ts +17 -0
- package/out/ui/packages/sparkline/sparklineLayout.luau +132 -8
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +1 -0
- package/out/ui/packages/speedDial/components/SpeedDial.luau +59 -9
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +1 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +50 -3
- package/out/ui/packages/speedDial/components/speedDialLabel.d.ts +4 -0
- package/out/ui/packages/speedDial/components/speedDialLabel.luau +16 -0
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stateMatrix.d.ts +1 -0
- package/out/ui/packages/stateMatrix.luau +9 -0
- package/out/ui/packages/stepper/components/Stepper.d.ts +2 -0
- package/out/ui/packages/stepper/components/Stepper.luau +35 -7
- package/out/ui/packages/stepper/components/Stepper.styles.luau +12 -6
- package/out/ui/packages/stepper/components/stepState.d.ts +4 -2
- package/out/ui/packages/stepper/components/stepState.luau +12 -1
- package/out/ui/packages/stepper/index.d.ts +1 -1
- package/out/ui/packages/stepper/init.luau +3 -1
- package/out/ui/packages/switch/components/Switch.luau +2 -2
- package/out/ui/packages/switch/components/Switch.styles.luau +2 -5
- package/out/ui/packages/switch/components/switchLook.d.ts +3 -3
- package/out/ui/packages/switch/components/switchLook.luau +4 -10
- package/out/ui/packages/table/components/Table.d.ts +1 -0
- package/out/ui/packages/table/components/Table.luau +99 -57
- package/out/ui/packages/table/components/Table.styles.luau +23 -6
- package/out/ui/packages/table/components/tableColumns.d.ts +2 -0
- package/out/ui/packages/table/components/tableColumns.luau +2 -0
- package/out/ui/packages/table/components/tableSort.d.ts +2 -0
- package/out/ui/packages/table/components/tableSort.luau +95 -0
- package/out/ui/packages/table/index.d.ts +1 -0
- package/out/ui/packages/table/init.luau +1 -0
- package/out/ui/packages/tabs/components/Tabs.luau +77 -6
- package/out/ui/packages/tabs/components/Tabs.styles.luau +12 -11
- package/out/ui/packages/tabs/components/tabIndicator.d.ts +7 -0
- package/out/ui/packages/tabs/components/tabIndicator.luau +21 -0
- package/out/ui/packages/tabs/components/tabScroll.d.ts +2 -0
- package/out/ui/packages/tabs/components/tabScroll.luau +18 -0
- package/out/ui/packages/text/components/Text.d.ts +9 -0
- package/out/ui/packages/text/components/Text.luau +64 -0
- package/out/ui/packages/text/components/textBox.d.ts +12 -0
- package/out/ui/packages/text/components/textBox.luau +21 -0
- package/out/ui/packages/text/index.d.ts +2 -0
- package/out/ui/packages/text/init.luau +5 -0
- package/out/ui/packages/timeField/components/TimeField.d.ts +13 -0
- package/out/ui/packages/timeField/components/TimeField.luau +106 -0
- package/out/ui/packages/timeField/index.d.ts +4 -0
- package/out/ui/packages/timeField/init.luau +9 -0
- package/out/ui/packages/timeField/timeValue.d.ts +8 -0
- package/out/ui/packages/timeField/timeValue.luau +49 -0
- package/out/ui/packages/timeline/components/Timeline.d.ts +12 -0
- package/out/ui/packages/timeline/components/Timeline.luau +102 -0
- package/out/ui/packages/timeline/components/Timeline.styles.d.ts +2 -0
- package/out/ui/packages/timeline/components/Timeline.styles.luau +115 -0
- package/out/ui/packages/timeline/components/timelineRail.d.ts +4 -0
- package/out/ui/packages/timeline/components/timelineRail.luau +15 -0
- package/out/ui/packages/timeline/index.d.ts +3 -0
- package/out/ui/packages/timeline/init.luau +8 -0
- package/out/ui/packages/toast/components/Toast.d.ts +1 -0
- package/out/ui/packages/toast/components/Toast.luau +200 -57
- package/out/ui/packages/toast/components/Toast.styles.luau +40 -20
- package/out/ui/packages/toast/components/toastPlace.d.ts +16 -0
- package/out/ui/packages/toast/components/toastPlace.luau +44 -0
- package/out/ui/packages/toast/enums/ToastVariants.d.ts +2 -1
- package/out/ui/packages/toast/enums/ToastVariants.luau +1 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +43 -4
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +1 -1
- package/out/ui/packages/tooltip/components/Tooltip.d.ts +1 -0
- package/out/ui/packages/tooltip/components/Tooltip.luau +109 -31
- package/out/ui/packages/tooltip/components/Tooltip.styles.luau +31 -1
- package/out/ui/packages/tooltip/components/tooltipBox.d.ts +4 -0
- package/out/ui/packages/tooltip/components/tooltipBox.luau +12 -0
- package/out/ui/packages/tooltip/components/tooltipPointer.d.ts +2 -0
- package/out/ui/packages/tooltip/components/tooltipPointer.luau +11 -0
- package/out/ui/packages/treeView/components/TreeView.luau +12 -13
- package/out/ui/packages/treeView/components/TreeView.styles.luau +6 -0
- package/out/ui/packages/typography/components/Typography.d.ts +2 -0
- package/out/ui/packages/typography/components/Typography.luau +8 -0
- package/out/ui/packages/typography/components/Typography.styles.luau +3 -1
- package/out/ui/packages/udimEditor/components/UDimEditor.luau +9 -1
- package/out/ui/packages/udimEditor/components/UDimEditor.styles.luau +25 -18
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +18 -3
- package/out/ui/packages/vectorEditor/components/VectorEditor.styles.luau +30 -16
- package/out/ui/packages/virtualList/components/VirtualList.styles.luau +1 -0
- package/out/ui/packages/weekGrid/components/WeekGrid.d.ts +24 -0
- package/out/ui/packages/weekGrid/components/WeekGrid.luau +187 -0
- package/out/ui/packages/weekGrid/components/weekColumns.d.ts +9 -0
- package/out/ui/packages/weekGrid/components/weekColumns.luau +25 -0
- package/out/ui/packages/weekGrid/index.d.ts +3 -0
- package/out/ui/packages/weekGrid/init.luau +8 -0
- package/package.json +2 -2
|
@@ -3,14 +3,16 @@ local TS = _G[script]
|
|
|
3
3
|
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local React = _react
|
|
5
5
|
local useEffect = _react.useEffect
|
|
6
|
+
local useRef = _react.useRef
|
|
6
7
|
local useState = _react.useState
|
|
7
8
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
8
9
|
local useShadowStyles = TS.import(script, script.Parent, "Shadow.styles").default
|
|
10
|
+
local ORIGIN = UDim2.fromOffset(0, 0)
|
|
11
|
+
local ZERO_ANCHOR = Vector2.new(0, 0)
|
|
9
12
|
local function Shadow(props)
|
|
10
13
|
local _binding = useShadowStyles()
|
|
11
14
|
local container = _binding.container
|
|
12
15
|
local blob = _binding.blob
|
|
13
|
-
local parent, setParent = useState(nil)
|
|
14
16
|
local cornerRadius, setCornerRadius = useState()
|
|
15
17
|
local blobSize, setBlobSize = useState(UDim2.fromOffset(0, 0))
|
|
16
18
|
local _binding_1 = props
|
|
@@ -24,31 +26,189 @@ local function Shadow(props)
|
|
|
24
26
|
end
|
|
25
27
|
local defaultZIndex = _condition
|
|
26
28
|
local zIndex, setZIndex = useState(defaultZIndex)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
local alive = useRef(true)
|
|
30
|
+
local gen = useRef(0)
|
|
31
|
+
local shadowRef = useRef()
|
|
32
|
+
local wrapRef = useRef()
|
|
33
|
+
local faceRef = useRef()
|
|
34
|
+
local conns = useRef({})
|
|
35
|
+
local disconnect = function()
|
|
36
|
+
for _, conn in conns.current do
|
|
37
|
+
conn:Disconnect()
|
|
38
|
+
end
|
|
39
|
+
conns.current = {}
|
|
40
|
+
end
|
|
41
|
+
local follow = function(face)
|
|
42
|
+
local wrap = wrapRef.current
|
|
43
|
+
if not wrap or face.Parent ~= wrap then
|
|
29
44
|
return nil
|
|
30
45
|
end
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
46
|
+
if face.Position ~= ORIGIN then
|
|
47
|
+
wrap.Position = face.Position
|
|
48
|
+
face.Position = ORIGIN
|
|
34
49
|
end
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if _condition_1 == nil then
|
|
39
|
-
_condition_1 = defaultZIndex
|
|
50
|
+
if face.AnchorPoint ~= ZERO_ANCHOR then
|
|
51
|
+
wrap.AnchorPoint = face.AnchorPoint
|
|
52
|
+
face.AnchorPoint = ZERO_ANCHOR
|
|
40
53
|
end
|
|
41
|
-
|
|
42
|
-
|
|
54
|
+
wrap.Size = face.Size
|
|
55
|
+
wrap.AutomaticSize = face.AutomaticSize
|
|
56
|
+
wrap.LayoutOrder = face.LayoutOrder
|
|
57
|
+
wrap.ZIndex = face.ZIndex
|
|
58
|
+
wrap.Visible = face.Visible
|
|
59
|
+
local size = UDim2.fromOffset(face.AbsoluteSize.X, face.AbsoluteSize.Y)
|
|
60
|
+
setBlobSize(function(prev)
|
|
61
|
+
return if prev.X.Offset == size.X.Offset and prev.Y.Offset == size.Y.Offset then prev else size
|
|
62
|
+
end)
|
|
63
|
+
local _radius = face:FindFirstChildOfClass("UICorner")
|
|
64
|
+
if _radius ~= nil then
|
|
65
|
+
_radius = _radius.CornerRadius
|
|
66
|
+
end
|
|
67
|
+
local radius = _radius
|
|
68
|
+
setCornerRadius(function(prev)
|
|
69
|
+
if radius == nil then
|
|
70
|
+
return if prev == nil then prev else nil
|
|
71
|
+
end
|
|
72
|
+
if prev ~= nil and prev.Offset == radius.Offset and prev.Scale == radius.Scale then
|
|
73
|
+
return prev
|
|
74
|
+
end
|
|
75
|
+
return radius
|
|
76
|
+
end)
|
|
77
|
+
setZIndex(face.ZIndex - 1)
|
|
78
|
+
end
|
|
79
|
+
local schedule
|
|
80
|
+
local bind = function(face)
|
|
81
|
+
disconnect()
|
|
43
82
|
local sync = function()
|
|
44
|
-
|
|
83
|
+
return follow(face)
|
|
45
84
|
end
|
|
46
85
|
sync()
|
|
47
|
-
local
|
|
86
|
+
local watch = { "AbsoluteSize", "Size", "AutomaticSize", "Position", "AnchorPoint", "LayoutOrder", "ZIndex", "Visible" }
|
|
87
|
+
-- ▼ ReadonlyArray.map ▼
|
|
88
|
+
local _newValue = table.create(#watch)
|
|
89
|
+
local _callback = function(name)
|
|
90
|
+
return face:GetPropertyChangedSignal(name):Connect(sync)
|
|
91
|
+
end
|
|
92
|
+
for _k, _v in watch do
|
|
93
|
+
_newValue[_k] = _callback(_v, _k - 1, watch)
|
|
94
|
+
end
|
|
95
|
+
-- ▲ ReadonlyArray.map ▲
|
|
96
|
+
conns.current = _newValue
|
|
97
|
+
local _current = conns.current
|
|
98
|
+
local _arg0 = face.AncestryChanged:Connect(function()
|
|
99
|
+
local shadow = shadowRef.current
|
|
100
|
+
if shadow then
|
|
101
|
+
schedule(shadow)
|
|
102
|
+
end
|
|
103
|
+
end)
|
|
104
|
+
table.insert(_current, _arg0)
|
|
105
|
+
end
|
|
106
|
+
local lift = function(shadow)
|
|
107
|
+
if not alive.current then
|
|
108
|
+
return nil
|
|
109
|
+
end
|
|
110
|
+
local parent = shadow.Parent
|
|
111
|
+
if not parent or not parent:IsA("GuiObject") then
|
|
112
|
+
return nil
|
|
113
|
+
end
|
|
114
|
+
local existing = wrapRef.current
|
|
115
|
+
if existing and parent == existing then
|
|
116
|
+
local face = faceRef.current
|
|
117
|
+
if not face or face.Parent == existing then
|
|
118
|
+
return nil
|
|
119
|
+
end
|
|
120
|
+
if face.Position ~= ORIGIN then
|
|
121
|
+
existing.Position = face.Position
|
|
122
|
+
face.Position = ORIGIN
|
|
123
|
+
end
|
|
124
|
+
if face.AnchorPoint ~= ZERO_ANCHOR then
|
|
125
|
+
existing.AnchorPoint = face.AnchorPoint
|
|
126
|
+
face.AnchorPoint = ZERO_ANCHOR
|
|
127
|
+
end
|
|
128
|
+
shadow.Parent = existing
|
|
129
|
+
face.Parent = existing
|
|
130
|
+
return nil
|
|
131
|
+
end
|
|
132
|
+
local face = parent
|
|
133
|
+
local wrapped = existing ~= nil and face.Parent == existing
|
|
134
|
+
local holder = if wrapped then existing.Parent else face.Parent
|
|
135
|
+
if not holder then
|
|
136
|
+
return nil
|
|
137
|
+
end
|
|
138
|
+
disconnect()
|
|
139
|
+
local wrap = existing or Instance.new("Frame")
|
|
140
|
+
if existing == nil then
|
|
141
|
+
wrap.Name = "ShadowWrap"
|
|
142
|
+
wrap.BackgroundTransparency = 1
|
|
143
|
+
wrap.BorderSizePixel = 0
|
|
144
|
+
wrap.ClipsDescendants = false
|
|
145
|
+
wrapRef.current = wrap
|
|
146
|
+
end
|
|
147
|
+
wrap.Size = face.Size
|
|
148
|
+
wrap.AutomaticSize = face.AutomaticSize
|
|
149
|
+
wrap.LayoutOrder = face.LayoutOrder
|
|
150
|
+
wrap.ZIndex = face.ZIndex
|
|
151
|
+
wrap.Visible = face.Visible
|
|
152
|
+
if not wrapped then
|
|
153
|
+
wrap.Position = face.Position
|
|
154
|
+
wrap.AnchorPoint = face.AnchorPoint
|
|
155
|
+
-- Shadow first, surface next, so the face paints over the blob.
|
|
156
|
+
shadow.Parent = wrap
|
|
157
|
+
face.Parent = wrap
|
|
158
|
+
face.Position = ORIGIN
|
|
159
|
+
face.AnchorPoint = ZERO_ANCHOR
|
|
160
|
+
wrap.Parent = holder
|
|
161
|
+
else
|
|
162
|
+
shadow.Parent = wrap
|
|
163
|
+
end
|
|
164
|
+
faceRef.current = face
|
|
165
|
+
bind(face)
|
|
166
|
+
end
|
|
167
|
+
schedule = function(shadow)
|
|
168
|
+
if not alive.current then
|
|
169
|
+
return nil
|
|
170
|
+
end
|
|
171
|
+
local wrap = wrapRef.current
|
|
172
|
+
local face = faceRef.current
|
|
173
|
+
if wrap and shadow.Parent == wrap and face and face.Parent == wrap then
|
|
174
|
+
return nil
|
|
175
|
+
end
|
|
176
|
+
gen.current += 1
|
|
177
|
+
local token = gen.current
|
|
178
|
+
task.defer(function()
|
|
179
|
+
if not alive.current or gen.current ~= token then
|
|
180
|
+
return nil
|
|
181
|
+
end
|
|
182
|
+
lift(shadow)
|
|
183
|
+
end)
|
|
184
|
+
end
|
|
185
|
+
useEffect(function()
|
|
186
|
+
local shadow = shadowRef.current
|
|
187
|
+
if shadow then
|
|
188
|
+
schedule(shadow)
|
|
189
|
+
end
|
|
48
190
|
return function()
|
|
49
|
-
|
|
191
|
+
alive.current = false
|
|
192
|
+
gen.current += 1
|
|
193
|
+
disconnect()
|
|
194
|
+
local wrap = wrapRef.current
|
|
195
|
+
local face = faceRef.current
|
|
196
|
+
local host = shadowRef.current
|
|
197
|
+
wrapRef.current = nil
|
|
198
|
+
if wrap and face and face.Parent == wrap then
|
|
199
|
+
face.Position = wrap.Position
|
|
200
|
+
face.AnchorPoint = wrap.AnchorPoint
|
|
201
|
+
if host and host.Parent == wrap then
|
|
202
|
+
host.Parent = face
|
|
203
|
+
end
|
|
204
|
+
face.Parent = wrap.Parent
|
|
205
|
+
end
|
|
206
|
+
local _result = wrap
|
|
207
|
+
if _result ~= nil then
|
|
208
|
+
_result:Destroy()
|
|
209
|
+
end
|
|
50
210
|
end
|
|
51
|
-
end, {
|
|
211
|
+
end, {})
|
|
52
212
|
local _attributes = {
|
|
53
213
|
tag = "frame",
|
|
54
214
|
}
|
|
@@ -57,7 +217,16 @@ local function Shadow(props)
|
|
|
57
217
|
_condition_1 = "Shadow"
|
|
58
218
|
end
|
|
59
219
|
_attributes.key = _condition_1
|
|
60
|
-
_attributes.hostRef =
|
|
220
|
+
_attributes.hostRef = function(instance)
|
|
221
|
+
shadowRef.current = instance
|
|
222
|
+
if type(ref) == "function" then
|
|
223
|
+
ref(instance)
|
|
224
|
+
return nil
|
|
225
|
+
end
|
|
226
|
+
if ref ~= nil then
|
|
227
|
+
ref.current = instance
|
|
228
|
+
end
|
|
229
|
+
end
|
|
61
230
|
_attributes.base = container
|
|
62
231
|
_attributes.className = className
|
|
63
232
|
_attributes.sx = sx
|
|
@@ -65,7 +234,7 @@ local function Shadow(props)
|
|
|
65
234
|
_attributes.Event = {
|
|
66
235
|
AncestryChanged = function(rbx, parent)
|
|
67
236
|
if parent:IsA("GuiObject") and rbx.Parent == parent then
|
|
68
|
-
|
|
237
|
+
schedule(rbx)
|
|
69
238
|
end
|
|
70
239
|
end,
|
|
71
240
|
}
|
|
@@ -77,10 +246,22 @@ local function Shadow(props)
|
|
|
77
246
|
end
|
|
78
247
|
_attributes_1.Size = blobSize
|
|
79
248
|
_attributes_1.ZIndex = zIndex
|
|
80
|
-
return React.createElement(SxHost, _attributes, React.createElement("
|
|
249
|
+
return React.createElement(SxHost, _attributes, React.createElement("scrollingframe", {
|
|
250
|
+
key = "Bounds",
|
|
251
|
+
Size = UDim2.fromOffset(0, 0),
|
|
252
|
+
BackgroundTransparency = 1,
|
|
253
|
+
BorderSizePixel = 0,
|
|
254
|
+
ScrollBarThickness = 0,
|
|
255
|
+
ScrollingEnabled = false,
|
|
256
|
+
AutomaticCanvasSize = Enum.AutomaticSize.None,
|
|
257
|
+
CanvasSize = UDim2.fromOffset(0, 0),
|
|
258
|
+
ClipsDescendants = false,
|
|
259
|
+
Active = false,
|
|
260
|
+
Selectable = false,
|
|
261
|
+
}, React.createElement("frame", _attributes_1, cornerRadius ~= nil and React.createElement("uicorner", {
|
|
81
262
|
key = "Corner",
|
|
82
263
|
CornerRadius = cornerRadius,
|
|
83
|
-
})))
|
|
264
|
+
}))))
|
|
84
265
|
end
|
|
85
266
|
local default = Shadow
|
|
86
267
|
return {
|
|
@@ -69,6 +69,8 @@ local function SkeletonBlock(props)
|
|
|
69
69
|
_attributes.base = {
|
|
70
70
|
BackgroundTransparency = 1,
|
|
71
71
|
BorderSizePixel = 0,
|
|
72
|
+
AutomaticSize = Enum.AutomaticSize.None,
|
|
73
|
+
ClipsDescendants = true,
|
|
72
74
|
}
|
|
73
75
|
_attributes.className = className
|
|
74
76
|
_attributes.sx = sx
|
|
@@ -179,6 +181,8 @@ local function Skeleton(props)
|
|
|
179
181
|
_attributes.className = className
|
|
180
182
|
_attributes.sx = sx
|
|
181
183
|
_attributes.Size = UDim2.new(0, width, 0, blockHeight)
|
|
184
|
+
_attributes.AutomaticSize = Enum.AutomaticSize.None
|
|
185
|
+
_attributes.ClipsDescendants = true
|
|
182
186
|
_attributes.BackgroundTransparency = 1
|
|
183
187
|
_attributes.BorderSizePixel = 0
|
|
184
188
|
local _exp = React.createElement("uilistlayout", {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ControlSize, CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { SliderColor } from "./Slider.styles";
|
|
3
|
+
import { RangeValue } from "./rangeValue";
|
|
4
|
+
export interface RangeSliderProps {
|
|
5
|
+
value: RangeValue;
|
|
6
|
+
onChange: (value: RangeValue) => void;
|
|
7
|
+
onCommit?: (value: RangeValue) => void;
|
|
8
|
+
min: number;
|
|
9
|
+
max: number;
|
|
10
|
+
step?: number;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
size?: ControlSize;
|
|
13
|
+
color?: SliderColor;
|
|
14
|
+
}
|
|
15
|
+
declare function RangeSlider(props: CustomizedProps<Frame, RangeSliderProps>): JSX.Element;
|
|
16
|
+
export default RangeSlider;
|
|
@@ -0,0 +1,232 @@
|
|
|
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 useRef = _react.useRef
|
|
6
|
+
local useState = _react.useState
|
|
7
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
8
|
+
local controlFade = _theme.controlFade
|
|
9
|
+
local cx = _theme.cx
|
|
10
|
+
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
11
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
12
|
+
local commitNumber = TS.import(script, script.Parent.Parent.Parent, "numberInput", "components", "numberValue").commitNumber
|
|
13
|
+
local _sliderNudge = TS.import(script, script.Parent, "sliderNudge")
|
|
14
|
+
local isSliderDrag = _sliderNudge.isSliderDrag
|
|
15
|
+
local isSliderMove = _sliderNudge.isSliderMove
|
|
16
|
+
local nudgeDelta = _sliderNudge.nudgeDelta
|
|
17
|
+
local nudgeValue = _sliderNudge.nudgeValue
|
|
18
|
+
local useRangeSliderStyles = TS.import(script, script.Parent, "RangeSlider.styles").default
|
|
19
|
+
local _rangeValue = TS.import(script, script.Parent, "rangeValue")
|
|
20
|
+
local orderRange = _rangeValue.orderRange
|
|
21
|
+
local rangeMove = _rangeValue.rangeMove
|
|
22
|
+
local rangeRatios = _rangeValue.rangeRatios
|
|
23
|
+
local rangeThumb = _rangeValue.rangeThumb
|
|
24
|
+
local function RangeSlider(props)
|
|
25
|
+
local _binding = props
|
|
26
|
+
local value = _binding.value
|
|
27
|
+
local onChange = _binding.onChange
|
|
28
|
+
local onCommit = _binding.onCommit
|
|
29
|
+
local min = _binding.min
|
|
30
|
+
local max = _binding.max
|
|
31
|
+
local step = _binding.step
|
|
32
|
+
local disabled = _binding.disabled
|
|
33
|
+
local size = _binding.size
|
|
34
|
+
local color = _binding.color
|
|
35
|
+
if color == nil then
|
|
36
|
+
color = "primary"
|
|
37
|
+
end
|
|
38
|
+
local className = _binding.className
|
|
39
|
+
local sx = _binding.sx
|
|
40
|
+
local id = _binding.id
|
|
41
|
+
local ref = _binding.ref
|
|
42
|
+
local styles = useRangeSliderStyles({
|
|
43
|
+
size = size,
|
|
44
|
+
color = color,
|
|
45
|
+
})
|
|
46
|
+
local ordered = orderRange(value.start, value.finish)
|
|
47
|
+
local ratios = rangeRatios(ordered.start, ordered.finish, min, max)
|
|
48
|
+
local active = canActivate(disabled)
|
|
49
|
+
local focused, setFocused = useState(false)
|
|
50
|
+
local pressed, setPressed = useState(false)
|
|
51
|
+
local dragging = useRef(false)
|
|
52
|
+
local thumb = useRef("low")
|
|
53
|
+
local latest = useRef(ordered)
|
|
54
|
+
latest.current = ordered
|
|
55
|
+
local faded = disabled == true
|
|
56
|
+
local showFocus = focused and active
|
|
57
|
+
local pointerValue = function(rbx, x)
|
|
58
|
+
local width = rbx.AbsoluteSize.X
|
|
59
|
+
if width <= 0 then
|
|
60
|
+
return nil
|
|
61
|
+
end
|
|
62
|
+
return commitNumber(min + ((x - rbx.AbsolutePosition.X) / width) * (max - min), min, max, step)
|
|
63
|
+
end
|
|
64
|
+
local publish = function(landed, commit)
|
|
65
|
+
thumb.current = landed.thumb
|
|
66
|
+
if landed.start == latest.current.start and landed.finish == latest.current.finish then
|
|
67
|
+
return nil
|
|
68
|
+
end
|
|
69
|
+
latest.current = {
|
|
70
|
+
start = landed.start,
|
|
71
|
+
finish = landed.finish,
|
|
72
|
+
}
|
|
73
|
+
onChange(latest.current)
|
|
74
|
+
if commit and onCommit then
|
|
75
|
+
onCommit(latest.current)
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
local update = function(rbx, x)
|
|
79
|
+
local landed = pointerValue(rbx, x)
|
|
80
|
+
if landed == nil then
|
|
81
|
+
return nil
|
|
82
|
+
end
|
|
83
|
+
publish(rangeMove(thumb.current, landed, latest.current.start, latest.current.finish), false)
|
|
84
|
+
end
|
|
85
|
+
local finish = function()
|
|
86
|
+
if not dragging.current then
|
|
87
|
+
return nil
|
|
88
|
+
end
|
|
89
|
+
dragging.current = false
|
|
90
|
+
setPressed(false)
|
|
91
|
+
if onCommit then
|
|
92
|
+
onCommit(latest.current)
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
local nudge = function(direction)
|
|
96
|
+
if not active then
|
|
97
|
+
return nil
|
|
98
|
+
end
|
|
99
|
+
local current = if thumb.current == "low" then latest.current.start else latest.current.finish
|
|
100
|
+
local nudged = nudgeValue(current, min, max, step, direction)
|
|
101
|
+
if nudged == nil then
|
|
102
|
+
return nil
|
|
103
|
+
end
|
|
104
|
+
publish(rangeMove(thumb.current, nudged, latest.current.start, latest.current.finish), true)
|
|
105
|
+
end
|
|
106
|
+
local knobLook = function(ratio, which)
|
|
107
|
+
return cx(styles.knob, {
|
|
108
|
+
Position = UDim2.fromScale(ratio, 0.5),
|
|
109
|
+
BackgroundTransparency = if faded then controlFade else 0,
|
|
110
|
+
ZIndex = if which == thumb.current then 3 else 2,
|
|
111
|
+
})
|
|
112
|
+
end
|
|
113
|
+
local _attributes = {
|
|
114
|
+
tag = "frame",
|
|
115
|
+
}
|
|
116
|
+
local _condition = id
|
|
117
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
118
|
+
_condition = "RangeSlider"
|
|
119
|
+
end
|
|
120
|
+
_attributes.key = _condition
|
|
121
|
+
_attributes.hostRef = ref
|
|
122
|
+
_attributes.base = styles.root
|
|
123
|
+
_attributes.className = className
|
|
124
|
+
_attributes.sx = sx
|
|
125
|
+
_attributes.state = {
|
|
126
|
+
disabled = disabled,
|
|
127
|
+
pressed = pressed,
|
|
128
|
+
focused = focused,
|
|
129
|
+
}
|
|
130
|
+
_attributes.Active = active
|
|
131
|
+
_attributes.Selectable = active
|
|
132
|
+
_attributes.Event = {
|
|
133
|
+
InputBegan = function(rbx, input)
|
|
134
|
+
if not active then
|
|
135
|
+
return nil
|
|
136
|
+
end
|
|
137
|
+
local direction = nudgeDelta(input.KeyCode.Name)
|
|
138
|
+
if direction ~= nil then
|
|
139
|
+
nudge(direction)
|
|
140
|
+
return nil
|
|
141
|
+
end
|
|
142
|
+
if not isSliderDrag(input.UserInputType.Name) then
|
|
143
|
+
return nil
|
|
144
|
+
end
|
|
145
|
+
local landed = pointerValue(rbx, input.Position.X)
|
|
146
|
+
if landed ~= nil then
|
|
147
|
+
thumb.current = rangeThumb(landed, latest.current.start, latest.current.finish)
|
|
148
|
+
end
|
|
149
|
+
dragging.current = true
|
|
150
|
+
setPressed(true)
|
|
151
|
+
update(rbx, input.Position.X)
|
|
152
|
+
end,
|
|
153
|
+
InputChanged = function(rbx, input)
|
|
154
|
+
if dragging.current and isSliderMove(input.UserInputType.Name) then
|
|
155
|
+
update(rbx, input.Position.X)
|
|
156
|
+
end
|
|
157
|
+
end,
|
|
158
|
+
InputEnded = function(_rbx, input)
|
|
159
|
+
if isSliderDrag(input.UserInputType.Name) then
|
|
160
|
+
finish()
|
|
161
|
+
end
|
|
162
|
+
end,
|
|
163
|
+
MouseLeave = function()
|
|
164
|
+
return finish()
|
|
165
|
+
end,
|
|
166
|
+
SelectionGained = function()
|
|
167
|
+
return setFocused(true)
|
|
168
|
+
end,
|
|
169
|
+
SelectionLost = function()
|
|
170
|
+
return setFocused(false)
|
|
171
|
+
end,
|
|
172
|
+
}
|
|
173
|
+
local _attributes_1 = {
|
|
174
|
+
key = "Track",
|
|
175
|
+
}
|
|
176
|
+
for _k, _v in styles.track do
|
|
177
|
+
_attributes_1[_k] = _v
|
|
178
|
+
end
|
|
179
|
+
_attributes_1.BackgroundTransparency = if faded then controlFade else 0.35
|
|
180
|
+
local _attributes_2 = table.clone(styles.corner)
|
|
181
|
+
setmetatable(_attributes_2, nil)
|
|
182
|
+
local _exp = React.createElement("uicorner", _attributes_2)
|
|
183
|
+
local _attributes_3 = {
|
|
184
|
+
key = "Fill",
|
|
185
|
+
}
|
|
186
|
+
for _k, _v in cx(styles.fill, {
|
|
187
|
+
Position = UDim2.fromScale(ratios.low, 0),
|
|
188
|
+
Size = UDim2.fromScale(ratios.high - ratios.low, 1),
|
|
189
|
+
BackgroundTransparency = if faded then controlFade elseif pressed then 0.1 else 0,
|
|
190
|
+
}) do
|
|
191
|
+
_attributes_3[_k] = _v
|
|
192
|
+
end
|
|
193
|
+
local _attributes_4 = table.clone(styles.corner)
|
|
194
|
+
setmetatable(_attributes_4, nil)
|
|
195
|
+
local _exp_1 = React.createElement("frame", _attributes_3, React.createElement("uicorner", _attributes_4))
|
|
196
|
+
local _attributes_5 = {
|
|
197
|
+
key = "Low",
|
|
198
|
+
}
|
|
199
|
+
for _k, _v in knobLook(ratios.low, "low") do
|
|
200
|
+
_attributes_5[_k] = _v
|
|
201
|
+
end
|
|
202
|
+
local _attributes_6 = table.clone(styles.corner)
|
|
203
|
+
setmetatable(_attributes_6, nil)
|
|
204
|
+
local _exp_2 = React.createElement("uicorner", _attributes_6)
|
|
205
|
+
local _condition_1 = showFocus and thumb.current == "low"
|
|
206
|
+
if _condition_1 then
|
|
207
|
+
local _attributes_7 = table.clone(styles.stroke)
|
|
208
|
+
setmetatable(_attributes_7, nil)
|
|
209
|
+
_condition_1 = React.createElement("uistroke", _attributes_7)
|
|
210
|
+
end
|
|
211
|
+
local _exp_3 = React.createElement("frame", _attributes_5, _exp_2, _condition_1)
|
|
212
|
+
local _attributes_7 = {
|
|
213
|
+
key = "High",
|
|
214
|
+
}
|
|
215
|
+
for _k, _v in knobLook(ratios.high, "high") do
|
|
216
|
+
_attributes_7[_k] = _v
|
|
217
|
+
end
|
|
218
|
+
local _attributes_8 = table.clone(styles.corner)
|
|
219
|
+
setmetatable(_attributes_8, nil)
|
|
220
|
+
local _exp_4 = React.createElement("uicorner", _attributes_8)
|
|
221
|
+
local _condition_2 = showFocus and thumb.current == "high"
|
|
222
|
+
if _condition_2 then
|
|
223
|
+
local _attributes_9 = table.clone(styles.stroke)
|
|
224
|
+
setmetatable(_attributes_9, nil)
|
|
225
|
+
_condition_2 = React.createElement("uistroke", _attributes_9)
|
|
226
|
+
end
|
|
227
|
+
return React.createElement(SxHost, _attributes, React.createElement("frame", _attributes_1, _exp, _exp_1, _exp_3, React.createElement("frame", _attributes_7, _exp_4, _condition_2)))
|
|
228
|
+
end
|
|
229
|
+
local default = RangeSlider
|
|
230
|
+
return {
|
|
231
|
+
default = default,
|
|
232
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ControlSize } from "../../../../theme/index";
|
|
2
|
+
import { SliderColor } from "./Slider.styles";
|
|
3
|
+
declare const useRangeSliderStyles: (props: {
|
|
4
|
+
size?: ControlSize;
|
|
5
|
+
color?: SliderColor;
|
|
6
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
7
|
+
export default useRangeSliderStyles;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
|
+
local componentStyles = _theme.componentStyles
|
|
5
|
+
local controlMetrics = _theme.controlMetrics
|
|
6
|
+
local createStyles = _theme.createStyles
|
|
7
|
+
local focusRing = _theme.focusRing
|
|
8
|
+
local useRangeSliderStyles = componentStyles("RangeSlider", function(theme, _param)
|
|
9
|
+
local size = _param.size
|
|
10
|
+
local color = _param.color
|
|
11
|
+
if color == nil then
|
|
12
|
+
color = "primary"
|
|
13
|
+
end
|
|
14
|
+
local metrics = controlMetrics(theme.density, size)
|
|
15
|
+
local tone = if color == "accent" then theme.palette.accent.main else theme.palette.primary.main
|
|
16
|
+
return createStyles({
|
|
17
|
+
root = {
|
|
18
|
+
Size = UDim2.new(1, 0, 0, metrics.sliderHeight),
|
|
19
|
+
BackgroundTransparency = 1,
|
|
20
|
+
BorderSizePixel = 0,
|
|
21
|
+
},
|
|
22
|
+
track = {
|
|
23
|
+
Size = UDim2.new(1, 0, 0, metrics.sliderTrack),
|
|
24
|
+
Position = UDim2.fromScale(0, 0.5),
|
|
25
|
+
AnchorPoint = Vector2.new(0, 0.5),
|
|
26
|
+
BackgroundColor3 = theme.palette.action.disabled,
|
|
27
|
+
BorderSizePixel = 0,
|
|
28
|
+
},
|
|
29
|
+
fill = {
|
|
30
|
+
BackgroundColor3 = tone,
|
|
31
|
+
BorderSizePixel = 0,
|
|
32
|
+
},
|
|
33
|
+
knob = {
|
|
34
|
+
Size = UDim2.fromOffset(metrics.sliderKnob, metrics.sliderKnob),
|
|
35
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
36
|
+
BackgroundColor3 = theme.palette.text.primary,
|
|
37
|
+
BorderSizePixel = 0,
|
|
38
|
+
},
|
|
39
|
+
corner = {
|
|
40
|
+
CornerRadius = UDim.new(1, 0),
|
|
41
|
+
},
|
|
42
|
+
stroke = focusRing(theme.palette.focus),
|
|
43
|
+
})
|
|
44
|
+
end)
|
|
45
|
+
local default = useRangeSliderStyles
|
|
46
|
+
return {
|
|
47
|
+
default = default,
|
|
48
|
+
}
|
|
@@ -10,6 +10,7 @@ export interface SliderProps {
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
size?: ControlSize;
|
|
12
12
|
marks?: boolean | ReadonlyArray<number>;
|
|
13
|
+
format?: (value: number) => string;
|
|
13
14
|
color?: SliderColor;
|
|
14
15
|
}
|
|
15
16
|
declare function Slider(props: CustomizedProps<Frame, SliderProps>): JSX.Element;
|