@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
|
@@ -5,16 +5,21 @@ local React = _react
|
|
|
5
5
|
local useEffect = _react.useEffect
|
|
6
6
|
local useState = _react.useState
|
|
7
7
|
local useReducedMotion = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "hooks").useReducedMotion
|
|
8
|
-
local
|
|
8
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
9
|
+
local controlMetrics = _theme.controlMetrics
|
|
10
|
+
local useTheme = _theme.useTheme
|
|
9
11
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
10
12
|
local CircularProgress = TS.import(script, script.Parent.Parent.Parent, "circularProgress").CircularProgress
|
|
11
13
|
local LoadingStroke = TS.import(script, script.Parent.Parent.Parent, "loadingStroke").LoadingStroke
|
|
12
14
|
local canActivate = TS.import(script, script.Parent, "activation").canActivate
|
|
13
15
|
local _buttonLook = TS.import(script, script.Parent, "buttonLook")
|
|
14
16
|
local buttonFace = _buttonLook.buttonFace
|
|
17
|
+
local buttonIcon = _buttonLook.buttonIcon
|
|
15
18
|
local spinnerPixels = _buttonLook.spinnerPixels
|
|
16
19
|
local spinnerPlace = _buttonLook.spinnerPlace
|
|
20
|
+
local buttonPaint = TS.import(script, script.Parent, "buttonPaint").buttonPaint
|
|
17
21
|
local useButtonStyles = TS.import(script, script.Parent, "Button.styles").default
|
|
22
|
+
local buttonColors
|
|
18
23
|
local function Button(props)
|
|
19
24
|
local _binding = props
|
|
20
25
|
local text = _binding.text
|
|
@@ -25,6 +30,7 @@ local function Button(props)
|
|
|
25
30
|
if variant == nil then
|
|
26
31
|
variant = "contained"
|
|
27
32
|
end
|
|
33
|
+
local icon = _binding.icon
|
|
28
34
|
local disabled = _binding.disabled
|
|
29
35
|
if disabled == nil then
|
|
30
36
|
disabled = false
|
|
@@ -69,24 +75,38 @@ local function Button(props)
|
|
|
69
75
|
local font = _binding_1.font
|
|
70
76
|
local corner = _binding_1.corner
|
|
71
77
|
local stroke = _binding_1.stroke
|
|
78
|
+
local focus = _binding_1.focus
|
|
72
79
|
local _binding_2 = useTheme()
|
|
73
80
|
local theme = _binding_2.theme
|
|
81
|
+
local metrics = controlMetrics(theme.density, props.size)
|
|
82
|
+
local glyph = buttonIcon(icon, loading)
|
|
83
|
+
local grow = glyph ~= nil and props.fullWidth ~= true
|
|
74
84
|
local reducedMotion = useReducedMotion(reducedProp)
|
|
75
85
|
local hovering, setHovering = useState(false)
|
|
86
|
+
local down, setDown = useState(false)
|
|
76
87
|
local focused, setFocused = useState(false)
|
|
77
88
|
local active = canActivate(disabled, loading)
|
|
78
|
-
local pressed = disabled or (not hoveringDisabled and active and (hovering or focused))
|
|
79
89
|
local face = buttonFace(text, loading, loadingLabel)
|
|
80
90
|
local place = spinnerPlace(loadingPosition)
|
|
81
91
|
local busy = loading or animating
|
|
92
|
+
local sweep = animating and not loading
|
|
82
93
|
local branded = (props.color or "primary") == "primary"
|
|
83
|
-
local
|
|
94
|
+
local paint = buttonPaint({
|
|
95
|
+
variant = variant,
|
|
96
|
+
branded = branded,
|
|
97
|
+
disabled = disabled,
|
|
98
|
+
hover = hovering and not hoveringDisabled and active,
|
|
99
|
+
down = down and active,
|
|
100
|
+
})
|
|
101
|
+
local colors = buttonColors(theme, paint)
|
|
102
|
+
local labelTransparency = if face.hideText then 1 else paint.labelTransparency
|
|
84
103
|
useEffect(function()
|
|
85
104
|
if active then
|
|
86
105
|
return nil
|
|
87
106
|
end
|
|
88
107
|
setHovering(false)
|
|
89
108
|
setFocused(false)
|
|
109
|
+
setDown(false)
|
|
90
110
|
end, { active })
|
|
91
111
|
local _attributes = {
|
|
92
112
|
tag = "textbutton",
|
|
@@ -102,40 +122,30 @@ local function Button(props)
|
|
|
102
122
|
for _k, _v in font do
|
|
103
123
|
_object[_k] = _v
|
|
104
124
|
end
|
|
125
|
+
_object.BackgroundColor3 = colors.fill
|
|
126
|
+
_object.BackgroundTransparency = paint.fillTransparency
|
|
127
|
+
_object.TextColor3 = colors.label
|
|
128
|
+
_object.TextTransparency = labelTransparency
|
|
105
129
|
_attributes.base = _object
|
|
106
130
|
_attributes.className = className
|
|
107
131
|
_attributes.sx = sx
|
|
108
132
|
_attributes.state = {
|
|
109
133
|
disabled = disabled,
|
|
110
134
|
loading = loading,
|
|
111
|
-
hover = hovering,
|
|
112
|
-
pressed =
|
|
135
|
+
hover = hovering and not hoveringDisabled,
|
|
136
|
+
pressed = down,
|
|
113
137
|
focused = focused,
|
|
114
138
|
}
|
|
115
139
|
_attributes.Active = active
|
|
116
|
-
_attributes.AutoButtonColor =
|
|
140
|
+
_attributes.AutoButtonColor = false
|
|
117
141
|
_attributes.Selectable = active
|
|
118
|
-
_attributes.Text = face.text
|
|
119
|
-
for _k, _v in (if
|
|
120
|
-
|
|
142
|
+
_attributes.Text = if glyph ~= nil then "" else face.text
|
|
143
|
+
for _k, _v in (if grow then {
|
|
144
|
+
AutomaticSize = Enum.AutomaticSize.X,
|
|
145
|
+
Size = UDim2.new(0, 0, 0, metrics.buttonHeight),
|
|
121
146
|
} else {}) do
|
|
122
147
|
_attributes[_k] = _v
|
|
123
148
|
end
|
|
124
|
-
local _result
|
|
125
|
-
if pressed then
|
|
126
|
-
_result = 0.75
|
|
127
|
-
else
|
|
128
|
-
local _result_1 = className
|
|
129
|
-
if _result_1 ~= nil then
|
|
130
|
-
_result_1 = _result_1.BackgroundTransparency
|
|
131
|
-
end
|
|
132
|
-
local _condition_1 = _result_1
|
|
133
|
-
if _condition_1 == nil then
|
|
134
|
-
_condition_1 = (if variant == "outlined" or variant == "text" then 1 else 0)
|
|
135
|
-
end
|
|
136
|
-
_result = _condition_1
|
|
137
|
-
end
|
|
138
|
-
_attributes.BackgroundTransparency = _result
|
|
139
149
|
_attributes.Event = {
|
|
140
150
|
MouseEnter = function()
|
|
141
151
|
if not active then
|
|
@@ -148,6 +158,7 @@ local function Button(props)
|
|
|
148
158
|
end,
|
|
149
159
|
MouseLeave = function()
|
|
150
160
|
setHovering(false)
|
|
161
|
+
setDown(false)
|
|
151
162
|
if mouseLeave then
|
|
152
163
|
mouseLeave()
|
|
153
164
|
end
|
|
@@ -166,11 +177,16 @@ local function Button(props)
|
|
|
166
177
|
end
|
|
167
178
|
end,
|
|
168
179
|
MouseButton1Down = function()
|
|
169
|
-
if active
|
|
180
|
+
if not active then
|
|
181
|
+
return nil
|
|
182
|
+
end
|
|
183
|
+
setDown(true)
|
|
184
|
+
if onLeftDown then
|
|
170
185
|
onLeftDown()
|
|
171
186
|
end
|
|
172
187
|
end,
|
|
173
188
|
MouseButton1Up = function()
|
|
189
|
+
setDown(false)
|
|
174
190
|
if active and onLeftUp then
|
|
175
191
|
onLeftUp()
|
|
176
192
|
end
|
|
@@ -191,33 +207,93 @@ local function Button(props)
|
|
|
191
207
|
end
|
|
192
208
|
end,
|
|
193
209
|
}
|
|
194
|
-
local _condition_1 =
|
|
210
|
+
local _condition_1 = not sweep and focused
|
|
195
211
|
if _condition_1 then
|
|
196
|
-
local _attributes_1 = table.clone(
|
|
212
|
+
local _attributes_1 = table.clone(focus)
|
|
197
213
|
setmetatable(_attributes_1, nil)
|
|
198
214
|
_condition_1 = React.createElement("uistroke", _attributes_1)
|
|
199
215
|
end
|
|
200
|
-
local
|
|
201
|
-
animating = busy and not reducedMotion,
|
|
202
|
-
color = spinnerColor,
|
|
203
|
-
})
|
|
204
|
-
local _condition_2 = rounded
|
|
216
|
+
local _condition_2 = not sweep and not focused and variant == "outlined"
|
|
205
217
|
if _condition_2 then
|
|
218
|
+
local _attributes_1 = table.clone(stroke)
|
|
219
|
+
setmetatable(_attributes_1, nil)
|
|
220
|
+
_condition_2 = React.createElement("uistroke", _attributes_1)
|
|
221
|
+
end
|
|
222
|
+
local _exp = sweep and React.createElement(LoadingStroke, {
|
|
223
|
+
animating = not reducedMotion,
|
|
224
|
+
color = colors.label,
|
|
225
|
+
})
|
|
226
|
+
local _condition_3 = rounded
|
|
227
|
+
if _condition_3 then
|
|
206
228
|
local _attributes_1 = table.clone(corner)
|
|
207
229
|
setmetatable(_attributes_1, nil)
|
|
208
|
-
|
|
230
|
+
_condition_3 = React.createElement("uicorner", _attributes_1)
|
|
209
231
|
end
|
|
210
|
-
return React.createElement(SxHost, _attributes, _condition_1, _exp,
|
|
232
|
+
return React.createElement(SxHost, _attributes, _condition_1, _condition_2, _exp, _condition_3, loading and (React.createElement(CircularProgress, {
|
|
211
233
|
size = spinnerPixels(props.size),
|
|
212
234
|
thickness = 2,
|
|
213
|
-
color =
|
|
235
|
+
color = colors.label,
|
|
214
236
|
reducedMotion = reducedMotion,
|
|
215
237
|
className = {
|
|
216
238
|
AnchorPoint = Vector2.new(place.anchorX, 0.5),
|
|
217
239
|
Position = UDim2.new(place.xScale, place.xOffset, 0.5, 0),
|
|
218
240
|
ZIndex = 10001,
|
|
219
241
|
},
|
|
220
|
-
})),
|
|
242
|
+
})), glyph ~= nil and (React.createElement(React.Fragment, nil, React.createElement("uipadding", {
|
|
243
|
+
PaddingLeft = UDim.new(0, theme.padding.calc(2)),
|
|
244
|
+
PaddingRight = UDim.new(0, theme.padding.calc(2)),
|
|
245
|
+
}), React.createElement("uilistlayout", {
|
|
246
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
247
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
248
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Center,
|
|
249
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
250
|
+
Padding = UDim.new(0, theme.padding.calc(1)),
|
|
251
|
+
}), React.createElement("imagelabel", {
|
|
252
|
+
key = "Icon",
|
|
253
|
+
LayoutOrder = 1,
|
|
254
|
+
BackgroundTransparency = 1,
|
|
255
|
+
BorderSizePixel = 0,
|
|
256
|
+
ScaleType = Enum.ScaleType.Fit,
|
|
257
|
+
Image = glyph,
|
|
258
|
+
ImageColor3 = colors.label,
|
|
259
|
+
ImageTransparency = labelTransparency,
|
|
260
|
+
Size = UDim2.fromOffset(metrics.icon, metrics.icon),
|
|
261
|
+
}), React.createElement("textlabel", {
|
|
262
|
+
key = "Label",
|
|
263
|
+
LayoutOrder = 2,
|
|
264
|
+
BackgroundTransparency = 1,
|
|
265
|
+
BorderSizePixel = 0,
|
|
266
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
267
|
+
Size = UDim2.fromScale(0, 0),
|
|
268
|
+
Font = theme.typography.fontFamilies.default,
|
|
269
|
+
TextSize = metrics.font,
|
|
270
|
+
TextColor3 = colors.label,
|
|
271
|
+
TextTransparency = labelTransparency,
|
|
272
|
+
Text = face.text,
|
|
273
|
+
}))), children)
|
|
274
|
+
end
|
|
275
|
+
function buttonColors(theme, paint)
|
|
276
|
+
local brand = theme.palette.primary
|
|
277
|
+
local fills = {
|
|
278
|
+
primary = brand.main,
|
|
279
|
+
primaryHover = brand.hover,
|
|
280
|
+
primaryPressed = brand.pressed,
|
|
281
|
+
ink = theme.palette.text.primary,
|
|
282
|
+
actionHover = theme.palette.action.hover,
|
|
283
|
+
actionPressed = theme.palette.action.pressed,
|
|
284
|
+
none = theme.palette.surface.paper,
|
|
285
|
+
}
|
|
286
|
+
local labels = {
|
|
287
|
+
onPrimary = brand.on,
|
|
288
|
+
inverse = theme.palette.text.inverse,
|
|
289
|
+
primary = brand.main,
|
|
290
|
+
ink = theme.palette.text.primary,
|
|
291
|
+
disabled = theme.palette.text.disabled,
|
|
292
|
+
}
|
|
293
|
+
return {
|
|
294
|
+
fill = fills[paint.fill],
|
|
295
|
+
label = labels[paint.label],
|
|
296
|
+
}
|
|
221
297
|
end
|
|
222
298
|
local default = Button
|
|
223
299
|
return {
|
|
@@ -4,6 +4,7 @@ local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "the
|
|
|
4
4
|
local controlMetrics = _theme.controlMetrics
|
|
5
5
|
local createStyles = _theme.createStyles
|
|
6
6
|
local componentStyles = _theme.componentStyles
|
|
7
|
+
local focusRing = _theme.focusRing
|
|
7
8
|
local makeRootStyles = function(theme, _param)
|
|
8
9
|
local size = _param.size
|
|
9
10
|
local color = _param.color
|
|
@@ -121,6 +122,7 @@ local useButtonStyles = componentStyles("Button", function(theme, _param)
|
|
|
121
122
|
Transparency = 0,
|
|
122
123
|
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
123
124
|
},
|
|
125
|
+
focus = focusRing(theme.palette.focus),
|
|
124
126
|
})
|
|
125
127
|
end)
|
|
126
128
|
local default = useButtonStyles
|
|
@@ -8,5 +8,7 @@ export declare function spinnerPlace(position?: LoadingPosition): {
|
|
|
8
8
|
xOffset: number;
|
|
9
9
|
anchorX: number;
|
|
10
10
|
};
|
|
11
|
+
/** An empty glyph stays off the button. Loading keeps the spinner path. */
|
|
12
|
+
export declare function buttonIcon(icon?: string, loading?: boolean): string | undefined;
|
|
11
13
|
export declare function spinnerPixels(size?: "small" | "medium" | "large"): 16 | 14 | 12;
|
|
12
14
|
export declare function iconSpinnerPixels(size?: string): 16 | 12 | 8;
|
|
@@ -29,6 +29,16 @@ local function spinnerPlace(position)
|
|
|
29
29
|
anchorX = 0.5,
|
|
30
30
|
}
|
|
31
31
|
end
|
|
32
|
+
--* An empty glyph stays off the button. Loading keeps the spinner path.
|
|
33
|
+
local function buttonIcon(icon, loading)
|
|
34
|
+
if loading == true then
|
|
35
|
+
return nil
|
|
36
|
+
end
|
|
37
|
+
if icon == nil or icon == "" then
|
|
38
|
+
return nil
|
|
39
|
+
end
|
|
40
|
+
return icon
|
|
41
|
+
end
|
|
32
42
|
local function spinnerPixels(size)
|
|
33
43
|
if size == "large" then
|
|
34
44
|
return 16
|
|
@@ -50,6 +60,7 @@ end
|
|
|
50
60
|
return {
|
|
51
61
|
buttonFace = buttonFace,
|
|
52
62
|
spinnerPlace = spinnerPlace,
|
|
63
|
+
buttonIcon = buttonIcon,
|
|
53
64
|
spinnerPixels = spinnerPixels,
|
|
54
65
|
iconSpinnerPixels = iconSpinnerPixels,
|
|
55
66
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ButtonVariantName = "contained" | "outlined" | "text";
|
|
2
|
+
export type ButtonFill = "primary" | "primaryHover" | "primaryPressed" | "ink" | "actionHover" | "actionPressed" | "none";
|
|
3
|
+
export type ButtonLabel = "onPrimary" | "inverse" | "primary" | "ink" | "disabled";
|
|
4
|
+
export interface ButtonPaint {
|
|
5
|
+
fill: ButtonFill;
|
|
6
|
+
label: ButtonLabel;
|
|
7
|
+
fillTransparency: number;
|
|
8
|
+
labelTransparency: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function buttonPaint(input: {
|
|
11
|
+
variant: ButtonVariantName;
|
|
12
|
+
branded: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
hover: boolean;
|
|
15
|
+
down: boolean;
|
|
16
|
+
}): ButtonPaint;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function buttonPaint(input)
|
|
3
|
+
local contained = input.variant ~= "outlined" and input.variant ~= "text"
|
|
4
|
+
if input.disabled then
|
|
5
|
+
if contained then
|
|
6
|
+
return {
|
|
7
|
+
fill = if input.branded then "primary" else "ink",
|
|
8
|
+
label = if input.branded then "onPrimary" else "inverse",
|
|
9
|
+
fillTransparency = 0.45,
|
|
10
|
+
labelTransparency = 0.35,
|
|
11
|
+
}
|
|
12
|
+
end
|
|
13
|
+
return {
|
|
14
|
+
fill = "none",
|
|
15
|
+
label = "disabled",
|
|
16
|
+
fillTransparency = 1,
|
|
17
|
+
labelTransparency = 0,
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
if contained then
|
|
21
|
+
if input.down then
|
|
22
|
+
return {
|
|
23
|
+
fill = if input.branded then "primaryPressed" else "actionPressed",
|
|
24
|
+
label = if input.branded then "onPrimary" else "ink",
|
|
25
|
+
fillTransparency = 0,
|
|
26
|
+
labelTransparency = 0,
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
if input.hover then
|
|
30
|
+
return {
|
|
31
|
+
fill = if input.branded then "primaryHover" else "actionHover",
|
|
32
|
+
label = if input.branded then "onPrimary" else "ink",
|
|
33
|
+
fillTransparency = 0,
|
|
34
|
+
labelTransparency = 0,
|
|
35
|
+
}
|
|
36
|
+
end
|
|
37
|
+
return {
|
|
38
|
+
fill = if input.branded then "primary" else "ink",
|
|
39
|
+
label = if input.branded then "onPrimary" else "inverse",
|
|
40
|
+
fillTransparency = 0,
|
|
41
|
+
labelTransparency = 0,
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
local label = if input.branded then "primary" else "ink"
|
|
45
|
+
if input.down then
|
|
46
|
+
return {
|
|
47
|
+
fill = "actionPressed",
|
|
48
|
+
label = label,
|
|
49
|
+
fillTransparency = 0,
|
|
50
|
+
labelTransparency = 0,
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
if input.hover then
|
|
54
|
+
return {
|
|
55
|
+
fill = "actionHover",
|
|
56
|
+
label = label,
|
|
57
|
+
fillTransparency = 0,
|
|
58
|
+
labelTransparency = 0,
|
|
59
|
+
}
|
|
60
|
+
end
|
|
61
|
+
return {
|
|
62
|
+
fill = "none",
|
|
63
|
+
label = label,
|
|
64
|
+
fillTransparency = 1,
|
|
65
|
+
labelTransparency = 0,
|
|
66
|
+
}
|
|
67
|
+
end
|
|
68
|
+
return {
|
|
69
|
+
buttonPaint = buttonPaint,
|
|
70
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ControlSize, CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
export interface ButtonGroupItem {
|
|
3
|
+
label: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface ButtonGroupProps {
|
|
7
|
+
items: ButtonGroupItem[];
|
|
8
|
+
onItem?: (index: number) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
size?: ControlSize;
|
|
11
|
+
selected?: number;
|
|
12
|
+
}
|
|
13
|
+
declare function ButtonGroup(props: CustomizedProps<Frame, ButtonGroupProps>): JSX.Element;
|
|
14
|
+
export default ButtonGroup;
|
|
@@ -0,0 +1,117 @@
|
|
|
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 useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").useTheme
|
|
5
|
+
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
6
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
7
|
+
local buttonGroupEdge = TS.import(script, script.Parent, "buttonGroupEdge").buttonGroupEdge
|
|
8
|
+
local useButtonGroupStyles = TS.import(script, script.Parent, "ButtonGroup.styles").default
|
|
9
|
+
local function ButtonGroup(props)
|
|
10
|
+
local _binding = props
|
|
11
|
+
local items = _binding.items
|
|
12
|
+
local onItem = _binding.onItem
|
|
13
|
+
local disabled = _binding.disabled
|
|
14
|
+
local size = _binding.size
|
|
15
|
+
local selected = _binding.selected
|
|
16
|
+
local className = _binding.className
|
|
17
|
+
local sx = _binding.sx
|
|
18
|
+
local id = _binding.id
|
|
19
|
+
local ref = _binding.ref
|
|
20
|
+
local styles = useButtonGroupStyles({
|
|
21
|
+
size = size,
|
|
22
|
+
})
|
|
23
|
+
local _binding_1 = useTheme()
|
|
24
|
+
local theme = _binding_1.theme
|
|
25
|
+
local count = #items
|
|
26
|
+
local groupOff = disabled == true
|
|
27
|
+
local _attributes = {
|
|
28
|
+
tag = "frame",
|
|
29
|
+
}
|
|
30
|
+
local _condition = id
|
|
31
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
32
|
+
_condition = "ButtonGroup"
|
|
33
|
+
end
|
|
34
|
+
_attributes.key = _condition
|
|
35
|
+
_attributes.hostRef = ref
|
|
36
|
+
_attributes.base = styles.root
|
|
37
|
+
_attributes.className = className
|
|
38
|
+
_attributes.sx = sx
|
|
39
|
+
_attributes.state = {
|
|
40
|
+
disabled = groupOff,
|
|
41
|
+
}
|
|
42
|
+
local _attributes_1 = table.clone(styles.corner)
|
|
43
|
+
setmetatable(_attributes_1, nil)
|
|
44
|
+
local _exp = React.createElement("uicorner", _attributes_1)
|
|
45
|
+
local _attributes_2 = table.clone(styles.stroke)
|
|
46
|
+
setmetatable(_attributes_2, nil)
|
|
47
|
+
local _exp_1 = React.createElement("uistroke", _attributes_2)
|
|
48
|
+
local _attributes_3 = table.clone(styles.list)
|
|
49
|
+
setmetatable(_attributes_3, nil)
|
|
50
|
+
local _exp_2 = React.createElement("uilistlayout", _attributes_3)
|
|
51
|
+
-- ▼ ReadonlyArray.map ▼
|
|
52
|
+
local _newValue = table.create(#items)
|
|
53
|
+
local _callback = function(item, index)
|
|
54
|
+
local off = groupOff or item.disabled == true
|
|
55
|
+
local active = canActivate(off)
|
|
56
|
+
local picked = not off and index == selected
|
|
57
|
+
local edge = buttonGroupEdge(index, count)
|
|
58
|
+
local rule = edge == "start" or edge == "middle"
|
|
59
|
+
local _attributes_4 = {
|
|
60
|
+
key = `{item.label}-{index}`,
|
|
61
|
+
}
|
|
62
|
+
for _k, _v in styles.item do
|
|
63
|
+
_attributes_4[_k] = _v
|
|
64
|
+
end
|
|
65
|
+
_attributes_4.Text = item.label
|
|
66
|
+
_attributes_4.TextColor3 = if picked then theme.palette.primary.on else theme.palette.text.primary
|
|
67
|
+
_attributes_4.BackgroundColor3 = theme.palette.primary.main
|
|
68
|
+
_attributes_4.BackgroundTransparency = if picked then 0 else 1
|
|
69
|
+
_attributes_4.TextTransparency = if off then 0.5 else 0
|
|
70
|
+
_attributes_4.Active = active
|
|
71
|
+
_attributes_4.Selectable = active
|
|
72
|
+
_attributes_4.LayoutOrder = index * 2
|
|
73
|
+
_attributes_4.Event = {
|
|
74
|
+
Activated = function()
|
|
75
|
+
if active then
|
|
76
|
+
local _result = onItem
|
|
77
|
+
if _result ~= nil then
|
|
78
|
+
_result(index)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end,
|
|
82
|
+
}
|
|
83
|
+
local _attributes_5 = table.clone(styles.pad)
|
|
84
|
+
setmetatable(_attributes_5, nil)
|
|
85
|
+
local _exp_3 = React.createElement("uipadding", _attributes_5)
|
|
86
|
+
local _condition_1 = picked and edge ~= "middle"
|
|
87
|
+
if _condition_1 then
|
|
88
|
+
local _attributes_6 = table.clone(styles.corner)
|
|
89
|
+
setmetatable(_attributes_6, nil)
|
|
90
|
+
_condition_1 = React.createElement("uicorner", _attributes_6)
|
|
91
|
+
end
|
|
92
|
+
local _exp_4 = React.createElement("textbutton", _attributes_4, _exp_3, _condition_1)
|
|
93
|
+
local _result
|
|
94
|
+
if rule then
|
|
95
|
+
local _attributes_6 = {
|
|
96
|
+
key = `Rule-{index}`,
|
|
97
|
+
}
|
|
98
|
+
for _k, _v in styles.rule do
|
|
99
|
+
_attributes_6[_k] = _v
|
|
100
|
+
end
|
|
101
|
+
_attributes_6.LayoutOrder = index * 2 + 1
|
|
102
|
+
_result = React.createElement("frame", _attributes_6)
|
|
103
|
+
else
|
|
104
|
+
_result = nil
|
|
105
|
+
end
|
|
106
|
+
return React.createElement(React.Fragment, nil, _exp_4, _result)
|
|
107
|
+
end
|
|
108
|
+
for _k, _v in items do
|
|
109
|
+
_newValue[_k] = _callback(_v, _k - 1, items)
|
|
110
|
+
end
|
|
111
|
+
-- ▲ ReadonlyArray.map ▲
|
|
112
|
+
return React.createElement(SxHost, _attributes, _exp, _exp_1, _exp_2, React.createElement(React.Fragment, nil, _newValue))
|
|
113
|
+
end
|
|
114
|
+
local default = ButtonGroup
|
|
115
|
+
return {
|
|
116
|
+
default = default,
|
|
117
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 useButtonGroupStyles = componentStyles("ButtonGroup", function(theme, _param)
|
|
8
|
+
local size = _param.size
|
|
9
|
+
local metrics = controlMetrics(theme.density, size)
|
|
10
|
+
local button = theme.typography.variants.button
|
|
11
|
+
return createStyles({
|
|
12
|
+
root = {
|
|
13
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
14
|
+
Size = UDim2.fromScale(0, 0),
|
|
15
|
+
BackgroundColor3 = theme.palette.surface.paper,
|
|
16
|
+
BorderSizePixel = 0,
|
|
17
|
+
ClipsDescendants = true,
|
|
18
|
+
},
|
|
19
|
+
list = {
|
|
20
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
21
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
22
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
23
|
+
Padding = UDim.new(0, 0),
|
|
24
|
+
},
|
|
25
|
+
corner = {
|
|
26
|
+
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
27
|
+
},
|
|
28
|
+
stroke = {
|
|
29
|
+
Color = theme.palette.border,
|
|
30
|
+
Thickness = 1,
|
|
31
|
+
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
32
|
+
},
|
|
33
|
+
item = {
|
|
34
|
+
AutomaticSize = Enum.AutomaticSize.X,
|
|
35
|
+
Size = UDim2.new(0, 0, 0, metrics.buttonHeight),
|
|
36
|
+
BackgroundTransparency = 1,
|
|
37
|
+
BorderSizePixel = 0,
|
|
38
|
+
AutoButtonColor = false,
|
|
39
|
+
Font = theme.typography.fontFamilies[button.family],
|
|
40
|
+
TextSize = button.size,
|
|
41
|
+
TextColor3 = theme.palette.text.primary,
|
|
42
|
+
},
|
|
43
|
+
pad = {
|
|
44
|
+
PaddingLeft = UDim.new(0, theme.padding.calc(2)),
|
|
45
|
+
PaddingRight = UDim.new(0, theme.padding.calc(2)),
|
|
46
|
+
},
|
|
47
|
+
rule = {
|
|
48
|
+
Size = UDim2.new(0, 1, 0, metrics.buttonHeight),
|
|
49
|
+
BackgroundColor3 = theme.palette.border,
|
|
50
|
+
BorderSizePixel = 0,
|
|
51
|
+
},
|
|
52
|
+
})
|
|
53
|
+
end)
|
|
54
|
+
local default = useButtonGroupStyles
|
|
55
|
+
return {
|
|
56
|
+
default = default,
|
|
57
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function buttonGroupEdge(index, count)
|
|
3
|
+
if count <= 1 or index < 0 then
|
|
4
|
+
return "only"
|
|
5
|
+
end
|
|
6
|
+
if index == 0 then
|
|
7
|
+
return "start"
|
|
8
|
+
end
|
|
9
|
+
if index >= count - 1 then
|
|
10
|
+
return "end"
|
|
11
|
+
end
|
|
12
|
+
return "middle"
|
|
13
|
+
end
|
|
14
|
+
return {
|
|
15
|
+
buttonGroupEdge = buttonGroupEdge,
|
|
16
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
exports.ButtonGroup = TS.import(script, script, "components", "ButtonGroup").default
|
|
5
|
+
exports.buttonGroupEdge = TS.import(script, script, "components", "buttonGroupEdge").buttonGroupEdge
|
|
6
|
+
return exports
|
|
@@ -13,12 +13,31 @@ local function Card(props)
|
|
|
13
13
|
end
|
|
14
14
|
local square = _binding.square
|
|
15
15
|
local actions = _binding.actions
|
|
16
|
+
local fullWidth = _binding.fullWidth
|
|
16
17
|
local children = _binding.children
|
|
17
18
|
local className = _binding.className
|
|
18
19
|
local sx = _binding.sx
|
|
19
20
|
local id = _binding.id
|
|
20
21
|
local ref = _binding.ref
|
|
21
|
-
local styles = useCardStyles(
|
|
22
|
+
local styles = useCardStyles({
|
|
23
|
+
fullWidth = fullWidth,
|
|
24
|
+
})
|
|
25
|
+
local _result
|
|
26
|
+
if fullWidth == true then
|
|
27
|
+
local _object = {
|
|
28
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
29
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
30
|
+
}
|
|
31
|
+
if sx then
|
|
32
|
+
for _k, _v in sx do
|
|
33
|
+
_object[_k] = _v
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
_result = _object
|
|
37
|
+
else
|
|
38
|
+
_result = sx
|
|
39
|
+
end
|
|
40
|
+
local paperSx = _result
|
|
22
41
|
local _attributes = {
|
|
23
42
|
key = "Column",
|
|
24
43
|
}
|
|
@@ -73,7 +92,7 @@ local function Card(props)
|
|
|
73
92
|
elevation = elevation,
|
|
74
93
|
square = square,
|
|
75
94
|
className = className,
|
|
76
|
-
sx =
|
|
95
|
+
sx = paperSx,
|
|
77
96
|
id = id,
|
|
78
97
|
ref = ref,
|
|
79
98
|
}, React.createElement("frame", _attributes, _exp, _condition, _condition_1, _exp_1, _condition_2))
|