@rbxts/uiblox 0.2.0-alpha.3 → 0.2.0-alpha.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -109
- package/out/hooks/index.d.ts +1 -0
- package/out/hooks/init.luau +3 -0
- package/out/hooks/useBreakpoints.luau +2 -11
- package/out/hooks/viewportObserver.d.ts +10 -0
- package/out/hooks/viewportObserver.luau +75 -0
- package/out/theme/interfaces/theme/Theme.d.ts +15 -0
- package/out/theme/styles/utilities/componentStyles.luau +45 -3
- package/out/theme/styles/utilities/componentTheme.d.ts +15 -0
- package/out/theme/styles/utilities/index.d.ts +2 -0
- package/out/theme/styles/utilities/init.luau +7 -0
- package/out/theme/styles/utilities/resolveStyle.d.ts +10 -2
- package/out/theme/styles/utilities/resolveStyle.luau +7 -3
- package/out/theme/styles/utilities/resolveSx.d.ts +110 -0
- package/out/theme/styles/utilities/resolveSx.luau +479 -0
- package/out/theme/styles/utilities/styleCache.d.ts +2 -0
- package/out/theme/styles/utilities/styleCache.luau +9 -0
- package/out/ui/packages/accordion/components/Accordion.d.ts +2 -0
- package/out/ui/packages/accordion/components/Accordion.luau +46 -30
- package/out/ui/packages/accordion/components/Accordion.styles.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.styles.luau +16 -4
- package/out/ui/packages/accordion/components/accordionOpen.d.ts +1 -0
- package/out/ui/packages/accordion/components/accordionOpen.luau +4 -0
- package/out/ui/packages/alert/components/Alert.d.ts +2 -0
- package/out/ui/packages/alert/components/Alert.luau +48 -42
- package/out/ui/packages/alert/components/Alert.styles.d.ts +2 -0
- package/out/ui/packages/alert/components/Alert.styles.luau +17 -8
- package/out/ui/packages/appBar/components/AppBar.d.ts +2 -1
- package/out/ui/packages/appBar/components/AppBar.luau +47 -36
- package/out/ui/packages/appBar/components/AppBar.styles.d.ts +2 -0
- package/out/ui/packages/appBar/components/AppBar.styles.luau +16 -5
- package/out/ui/packages/assetField/components/AssetField.luau +12 -16
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +8 -0
- package/out/ui/packages/avatar/components/Avatar.d.ts +2 -0
- package/out/ui/packages/avatar/components/Avatar.luau +27 -26
- package/out/ui/packages/avatar/components/Avatar.styles.d.ts +2 -0
- package/out/ui/packages/avatar/components/Avatar.styles.luau +5 -1
- package/out/ui/packages/backdrop/components/Backdrop.d.ts +10 -0
- package/out/ui/packages/backdrop/components/Backdrop.luau +51 -0
- package/out/ui/packages/backdrop/components/Backdrop.styles.d.ts +4 -0
- package/out/ui/packages/backdrop/components/Backdrop.styles.luau +24 -0
- package/out/ui/packages/backdrop/index.d.ts +2 -0
- package/out/ui/packages/backdrop/init.luau +5 -0
- package/out/ui/packages/badge/components/Badge.d.ts +3 -0
- package/out/ui/packages/badge/components/Badge.luau +32 -24
- package/out/ui/packages/badge/components/Badge.styles.d.ts +5 -1
- package/out/ui/packages/badge/components/Badge.styles.luau +20 -8
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +1 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +20 -18
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.d.ts +3 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +6 -2
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +67 -40
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +9 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +68 -0
- package/out/ui/packages/breadcrumbs/index.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/init.luau +3 -0
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +12 -16
- package/out/ui/packages/button/components/Button.luau +28 -22
- package/out/ui/packages/card/components/Card.d.ts +3 -1
- package/out/ui/packages/card/components/Card.luau +10 -0
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +75 -53
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +26 -9
- package/out/ui/packages/checkbox/components/Checkbox.luau +16 -16
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
- package/out/ui/packages/chip/components/Chip.d.ts +6 -1
- package/out/ui/packages/chip/components/Chip.luau +61 -17
- package/out/ui/packages/chip/components/Chip.styles.d.ts +6 -0
- package/out/ui/packages/chip/components/Chip.styles.luau +54 -9
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +29 -18
- package/out/ui/packages/colorPicker/components/ColorPicker.luau +16 -20
- package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +34 -20
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +34 -35
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +65 -62
- package/out/ui/packages/dialog/components/Dialog.d.ts +3 -2
- package/out/ui/packages/dialog/components/Dialog.luau +41 -21
- package/out/ui/packages/divider/components/Divider.d.ts +1 -0
- package/out/ui/packages/divider/components/Divider.luau +52 -17
- package/out/ui/packages/divider/components/Divider.styles.luau +32 -0
- package/out/ui/packages/divider/components/dividerLabel.d.ts +1 -0
- package/out/ui/packages/divider/components/dividerLabel.luau +10 -0
- package/out/ui/packages/drawer/components/Drawer.d.ts +3 -1
- package/out/ui/packages/drawer/components/Drawer.luau +71 -37
- package/out/ui/packages/drawer/components/Drawer.styles.d.ts +3 -1
- package/out/ui/packages/drawer/components/Drawer.styles.luau +3 -2
- package/out/ui/packages/fab/components/Fab.d.ts +3 -0
- package/out/ui/packages/fab/components/Fab.luau +79 -37
- package/out/ui/packages/fab/components/Fab.styles.d.ts +3 -0
- package/out/ui/packages/fab/components/Fab.styles.luau +39 -3
- package/out/ui/packages/fab/components/fabSize.d.ts +1 -0
- package/out/ui/packages/fab/components/fabSize.luau +4 -0
- package/out/ui/packages/fab/index.d.ts +1 -1
- package/out/ui/packages/fab/init.luau +1 -0
- package/out/ui/packages/fontEditor/components/FontEditor.luau +12 -16
- package/out/ui/packages/formText/components/FormHelperText.d.ts +8 -0
- package/out/ui/packages/formText/components/FormHelperText.luau +40 -0
- package/out/ui/packages/formText/components/FormLabel.d.ts +9 -0
- package/out/ui/packages/formText/components/FormLabel.luau +42 -0
- package/out/ui/packages/formText/components/FormText.styles.d.ts +5 -0
- package/out/ui/packages/formText/components/FormText.styles.luau +33 -0
- package/out/ui/packages/formText/index.d.ts +4 -0
- package/out/ui/packages/formText/init.luau +6 -0
- package/out/ui/packages/gradientEditor/components/GradientEditor.luau +56 -42
- package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +37 -4
- package/out/ui/packages/host/components/SxHost.d.ts +18 -0
- package/out/ui/packages/host/components/SxHost.luau +202 -0
- package/out/ui/packages/host/hostPaint.d.ts +11 -0
- package/out/ui/packages/host/hostPaint.luau +33 -0
- package/out/ui/packages/host/hostRules.d.ts +15 -0
- package/out/ui/packages/host/hostRules.luau +92 -0
- package/out/ui/packages/host/index.d.ts +3 -0
- package/out/ui/packages/host/init.luau +13 -0
- package/out/ui/packages/icon/components/Icon.luau +9 -16
- package/out/ui/packages/iconButton/components/IconButton.luau +22 -17
- package/out/ui/packages/iconButton/components/IconButton.styles.luau +3 -0
- package/out/ui/packages/imageList/components/ImageList.d.ts +14 -0
- package/out/ui/packages/imageList/components/ImageList.luau +93 -0
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +6 -0
- package/out/ui/packages/imageList/components/ImageList.styles.luau +73 -0
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +4 -0
- package/out/ui/packages/imageList/components/imageListLayout.luau +31 -0
- package/out/ui/packages/imageList/index.d.ts +2 -0
- package/out/ui/packages/imageList/init.luau +5 -0
- package/out/ui/packages/index.d.ts +8 -0
- package/out/ui/packages/init.luau +24 -0
- package/out/ui/packages/input/components/Input.d.ts +1 -0
- package/out/ui/packages/input/components/Input.luau +22 -19
- package/out/ui/packages/layout/components/Box.d.ts +11 -0
- package/out/ui/packages/layout/components/Box.luau +40 -0
- package/out/ui/packages/layout/components/Box.styles.d.ts +7 -0
- package/out/ui/packages/layout/components/Box.styles.luau +34 -0
- package/out/ui/packages/layout/components/Container.d.ts +10 -0
- package/out/ui/packages/layout/components/Container.luau +45 -0
- package/out/ui/packages/layout/components/Container.styles.d.ts +6 -0
- package/out/ui/packages/layout/components/Container.styles.luau +41 -0
- package/out/ui/packages/layout/components/FlexItem.d.ts +12 -0
- package/out/ui/packages/layout/components/FlexItem.luau +40 -0
- package/out/ui/packages/layout/components/FlexItem.styles.d.ts +8 -0
- package/out/ui/packages/layout/components/FlexItem.styles.luau +66 -0
- package/out/ui/packages/layout/components/Grid.d.ts +5 -1
- package/out/ui/packages/layout/components/Grid.luau +41 -19
- package/out/ui/packages/layout/components/List.luau +9 -16
- package/out/ui/packages/layout/components/Stack.d.ts +14 -0
- package/out/ui/packages/layout/components/Stack.luau +44 -0
- package/out/ui/packages/layout/components/Stack.styles.d.ts +10 -0
- package/out/ui/packages/layout/components/Stack.styles.luau +101 -0
- package/out/ui/packages/layout/components/boxPad.d.ts +14 -0
- package/out/ui/packages/layout/components/boxPad.luau +59 -0
- package/out/ui/packages/layout/components/containerWidth.d.ts +2 -0
- package/out/ui/packages/layout/components/containerWidth.luau +17 -0
- package/out/ui/packages/layout/components/flexItemMode.d.ts +6 -0
- package/out/ui/packages/layout/components/flexItemMode.luau +36 -0
- package/out/ui/packages/layout/components/gridProps.d.ts +3 -0
- package/out/ui/packages/layout/components/gridProps.luau +20 -0
- package/out/ui/packages/layout/components/stackAlign.d.ts +10 -0
- package/out/ui/packages/layout/components/stackAlign.luau +43 -0
- package/out/ui/packages/layout/index.d.ts +14 -0
- package/out/ui/packages/layout/init.luau +5 -0
- package/out/ui/packages/link/components/Link.d.ts +11 -0
- package/out/ui/packages/link/components/Link.luau +80 -0
- package/out/ui/packages/link/components/Link.styles.d.ts +8 -0
- package/out/ui/packages/link/components/Link.styles.luau +59 -0
- package/out/ui/packages/link/index.d.ts +3 -0
- package/out/ui/packages/link/init.luau +5 -0
- package/out/ui/packages/listItem/components/ListItem.d.ts +4 -1
- package/out/ui/packages/listItem/components/ListItem.luau +44 -4
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +16 -5
- package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +7 -1
- package/out/ui/packages/loadingStroke/components/LoadingStroke.luau +23 -19
- package/out/ui/packages/loadingStroke/components/loadingStrokeSx.d.ts +11 -0
- package/out/ui/packages/loadingStroke/components/loadingStrokeSx.luau +2 -0
- package/out/ui/packages/markdown/components/Markdown.d.ts +6 -0
- package/out/ui/packages/markdown/components/Markdown.luau +221 -0
- package/out/ui/packages/markdown/components/Markdown.styles.d.ts +2 -0
- package/out/ui/packages/markdown/components/Markdown.styles.luau +101 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.d.ts +16 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.luau +315 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +6 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +132 -0
- package/out/ui/packages/markdown/htmlToMarkdown.d.ts +2 -0
- package/out/ui/packages/markdown/htmlToMarkdown.luau +350 -0
- package/out/ui/packages/markdown/index.d.ts +8 -0
- package/out/ui/packages/markdown/init.luau +11 -0
- package/out/ui/packages/markdown/parseMarkdown.d.ts +42 -0
- package/out/ui/packages/markdown/parseMarkdown.luau +459 -0
- package/out/ui/packages/menu/components/Menu.d.ts +7 -1
- package/out/ui/packages/menu/components/Menu.luau +68 -26
- package/out/ui/packages/menu/components/Menu.styles.luau +5 -1
- package/out/ui/packages/modal/components/Modal.d.ts +2 -1
- package/out/ui/packages/modal/components/Modal.luau +79 -37
- package/out/ui/packages/motion/index.d.ts +1 -1
- package/out/ui/packages/motion/init.luau +1 -0
- package/out/ui/packages/motion/unit.d.ts +5 -0
- package/out/ui/packages/motion/unit.luau +23 -0
- package/out/ui/packages/numberInput/components/NumberInput.d.ts +2 -0
- package/out/ui/packages/numberInput/components/NumberInput.luau +16 -3
- package/out/ui/packages/numberInput/components/numberValue.d.ts +1 -0
- package/out/ui/packages/numberInput/components/numberValue.luau +45 -0
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +12 -16
- package/out/ui/packages/pagination/components/Pagination.d.ts +6 -1
- package/out/ui/packages/pagination/components/Pagination.luau +62 -38
- package/out/ui/packages/pagination/components/Pagination.styles.d.ts +6 -1
- package/out/ui/packages/pagination/components/Pagination.styles.luau +36 -4
- package/out/ui/packages/pagination/components/pageRange.d.ts +2 -1
- package/out/ui/packages/pagination/components/pageRange.luau +91 -8
- package/out/ui/packages/pagination/index.d.ts +1 -0
- package/out/ui/packages/pagination/init.luau +1 -0
- package/out/ui/packages/paper/components/Paper.d.ts +4 -2
- package/out/ui/packages/paper/components/Paper.luau +31 -9
- package/out/ui/packages/paper/components/Paper.styles.d.ts +1 -1
- package/out/ui/packages/paper/components/Paper.styles.luau +6 -0
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +63 -38
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +21 -7
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +2 -0
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +14 -0
- package/out/ui/packages/popup/components/Popup.d.ts +2 -1
- package/out/ui/packages/popup/components/Popup.luau +35 -18
- package/out/ui/packages/popup/index.d.ts +1 -0
- package/out/ui/packages/popup/init.luau +1 -0
- package/out/ui/packages/preloader/components/Preloader.luau +9 -16
- package/out/ui/packages/progressBar/components/ProgressBar.luau +12 -16
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +16 -18
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +4 -1
- package/out/ui/packages/rating/components/Rating.d.ts +11 -0
- package/out/ui/packages/rating/components/Rating.luau +97 -0
- package/out/ui/packages/rating/components/Rating.styles.d.ts +6 -0
- package/out/ui/packages/rating/components/Rating.styles.luau +44 -0
- package/out/ui/packages/rating/index.d.ts +2 -0
- package/out/ui/packages/rating/init.luau +5 -0
- package/out/ui/packages/rayEditor/components/RayEditor.luau +12 -16
- package/out/ui/packages/rectEditor/components/RectEditor.luau +86 -43
- package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +30 -7
- package/out/ui/packages/select/components/Select.d.ts +5 -0
- package/out/ui/packages/select/components/Select.luau +61 -77
- package/out/ui/packages/select/components/Select.styles.luau +1 -1
- package/out/ui/packages/shadow/components/Shadow.d.ts +2 -1
- package/out/ui/packages/shadow/components/Shadow.luau +39 -17
- package/out/ui/packages/shadow/components/Shadow.styles.luau +7 -2
- package/out/ui/packages/sidebar/components/Sidebar.luau +9 -16
- package/out/ui/packages/skeleton/components/Skeleton.luau +22 -30
- package/out/ui/packages/skeleton/components/Skeleton.styles.luau +7 -2
- package/out/ui/packages/skeleton/components/skeletonMotion.luau +1 -1
- package/out/ui/packages/skeleton/components/skeletonTone.d.ts +20 -0
- package/out/ui/packages/skeleton/components/skeletonTone.luau +14 -0
- package/out/ui/packages/slider/components/Slider.d.ts +3 -0
- package/out/ui/packages/slider/components/Slider.luau +47 -19
- package/out/ui/packages/slider/components/Slider.styles.d.ts +2 -0
- package/out/ui/packages/slider/components/Slider.styles.luau +14 -1
- package/out/ui/packages/slider/components/sliderMarks.d.ts +1 -0
- package/out/ui/packages/slider/components/sliderMarks.luau +37 -0
- package/out/ui/packages/snackbar/components/Snackbar.d.ts +2 -0
- package/out/ui/packages/snackbar/components/Snackbar.luau +5 -0
- package/out/ui/packages/snackbar/components/snackbarAction.d.ts +1 -0
- package/out/ui/packages/snackbar/components/snackbarAction.luau +10 -0
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +19 -0
- package/out/ui/packages/speedDial/components/SpeedDial.luau +97 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +5 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +31 -0
- package/out/ui/packages/speedDial/index.d.ts +3 -0
- package/out/ui/packages/speedDial/init.luau +5 -0
- package/out/ui/packages/splitPane/components/SplitPane.luau +13 -17
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stateMatrix.d.ts +2 -0
- package/out/ui/packages/stateMatrix.luau +872 -881
- package/out/ui/packages/stepper/components/Stepper.d.ts +1 -0
- package/out/ui/packages/stepper/components/Stepper.luau +16 -17
- package/out/ui/packages/stepper/components/Stepper.styles.d.ts +3 -1
- package/out/ui/packages/stepper/components/Stepper.styles.luau +6 -2
- package/out/ui/packages/switch/components/Switch.d.ts +2 -0
- package/out/ui/packages/switch/components/Switch.luau +21 -16
- package/out/ui/packages/switch/components/Switch.styles.d.ts +2 -0
- package/out/ui/packages/switch/components/Switch.styles.luau +6 -1
- package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
- package/out/ui/packages/table/components/Table.d.ts +1 -0
- package/out/ui/packages/table/components/Table.luau +15 -19
- package/out/ui/packages/table/components/Table.styles.d.ts +3 -1
- package/out/ui/packages/table/components/Table.styles.luau +10 -6
- package/out/ui/packages/tabs/components/Tabs.d.ts +3 -0
- package/out/ui/packages/tabs/components/Tabs.luau +24 -19
- package/out/ui/packages/tabs/components/Tabs.styles.d.ts +5 -1
- package/out/ui/packages/tabs/components/Tabs.styles.luau +26 -10
- package/out/ui/packages/tabs/components/tabsOrientation.d.ts +2 -0
- package/out/ui/packages/tabs/components/tabsOrientation.luau +7 -0
- package/out/ui/packages/tabs/index.d.ts +1 -0
- package/out/ui/packages/tabs/init.luau +1 -0
- package/out/ui/packages/toast/components/Toast.d.ts +2 -0
- package/out/ui/packages/toast/components/Toast.luau +41 -13
- package/out/ui/packages/toast/components/Toast.styles.luau +23 -5
- package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +21 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +129 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +9 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +69 -0
- package/out/ui/packages/toggleButton/index.d.ts +2 -0
- package/out/ui/packages/toggleButton/init.luau +7 -0
- package/out/ui/packages/tooltip/components/Tooltip.luau +9 -16
- package/out/ui/packages/treeView/components/TreeView.luau +9 -16
- package/out/ui/packages/typography/components/Typography.luau +13 -14
- package/out/ui/packages/udimEditor/components/UDimEditor.luau +12 -16
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +12 -16
- package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +7 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.luau +43 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.d.ts +5 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.luau +26 -0
- package/out/ui/packages/virtualList/components/VirtualList.luau +9 -16
- package/out/ui/packages/virtualList/index.d.ts +2 -0
- package/out/ui/packages/virtualList/init.luau +1 -0
- package/package.json +2 -2
- package/out/ui/packages/select/components/selectMotion.d.ts +0 -2
- package/out/ui/packages/select/components/selectMotion.luau +0 -12
|
@@ -0,0 +1,51 @@
|
|
|
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 SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
5
|
+
local useBackdropStyles = TS.import(script, script.Parent, "Backdrop.styles").default
|
|
6
|
+
local function Backdrop(props)
|
|
7
|
+
local _binding = props
|
|
8
|
+
local open = _binding.open
|
|
9
|
+
if open == nil then
|
|
10
|
+
open = true
|
|
11
|
+
end
|
|
12
|
+
local invisible = _binding.invisible
|
|
13
|
+
local onClick = _binding.onClick
|
|
14
|
+
local children = _binding.children
|
|
15
|
+
local className = _binding.className
|
|
16
|
+
local sx = _binding.sx
|
|
17
|
+
local id = _binding.id
|
|
18
|
+
local ref = _binding.ref
|
|
19
|
+
local styles = useBackdropStyles({
|
|
20
|
+
invisible = invisible,
|
|
21
|
+
})
|
|
22
|
+
if open ~= true then
|
|
23
|
+
return nil
|
|
24
|
+
end
|
|
25
|
+
local _attributes = {
|
|
26
|
+
tag = "textbutton",
|
|
27
|
+
}
|
|
28
|
+
local _condition = id
|
|
29
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
30
|
+
_condition = "Backdrop"
|
|
31
|
+
end
|
|
32
|
+
_attributes.key = _condition
|
|
33
|
+
_attributes.hostRef = ref
|
|
34
|
+
_attributes.base = styles.root
|
|
35
|
+
_attributes.className = className
|
|
36
|
+
_attributes.sx = sx
|
|
37
|
+
_attributes.Event = {
|
|
38
|
+
Activated = function()
|
|
39
|
+
local _result = onClick
|
|
40
|
+
if _result ~= nil then
|
|
41
|
+
_result = _result()
|
|
42
|
+
end
|
|
43
|
+
return _result
|
|
44
|
+
end,
|
|
45
|
+
}
|
|
46
|
+
return React.createElement(SxHost, _attributes, children)
|
|
47
|
+
end
|
|
48
|
+
local default = Backdrop
|
|
49
|
+
return {
|
|
50
|
+
default = default,
|
|
51
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
|
+
local componentStyles = _theme.componentStyles
|
|
5
|
+
local createStyles = _theme.createStyles
|
|
6
|
+
local useBackdropStyles = componentStyles("Backdrop", function(theme, _param)
|
|
7
|
+
local invisible = _param.invisible
|
|
8
|
+
return createStyles({
|
|
9
|
+
root = {
|
|
10
|
+
Size = UDim2.fromScale(1, 1),
|
|
11
|
+
BackgroundColor3 = theme.palette.backdrop,
|
|
12
|
+
BackgroundTransparency = if invisible == true then 1 else 0.45,
|
|
13
|
+
BorderSizePixel = 0,
|
|
14
|
+
Text = "",
|
|
15
|
+
AutoButtonColor = false,
|
|
16
|
+
Selectable = false,
|
|
17
|
+
ZIndex = 30000,
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
end)
|
|
21
|
+
local default = useBackdropStyles
|
|
22
|
+
return {
|
|
23
|
+
default = default,
|
|
24
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
2
|
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
+
import { BadgeColor } from "./Badge.styles";
|
|
3
4
|
export interface BadgeProps {
|
|
4
5
|
count?: number;
|
|
5
6
|
max?: number;
|
|
6
7
|
invisible?: boolean;
|
|
8
|
+
variant?: "standard" | "dot";
|
|
9
|
+
color?: BadgeColor;
|
|
7
10
|
children?: React.ReactNode;
|
|
8
11
|
}
|
|
9
12
|
declare function Badge(props: CustomizedProps<Frame, BadgeProps>): JSX.Element;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local badgeText = TS.import(script, script.Parent, "badgeValue").badgeText
|
|
5
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
5
6
|
local useBadgeStyles = TS.import(script, script.Parent, "Badge.styles").default
|
|
6
7
|
local function Badge(props)
|
|
7
8
|
local _binding = props
|
|
@@ -17,33 +18,37 @@ local function Badge(props)
|
|
|
17
18
|
if invisible == nil then
|
|
18
19
|
invisible = false
|
|
19
20
|
end
|
|
21
|
+
local variant = _binding.variant
|
|
22
|
+
if variant == nil then
|
|
23
|
+
variant = "standard"
|
|
24
|
+
end
|
|
25
|
+
local color = _binding.color
|
|
26
|
+
if color == nil then
|
|
27
|
+
color = "error"
|
|
28
|
+
end
|
|
20
29
|
local children = _binding.children
|
|
21
30
|
local className = _binding.className
|
|
22
31
|
local sx = _binding.sx
|
|
23
32
|
local id = _binding.id
|
|
24
33
|
local ref = _binding.ref
|
|
25
|
-
local styles = useBadgeStyles(
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
local styles = useBadgeStyles({
|
|
35
|
+
variant = variant,
|
|
36
|
+
color = color,
|
|
37
|
+
})
|
|
38
|
+
local isDot = variant == "dot"
|
|
39
|
+
local shown = not invisible and (isDot or count > 0)
|
|
40
|
+
local _attributes = {
|
|
41
|
+
tag = "frame",
|
|
42
|
+
}
|
|
28
43
|
local _condition = id
|
|
29
44
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
30
45
|
_condition = "Badge"
|
|
31
46
|
end
|
|
32
47
|
_attributes.key = _condition
|
|
33
|
-
_attributes.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if className then
|
|
38
|
-
for _k, _v in className do
|
|
39
|
-
_attributes[_k] = _v
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
if sx then
|
|
43
|
-
for _k, _v in sx do
|
|
44
|
-
_attributes[_k] = _v
|
|
45
|
-
end
|
|
46
|
-
end
|
|
48
|
+
_attributes.hostRef = ref
|
|
49
|
+
_attributes.base = styles.root
|
|
50
|
+
_attributes.className = className
|
|
51
|
+
_attributes.sx = sx
|
|
47
52
|
local _exp = children
|
|
48
53
|
local _condition_1 = shown
|
|
49
54
|
if _condition_1 then
|
|
@@ -53,15 +58,18 @@ local function Badge(props)
|
|
|
53
58
|
for _k, _v in styles.badge do
|
|
54
59
|
_attributes_1[_k] = _v
|
|
55
60
|
end
|
|
56
|
-
_attributes_1.Text = badgeText(count, max)
|
|
57
|
-
local
|
|
61
|
+
_attributes_1.Text = if isDot then "" else badgeText(count, max)
|
|
62
|
+
local _condition_2 = isDot ~= true
|
|
63
|
+
if _condition_2 then
|
|
64
|
+
local _attributes_2 = table.clone(styles.padding)
|
|
65
|
+
setmetatable(_attributes_2, nil)
|
|
66
|
+
_condition_2 = React.createElement("uipadding", _attributes_2)
|
|
67
|
+
end
|
|
68
|
+
local _attributes_2 = table.clone(styles.corner)
|
|
58
69
|
setmetatable(_attributes_2, nil)
|
|
59
|
-
|
|
60
|
-
local _attributes_3 = table.clone(styles.corner)
|
|
61
|
-
setmetatable(_attributes_3, nil)
|
|
62
|
-
_condition_1 = (React.createElement("textlabel", _attributes_1, _exp_1, React.createElement("uicorner", _attributes_3)))
|
|
70
|
+
_condition_1 = (React.createElement("textlabel", _attributes_1, _condition_2, React.createElement("uicorner", _attributes_2)))
|
|
63
71
|
end
|
|
64
|
-
return React.createElement(
|
|
72
|
+
return React.createElement(SxHost, _attributes, _exp, _condition_1)
|
|
65
73
|
end
|
|
66
74
|
local default = Badge
|
|
67
75
|
return {
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
export type BadgeColor = "error" | "primary" | "success";
|
|
2
|
+
declare const useBadgeStyles: (props: {
|
|
3
|
+
variant?: "standard" | "dot";
|
|
4
|
+
color?: BadgeColor;
|
|
5
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
2
6
|
export default useBadgeStyles;
|
|
@@ -3,7 +3,17 @@ local TS = _G[script]
|
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local componentStyles = _theme.componentStyles
|
|
5
5
|
local createStyles = _theme.createStyles
|
|
6
|
-
local useBadgeStyles = componentStyles("Badge", function(theme)
|
|
6
|
+
local useBadgeStyles = componentStyles("Badge", function(theme, _param)
|
|
7
|
+
local variant = _param.variant
|
|
8
|
+
if variant == nil then
|
|
9
|
+
variant = "standard"
|
|
10
|
+
end
|
|
11
|
+
local color = _param.color
|
|
12
|
+
if color == nil then
|
|
13
|
+
color = "error"
|
|
14
|
+
end
|
|
15
|
+
local diameter = if variant == "dot" then theme.spacing.calc(1) else theme.spacing.calc(2) + theme.padding.calc(1)
|
|
16
|
+
local tone = if color == "primary" then theme.palette.primary elseif color == "success" then theme.palette.status.success else theme.palette.status.error
|
|
7
17
|
return createStyles({
|
|
8
18
|
root = {
|
|
9
19
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -14,21 +24,23 @@ local useBadgeStyles = componentStyles("Badge", function(theme)
|
|
|
14
24
|
badge = {
|
|
15
25
|
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
16
26
|
Position = UDim2.fromScale(1, 0),
|
|
17
|
-
AutomaticSize = Enum.AutomaticSize.
|
|
18
|
-
Size = UDim2.fromOffset(
|
|
19
|
-
BackgroundColor3 =
|
|
27
|
+
AutomaticSize = if variant == "dot" then Enum.AutomaticSize.None else Enum.AutomaticSize.X,
|
|
28
|
+
Size = UDim2.fromOffset(diameter, diameter),
|
|
29
|
+
BackgroundColor3 = tone.main,
|
|
20
30
|
BorderSizePixel = 0,
|
|
21
31
|
Font = theme.typography.fontFamilies.default,
|
|
22
32
|
TextSize = theme.typography.fontSizes.caption,
|
|
23
|
-
TextColor3 = theme.palette.text.inverse,
|
|
33
|
+
TextColor3 = if color == "error" then theme.palette.text.inverse else tone.on,
|
|
34
|
+
TextXAlignment = Enum.TextXAlignment.Center,
|
|
35
|
+
TextYAlignment = Enum.TextYAlignment.Center,
|
|
24
36
|
ZIndex = 2,
|
|
25
37
|
},
|
|
26
38
|
padding = {
|
|
27
|
-
PaddingLeft = UDim.new(0, theme.padding.calc(0.5)),
|
|
28
|
-
PaddingRight = UDim.new(0, theme.padding.calc(0.5)),
|
|
39
|
+
PaddingLeft = UDim.new(0, if variant == "dot" then 0 else theme.padding.calc(0.5)),
|
|
40
|
+
PaddingRight = UDim.new(0, if variant == "dot" then 0 else theme.padding.calc(0.5)),
|
|
29
41
|
},
|
|
30
42
|
corner = {
|
|
31
|
-
CornerRadius = UDim.new(
|
|
43
|
+
CornerRadius = UDim.new(0.5, 0),
|
|
32
44
|
},
|
|
33
45
|
})
|
|
34
46
|
end)
|
|
@@ -5,6 +5,7 @@ export interface BottomNavigationProps<T> {
|
|
|
5
5
|
options: ChoiceOption<T>[];
|
|
6
6
|
onChange: (value: T) => void;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
showLabels?: boolean;
|
|
8
9
|
}
|
|
9
10
|
declare function BottomNavigation<T>(props: CustomizedProps<Frame, BottomNavigationProps<T>>): JSX.Element;
|
|
10
11
|
export default BottomNavigation;
|
|
@@ -3,6 +3,7 @@ local TS = _G[script]
|
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
|
|
5
5
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
6
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
7
|
local useBottomNavigationStyles = TS.import(script, script.Parent, "BottomNavigation.styles").default
|
|
7
8
|
local function BottomNavigation(props)
|
|
8
9
|
local _binding = props
|
|
@@ -10,32 +11,33 @@ local function BottomNavigation(props)
|
|
|
10
11
|
local options = _binding.options
|
|
11
12
|
local onChange = _binding.onChange
|
|
12
13
|
local disabled = _binding.disabled
|
|
14
|
+
local showLabels = _binding.showLabels
|
|
15
|
+
if showLabels == nil then
|
|
16
|
+
showLabels = true
|
|
17
|
+
end
|
|
13
18
|
local className = _binding.className
|
|
14
19
|
local sx = _binding.sx
|
|
15
20
|
local id = _binding.id
|
|
16
21
|
local ref = _binding.ref
|
|
17
|
-
local styles = useBottomNavigationStyles(
|
|
22
|
+
local styles = useBottomNavigationStyles({
|
|
23
|
+
showLabels = showLabels,
|
|
24
|
+
})
|
|
18
25
|
local count = math.max(#options, 1)
|
|
19
|
-
local _attributes = {
|
|
26
|
+
local _attributes = {
|
|
27
|
+
tag = "frame",
|
|
28
|
+
}
|
|
20
29
|
local _condition = id
|
|
21
30
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
22
31
|
_condition = "BottomNavigation"
|
|
23
32
|
end
|
|
24
33
|
_attributes.key = _condition
|
|
25
|
-
_attributes.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
if sx then
|
|
35
|
-
for _k, _v in sx do
|
|
36
|
-
_attributes[_k] = _v
|
|
37
|
-
end
|
|
38
|
-
end
|
|
34
|
+
_attributes.hostRef = ref
|
|
35
|
+
_attributes.base = styles.root
|
|
36
|
+
_attributes.className = className
|
|
37
|
+
_attributes.sx = sx
|
|
38
|
+
_attributes.state = {
|
|
39
|
+
disabled = disabled,
|
|
40
|
+
}
|
|
39
41
|
local _attributes_1 = table.clone(styles.list)
|
|
40
42
|
setmetatable(_attributes_1, nil)
|
|
41
43
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
@@ -51,7 +53,7 @@ local function BottomNavigation(props)
|
|
|
51
53
|
_attributes_2[_k] = _v
|
|
52
54
|
end
|
|
53
55
|
_attributes_2.Size = UDim2.new(1 / count, 0, 1, 0)
|
|
54
|
-
_attributes_2.Text = choice.label
|
|
56
|
+
_attributes_2.Text = if showLabels == false then "" else choice.label
|
|
55
57
|
_attributes_2.LayoutOrder = index
|
|
56
58
|
_attributes_2.Active = active
|
|
57
59
|
_attributes_2.Selectable = active
|
|
@@ -78,7 +80,7 @@ local function BottomNavigation(props)
|
|
|
78
80
|
_newValue[_k] = _callback(_v, _k - 1, options)
|
|
79
81
|
end
|
|
80
82
|
-- ▲ ReadonlyArray.map ▲
|
|
81
|
-
return React.createElement(
|
|
83
|
+
return React.createElement(SxHost, _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
|
|
82
84
|
end
|
|
83
85
|
local default = BottomNavigation
|
|
84
86
|
return {
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const useBottomNavigationStyles: (
|
|
1
|
+
declare const useBottomNavigationStyles: (props: {
|
|
2
|
+
showLabels?: boolean;
|
|
3
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
2
4
|
export default useBottomNavigationStyles;
|
|
@@ -3,10 +3,14 @@ local TS = _G[script]
|
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local componentStyles = _theme.componentStyles
|
|
5
5
|
local createStyles = _theme.createStyles
|
|
6
|
-
local useBottomNavigationStyles = componentStyles("BottomNavigation", function(theme)
|
|
6
|
+
local useBottomNavigationStyles = componentStyles("BottomNavigation", function(theme, _param)
|
|
7
|
+
local showLabels = _param.showLabels
|
|
8
|
+
if showLabels == nil then
|
|
9
|
+
showLabels = true
|
|
10
|
+
end
|
|
7
11
|
local _object = {
|
|
8
12
|
root = {
|
|
9
|
-
Size = UDim2.new(1, 0, 0, theme.spacing.calc(7)),
|
|
13
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(if showLabels == false then 5 else 7)),
|
|
10
14
|
BackgroundColor3 = theme.palette.surface.elevated,
|
|
11
15
|
BorderSizePixel = 0,
|
|
12
16
|
ZIndex = 11000,
|
|
@@ -6,6 +6,7 @@ export interface BreadcrumbItem {
|
|
|
6
6
|
export interface BreadcrumbsProps {
|
|
7
7
|
items: BreadcrumbItem[];
|
|
8
8
|
separator?: string;
|
|
9
|
+
maxItems?: number;
|
|
9
10
|
}
|
|
10
11
|
declare function Breadcrumbs(props: CustomizedProps<Frame, BreadcrumbsProps>): JSX.Element;
|
|
11
12
|
export default Breadcrumbs;
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
|
|
5
|
-
local
|
|
5
|
+
local _breadcrumbItems = TS.import(script, script.Parent, "breadcrumbItems")
|
|
6
|
+
local breadcrumbCurrent = _breadcrumbItems.breadcrumbCurrent
|
|
7
|
+
local breadcrumbVisible = _breadcrumbItems.breadcrumbVisible
|
|
8
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
9
|
local useBreadcrumbStyles = TS.import(script, script.Parent, "Breadcrumbs.styles").default
|
|
7
10
|
local function Breadcrumbs(props)
|
|
8
11
|
local _binding = props
|
|
@@ -11,70 +14,94 @@ local function Breadcrumbs(props)
|
|
|
11
14
|
if separator == nil then
|
|
12
15
|
separator = "/"
|
|
13
16
|
end
|
|
17
|
+
local maxItems = _binding.maxItems
|
|
14
18
|
local className = _binding.className
|
|
15
19
|
local sx = _binding.sx
|
|
16
20
|
local id = _binding.id
|
|
17
21
|
local ref = _binding.ref
|
|
18
22
|
local styles = useBreadcrumbStyles()
|
|
19
|
-
local
|
|
23
|
+
local visible = breadcrumbVisible(items, maxItems)
|
|
24
|
+
local _attributes = {
|
|
25
|
+
tag = "frame",
|
|
26
|
+
}
|
|
20
27
|
local _condition = id
|
|
21
28
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
22
29
|
_condition = "Breadcrumbs"
|
|
23
30
|
end
|
|
24
31
|
_attributes.key = _condition
|
|
25
|
-
_attributes.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if className then
|
|
30
|
-
for _k, _v in className do
|
|
31
|
-
_attributes[_k] = _v
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
if sx then
|
|
35
|
-
for _k, _v in sx do
|
|
36
|
-
_attributes[_k] = _v
|
|
37
|
-
end
|
|
38
|
-
end
|
|
32
|
+
_attributes.hostRef = ref
|
|
33
|
+
_attributes.base = styles.root
|
|
34
|
+
_attributes.className = className
|
|
35
|
+
_attributes.sx = sx
|
|
39
36
|
local _attributes_1 = table.clone(styles.list)
|
|
40
37
|
setmetatable(_attributes_1, nil)
|
|
41
38
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
42
39
|
-- ▼ ReadonlyArray.map ▼
|
|
43
|
-
local _newValue = table.create(#
|
|
44
|
-
local _callback = function(
|
|
45
|
-
local current = breadcrumbCurrent(index, #items)
|
|
46
|
-
local
|
|
40
|
+
local _newValue = table.create(#visible)
|
|
41
|
+
local _callback = function(entry, order)
|
|
42
|
+
local current = not entry.ellipsis and breadcrumbCurrent(entry.index, #items)
|
|
43
|
+
local item = if entry.ellipsis then nil else items[entry.index + 1]
|
|
44
|
+
local _condition_1 = order > 0
|
|
47
45
|
if _condition_1 then
|
|
48
46
|
local _attributes_2 = table.clone(styles.separator)
|
|
49
47
|
setmetatable(_attributes_2, nil)
|
|
50
48
|
_attributes_2.Text = separator
|
|
51
|
-
_attributes_2.LayoutOrder =
|
|
49
|
+
_attributes_2.LayoutOrder = order * 2
|
|
52
50
|
_condition_1 = React.createElement("textlabel", _attributes_2)
|
|
53
51
|
end
|
|
54
|
-
local
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
52
|
+
local _result
|
|
53
|
+
if entry.ellipsis then
|
|
54
|
+
local _attributes_2 = table.clone(styles.separator)
|
|
55
|
+
setmetatable(_attributes_2, nil)
|
|
56
|
+
_attributes_2.Text = "…"
|
|
57
|
+
_attributes_2.LayoutOrder = order * 2 + 1
|
|
58
|
+
_result = (React.createElement("textlabel", _attributes_2))
|
|
59
|
+
else
|
|
60
|
+
local _attributes_2 = table.clone(cx(styles.item, current and styles.current))
|
|
61
|
+
setmetatable(_attributes_2, nil)
|
|
62
|
+
_attributes_2.Text = entry.label
|
|
63
|
+
_attributes_2.LayoutOrder = order * 2 + 1
|
|
64
|
+
local _condition_2 = not current
|
|
65
|
+
if _condition_2 then
|
|
66
|
+
local _result_1 = item
|
|
67
|
+
if _result_1 ~= nil then
|
|
68
|
+
_result_1 = _result_1.onActivated
|
|
65
69
|
end
|
|
66
|
-
|
|
67
|
-
end
|
|
68
|
-
|
|
70
|
+
_condition_2 = _result_1 ~= nil
|
|
71
|
+
end
|
|
72
|
+
_attributes_2.Active = _condition_2
|
|
73
|
+
local _condition_3 = not current
|
|
74
|
+
if _condition_3 then
|
|
75
|
+
local _result_1 = item
|
|
76
|
+
if _result_1 ~= nil then
|
|
77
|
+
_result_1 = _result_1.onActivated
|
|
78
|
+
end
|
|
79
|
+
_condition_3 = _result_1 ~= nil
|
|
80
|
+
end
|
|
81
|
+
_attributes_2.Selectable = _condition_3
|
|
82
|
+
_attributes_2.Event = {
|
|
83
|
+
Activated = function()
|
|
84
|
+
local _result_1 = item
|
|
85
|
+
if _result_1 ~= nil then
|
|
86
|
+
_result_1 = _result_1.onActivated
|
|
87
|
+
if _result_1 ~= nil then
|
|
88
|
+
_result_1 = _result_1()
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
return _result_1
|
|
92
|
+
end,
|
|
93
|
+
}
|
|
94
|
+
_result = (React.createElement("textbutton", _attributes_2))
|
|
95
|
+
end
|
|
69
96
|
return React.createElement(React.Fragment, {
|
|
70
|
-
key = `{
|
|
71
|
-
}, _condition_1,
|
|
97
|
+
key = `{entry.label}-{order}`,
|
|
98
|
+
}, _condition_1, _result)
|
|
72
99
|
end
|
|
73
|
-
for _k, _v in
|
|
74
|
-
_newValue[_k] = _callback(_v, _k - 1,
|
|
100
|
+
for _k, _v in visible do
|
|
101
|
+
_newValue[_k] = _callback(_v, _k - 1, visible)
|
|
75
102
|
end
|
|
76
103
|
-- ▲ ReadonlyArray.map ▲
|
|
77
|
-
return React.createElement(
|
|
104
|
+
return React.createElement(SxHost, _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
|
|
78
105
|
end
|
|
79
106
|
local default = Breadcrumbs
|
|
80
107
|
return {
|
|
@@ -1 +1,10 @@
|
|
|
1
1
|
export declare function breadcrumbCurrent(index: number, count: number): boolean;
|
|
2
|
+
export interface BreadcrumbSlice {
|
|
3
|
+
label: string;
|
|
4
|
+
index: number;
|
|
5
|
+
ellipsis?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Collapse middle items when over maxItems (keep ends). */
|
|
8
|
+
export declare function breadcrumbVisible<T extends {
|
|
9
|
+
label: string;
|
|
10
|
+
}>(items: T[], maxItems?: number): BreadcrumbSlice[];
|
|
@@ -2,6 +2,74 @@
|
|
|
2
2
|
local function breadcrumbCurrent(index, count)
|
|
3
3
|
return count > 0 and index == count - 1
|
|
4
4
|
end
|
|
5
|
+
--* Collapse middle items when over maxItems (keep ends).
|
|
6
|
+
local function breadcrumbVisible(items, maxItems)
|
|
7
|
+
local count = #items
|
|
8
|
+
if maxItems == nil or maxItems < 1 or count <= maxItems then
|
|
9
|
+
local out = {}
|
|
10
|
+
do
|
|
11
|
+
local i = 0
|
|
12
|
+
local _shouldIncrement = false
|
|
13
|
+
while true do
|
|
14
|
+
if _shouldIncrement then
|
|
15
|
+
i += 1
|
|
16
|
+
else
|
|
17
|
+
_shouldIncrement = true
|
|
18
|
+
end
|
|
19
|
+
if not (i < count) then
|
|
20
|
+
break
|
|
21
|
+
end
|
|
22
|
+
local _arg0 = {
|
|
23
|
+
label = items[i + 1].label,
|
|
24
|
+
index = i,
|
|
25
|
+
}
|
|
26
|
+
table.insert(out, _arg0)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
return out
|
|
30
|
+
end
|
|
31
|
+
if maxItems == 1 then
|
|
32
|
+
return { {
|
|
33
|
+
label = items[count].label,
|
|
34
|
+
index = count - 1,
|
|
35
|
+
} }
|
|
36
|
+
end
|
|
37
|
+
local keepEnd = 1
|
|
38
|
+
local rawStart = maxItems - keepEnd - 1
|
|
39
|
+
local keepStart = if rawStart < 1 then 1 else rawStart
|
|
40
|
+
local out = {}
|
|
41
|
+
do
|
|
42
|
+
local i = 0
|
|
43
|
+
local _shouldIncrement = false
|
|
44
|
+
while true do
|
|
45
|
+
if _shouldIncrement then
|
|
46
|
+
i += 1
|
|
47
|
+
else
|
|
48
|
+
_shouldIncrement = true
|
|
49
|
+
end
|
|
50
|
+
if not (i < keepStart) then
|
|
51
|
+
break
|
|
52
|
+
end
|
|
53
|
+
local _arg0 = {
|
|
54
|
+
label = items[i + 1].label,
|
|
55
|
+
index = i,
|
|
56
|
+
}
|
|
57
|
+
table.insert(out, _arg0)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
table.insert(out, {
|
|
61
|
+
label = "…",
|
|
62
|
+
index = -1,
|
|
63
|
+
ellipsis = true,
|
|
64
|
+
})
|
|
65
|
+
local _arg0 = {
|
|
66
|
+
label = items[count].label,
|
|
67
|
+
index = count - 1,
|
|
68
|
+
}
|
|
69
|
+
table.insert(out, _arg0)
|
|
70
|
+
return out
|
|
71
|
+
end
|
|
5
72
|
return {
|
|
6
73
|
breadcrumbCurrent = breadcrumbCurrent,
|
|
74
|
+
breadcrumbVisible = breadcrumbVisible,
|
|
7
75
|
}
|
|
@@ -2,4 +2,7 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local exports = {}
|
|
4
4
|
exports.Breadcrumbs = TS.import(script, script, "components", "Breadcrumbs").default
|
|
5
|
+
local _breadcrumbItems = TS.import(script, script, "components", "breadcrumbItems")
|
|
6
|
+
exports.breadcrumbCurrent = _breadcrumbItems.breadcrumbCurrent
|
|
7
|
+
exports.breadcrumbVisible = _breadcrumbItems.breadcrumbVisible
|
|
5
8
|
return exports
|