@rbxts/uiblox 0.2.0-alpha.36 → 0.2.0-alpha.5
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/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 -5
- package/out/ui/packages/chip/components/Chip.luau +16 -25
- package/out/ui/packages/chip/components/Chip.styles.d.ts +0 -5
- package/out/ui/packages/chip/components/Chip.styles.luau +13 -30
- 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/formText/components/FormHelperText.luau +16 -12
- package/out/ui/packages/formText/components/FormLabel.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 -6
- package/out/ui/packages/init.luau +0 -18
- 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/components/Stack.d.ts +0 -2
- package/out/ui/packages/layout/components/Stack.luau +15 -10
- package/out/ui/packages/layout/components/Stack.styles.d.ts +0 -2
- package/out/ui/packages/layout/components/Stack.styles.luau +5 -34
- package/out/ui/packages/layout/components/stackAlign.d.ts +2 -4
- package/out/ui/packages/layout/components/stackAlign.luau +2 -16
- package/out/ui/packages/layout/index.d.ts +0 -11
- package/out/ui/packages/layout/init.luau +0 -4
- 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 -4
- package/out/ui/packages/menu/components/Menu.luau +15 -32
- 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.luau +55 -15
- 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/speedDial/components/SpeedDial.d.ts +0 -2
- package/out/ui/packages/speedDial/components/SpeedDial.luau +20 -25
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +1 -4
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +4 -9
- package/out/ui/packages/speedDial/index.d.ts +0 -1
- 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 +997 -793
- 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/EmptyListHint.d.ts +1 -2
- package/out/ui/packages/virtualList/components/EmptyListHint.luau +4 -15
- package/out/ui/packages/virtualList/components/VirtualList.luau +16 -9
- 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/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/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/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/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
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
|
|
5
|
-
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
5
|
local useAlertStyles = TS.import(script, script.Parent, "Alert.styles").default
|
|
7
6
|
local function Alert(props)
|
|
8
7
|
local _binding = props
|
|
@@ -10,69 +9,47 @@ local function Alert(props)
|
|
|
10
9
|
local title = _binding.title
|
|
11
10
|
local message = _binding.message
|
|
12
11
|
local onClose = _binding.onClose
|
|
13
|
-
local filled = _binding.filled
|
|
14
|
-
local square = _binding.square
|
|
15
12
|
local className = _binding.className
|
|
16
13
|
local sx = _binding.sx
|
|
17
14
|
local id = _binding.id
|
|
18
15
|
local ref = _binding.ref
|
|
19
|
-
local dismissible = onClose ~= nil
|
|
20
16
|
local styles = useAlertStyles({
|
|
21
17
|
severity = severity,
|
|
22
|
-
dismissible = dismissible,
|
|
23
|
-
filled = filled,
|
|
24
18
|
})
|
|
25
|
-
local _attributes = {
|
|
26
|
-
tag = "frame",
|
|
27
|
-
}
|
|
19
|
+
local _attributes = {}
|
|
28
20
|
local _condition = id
|
|
29
21
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
30
22
|
_condition = "Alert"
|
|
31
23
|
end
|
|
32
24
|
_attributes.key = _condition
|
|
33
|
-
_attributes.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
_attributes.sx = sx
|
|
37
|
-
local _attributes_1 = table.clone(styles.padding)
|
|
38
|
-
setmetatable(_attributes_1, nil)
|
|
39
|
-
local _exp = React.createElement("uipadding", _attributes_1)
|
|
40
|
-
local _condition_1 = square ~= true
|
|
41
|
-
if _condition_1 then
|
|
42
|
-
local _attributes_2 = table.clone(styles.corner)
|
|
43
|
-
setmetatable(_attributes_2, nil)
|
|
44
|
-
_condition_1 = React.createElement("uicorner", _attributes_2)
|
|
25
|
+
_attributes.ref = ref
|
|
26
|
+
for _k, _v in styles.root do
|
|
27
|
+
_attributes[_k] = _v
|
|
45
28
|
end
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
local _condition_2 = dismissible
|
|
50
|
-
if _condition_2 then
|
|
51
|
-
local _attributes_3 = {
|
|
52
|
-
key = "Close",
|
|
53
|
-
}
|
|
54
|
-
for _k, _v in styles.close do
|
|
55
|
-
_attributes_3[_k] = _v
|
|
29
|
+
if className then
|
|
30
|
+
for _k, _v in className do
|
|
31
|
+
_attributes[_k] = _v
|
|
56
32
|
end
|
|
57
|
-
_attributes_3.Image = tostring(Icons.Close)
|
|
58
|
-
_attributes_3.Event = {
|
|
59
|
-
Activated = function()
|
|
60
|
-
return onClose()
|
|
61
|
-
end,
|
|
62
|
-
}
|
|
63
|
-
_condition_2 = (React.createElement("imagebutton", _attributes_3))
|
|
64
33
|
end
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
_attributes_3[_k] = _v
|
|
34
|
+
if sx then
|
|
35
|
+
for _k, _v in sx do
|
|
36
|
+
_attributes[_k] = _v
|
|
37
|
+
end
|
|
70
38
|
end
|
|
39
|
+
local _attributes_1 = table.clone(styles.padding)
|
|
40
|
+
setmetatable(_attributes_1, nil)
|
|
41
|
+
local _exp = React.createElement("uipadding", _attributes_1)
|
|
42
|
+
local _attributes_2 = table.clone(styles.corner)
|
|
43
|
+
setmetatable(_attributes_2, nil)
|
|
44
|
+
local _exp_1 = React.createElement("uicorner", _attributes_2)
|
|
45
|
+
local _attributes_3 = table.clone(styles.stroke)
|
|
46
|
+
setmetatable(_attributes_3, nil)
|
|
47
|
+
local _exp_2 = React.createElement("uistroke", _attributes_3)
|
|
71
48
|
local _attributes_4 = table.clone(styles.layout)
|
|
72
49
|
setmetatable(_attributes_4, nil)
|
|
73
|
-
local
|
|
74
|
-
local
|
|
75
|
-
if
|
|
50
|
+
local _exp_3 = React.createElement("uilistlayout", _attributes_4)
|
|
51
|
+
local _condition_1 = title ~= nil and title ~= ""
|
|
52
|
+
if _condition_1 then
|
|
76
53
|
local _attributes_5 = {
|
|
77
54
|
key = "Title",
|
|
78
55
|
}
|
|
@@ -80,7 +57,7 @@ local function Alert(props)
|
|
|
80
57
|
_attributes_5[_k] = _v
|
|
81
58
|
end
|
|
82
59
|
_attributes_5.Text = title
|
|
83
|
-
|
|
60
|
+
_condition_1 = React.createElement("textlabel", _attributes_5)
|
|
84
61
|
end
|
|
85
62
|
local _attributes_5 = {
|
|
86
63
|
key = "Message",
|
|
@@ -89,7 +66,24 @@ local function Alert(props)
|
|
|
89
66
|
_attributes_5[_k] = _v
|
|
90
67
|
end
|
|
91
68
|
_attributes_5.Text = message
|
|
92
|
-
|
|
69
|
+
local _exp_4 = React.createElement("textlabel", _attributes_5)
|
|
70
|
+
local _condition_2 = onClose ~= nil
|
|
71
|
+
if _condition_2 then
|
|
72
|
+
local _attributes_6 = {
|
|
73
|
+
key = "Close",
|
|
74
|
+
}
|
|
75
|
+
for _k, _v in styles.close do
|
|
76
|
+
_attributes_6[_k] = _v
|
|
77
|
+
end
|
|
78
|
+
_attributes_6.Image = tostring(Icons.Close)
|
|
79
|
+
_attributes_6.Event = {
|
|
80
|
+
Activated = function()
|
|
81
|
+
return onClose()
|
|
82
|
+
end,
|
|
83
|
+
}
|
|
84
|
+
_condition_2 = (React.createElement("imagebutton", _attributes_6))
|
|
85
|
+
end
|
|
86
|
+
return React.createElement("frame", _attributes, _exp, _exp_1, _exp_2, _exp_3, _condition_1, _exp_4, _condition_2)
|
|
93
87
|
end
|
|
94
88
|
local default = Alert
|
|
95
89
|
return {
|
|
@@ -6,15 +6,12 @@ local createStyles = _theme.createStyles
|
|
|
6
6
|
local alertSeverity = TS.import(script, script.Parent, "alertTone").alertSeverity
|
|
7
7
|
local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
8
8
|
local severity = _param.severity
|
|
9
|
-
local dismissible = _param.dismissible
|
|
10
|
-
local filled = _param.filled
|
|
11
9
|
local tone = theme.palette.status[alertSeverity(severity)]
|
|
12
|
-
local closeSize = theme.spacing.calc(2)
|
|
13
10
|
local _object = {
|
|
14
11
|
root = {
|
|
15
12
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
16
13
|
Size = UDim2.new(1, 0, 0, 0),
|
|
17
|
-
BackgroundColor3 =
|
|
14
|
+
BackgroundColor3 = tone.surface,
|
|
18
15
|
BorderSizePixel = 0,
|
|
19
16
|
},
|
|
20
17
|
padding = {
|
|
@@ -27,17 +24,11 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
|
27
24
|
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
28
25
|
},
|
|
29
26
|
stroke = {
|
|
30
|
-
Color =
|
|
27
|
+
Color = tone.border,
|
|
31
28
|
Thickness = 1,
|
|
32
|
-
Transparency =
|
|
29
|
+
Transparency = 0,
|
|
33
30
|
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
34
31
|
},
|
|
35
|
-
body = {
|
|
36
|
-
AutomaticSize = Enum.AutomaticSize.Y,
|
|
37
|
-
Size = UDim2.new(1, if dismissible == true then -(closeSize + theme.padding.calc(1)) else 0, 0, 0),
|
|
38
|
-
BackgroundTransparency = 1,
|
|
39
|
-
BorderSizePixel = 0,
|
|
40
|
-
},
|
|
41
32
|
layout = {
|
|
42
33
|
FillDirection = Enum.FillDirection.Vertical,
|
|
43
34
|
HorizontalAlignment = Enum.HorizontalAlignment.Left,
|
|
@@ -52,7 +43,7 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
|
52
43
|
BorderSizePixel = 0,
|
|
53
44
|
Font = theme.typography.fontFamilies.default,
|
|
54
45
|
TextSize = theme.typography.fontSizes.body,
|
|
55
|
-
TextColor3 =
|
|
46
|
+
TextColor3 = tone.main,
|
|
56
47
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
57
48
|
LayoutOrder = 1,
|
|
58
49
|
},
|
|
@@ -71,18 +62,18 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
|
71
62
|
_condition = theme.typography.fontSizes.body
|
|
72
63
|
end
|
|
73
64
|
_object_1[_left_1] = _condition
|
|
74
|
-
_object_1.TextColor3 =
|
|
65
|
+
_object_1.TextColor3 = theme.palette.text.primary
|
|
75
66
|
_object_1.TextXAlignment = Enum.TextXAlignment.Left
|
|
76
67
|
_object_1.TextWrapped = true
|
|
77
68
|
_object_1.LayoutOrder = 2
|
|
78
69
|
_object[_left] = _object_1
|
|
79
70
|
_object.close = {
|
|
80
|
-
Size = UDim2.fromOffset(
|
|
81
|
-
Position = UDim2.new(1,
|
|
71
|
+
Size = UDim2.fromOffset(theme.spacing.calc(2), theme.spacing.calc(2)),
|
|
72
|
+
Position = UDim2.new(1, -theme.padding.calc(1), 0, theme.padding.calc(1)),
|
|
82
73
|
AnchorPoint = Vector2.new(1, 0),
|
|
83
74
|
BackgroundTransparency = 1,
|
|
84
75
|
BorderSizePixel = 0,
|
|
85
|
-
ImageColor3 =
|
|
76
|
+
ImageColor3 = theme.palette.text.secondary,
|
|
86
77
|
ScaleType = Enum.ScaleType.Fit,
|
|
87
78
|
ZIndex = 2,
|
|
88
79
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
2
|
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
-
import {
|
|
3
|
+
import { AppBarElevation } from "./AppBar.styles";
|
|
4
4
|
export interface AppBarProps {
|
|
5
5
|
title?: string;
|
|
6
6
|
elevation?: AppBarElevation;
|
|
7
|
-
color?: AppBarColor;
|
|
8
7
|
children?: React.ReactNode;
|
|
9
8
|
}
|
|
10
9
|
declare function AppBar(props: CustomizedProps<Frame, AppBarProps>): JSX.Element;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local Shadow = TS.import(script, script.Parent.Parent.Parent, "shadow").Shadow
|
|
5
|
-
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
5
|
local useAppBarStyles = TS.import(script, script.Parent, "AppBar.styles").default
|
|
7
6
|
local function AppBar(props)
|
|
8
7
|
local _binding = props
|
|
@@ -14,73 +13,63 @@ local function AppBar(props)
|
|
|
14
13
|
if elevation == nil then
|
|
15
14
|
elevation = "raised"
|
|
16
15
|
end
|
|
17
|
-
local color = _binding.color
|
|
18
|
-
if color == nil then
|
|
19
|
-
color = "default"
|
|
20
|
-
end
|
|
21
16
|
local children = _binding.children
|
|
22
17
|
local className = _binding.className
|
|
23
18
|
local sx = _binding.sx
|
|
24
19
|
local id = _binding.id
|
|
25
20
|
local ref = _binding.ref
|
|
26
|
-
local hasActions = children ~= nil
|
|
27
21
|
local styles = useAppBarStyles({
|
|
28
22
|
elevation = elevation,
|
|
29
|
-
|
|
30
|
-
hasActions = hasActions,
|
|
23
|
+
hasActions = children ~= nil,
|
|
31
24
|
})
|
|
32
|
-
local
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
local _attributes = {}
|
|
26
|
+
local _condition = id
|
|
27
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
28
|
+
_condition = "AppBar"
|
|
29
|
+
end
|
|
30
|
+
_attributes.key = _condition
|
|
31
|
+
_attributes.ref = ref
|
|
32
|
+
for _k, _v in styles.root do
|
|
33
|
+
_attributes[_k] = _v
|
|
34
|
+
end
|
|
35
|
+
if className then
|
|
36
|
+
for _k, _v in className do
|
|
38
37
|
_attributes[_k] = _v
|
|
39
38
|
end
|
|
40
|
-
_attributes.Text = title
|
|
41
|
-
_condition = React.createElement("textlabel", _attributes)
|
|
42
39
|
end
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
local _condition_1 = id
|
|
48
|
-
if not (_condition_1 ~= 0 and _condition_1 == _condition_1 and _condition_1 ~= "" and _condition_1) then
|
|
49
|
-
_condition_1 = "AppBar"
|
|
40
|
+
if sx then
|
|
41
|
+
for _k, _v in sx do
|
|
42
|
+
_attributes[_k] = _v
|
|
43
|
+
end
|
|
50
44
|
end
|
|
51
|
-
_attributes.key = _condition_1
|
|
52
|
-
_attributes.hostRef = ref
|
|
53
|
-
_attributes.base = styles.root
|
|
54
|
-
_attributes.className = className
|
|
55
|
-
_attributes.sx = sx
|
|
56
45
|
local _attributes_1 = table.clone(styles.padding)
|
|
57
46
|
setmetatable(_attributes_1, nil)
|
|
58
47
|
local _exp = React.createElement("uipadding", _attributes_1)
|
|
59
48
|
local _exp_1 = elevation == "raised" and React.createElement(Shadow)
|
|
60
|
-
local
|
|
61
|
-
if
|
|
62
|
-
local _attributes_2 =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
49
|
+
local _condition_1 = title ~= ""
|
|
50
|
+
if _condition_1 then
|
|
51
|
+
local _attributes_2 = {
|
|
52
|
+
key = "Title",
|
|
53
|
+
}
|
|
54
|
+
for _k, _v in styles.title do
|
|
55
|
+
_attributes_2[_k] = _v
|
|
56
|
+
end
|
|
57
|
+
_attributes_2.Text = title
|
|
58
|
+
_condition_1 = React.createElement("textlabel", _attributes_2)
|
|
59
|
+
end
|
|
60
|
+
local _condition_2 = children ~= nil
|
|
61
|
+
if _condition_2 then
|
|
62
|
+
local _attributes_2 = {
|
|
67
63
|
key = "Actions",
|
|
68
64
|
}
|
|
69
65
|
for _k, _v in styles.actions do
|
|
70
|
-
|
|
66
|
+
_attributes_2[_k] = _v
|
|
71
67
|
end
|
|
72
|
-
local
|
|
73
|
-
setmetatable(
|
|
74
|
-
|
|
75
|
-
key = "Row",
|
|
76
|
-
Size = UDim2.fromScale(1, 1),
|
|
77
|
-
BackgroundTransparency = 1,
|
|
78
|
-
BorderSizePixel = 0,
|
|
79
|
-
}, _exp_2, _exp_3, React.createElement("frame", _attributes_3, React.createElement("uilistlayout", _attributes_4), children)))
|
|
80
|
-
else
|
|
81
|
-
_result = titleLabel
|
|
68
|
+
local _attributes_3 = table.clone(styles.actionsLayout)
|
|
69
|
+
setmetatable(_attributes_3, nil)
|
|
70
|
+
_condition_2 = (React.createElement("frame", _attributes_2, React.createElement("uilistlayout", _attributes_3), children))
|
|
82
71
|
end
|
|
83
|
-
return React.createElement(
|
|
72
|
+
return React.createElement("frame", _attributes, _exp, _exp_1, _condition_1, _condition_2)
|
|
84
73
|
end
|
|
85
74
|
local default = AppBar
|
|
86
75
|
return {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export type AppBarElevation = "flat" | "raised";
|
|
2
|
-
export type AppBarColor = "default" | "primary";
|
|
3
2
|
declare const useAppBarStyles: (props: {
|
|
4
3
|
elevation?: AppBarElevation;
|
|
5
|
-
color?: AppBarColor;
|
|
6
4
|
hasActions?: boolean;
|
|
7
5
|
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
8
6
|
export default useAppBarStyles;
|
|
@@ -8,10 +8,6 @@ local useAppBarStyles = componentStyles("AppBar", function(theme, _param)
|
|
|
8
8
|
if elevation == nil then
|
|
9
9
|
elevation = "raised"
|
|
10
10
|
end
|
|
11
|
-
local color = _param.color
|
|
12
|
-
if color == nil then
|
|
13
|
-
color = "default"
|
|
14
|
-
end
|
|
15
11
|
local hasActions = _param.hasActions
|
|
16
12
|
if hasActions == nil then
|
|
17
13
|
hasActions = false
|
|
@@ -19,7 +15,7 @@ local useAppBarStyles = componentStyles("AppBar", function(theme, _param)
|
|
|
19
15
|
local _object = {
|
|
20
16
|
root = {
|
|
21
17
|
Size = UDim2.new(1, 0, 0, theme.spacing.calc(7)),
|
|
22
|
-
BackgroundColor3 = if
|
|
18
|
+
BackgroundColor3 = if elevation == "raised" then theme.palette.surface.elevated else theme.palette.surface.paper,
|
|
23
19
|
BorderSizePixel = 0,
|
|
24
20
|
ZIndex = 11000,
|
|
25
21
|
},
|
|
@@ -27,18 +23,10 @@ local useAppBarStyles = componentStyles("AppBar", function(theme, _param)
|
|
|
27
23
|
PaddingLeft = UDim.new(0, theme.padding.calc(2)),
|
|
28
24
|
PaddingRight = UDim.new(0, theme.padding.calc(2)),
|
|
29
25
|
},
|
|
30
|
-
row = {
|
|
31
|
-
FillDirection = Enum.FillDirection.Horizontal,
|
|
32
|
-
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
33
|
-
HorizontalFlex = Enum.UIFlexAlignment.SpaceBetween,
|
|
34
|
-
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
35
|
-
},
|
|
36
26
|
}
|
|
37
27
|
local _left = "title"
|
|
38
28
|
local _object_1 = {
|
|
39
|
-
|
|
40
|
-
AutomaticSize = if hasActions then Enum.AutomaticSize.X else Enum.AutomaticSize.None,
|
|
41
|
-
Size = if hasActions then UDim2.new(0, 0, 1, 0) else UDim2.new(1, 0, 1, 0),
|
|
29
|
+
Size = UDim2.new(1, if hasActions then -theme.spacing.calc(8) else 0, 1, 0),
|
|
42
30
|
BackgroundTransparency = 1,
|
|
43
31
|
BorderSizePixel = 0,
|
|
44
32
|
Font = theme.typography.fontFamilies.default,
|
|
@@ -49,15 +37,16 @@ local useAppBarStyles = componentStyles("AppBar", function(theme, _param)
|
|
|
49
37
|
_condition = theme.typography.fontSizes.body
|
|
50
38
|
end
|
|
51
39
|
_object_1[_left_1] = _condition
|
|
52
|
-
_object_1.TextColor3 =
|
|
40
|
+
_object_1.TextColor3 = theme.palette.text.primary
|
|
53
41
|
_object_1.TextXAlignment = Enum.TextXAlignment.Left
|
|
54
42
|
_object_1.TextYAlignment = Enum.TextYAlignment.Center
|
|
55
43
|
_object_1.TextTruncate = Enum.TextTruncate.AtEnd
|
|
56
44
|
_object[_left] = _object_1
|
|
57
45
|
_object.actions = {
|
|
58
|
-
LayoutOrder = 2,
|
|
59
46
|
AutomaticSize = Enum.AutomaticSize.X,
|
|
60
47
|
Size = UDim2.new(0, 0, 1, 0),
|
|
48
|
+
Position = UDim2.new(1, 0, 0, 0),
|
|
49
|
+
AnchorPoint = Vector2.new(1, 0),
|
|
61
50
|
BackgroundTransparency = 1,
|
|
62
51
|
BorderSizePixel = 0,
|
|
63
52
|
ZIndex = 2,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
-
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
5
4
|
local Input = TS.import(script, script.Parent.Parent.Parent, "input").Input
|
|
6
5
|
local useAssetFieldStyles = TS.import(script, script.Parent, "AssetField.styles").default
|
|
7
6
|
local assetPreviewUri = TS.import(script, script.Parent, "assetPreviewUri").assetPreviewUri
|
|
@@ -24,21 +23,26 @@ local function AssetField(props)
|
|
|
24
23
|
local ref = _binding.ref
|
|
25
24
|
local styles = useAssetFieldStyles()
|
|
26
25
|
local uri = if preview == true then assetPreviewUri(value) else nil
|
|
27
|
-
local _attributes = {
|
|
28
|
-
tag = "frame",
|
|
29
|
-
}
|
|
26
|
+
local _attributes = {}
|
|
30
27
|
local _condition = id
|
|
31
28
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
32
29
|
_condition = "AssetField"
|
|
33
30
|
end
|
|
34
31
|
_attributes.key = _condition
|
|
35
|
-
_attributes.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
_attributes.ref = ref
|
|
33
|
+
for _k, _v in styles.root do
|
|
34
|
+
_attributes[_k] = _v
|
|
35
|
+
end
|
|
36
|
+
if className then
|
|
37
|
+
for _k, _v in className do
|
|
38
|
+
_attributes[_k] = _v
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
if sx then
|
|
42
|
+
for _k, _v in sx do
|
|
43
|
+
_attributes[_k] = _v
|
|
44
|
+
end
|
|
45
|
+
end
|
|
42
46
|
local _attributes_1 = table.clone(styles.list)
|
|
43
47
|
setmetatable(_attributes_1, nil)
|
|
44
48
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
@@ -63,7 +67,7 @@ local function AssetField(props)
|
|
|
63
67
|
setmetatable(_attributes_3, nil)
|
|
64
68
|
_condition_1 = (React.createElement("imagelabel", _attributes_2, React.createElement("uicorner", _attributes_3)))
|
|
65
69
|
end
|
|
66
|
-
return React.createElement(
|
|
70
|
+
return React.createElement("frame", _attributes, _exp, _exp_1, _condition_1)
|
|
67
71
|
end
|
|
68
72
|
local default = AssetField
|
|
69
73
|
return {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
-
import { AvatarVariant } from "./Avatar.styles";
|
|
3
2
|
export interface AvatarProps {
|
|
4
3
|
name?: string;
|
|
5
4
|
image?: string;
|
|
6
5
|
size?: number;
|
|
7
|
-
variant?: AvatarVariant;
|
|
8
6
|
}
|
|
9
7
|
declare function Avatar(props: CustomizedProps<Frame, AvatarProps>): JSX.Element;
|
|
10
8
|
export default Avatar;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local avatarInitials = TS.import(script, script.Parent, "avatarText").avatarInitials
|
|
5
|
-
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
5
|
local useAvatarStyles = TS.import(script, script.Parent, "Avatar.styles").default
|
|
7
6
|
local function Avatar(props)
|
|
8
7
|
local _binding = props
|
|
@@ -12,57 +11,57 @@ local function Avatar(props)
|
|
|
12
11
|
end
|
|
13
12
|
local image = _binding.image
|
|
14
13
|
local size = _binding.size
|
|
15
|
-
local variant = _binding.variant
|
|
16
|
-
if variant == nil then
|
|
17
|
-
variant = "circular"
|
|
18
|
-
end
|
|
19
14
|
local className = _binding.className
|
|
20
15
|
local sx = _binding.sx
|
|
21
16
|
local id = _binding.id
|
|
22
17
|
local ref = _binding.ref
|
|
23
18
|
local styles = useAvatarStyles({
|
|
24
19
|
size = size,
|
|
25
|
-
variant = variant,
|
|
26
20
|
})
|
|
27
|
-
local _attributes = {
|
|
28
|
-
tag = "frame",
|
|
29
|
-
}
|
|
21
|
+
local _attributes = {}
|
|
30
22
|
local _condition = id
|
|
31
23
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
32
24
|
_condition = "Avatar"
|
|
33
25
|
end
|
|
34
26
|
_attributes.key = _condition
|
|
35
|
-
_attributes.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
_attributes.ref = ref
|
|
28
|
+
for _k, _v in styles.root do
|
|
29
|
+
_attributes[_k] = _v
|
|
30
|
+
end
|
|
31
|
+
if className then
|
|
32
|
+
for _k, _v in className do
|
|
33
|
+
_attributes[_k] = _v
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
if sx then
|
|
37
|
+
for _k, _v in sx do
|
|
38
|
+
_attributes[_k] = _v
|
|
39
|
+
end
|
|
44
40
|
end
|
|
41
|
+
local _attributes_1 = table.clone(styles.corner)
|
|
42
|
+
setmetatable(_attributes_1, nil)
|
|
43
|
+
local _exp = React.createElement("uicorner", _attributes_1)
|
|
45
44
|
local _result
|
|
46
45
|
if image ~= nil then
|
|
47
|
-
local
|
|
46
|
+
local _attributes_2 = {
|
|
48
47
|
key = "Image",
|
|
49
48
|
}
|
|
50
49
|
for _k, _v in styles.image do
|
|
51
|
-
|
|
50
|
+
_attributes_2[_k] = _v
|
|
52
51
|
end
|
|
53
|
-
|
|
54
|
-
_result = (React.createElement("imagelabel",
|
|
52
|
+
_attributes_2.Image = image
|
|
53
|
+
_result = (React.createElement("imagelabel", _attributes_2))
|
|
55
54
|
else
|
|
56
|
-
local
|
|
55
|
+
local _attributes_2 = {
|
|
57
56
|
key = "Initials",
|
|
58
57
|
}
|
|
59
58
|
for _k, _v in styles.text do
|
|
60
|
-
|
|
59
|
+
_attributes_2[_k] = _v
|
|
61
60
|
end
|
|
62
|
-
|
|
63
|
-
_result = (React.createElement("textlabel",
|
|
61
|
+
_attributes_2.Text = avatarInitials(name)
|
|
62
|
+
_result = (React.createElement("textlabel", _attributes_2))
|
|
64
63
|
end
|
|
65
|
-
return React.createElement(
|
|
64
|
+
return React.createElement("frame", _attributes, _exp, _result)
|
|
66
65
|
end
|
|
67
66
|
local default = Avatar
|
|
68
67
|
return {
|
|
@@ -8,10 +8,6 @@ local useAvatarStyles = componentStyles("Avatar", function(theme, _param)
|
|
|
8
8
|
if size == nil then
|
|
9
9
|
size = 40
|
|
10
10
|
end
|
|
11
|
-
local variant = _param.variant
|
|
12
|
-
if variant == nil then
|
|
13
|
-
variant = "circular"
|
|
14
|
-
end
|
|
15
11
|
return createStyles({
|
|
16
12
|
root = {
|
|
17
13
|
Size = UDim2.fromOffset(size, size),
|
|
@@ -33,7 +29,7 @@ local useAvatarStyles = componentStyles("Avatar", function(theme, _param)
|
|
|
33
29
|
TextColor3 = theme.palette.primary.on,
|
|
34
30
|
},
|
|
35
31
|
corner = {
|
|
36
|
-
CornerRadius =
|
|
32
|
+
CornerRadius = UDim.new(1, 0),
|
|
37
33
|
},
|
|
38
34
|
})
|
|
39
35
|
end)
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
2
|
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
-
import { BadgeColor } from "./Badge.styles";
|
|
4
3
|
export interface BadgeProps {
|
|
5
4
|
count?: number;
|
|
6
5
|
max?: number;
|
|
7
6
|
invisible?: boolean;
|
|
8
|
-
variant?: "standard" | "dot";
|
|
9
|
-
color?: BadgeColor;
|
|
10
7
|
children?: React.ReactNode;
|
|
11
8
|
}
|
|
12
9
|
declare function Badge(props: CustomizedProps<Frame, BadgeProps>): JSX.Element;
|