@rbxts/uiblox 0.1.52 → 0.2.0-alpha.0
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 +67 -2
- package/out/foundation/guard.d.ts +3 -0
- package/out/foundation/guard.luau +23 -0
- package/out/foundation/index.d.ts +1 -0
- package/out/foundation/init.luau +8 -0
- package/out/hooks/breakpoints.d.ts +10 -0
- package/out/hooks/breakpoints.luau +60 -0
- package/out/hooks/index.d.ts +4 -0
- package/out/hooks/init.luau +10 -0
- package/out/hooks/useBreakpoints.d.ts +6 -0
- package/out/hooks/useBreakpoints.luau +39 -0
- package/out/hooks/useReducedMotion.d.ts +1 -0
- package/out/hooks/useReducedMotion.luau +12 -0
- package/out/index.d.ts +3 -0
- package/out/init.luau +9 -0
- package/out/interaction/index.d.ts +4 -0
- package/out/interaction/init.luau +9 -0
- package/out/interaction/pointerRoute.d.ts +6 -0
- package/out/interaction/pointerRoute.luau +35 -0
- package/out/interaction/usePointer.d.ts +11 -0
- package/out/interaction/usePointer.luau +99 -0
- package/out/theme/constants/ColorConstants.d.ts +0 -3
- package/out/theme/constants/ColorConstants.luau +0 -96
- package/out/theme/context/ThemeProvider.d.ts +3 -0
- package/out/theme/context/ThemeProvider.luau +15 -8
- package/out/theme/context/themeScope.d.ts +5 -0
- package/out/theme/context/themeScope.luau +7 -0
- package/out/theme/hooks/useTheme.luau +15 -14
- package/out/theme/interfaces/density/controlMetrics.d.ts +21 -0
- package/out/theme/interfaces/density/controlMetrics.luau +67 -0
- package/out/theme/interfaces/density/index.d.ts +1 -0
- package/out/theme/interfaces/density/init.luau +7 -0
- package/out/theme/interfaces/index.d.ts +1 -0
- package/out/theme/interfaces/init.luau +3 -0
- package/out/theme/interfaces/palette/Palette.d.ts +39 -18
- package/out/theme/interfaces/palette/colors/index.d.ts +0 -1
- package/out/theme/interfaces/palette/index.d.ts +1 -0
- package/out/theme/interfaces/theme/Theme.d.ts +13 -0
- package/out/theme/interfaces/theme/ThemeConstants.d.ts +0 -18
- package/out/theme/styles/index.d.ts +1 -2
- package/out/theme/styles/init.luau +3 -1
- package/out/theme/styles/types/index.d.ts +0 -1
- package/out/theme/styles/utilities/classNames.d.ts +3 -2
- package/out/theme/styles/utilities/classNames.luau +7 -173
- package/out/theme/styles/utilities/componentStyles.d.ts +7 -0
- package/out/theme/styles/utilities/componentStyles.luau +31 -0
- package/out/theme/styles/utilities/componentTheme.d.ts +20 -0
- package/out/theme/styles/utilities/componentTheme.luau +53 -0
- package/out/theme/styles/utilities/createStyles.d.ts +1 -2
- package/out/theme/styles/utilities/index.d.ts +5 -1
- package/out/theme/styles/utilities/init.luau +7 -1
- package/out/theme/styles/utilities/interaction.d.ts +13 -0
- package/out/theme/styles/utilities/interaction.luau +68 -0
- package/out/theme/styles/utilities/makeStyles.luau +14 -15
- package/out/theme/styles/utilities/styleCache.d.ts +2 -0
- package/out/theme/styles/utilities/styleCache.luau +68 -0
- package/out/theme/styles/utilities/variants.d.ts +19 -0
- package/out/theme/styles/utilities/variants.luau +59 -0
- package/out/theme/themes/DarkTheme.luau +4 -57
- package/out/theme/themes/LightTheme.luau +4 -57
- package/out/theme/themes/createPalette.d.ts +3 -0
- package/out/theme/themes/createPalette.luau +111 -0
- package/out/theme/themes/index.d.ts +1 -0
- package/out/theme/themes/init.luau +3 -0
- package/out/theme/types/types.d.ts +1 -0
- package/out/theme/utilites/colorMath.d.ts +8 -0
- package/out/theme/utilites/colorMath.luau +35 -0
- package/out/theme/utilites/index.d.ts +1 -0
- package/out/theme/utilites/init.luau +6 -0
- package/out/ui/enums/Icons.d.ts +5 -1
- package/out/ui/enums/Icons.luau +4 -0
- package/out/ui/index.d.ts +12 -0
- package/out/ui/init.luau +5 -0
- package/out/ui/packages/accordion/components/Accordion.d.ts +11 -0
- package/out/ui/packages/accordion/components/Accordion.luau +93 -0
- package/out/ui/packages/accordion/components/Accordion.styles.d.ts +4 -0
- package/out/ui/packages/accordion/components/Accordion.styles.luau +65 -0
- package/out/ui/packages/accordion/components/accordionOpen.d.ts +1 -0
- package/out/ui/packages/accordion/components/accordionOpen.luau +10 -0
- package/out/ui/packages/accordion/index.d.ts +2 -0
- package/out/ui/packages/accordion/init.luau +5 -0
- package/out/ui/packages/assetField/components/AssetField.d.ts +10 -0
- package/out/ui/packages/assetField/components/AssetField.luau +75 -0
- package/out/ui/packages/assetField/components/AssetField.styles.d.ts +2 -0
- package/out/ui/packages/assetField/components/AssetField.styles.luau +33 -0
- package/out/ui/packages/assetField/components/assetPreviewUri.d.ts +1 -0
- package/out/ui/packages/assetField/components/assetPreviewUri.luau +25 -0
- package/out/ui/packages/assetField/index.d.ts +2 -0
- package/out/ui/packages/assetField/init.luau +5 -0
- package/out/ui/packages/autocomplete/components/Autocomplete.d.ts +5 -0
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +45 -0
- package/out/ui/packages/autocomplete/components/autocompleteSearchable.d.ts +1 -0
- package/out/ui/packages/autocomplete/components/autocompleteSearchable.luau +7 -0
- package/out/ui/packages/autocomplete/index.d.ts +2 -0
- package/out/ui/packages/autocomplete/init.luau +5 -0
- package/out/ui/packages/avatar/components/Avatar.d.ts +8 -0
- package/out/ui/packages/avatar/components/Avatar.luau +69 -0
- package/out/ui/packages/avatar/components/Avatar.styles.d.ts +4 -0
- package/out/ui/packages/avatar/components/Avatar.styles.luau +39 -0
- package/out/ui/packages/avatar/components/avatarText.d.ts +1 -0
- package/out/ui/packages/avatar/components/avatarText.luau +17 -0
- package/out/ui/packages/avatar/index.d.ts +3 -0
- package/out/ui/packages/avatar/init.luau +6 -0
- package/out/ui/packages/badge/components/Badge.d.ts +10 -0
- package/out/ui/packages/badge/components/Badge.luau +69 -0
- package/out/ui/packages/badge/components/Badge.styles.d.ts +2 -0
- package/out/ui/packages/badge/components/Badge.styles.luau +38 -0
- package/out/ui/packages/badge/components/badgeValue.d.ts +1 -0
- package/out/ui/packages/badge/components/badgeValue.luau +7 -0
- package/out/ui/packages/badge/index.d.ts +3 -0
- package/out/ui/packages/badge/init.luau +6 -0
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +11 -0
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +82 -0
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.styles.d.ts +2 -0
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.styles.luau +47 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +7 -0
- package/out/ui/packages/breadcrumbs/index.d.ts +2 -0
- package/out/ui/packages/breadcrumbs/init.luau +5 -0
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.d.ts +9 -0
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +234 -0
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.styles.d.ts +2 -0
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.styles.luau +98 -0
- package/out/ui/packages/brickColorPicker/components/brickColorCatalog.d.ts +1 -0
- package/out/ui/packages/brickColorPicker/components/brickColorCatalog.luau +26 -0
- package/out/ui/packages/brickColorPicker/components/brickColorFilter.d.ts +2 -0
- package/out/ui/packages/brickColorPicker/components/brickColorFilter.luau +26 -0
- package/out/ui/packages/brickColorPicker/index.d.ts +3 -0
- package/out/ui/packages/brickColorPicker/init.luau +8 -0
- package/out/ui/packages/button/components/Button.d.ts +4 -0
- package/out/ui/packages/button/components/Button.luau +90 -37
- package/out/ui/packages/button/components/Button.styles.luau +18 -32
- package/out/ui/packages/button/components/activation.d.ts +1 -0
- package/out/ui/packages/button/components/activation.luau +7 -0
- package/out/ui/packages/button/components/buttonLook.d.ts +12 -0
- package/out/ui/packages/button/components/buttonLook.luau +55 -0
- package/out/ui/packages/button/types/ButtonSize.d.ts +1 -1
- package/out/ui/packages/card/components/Card.d.ts +11 -0
- package/out/ui/packages/card/components/Card.luau +74 -0
- package/out/ui/packages/card/components/Card.styles.d.ts +2 -0
- package/out/ui/packages/card/components/Card.styles.luau +66 -0
- package/out/ui/packages/card/index.d.ts +2 -0
- package/out/ui/packages/card/init.luau +5 -0
- package/out/ui/packages/cframeEditor/components/CFrameEditor.d.ts +8 -0
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +89 -0
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.d.ts +2 -0
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +46 -0
- package/out/ui/packages/cframeEditor/components/cframeValue.d.ts +3 -0
- package/out/ui/packages/cframeEditor/components/cframeValue.luau +15 -0
- package/out/ui/packages/cframeEditor/index.d.ts +2 -0
- package/out/ui/packages/cframeEditor/init.luau +5 -0
- package/out/ui/packages/checkbox/components/Checkbox.d.ts +11 -0
- package/out/ui/packages/checkbox/components/Checkbox.luau +136 -0
- package/out/ui/packages/checkbox/components/Checkbox.styles.d.ts +6 -0
- package/out/ui/packages/checkbox/components/Checkbox.styles.luau +69 -0
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +5 -0
- package/out/ui/packages/checkbox/components/checkboxLook.luau +52 -0
- package/out/ui/packages/checkbox/components/nextChecked.d.ts +1 -0
- package/out/ui/packages/checkbox/components/nextChecked.luau +7 -0
- package/out/ui/packages/checkbox/index.d.ts +2 -0
- package/out/ui/packages/checkbox/init.luau +5 -0
- package/out/ui/packages/chip/components/Chip.d.ts +9 -0
- package/out/ui/packages/chip/components/Chip.luau +63 -0
- package/out/ui/packages/chip/components/Chip.styles.d.ts +5 -0
- package/out/ui/packages/chip/components/Chip.styles.luau +47 -0
- package/out/ui/packages/chip/index.d.ts +2 -0
- package/out/ui/packages/chip/init.luau +5 -0
- package/out/ui/packages/circularProgress/components/CircularProgress.d.ts +11 -0
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +109 -0
- package/out/ui/packages/circularProgress/index.d.ts +2 -0
- package/out/ui/packages/circularProgress/init.luau +5 -0
- package/out/ui/packages/colorPicker/components/ColorPicker.d.ts +8 -0
- package/out/ui/packages/colorPicker/components/ColorPicker.luau +512 -0
- package/out/ui/packages/colorPicker/components/ColorPicker.styles.d.ts +2 -0
- package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +145 -0
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.d.ts +8 -0
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +190 -0
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.d.ts +8 -0
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +240 -0
- package/out/ui/packages/colorPicker/components/colorValue.d.ts +22 -0
- package/out/ui/packages/colorPicker/components/colorValue.luau +157 -0
- package/out/ui/packages/colorPicker/components/sequenceValue.d.ts +26 -0
- package/out/ui/packages/colorPicker/components/sequenceValue.luau +307 -0
- package/out/ui/packages/colorPicker/index.d.ts +11 -0
- package/out/ui/packages/colorPicker/init.luau +37 -0
- package/out/ui/packages/dialog/components/Dialog.d.ts +11 -0
- package/out/ui/packages/dialog/components/Dialog.luau +56 -0
- package/out/ui/packages/dialog/components/Dialog.styles.d.ts +2 -0
- package/out/ui/packages/dialog/components/Dialog.styles.luau +55 -0
- package/out/ui/packages/dialog/index.d.ts +2 -0
- package/out/ui/packages/dialog/init.luau +5 -0
- package/out/ui/packages/divider/components/Divider.luau +6 -0
- package/out/ui/packages/divider/components/Divider.styles.luau +4 -4
- package/out/ui/packages/drawer/components/Drawer.d.ts +11 -0
- package/out/ui/packages/drawer/components/Drawer.luau +77 -0
- package/out/ui/packages/drawer/components/Drawer.styles.d.ts +2 -0
- package/out/ui/packages/drawer/components/Drawer.styles.luau +40 -0
- package/out/ui/packages/drawer/components/drawerPlacement.d.ts +2 -0
- package/out/ui/packages/drawer/components/drawerPlacement.luau +7 -0
- package/out/ui/packages/drawer/index.d.ts +3 -0
- package/out/ui/packages/drawer/init.luau +5 -0
- package/out/ui/packages/enumPicker/components/EnumPicker.d.ts +11 -0
- package/out/ui/packages/enumPicker/components/EnumPicker.luau +42 -0
- package/out/ui/packages/enumPicker/components/enumOptions.d.ts +5 -0
- package/out/ui/packages/enumPicker/components/enumOptions.luau +28 -0
- package/out/ui/packages/enumPicker/index.d.ts +2 -0
- package/out/ui/packages/enumPicker/init.luau +5 -0
- package/out/ui/packages/fontEditor/components/FontEditor.d.ts +8 -0
- package/out/ui/packages/fontEditor/components/FontEditor.luau +223 -0
- package/out/ui/packages/fontEditor/components/FontEditor.styles.d.ts +2 -0
- package/out/ui/packages/fontEditor/components/FontEditor.styles.luau +56 -0
- package/out/ui/packages/fontEditor/components/fontValue.d.ts +10 -0
- package/out/ui/packages/fontEditor/components/fontValue.luau +81 -0
- package/out/ui/packages/fontEditor/index.d.ts +4 -0
- package/out/ui/packages/fontEditor/init.luau +10 -0
- package/out/ui/packages/gradientEditor/components/GradientEditor.d.ts +10 -0
- package/out/ui/packages/gradientEditor/components/GradientEditor.luau +156 -0
- package/out/ui/packages/gradientEditor/components/GradientEditor.styles.d.ts +2 -0
- package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +37 -0
- package/out/ui/packages/gradientEditor/components/gradientPatch.d.ts +8 -0
- package/out/ui/packages/gradientEditor/components/gradientPatch.luau +17 -0
- package/out/ui/packages/gradientEditor/components/gradientValue.d.ts +9 -0
- package/out/ui/packages/gradientEditor/components/gradientValue.luau +23 -0
- package/out/ui/packages/gradientEditor/index.d.ts +2 -0
- package/out/ui/packages/gradientEditor/init.luau +5 -0
- package/out/ui/packages/icon/components/Icon.luau +6 -0
- package/out/ui/packages/icon/components/Icon.styles.luau +3 -3
- package/out/ui/packages/iconButton/components/IconButton.d.ts +3 -0
- package/out/ui/packages/iconButton/components/IconButton.luau +53 -5
- package/out/ui/packages/iconButton/components/IconButton.styles.luau +3 -3
- package/out/ui/packages/index.d.ts +46 -0
- package/out/ui/packages/init.luau +138 -0
- package/out/ui/packages/input/components/Input.d.ts +6 -1
- package/out/ui/packages/input/components/Input.luau +137 -54
- package/out/ui/packages/input/components/Input.styles.d.ts +3 -1
- package/out/ui/packages/input/components/Input.styles.luau +74 -52
- package/out/ui/packages/input/components/inputDraft.d.ts +1 -0
- package/out/ui/packages/input/components/inputDraft.luau +17 -0
- package/out/ui/packages/input/components/inputInsets.d.ts +4 -0
- package/out/ui/packages/input/components/inputInsets.luau +10 -0
- package/out/ui/packages/layout/components/Grid.luau +8 -2
- package/out/ui/packages/layout/components/List.luau +8 -2
- package/out/ui/packages/listItem/components/ListItem.d.ts +9 -0
- package/out/ui/packages/listItem/components/ListItem.luau +67 -0
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +5 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +64 -0
- package/out/ui/packages/listItem/index.d.ts +2 -0
- package/out/ui/packages/listItem/init.luau +5 -0
- package/out/ui/packages/loadingStroke/components/LoadingStroke.luau +27 -22
- package/out/ui/packages/menu/components/Menu.d.ts +14 -0
- package/out/ui/packages/menu/components/Menu.luau +60 -0
- package/out/ui/packages/menu/components/Menu.styles.d.ts +2 -0
- package/out/ui/packages/menu/components/Menu.styles.luau +26 -0
- package/out/ui/packages/menu/index.d.ts +2 -0
- package/out/ui/packages/menu/init.luau +5 -0
- package/out/ui/packages/modal/components/Modal.d.ts +9 -0
- package/out/ui/packages/modal/components/Modal.luau +97 -0
- package/out/ui/packages/modal/components/Modal.styles.d.ts +2 -0
- package/out/ui/packages/modal/components/Modal.styles.luau +47 -0
- package/out/ui/packages/modal/components/dismissInput.d.ts +1 -0
- package/out/ui/packages/modal/components/dismissInput.luau +8 -0
- package/out/ui/packages/modal/components/focusTrap.d.ts +2 -0
- package/out/ui/packages/modal/components/focusTrap.luau +22 -0
- package/out/ui/packages/modal/index.d.ts +2 -0
- package/out/ui/packages/modal/init.luau +5 -0
- package/out/ui/packages/motion/duration.d.ts +2 -0
- package/out/ui/packages/motion/duration.luau +17 -0
- package/out/ui/packages/motion/index.d.ts +5 -0
- package/out/ui/packages/motion/init.luau +16 -0
- package/out/ui/packages/motion/loop.d.ts +1 -0
- package/out/ui/packages/motion/loop.luau +18 -0
- package/out/ui/packages/motion/play.d.ts +1 -0
- package/out/ui/packages/motion/play.luau +23 -0
- package/out/ui/packages/motion/resolveReduced.d.ts +1 -0
- package/out/ui/packages/motion/resolveReduced.luau +10 -0
- package/out/ui/packages/motion/unit.d.ts +8 -0
- package/out/ui/packages/motion/unit.luau +80 -0
- package/out/ui/packages/numberInput/components/NumberInput.d.ts +14 -0
- package/out/ui/packages/numberInput/components/NumberInput.luau +44 -0
- package/out/ui/packages/numberInput/components/numberValue.d.ts +2 -0
- package/out/ui/packages/numberInput/components/numberValue.luau +29 -0
- package/out/ui/packages/numberInput/index.d.ts +2 -0
- package/out/ui/packages/numberInput/init.luau +5 -0
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.d.ts +8 -0
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +96 -0
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.styles.d.ts +2 -0
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.styles.luau +41 -0
- package/out/ui/packages/numberRangeEditor/components/numberRangeValue.d.ts +4 -0
- package/out/ui/packages/numberRangeEditor/components/numberRangeValue.luau +16 -0
- package/out/ui/packages/numberRangeEditor/index.d.ts +2 -0
- package/out/ui/packages/numberRangeEditor/init.luau +5 -0
- package/out/ui/packages/pagination/components/Pagination.d.ts +9 -0
- package/out/ui/packages/pagination/components/Pagination.luau +72 -0
- package/out/ui/packages/pagination/components/Pagination.styles.d.ts +2 -0
- package/out/ui/packages/pagination/components/Pagination.styles.luau +39 -0
- package/out/ui/packages/pagination/components/pageRange.d.ts +1 -0
- package/out/ui/packages/pagination/components/pageRange.luau +24 -0
- package/out/ui/packages/pagination/index.d.ts +2 -0
- package/out/ui/packages/pagination/init.luau +5 -0
- package/out/ui/packages/paper/components/Paper.d.ts +8 -0
- package/out/ui/packages/paper/components/Paper.luau +31 -0
- package/out/ui/packages/paper/components/Paper.styles.d.ts +4 -0
- package/out/ui/packages/paper/components/Paper.styles.luau +32 -0
- package/out/ui/packages/paper/index.d.ts +2 -0
- package/out/ui/packages/paper/init.luau +5 -0
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.d.ts +8 -0
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +85 -0
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.d.ts +2 -0
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +46 -0
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +3 -0
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +14 -0
- package/out/ui/packages/physicalPropertiesEditor/index.d.ts +2 -0
- package/out/ui/packages/physicalPropertiesEditor/init.luau +5 -0
- package/out/ui/packages/popup/components/Popup.d.ts +13 -0
- package/out/ui/packages/popup/components/Popup.luau +131 -0
- package/out/ui/packages/popup/components/Portal.d.ts +7 -0
- package/out/ui/packages/popup/components/Portal.luau +15 -0
- package/out/ui/packages/popup/components/placement.d.ts +9 -0
- package/out/ui/packages/popup/components/placement.luau +41 -0
- package/out/ui/packages/popup/components/portalTarget.d.ts +1 -0
- package/out/ui/packages/popup/components/portalTarget.luau +13 -0
- package/out/ui/packages/popup/index.d.ts +4 -0
- package/out/ui/packages/popup/init.luau +6 -0
- package/out/ui/packages/preloader/components/Preloader.luau +6 -0
- package/out/ui/packages/preloader/components/Preloader.styles.luau +3 -3
- package/out/ui/packages/progressBar/components/ProgressBar.d.ts +8 -1
- package/out/ui/packages/progressBar/components/ProgressBar.luau +61 -11
- package/out/ui/packages/progressBar/components/ProgressBar.styles.luau +2 -2
- package/out/ui/packages/progressBar/index.d.ts +2 -3
- package/out/ui/packages/progressBar/init.luau +3 -4
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +16 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +112 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +6 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +66 -0
- package/out/ui/packages/radioGroup/index.d.ts +2 -0
- package/out/ui/packages/radioGroup/init.luau +5 -0
- package/out/ui/packages/rayEditor/components/RayEditor.d.ts +8 -0
- package/out/ui/packages/rayEditor/components/RayEditor.luau +83 -0
- package/out/ui/packages/rayEditor/components/RayEditor.styles.d.ts +2 -0
- package/out/ui/packages/rayEditor/components/RayEditor.styles.luau +37 -0
- package/out/ui/packages/rayEditor/components/rayParts.d.ts +1 -0
- package/out/ui/packages/rayEditor/components/rayParts.luau +10 -0
- package/out/ui/packages/rayEditor/index.d.ts +2 -0
- package/out/ui/packages/rayEditor/init.luau +5 -0
- package/out/ui/packages/rectEditor/components/RectEditor.d.ts +8 -0
- package/out/ui/packages/rectEditor/components/RectEditor.luau +85 -0
- package/out/ui/packages/rectEditor/components/RectEditor.styles.d.ts +2 -0
- package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +46 -0
- package/out/ui/packages/rectEditor/components/rectValue.d.ts +3 -0
- package/out/ui/packages/rectEditor/components/rectValue.luau +14 -0
- package/out/ui/packages/rectEditor/index.d.ts +2 -0
- package/out/ui/packages/rectEditor/init.luau +5 -0
- package/out/ui/packages/scroll/dragScroll.d.ts +8 -0
- package/out/ui/packages/scroll/dragScroll.luau +51 -0
- package/out/ui/packages/scroll/index.d.ts +2 -0
- package/out/ui/packages/scroll/init.luau +5 -0
- package/out/ui/packages/scroll/useDragScroll.d.ts +5 -0
- package/out/ui/packages/scroll/useDragScroll.luau +127 -0
- package/out/ui/packages/select/components/Select.d.ts +15 -0
- package/out/ui/packages/select/components/Select.luau +432 -0
- package/out/ui/packages/select/components/Select.styles.d.ts +6 -0
- package/out/ui/packages/select/components/Select.styles.luau +104 -0
- package/out/ui/packages/select/components/optionLabel.d.ts +1 -0
- package/out/ui/packages/select/components/optionLabel.luau +7 -0
- package/out/ui/packages/select/components/selectFilter.d.ts +4 -0
- package/out/ui/packages/select/components/selectFilter.luau +27 -0
- package/out/ui/packages/select/components/selectFocus.d.ts +4 -0
- package/out/ui/packages/select/components/selectFocus.luau +16 -0
- package/out/ui/packages/select/components/selectGroups.d.ts +18 -0
- package/out/ui/packages/select/components/selectGroups.luau +38 -0
- package/out/ui/packages/select/components/selectKey.d.ts +4 -0
- package/out/ui/packages/select/components/selectKey.luau +14 -0
- 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/select/components/selectMulti.d.ts +5 -0
- package/out/ui/packages/select/components/selectMulti.luau +26 -0
- package/out/ui/packages/select/components/selectTypeahead.d.ts +4 -0
- package/out/ui/packages/select/components/selectTypeahead.luau +58 -0
- package/out/ui/packages/select/components/stepChoice.d.ts +3 -0
- package/out/ui/packages/select/components/stepChoice.luau +24 -0
- package/out/ui/packages/select/index.d.ts +3 -0
- package/out/ui/packages/select/init.luau +8 -0
- package/out/ui/packages/shadow/components/Shadow.styles.luau +3 -3
- package/out/ui/packages/sidebar/components/Sidebar.luau +6 -0
- package/out/ui/packages/sidebar/components/Sidebar.styles.luau +3 -3
- package/out/ui/packages/skeleton/components/Skeleton.d.ts +15 -0
- package/out/ui/packages/skeleton/components/Skeleton.luau +224 -0
- package/out/ui/packages/skeleton/components/Skeleton.styles.d.ts +2 -0
- package/out/ui/packages/skeleton/components/Skeleton.styles.luau +27 -0
- package/out/ui/packages/skeleton/components/skeletonMotion.d.ts +3 -0
- package/out/ui/packages/skeleton/components/skeletonMotion.luau +17 -0
- package/out/ui/packages/skeleton/index.d.ts +3 -0
- package/out/ui/packages/skeleton/init.luau +7 -0
- package/out/ui/packages/slider/components/Slider.d.ts +13 -0
- package/out/ui/packages/slider/components/Slider.luau +204 -0
- package/out/ui/packages/slider/components/Slider.styles.d.ts +6 -0
- package/out/ui/packages/slider/components/Slider.styles.luau +47 -0
- package/out/ui/packages/slider/components/sliderNudge.d.ts +4 -0
- package/out/ui/packages/slider/components/sliderNudge.luau +39 -0
- package/out/ui/packages/slider/index.d.ts +2 -0
- package/out/ui/packages/slider/init.luau +5 -0
- package/out/ui/packages/snackbar/components/Snackbar.d.ts +11 -0
- package/out/ui/packages/snackbar/components/Snackbar.luau +41 -0
- package/out/ui/packages/snackbar/index.d.ts +2 -0
- package/out/ui/packages/snackbar/init.luau +5 -0
- package/out/ui/packages/splitPane/components/SplitPane.d.ts +14 -0
- package/out/ui/packages/splitPane/components/SplitPane.luau +241 -0
- package/out/ui/packages/splitPane/components/SplitPane.styles.d.ts +2 -0
- package/out/ui/packages/splitPane/components/SplitPane.styles.luau +59 -0
- package/out/ui/packages/splitPane/components/splitLook.d.ts +5 -0
- package/out/ui/packages/splitPane/components/splitLook.luau +49 -0
- package/out/ui/packages/splitPane/components/splitSize.d.ts +10 -0
- package/out/ui/packages/splitPane/components/splitSize.luau +46 -0
- package/out/ui/packages/splitPane/index.d.ts +2 -0
- package/out/ui/packages/splitPane/init.luau +5 -0
- package/out/ui/packages/stateMatrix.d.ts +30 -0
- package/out/ui/packages/stateMatrix.luau +1369 -0
- package/out/ui/packages/stepper/components/Stepper.d.ts +7 -0
- package/out/ui/packages/stepper/components/Stepper.luau +62 -0
- package/out/ui/packages/stepper/components/Stepper.styles.d.ts +2 -0
- package/out/ui/packages/stepper/components/Stepper.styles.luau +39 -0
- package/out/ui/packages/stepper/components/stepState.d.ts +2 -0
- package/out/ui/packages/stepper/components/stepState.luau +13 -0
- package/out/ui/packages/stepper/index.d.ts +3 -0
- package/out/ui/packages/stepper/init.luau +6 -0
- package/out/ui/packages/switch/components/Switch.d.ts +11 -0
- package/out/ui/packages/switch/components/Switch.luau +170 -0
- package/out/ui/packages/switch/components/Switch.styles.d.ts +6 -0
- package/out/ui/packages/switch/components/Switch.styles.luau +62 -0
- package/out/ui/packages/switch/components/switchLook.d.ts +10 -0
- package/out/ui/packages/switch/components/switchLook.luau +63 -0
- package/out/ui/packages/switch/index.d.ts +2 -0
- package/out/ui/packages/switch/init.luau +5 -0
- package/out/ui/packages/table/components/Table.d.ts +9 -0
- package/out/ui/packages/table/components/Table.luau +135 -0
- package/out/ui/packages/table/components/Table.styles.d.ts +2 -0
- package/out/ui/packages/table/components/Table.styles.luau +70 -0
- package/out/ui/packages/table/components/rowSelected.d.ts +1 -0
- package/out/ui/packages/table/components/rowSelected.luau +7 -0
- package/out/ui/packages/table/index.d.ts +2 -0
- package/out/ui/packages/table/init.luau +5 -0
- package/out/ui/packages/tabs/components/Tabs.d.ts +10 -0
- package/out/ui/packages/tabs/components/Tabs.luau +113 -0
- package/out/ui/packages/tabs/components/Tabs.styles.d.ts +2 -0
- package/out/ui/packages/tabs/components/Tabs.styles.luau +55 -0
- package/out/ui/packages/tabs/index.d.ts +2 -0
- package/out/ui/packages/tabs/init.luau +5 -0
- package/out/ui/packages/toast/components/Toast.luau +6 -0
- package/out/ui/packages/toast/components/Toast.styles.luau +23 -10
- package/out/ui/packages/tooltip/components/Tooltip.d.ts +7 -0
- package/out/ui/packages/tooltip/components/Tooltip.luau +119 -0
- package/out/ui/packages/tooltip/components/Tooltip.styles.d.ts +2 -0
- package/out/ui/packages/tooltip/components/Tooltip.styles.luau +43 -0
- package/out/ui/packages/tooltip/index.d.ts +2 -0
- package/out/ui/packages/tooltip/init.luau +5 -0
- package/out/ui/packages/treeView/components/TreeView.d.ts +1 -0
- package/out/ui/packages/treeView/components/TreeView.luau +201 -225
- package/out/ui/packages/treeView/components/TreeView.styles.luau +6 -34
- package/out/ui/packages/treeView/components/treeRows.d.ts +23 -0
- package/out/ui/packages/treeView/components/treeRows.luau +147 -0
- package/out/ui/packages/treeView/interfaces/Branch.d.ts +3 -0
- package/out/ui/packages/treeView/interfaces/Leaf.d.ts +2 -0
- package/out/ui/packages/typography/components/Typography.luau +6 -0
- package/out/ui/packages/typography/components/Typography.styles.luau +8 -11
- package/out/ui/packages/udimEditor/components/UDimEditor.d.ts +8 -0
- package/out/ui/packages/udimEditor/components/UDimEditor.luau +127 -0
- package/out/ui/packages/udimEditor/components/UDimEditor.styles.d.ts +2 -0
- package/out/ui/packages/udimEditor/components/UDimEditor.styles.luau +50 -0
- package/out/ui/packages/udimEditor/index.d.ts +2 -0
- package/out/ui/packages/udimEditor/init.luau +5 -0
- package/out/ui/packages/vectorEditor/components/VectorEditor.d.ts +10 -0
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +87 -0
- package/out/ui/packages/vectorEditor/components/VectorEditor.styles.d.ts +2 -0
- package/out/ui/packages/vectorEditor/components/VectorEditor.styles.luau +41 -0
- package/out/ui/packages/vectorEditor/components/vectorValue.d.ts +10 -0
- package/out/ui/packages/vectorEditor/components/vectorValue.luau +49 -0
- package/out/ui/packages/vectorEditor/index.d.ts +4 -0
- package/out/ui/packages/vectorEditor/init.luau +11 -0
- package/out/ui/packages/virtualList/components/VirtualList.d.ts +23 -0
- package/out/ui/packages/virtualList/components/VirtualList.luau +178 -0
- package/out/ui/packages/virtualList/components/VirtualList.styles.d.ts +2 -0
- package/out/ui/packages/virtualList/components/VirtualList.styles.luau +29 -0
- package/out/ui/packages/virtualList/components/virtualWindow.d.ts +10 -0
- package/out/ui/packages/virtualList/components/virtualWindow.luau +66 -0
- package/out/ui/packages/virtualList/index.d.ts +2 -0
- package/out/ui/packages/virtualList/init.luau +5 -0
- package/package.json +7 -3
- package/out/theme/interfaces/palette/colors/Colors.d.ts +0 -42
- package/out/theme/interfaces/palette/colors/Colors.luau +0 -2
- package/out/theme/styles/types/ConditionalStylesMap.d.ts +0 -2
- package/out/theme/styles/types/ConditionalStylesMap.luau +0 -2
package/README.md
CHANGED
|
@@ -34,7 +34,6 @@ How does it do this? Well, there are two main exports from this package:
|
|
|
34
34
|
|
|
35
35
|
- @rbxts/uiblox -> theme
|
|
36
36
|
- An extensible Theme type + default Dark (default) and Light themes
|
|
37
|
-
- ... Light theme palette is a WIP
|
|
38
37
|
- makeStyles/createStyles utilities to serve up Instance-extended property
|
|
39
38
|
tables that can be applied to your React Components
|
|
40
39
|
- ThemeProvider which can wrap your application and uses Reflex to tell
|
|
@@ -196,6 +195,73 @@ const useMyComponentStyles = makeStyles<MyComponentProps>((theme: Theme, props:
|
|
|
196
195
|
export default useMyComponentStyles;
|
|
197
196
|
```
|
|
198
197
|
|
|
198
|
+
### Style precedence
|
|
199
|
+
|
|
200
|
+
Components spread their own styles first, then `className`, then the props that
|
|
201
|
+
carry state. Later always wins:
|
|
202
|
+
|
|
203
|
+
1. Component styles from the theme
|
|
204
|
+
2. `className` (merge several with `cx(a, condition && b)`; later args win, falsy
|
|
205
|
+
args are skipped)
|
|
206
|
+
3. State props the component owns: `Active`, `Selectable`, `Text`, and the
|
|
207
|
+
value-driven sizes/positions of Slider, SplitPane, and so on
|
|
208
|
+
|
|
209
|
+
So `className` can restyle anything except a control's state. Pass `disabled`
|
|
210
|
+
instead of overriding `Active`.
|
|
211
|
+
|
|
212
|
+
### Controls
|
|
213
|
+
|
|
214
|
+
Inputs are controlled: `{ value, onChange, disabled? }`. They call `onChange`
|
|
215
|
+
only when the value actually changes, and never while disabled.
|
|
216
|
+
|
|
217
|
+
| Component | Value | Notes |
|
|
218
|
+
| --- | --- | --- |
|
|
219
|
+
| Checkbox | `boolean` | `mixed` shows indeterminate; activating commits `true` |
|
|
220
|
+
| Switch | `boolean` | |
|
|
221
|
+
| RadioGroup / Select / Tabs | `T` from `options: { label, value: T, disabled? }[]` | compared by identity; disabled options are skipped |
|
|
222
|
+
| NumberInput | `number` | commits on focus lost or Enter; clamps to `min`/`max`, snaps to `step` |
|
|
223
|
+
| Slider | `number` | `onChange` while dragging, `onCommit` on release |
|
|
224
|
+
| SplitPane | first pane size (px) | display clamps to `min`/`max`; Escape cancels a drag |
|
|
225
|
+
| Input | `text` | `onInput` while typing, `onTextChanged` on commit |
|
|
226
|
+
|
|
227
|
+
Select and Tooltip render through `Popup`, which portals into the nearest
|
|
228
|
+
`LayerCollector` so clipping parents do not cut them off. The popup follows its
|
|
229
|
+
anchor when that anchor moves or resizes, and Select closes if the anchor leaves
|
|
230
|
+
the layer. Select handles Up, Down, Enter, and Escape while it is open or
|
|
231
|
+
selected, including when the pointer is not over it.
|
|
232
|
+
|
|
233
|
+
### Loading
|
|
234
|
+
|
|
235
|
+
`Skeleton` covers a block that is still loading. `variant` is `text`,
|
|
236
|
+
`rectangular`, `rounded`, or `circular`. `width` and `height` are pixels.
|
|
237
|
+
`lines` and `gap` stack text rows. `SkeletonText` is the text variant.
|
|
238
|
+
`animation` is `pulse`, `shimmer`, or `false`. `reducedMotion` holds the block
|
|
239
|
+
still. A later theme preference can set that prop for you.
|
|
240
|
+
|
|
241
|
+
`CircularProgress` spins while `value` is omitted. A `value` from 0 to 1 draws
|
|
242
|
+
an arc and stops the spin. `size`, `thickness`, and `color` restyle the ring.
|
|
243
|
+
`LinearProgress` is the existing `ProgressBar`: pass `value` from 0 to 1 or
|
|
244
|
+
`progress` from 0 to 100. `indeterminate` slides the bar. `disabled` and
|
|
245
|
+
`reducedMotion` stop the motion and fade the fill.
|
|
246
|
+
|
|
247
|
+
`Button` and `IconButton` take `loading`. The control ignores clicks, hover,
|
|
248
|
+
and focus while loading, and its size stays put. `loadingLabel` replaces the
|
|
249
|
+
caption. `loadingPosition` is `start`, `center`, or `end`. `reducedMotion`
|
|
250
|
+
keeps the spinner still.
|
|
251
|
+
|
|
252
|
+
### State captures
|
|
253
|
+
|
|
254
|
+
`stateMatrix` is the gallery list for Storyblox. Each row is one shot: `theme`
|
|
255
|
+
(`Dark` or `Light`), `width`, and `pointer` (`rest`, `hover`, `press`, or
|
|
256
|
+
`focus`). `open` means the Select list is showing. `options` and `disabledOption`
|
|
257
|
+
build RadioGroup, Select, and Tabs. `selected` and `filter` are TreeView.
|
|
258
|
+
`value`, `text`, `disabled`, `loading`, `mixed`, `hasError`, and `placeholder`
|
|
259
|
+
are that control's props. `variant`, `animation` (`pulse`, `shimmer`, or
|
|
260
|
+
`false`), `reducedMotion`, and `indeterminate` cover skeleton and progress
|
|
261
|
+
shots. Those shots stay still when `animation` is `false` or `reducedMotion`
|
|
262
|
+
is set. Hover, press, and focus rows are only there when the
|
|
263
|
+
control actually changes.
|
|
264
|
+
|
|
199
265
|
### Client
|
|
200
266
|
|
|
201
267
|
Some sample logic for mounting app when player spawns (on client).
|
|
@@ -247,7 +313,6 @@ new AppLoader().Mount();
|
|
|
247
313
|
# Future work
|
|
248
314
|
|
|
249
315
|
- More UI packages
|
|
250
|
-
- Finish palette for LightTheme
|
|
251
316
|
|
|
252
317
|
# See Also
|
|
253
318
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function isFiniteNumber(value)
|
|
3
|
+
local _value = value
|
|
4
|
+
if typeof(_value) ~= "number" then
|
|
5
|
+
return false
|
|
6
|
+
end
|
|
7
|
+
local number = value
|
|
8
|
+
return number == number and number < math.huge and number > -math.huge
|
|
9
|
+
end
|
|
10
|
+
local function finiteOr(value, fallback)
|
|
11
|
+
return if isFiniteNumber(value) then value else fallback
|
|
12
|
+
end
|
|
13
|
+
local function positiveDimension(value, fallback)
|
|
14
|
+
if not isFiniteNumber(value) or value <= 0 then
|
|
15
|
+
return fallback
|
|
16
|
+
end
|
|
17
|
+
return value
|
|
18
|
+
end
|
|
19
|
+
return {
|
|
20
|
+
isFiniteNumber = isFiniteNumber,
|
|
21
|
+
finiteOr = finiteOr,
|
|
22
|
+
positiveDimension = positiveDimension,
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isFiniteNumber, finiteOr, positiveDimension } from "./guard";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
local _guard = TS.import(script, script, "guard")
|
|
5
|
+
exports.isFiniteNumber = _guard.isFiniteNumber
|
|
6
|
+
exports.finiteOr = _guard.finiteOr
|
|
7
|
+
exports.positiveDimension = _guard.positiveDimension
|
|
8
|
+
return exports
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type BreakpointName = "phone" | "tablet" | "desktop";
|
|
2
|
+
export type OrientationName = "portrait" | "landscape";
|
|
3
|
+
export declare function breakpointName(width: number): BreakpointName;
|
|
4
|
+
export declare function orientationName(width: number, height: number): OrientationName;
|
|
5
|
+
export type Responsive<T> = T | {
|
|
6
|
+
phone?: T;
|
|
7
|
+
tablet?: T;
|
|
8
|
+
desktop?: T;
|
|
9
|
+
};
|
|
10
|
+
export declare function resolveResponsive<T>(value: Responsive<T> | undefined, width: number): T | undefined;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function usable(value)
|
|
3
|
+
local _value = value
|
|
4
|
+
local _condition = typeof(_value) ~= "number"
|
|
5
|
+
if not _condition then
|
|
6
|
+
_condition = value ~= value or value >= math.huge or value <= -math.huge or value <= 0
|
|
7
|
+
end
|
|
8
|
+
if _condition then
|
|
9
|
+
return 0
|
|
10
|
+
end
|
|
11
|
+
return value
|
|
12
|
+
end
|
|
13
|
+
local function breakpointName(width)
|
|
14
|
+
local size = usable(width)
|
|
15
|
+
if size < 600 then
|
|
16
|
+
return "phone"
|
|
17
|
+
end
|
|
18
|
+
if size < 960 then
|
|
19
|
+
return "tablet"
|
|
20
|
+
end
|
|
21
|
+
return "desktop"
|
|
22
|
+
end
|
|
23
|
+
local function orientationName(width, height)
|
|
24
|
+
return if usable(height) > usable(width) then "portrait" else "landscape"
|
|
25
|
+
end
|
|
26
|
+
local function resolveResponsive(value, width)
|
|
27
|
+
local _condition = value == nil
|
|
28
|
+
if not _condition then
|
|
29
|
+
local _value = value
|
|
30
|
+
_condition = typeof(_value) ~= "table"
|
|
31
|
+
end
|
|
32
|
+
if _condition then
|
|
33
|
+
return value
|
|
34
|
+
end
|
|
35
|
+
local record = value
|
|
36
|
+
local name = breakpointName(width)
|
|
37
|
+
if name == "desktop" then
|
|
38
|
+
local _condition_1 = record.desktop
|
|
39
|
+
if _condition_1 == nil then
|
|
40
|
+
_condition_1 = record.tablet
|
|
41
|
+
if _condition_1 == nil then
|
|
42
|
+
_condition_1 = record.phone
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
return _condition_1
|
|
46
|
+
end
|
|
47
|
+
if name == "tablet" then
|
|
48
|
+
local _condition_1 = record.tablet
|
|
49
|
+
if _condition_1 == nil then
|
|
50
|
+
_condition_1 = record.phone
|
|
51
|
+
end
|
|
52
|
+
return _condition_1
|
|
53
|
+
end
|
|
54
|
+
return record.phone
|
|
55
|
+
end
|
|
56
|
+
return {
|
|
57
|
+
breakpointName = breakpointName,
|
|
58
|
+
orientationName = orientationName,
|
|
59
|
+
resolveResponsive = resolveResponsive,
|
|
60
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
local _breakpoints = TS.import(script, script, "breakpoints")
|
|
5
|
+
exports.breakpointName = _breakpoints.breakpointName
|
|
6
|
+
exports.orientationName = _breakpoints.orientationName
|
|
7
|
+
exports.resolveResponsive = _breakpoints.resolveResponsive
|
|
8
|
+
exports.useBreakpoints = TS.import(script, script, "useBreakpoints").useBreakpoints
|
|
9
|
+
exports.useReducedMotion = TS.import(script, script, "useReducedMotion").useReducedMotion
|
|
10
|
+
return exports
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local useEffect = _react.useEffect
|
|
5
|
+
local useState = _react.useState
|
|
6
|
+
local _breakpoints = TS.import(script, script.Parent, "breakpoints")
|
|
7
|
+
local breakpointName = _breakpoints.breakpointName
|
|
8
|
+
local orientationName = _breakpoints.orientationName
|
|
9
|
+
local function useBreakpoints(host)
|
|
10
|
+
local size, setSize = useState({
|
|
11
|
+
width = 0,
|
|
12
|
+
height = 0,
|
|
13
|
+
})
|
|
14
|
+
useEffect(function()
|
|
15
|
+
if host == nil then
|
|
16
|
+
return nil
|
|
17
|
+
end
|
|
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
|
|
29
|
+
end, { host })
|
|
30
|
+
return {
|
|
31
|
+
width = size.width,
|
|
32
|
+
height = size.height,
|
|
33
|
+
name = breakpointName(size.width),
|
|
34
|
+
orientation = orientationName(size.width, size.height),
|
|
35
|
+
}
|
|
36
|
+
end
|
|
37
|
+
return {
|
|
38
|
+
useBreakpoints = useBreakpoints,
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useReducedMotion(override?: boolean): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local useTheme = TS.import(script, script.Parent.Parent, "theme").useTheme
|
|
4
|
+
local resolveReduced = TS.import(script, script.Parent.Parent, "ui", "packages", "motion", "resolveReduced").resolveReduced
|
|
5
|
+
local function useReducedMotion(override)
|
|
6
|
+
local _binding = useTheme()
|
|
7
|
+
local theme = _binding.theme
|
|
8
|
+
return resolveReduced(override, theme.reducedMotion)
|
|
9
|
+
end
|
|
10
|
+
return {
|
|
11
|
+
useReducedMotion = useReducedMotion,
|
|
12
|
+
}
|
package/out/index.d.ts
CHANGED
package/out/init.luau
CHANGED
|
@@ -7,4 +7,13 @@ end
|
|
|
7
7
|
for _k, _v in TS.import(script, script, "ui") or {} do
|
|
8
8
|
exports[_k] = _v
|
|
9
9
|
end
|
|
10
|
+
for _k, _v in TS.import(script, script, "interaction") or {} do
|
|
11
|
+
exports[_k] = _v
|
|
12
|
+
end
|
|
13
|
+
for _k, _v in TS.import(script, script, "foundation") or {} do
|
|
14
|
+
exports[_k] = _v
|
|
15
|
+
end
|
|
16
|
+
for _k, _v in TS.import(script, script, "hooks") or {} do
|
|
17
|
+
exports[_k] = _v
|
|
18
|
+
end
|
|
10
19
|
return exports
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
exports.usePointer = TS.import(script, script, "usePointer").usePointer
|
|
5
|
+
local _pointerRoute = TS.import(script, script, "pointerRoute")
|
|
6
|
+
exports.pointerRoute = _pointerRoute.pointerRoute
|
|
7
|
+
exports.isKeyKind = _pointerRoute.isKeyKind
|
|
8
|
+
exports.shouldTakeKey = _pointerRoute.shouldTakeKey
|
|
9
|
+
return exports
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type PointerRoute = "local" | "global";
|
|
2
|
+
/** Global pointer replaces local GuiObject events. Never both. */
|
|
3
|
+
export declare function pointerRoute(globalPointer?: boolean): PointerRoute;
|
|
4
|
+
export declare function isKeyKind(name: string): boolean;
|
|
5
|
+
/** Processed keys are ignored unless the caller opts into them. */
|
|
6
|
+
export declare function shouldTakeKey(gameProcessed: boolean, captureProcessed?: boolean): boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
--* Global pointer replaces local GuiObject events. Never both.
|
|
3
|
+
local function pointerRoute(globalPointer)
|
|
4
|
+
return if globalPointer == true then "global" else "local"
|
|
5
|
+
end
|
|
6
|
+
local GAMEPADS = {
|
|
7
|
+
["Gamepad1"] = true,
|
|
8
|
+
["Gamepad2"] = true,
|
|
9
|
+
["Gamepad3"] = true,
|
|
10
|
+
["Gamepad4"] = true,
|
|
11
|
+
["Gamepad5"] = true,
|
|
12
|
+
["Gamepad6"] = true,
|
|
13
|
+
["Gamepad7"] = true,
|
|
14
|
+
["Gamepad8"] = true,
|
|
15
|
+
}
|
|
16
|
+
local function isKeyKind(name)
|
|
17
|
+
local _condition = name == "Keyboard"
|
|
18
|
+
if not _condition then
|
|
19
|
+
local _name = name
|
|
20
|
+
_condition = GAMEPADS[_name] ~= nil
|
|
21
|
+
end
|
|
22
|
+
return _condition
|
|
23
|
+
end
|
|
24
|
+
--* Processed keys are ignored unless the caller opts into them.
|
|
25
|
+
local function shouldTakeKey(gameProcessed, captureProcessed)
|
|
26
|
+
if captureProcessed == nil then
|
|
27
|
+
captureProcessed = false
|
|
28
|
+
end
|
|
29
|
+
return captureProcessed or not gameProcessed
|
|
30
|
+
end
|
|
31
|
+
return {
|
|
32
|
+
pointerRoute = pointerRoute,
|
|
33
|
+
isKeyKind = isKeyKind,
|
|
34
|
+
shouldTakeKey = shouldTakeKey,
|
|
35
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface PointerHandlers {
|
|
2
|
+
onDown?: (position: Vector2) => void;
|
|
3
|
+
onUp?: (position: Vector2) => void;
|
|
4
|
+
onKey?: (input: InputObject) => void;
|
|
5
|
+
}
|
|
6
|
+
export interface UsePointerOptions {
|
|
7
|
+
globalPointer?: boolean;
|
|
8
|
+
keyboard?: boolean;
|
|
9
|
+
captureProcessed?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function usePointer(target: GuiObject | undefined, handlers: PointerHandlers, options?: UsePointerOptions): void;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local useEffect = _react.useEffect
|
|
5
|
+
local useRef = _react.useRef
|
|
6
|
+
local UserInputService = TS.import(script, TS.getModule(script, "@rbxts", "services")).UserInputService
|
|
7
|
+
local _pointerRoute = TS.import(script, script.Parent, "pointerRoute")
|
|
8
|
+
local isKeyKind = _pointerRoute.isKeyKind
|
|
9
|
+
local pointerRoute = _pointerRoute.pointerRoute
|
|
10
|
+
local shouldTakeKey = _pointerRoute.shouldTakeKey
|
|
11
|
+
local function isPointerButton(input)
|
|
12
|
+
local kind = input.UserInputType
|
|
13
|
+
return kind == Enum.UserInputType.MouseButton1 or kind == Enum.UserInputType.Touch
|
|
14
|
+
end
|
|
15
|
+
local function positionOf(input)
|
|
16
|
+
return Vector2.new(input.Position.X, input.Position.Y)
|
|
17
|
+
end
|
|
18
|
+
local function usePointer(target, handlers, options)
|
|
19
|
+
if options == nil then
|
|
20
|
+
options = {}
|
|
21
|
+
end
|
|
22
|
+
local current = useRef(handlers)
|
|
23
|
+
current.current = handlers
|
|
24
|
+
local route = pointerRoute(options.globalPointer)
|
|
25
|
+
local captureProcessed = options.captureProcessed == true
|
|
26
|
+
useEffect(function()
|
|
27
|
+
if route ~= "local" or not target then
|
|
28
|
+
return nil
|
|
29
|
+
end
|
|
30
|
+
local began = target.InputBegan:Connect(function(input)
|
|
31
|
+
if isPointerButton(input) then
|
|
32
|
+
local _result = current.current.onDown
|
|
33
|
+
if _result ~= nil then
|
|
34
|
+
_result(positionOf(input))
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end)
|
|
38
|
+
local ended = target.InputEnded:Connect(function(input)
|
|
39
|
+
if isPointerButton(input) then
|
|
40
|
+
local _result = current.current.onUp
|
|
41
|
+
if _result ~= nil then
|
|
42
|
+
_result(positionOf(input))
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end)
|
|
46
|
+
return function()
|
|
47
|
+
began:Disconnect()
|
|
48
|
+
ended:Disconnect()
|
|
49
|
+
end
|
|
50
|
+
end, { target, route })
|
|
51
|
+
useEffect(function()
|
|
52
|
+
if route ~= "global" then
|
|
53
|
+
return nil
|
|
54
|
+
end
|
|
55
|
+
local began = UserInputService.InputBegan:Connect(function(input)
|
|
56
|
+
if isPointerButton(input) then
|
|
57
|
+
local _result = current.current.onDown
|
|
58
|
+
if _result ~= nil then
|
|
59
|
+
_result(positionOf(input))
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end)
|
|
63
|
+
local ended = UserInputService.InputEnded:Connect(function(input)
|
|
64
|
+
if isPointerButton(input) then
|
|
65
|
+
local _result = current.current.onUp
|
|
66
|
+
if _result ~= nil then
|
|
67
|
+
_result(positionOf(input))
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end)
|
|
71
|
+
return function()
|
|
72
|
+
began:Disconnect()
|
|
73
|
+
ended:Disconnect()
|
|
74
|
+
end
|
|
75
|
+
end, { route })
|
|
76
|
+
useEffect(function()
|
|
77
|
+
if options.keyboard ~= true then
|
|
78
|
+
return nil
|
|
79
|
+
end
|
|
80
|
+
local connection = UserInputService.InputBegan:Connect(function(input, gameProcessed)
|
|
81
|
+
if not isKeyKind(input.UserInputType.Name) then
|
|
82
|
+
return nil
|
|
83
|
+
end
|
|
84
|
+
if not shouldTakeKey(gameProcessed, captureProcessed) then
|
|
85
|
+
return nil
|
|
86
|
+
end
|
|
87
|
+
local _result = current.current.onKey
|
|
88
|
+
if _result ~= nil then
|
|
89
|
+
_result(input)
|
|
90
|
+
end
|
|
91
|
+
end)
|
|
92
|
+
return function()
|
|
93
|
+
return connection:Disconnect()
|
|
94
|
+
end
|
|
95
|
+
end, { options.keyboard, captureProcessed })
|
|
96
|
+
end
|
|
97
|
+
return {
|
|
98
|
+
usePointer = usePointer,
|
|
99
|
+
}
|
|
@@ -1,104 +1,8 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local TS = _G[script]
|
|
3
|
-
local _colors = TS.import(script, script.Parent.Parent, "interfaces", "palette", "colors")
|
|
4
|
-
local Blue = _colors.Blue
|
|
5
|
-
local Common = _colors.Common
|
|
6
|
-
local Gray = _colors.Gray
|
|
7
|
-
local Green = _colors.Green
|
|
8
|
-
local Purple = _colors.Purple
|
|
9
|
-
local Red = _colors.Red
|
|
10
|
-
local Yellow = _colors.Yellow
|
|
11
|
-
-- dark theme
|
|
12
|
-
local DARK_THEME_COLORS = {
|
|
13
|
-
backgroundDefault = Common.Black,
|
|
14
|
-
backgroundContrast = Gray[110],
|
|
15
|
-
backgroundMuted = Gray[90],
|
|
16
|
-
backgroundUIDefault = Gray[90],
|
|
17
|
-
backgroundUIMuted = Gray[100],
|
|
18
|
-
backgroundUIContrast = Gray[100],
|
|
19
|
-
UIDefault = Gray[70],
|
|
20
|
-
UIMuted = Gray[100],
|
|
21
|
-
UIEmphasis = Gray[80],
|
|
22
|
-
textDefault = Common.White,
|
|
23
|
-
textMuted = Gray[50],
|
|
24
|
-
textEmphasis = Common.White,
|
|
25
|
-
iconDefault = Common.White,
|
|
26
|
-
iconEmphasis = Common.White,
|
|
27
|
-
iconOnHover = Common.White,
|
|
28
|
-
systemPrimaryDefault = Common.White,
|
|
29
|
-
systemPrimaryOnHover = Gray[40],
|
|
30
|
-
systemPrimaryContent = Common.Black,
|
|
31
|
-
contextualPrimaryDefault = Green[50],
|
|
32
|
-
contextualPrimaryOnHover = Green[40],
|
|
33
|
-
contextualPrimaryContent = Common.Black,
|
|
34
|
-
secondaryDefault = Common.White,
|
|
35
|
-
secondaryOnHover = Gray[40],
|
|
36
|
-
secondaryContent = Common.White,
|
|
37
|
-
divider = Gray[70],
|
|
38
|
-
overlay = Common.Black,
|
|
39
|
-
dropShadow = Common.Black,
|
|
40
|
-
navigationBar = Gray[110],
|
|
41
|
-
badge = Common.White,
|
|
42
|
-
badgeContent = Common.Black,
|
|
43
|
-
placeholder = Gray[100],
|
|
44
|
-
online = Green[50],
|
|
45
|
-
offline = Gray[50],
|
|
46
|
-
alert = Red[60],
|
|
47
|
-
success = Green[50],
|
|
48
|
-
accent = Purple[50],
|
|
49
|
-
link = Blue[50],
|
|
50
|
-
caution = Yellow[50],
|
|
51
|
-
text = Common.White,
|
|
52
|
-
background = Common.Black,
|
|
53
|
-
}
|
|
54
|
-
local LIGHT_THEME_COLORS = {
|
|
55
|
-
backgroundDefault = Common.White,
|
|
56
|
-
backgroundContrast = Gray[40],
|
|
57
|
-
backgroundMuted = Gray[30],
|
|
58
|
-
backgroundUIDefault = Gray[30],
|
|
59
|
-
backgroundUIMuted = Gray[50],
|
|
60
|
-
backgroundUIContrast = Gray[50],
|
|
61
|
-
UIDefault = Gray[70],
|
|
62
|
-
UIMuted = Gray[50],
|
|
63
|
-
UIEmphasis = Gray[80],
|
|
64
|
-
textDefault = Common.Black,
|
|
65
|
-
textMuted = Gray[50],
|
|
66
|
-
textEmphasis = Common.Black,
|
|
67
|
-
iconDefault = Common.Black,
|
|
68
|
-
iconEmphasis = Common.Black,
|
|
69
|
-
iconOnHover = Common.Black,
|
|
70
|
-
systemPrimaryDefault = Common.Black,
|
|
71
|
-
systemPrimaryOnHover = Gray[40],
|
|
72
|
-
systemPrimaryContent = Common.White,
|
|
73
|
-
contextualPrimaryDefault = Green[60],
|
|
74
|
-
contextualPrimaryOnHover = Green[40],
|
|
75
|
-
contextualPrimaryContent = Common.White,
|
|
76
|
-
secondaryDefault = Common.Black,
|
|
77
|
-
secondaryOnHover = Gray[40],
|
|
78
|
-
secondaryContent = Common.Black,
|
|
79
|
-
divider = Gray[70],
|
|
80
|
-
overlay = Common.White,
|
|
81
|
-
dropShadow = Common.White,
|
|
82
|
-
navigationBar = Gray[40],
|
|
83
|
-
badge = Common.Black,
|
|
84
|
-
badgeContent = Common.White,
|
|
85
|
-
placeholder = Gray[50],
|
|
86
|
-
online = Green[60],
|
|
87
|
-
offline = Gray[50],
|
|
88
|
-
alert = Red[60],
|
|
89
|
-
success = Green[60],
|
|
90
|
-
accent = Purple[50],
|
|
91
|
-
link = Blue[50],
|
|
92
|
-
caution = Yellow[50],
|
|
93
|
-
text = Common.Black,
|
|
94
|
-
background = Common.White,
|
|
95
|
-
}
|
|
96
2
|
local DEFAULT_BORDERS = {
|
|
97
3
|
default = 1,
|
|
98
4
|
divider = 2,
|
|
99
5
|
}
|
|
100
6
|
return {
|
|
101
|
-
DARK_THEME_COLORS = DARK_THEME_COLORS,
|
|
102
|
-
LIGHT_THEME_COLORS = LIGHT_THEME_COLORS,
|
|
103
7
|
DEFAULT_BORDERS = DEFAULT_BORDERS,
|
|
104
8
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
1
2
|
import { Theme } from "../interfaces/index";
|
|
2
3
|
import { CustomizedProps } from "../types/index";
|
|
4
|
+
import { ThemeScope } from "./themeScope";
|
|
5
|
+
export declare const ThemeContext: React.Context<ThemeScope<Theme> | undefined>;
|
|
3
6
|
export interface ThemeProviderProps {
|
|
4
7
|
theme?: Theme;
|
|
5
8
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local React = _react
|
|
5
|
-
local StrictMode = _react.StrictMode
|
|
6
5
|
local useEffect = _react.useEffect
|
|
7
|
-
local
|
|
6
|
+
local useMemo = _react.useMemo
|
|
7
|
+
local useState = _react.useState
|
|
8
8
|
local DEFAULT_THEME = TS.import(script, script.Parent.Parent, "constants").DEFAULT_THEME
|
|
9
|
-
local
|
|
9
|
+
local ThemeContext = React.createContext(nil)
|
|
10
10
|
local function ThemeProvider(props)
|
|
11
11
|
local _binding = props
|
|
12
12
|
local theme = _binding.theme
|
|
@@ -14,15 +14,22 @@ local function ThemeProvider(props)
|
|
|
14
14
|
theme = DEFAULT_THEME
|
|
15
15
|
end
|
|
16
16
|
local children = _binding.children
|
|
17
|
-
|
|
17
|
+
local current, setCurrent = useState(theme)
|
|
18
18
|
useEffect(function()
|
|
19
|
-
|
|
19
|
+
setCurrent(theme)
|
|
20
20
|
end, { theme })
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
local value = useMemo(function()
|
|
22
|
+
return {
|
|
23
|
+
theme = current,
|
|
24
|
+
setTheme = setCurrent,
|
|
25
|
+
}
|
|
26
|
+
end, { current })
|
|
27
|
+
return React.createElement(ThemeContext.Provider, {
|
|
28
|
+
value = value,
|
|
29
|
+
}, children)
|
|
24
30
|
end
|
|
25
31
|
local default = ThemeProvider
|
|
26
32
|
return {
|
|
33
|
+
ThemeContext = ThemeContext,
|
|
27
34
|
default = default,
|
|
28
35
|
}
|