@rbxts/uiblox 0.2.0-alpha.36 → 0.2.0-alpha.4
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 +109 -27
- package/out/hooks/index.d.ts +0 -1
- package/out/hooks/init.luau +0 -3
- package/out/hooks/useBreakpoints.luau +11 -2
- package/out/theme/interfaces/theme/Theme.d.ts +0 -15
- package/out/theme/styles/utilities/componentStyles.luau +3 -45
- package/out/theme/styles/utilities/componentTheme.d.ts +0 -15
- package/out/theme/styles/utilities/index.d.ts +0 -2
- package/out/theme/styles/utilities/init.luau +0 -7
- package/out/theme/styles/utilities/resolveStyle.d.ts +2 -10
- package/out/theme/styles/utilities/resolveStyle.luau +3 -7
- package/out/theme/styles/utilities/styleCache.d.ts +0 -2
- package/out/theme/styles/utilities/styleCache.luau +0 -9
- package/out/theme/types/types.d.ts +1 -2
- package/out/ui/packages/accordion/components/Accordion.d.ts +0 -2
- package/out/ui/packages/accordion/components/Accordion.luau +30 -46
- package/out/ui/packages/accordion/components/Accordion.styles.d.ts +0 -1
- package/out/ui/packages/accordion/components/Accordion.styles.luau +4 -16
- package/out/ui/packages/accordion/components/accordionOpen.d.ts +0 -1
- package/out/ui/packages/accordion/components/accordionOpen.luau +0 -4
- package/out/ui/packages/alert/components/Alert.d.ts +0 -2
- package/out/ui/packages/alert/components/Alert.luau +42 -48
- package/out/ui/packages/alert/components/Alert.styles.d.ts +0 -2
- package/out/ui/packages/alert/components/Alert.styles.luau +8 -17
- package/out/ui/packages/appBar/components/AppBar.d.ts +1 -2
- package/out/ui/packages/appBar/components/AppBar.luau +36 -47
- package/out/ui/packages/appBar/components/AppBar.styles.d.ts +0 -2
- package/out/ui/packages/appBar/components/AppBar.styles.luau +5 -16
- package/out/ui/packages/assetField/components/AssetField.luau +16 -12
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +0 -8
- package/out/ui/packages/avatar/components/Avatar.d.ts +0 -2
- package/out/ui/packages/avatar/components/Avatar.luau +26 -27
- package/out/ui/packages/avatar/components/Avatar.styles.d.ts +0 -2
- package/out/ui/packages/avatar/components/Avatar.styles.luau +1 -5
- package/out/ui/packages/badge/components/Badge.d.ts +0 -3
- package/out/ui/packages/badge/components/Badge.luau +24 -32
- package/out/ui/packages/badge/components/Badge.styles.d.ts +1 -5
- package/out/ui/packages/badge/components/Badge.styles.luau +8 -20
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +0 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +18 -20
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.d.ts +1 -3
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +2 -6
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +0 -1
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +40 -67
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +0 -9
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +0 -68
- package/out/ui/packages/breadcrumbs/index.d.ts +0 -1
- package/out/ui/packages/breadcrumbs/init.luau +0 -3
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +16 -12
- package/out/ui/packages/button/components/Button.luau +18 -20
- package/out/ui/packages/card/components/Card.d.ts +1 -3
- package/out/ui/packages/card/components/Card.luau +0 -10
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +53 -75
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +9 -26
- 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 +1 -6
- package/out/ui/packages/chip/components/Chip.luau +17 -61
- package/out/ui/packages/chip/components/Chip.styles.d.ts +0 -6
- package/out/ui/packages/chip/components/Chip.styles.luau +9 -54
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +18 -29
- package/out/ui/packages/colorPicker/components/ColorPicker.luau +20 -16
- package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +20 -34
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +35 -34
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +62 -65
- package/out/ui/packages/dialog/components/Dialog.d.ts +2 -3
- package/out/ui/packages/dialog/components/Dialog.luau +21 -41
- package/out/ui/packages/divider/components/Divider.d.ts +0 -1
- package/out/ui/packages/divider/components/Divider.luau +17 -52
- package/out/ui/packages/divider/components/Divider.styles.luau +0 -32
- package/out/ui/packages/drawer/components/Drawer.d.ts +1 -3
- package/out/ui/packages/drawer/components/Drawer.luau +37 -71
- package/out/ui/packages/drawer/components/Drawer.styles.d.ts +1 -3
- package/out/ui/packages/drawer/components/Drawer.styles.luau +2 -3
- package/out/ui/packages/fab/components/Fab.d.ts +0 -3
- package/out/ui/packages/fab/components/Fab.luau +37 -79
- package/out/ui/packages/fab/components/Fab.styles.d.ts +0 -3
- package/out/ui/packages/fab/components/Fab.styles.luau +3 -39
- package/out/ui/packages/fab/components/fabSize.d.ts +0 -1
- package/out/ui/packages/fab/components/fabSize.luau +0 -4
- package/out/ui/packages/fab/index.d.ts +1 -1
- package/out/ui/packages/fab/init.luau +0 -1
- package/out/ui/packages/fontEditor/components/FontEditor.luau +16 -12
- package/out/ui/packages/gradientEditor/components/GradientEditor.luau +42 -56
- package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +4 -37
- package/out/ui/packages/icon/components/Icon.luau +16 -9
- package/out/ui/packages/iconButton/components/IconButton.luau +16 -16
- package/out/ui/packages/index.d.ts +0 -8
- package/out/ui/packages/init.luau +0 -24
- package/out/ui/packages/input/components/Input.d.ts +0 -1
- package/out/ui/packages/input/components/Input.luau +18 -21
- package/out/ui/packages/layout/components/Grid.d.ts +1 -5
- package/out/ui/packages/layout/components/Grid.luau +19 -41
- package/out/ui/packages/layout/components/List.luau +16 -9
- package/out/ui/packages/layout/index.d.ts +0 -14
- package/out/ui/packages/layout/init.luau +0 -5
- package/out/ui/packages/link/components/Link.luau +16 -13
- package/out/ui/packages/listItem/components/ListItem.d.ts +1 -4
- package/out/ui/packages/listItem/components/ListItem.luau +4 -44
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +0 -1
- package/out/ui/packages/listItem/components/ListItem.styles.luau +5 -16
- package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +1 -5
- package/out/ui/packages/menu/components/Menu.d.ts +1 -7
- package/out/ui/packages/menu/components/Menu.luau +26 -68
- package/out/ui/packages/menu/components/Menu.styles.luau +1 -5
- package/out/ui/packages/modal/components/Modal.d.ts +1 -2
- package/out/ui/packages/modal/components/Modal.luau +37 -79
- package/out/ui/packages/motion/index.d.ts +1 -1
- package/out/ui/packages/motion/init.luau +0 -1
- package/out/ui/packages/motion/unit.d.ts +0 -5
- package/out/ui/packages/motion/unit.luau +0 -23
- package/out/ui/packages/numberInput/components/NumberInput.d.ts +0 -2
- package/out/ui/packages/numberInput/components/NumberInput.luau +3 -16
- package/out/ui/packages/numberInput/components/numberValue.d.ts +0 -1
- package/out/ui/packages/numberInput/components/numberValue.luau +0 -45
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +16 -12
- package/out/ui/packages/pagination/components/Pagination.d.ts +1 -6
- package/out/ui/packages/pagination/components/Pagination.luau +38 -62
- package/out/ui/packages/pagination/components/Pagination.styles.d.ts +1 -6
- package/out/ui/packages/pagination/components/Pagination.styles.luau +4 -36
- package/out/ui/packages/pagination/components/pageRange.d.ts +1 -2
- package/out/ui/packages/pagination/components/pageRange.luau +8 -91
- package/out/ui/packages/pagination/index.d.ts +0 -1
- package/out/ui/packages/pagination/init.luau +0 -1
- package/out/ui/packages/paper/components/Paper.d.ts +2 -4
- package/out/ui/packages/paper/components/Paper.luau +9 -31
- package/out/ui/packages/paper/components/Paper.styles.d.ts +1 -1
- package/out/ui/packages/paper/components/Paper.styles.luau +0 -6
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +38 -63
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +7 -21
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +0 -2
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +0 -14
- package/out/ui/packages/popup/components/Popup.d.ts +1 -2
- package/out/ui/packages/popup/components/Popup.luau +18 -35
- package/out/ui/packages/popup/index.d.ts +0 -1
- package/out/ui/packages/popup/init.luau +0 -1
- package/out/ui/packages/preloader/components/Preloader.luau +16 -9
- package/out/ui/packages/progressBar/components/ProgressBar.luau +16 -12
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +0 -1
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +18 -16
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +0 -1
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +1 -4
- package/out/ui/packages/rating/components/Rating.d.ts +1 -3
- package/out/ui/packages/rating/components/Rating.luau +17 -19
- package/out/ui/packages/rating/components/Rating.styles.d.ts +0 -2
- package/out/ui/packages/rating/components/Rating.styles.luau +2 -7
- package/out/ui/packages/rayEditor/components/RayEditor.luau +16 -12
- package/out/ui/packages/rectEditor/components/RectEditor.luau +43 -86
- package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +7 -30
- package/out/ui/packages/scroll/index.d.ts +0 -2
- package/out/ui/packages/scroll/init.luau +0 -1
- package/out/ui/packages/select/components/Select.d.ts +0 -5
- package/out/ui/packages/select/components/Select.luau +77 -61
- package/out/ui/packages/select/components/Select.styles.luau +1 -1
- package/out/ui/packages/select/components/selectMotion.d.ts +2 -0
- package/out/ui/packages/select/components/selectMotion.luau +12 -0
- package/out/ui/packages/shadow/components/Shadow.d.ts +1 -2
- package/out/ui/packages/shadow/components/Shadow.luau +17 -39
- package/out/ui/packages/shadow/components/Shadow.styles.luau +2 -7
- package/out/ui/packages/sidebar/components/Sidebar.luau +16 -9
- package/out/ui/packages/skeleton/components/Skeleton.luau +28 -19
- package/out/ui/packages/skeleton/components/Skeleton.styles.luau +3 -7
- package/out/ui/packages/slider/components/Slider.d.ts +0 -3
- package/out/ui/packages/slider/components/Slider.luau +19 -47
- package/out/ui/packages/slider/components/Slider.styles.d.ts +0 -2
- package/out/ui/packages/slider/components/Slider.styles.luau +1 -14
- package/out/ui/packages/snackbar/components/Snackbar.d.ts +0 -2
- package/out/ui/packages/snackbar/components/Snackbar.luau +0 -5
- package/out/ui/packages/splitPane/components/SplitPane.luau +17 -13
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stateMatrix.d.ts +0 -2
- package/out/ui/packages/stateMatrix.luau +929 -843
- package/out/ui/packages/stepper/components/Stepper.d.ts +0 -1
- package/out/ui/packages/stepper/components/Stepper.luau +17 -16
- package/out/ui/packages/stepper/components/Stepper.styles.d.ts +1 -3
- package/out/ui/packages/stepper/components/Stepper.styles.luau +2 -6
- package/out/ui/packages/switch/components/Switch.d.ts +0 -2
- package/out/ui/packages/switch/components/Switch.luau +16 -21
- package/out/ui/packages/switch/components/Switch.styles.d.ts +0 -2
- package/out/ui/packages/switch/components/Switch.styles.luau +1 -6
- package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
- package/out/ui/packages/table/components/Table.d.ts +2 -16
- package/out/ui/packages/table/components/Table.luau +53 -136
- package/out/ui/packages/table/components/Table.styles.d.ts +1 -3
- package/out/ui/packages/table/components/Table.styles.luau +6 -10
- package/out/ui/packages/table/index.d.ts +1 -2
- package/out/ui/packages/tabs/components/Tabs.d.ts +0 -3
- package/out/ui/packages/tabs/components/Tabs.luau +19 -24
- package/out/ui/packages/tabs/components/Tabs.styles.d.ts +1 -5
- package/out/ui/packages/tabs/components/Tabs.styles.luau +10 -26
- package/out/ui/packages/tabs/index.d.ts +0 -1
- package/out/ui/packages/tabs/init.luau +0 -1
- package/out/ui/packages/toast/components/Toast.d.ts +0 -2
- package/out/ui/packages/toast/components/Toast.luau +13 -41
- package/out/ui/packages/toast/components/Toast.styles.luau +5 -23
- package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +1 -5
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +33 -36
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +0 -4
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +5 -16
- package/out/ui/packages/tooltip/components/Tooltip.luau +16 -9
- package/out/ui/packages/treeView/components/TreeView.luau +16 -9
- package/out/ui/packages/typography/components/Typography.luau +14 -13
- package/out/ui/packages/udimEditor/components/UDimEditor.luau +16 -12
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +16 -12
- package/out/ui/packages/virtualList/components/VirtualList.luau +16 -9
- package/out/ui/packages/virtualList/index.d.ts +0 -2
- package/out/ui/packages/virtualList/init.luau +0 -1
- package/package.json +2 -2
- package/out/hooks/viewportObserver.d.ts +0 -10
- package/out/hooks/viewportObserver.luau +0 -75
- package/out/theme/styles/utilities/resolveSx.d.ts +0 -120
- package/out/theme/styles/utilities/resolveSx.luau +0 -524
- package/out/ui/packages/backdrop/components/Backdrop.d.ts +0 -10
- package/out/ui/packages/backdrop/components/Backdrop.luau +0 -51
- package/out/ui/packages/backdrop/components/Backdrop.styles.d.ts +0 -4
- package/out/ui/packages/backdrop/components/Backdrop.styles.luau +0 -24
- package/out/ui/packages/backdrop/index.d.ts +0 -2
- package/out/ui/packages/backdrop/init.luau +0 -5
- package/out/ui/packages/dateRange/components/DateRangePicker.d.ts +0 -11
- package/out/ui/packages/dateRange/components/DateRangePicker.luau +0 -253
- package/out/ui/packages/dateRange/dateRangeValue.d.ts +0 -18
- package/out/ui/packages/dateRange/dateRangeValue.luau +0 -121
- package/out/ui/packages/dateRange/index.d.ts +0 -3
- package/out/ui/packages/dateRange/init.luau +0 -16
- package/out/ui/packages/divider/components/dividerLabel.d.ts +0 -1
- package/out/ui/packages/divider/components/dividerLabel.luau +0 -10
- package/out/ui/packages/formText/components/FormHelperText.d.ts +0 -8
- package/out/ui/packages/formText/components/FormHelperText.luau +0 -40
- package/out/ui/packages/formText/components/FormLabel.d.ts +0 -9
- package/out/ui/packages/formText/components/FormLabel.luau +0 -42
- package/out/ui/packages/formText/components/FormText.styles.d.ts +0 -5
- package/out/ui/packages/formText/components/FormText.styles.luau +0 -33
- package/out/ui/packages/formText/index.d.ts +0 -4
- package/out/ui/packages/formText/init.luau +0 -6
- package/out/ui/packages/host/components/SxHost.d.ts +0 -18
- package/out/ui/packages/host/components/SxHost.luau +0 -210
- package/out/ui/packages/host/hostPaint.d.ts +0 -12
- package/out/ui/packages/host/hostPaint.luau +0 -34
- package/out/ui/packages/host/hostRules.d.ts +0 -15
- package/out/ui/packages/host/hostRules.luau +0 -92
- package/out/ui/packages/host/index.d.ts +0 -3
- package/out/ui/packages/host/init.luau +0 -13
- package/out/ui/packages/imageList/components/ImageList.d.ts +0 -14
- package/out/ui/packages/imageList/components/ImageList.luau +0 -93
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +0 -6
- package/out/ui/packages/imageList/components/ImageList.styles.luau +0 -73
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +0 -4
- package/out/ui/packages/imageList/components/imageListLayout.luau +0 -31
- package/out/ui/packages/imageList/index.d.ts +0 -2
- package/out/ui/packages/imageList/init.luau +0 -5
- package/out/ui/packages/layout/components/Box.d.ts +0 -11
- package/out/ui/packages/layout/components/Box.luau +0 -40
- package/out/ui/packages/layout/components/Box.styles.d.ts +0 -7
- package/out/ui/packages/layout/components/Box.styles.luau +0 -34
- package/out/ui/packages/layout/components/Container.d.ts +0 -10
- package/out/ui/packages/layout/components/Container.luau +0 -45
- package/out/ui/packages/layout/components/Container.styles.d.ts +0 -6
- package/out/ui/packages/layout/components/Container.styles.luau +0 -41
- package/out/ui/packages/layout/components/FlexItem.d.ts +0 -12
- package/out/ui/packages/layout/components/FlexItem.luau +0 -40
- package/out/ui/packages/layout/components/FlexItem.styles.d.ts +0 -8
- package/out/ui/packages/layout/components/FlexItem.styles.luau +0 -66
- package/out/ui/packages/layout/components/Stack.d.ts +0 -14
- package/out/ui/packages/layout/components/Stack.luau +0 -44
- package/out/ui/packages/layout/components/Stack.styles.d.ts +0 -10
- package/out/ui/packages/layout/components/Stack.styles.luau +0 -101
- package/out/ui/packages/layout/components/boxPad.d.ts +0 -14
- package/out/ui/packages/layout/components/boxPad.luau +0 -59
- package/out/ui/packages/layout/components/containerWidth.d.ts +0 -2
- package/out/ui/packages/layout/components/containerWidth.luau +0 -17
- package/out/ui/packages/layout/components/flexItemMode.d.ts +0 -6
- package/out/ui/packages/layout/components/flexItemMode.luau +0 -36
- package/out/ui/packages/layout/components/gridProps.d.ts +0 -3
- package/out/ui/packages/layout/components/gridProps.luau +0 -20
- package/out/ui/packages/layout/components/stackAlign.d.ts +0 -10
- package/out/ui/packages/layout/components/stackAlign.luau +0 -43
- package/out/ui/packages/loadingStroke/components/loadingStrokeSx.d.ts +0 -11
- package/out/ui/packages/loadingStroke/components/loadingStrokeSx.luau +0 -2
- package/out/ui/packages/markdown/components/Markdown.d.ts +0 -6
- package/out/ui/packages/markdown/components/Markdown.luau +0 -221
- package/out/ui/packages/markdown/components/Markdown.styles.d.ts +0 -2
- package/out/ui/packages/markdown/components/Markdown.styles.luau +0 -101
- package/out/ui/packages/markdown/components/MarkdownEditor.d.ts +0 -22
- package/out/ui/packages/markdown/components/MarkdownEditor.luau +0 -433
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +0 -6
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +0 -161
- package/out/ui/packages/markdown/components/markdownEditorHeight.d.ts +0 -1
- package/out/ui/packages/markdown/components/markdownEditorHeight.luau +0 -13
- package/out/ui/packages/markdown/htmlToMarkdown.d.ts +0 -2
- package/out/ui/packages/markdown/htmlToMarkdown.luau +0 -350
- package/out/ui/packages/markdown/index.d.ts +0 -8
- package/out/ui/packages/markdown/init.luau +0 -11
- package/out/ui/packages/markdown/parseMarkdown.d.ts +0 -42
- package/out/ui/packages/markdown/parseMarkdown.luau +0 -459
- package/out/ui/packages/reorder/index.d.ts +0 -2
- package/out/ui/packages/reorder/init.luau +0 -14
- package/out/ui/packages/reorder/reorder.d.ts +0 -24
- package/out/ui/packages/reorder/reorder.luau +0 -178
- package/out/ui/packages/reorder/useReorderDrag.d.ts +0 -15
- package/out/ui/packages/reorder/useReorderDrag.luau +0 -129
- package/out/ui/packages/scroll/components/ScrollView.d.ts +0 -7
- package/out/ui/packages/scroll/components/ScrollView.luau +0 -42
- package/out/ui/packages/skeleton/components/skeletonTone.d.ts +0 -20
- package/out/ui/packages/skeleton/components/skeletonTone.luau +0 -14
- package/out/ui/packages/slider/components/sliderMarks.d.ts +0 -1
- package/out/ui/packages/slider/components/sliderMarks.luau +0 -37
- package/out/ui/packages/snackbar/components/snackbarAction.d.ts +0 -1
- package/out/ui/packages/snackbar/components/snackbarAction.luau +0 -10
- package/out/ui/packages/sparkline/components/Sparkline.d.ts +0 -9
- package/out/ui/packages/sparkline/components/Sparkline.luau +0 -66
- package/out/ui/packages/sparkline/index.d.ts +0 -3
- package/out/ui/packages/sparkline/init.luau +0 -6
- package/out/ui/packages/sparkline/sparklineLayout.d.ts +0 -8
- package/out/ui/packages/sparkline/sparklineLayout.luau +0 -75
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +0 -19
- package/out/ui/packages/speedDial/components/SpeedDial.luau +0 -97
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +0 -5
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +0 -31
- package/out/ui/packages/speedDial/index.d.ts +0 -3
- package/out/ui/packages/speedDial/init.luau +0 -5
- package/out/ui/packages/table/components/tableColumns.d.ts +0 -26
- package/out/ui/packages/table/components/tableColumns.luau +0 -92
- package/out/ui/packages/tabs/components/tabsOrientation.d.ts +0 -2
- package/out/ui/packages/tabs/components/tabsOrientation.luau +0 -7
- package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +0 -7
- package/out/ui/packages/virtualList/components/EmptyListHint.luau +0 -43
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.d.ts +0 -5
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.luau +0 -26
package/README.md
CHANGED
|
@@ -2,35 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# uiblox-rbxts
|
|
4
4
|
|
|
5
|
-
> This package is a work in progress.
|
|
6
|
-
|
|
7
5
|
UI library and theming for roblox-ts projects.
|
|
8
6
|
|
|
9
|
-
## Background
|
|
10
|
-
|
|
11
|
-
Roblox has their own internal design system, coined "uiblox-web", that it uses for its new
|
|
12
|
-
web-facing products. This system offers reusable components, implemented in
|
|
13
|
-
React Typescript, that are derived from material UI (MUI). As well, it offers a
|
|
14
|
-
common theme/pallete for consistent UI/UX.
|
|
15
|
-
|
|
16
|
-
Anyone is able to view their design system as
|
|
17
|
-
[UIBlox-Web](https://uiblox.roblox.com). You can see that they leverage
|
|
18
|
-
[Storybook](https://storybook.js.org), a UI component explorer for frontend
|
|
19
|
-
developers, to render component previews.
|
|
20
|
-
|
|
21
|
-
Design systems all help engineers cut down on implementation time and ensure
|
|
22
|
-
consitent UX across products.
|
|
23
|
-
|
|
24
7
|
## Overview
|
|
25
8
|
|
|
26
|
-
|
|
27
|
-
uiblox-web for games written using roblox-ts.
|
|
9
|
+
Uiblox is a roblox-ts UI kit: semantic themes, `makeStyles` / `createStyles`, and typed React components for Studio and games. Public APIs aim for familiar Material UI–style capability (props and behavior), implemented independently for Roblox Instances, input modes, and performance.
|
|
28
10
|
|
|
29
|
-
|
|
30
|
-
anyone who installs this npm package. It also offers a theme and styling system
|
|
31
|
-
that aids UI/UX consistentency.
|
|
32
|
-
|
|
33
|
-
How does it do this? Well, there are two main exports from this package:
|
|
11
|
+
Main exports from `@rbxts/uiblox`:
|
|
34
12
|
|
|
35
13
|
- @rbxts/uiblox -> theme
|
|
36
14
|
- An extensible Theme type + default Dark (default) and Light themes
|
|
@@ -46,11 +24,47 @@ How does it do this? Well, there are two main exports from this package:
|
|
|
46
24
|
|
|
47
25
|
### Installation
|
|
48
26
|
|
|
49
|
-
|
|
27
|
+
```
|
|
28
|
+
npm install @rbxts/uiblox
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quickstart
|
|
50
32
|
|
|
51
|
-
`
|
|
33
|
+
1. Wrap your app (or a subtree) in `ThemeProvider` with `DarkTheme` or `LightTheme`.
|
|
34
|
+
2. Build styles with `makeStyles` / `createStyles` (or `componentStyles`) and spread them onto Instances.
|
|
35
|
+
3. For hover/press/focus/disabled (and list `_first` / `_last`), put `_hover`-style keys on the style table and call `resolveStyle(style, state)` before spreading.
|
|
36
|
+
4. Use packaged components from `@rbxts/uiblox` (`Button`, `Input`, `Select`, …).
|
|
37
|
+
5. Preview components in [Storyblox](https://github.com/bjlarouche/storyblox) with `*.stories` modules.
|
|
52
38
|
|
|
53
|
-
|
|
39
|
+
Token reference (spacing, density, typography, shape, palette, `resolveStyle`): [docs/STYLING.md](docs/STYLING.md).
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import React from "@rbxts/react";
|
|
43
|
+
import { Button, DarkTheme, ThemeProvider } from "@rbxts/uiblox";
|
|
44
|
+
|
|
45
|
+
export function App() {
|
|
46
|
+
return (
|
|
47
|
+
<ThemeProvider theme={DarkTheme}>
|
|
48
|
+
<Button text="Continue" onLeftClick={() => {}} />
|
|
49
|
+
</ThemeProvider>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Parity checklist
|
|
55
|
+
|
|
56
|
+
Capability parity, not pixel parity. For each public component, expect:
|
|
57
|
+
|
|
58
|
+
- [ ] Typed controlled props where interaction needs state
|
|
59
|
+
- [ ] Theme tokens (light/dark) via `ThemeProvider`
|
|
60
|
+
- [ ] Style slots / variants through the styling helpers
|
|
61
|
+
- [ ] Disabled / loading / error when the control type warrants it
|
|
62
|
+
- [ ] Mouse, touch, and gamepad-friendly activation where interactive
|
|
63
|
+
- [ ] Cleanup and focused unit checks in-repo
|
|
64
|
+
- [ ] `stateMatrix` rows for visual capture planning
|
|
65
|
+
- [ ] A Storyblox story (dev fixtures OK)
|
|
66
|
+
|
|
67
|
+
Skipped on purpose: browser-only addons (MDX, iframes, hosted visual-review clouds).
|
|
54
68
|
|
|
55
69
|
## Example
|
|
56
70
|
|
|
@@ -197,6 +211,74 @@ const useMyComponentStyles = makeStyles<MyComponentProps>((theme: Theme, props:
|
|
|
197
211
|
export default useMyComponentStyles;
|
|
198
212
|
```
|
|
199
213
|
|
|
214
|
+
### Style precedence
|
|
215
|
+
|
|
216
|
+
Components spread their own styles first, then `className`, then the props that
|
|
217
|
+
carry state. Later always wins:
|
|
218
|
+
|
|
219
|
+
1. Component styles from the theme
|
|
220
|
+
2. `className` (merge several with `cx(a, condition && b)`; later args win, falsy
|
|
221
|
+
args are skipped)
|
|
222
|
+
3. State props the component owns: `Active`, `Selectable`, `Text`, and the
|
|
223
|
+
value-driven sizes/positions of Slider, SplitPane, and so on
|
|
224
|
+
|
|
225
|
+
So `className` can restyle anything except a control's state. Pass `disabled`
|
|
226
|
+
instead of overriding `Active`.
|
|
227
|
+
|
|
228
|
+
### Controls
|
|
229
|
+
|
|
230
|
+
Inputs are controlled: `{ value, onChange, disabled? }`. They call `onChange`
|
|
231
|
+
only when the value actually changes, and never while disabled.
|
|
232
|
+
|
|
233
|
+
| Component | Value | Notes |
|
|
234
|
+
| --- | --- | --- |
|
|
235
|
+
| Checkbox | `boolean` | `mixed` shows indeterminate; activating commits `true` |
|
|
236
|
+
| Switch | `boolean` | |
|
|
237
|
+
| RadioGroup / Select / Tabs | `T` from `options: { label, value: T, disabled? }[]` | compared by identity; disabled options are skipped |
|
|
238
|
+
| NumberInput | `number` | commits on focus lost or Enter; clamps to `min`/`max`, snaps to `step` |
|
|
239
|
+
| Slider | `number` | `onChange` while dragging, `onCommit` on release |
|
|
240
|
+
| SplitPane | first pane size (px) | display clamps to `min`/`max`; Escape cancels a drag |
|
|
241
|
+
| Input | `text` | `onInput` while typing, `onTextChanged` on commit |
|
|
242
|
+
|
|
243
|
+
Select and Tooltip render through `Popup`, which portals into the nearest
|
|
244
|
+
`LayerCollector` so clipping parents do not cut them off. The popup follows its
|
|
245
|
+
anchor when that anchor moves or resizes, and Select closes if the anchor leaves
|
|
246
|
+
the layer. Select handles Up, Down, Enter, and Escape while it is open or
|
|
247
|
+
selected, including when the pointer is not over it.
|
|
248
|
+
|
|
249
|
+
### Loading
|
|
250
|
+
|
|
251
|
+
`Skeleton` covers a block that is still loading. `variant` is `text`,
|
|
252
|
+
`rectangular`, `rounded`, or `circular`. `width` and `height` are pixels.
|
|
253
|
+
`lines` and `gap` stack text rows. `SkeletonText` is the text variant.
|
|
254
|
+
`animation` is `pulse`, `shimmer`, or `false`. `reducedMotion` holds the block
|
|
255
|
+
still. A later theme preference can set that prop for you.
|
|
256
|
+
|
|
257
|
+
`CircularProgress` spins while `value` is omitted. A `value` from 0 to 1 draws
|
|
258
|
+
an arc and stops the spin. `size`, `thickness`, and `color` restyle the ring.
|
|
259
|
+
`LinearProgress` is the existing `ProgressBar`: pass `value` from 0 to 1 or
|
|
260
|
+
`progress` from 0 to 100. `indeterminate` slides the bar. `disabled` and
|
|
261
|
+
`reducedMotion` stop the motion and fade the fill.
|
|
262
|
+
|
|
263
|
+
`Button` and `IconButton` take `loading`. The control ignores clicks, hover,
|
|
264
|
+
and focus while loading, and its size stays put. `loadingLabel` replaces the
|
|
265
|
+
caption. `loadingPosition` is `start`, `center`, or `end`. `reducedMotion`
|
|
266
|
+
keeps the spinner still.
|
|
267
|
+
|
|
268
|
+
### State captures
|
|
269
|
+
|
|
270
|
+
`stateMatrix` is the gallery list for Storyblox. Each row is one shot: `theme`
|
|
271
|
+
(`Dark` or `Light`), `width`, and `pointer` (`rest`, `hover`, `press`, or
|
|
272
|
+
`focus`). Rows are built in small helper functions and concatenated so the
|
|
273
|
+
compiled Luau chunk stays under the 200-local register limit. `open` means the
|
|
274
|
+
Select list is showing. `options` and `disabledOption` build RadioGroup, Select,
|
|
275
|
+
and Tabs. `selected` and `filter` are TreeView. `value`, `text`, `disabled`,
|
|
276
|
+
`loading`, `mixed`, `hasError`, and `placeholder` are that control's props.
|
|
277
|
+
`variant`, `animation` (`pulse`, `shimmer`, or `false`), `reducedMotion`, and
|
|
278
|
+
`indeterminate` cover skeleton and progress shots. Those shots stay still when
|
|
279
|
+
`animation` is `false` or `reducedMotion` is set. Hover, press, and focus rows
|
|
280
|
+
are only there when the control actually changes.
|
|
281
|
+
|
|
200
282
|
### Client
|
|
201
283
|
|
|
202
284
|
Some sample logic for mounting app when player spawns (on client).
|
package/out/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { breakpointName, orientationName, resolveResponsive } from "./breakpoints";
|
|
2
2
|
export { BreakpointName, OrientationName, Responsive } from "./breakpoints";
|
|
3
3
|
export { useBreakpoints } from "./useBreakpoints";
|
|
4
|
-
export { clearViewportObservers, observeViewport } from "./viewportObserver";
|
|
5
4
|
export { useReducedMotion } from "./useReducedMotion";
|
package/out/hooks/init.luau
CHANGED
|
@@ -6,8 +6,5 @@ exports.breakpointName = _breakpoints.breakpointName
|
|
|
6
6
|
exports.orientationName = _breakpoints.orientationName
|
|
7
7
|
exports.resolveResponsive = _breakpoints.resolveResponsive
|
|
8
8
|
exports.useBreakpoints = TS.import(script, script, "useBreakpoints").useBreakpoints
|
|
9
|
-
local _viewportObserver = TS.import(script, script, "viewportObserver")
|
|
10
|
-
exports.clearViewportObservers = _viewportObserver.clearViewportObservers
|
|
11
|
-
exports.observeViewport = _viewportObserver.observeViewport
|
|
12
9
|
exports.useReducedMotion = TS.import(script, script, "useReducedMotion").useReducedMotion
|
|
13
10
|
return exports
|
|
@@ -6,7 +6,6 @@ local useState = _react.useState
|
|
|
6
6
|
local _breakpoints = TS.import(script, script.Parent, "breakpoints")
|
|
7
7
|
local breakpointName = _breakpoints.breakpointName
|
|
8
8
|
local orientationName = _breakpoints.orientationName
|
|
9
|
-
local observeViewport = TS.import(script, script.Parent, "viewportObserver").observeViewport
|
|
10
9
|
local function useBreakpoints(host)
|
|
11
10
|
local size, setSize = useState({
|
|
12
11
|
width = 0,
|
|
@@ -16,7 +15,17 @@ local function useBreakpoints(host)
|
|
|
16
15
|
if host == nil then
|
|
17
16
|
return nil
|
|
18
17
|
end
|
|
19
|
-
|
|
18
|
+
local read = function()
|
|
19
|
+
return setSize({
|
|
20
|
+
width = host.AbsoluteSize.X,
|
|
21
|
+
height = host.AbsoluteSize.Y,
|
|
22
|
+
})
|
|
23
|
+
end
|
|
24
|
+
read()
|
|
25
|
+
local connection = host:GetPropertyChangedSignal("AbsoluteSize"):Connect(read)
|
|
26
|
+
return function()
|
|
27
|
+
return connection:Disconnect()
|
|
28
|
+
end
|
|
20
29
|
end, { host })
|
|
21
30
|
return {
|
|
22
31
|
width = size.width,
|
|
@@ -21,21 +21,6 @@ interface Theme {
|
|
|
21
21
|
styleOverrides?: {
|
|
22
22
|
[slot: string]: object;
|
|
23
23
|
};
|
|
24
|
-
variants?: {
|
|
25
|
-
[prop: string]: {
|
|
26
|
-
[value: string]: {
|
|
27
|
-
[slot: string]: object;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
compoundVariants?: Array<{
|
|
32
|
-
when: {
|
|
33
|
-
[prop: string]: unknown;
|
|
34
|
-
};
|
|
35
|
-
styles: {
|
|
36
|
-
[slot: string]: object;
|
|
37
|
-
};
|
|
38
|
-
}>;
|
|
39
24
|
};
|
|
40
25
|
};
|
|
41
26
|
}
|
|
@@ -4,7 +4,6 @@ local _componentTheme = TS.import(script, script.Parent, "componentTheme")
|
|
|
4
4
|
local propsWithDefaults = _componentTheme.propsWithDefaults
|
|
5
5
|
local slotsWithOverrides = _componentTheme.slotsWithOverrides
|
|
6
6
|
local makeStyles = TS.import(script, script.Parent, "makeStyles").default
|
|
7
|
-
local applyVariants = TS.import(script, script.Parent, "variants").applyVariants
|
|
8
7
|
local componentStyles = function(name, factory)
|
|
9
8
|
return makeStyles((function(theme, props)
|
|
10
9
|
local _spec = theme.components
|
|
@@ -18,53 +17,12 @@ local componentStyles = function(name, factory)
|
|
|
18
17
|
end
|
|
19
18
|
local merged = propsWithDefaults(_result, props)
|
|
20
19
|
local paint = factory
|
|
21
|
-
local
|
|
20
|
+
local _exp = paint(theme, merged)
|
|
22
21
|
local _result_1 = spec
|
|
23
22
|
if _result_1 ~= nil then
|
|
24
|
-
_result_1 = _result_1.
|
|
23
|
+
_result_1 = _result_1.styleOverrides
|
|
25
24
|
end
|
|
26
|
-
|
|
27
|
-
if not _condition then
|
|
28
|
-
local _result_2 = spec
|
|
29
|
-
if _result_2 ~= nil then
|
|
30
|
-
_result_2 = _result_2.compoundVariants
|
|
31
|
-
if _result_2 ~= nil then
|
|
32
|
-
_result_2 = #_result_2
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
local _condition_1 = _result_2
|
|
36
|
-
if _condition_1 == nil then
|
|
37
|
-
_condition_1 = 0
|
|
38
|
-
end
|
|
39
|
-
_condition = _condition_1 > 0
|
|
40
|
-
end
|
|
41
|
-
if _condition then
|
|
42
|
-
local _exp = slots
|
|
43
|
-
local _exp_1 = merged
|
|
44
|
-
local _result_2 = spec
|
|
45
|
-
if _result_2 ~= nil then
|
|
46
|
-
_result_2 = _result_2.variants
|
|
47
|
-
end
|
|
48
|
-
local _condition_1 = _result_2
|
|
49
|
-
if _condition_1 == nil then
|
|
50
|
-
_condition_1 = {}
|
|
51
|
-
end
|
|
52
|
-
local _result_3 = spec
|
|
53
|
-
if _result_3 ~= nil then
|
|
54
|
-
_result_3 = _result_3.compoundVariants
|
|
55
|
-
end
|
|
56
|
-
local _condition_2 = _result_3
|
|
57
|
-
if _condition_2 == nil then
|
|
58
|
-
_condition_2 = {}
|
|
59
|
-
end
|
|
60
|
-
slots = applyVariants(_exp, _exp_1, _condition_1, _condition_2)
|
|
61
|
-
end
|
|
62
|
-
local _exp = slots
|
|
63
|
-
local _result_2 = spec
|
|
64
|
-
if _result_2 ~= nil then
|
|
65
|
-
_result_2 = _result_2.styleOverrides
|
|
66
|
-
end
|
|
67
|
-
return slotsWithOverrides(_exp, _result_2)
|
|
25
|
+
return slotsWithOverrides(_exp, _result_1)
|
|
68
26
|
end))
|
|
69
27
|
end
|
|
70
28
|
local default = componentStyles
|
|
@@ -5,21 +5,6 @@ export interface ComponentSpec {
|
|
|
5
5
|
styleOverrides?: {
|
|
6
6
|
[slot: string]: object;
|
|
7
7
|
};
|
|
8
|
-
variants?: {
|
|
9
|
-
[prop: string]: {
|
|
10
|
-
[value: string]: {
|
|
11
|
-
[slot: string]: object;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
compoundVariants?: Array<{
|
|
16
|
-
when: {
|
|
17
|
-
[prop: string]: unknown;
|
|
18
|
-
};
|
|
19
|
-
styles: {
|
|
20
|
-
[slot: string]: object;
|
|
21
|
-
};
|
|
22
|
-
}>;
|
|
23
8
|
}
|
|
24
9
|
export declare function propsWithDefaults(defaults: {
|
|
25
10
|
[key: string]: unknown;
|
|
@@ -4,6 +4,4 @@ export { default as classNames, cx } from "./classNames";
|
|
|
4
4
|
export { applyVariants, CompoundVariant } from "./variants";
|
|
5
5
|
export { default as componentStyles } from "./componentStyles";
|
|
6
6
|
export { resolveResponsive, Responsive } from "../../../hooks/breakpoints";
|
|
7
|
-
export { clearStyleCaches, createStyleCache, styleDepsKey } from "./styleCache";
|
|
8
|
-
export { resolveSx, resolvePaletteToken, PaletteToken, ResolvedSx, SxColor, SxGradient, SxInput } from "./resolveSx";
|
|
9
7
|
export { interactionStyle, InteractionSlots, InteractionState, resolveStyle, StyleSelectorKey, StyleState, StyleWithSelectors, } from "./resolveStyle";
|
|
@@ -9,13 +9,6 @@ exports.cx = _classNames.cx
|
|
|
9
9
|
exports.applyVariants = TS.import(script, script, "variants").applyVariants
|
|
10
10
|
exports.componentStyles = TS.import(script, script, "componentStyles").default
|
|
11
11
|
exports.resolveResponsive = TS.import(script, script.Parent.Parent.Parent, "hooks", "breakpoints").resolveResponsive
|
|
12
|
-
local _styleCache = TS.import(script, script, "styleCache")
|
|
13
|
-
exports.clearStyleCaches = _styleCache.clearStyleCaches
|
|
14
|
-
exports.createStyleCache = _styleCache.createStyleCache
|
|
15
|
-
exports.styleDepsKey = _styleCache.styleDepsKey
|
|
16
|
-
local _resolveSx = TS.import(script, script, "resolveSx")
|
|
17
|
-
exports.resolveSx = _resolveSx.resolveSx
|
|
18
|
-
exports.resolvePaletteToken = _resolveSx.resolvePaletteToken
|
|
19
12
|
local _resolveStyle = TS.import(script, script, "resolveStyle")
|
|
20
13
|
exports.interactionStyle = _resolveStyle.interactionStyle
|
|
21
14
|
exports.resolveStyle = _resolveStyle.resolveStyle
|
|
@@ -1,31 +1,23 @@
|
|
|
1
|
-
export type StyleSelectorKey = "_hover" | "_pressed" | "_focus" | "
|
|
1
|
+
export type StyleSelectorKey = "_hover" | "_pressed" | "_focus" | "_disabled" | "_selected" | "_checked" | "_first" | "_last";
|
|
2
2
|
export interface StyleState {
|
|
3
3
|
hover?: boolean;
|
|
4
4
|
pressed?: boolean;
|
|
5
5
|
focused?: boolean;
|
|
6
|
-
focusVisible?: boolean;
|
|
7
6
|
disabled?: boolean;
|
|
8
7
|
selected?: boolean;
|
|
9
8
|
checked?: boolean;
|
|
10
|
-
loading?: boolean;
|
|
11
9
|
first?: boolean;
|
|
12
10
|
last?: boolean;
|
|
13
|
-
odd?: boolean;
|
|
14
|
-
even?: boolean;
|
|
15
11
|
}
|
|
16
12
|
export type StyleWithSelectors<T extends object = object> = T & {
|
|
17
13
|
_hover?: Partial<T>;
|
|
18
14
|
_pressed?: Partial<T>;
|
|
19
15
|
_focus?: Partial<T>;
|
|
20
|
-
_focusVisible?: Partial<T>;
|
|
21
16
|
_disabled?: Partial<T>;
|
|
22
17
|
_selected?: Partial<T>;
|
|
23
18
|
_checked?: Partial<T>;
|
|
24
|
-
_loading?: Partial<T>;
|
|
25
19
|
_first?: Partial<T>;
|
|
26
20
|
_last?: Partial<T>;
|
|
27
|
-
_odd?: Partial<T>;
|
|
28
|
-
_even?: Partial<T>;
|
|
29
21
|
};
|
|
30
22
|
export interface InteractionSlots<T extends object = object> {
|
|
31
23
|
hover?: T;
|
|
@@ -34,7 +26,7 @@ export interface InteractionSlots<T extends object = object> {
|
|
|
34
26
|
disabled?: T;
|
|
35
27
|
}
|
|
36
28
|
export type InteractionState = Pick<StyleState, "hover" | "pressed" | "focused" | "disabled">;
|
|
37
|
-
/** Peels
|
|
29
|
+
/** Peels `_hover` / `_pressed` / `_focus` / … and merges active ones onto the Instance props. */
|
|
38
30
|
export declare function resolveStyle<T extends object>(style: StyleWithSelectors<T>, state?: StyleState): T;
|
|
39
31
|
/** Prefer `resolveStyle` with `_hover` keys. Kept for existing call sites. */
|
|
40
32
|
export declare function interactionStyle<T extends object>(base: T, slots: InteractionSlots<T>, state: InteractionState): T;
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
--* Order matters: later keys win. Structural
|
|
3
|
-
local SELECTORS = { { "_first", "first" }, { "_last", "last" }, { "
|
|
2
|
+
--* Order matters: later keys win. Structural first, then interaction; `_disabled` last.
|
|
3
|
+
local SELECTORS = { { "_first", "first" }, { "_last", "last" }, { "_selected", "selected" }, { "_checked", "checked" }, { "_hover", "hover" }, { "_pressed", "pressed" }, { "_focus", "focused" }, { "_disabled", "disabled" } }
|
|
4
4
|
local SELECTOR_FLAGS = {
|
|
5
5
|
_hover = true,
|
|
6
6
|
_pressed = true,
|
|
7
7
|
_focus = true,
|
|
8
|
-
_focusVisible = true,
|
|
9
8
|
_selected = true,
|
|
10
9
|
_checked = true,
|
|
11
|
-
_loading = true,
|
|
12
10
|
_first = true,
|
|
13
11
|
_last = true,
|
|
14
|
-
_odd = true,
|
|
15
|
-
_even = true,
|
|
16
12
|
_disabled = true,
|
|
17
13
|
}
|
|
18
|
-
--* Peels
|
|
14
|
+
--* Peels `_hover` / `_pressed` / `_focus` / … and merges active ones onto the Instance props.
|
|
19
15
|
local function resolveStyle(style, state)
|
|
20
16
|
if state == nil then
|
|
21
17
|
state = {}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
export declare function styleDepsKey(props: object | undefined): string;
|
|
2
2
|
export declare function createStyleCache<T extends defined>(): (theme: object, key: string, create: () => T) => T;
|
|
3
|
-
/** Drop all makeStyles memo buckets (theme hot-reload / tests). */
|
|
4
|
-
export declare function clearStyleCaches(): void;
|
|
@@ -9,7 +9,6 @@ local KEYED = {
|
|
|
9
9
|
CFrame = true,
|
|
10
10
|
BrickColor = true,
|
|
11
11
|
}
|
|
12
|
-
local caches = {}
|
|
13
12
|
local function styleDepsKey(props)
|
|
14
13
|
if props == nil then
|
|
15
14
|
return ""
|
|
@@ -41,7 +40,6 @@ local function styleDepsKey(props)
|
|
|
41
40
|
end
|
|
42
41
|
local function createStyleCache()
|
|
43
42
|
local byTheme = {}
|
|
44
|
-
table.insert(caches, byTheme)
|
|
45
43
|
return function(theme, key, create)
|
|
46
44
|
local _theme = theme
|
|
47
45
|
local bucket = byTheme[_theme]
|
|
@@ -64,14 +62,7 @@ local function createStyleCache()
|
|
|
64
62
|
return value
|
|
65
63
|
end
|
|
66
64
|
end
|
|
67
|
-
--* Drop all makeStyles memo buckets (theme hot-reload / tests).
|
|
68
|
-
local function clearStyleCaches()
|
|
69
|
-
for _, cache in caches do
|
|
70
|
-
table.clear(cache)
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
65
|
return {
|
|
74
66
|
styleDepsKey = styleDepsKey,
|
|
75
67
|
createStyleCache = createStyleCache,
|
|
76
|
-
clearStyleCaches = clearStyleCaches,
|
|
77
68
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from "@rbxts/react";
|
|
2
2
|
import { WriteableStyle } from "../styles/index";
|
|
3
|
-
import { SxInput } from "../styles/utilities/resolveSx";
|
|
4
3
|
export interface CommonProps<T extends Instance> extends PropsWithChildren {
|
|
5
4
|
className?: WriteableStyle<T>;
|
|
6
|
-
sx?: WriteableStyle<T
|
|
5
|
+
sx?: WriteableStyle<T>;
|
|
7
6
|
component?: T;
|
|
8
7
|
id?: React.Key;
|
|
9
8
|
ref?: React.Ref<T>;
|
|
@@ -3,19 +3,13 @@ local TS = _G[script]
|
|
|
3
3
|
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local React = _react
|
|
5
5
|
local useState = _react.useState
|
|
6
|
-
local
|
|
7
|
-
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
8
|
-
local _accordionOpen = TS.import(script, script.Parent, "accordionOpen")
|
|
9
|
-
local accordionGlyph = _accordionOpen.accordionGlyph
|
|
10
|
-
local accordionOpen = _accordionOpen.accordionOpen
|
|
6
|
+
local accordionOpen = TS.import(script, script.Parent, "accordionOpen").accordionOpen
|
|
11
7
|
local useAccordionStyles = TS.import(script, script.Parent, "Accordion.styles").default
|
|
12
8
|
local function Accordion(props)
|
|
13
9
|
local _binding = props
|
|
14
10
|
local title = _binding.title
|
|
15
11
|
local controlled = _binding.open
|
|
16
12
|
local defaultOpen = _binding.defaultOpen
|
|
17
|
-
local disabled = _binding.disabled
|
|
18
|
-
local square = _binding.square
|
|
19
13
|
local onChange = _binding.onChange
|
|
20
14
|
local children = _binding.children
|
|
21
15
|
local className = _binding.className
|
|
@@ -26,12 +20,8 @@ local function Accordion(props)
|
|
|
26
20
|
local open = accordionOpen(localOpen, controlled)
|
|
27
21
|
local styles = useAccordionStyles({
|
|
28
22
|
open = open,
|
|
29
|
-
disabled = disabled,
|
|
30
23
|
})
|
|
31
24
|
local toggle = function()
|
|
32
|
-
if disabled == true then
|
|
33
|
-
return nil
|
|
34
|
-
end
|
|
35
25
|
local nextOpen = not open
|
|
36
26
|
if controlled == nil then
|
|
37
27
|
setLocalOpen(nextOpen)
|
|
@@ -41,58 +31,52 @@ local function Accordion(props)
|
|
|
41
31
|
_result(nextOpen)
|
|
42
32
|
end
|
|
43
33
|
end
|
|
44
|
-
local _attributes = {
|
|
45
|
-
tag = "frame",
|
|
46
|
-
}
|
|
34
|
+
local _attributes = {}
|
|
47
35
|
local _condition = id
|
|
48
36
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
49
37
|
_condition = "Accordion"
|
|
50
38
|
end
|
|
51
39
|
_attributes.key = _condition
|
|
52
|
-
_attributes.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
_attributes.sx = sx
|
|
56
|
-
_attributes.state = {
|
|
57
|
-
disabled = disabled,
|
|
58
|
-
}
|
|
59
|
-
local _condition_1 = square ~= true
|
|
60
|
-
if _condition_1 then
|
|
61
|
-
local _attributes_1 = table.clone(styles.corner)
|
|
62
|
-
setmetatable(_attributes_1, nil)
|
|
63
|
-
_condition_1 = React.createElement("uicorner", _attributes_1)
|
|
40
|
+
_attributes.ref = ref
|
|
41
|
+
for _k, _v in styles.root do
|
|
42
|
+
_attributes[_k] = _v
|
|
64
43
|
end
|
|
65
|
-
|
|
44
|
+
if className then
|
|
45
|
+
for _k, _v in className do
|
|
46
|
+
_attributes[_k] = _v
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
if sx then
|
|
50
|
+
for _k, _v in sx do
|
|
51
|
+
_attributes[_k] = _v
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
local _attributes_1 = table.clone(styles.corner)
|
|
66
55
|
setmetatable(_attributes_1, nil)
|
|
67
|
-
local _exp = React.createElement("
|
|
68
|
-
local _attributes_2 =
|
|
56
|
+
local _exp = React.createElement("uicorner", _attributes_1)
|
|
57
|
+
local _attributes_2 = table.clone(styles.list)
|
|
58
|
+
setmetatable(_attributes_2, nil)
|
|
59
|
+
local _exp_1 = React.createElement("uilistlayout", _attributes_2)
|
|
60
|
+
local _attributes_3 = {
|
|
69
61
|
key = "Header",
|
|
70
62
|
}
|
|
71
63
|
for _k, _v in styles.header do
|
|
72
|
-
|
|
64
|
+
_attributes_3[_k] = _v
|
|
73
65
|
end
|
|
74
|
-
|
|
66
|
+
_attributes_3.Event = {
|
|
75
67
|
Activated = toggle,
|
|
76
68
|
}
|
|
77
|
-
local
|
|
78
|
-
setmetatable(
|
|
79
|
-
local
|
|
80
|
-
local
|
|
69
|
+
local _attributes_4 = table.clone(styles.padding)
|
|
70
|
+
setmetatable(_attributes_4, nil)
|
|
71
|
+
local _exp_2 = React.createElement("uipadding", _attributes_4)
|
|
72
|
+
local _attributes_5 = {
|
|
81
73
|
key = "Title",
|
|
82
74
|
}
|
|
83
75
|
for _k, _v in styles.title do
|
|
84
|
-
_attributes_4[_k] = _v
|
|
85
|
-
end
|
|
86
|
-
_attributes_4.Text = title
|
|
87
|
-
local _exp_2 = React.createElement("textlabel", _attributes_4)
|
|
88
|
-
local _attributes_5 = {
|
|
89
|
-
key = "Icon",
|
|
90
|
-
}
|
|
91
|
-
for _k, _v in styles.icon do
|
|
92
76
|
_attributes_5[_k] = _v
|
|
93
77
|
end
|
|
94
|
-
_attributes_5.
|
|
95
|
-
local _exp_3 = React.createElement("textbutton",
|
|
78
|
+
_attributes_5.Text = title
|
|
79
|
+
local _exp_3 = React.createElement("textbutton", _attributes_3, _exp_2, React.createElement("textlabel", _attributes_5))
|
|
96
80
|
local _attributes_6 = {
|
|
97
81
|
key = "Body",
|
|
98
82
|
}
|
|
@@ -101,7 +85,7 @@ local function Accordion(props)
|
|
|
101
85
|
end
|
|
102
86
|
local _attributes_7 = table.clone(styles.padding)
|
|
103
87
|
setmetatable(_attributes_7, nil)
|
|
104
|
-
return React.createElement(
|
|
88
|
+
return React.createElement("frame", _attributes, _exp, _exp_1, _exp_3, React.createElement("frame", _attributes_6, React.createElement("uipadding", _attributes_7), children))
|
|
105
89
|
end
|
|
106
90
|
local default = Accordion
|
|
107
91
|
return {
|
|
@@ -8,7 +8,6 @@ local useAccordionStyles = componentStyles("Accordion", function(theme, _param)
|
|
|
8
8
|
if open == nil then
|
|
9
9
|
open = false
|
|
10
10
|
end
|
|
11
|
-
local disabled = _param.disabled
|
|
12
11
|
return createStyles({
|
|
13
12
|
root = {
|
|
14
13
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
@@ -28,30 +27,19 @@ local useAccordionStyles = componentStyles("Accordion", function(theme, _param)
|
|
|
28
27
|
BorderSizePixel = 0,
|
|
29
28
|
AutoButtonColor = false,
|
|
30
29
|
Text = "",
|
|
31
|
-
Active =
|
|
32
|
-
Selectable =
|
|
30
|
+
Active = true,
|
|
31
|
+
Selectable = true,
|
|
33
32
|
},
|
|
34
33
|
title = {
|
|
35
|
-
AutomaticSize = Enum.AutomaticSize.
|
|
36
|
-
Size = UDim2.
|
|
34
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
35
|
+
Size = UDim2.fromScale(0, 0),
|
|
37
36
|
BackgroundTransparency = 1,
|
|
38
37
|
BorderSizePixel = 0,
|
|
39
38
|
Font = theme.typography.fontFamilies.default,
|
|
40
39
|
TextSize = theme.typography.fontSizes.body,
|
|
41
40
|
TextColor3 = theme.palette.text.primary,
|
|
42
|
-
TextTransparency = if disabled == true then 0.5 else 0,
|
|
43
41
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
44
42
|
},
|
|
45
|
-
icon = {
|
|
46
|
-
Size = UDim2.fromOffset(theme.options.constants.iconSizes.small, theme.options.constants.iconSizes.small),
|
|
47
|
-
Position = UDim2.new(1, -theme.padding.calc(1.5), 0.5, 0),
|
|
48
|
-
AnchorPoint = Vector2.new(1, 0.5),
|
|
49
|
-
BackgroundTransparency = 1,
|
|
50
|
-
BorderSizePixel = 0,
|
|
51
|
-
ScaleType = Enum.ScaleType.Fit,
|
|
52
|
-
ImageColor3 = theme.palette.text.primary,
|
|
53
|
-
ImageTransparency = if disabled == true then 0.5 else 0,
|
|
54
|
-
},
|
|
55
43
|
padding = {
|
|
56
44
|
PaddingTop = UDim.new(0, theme.padding.calc(1)),
|
|
57
45
|
PaddingBottom = UDim.new(0, theme.padding.calc(1)),
|
|
@@ -5,10 +5,6 @@ local function accordionOpen(expanded, controlled)
|
|
|
5
5
|
end
|
|
6
6
|
return expanded == true
|
|
7
7
|
end
|
|
8
|
-
local function accordionGlyph(open)
|
|
9
|
-
return if open == true then "expanded" else "collapsed"
|
|
10
|
-
end
|
|
11
8
|
return {
|
|
12
9
|
accordionOpen = accordionOpen,
|
|
13
|
-
accordionGlyph = accordionGlyph,
|
|
14
10
|
}
|