@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
|
@@ -4,10 +4,14 @@ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
4
4
|
local React = _react
|
|
5
5
|
local useEffect = _react.useEffect
|
|
6
6
|
local useRef = _react.useRef
|
|
7
|
+
local useState = _react.useState
|
|
7
8
|
local _services = TS.import(script, TS.getModule(script, "@rbxts", "services"))
|
|
8
9
|
local GuiService = _services.GuiService
|
|
9
10
|
local UserInputService = _services.UserInputService
|
|
10
|
-
local
|
|
11
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
12
|
+
local _popup = TS.import(script, script.Parent.Parent.Parent, "popup")
|
|
13
|
+
local Portal = _popup.Portal
|
|
14
|
+
local portalTarget = _popup.portalTarget
|
|
11
15
|
local isDismissInput = TS.import(script, script.Parent, "dismissInput").isDismissInput
|
|
12
16
|
local _focusTrap = TS.import(script, script.Parent, "focusTrap")
|
|
13
17
|
local isFocusable = _focusTrap.isFocusable
|
|
@@ -19,10 +23,21 @@ local function Modal(props)
|
|
|
19
23
|
local open = _binding.open
|
|
20
24
|
local onClose = _binding.onClose
|
|
21
25
|
local children = _binding.children
|
|
26
|
+
local className = _binding.className
|
|
27
|
+
local sx = _binding.sx
|
|
28
|
+
local id = _binding.id
|
|
29
|
+
local ref = _binding.ref
|
|
22
30
|
local styles = useModalStyles()
|
|
23
31
|
local close = useRef(onClose)
|
|
24
32
|
local surface = useRef()
|
|
33
|
+
local anchor = useRef()
|
|
34
|
+
local layer, setLayer = useState(function()
|
|
35
|
+
return portalTarget(host)
|
|
36
|
+
end)
|
|
25
37
|
close.current = onClose
|
|
38
|
+
useEffect(function()
|
|
39
|
+
setLayer(portalTarget(host or anchor.current))
|
|
40
|
+
end, { host, open })
|
|
26
41
|
useEffect(function()
|
|
27
42
|
if not open then
|
|
28
43
|
return nil
|
|
@@ -53,43 +68,70 @@ local function Modal(props)
|
|
|
53
68
|
GuiService.SelectedObject = previous
|
|
54
69
|
end
|
|
55
70
|
end
|
|
56
|
-
end, { open })
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
71
|
+
end, { open, layer })
|
|
72
|
+
local surfaceStyle = styles.surface
|
|
73
|
+
local _exp = React.createElement("frame", {
|
|
74
|
+
key = "ModalAnchor",
|
|
75
|
+
ref = anchor,
|
|
76
|
+
Size = UDim2.fromOffset(0, 0),
|
|
77
|
+
BackgroundTransparency = 1,
|
|
78
|
+
BorderSizePixel = 0,
|
|
79
|
+
})
|
|
80
|
+
local _condition = open and layer ~= nil
|
|
81
|
+
if _condition then
|
|
82
|
+
local _attributes = {
|
|
83
|
+
key = "Modal",
|
|
84
|
+
}
|
|
85
|
+
for _k, _v in styles.root do
|
|
86
|
+
_attributes[_k] = _v
|
|
87
|
+
end
|
|
88
|
+
local _attributes_1 = {
|
|
89
|
+
key = "Backdrop",
|
|
90
|
+
}
|
|
91
|
+
for _k, _v in styles.backdrop do
|
|
92
|
+
_attributes_1[_k] = _v
|
|
93
|
+
end
|
|
94
|
+
_attributes_1.Event = {
|
|
95
|
+
Activated = function()
|
|
96
|
+
return close.current()
|
|
97
|
+
end,
|
|
98
|
+
}
|
|
99
|
+
local _exp_1 = React.createElement("textbutton", _attributes_1)
|
|
100
|
+
local _attributes_2 = {
|
|
101
|
+
tag = "frame",
|
|
102
|
+
}
|
|
103
|
+
local _condition_1 = id
|
|
104
|
+
if not (_condition_1 ~= 0 and _condition_1 == _condition_1 and _condition_1 ~= "" and _condition_1) then
|
|
105
|
+
_condition_1 = "Surface"
|
|
106
|
+
end
|
|
107
|
+
_attributes_2.key = _condition_1
|
|
108
|
+
_attributes_2.hostRef = function(instance)
|
|
109
|
+
surface.current = instance
|
|
110
|
+
if ref == nil then
|
|
111
|
+
return nil
|
|
112
|
+
end
|
|
113
|
+
if type(ref) == "function" then
|
|
114
|
+
ref(instance)
|
|
115
|
+
return nil
|
|
116
|
+
end
|
|
117
|
+
ref.current = instance
|
|
118
|
+
end
|
|
119
|
+
_attributes_2.base = surfaceStyle
|
|
120
|
+
_attributes_2.className = className
|
|
121
|
+
_attributes_2.sx = sx
|
|
122
|
+
_attributes_2.AnchorPoint = surfaceStyle.AnchorPoint
|
|
123
|
+
_attributes_2.Position = surfaceStyle.Position
|
|
124
|
+
_attributes_2.ZIndex = surfaceStyle.ZIndex
|
|
125
|
+
local _attributes_3 = table.clone(styles.padding)
|
|
126
|
+
setmetatable(_attributes_3, nil)
|
|
127
|
+
local _exp_2 = React.createElement("uipadding", _attributes_3)
|
|
128
|
+
local _attributes_4 = table.clone(styles.corner)
|
|
129
|
+
setmetatable(_attributes_4, nil)
|
|
130
|
+
_condition = (React.createElement(Portal, {
|
|
131
|
+
host = layer,
|
|
132
|
+
}, React.createElement("frame", _attributes, _exp_1, React.createElement(SxHost, _attributes_2, _exp_2, React.createElement("uicorner", _attributes_4), children))))
|
|
84
133
|
end
|
|
85
|
-
|
|
86
|
-
setmetatable(_attributes_3, nil)
|
|
87
|
-
local _exp_1 = React.createElement("uipadding", _attributes_3)
|
|
88
|
-
local _attributes_4 = table.clone(styles.corner)
|
|
89
|
-
setmetatable(_attributes_4, nil)
|
|
90
|
-
return React.createElement(Portal, {
|
|
91
|
-
host = host,
|
|
92
|
-
}, React.createElement("frame", _attributes, _exp, React.createElement("frame", _attributes_2, _exp_1, React.createElement("uicorner", _attributes_4), children)))
|
|
134
|
+
return React.createElement(React.Fragment, nil, _exp, _condition)
|
|
93
135
|
end
|
|
94
136
|
local default = Modal
|
|
95
137
|
return {
|
|
@@ -2,4 +2,4 @@ export { loopProperty } from "./loop";
|
|
|
2
2
|
export { motionDuration, assignGoal } from "./duration";
|
|
3
3
|
export { playProperty } from "./play";
|
|
4
4
|
export { resolveReduced } from "./resolveReduced";
|
|
5
|
-
export { clampUnit, stopOnce, progressUnit, progressSpin, arcKeys } from "./unit";
|
|
5
|
+
export { clampUnit, stopOnce, progressUnit, progressSpin, arcKeys, spinArcKeys } from "./unit";
|
|
@@ -6,3 +6,8 @@ export declare function arcKeys(value: number): {
|
|
|
6
6
|
time: number;
|
|
7
7
|
transparency: number;
|
|
8
8
|
}[];
|
|
9
|
+
/** Indeterminate ring: long clear trail, bright head — reads as a sweep. */
|
|
10
|
+
export declare function spinArcKeys(): {
|
|
11
|
+
time: number;
|
|
12
|
+
transparency: number;
|
|
13
|
+
}[];
|
|
@@ -71,10 +71,33 @@ local function arcKeys(value)
|
|
|
71
71
|
transparency = 1,
|
|
72
72
|
} }
|
|
73
73
|
end
|
|
74
|
+
--* Indeterminate ring: long clear trail, bright head — reads as a sweep.
|
|
75
|
+
local function spinArcKeys()
|
|
76
|
+
return { {
|
|
77
|
+
time = 0,
|
|
78
|
+
transparency = 1,
|
|
79
|
+
}, {
|
|
80
|
+
time = 0.45,
|
|
81
|
+
transparency = 1,
|
|
82
|
+
}, {
|
|
83
|
+
time = 0.7,
|
|
84
|
+
transparency = 0.55,
|
|
85
|
+
}, {
|
|
86
|
+
time = 0.88,
|
|
87
|
+
transparency = 0,
|
|
88
|
+
}, {
|
|
89
|
+
time = 0.96,
|
|
90
|
+
transparency = 0.35,
|
|
91
|
+
}, {
|
|
92
|
+
time = 1,
|
|
93
|
+
transparency = 1,
|
|
94
|
+
} }
|
|
95
|
+
end
|
|
74
96
|
return {
|
|
75
97
|
clampUnit = clampUnit,
|
|
76
98
|
stopOnce = stopOnce,
|
|
77
99
|
progressUnit = progressUnit,
|
|
78
100
|
progressSpin = progressSpin,
|
|
79
101
|
arcKeys = arcKeys,
|
|
102
|
+
spinArcKeys = spinArcKeys,
|
|
80
103
|
}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local Input = TS.import(script, script.Parent.Parent.Parent, "input").Input
|
|
5
|
-
local
|
|
5
|
+
local _numberValue = TS.import(script, script.Parent, "numberValue")
|
|
6
|
+
local formatNumber = _numberValue.formatNumber
|
|
7
|
+
local parseNumberDraft = _numberValue.parseNumberDraft
|
|
6
8
|
local function NumberInput(props)
|
|
7
9
|
local _binding = props
|
|
8
10
|
local value = _binding.value
|
|
@@ -10,13 +12,16 @@ local function NumberInput(props)
|
|
|
10
12
|
local min = _binding.min
|
|
11
13
|
local max = _binding.max
|
|
12
14
|
local step = _binding.step
|
|
15
|
+
local places = _binding.places
|
|
13
16
|
local disabled = _binding.disabled
|
|
17
|
+
local readOnly = _binding.readOnly
|
|
14
18
|
local loading = _binding.loading
|
|
15
19
|
local placeholder = _binding.placeholder
|
|
16
20
|
local width = _binding.width
|
|
17
21
|
local size = _binding.size
|
|
18
22
|
local reducedMotion = _binding.reducedMotion
|
|
19
23
|
local className = _binding.className
|
|
24
|
+
local sx = _binding.sx
|
|
20
25
|
local id = _binding.id
|
|
21
26
|
local ref = _binding.ref
|
|
22
27
|
local _attributes = {}
|
|
@@ -27,16 +32,24 @@ local function NumberInput(props)
|
|
|
27
32
|
_attributes.id = _condition
|
|
28
33
|
_attributes.ref = ref
|
|
29
34
|
_attributes.className = className
|
|
30
|
-
_attributes.
|
|
35
|
+
_attributes.sx = sx
|
|
36
|
+
_attributes.text = if places ~= nil then formatNumber(value, places) else tostring(value)
|
|
31
37
|
_attributes.placeholder = placeholder
|
|
32
38
|
_attributes.width = width
|
|
33
39
|
_attributes.disabled = disabled
|
|
40
|
+
_attributes.readOnly = readOnly
|
|
34
41
|
_attributes.loading = loading
|
|
35
42
|
_attributes.size = size
|
|
36
43
|
_attributes.reducedMotion = reducedMotion
|
|
37
44
|
_attributes.onTextChanged = function(text)
|
|
38
45
|
local committed = parseNumberDraft(text, min, max, step)
|
|
39
|
-
if committed
|
|
46
|
+
if committed == nil then
|
|
47
|
+
return nil
|
|
48
|
+
end
|
|
49
|
+
if places ~= nil and formatNumber(committed, places) == formatNumber(value, places) then
|
|
50
|
+
return nil
|
|
51
|
+
end
|
|
52
|
+
if committed ~= value then
|
|
40
53
|
onChange(committed)
|
|
41
54
|
end
|
|
42
55
|
end
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare function commitNumber(value: number | undefined, min?: number, max?: number, step?: number): number | undefined;
|
|
2
2
|
export declare function parseNumberDraft(text: string, min?: number, max?: number, step?: number): number | undefined;
|
|
3
|
+
export declare function formatNumber(value: number, places?: number): string;
|
|
@@ -23,7 +23,52 @@ end
|
|
|
23
23
|
local function parseNumberDraft(text, min, max, step)
|
|
24
24
|
return commitNumber(tonumber(text), min, max, step)
|
|
25
25
|
end
|
|
26
|
+
local function formatNumber(value, places)
|
|
27
|
+
if places == nil then
|
|
28
|
+
places = 4
|
|
29
|
+
end
|
|
30
|
+
if value ~= value or value == math.huge or value == -math.huge then
|
|
31
|
+
return tostring(value)
|
|
32
|
+
end
|
|
33
|
+
local scale = 10 ^ places
|
|
34
|
+
local scaled = math.floor(math.abs(value) * scale + 0.5)
|
|
35
|
+
if scaled == 0 then
|
|
36
|
+
return "0"
|
|
37
|
+
end
|
|
38
|
+
local sign = if value < 0 then "-" else ""
|
|
39
|
+
local whole = math.floor(scaled / scale)
|
|
40
|
+
local frac = scaled % scale
|
|
41
|
+
if frac == 0 then
|
|
42
|
+
return `{sign}{whole}`
|
|
43
|
+
end
|
|
44
|
+
local digits = ""
|
|
45
|
+
local rest = frac
|
|
46
|
+
while rest > 0 do
|
|
47
|
+
digits = `{rest % 10}{digits}`
|
|
48
|
+
rest = math.floor(rest / 10)
|
|
49
|
+
end
|
|
50
|
+
while #digits < places do
|
|
51
|
+
digits = `0{digits}`
|
|
52
|
+
end
|
|
53
|
+
while true do
|
|
54
|
+
local _condition = #digits > 0
|
|
55
|
+
if _condition then
|
|
56
|
+
local _digits = digits
|
|
57
|
+
local _arg0 = #digits
|
|
58
|
+
local _arg1 = #digits
|
|
59
|
+
_condition = string.sub(_digits, _arg0, _arg1) == "0"
|
|
60
|
+
end
|
|
61
|
+
if not _condition then
|
|
62
|
+
break
|
|
63
|
+
end
|
|
64
|
+
local _digits = digits
|
|
65
|
+
local _arg1 = #digits - 1
|
|
66
|
+
digits = string.sub(_digits, 1, _arg1)
|
|
67
|
+
end
|
|
68
|
+
return `{sign}{whole}.{digits}`
|
|
69
|
+
end
|
|
26
70
|
return {
|
|
27
71
|
commitNumber = commitNumber,
|
|
28
72
|
parseNumberDraft = parseNumberDraft,
|
|
73
|
+
formatNumber = formatNumber,
|
|
29
74
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
4
5
|
local NumberInput = TS.import(script, script.Parent.Parent.Parent, "numberInput").NumberInput
|
|
5
6
|
local useNumberRangeEditorStyles = TS.import(script, script.Parent, "NumberRangeEditor.styles").default
|
|
6
7
|
local writeNumberRange = TS.import(script, script.Parent, "numberRangeValue").writeNumberRange
|
|
@@ -18,26 +19,21 @@ local function NumberRangeEditor(props)
|
|
|
18
19
|
local parts = writeNumberRange(value.Min, value.Max, field, amount)
|
|
19
20
|
onChange(NumberRange.new(parts.Min, parts.Max))
|
|
20
21
|
end
|
|
21
|
-
local _attributes = {
|
|
22
|
+
local _attributes = {
|
|
23
|
+
tag = "frame",
|
|
24
|
+
}
|
|
22
25
|
local _condition = id
|
|
23
26
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
24
27
|
_condition = "NumberRangeEditor"
|
|
25
28
|
end
|
|
26
29
|
_attributes.key = _condition
|
|
27
|
-
_attributes.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
if sx then
|
|
37
|
-
for _k, _v in sx do
|
|
38
|
-
_attributes[_k] = _v
|
|
39
|
-
end
|
|
40
|
-
end
|
|
30
|
+
_attributes.hostRef = ref
|
|
31
|
+
_attributes.base = styles.root
|
|
32
|
+
_attributes.className = className
|
|
33
|
+
_attributes.sx = sx
|
|
34
|
+
_attributes.state = {
|
|
35
|
+
disabled = disabled,
|
|
36
|
+
}
|
|
41
37
|
local _attributes_1 = table.clone(styles.row)
|
|
42
38
|
setmetatable(_attributes_1, nil)
|
|
43
39
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
@@ -81,7 +77,7 @@ local function NumberRangeEditor(props)
|
|
|
81
77
|
local _exp_5 = React.createElement("textlabel", _attributes_8)
|
|
82
78
|
local _attributes_9 = table.clone(styles.field)
|
|
83
79
|
setmetatable(_attributes_9, nil)
|
|
84
|
-
return React.createElement(
|
|
80
|
+
return React.createElement(SxHost, _attributes, _exp, _exp_3, React.createElement("frame", _attributes_6, _exp_4, _exp_5, React.createElement("frame", _attributes_9, React.createElement(NumberInput, {
|
|
85
81
|
value = value.Max,
|
|
86
82
|
disabled = disabled,
|
|
87
83
|
width = UDim.new(1, 0),
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { CustomizedProps } from "../../../../theme/index";
|
|
1
|
+
import { ControlSize, CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { PaginationVariant } from "./Pagination.styles";
|
|
2
3
|
export interface PaginationProps {
|
|
3
4
|
count: number;
|
|
4
5
|
page: number;
|
|
5
6
|
disabled?: boolean;
|
|
7
|
+
siblingCount?: number;
|
|
8
|
+
boundaryCount?: number;
|
|
9
|
+
size?: ControlSize;
|
|
10
|
+
variant?: PaginationVariant;
|
|
6
11
|
onChange: (page: number) => void;
|
|
7
12
|
}
|
|
8
13
|
declare function Pagination(props: CustomizedProps<Frame, PaginationProps>): JSX.Element;
|
|
@@ -3,68 +3,92 @@ 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 pageRange = TS.import(script, script.Parent, "pageRange").pageRange
|
|
6
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
7
|
local usePaginationStyles = TS.import(script, script.Parent, "Pagination.styles").default
|
|
7
8
|
local function Pagination(props)
|
|
8
9
|
local _binding = props
|
|
9
10
|
local count = _binding.count
|
|
10
11
|
local page = _binding.page
|
|
11
12
|
local disabled = _binding.disabled
|
|
13
|
+
local siblingCount = _binding.siblingCount
|
|
14
|
+
local boundaryCount = _binding.boundaryCount
|
|
15
|
+
local size = _binding.size
|
|
16
|
+
local variant = _binding.variant
|
|
12
17
|
local onChange = _binding.onChange
|
|
13
18
|
local className = _binding.className
|
|
14
19
|
local sx = _binding.sx
|
|
15
20
|
local id = _binding.id
|
|
16
21
|
local ref = _binding.ref
|
|
17
|
-
local styles = usePaginationStyles(
|
|
18
|
-
|
|
22
|
+
local styles = usePaginationStyles({
|
|
23
|
+
size = size,
|
|
24
|
+
variant = variant,
|
|
25
|
+
})
|
|
26
|
+
local tokens = pageRange(count, page, siblingCount, boundaryCount)
|
|
27
|
+
local _attributes = {
|
|
28
|
+
tag = "frame",
|
|
29
|
+
}
|
|
19
30
|
local _condition = id
|
|
20
31
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
21
32
|
_condition = "Pagination"
|
|
22
33
|
end
|
|
23
34
|
_attributes.key = _condition
|
|
24
|
-
_attributes.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
if sx then
|
|
34
|
-
for _k, _v in sx do
|
|
35
|
-
_attributes[_k] = _v
|
|
36
|
-
end
|
|
37
|
-
end
|
|
35
|
+
_attributes.hostRef = ref
|
|
36
|
+
_attributes.base = styles.root
|
|
37
|
+
_attributes.className = className
|
|
38
|
+
_attributes.sx = sx
|
|
39
|
+
_attributes.state = {
|
|
40
|
+
disabled = disabled,
|
|
41
|
+
}
|
|
38
42
|
local _attributes_1 = table.clone(styles.list)
|
|
39
43
|
setmetatable(_attributes_1, nil)
|
|
40
44
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
41
|
-
local _exp_1 = pageRange(count)
|
|
42
45
|
-- ▼ ReadonlyArray.map ▼
|
|
43
|
-
local _newValue = table.create(#
|
|
44
|
-
local _callback = function(item)
|
|
45
|
-
local
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
local _newValue = table.create(#tokens)
|
|
47
|
+
local _callback = function(item, index)
|
|
48
|
+
local _result
|
|
49
|
+
if item == "ellipsis" then
|
|
50
|
+
local _attributes_2 = {
|
|
51
|
+
key = `e-{index}`,
|
|
52
|
+
}
|
|
53
|
+
for _k, _v in styles.ellipsis do
|
|
54
|
+
_attributes_2[_k] = _v
|
|
55
|
+
end
|
|
56
|
+
_attributes_2.LayoutOrder = index
|
|
57
|
+
_result = (React.createElement("textlabel", _attributes_2))
|
|
58
|
+
else
|
|
59
|
+
local _attributes_2 = {
|
|
60
|
+
key = tostring(item),
|
|
61
|
+
}
|
|
62
|
+
for _k, _v in cx(styles.page, item == page and styles.selected) do
|
|
63
|
+
_attributes_2[_k] = _v
|
|
64
|
+
end
|
|
65
|
+
_attributes_2.Text = tostring(item)
|
|
66
|
+
_attributes_2.LayoutOrder = index
|
|
67
|
+
_attributes_2.Active = disabled ~= true
|
|
68
|
+
_attributes_2.Selectable = disabled ~= true
|
|
69
|
+
_attributes_2.Event = {
|
|
70
|
+
Activated = function()
|
|
71
|
+
return disabled ~= true and item ~= page and onChange(item)
|
|
72
|
+
end,
|
|
73
|
+
}
|
|
74
|
+
local _attributes_3 = table.clone(styles.corner)
|
|
75
|
+
setmetatable(_attributes_3, nil)
|
|
76
|
+
local _exp_1 = React.createElement("uicorner", _attributes_3)
|
|
77
|
+
local _condition_1 = variant == "outlined"
|
|
78
|
+
if _condition_1 then
|
|
79
|
+
local _attributes_4 = table.clone((if item == page then styles.selectedStroke else styles.stroke))
|
|
80
|
+
setmetatable(_attributes_4, nil)
|
|
81
|
+
_condition_1 = React.createElement("uistroke", _attributes_4)
|
|
82
|
+
end
|
|
83
|
+
_result = (React.createElement("textbutton", _attributes_2, _exp_1, _condition_1))
|
|
50
84
|
end
|
|
51
|
-
|
|
52
|
-
_attributes_2.Active = disabled ~= true
|
|
53
|
-
_attributes_2.Selectable = disabled ~= true
|
|
54
|
-
_attributes_2.Event = {
|
|
55
|
-
Activated = function()
|
|
56
|
-
return disabled ~= true and item ~= page and onChange(item)
|
|
57
|
-
end,
|
|
58
|
-
}
|
|
59
|
-
local _attributes_3 = table.clone(styles.corner)
|
|
60
|
-
setmetatable(_attributes_3, nil)
|
|
61
|
-
return React.createElement("textbutton", _attributes_2, React.createElement("uicorner", _attributes_3))
|
|
85
|
+
return _result
|
|
62
86
|
end
|
|
63
|
-
for _k, _v in
|
|
64
|
-
_newValue[_k] = _callback(_v, _k - 1,
|
|
87
|
+
for _k, _v in tokens do
|
|
88
|
+
_newValue[_k] = _callback(_v, _k - 1, tokens)
|
|
65
89
|
end
|
|
66
90
|
-- ▲ ReadonlyArray.map ▲
|
|
67
|
-
return React.createElement(
|
|
91
|
+
return React.createElement(SxHost, _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
|
|
68
92
|
end
|
|
69
93
|
local default = Pagination
|
|
70
94
|
return {
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { ControlSize } from "../../../../theme/index";
|
|
2
|
+
export type PaginationVariant = "text" | "outlined";
|
|
3
|
+
declare const usePaginationStyles: (props: {
|
|
4
|
+
size?: ControlSize;
|
|
5
|
+
variant?: PaginationVariant;
|
|
6
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
2
7
|
export default usePaginationStyles;
|
|
@@ -3,7 +3,18 @@ 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 usePaginationStyles = componentStyles("Pagination", function(theme)
|
|
6
|
+
local usePaginationStyles = componentStyles("Pagination", function(theme, _param)
|
|
7
|
+
local size = _param.size
|
|
8
|
+
if size == nil then
|
|
9
|
+
size = "medium"
|
|
10
|
+
end
|
|
11
|
+
local variant = _param.variant
|
|
12
|
+
if variant == nil then
|
|
13
|
+
variant = "text"
|
|
14
|
+
end
|
|
15
|
+
local outlined = variant == "outlined"
|
|
16
|
+
local box = if size == "small" then theme.spacing.calc(2.5) elseif size == "large" then theme.spacing.calc(4) else theme.spacing.calc(3)
|
|
17
|
+
local text = if size == "small" then theme.typography.fontSizes.caption elseif size == "large" then theme.typography.fontSizes.h6 else theme.typography.fontSizes.body
|
|
7
18
|
return createStyles({
|
|
8
19
|
root = {
|
|
9
20
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -13,20 +24,41 @@ local usePaginationStyles = componentStyles("Pagination", function(theme)
|
|
|
13
24
|
},
|
|
14
25
|
list = {
|
|
15
26
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
16
|
-
Padding = UDim.new(0, theme.padding.calc(0.5)),
|
|
27
|
+
Padding = UDim.new(0, theme.padding.calc(if size == "small" then 0.25 else 0.5)),
|
|
17
28
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
18
29
|
},
|
|
19
30
|
page = {
|
|
20
|
-
Size = UDim2.fromOffset(
|
|
31
|
+
Size = UDim2.fromOffset(box, box),
|
|
21
32
|
BackgroundColor3 = theme.palette.surface.input,
|
|
33
|
+
BackgroundTransparency = if outlined then 1 else 0,
|
|
22
34
|
BorderSizePixel = 0,
|
|
23
35
|
AutoButtonColor = false,
|
|
24
36
|
Font = theme.typography.fontFamilies.default,
|
|
25
|
-
TextSize =
|
|
37
|
+
TextSize = text,
|
|
26
38
|
TextColor3 = theme.palette.text.primary,
|
|
27
39
|
},
|
|
28
40
|
selected = {
|
|
29
41
|
BackgroundColor3 = theme.palette.action.selected,
|
|
42
|
+
BackgroundTransparency = 0,
|
|
43
|
+
},
|
|
44
|
+
stroke = {
|
|
45
|
+
Color = theme.palette.border,
|
|
46
|
+
Thickness = 1,
|
|
47
|
+
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
48
|
+
},
|
|
49
|
+
selectedStroke = {
|
|
50
|
+
Color = theme.palette.primary.main,
|
|
51
|
+
Thickness = 1,
|
|
52
|
+
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
53
|
+
},
|
|
54
|
+
ellipsis = {
|
|
55
|
+
Size = UDim2.fromOffset(box, box),
|
|
56
|
+
BackgroundTransparency = 1,
|
|
57
|
+
BorderSizePixel = 0,
|
|
58
|
+
Font = theme.typography.fontFamilies.default,
|
|
59
|
+
TextSize = text,
|
|
60
|
+
TextColor3 = theme.palette.text.secondary,
|
|
61
|
+
Text = "…",
|
|
30
62
|
},
|
|
31
63
|
corner = {
|
|
32
64
|
CornerRadius = UDim.new(1, 0),
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type PageToken = number | "ellipsis";
|
|
2
|
+
export declare function pageRange(count: number, page?: number, siblingCount?: number, boundaryCount?: number): PageToken[];
|