@rbxts/uiblox 0.2.0-alpha.3 → 0.2.0-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -109
- package/out/hooks/index.d.ts +1 -0
- package/out/hooks/init.luau +3 -0
- package/out/hooks/useBreakpoints.luau +2 -11
- package/out/hooks/viewportObserver.d.ts +10 -0
- package/out/hooks/viewportObserver.luau +75 -0
- package/out/theme/interfaces/theme/Theme.d.ts +15 -0
- package/out/theme/styles/utilities/componentStyles.luau +45 -3
- package/out/theme/styles/utilities/componentTheme.d.ts +15 -0
- package/out/theme/styles/utilities/index.d.ts +2 -0
- package/out/theme/styles/utilities/init.luau +7 -0
- package/out/theme/styles/utilities/resolveStyle.d.ts +10 -2
- package/out/theme/styles/utilities/resolveStyle.luau +7 -3
- package/out/theme/styles/utilities/resolveSx.d.ts +120 -0
- package/out/theme/styles/utilities/resolveSx.luau +524 -0
- package/out/theme/styles/utilities/styleCache.d.ts +2 -0
- package/out/theme/styles/utilities/styleCache.luau +9 -0
- package/out/ui/packages/accordion/components/Accordion.d.ts +2 -0
- package/out/ui/packages/accordion/components/Accordion.luau +46 -30
- package/out/ui/packages/accordion/components/Accordion.styles.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.styles.luau +16 -4
- package/out/ui/packages/accordion/components/accordionOpen.d.ts +1 -0
- package/out/ui/packages/accordion/components/accordionOpen.luau +4 -0
- package/out/ui/packages/alert/components/Alert.d.ts +2 -0
- package/out/ui/packages/alert/components/Alert.luau +48 -42
- package/out/ui/packages/alert/components/Alert.styles.d.ts +2 -0
- package/out/ui/packages/alert/components/Alert.styles.luau +17 -8
- package/out/ui/packages/appBar/components/AppBar.d.ts +2 -1
- package/out/ui/packages/appBar/components/AppBar.luau +47 -36
- package/out/ui/packages/appBar/components/AppBar.styles.d.ts +2 -0
- package/out/ui/packages/appBar/components/AppBar.styles.luau +16 -5
- package/out/ui/packages/assetField/components/AssetField.luau +12 -16
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +8 -0
- package/out/ui/packages/avatar/components/Avatar.d.ts +2 -0
- package/out/ui/packages/avatar/components/Avatar.luau +27 -26
- package/out/ui/packages/avatar/components/Avatar.styles.d.ts +2 -0
- package/out/ui/packages/avatar/components/Avatar.styles.luau +5 -1
- package/out/ui/packages/backdrop/components/Backdrop.d.ts +10 -0
- package/out/ui/packages/backdrop/components/Backdrop.luau +51 -0
- package/out/ui/packages/backdrop/components/Backdrop.styles.d.ts +4 -0
- package/out/ui/packages/backdrop/components/Backdrop.styles.luau +24 -0
- package/out/ui/packages/backdrop/index.d.ts +2 -0
- package/out/ui/packages/backdrop/init.luau +5 -0
- package/out/ui/packages/badge/components/Badge.d.ts +3 -0
- package/out/ui/packages/badge/components/Badge.luau +32 -24
- package/out/ui/packages/badge/components/Badge.styles.d.ts +5 -1
- package/out/ui/packages/badge/components/Badge.styles.luau +20 -8
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +1 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +20 -18
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.d.ts +3 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +6 -2
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +67 -40
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +9 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +68 -0
- package/out/ui/packages/breadcrumbs/index.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/init.luau +3 -0
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +12 -16
- package/out/ui/packages/button/components/Button.luau +28 -22
- package/out/ui/packages/card/components/Card.d.ts +3 -1
- package/out/ui/packages/card/components/Card.luau +10 -0
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +75 -53
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +26 -9
- package/out/ui/packages/checkbox/components/Checkbox.luau +16 -16
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
- package/out/ui/packages/chip/components/Chip.d.ts +6 -1
- package/out/ui/packages/chip/components/Chip.luau +61 -17
- package/out/ui/packages/chip/components/Chip.styles.d.ts +6 -0
- package/out/ui/packages/chip/components/Chip.styles.luau +54 -9
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +29 -18
- package/out/ui/packages/colorPicker/components/ColorPicker.luau +16 -20
- package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +34 -20
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +34 -35
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +65 -62
- package/out/ui/packages/dialog/components/Dialog.d.ts +3 -2
- package/out/ui/packages/dialog/components/Dialog.luau +41 -21
- package/out/ui/packages/divider/components/Divider.d.ts +1 -0
- package/out/ui/packages/divider/components/Divider.luau +52 -17
- package/out/ui/packages/divider/components/Divider.styles.luau +32 -0
- package/out/ui/packages/divider/components/dividerLabel.d.ts +1 -0
- package/out/ui/packages/divider/components/dividerLabel.luau +10 -0
- package/out/ui/packages/drawer/components/Drawer.d.ts +3 -1
- package/out/ui/packages/drawer/components/Drawer.luau +71 -37
- package/out/ui/packages/drawer/components/Drawer.styles.d.ts +3 -1
- package/out/ui/packages/drawer/components/Drawer.styles.luau +3 -2
- package/out/ui/packages/fab/components/Fab.d.ts +3 -0
- package/out/ui/packages/fab/components/Fab.luau +79 -37
- package/out/ui/packages/fab/components/Fab.styles.d.ts +3 -0
- package/out/ui/packages/fab/components/Fab.styles.luau +39 -3
- package/out/ui/packages/fab/components/fabSize.d.ts +1 -0
- package/out/ui/packages/fab/components/fabSize.luau +4 -0
- package/out/ui/packages/fab/index.d.ts +1 -1
- package/out/ui/packages/fab/init.luau +1 -0
- package/out/ui/packages/fontEditor/components/FontEditor.luau +12 -16
- package/out/ui/packages/formText/components/FormHelperText.d.ts +8 -0
- package/out/ui/packages/formText/components/FormHelperText.luau +40 -0
- package/out/ui/packages/formText/components/FormLabel.d.ts +9 -0
- package/out/ui/packages/formText/components/FormLabel.luau +42 -0
- package/out/ui/packages/formText/components/FormText.styles.d.ts +5 -0
- package/out/ui/packages/formText/components/FormText.styles.luau +33 -0
- package/out/ui/packages/formText/index.d.ts +4 -0
- package/out/ui/packages/formText/init.luau +6 -0
- package/out/ui/packages/gradientEditor/components/GradientEditor.luau +56 -42
- package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +37 -4
- package/out/ui/packages/host/components/SxHost.d.ts +18 -0
- package/out/ui/packages/host/components/SxHost.luau +210 -0
- package/out/ui/packages/host/hostPaint.d.ts +12 -0
- package/out/ui/packages/host/hostPaint.luau +34 -0
- package/out/ui/packages/host/hostRules.d.ts +15 -0
- package/out/ui/packages/host/hostRules.luau +92 -0
- package/out/ui/packages/host/index.d.ts +3 -0
- package/out/ui/packages/host/init.luau +13 -0
- package/out/ui/packages/icon/components/Icon.luau +9 -16
- package/out/ui/packages/iconButton/components/IconButton.luau +22 -17
- package/out/ui/packages/iconButton/components/IconButton.styles.luau +3 -0
- package/out/ui/packages/imageList/components/ImageList.d.ts +14 -0
- package/out/ui/packages/imageList/components/ImageList.luau +93 -0
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +6 -0
- package/out/ui/packages/imageList/components/ImageList.styles.luau +73 -0
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +4 -0
- package/out/ui/packages/imageList/components/imageListLayout.luau +31 -0
- package/out/ui/packages/imageList/index.d.ts +2 -0
- package/out/ui/packages/imageList/init.luau +5 -0
- package/out/ui/packages/index.d.ts +8 -0
- package/out/ui/packages/init.luau +24 -0
- package/out/ui/packages/input/components/Input.d.ts +1 -0
- package/out/ui/packages/input/components/Input.luau +22 -19
- package/out/ui/packages/layout/components/Box.d.ts +11 -0
- package/out/ui/packages/layout/components/Box.luau +40 -0
- package/out/ui/packages/layout/components/Box.styles.d.ts +7 -0
- package/out/ui/packages/layout/components/Box.styles.luau +34 -0
- package/out/ui/packages/layout/components/Container.d.ts +10 -0
- package/out/ui/packages/layout/components/Container.luau +45 -0
- package/out/ui/packages/layout/components/Container.styles.d.ts +6 -0
- package/out/ui/packages/layout/components/Container.styles.luau +41 -0
- package/out/ui/packages/layout/components/FlexItem.d.ts +12 -0
- package/out/ui/packages/layout/components/FlexItem.luau +40 -0
- package/out/ui/packages/layout/components/FlexItem.styles.d.ts +8 -0
- package/out/ui/packages/layout/components/FlexItem.styles.luau +66 -0
- package/out/ui/packages/layout/components/Grid.d.ts +5 -1
- package/out/ui/packages/layout/components/Grid.luau +41 -19
- package/out/ui/packages/layout/components/List.luau +9 -16
- package/out/ui/packages/layout/components/Stack.d.ts +14 -0
- package/out/ui/packages/layout/components/Stack.luau +44 -0
- package/out/ui/packages/layout/components/Stack.styles.d.ts +10 -0
- package/out/ui/packages/layout/components/Stack.styles.luau +101 -0
- package/out/ui/packages/layout/components/boxPad.d.ts +14 -0
- package/out/ui/packages/layout/components/boxPad.luau +59 -0
- package/out/ui/packages/layout/components/containerWidth.d.ts +2 -0
- package/out/ui/packages/layout/components/containerWidth.luau +17 -0
- package/out/ui/packages/layout/components/flexItemMode.d.ts +6 -0
- package/out/ui/packages/layout/components/flexItemMode.luau +36 -0
- package/out/ui/packages/layout/components/gridProps.d.ts +3 -0
- package/out/ui/packages/layout/components/gridProps.luau +20 -0
- package/out/ui/packages/layout/components/stackAlign.d.ts +10 -0
- package/out/ui/packages/layout/components/stackAlign.luau +43 -0
- package/out/ui/packages/layout/index.d.ts +14 -0
- package/out/ui/packages/layout/init.luau +5 -0
- package/out/ui/packages/link/components/Link.d.ts +11 -0
- package/out/ui/packages/link/components/Link.luau +80 -0
- package/out/ui/packages/link/components/Link.styles.d.ts +8 -0
- package/out/ui/packages/link/components/Link.styles.luau +59 -0
- package/out/ui/packages/link/index.d.ts +3 -0
- package/out/ui/packages/link/init.luau +5 -0
- package/out/ui/packages/listItem/components/ListItem.d.ts +4 -1
- package/out/ui/packages/listItem/components/ListItem.luau +44 -4
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +16 -5
- package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +7 -1
- package/out/ui/packages/loadingStroke/components/LoadingStroke.luau +23 -19
- package/out/ui/packages/loadingStroke/components/loadingStrokeSx.d.ts +11 -0
- package/out/ui/packages/loadingStroke/components/loadingStrokeSx.luau +2 -0
- package/out/ui/packages/markdown/components/Markdown.d.ts +6 -0
- package/out/ui/packages/markdown/components/Markdown.luau +221 -0
- package/out/ui/packages/markdown/components/Markdown.styles.d.ts +2 -0
- package/out/ui/packages/markdown/components/Markdown.styles.luau +101 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.d.ts +16 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.luau +315 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +6 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +132 -0
- package/out/ui/packages/markdown/htmlToMarkdown.d.ts +2 -0
- package/out/ui/packages/markdown/htmlToMarkdown.luau +350 -0
- package/out/ui/packages/markdown/index.d.ts +8 -0
- package/out/ui/packages/markdown/init.luau +11 -0
- package/out/ui/packages/markdown/parseMarkdown.d.ts +42 -0
- package/out/ui/packages/markdown/parseMarkdown.luau +459 -0
- package/out/ui/packages/menu/components/Menu.d.ts +7 -1
- package/out/ui/packages/menu/components/Menu.luau +68 -26
- package/out/ui/packages/menu/components/Menu.styles.luau +5 -1
- package/out/ui/packages/modal/components/Modal.d.ts +2 -1
- package/out/ui/packages/modal/components/Modal.luau +79 -37
- package/out/ui/packages/motion/index.d.ts +1 -1
- package/out/ui/packages/motion/init.luau +1 -0
- package/out/ui/packages/motion/unit.d.ts +5 -0
- package/out/ui/packages/motion/unit.luau +23 -0
- package/out/ui/packages/numberInput/components/NumberInput.d.ts +2 -0
- package/out/ui/packages/numberInput/components/NumberInput.luau +16 -3
- package/out/ui/packages/numberInput/components/numberValue.d.ts +1 -0
- package/out/ui/packages/numberInput/components/numberValue.luau +45 -0
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +12 -16
- package/out/ui/packages/pagination/components/Pagination.d.ts +6 -1
- package/out/ui/packages/pagination/components/Pagination.luau +62 -38
- package/out/ui/packages/pagination/components/Pagination.styles.d.ts +6 -1
- package/out/ui/packages/pagination/components/Pagination.styles.luau +36 -4
- package/out/ui/packages/pagination/components/pageRange.d.ts +2 -1
- package/out/ui/packages/pagination/components/pageRange.luau +91 -8
- package/out/ui/packages/pagination/index.d.ts +1 -0
- package/out/ui/packages/pagination/init.luau +1 -0
- package/out/ui/packages/paper/components/Paper.d.ts +4 -2
- package/out/ui/packages/paper/components/Paper.luau +31 -9
- package/out/ui/packages/paper/components/Paper.styles.d.ts +1 -1
- package/out/ui/packages/paper/components/Paper.styles.luau +6 -0
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +63 -38
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +21 -7
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +2 -0
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +14 -0
- package/out/ui/packages/popup/components/Popup.d.ts +2 -1
- package/out/ui/packages/popup/components/Popup.luau +35 -18
- package/out/ui/packages/popup/index.d.ts +1 -0
- package/out/ui/packages/popup/init.luau +1 -0
- package/out/ui/packages/preloader/components/Preloader.luau +9 -16
- package/out/ui/packages/progressBar/components/ProgressBar.luau +12 -16
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +16 -18
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +4 -1
- package/out/ui/packages/rating/components/Rating.d.ts +11 -0
- package/out/ui/packages/rating/components/Rating.luau +97 -0
- package/out/ui/packages/rating/components/Rating.styles.d.ts +6 -0
- package/out/ui/packages/rating/components/Rating.styles.luau +44 -0
- package/out/ui/packages/rating/index.d.ts +2 -0
- package/out/ui/packages/rating/init.luau +5 -0
- package/out/ui/packages/rayEditor/components/RayEditor.luau +12 -16
- package/out/ui/packages/rectEditor/components/RectEditor.luau +86 -43
- package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +30 -7
- package/out/ui/packages/select/components/Select.d.ts +5 -0
- package/out/ui/packages/select/components/Select.luau +61 -77
- package/out/ui/packages/select/components/Select.styles.luau +1 -1
- package/out/ui/packages/shadow/components/Shadow.d.ts +2 -1
- package/out/ui/packages/shadow/components/Shadow.luau +39 -17
- package/out/ui/packages/shadow/components/Shadow.styles.luau +7 -2
- package/out/ui/packages/sidebar/components/Sidebar.luau +9 -16
- package/out/ui/packages/skeleton/components/Skeleton.luau +22 -30
- package/out/ui/packages/skeleton/components/Skeleton.styles.luau +7 -2
- package/out/ui/packages/skeleton/components/skeletonMotion.luau +1 -1
- package/out/ui/packages/skeleton/components/skeletonTone.d.ts +20 -0
- package/out/ui/packages/skeleton/components/skeletonTone.luau +14 -0
- package/out/ui/packages/slider/components/Slider.d.ts +3 -0
- package/out/ui/packages/slider/components/Slider.luau +47 -19
- package/out/ui/packages/slider/components/Slider.styles.d.ts +2 -0
- package/out/ui/packages/slider/components/Slider.styles.luau +14 -1
- package/out/ui/packages/slider/components/sliderMarks.d.ts +1 -0
- package/out/ui/packages/slider/components/sliderMarks.luau +37 -0
- package/out/ui/packages/snackbar/components/Snackbar.d.ts +2 -0
- package/out/ui/packages/snackbar/components/Snackbar.luau +5 -0
- package/out/ui/packages/snackbar/components/snackbarAction.d.ts +1 -0
- package/out/ui/packages/snackbar/components/snackbarAction.luau +10 -0
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +19 -0
- package/out/ui/packages/speedDial/components/SpeedDial.luau +97 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +5 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +31 -0
- package/out/ui/packages/speedDial/index.d.ts +3 -0
- package/out/ui/packages/speedDial/init.luau +5 -0
- package/out/ui/packages/splitPane/components/SplitPane.luau +13 -17
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stateMatrix.d.ts +2 -0
- package/out/ui/packages/stateMatrix.luau +872 -881
- package/out/ui/packages/stepper/components/Stepper.d.ts +1 -0
- package/out/ui/packages/stepper/components/Stepper.luau +16 -17
- package/out/ui/packages/stepper/components/Stepper.styles.d.ts +3 -1
- package/out/ui/packages/stepper/components/Stepper.styles.luau +6 -2
- package/out/ui/packages/switch/components/Switch.d.ts +2 -0
- package/out/ui/packages/switch/components/Switch.luau +21 -16
- package/out/ui/packages/switch/components/Switch.styles.d.ts +2 -0
- package/out/ui/packages/switch/components/Switch.styles.luau +6 -1
- package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
- package/out/ui/packages/table/components/Table.d.ts +1 -0
- package/out/ui/packages/table/components/Table.luau +15 -19
- package/out/ui/packages/table/components/Table.styles.d.ts +3 -1
- package/out/ui/packages/table/components/Table.styles.luau +10 -6
- package/out/ui/packages/tabs/components/Tabs.d.ts +3 -0
- package/out/ui/packages/tabs/components/Tabs.luau +24 -19
- package/out/ui/packages/tabs/components/Tabs.styles.d.ts +5 -1
- package/out/ui/packages/tabs/components/Tabs.styles.luau +26 -10
- package/out/ui/packages/tabs/components/tabsOrientation.d.ts +2 -0
- package/out/ui/packages/tabs/components/tabsOrientation.luau +7 -0
- package/out/ui/packages/tabs/index.d.ts +1 -0
- package/out/ui/packages/tabs/init.luau +1 -0
- package/out/ui/packages/toast/components/Toast.d.ts +2 -0
- package/out/ui/packages/toast/components/Toast.luau +41 -13
- package/out/ui/packages/toast/components/Toast.styles.luau +23 -5
- package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +21 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +129 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +9 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +69 -0
- package/out/ui/packages/toggleButton/index.d.ts +2 -0
- package/out/ui/packages/toggleButton/init.luau +7 -0
- package/out/ui/packages/tooltip/components/Tooltip.luau +9 -16
- package/out/ui/packages/treeView/components/TreeView.luau +9 -16
- package/out/ui/packages/typography/components/Typography.luau +13 -14
- package/out/ui/packages/udimEditor/components/UDimEditor.luau +12 -16
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +12 -16
- package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +7 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.luau +43 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.d.ts +5 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.luau +26 -0
- package/out/ui/packages/virtualList/components/VirtualList.luau +9 -16
- package/out/ui/packages/virtualList/index.d.ts +2 -0
- package/out/ui/packages/virtualList/init.luau +1 -0
- package/package.json +2 -2
- package/out/ui/packages/select/components/selectMotion.d.ts +0 -2
- package/out/ui/packages/select/components/selectMotion.luau +0 -12
|
@@ -2,6 +2,7 @@ import { CustomizedProps } from "../../../../theme/index";
|
|
|
2
2
|
export interface StepperProps {
|
|
3
3
|
steps: string[];
|
|
4
4
|
activeStep: number;
|
|
5
|
+
orientation?: "horizontal" | "vertical";
|
|
5
6
|
}
|
|
6
7
|
declare function Stepper(props: CustomizedProps<Frame, StepperProps>): JSX.Element;
|
|
7
8
|
export default Stepper;
|
|
@@ -3,36 +3,35 @@ local TS = _G[script]
|
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
|
|
5
5
|
local stepState = TS.import(script, script.Parent, "stepState").stepState
|
|
6
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
7
|
local useStepperStyles = TS.import(script, script.Parent, "Stepper.styles").default
|
|
7
8
|
local function Stepper(props)
|
|
8
9
|
local _binding = props
|
|
9
10
|
local steps = _binding.steps
|
|
10
11
|
local activeStep = _binding.activeStep
|
|
12
|
+
local orientation = _binding.orientation
|
|
13
|
+
if orientation == nil then
|
|
14
|
+
orientation = "horizontal"
|
|
15
|
+
end
|
|
11
16
|
local className = _binding.className
|
|
12
17
|
local sx = _binding.sx
|
|
13
18
|
local id = _binding.id
|
|
14
19
|
local ref = _binding.ref
|
|
15
|
-
local styles = useStepperStyles(
|
|
16
|
-
|
|
20
|
+
local styles = useStepperStyles({
|
|
21
|
+
orientation = orientation,
|
|
22
|
+
})
|
|
23
|
+
local _attributes = {
|
|
24
|
+
tag = "frame",
|
|
25
|
+
}
|
|
17
26
|
local _condition = id
|
|
18
27
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
19
28
|
_condition = "Stepper"
|
|
20
29
|
end
|
|
21
30
|
_attributes.key = _condition
|
|
22
|
-
_attributes.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if className then
|
|
27
|
-
for _k, _v in className do
|
|
28
|
-
_attributes[_k] = _v
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
if sx then
|
|
32
|
-
for _k, _v in sx do
|
|
33
|
-
_attributes[_k] = _v
|
|
34
|
-
end
|
|
35
|
-
end
|
|
31
|
+
_attributes.hostRef = ref
|
|
32
|
+
_attributes.base = styles.root
|
|
33
|
+
_attributes.className = className
|
|
34
|
+
_attributes.sx = sx
|
|
36
35
|
local _attributes_1 = table.clone(styles.list)
|
|
37
36
|
setmetatable(_attributes_1, nil)
|
|
38
37
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
@@ -54,7 +53,7 @@ local function Stepper(props)
|
|
|
54
53
|
_newValue[_k] = _callback(_v, _k - 1, steps)
|
|
55
54
|
end
|
|
56
55
|
-- ▲ ReadonlyArray.map ▲
|
|
57
|
-
return React.createElement(
|
|
56
|
+
return React.createElement(SxHost, _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
|
|
58
57
|
end
|
|
59
58
|
local default = Stepper
|
|
60
59
|
return {
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const useStepperStyles: (
|
|
1
|
+
declare const useStepperStyles: (props: {
|
|
2
|
+
orientation?: "horizontal" | "vertical";
|
|
3
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
2
4
|
export default useStepperStyles;
|
|
@@ -3,7 +3,11 @@ local TS = _G[script]
|
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local componentStyles = _theme.componentStyles
|
|
5
5
|
local createStyles = _theme.createStyles
|
|
6
|
-
local useStepperStyles = componentStyles("Stepper", function(theme)
|
|
6
|
+
local useStepperStyles = componentStyles("Stepper", function(theme, _param)
|
|
7
|
+
local orientation = _param.orientation
|
|
8
|
+
if orientation == nil then
|
|
9
|
+
orientation = "horizontal"
|
|
10
|
+
end
|
|
7
11
|
return createStyles({
|
|
8
12
|
root = {
|
|
9
13
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -12,7 +16,7 @@ local useStepperStyles = componentStyles("Stepper", function(theme)
|
|
|
12
16
|
BorderSizePixel = 0,
|
|
13
17
|
},
|
|
14
18
|
list = {
|
|
15
|
-
FillDirection = Enum.FillDirection.Horizontal,
|
|
19
|
+
FillDirection = if orientation == "vertical" then Enum.FillDirection.Vertical else Enum.FillDirection.Horizontal,
|
|
16
20
|
Padding = UDim.new(0, theme.padding.calc(1)),
|
|
17
21
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
18
22
|
},
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ControlSize, CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { SwitchColor } from "./Switch.styles";
|
|
2
3
|
export interface SwitchProps {
|
|
3
4
|
value: boolean;
|
|
4
5
|
onChange: (value: boolean) => void;
|
|
5
6
|
disabled?: boolean;
|
|
6
7
|
label?: string;
|
|
7
8
|
size?: ControlSize;
|
|
9
|
+
color?: SwitchColor;
|
|
8
10
|
reducedMotion?: boolean;
|
|
9
11
|
}
|
|
10
12
|
declare function Switch(props: CustomizedProps<TextButton, SwitchProps>): JSX.Element;
|
|
@@ -11,6 +11,7 @@ local controlMetrics = _theme.controlMetrics
|
|
|
11
11
|
local cx = _theme.cx
|
|
12
12
|
local useTheme = _theme.useTheme
|
|
13
13
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
14
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
14
15
|
local playProperty = TS.import(script, script.Parent.Parent.Parent, "motion").playProperty
|
|
15
16
|
local useSwitchStyles = TS.import(script, script.Parent, "Switch.styles").default
|
|
16
17
|
local _switchLook = TS.import(script, script.Parent, "switchLook")
|
|
@@ -27,6 +28,10 @@ local function Switch(props)
|
|
|
27
28
|
local disabled = _binding.disabled
|
|
28
29
|
local label = _binding.label
|
|
29
30
|
local size = _binding.size
|
|
31
|
+
local color = _binding.color
|
|
32
|
+
if color == nil then
|
|
33
|
+
color = "primary"
|
|
34
|
+
end
|
|
30
35
|
local reducedProp = _binding.reducedMotion
|
|
31
36
|
local className = _binding.className
|
|
32
37
|
local sx = _binding.sx
|
|
@@ -37,6 +42,7 @@ local function Switch(props)
|
|
|
37
42
|
local theme = _binding_1.theme
|
|
38
43
|
local _binding_2 = useSwitchStyles({
|
|
39
44
|
size = size,
|
|
45
|
+
color = color,
|
|
40
46
|
})
|
|
41
47
|
local root = _binding_2.root
|
|
42
48
|
local row = _binding_2.row
|
|
@@ -73,26 +79,25 @@ local function Switch(props)
|
|
|
73
79
|
end
|
|
74
80
|
return playProperty(thumb, goal, THUMB_SECONDS, reducedMotion)
|
|
75
81
|
end, { placement.scaleX, placement.offsetX, placement.anchorX, reducedMotion })
|
|
76
|
-
local _attributes = {
|
|
82
|
+
local _attributes = {
|
|
83
|
+
tag = "textbutton",
|
|
84
|
+
}
|
|
77
85
|
local _condition = id
|
|
78
86
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
79
87
|
_condition = "Switch"
|
|
80
88
|
end
|
|
81
89
|
_attributes.key = _condition
|
|
82
|
-
_attributes.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
_attributes[_k] = _v
|
|
94
|
-
end
|
|
95
|
-
end
|
|
90
|
+
_attributes.hostRef = ref
|
|
91
|
+
_attributes.base = root
|
|
92
|
+
_attributes.className = className
|
|
93
|
+
_attributes.sx = sx
|
|
94
|
+
_attributes.state = {
|
|
95
|
+
disabled = disabled,
|
|
96
|
+
checked = on,
|
|
97
|
+
hover = hovering,
|
|
98
|
+
pressed = pressed,
|
|
99
|
+
focused = focused,
|
|
100
|
+
}
|
|
96
101
|
_attributes.Active = active
|
|
97
102
|
_attributes.Selectable = not disabled
|
|
98
103
|
_attributes.BackgroundTransparency = if focused and active then 0.85 else 1
|
|
@@ -162,7 +167,7 @@ local function Switch(props)
|
|
|
162
167
|
_attributes_7.LayoutOrder = 2
|
|
163
168
|
_condition_1 = (React.createElement("textlabel", _attributes_7))
|
|
164
169
|
end
|
|
165
|
-
return React.createElement(
|
|
170
|
+
return React.createElement(SxHost, _attributes, _exp, _exp_3, _condition_1)
|
|
166
171
|
end
|
|
167
172
|
local default = Switch
|
|
168
173
|
return {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ControlSize } from "../../../../theme/index";
|
|
2
|
+
export type SwitchColor = "primary" | "accent";
|
|
2
3
|
export interface SwitchStyleProps {
|
|
3
4
|
size?: ControlSize;
|
|
5
|
+
color?: SwitchColor;
|
|
4
6
|
}
|
|
5
7
|
declare const useSwitchStyles: (props: SwitchStyleProps) => import("../../../../theme/index").ClassNameMap<string>;
|
|
6
8
|
export default useSwitchStyles;
|
|
@@ -6,7 +6,12 @@ local createStyles = _theme.createStyles
|
|
|
6
6
|
local componentStyles = _theme.componentStyles
|
|
7
7
|
local useSwitchStyles = componentStyles("Switch", function(theme, _param)
|
|
8
8
|
local size = _param.size
|
|
9
|
+
local color = _param.color
|
|
10
|
+
if color == nil then
|
|
11
|
+
color = "primary"
|
|
12
|
+
end
|
|
9
13
|
local metrics = controlMetrics(theme.density, size)
|
|
14
|
+
local onTone = if color == "accent" then theme.palette.accent.main else theme.palette.primary.main
|
|
10
15
|
return createStyles({
|
|
11
16
|
root = {
|
|
12
17
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -28,7 +33,7 @@ local useSwitchStyles = componentStyles("Switch", function(theme, _param)
|
|
|
28
33
|
BorderSizePixel = 0,
|
|
29
34
|
},
|
|
30
35
|
trackOn = {
|
|
31
|
-
BackgroundColor3 =
|
|
36
|
+
BackgroundColor3 = onTone,
|
|
32
37
|
},
|
|
33
38
|
knob = {
|
|
34
39
|
Size = UDim2.fromOffset(metrics.switchThumb, metrics.switchThumb),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type SwitchPointer = "rest" | "hover" | "press" | "focus";
|
|
2
2
|
export declare function switchPointer(hovering: boolean, pressed: boolean, focused: boolean): SwitchPointer;
|
|
3
|
-
export declare function switchTrackTransparency(on: boolean, disabled: boolean, pointer: SwitchPointer): 0 | 0.25 | 0.
|
|
3
|
+
export declare function switchTrackTransparency(on: boolean, disabled: boolean, pointer: SwitchPointer): 0 | 0.25 | 0.55 | 0.35 | 0.15 | 0.65 | 0.08;
|
|
4
4
|
export declare function switchThumbTransparency(disabled: boolean): 0 | 0.35;
|
|
5
5
|
export declare function switchStrokeTransparency(disabled: boolean, pointer: SwitchPointer): 1 | 0 | 0.35;
|
|
6
6
|
export declare function switchThumbPlacement(on: boolean, inset: number): {
|
|
@@ -3,39 +3,35 @@ local TS = _G[script]
|
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
|
|
5
5
|
local rowSelected = TS.import(script, script.Parent, "rowSelected").rowSelected
|
|
6
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
7
|
local useTableStyles = TS.import(script, script.Parent, "Table.styles").default
|
|
7
8
|
local function Table(props)
|
|
8
9
|
local _binding = props
|
|
9
10
|
local columns = _binding.columns
|
|
10
11
|
local rows = _binding.rows
|
|
11
12
|
local selected = _binding.selected
|
|
13
|
+
local dense = _binding.dense
|
|
12
14
|
local onRowActivated = _binding.onRowActivated
|
|
13
15
|
local className = _binding.className
|
|
14
16
|
local sx = _binding.sx
|
|
15
17
|
local id = _binding.id
|
|
16
18
|
local ref = _binding.ref
|
|
17
|
-
local styles = useTableStyles(
|
|
19
|
+
local styles = useTableStyles({
|
|
20
|
+
dense = dense,
|
|
21
|
+
})
|
|
18
22
|
local width = if #columns > 0 then 1 / #columns else 1
|
|
19
|
-
local _attributes = {
|
|
23
|
+
local _attributes = {
|
|
24
|
+
tag = "frame",
|
|
25
|
+
}
|
|
20
26
|
local _condition = id
|
|
21
27
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
22
28
|
_condition = "Table"
|
|
23
29
|
end
|
|
24
30
|
_attributes.key = _condition
|
|
25
|
-
_attributes.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if className then
|
|
30
|
-
for _k, _v in className do
|
|
31
|
-
_attributes[_k] = _v
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
if sx then
|
|
35
|
-
for _k, _v in sx do
|
|
36
|
-
_attributes[_k] = _v
|
|
37
|
-
end
|
|
38
|
-
end
|
|
31
|
+
_attributes.hostRef = ref
|
|
32
|
+
_attributes.base = styles.root
|
|
33
|
+
_attributes.className = className
|
|
34
|
+
_attributes.sx = sx
|
|
39
35
|
local _attributes_1 = table.clone(styles.corner)
|
|
40
36
|
setmetatable(_attributes_1, nil)
|
|
41
37
|
local _exp = React.createElement("uicorner", _attributes_1)
|
|
@@ -73,7 +69,7 @@ local function Table(props)
|
|
|
73
69
|
_newValue[_k] = _callback(_v, _k - 1, columns)
|
|
74
70
|
end
|
|
75
71
|
-- ▲ ReadonlyArray.map ▲
|
|
76
|
-
local _exp_4 = React.createElement("frame", _attributes_3, _exp_2, _exp_3, _newValue)
|
|
72
|
+
local _exp_4 = React.createElement("frame", _attributes_3, _exp_2, _exp_3, React.createElement(React.Fragment, nil, _newValue))
|
|
77
73
|
-- ▼ ReadonlyArray.map ▼
|
|
78
74
|
local _newValue_1 = table.create(#rows)
|
|
79
75
|
local _callback_1 = function(cells, rowIndex)
|
|
@@ -121,13 +117,13 @@ local function Table(props)
|
|
|
121
117
|
_newValue_2[_k] = _callback_2(_v, _k - 1, columns)
|
|
122
118
|
end
|
|
123
119
|
-- ▲ ReadonlyArray.map ▲
|
|
124
|
-
return React.createElement("textbutton", _attributes_6, _exp_5, _exp_6, _newValue_2)
|
|
120
|
+
return React.createElement("textbutton", _attributes_6, _exp_5, _exp_6, React.createElement(React.Fragment, nil, _newValue_2))
|
|
125
121
|
end
|
|
126
122
|
for _k, _v in rows do
|
|
127
123
|
_newValue_1[_k] = _callback_1(_v, _k - 1, rows)
|
|
128
124
|
end
|
|
129
125
|
-- ▲ ReadonlyArray.map ▲
|
|
130
|
-
return React.createElement(
|
|
126
|
+
return React.createElement(SxHost, _attributes, _exp, _exp_1, _exp_4, React.createElement(React.Fragment, nil, _newValue_1))
|
|
131
127
|
end
|
|
132
128
|
local default = Table
|
|
133
129
|
return {
|
|
@@ -3,7 +3,11 @@ local TS = _G[script]
|
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local componentStyles = _theme.componentStyles
|
|
5
5
|
local createStyles = _theme.createStyles
|
|
6
|
-
local useTableStyles = componentStyles("Table", function(theme)
|
|
6
|
+
local useTableStyles = componentStyles("Table", function(theme, _param)
|
|
7
|
+
local dense = _param.dense
|
|
8
|
+
local padY = theme.padding.calc(if dense == true then 0.5 else 1)
|
|
9
|
+
local padX = theme.padding.calc(if dense == true then 1 else 1.5)
|
|
10
|
+
local textSize = if dense == true then theme.typography.fontSizes.caption else theme.typography.fontSizes.body
|
|
7
11
|
return createStyles({
|
|
8
12
|
root = {
|
|
9
13
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
@@ -44,7 +48,7 @@ local useTableStyles = componentStyles("Table", function(theme)
|
|
|
44
48
|
BackgroundTransparency = 1,
|
|
45
49
|
BorderSizePixel = 0,
|
|
46
50
|
Font = theme.typography.fontFamilies.default,
|
|
47
|
-
TextSize =
|
|
51
|
+
TextSize = textSize,
|
|
48
52
|
TextColor3 = theme.palette.text.primary,
|
|
49
53
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
50
54
|
TextTruncate = Enum.TextTruncate.AtEnd,
|
|
@@ -54,10 +58,10 @@ local useTableStyles = componentStyles("Table", function(theme)
|
|
|
54
58
|
TextColor3 = theme.palette.text.secondary,
|
|
55
59
|
},
|
|
56
60
|
padding = {
|
|
57
|
-
PaddingTop = UDim.new(0,
|
|
58
|
-
PaddingBottom = UDim.new(0,
|
|
59
|
-
PaddingLeft = UDim.new(0,
|
|
60
|
-
PaddingRight = UDim.new(0,
|
|
61
|
+
PaddingTop = UDim.new(0, padY),
|
|
62
|
+
PaddingBottom = UDim.new(0, padY),
|
|
63
|
+
PaddingLeft = UDim.new(0, padX),
|
|
64
|
+
PaddingRight = UDim.new(0, padX),
|
|
61
65
|
},
|
|
62
66
|
corner = {
|
|
63
67
|
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { CustomizedProps } from "../../../../theme/index";
|
|
2
2
|
import { ChoiceOption } from "../../radioGroup/index";
|
|
3
|
+
import { TabsOrientation } from "./tabsOrientation";
|
|
3
4
|
export interface TabsProps<T> {
|
|
4
5
|
value: T;
|
|
5
6
|
options: ChoiceOption<T>[];
|
|
6
7
|
onChange: (value: T) => void;
|
|
7
8
|
disabled?: boolean;
|
|
9
|
+
orientation?: TabsOrientation;
|
|
10
|
+
centered?: boolean;
|
|
8
11
|
}
|
|
9
12
|
declare function Tabs<T>(props: CustomizedProps<ScrollingFrame, TabsProps<T>>): JSX.Element;
|
|
10
13
|
export default Tabs;
|
|
@@ -4,6 +4,8 @@ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
4
4
|
local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
|
|
5
5
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
6
6
|
local stepChoice = TS.import(script, script.Parent.Parent.Parent, "select", "components", "stepChoice").stepChoice
|
|
7
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
8
|
+
local tabsIsVertical = TS.import(script, script.Parent, "tabsOrientation").tabsIsVertical
|
|
7
9
|
local useTabsStyles = TS.import(script, script.Parent, "Tabs.styles").default
|
|
8
10
|
local function Tabs(props)
|
|
9
11
|
local _binding = props
|
|
@@ -11,11 +13,17 @@ local function Tabs(props)
|
|
|
11
13
|
local options = _binding.options
|
|
12
14
|
local onChange = _binding.onChange
|
|
13
15
|
local disabled = _binding.disabled
|
|
16
|
+
local orientation = _binding.orientation
|
|
17
|
+
local centered = _binding.centered
|
|
14
18
|
local className = _binding.className
|
|
15
19
|
local sx = _binding.sx
|
|
16
20
|
local id = _binding.id
|
|
17
21
|
local ref = _binding.ref
|
|
18
|
-
local styles = useTabsStyles(
|
|
22
|
+
local styles = useTabsStyles({
|
|
23
|
+
orientation = orientation,
|
|
24
|
+
centered = centered,
|
|
25
|
+
})
|
|
26
|
+
local vertical = tabsIsVertical(orientation)
|
|
19
27
|
local choose = function(index)
|
|
20
28
|
local choice = options[index + 1]
|
|
21
29
|
if choice ~= nil and canActivate(disabled or choice.disabled) and choice.value ~= value then
|
|
@@ -36,32 +44,29 @@ local function Tabs(props)
|
|
|
36
44
|
end
|
|
37
45
|
-- ▲ ReadonlyArray.findIndex ▲
|
|
38
46
|
local index = _result
|
|
39
|
-
if
|
|
47
|
+
local back = if vertical then Enum.KeyCode.Up else Enum.KeyCode.Left
|
|
48
|
+
local forward = if vertical then Enum.KeyCode.Down else Enum.KeyCode.Right
|
|
49
|
+
if input.KeyCode == back then
|
|
40
50
|
choose(stepChoice(options, index, -1))
|
|
41
|
-
elseif input.KeyCode ==
|
|
51
|
+
elseif input.KeyCode == forward then
|
|
42
52
|
choose(stepChoice(options, index, 1))
|
|
43
53
|
end
|
|
44
54
|
end
|
|
45
|
-
local _attributes = {
|
|
55
|
+
local _attributes = {
|
|
56
|
+
tag = "scrollingframe",
|
|
57
|
+
}
|
|
46
58
|
local _condition = id
|
|
47
59
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
48
60
|
_condition = "Tabs"
|
|
49
61
|
end
|
|
50
62
|
_attributes.key = _condition
|
|
51
|
-
_attributes.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
if sx then
|
|
61
|
-
for _k, _v in sx do
|
|
62
|
-
_attributes[_k] = _v
|
|
63
|
-
end
|
|
64
|
-
end
|
|
63
|
+
_attributes.hostRef = ref
|
|
64
|
+
_attributes.base = styles.root
|
|
65
|
+
_attributes.className = className
|
|
66
|
+
_attributes.sx = sx
|
|
67
|
+
_attributes.state = {
|
|
68
|
+
disabled = disabled,
|
|
69
|
+
}
|
|
65
70
|
local _attributes_1 = table.clone(styles.list)
|
|
66
71
|
setmetatable(_attributes_1, nil)
|
|
67
72
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
@@ -105,7 +110,7 @@ local function Tabs(props)
|
|
|
105
110
|
_newValue[_k] = _callback(_v, _k - 1, options)
|
|
106
111
|
end
|
|
107
112
|
-- ▲ ReadonlyArray.map ▲
|
|
108
|
-
return React.createElement(
|
|
113
|
+
return React.createElement(SxHost, _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
|
|
109
114
|
end
|
|
110
115
|
local default = Tabs
|
|
111
116
|
return {
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { TabsOrientation } from "./tabsOrientation";
|
|
2
|
+
declare const useTabsStyles: (props: {
|
|
3
|
+
orientation?: TabsOrientation;
|
|
4
|
+
centered?: boolean;
|
|
5
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
2
6
|
export default useTabsStyles;
|
|
@@ -3,32 +3,40 @@ local TS = _G[script]
|
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local createStyles = _theme.createStyles
|
|
5
5
|
local componentStyles = _theme.componentStyles
|
|
6
|
-
local
|
|
6
|
+
local tabsIsVertical = TS.import(script, script.Parent, "tabsOrientation").tabsIsVertical
|
|
7
|
+
local useTabsStyles = componentStyles("Tabs", function(theme, _param)
|
|
8
|
+
local orientation = _param.orientation
|
|
9
|
+
local centered = _param.centered
|
|
10
|
+
local vertical = tabsIsVertical(orientation)
|
|
11
|
+
local bar = theme.padding.calc(0.5)
|
|
7
12
|
return createStyles({
|
|
8
13
|
root = {
|
|
9
|
-
Size = UDim2.new(1, 0, 0, theme.spacing.calc(4)),
|
|
14
|
+
Size = if vertical then UDim2.new(0, theme.spacing.calc(16), 1, 0) else UDim2.new(1, 0, 0, theme.spacing.calc(4)),
|
|
10
15
|
BackgroundTransparency = 1,
|
|
11
16
|
BorderSizePixel = 0,
|
|
12
17
|
CanvasSize = UDim2.fromScale(0, 0),
|
|
13
|
-
AutomaticCanvasSize = Enum.AutomaticSize.X,
|
|
14
|
-
ScrollingDirection = Enum.ScrollingDirection.X,
|
|
18
|
+
AutomaticCanvasSize = if vertical then Enum.AutomaticSize.Y else Enum.AutomaticSize.X,
|
|
19
|
+
ScrollingDirection = if vertical then Enum.ScrollingDirection.Y else Enum.ScrollingDirection.X,
|
|
15
20
|
HorizontalScrollBarInset = Enum.ScrollBarInset.Always,
|
|
21
|
+
VerticalScrollBarInset = Enum.ScrollBarInset.Always,
|
|
16
22
|
ScrollBarThickness = theme.padding.calc(0.5),
|
|
17
23
|
ScrollBarImageColor3 = theme.palette.text.secondary,
|
|
18
24
|
},
|
|
19
25
|
list = {
|
|
20
|
-
FillDirection = Enum.FillDirection.Horizontal,
|
|
26
|
+
FillDirection = if vertical then Enum.FillDirection.Vertical else Enum.FillDirection.Horizontal,
|
|
27
|
+
HorizontalAlignment = if centered == true and vertical ~= true then Enum.HorizontalAlignment.Center else Enum.HorizontalAlignment.Left,
|
|
21
28
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
22
29
|
},
|
|
23
30
|
tab = {
|
|
24
|
-
AutomaticSize = Enum.AutomaticSize.X,
|
|
25
|
-
Size = UDim2.fromScale(0, 1),
|
|
31
|
+
AutomaticSize = if vertical then Enum.AutomaticSize.Y else Enum.AutomaticSize.X,
|
|
32
|
+
Size = if vertical then UDim2.new(1, 0, 0, 0) else UDim2.fromScale(0, 1),
|
|
26
33
|
BackgroundTransparency = 1,
|
|
27
34
|
BorderSizePixel = 0,
|
|
28
35
|
AutoButtonColor = false,
|
|
29
36
|
TextColor3 = theme.palette.text.secondary,
|
|
30
37
|
Font = theme.typography.fontFamilies.default,
|
|
31
38
|
TextSize = theme.typography.fontSizes.body,
|
|
39
|
+
TextXAlignment = if vertical then Enum.TextXAlignment.Left else Enum.TextXAlignment.Center,
|
|
32
40
|
},
|
|
33
41
|
selected = {
|
|
34
42
|
TextColor3 = theme.palette.text.primary,
|
|
@@ -39,14 +47,22 @@ local useTabsStyles = componentStyles("Tabs", function(theme)
|
|
|
39
47
|
padding = {
|
|
40
48
|
PaddingLeft = UDim.new(0, theme.padding.calc(2)),
|
|
41
49
|
PaddingRight = UDim.new(0, theme.padding.calc(2)),
|
|
50
|
+
PaddingTop = UDim.new(0, if vertical then theme.padding.calc(1) else 0),
|
|
51
|
+
PaddingBottom = UDim.new(0, if vertical then theme.padding.calc(1) else 0),
|
|
42
52
|
},
|
|
43
|
-
indicator = {
|
|
44
|
-
Size = UDim2.new(
|
|
53
|
+
indicator = if vertical then ({
|
|
54
|
+
Size = UDim2.new(0, bar, 1, -theme.padding.calc(2)),
|
|
55
|
+
Position = UDim2.new(0, 0, 0.5, 0),
|
|
56
|
+
AnchorPoint = Vector2.new(0, 0.5),
|
|
57
|
+
BackgroundColor3 = theme.palette.primary.main,
|
|
58
|
+
BorderSizePixel = 0,
|
|
59
|
+
}) else ({
|
|
60
|
+
Size = UDim2.new(1, theme.padding.calc(4), 0, bar),
|
|
45
61
|
Position = UDim2.fromScale(0.5, 1),
|
|
46
62
|
AnchorPoint = Vector2.new(0.5, 1),
|
|
47
63
|
BackgroundColor3 = theme.palette.primary.main,
|
|
48
64
|
BorderSizePixel = 0,
|
|
49
|
-
},
|
|
65
|
+
}),
|
|
50
66
|
})
|
|
51
67
|
end)
|
|
52
68
|
local default = useTabsStyles
|