@rbxts/uiblox 0.2.0-alpha.35 → 0.2.0-alpha.37
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/out/theme/styles/utilities/focusRing.d.ts +5 -0
- package/out/theme/styles/utilities/focusRing.luau +11 -0
- package/out/theme/styles/utilities/index.d.ts +1 -0
- package/out/theme/styles/utilities/init.luau +1 -0
- package/out/theme/styles/utilities/resolveSx.d.ts +6 -1
- package/out/theme/styles/utilities/resolveSx.luau +53 -12
- package/out/ui/packages/accordion/components/Accordion.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.luau +55 -19
- package/out/ui/packages/accordion/components/Accordion.styles.luau +49 -29
- package/out/ui/packages/accordion/components/accordionNote.d.ts +2 -0
- package/out/ui/packages/accordion/components/accordionNote.luau +11 -0
- package/out/ui/packages/alert/components/Alert.d.ts +2 -0
- package/out/ui/packages/alert/components/Alert.luau +24 -1
- package/out/ui/packages/alert/components/Alert.styles.luau +11 -0
- package/out/ui/packages/alert/components/alertAction.d.ts +2 -0
- package/out/ui/packages/alert/components/alertAction.luau +11 -0
- package/out/ui/packages/appBar/components/AppBar.d.ts +1 -0
- package/out/ui/packages/appBar/components/AppBar.luau +59 -15
- package/out/ui/packages/appBar/components/AppBar.styles.luau +24 -0
- package/out/ui/packages/appBar/components/appBarSubtitle.d.ts +2 -0
- package/out/ui/packages/appBar/components/appBarSubtitle.luau +11 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.d.ts +14 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.luau +102 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.d.ts +6 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.luau +50 -0
- package/out/ui/packages/avatarGroup/components/avatarGroupCut.d.ts +2 -0
- package/out/ui/packages/avatarGroup/components/avatarGroupCut.luau +11 -0
- package/out/ui/packages/avatarGroup/index.d.ts +3 -0
- package/out/ui/packages/avatarGroup/init.luau +6 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +4 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +19 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +20 -0
- package/out/ui/packages/bottomNavigation/components/navBadge.d.ts +2 -0
- package/out/ui/packages/bottomNavigation/components/navBadge.luau +14 -0
- package/out/ui/packages/bottomNavigation/index.d.ts +1 -1
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +16 -5
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.styles.luau +6 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +2 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +8 -0
- package/out/ui/packages/button/components/Button.d.ts +2 -0
- package/out/ui/packages/button/components/Button.luau +59 -10
- package/out/ui/packages/button/components/Button.styles.luau +2 -0
- package/out/ui/packages/button/components/buttonLook.d.ts +2 -0
- package/out/ui/packages/button/components/buttonLook.luau +11 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.d.ts +13 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.luau +102 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.styles.d.ts +5 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.styles.luau +57 -0
- package/out/ui/packages/buttonGroup/components/buttonGroupEdge.d.ts +2 -0
- package/out/ui/packages/buttonGroup/components/buttonGroupEdge.luau +16 -0
- package/out/ui/packages/buttonGroup/index.d.ts +3 -0
- package/out/ui/packages/buttonGroup/init.luau +6 -0
- package/out/ui/packages/card/components/Card.d.ts +1 -0
- package/out/ui/packages/card/components/Card.luau +21 -2
- package/out/ui/packages/card/components/Card.styles.d.ts +3 -1
- package/out/ui/packages/card/components/Card.styles.luau +16 -7
- package/out/ui/packages/card/components/cardWidth.d.ts +10 -0
- package/out/ui/packages/card/components/cardWidth.luau +36 -0
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +9 -4
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +10 -1
- package/out/ui/packages/cframeEditor/components/cframeValue.d.ts +1 -0
- package/out/ui/packages/cframeEditor/components/cframeValue.luau +13 -0
- package/out/ui/packages/checkbox/components/Checkbox.luau +2 -1
- package/out/ui/packages/checkbox/components/Checkbox.styles.luau +2 -0
- package/out/ui/packages/chip/components/Chip.styles.d.ts +2 -1
- package/out/ui/packages/chip/components/Chip.styles.luau +9 -6
- package/out/ui/packages/chip/components/chipTone.d.ts +3 -0
- package/out/ui/packages/chip/components/chipTone.luau +11 -0
- package/out/ui/packages/collapse/components/Collapse.d.ts +8 -0
- package/out/ui/packages/collapse/components/Collapse.luau +34 -0
- package/out/ui/packages/collapse/components/Collapse.styles.d.ts +2 -0
- package/out/ui/packages/collapse/components/Collapse.styles.luau +20 -0
- package/out/ui/packages/collapse/components/collapseOpen.d.ts +1 -0
- package/out/ui/packages/collapse/components/collapseOpen.luau +7 -0
- package/out/ui/packages/collapse/index.d.ts +3 -0
- package/out/ui/packages/collapse/init.luau +6 -0
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +4 -2
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +4 -2
- package/out/ui/packages/colorPicker/components/sequenceValue.d.ts +2 -0
- package/out/ui/packages/colorPicker/components/sequenceValue.luau +8 -0
- package/out/ui/packages/colorPicker/index.d.ts +1 -1
- package/out/ui/packages/colorPicker/init.luau +2 -0
- package/out/ui/packages/copyButton/components/CopyButton.d.ts +8 -0
- package/out/ui/packages/copyButton/components/CopyButton.luau +32 -0
- package/out/ui/packages/copyButton/components/copyInvoke.d.ts +2 -0
- package/out/ui/packages/copyButton/components/copyInvoke.luau +12 -0
- package/out/ui/packages/copyButton/index.d.ts +3 -0
- package/out/ui/packages/copyButton/init.luau +6 -0
- package/out/ui/packages/cover/components/Cover.d.ts +8 -0
- package/out/ui/packages/cover/components/Cover.luau +47 -0
- package/out/ui/packages/cover/components/coverFill.d.ts +2 -0
- package/out/ui/packages/cover/components/coverFill.luau +14 -0
- package/out/ui/packages/cover/index.d.ts +3 -0
- package/out/ui/packages/cover/init.luau +6 -0
- package/out/ui/packages/dateRange/components/DateRangePicker.d.ts +3 -0
- package/out/ui/packages/dateRange/components/DateRangePicker.luau +167 -88
- package/out/ui/packages/dateRange/dateRangeValue.d.ts +5 -0
- package/out/ui/packages/dateRange/dateRangeValue.luau +34 -0
- package/out/ui/packages/dateRange/index.d.ts +1 -1
- package/out/ui/packages/dateRange/init.luau +3 -0
- package/out/ui/packages/dialog/components/Dialog.d.ts +1 -0
- package/out/ui/packages/dialog/components/Dialog.luau +55 -6
- package/out/ui/packages/dialog/components/Dialog.styles.luau +5 -3
- package/out/ui/packages/dialog/components/dialogWidth.d.ts +7 -0
- package/out/ui/packages/dialog/components/dialogWidth.luau +35 -0
- package/out/ui/packages/divider/components/Divider.luau +57 -12
- package/out/ui/packages/divider/components/dividerLabel.d.ts +2 -0
- package/out/ui/packages/divider/components/dividerLabel.luau +11 -0
- package/out/ui/packages/drawer/components/Drawer.d.ts +1 -0
- package/out/ui/packages/drawer/components/Drawer.luau +18 -3
- package/out/ui/packages/drawer/components/drawerPlacement.d.ts +13 -1
- package/out/ui/packages/drawer/components/drawerPlacement.luau +28 -0
- package/out/ui/packages/fab/components/fabSize.d.ts +1 -1
- package/out/ui/packages/iconButton/components/IconButton.d.ts +2 -0
- package/out/ui/packages/iconButton/components/IconButton.luau +37 -3
- package/out/ui/packages/iconButton/components/transportGlyph.d.ts +9 -0
- package/out/ui/packages/iconButton/components/transportGlyph.luau +73 -0
- package/out/ui/packages/imageList/components/ImageList.d.ts +4 -0
- package/out/ui/packages/imageList/components/ImageList.luau +57 -11
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +1 -0
- package/out/ui/packages/imageList/components/ImageList.styles.luau +16 -10
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +10 -0
- package/out/ui/packages/imageList/components/imageListLayout.luau +44 -0
- package/out/ui/packages/index.d.ts +12 -0
- package/out/ui/packages/init.luau +36 -0
- package/out/ui/packages/input/components/Input.d.ts +4 -0
- package/out/ui/packages/input/components/Input.luau +29 -9
- package/out/ui/packages/input/components/Input.styles.d.ts +1 -0
- package/out/ui/packages/input/components/Input.styles.luau +42 -12
- package/out/ui/packages/input/components/clampText.d.ts +2 -0
- package/out/ui/packages/input/components/clampText.luau +16 -0
- package/out/ui/packages/input/components/multilineHeight.d.ts +1 -0
- package/out/ui/packages/input/components/multilineHeight.luau +11 -0
- package/out/ui/packages/link/components/Link.luau +13 -9
- package/out/ui/packages/link/components/Link.styles.d.ts +0 -1
- package/out/ui/packages/link/components/Link.styles.luau +1 -12
- package/out/ui/packages/listItem/components/ListItem.d.ts +6 -0
- package/out/ui/packages/listItem/components/ListItem.luau +97 -39
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +3 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +52 -30
- package/out/ui/packages/listItem/components/listItemInk.d.ts +3 -0
- package/out/ui/packages/listItem/components/listItemInk.luau +14 -0
- package/out/ui/packages/listItem/components/listItemLayout.d.ts +12 -0
- package/out/ui/packages/listItem/components/listItemLayout.luau +41 -0
- package/out/ui/packages/markdown/components/Markdown.d.ts +2 -0
- package/out/ui/packages/markdown/components/Markdown.luau +91 -6
- package/out/ui/packages/markdown/components/Markdown.styles.luau +25 -0
- package/out/ui/packages/markdown/index.d.ts +2 -2
- package/out/ui/packages/markdown/init.luau +2 -0
- package/out/ui/packages/markdown/parseMarkdown.d.ts +21 -1
- package/out/ui/packages/markdown/parseMarkdown.luau +109 -2
- package/out/ui/packages/menu/components/Menu.d.ts +3 -0
- package/out/ui/packages/menu/components/Menu.luau +68 -21
- package/out/ui/packages/menu/components/menuIcon.d.ts +6 -0
- package/out/ui/packages/menu/components/menuIcon.luau +32 -0
- package/out/ui/packages/numberInput/components/NumberInput.d.ts +1 -0
- package/out/ui/packages/numberInput/components/NumberInput.luau +67 -1
- package/out/ui/packages/numberInput/components/numberValue.d.ts +2 -0
- package/out/ui/packages/numberInput/components/numberValue.luau +10 -0
- package/out/ui/packages/pager/components/Pager.d.ts +11 -0
- package/out/ui/packages/pager/components/Pager.luau +112 -0
- package/out/ui/packages/pager/components/Pager.styles.d.ts +2 -0
- package/out/ui/packages/pager/components/Pager.styles.luau +61 -0
- package/out/ui/packages/pager/components/pagerStep.d.ts +3 -0
- package/out/ui/packages/pager/components/pagerStep.luau +24 -0
- package/out/ui/packages/pager/index.d.ts +3 -0
- package/out/ui/packages/pager/init.luau +9 -0
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +5 -0
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +5 -0
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +22 -0
- package/out/ui/packages/popover/components/Popover.d.ts +12 -0
- package/out/ui/packages/popover/components/Popover.luau +50 -0
- package/out/ui/packages/popover/components/Popover.styles.d.ts +2 -0
- package/out/ui/packages/popover/components/Popover.styles.luau +26 -0
- package/out/ui/packages/popover/index.d.ts +2 -0
- package/out/ui/packages/popover/init.luau +5 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +4 -1
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +51 -8
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +26 -2
- package/out/ui/packages/radioGroup/components/radioHint.d.ts +2 -0
- package/out/ui/packages/radioGroup/components/radioHint.luau +11 -0
- package/out/ui/packages/radioGroup/index.d.ts +1 -1
- package/out/ui/packages/rating/components/Rating.d.ts +1 -1
- package/out/ui/packages/rating/components/Rating.luau +4 -2
- package/out/ui/packages/rating/components/ratingCommit.d.ts +2 -0
- package/out/ui/packages/rating/components/ratingCommit.luau +11 -0
- package/out/ui/packages/reorder/index.d.ts +2 -0
- package/out/ui/packages/reorder/init.luau +14 -0
- package/out/ui/packages/reorder/reorder.d.ts +24 -0
- package/out/ui/packages/reorder/reorder.luau +178 -0
- package/out/ui/packages/reorder/useReorderDrag.d.ts +15 -0
- package/out/ui/packages/reorder/useReorderDrag.luau +129 -0
- package/out/ui/packages/scroll/components/ScrollView.luau +76 -7
- package/out/ui/packages/select/components/Select.luau +18 -1
- package/out/ui/packages/select/components/Select.styles.luau +2 -5
- package/out/ui/packages/select/components/selectWidth.d.ts +2 -0
- package/out/ui/packages/select/components/selectWidth.luau +15 -0
- package/out/ui/packages/shadow/components/Shadow.luau +14 -2
- package/out/ui/packages/slider/components/RangeSlider.d.ts +16 -0
- package/out/ui/packages/slider/components/RangeSlider.luau +231 -0
- package/out/ui/packages/slider/components/RangeSlider.styles.d.ts +7 -0
- package/out/ui/packages/slider/components/RangeSlider.styles.luau +48 -0
- package/out/ui/packages/slider/components/Slider.d.ts +1 -0
- package/out/ui/packages/slider/components/Slider.luau +44 -11
- package/out/ui/packages/slider/components/Slider.styles.d.ts +1 -0
- package/out/ui/packages/slider/components/Slider.styles.luau +19 -5
- package/out/ui/packages/slider/components/rangeValue.d.ts +21 -0
- package/out/ui/packages/slider/components/rangeValue.luau +77 -0
- package/out/ui/packages/slider/components/sliderLabel.d.ts +4 -0
- package/out/ui/packages/slider/components/sliderLabel.luau +30 -0
- package/out/ui/packages/slider/index.d.ts +3 -0
- package/out/ui/packages/slider/init.luau +6 -0
- package/out/ui/packages/snackbar/components/Snackbar.d.ts +1 -0
- package/out/ui/packages/snackbar/components/Snackbar.luau +2 -0
- package/out/ui/packages/sparkline/components/Sparkline.d.ts +3 -0
- package/out/ui/packages/sparkline/components/Sparkline.luau +69 -7
- package/out/ui/packages/sparkline/index.d.ts +1 -1
- package/out/ui/packages/sparkline/init.luau +6 -1
- package/out/ui/packages/sparkline/sparklineLayout.d.ts +17 -0
- package/out/ui/packages/sparkline/sparklineLayout.luau +132 -8
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +1 -0
- package/out/ui/packages/speedDial/components/SpeedDial.luau +56 -9
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +1 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +45 -3
- package/out/ui/packages/speedDial/components/speedDialLabel.d.ts +4 -0
- package/out/ui/packages/speedDial/components/speedDialLabel.luau +16 -0
- package/out/ui/packages/stateMatrix.d.ts +1 -0
- package/out/ui/packages/stateMatrix.luau +9 -0
- package/out/ui/packages/stepper/components/Stepper.d.ts +2 -0
- package/out/ui/packages/stepper/components/Stepper.luau +35 -7
- package/out/ui/packages/stepper/components/Stepper.styles.luau +3 -0
- package/out/ui/packages/stepper/components/stepState.d.ts +4 -2
- package/out/ui/packages/stepper/components/stepState.luau +12 -1
- package/out/ui/packages/stepper/index.d.ts +1 -1
- package/out/ui/packages/stepper/init.luau +3 -1
- package/out/ui/packages/switch/components/Switch.styles.luau +2 -5
- package/out/ui/packages/table/components/Table.luau +8 -5
- package/out/ui/packages/table/components/tableSort.d.ts +2 -0
- package/out/ui/packages/table/components/tableSort.luau +95 -0
- package/out/ui/packages/table/index.d.ts +1 -0
- package/out/ui/packages/table/init.luau +1 -0
- package/out/ui/packages/tabs/components/Tabs.luau +70 -2
- package/out/ui/packages/tabs/components/tabScroll.d.ts +2 -0
- package/out/ui/packages/tabs/components/tabScroll.luau +18 -0
- package/out/ui/packages/text/components/Text.d.ts +7 -0
- package/out/ui/packages/text/components/Text.luau +54 -0
- package/out/ui/packages/text/components/textBox.d.ts +12 -0
- package/out/ui/packages/text/components/textBox.luau +21 -0
- package/out/ui/packages/text/index.d.ts +2 -0
- package/out/ui/packages/text/init.luau +5 -0
- package/out/ui/packages/timeField/components/TimeField.d.ts +13 -0
- package/out/ui/packages/timeField/components/TimeField.luau +102 -0
- package/out/ui/packages/timeField/index.d.ts +4 -0
- package/out/ui/packages/timeField/init.luau +9 -0
- package/out/ui/packages/timeField/timeValue.d.ts +8 -0
- package/out/ui/packages/timeField/timeValue.luau +49 -0
- package/out/ui/packages/timeline/components/Timeline.d.ts +12 -0
- package/out/ui/packages/timeline/components/Timeline.luau +99 -0
- package/out/ui/packages/timeline/components/Timeline.styles.d.ts +2 -0
- package/out/ui/packages/timeline/components/Timeline.styles.luau +106 -0
- package/out/ui/packages/timeline/components/timelineRail.d.ts +4 -0
- package/out/ui/packages/timeline/components/timelineRail.luau +15 -0
- package/out/ui/packages/timeline/index.d.ts +3 -0
- package/out/ui/packages/timeline/init.luau +8 -0
- package/out/ui/packages/toast/components/Toast.d.ts +1 -0
- package/out/ui/packages/toast/components/Toast.luau +59 -12
- package/out/ui/packages/toast/components/Toast.styles.luau +6 -3
- package/out/ui/packages/toast/components/toastPlace.d.ts +12 -0
- package/out/ui/packages/toast/components/toastPlace.luau +31 -0
- package/out/ui/packages/tooltip/components/Tooltip.d.ts +1 -0
- package/out/ui/packages/tooltip/components/Tooltip.luau +109 -31
- package/out/ui/packages/tooltip/components/Tooltip.styles.luau +30 -0
- package/out/ui/packages/tooltip/components/tooltipBox.d.ts +4 -0
- package/out/ui/packages/tooltip/components/tooltipBox.luau +12 -0
- package/out/ui/packages/tooltip/components/tooltipPointer.d.ts +2 -0
- package/out/ui/packages/tooltip/components/tooltipPointer.luau +11 -0
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +1 -0
- package/out/ui/packages/weekGrid/components/WeekGrid.d.ts +24 -0
- package/out/ui/packages/weekGrid/components/WeekGrid.luau +187 -0
- package/out/ui/packages/weekGrid/components/weekColumns.d.ts +9 -0
- package/out/ui/packages/weekGrid/components/weekColumns.luau +25 -0
- package/out/ui/packages/weekGrid/index.d.ts +3 -0
- package/out/ui/packages/weekGrid/init.luau +8 -0
- package/package.json +67 -69
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { AvatarVariant } from "../../avatar/components/Avatar.styles";
|
|
3
|
+
export interface AvatarGroupEntry {
|
|
4
|
+
name?: string;
|
|
5
|
+
image?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AvatarGroupProps {
|
|
8
|
+
items: AvatarGroupEntry[];
|
|
9
|
+
max?: number;
|
|
10
|
+
size?: number;
|
|
11
|
+
variant?: AvatarVariant;
|
|
12
|
+
}
|
|
13
|
+
declare function AvatarGroup(props: CustomizedProps<Frame, AvatarGroupProps>): JSX.Element;
|
|
14
|
+
export default AvatarGroup;
|
|
@@ -0,0 +1,102 @@
|
|
|
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 Avatar = TS.import(script, script.Parent.Parent.Parent, "avatar").Avatar
|
|
5
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
|
+
local avatarGroupCut = TS.import(script, script.Parent, "avatarGroupCut").avatarGroupCut
|
|
7
|
+
local useAvatarGroupStyles = TS.import(script, script.Parent, "AvatarGroup.styles").default
|
|
8
|
+
local function AvatarGroup(props)
|
|
9
|
+
local _binding = props
|
|
10
|
+
local items = _binding.items
|
|
11
|
+
local max = _binding.max
|
|
12
|
+
local size = _binding.size
|
|
13
|
+
if size == nil then
|
|
14
|
+
size = 40
|
|
15
|
+
end
|
|
16
|
+
local variant = _binding.variant
|
|
17
|
+
if variant == nil then
|
|
18
|
+
variant = "circular"
|
|
19
|
+
end
|
|
20
|
+
local className = _binding.className
|
|
21
|
+
local sx = _binding.sx
|
|
22
|
+
local id = _binding.id
|
|
23
|
+
local ref = _binding.ref
|
|
24
|
+
local styles = useAvatarGroupStyles({
|
|
25
|
+
size = size,
|
|
26
|
+
variant = variant,
|
|
27
|
+
})
|
|
28
|
+
local count = #items
|
|
29
|
+
local shown = avatarGroupCut(count, max)
|
|
30
|
+
local extra = count - shown
|
|
31
|
+
local _attributes = {
|
|
32
|
+
tag = "frame",
|
|
33
|
+
}
|
|
34
|
+
local _condition = id
|
|
35
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
36
|
+
_condition = "AvatarGroup"
|
|
37
|
+
end
|
|
38
|
+
_attributes.key = _condition
|
|
39
|
+
_attributes.hostRef = ref
|
|
40
|
+
_attributes.base = styles.root
|
|
41
|
+
_attributes.className = className
|
|
42
|
+
_attributes.sx = sx
|
|
43
|
+
local _attributes_1 = table.clone(styles.list)
|
|
44
|
+
setmetatable(_attributes_1, nil)
|
|
45
|
+
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
46
|
+
-- ▼ ReadonlyArray.map ▼
|
|
47
|
+
local _newValue = table.create(#items)
|
|
48
|
+
local _callback = function(entry, index)
|
|
49
|
+
if index >= shown then
|
|
50
|
+
return nil
|
|
51
|
+
end
|
|
52
|
+
local _attributes_2 = {}
|
|
53
|
+
local _condition_1 = entry.name
|
|
54
|
+
if _condition_1 == nil then
|
|
55
|
+
_condition_1 = "face"
|
|
56
|
+
end
|
|
57
|
+
_attributes_2.key = `{_condition_1}-{index}`
|
|
58
|
+
_attributes_2.name = entry.name
|
|
59
|
+
_attributes_2.image = entry.image
|
|
60
|
+
_attributes_2.size = size
|
|
61
|
+
_attributes_2.variant = variant
|
|
62
|
+
_attributes_2.className = {
|
|
63
|
+
LayoutOrder = index,
|
|
64
|
+
ZIndex = index + 1,
|
|
65
|
+
}
|
|
66
|
+
return React.createElement(Avatar, _attributes_2)
|
|
67
|
+
end
|
|
68
|
+
for _k, _v in items do
|
|
69
|
+
_newValue[_k] = _callback(_v, _k - 1, items)
|
|
70
|
+
end
|
|
71
|
+
-- ▲ ReadonlyArray.map ▲
|
|
72
|
+
local _result
|
|
73
|
+
if extra > 0 then
|
|
74
|
+
local _attributes_2 = {
|
|
75
|
+
key = "Extra",
|
|
76
|
+
}
|
|
77
|
+
for _k, _v in styles.surplus do
|
|
78
|
+
_attributes_2[_k] = _v
|
|
79
|
+
end
|
|
80
|
+
_attributes_2.LayoutOrder = shown
|
|
81
|
+
_attributes_2.ZIndex = shown + 1
|
|
82
|
+
local _result_1
|
|
83
|
+
if variant ~= "square" then
|
|
84
|
+
local _attributes_3 = table.clone(styles.corner)
|
|
85
|
+
setmetatable(_attributes_3, nil)
|
|
86
|
+
_result_1 = React.createElement("uicorner", _attributes_3)
|
|
87
|
+
else
|
|
88
|
+
_result_1 = nil
|
|
89
|
+
end
|
|
90
|
+
local _attributes_3 = table.clone(styles.surplusText)
|
|
91
|
+
setmetatable(_attributes_3, nil)
|
|
92
|
+
_attributes_3.Text = `+{extra}`
|
|
93
|
+
_result = (React.createElement("frame", _attributes_2, _result_1, React.createElement("textlabel", _attributes_3)))
|
|
94
|
+
else
|
|
95
|
+
_result = nil
|
|
96
|
+
end
|
|
97
|
+
return React.createElement(SxHost, _attributes, _exp, React.createElement(React.Fragment, nil, _newValue, _result))
|
|
98
|
+
end
|
|
99
|
+
local default = AvatarGroup
|
|
100
|
+
return {
|
|
101
|
+
default = default,
|
|
102
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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 useAvatarGroupStyles = componentStyles("AvatarGroup", function(theme, _param)
|
|
7
|
+
local size = _param.size
|
|
8
|
+
if size == nil then
|
|
9
|
+
size = 40
|
|
10
|
+
end
|
|
11
|
+
local variant = _param.variant
|
|
12
|
+
if variant == nil then
|
|
13
|
+
variant = "circular"
|
|
14
|
+
end
|
|
15
|
+
local overlap = math.max(theme.padding.calc(1), math.floor(size / 4))
|
|
16
|
+
return createStyles({
|
|
17
|
+
root = {
|
|
18
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
19
|
+
Size = UDim2.fromScale(0, 0),
|
|
20
|
+
BackgroundTransparency = 1,
|
|
21
|
+
BorderSizePixel = 0,
|
|
22
|
+
},
|
|
23
|
+
list = {
|
|
24
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
25
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
26
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
27
|
+
Padding = UDim.new(0, -overlap),
|
|
28
|
+
},
|
|
29
|
+
surplus = {
|
|
30
|
+
Size = UDim2.fromOffset(size, size),
|
|
31
|
+
BackgroundColor3 = theme.palette.surface.elevated,
|
|
32
|
+
BorderSizePixel = 0,
|
|
33
|
+
},
|
|
34
|
+
surplusText = {
|
|
35
|
+
Size = UDim2.fromScale(1, 1),
|
|
36
|
+
BackgroundTransparency = 1,
|
|
37
|
+
BorderSizePixel = 0,
|
|
38
|
+
Font = theme.typography.fontFamilies.default,
|
|
39
|
+
TextSize = math.max(12, size * 0.35),
|
|
40
|
+
TextColor3 = theme.palette.text.primary,
|
|
41
|
+
},
|
|
42
|
+
corner = {
|
|
43
|
+
CornerRadius = if variant == "rounded" then UDim.new(0, theme.shape.borderRadius) else UDim.new(1, 0),
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
end)
|
|
47
|
+
local default = useAvatarGroupStyles
|
|
48
|
+
return {
|
|
49
|
+
default = default,
|
|
50
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
--* Faces drawn before a surplus badge. A max below 2, or a short list, shows every face.
|
|
3
|
+
local function avatarGroupCut(count, max)
|
|
4
|
+
if max == nil or max ~= max or max < 2 or count <= max then
|
|
5
|
+
return count
|
|
6
|
+
end
|
|
7
|
+
return max - 1
|
|
8
|
+
end
|
|
9
|
+
return {
|
|
10
|
+
avatarGroupCut = avatarGroupCut,
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
exports.AvatarGroup = TS.import(script, script, "components", "AvatarGroup").default
|
|
5
|
+
exports.avatarGroupCut = TS.import(script, script, "components", "avatarGroupCut").avatarGroupCut
|
|
6
|
+
return exports
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { CustomizedProps } from "../../../../theme/index";
|
|
2
2
|
import { ChoiceOption } from "../../radioGroup/index";
|
|
3
|
+
export interface BottomNavOption<T> extends ChoiceOption<T> {
|
|
4
|
+
badge?: number;
|
|
5
|
+
}
|
|
3
6
|
export interface BottomNavigationProps<T> {
|
|
4
7
|
value: T;
|
|
5
|
-
options:
|
|
8
|
+
options: BottomNavOption<T>[];
|
|
6
9
|
onChange: (value: T) => void;
|
|
7
10
|
disabled?: boolean;
|
|
8
11
|
showLabels?: boolean;
|
|
@@ -5,6 +5,7 @@ local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
|
5
5
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
6
6
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
7
7
|
local useBottomNavigationStyles = TS.import(script, script.Parent, "BottomNavigation.styles").default
|
|
8
|
+
local navBadge = TS.import(script, script.Parent, "navBadge").navBadge
|
|
8
9
|
local function BottomNavigation(props)
|
|
9
10
|
local _binding = props
|
|
10
11
|
local value = _binding.value
|
|
@@ -46,6 +47,7 @@ local function BottomNavigation(props)
|
|
|
46
47
|
local _callback = function(choice, index)
|
|
47
48
|
local active = canActivate(disabled or choice.disabled)
|
|
48
49
|
local selected = choice.value == value
|
|
50
|
+
local mark = navBadge(choice.badge)
|
|
49
51
|
local _attributes_2 = {
|
|
50
52
|
key = `{choice.label}-{index}`,
|
|
51
53
|
}
|
|
@@ -74,7 +76,23 @@ local function BottomNavigation(props)
|
|
|
74
76
|
end
|
|
75
77
|
_condition_1 = React.createElement("frame", _attributes_3)
|
|
76
78
|
end
|
|
77
|
-
|
|
79
|
+
local _condition_2 = mark ~= nil
|
|
80
|
+
if _condition_2 then
|
|
81
|
+
local _attributes_3 = {
|
|
82
|
+
key = "Badge",
|
|
83
|
+
}
|
|
84
|
+
for _k, _v in styles.badge do
|
|
85
|
+
_attributes_3[_k] = _v
|
|
86
|
+
end
|
|
87
|
+
_attributes_3.Text = mark
|
|
88
|
+
local _attributes_4 = table.clone(styles.badgePad)
|
|
89
|
+
setmetatable(_attributes_4, nil)
|
|
90
|
+
local _exp_1 = React.createElement("uipadding", _attributes_4)
|
|
91
|
+
local _attributes_5 = table.clone(styles.badgeCorner)
|
|
92
|
+
setmetatable(_attributes_5, nil)
|
|
93
|
+
_condition_2 = (React.createElement("textlabel", _attributes_3, _exp_1, React.createElement("uicorner", _attributes_5)))
|
|
94
|
+
end
|
|
95
|
+
return React.createElement("textbutton", _attributes_2, _condition_1, _condition_2)
|
|
78
96
|
end
|
|
79
97
|
for _k, _v in options do
|
|
80
98
|
_newValue[_k] = _callback(_v, _k - 1, options)
|
|
@@ -54,6 +54,26 @@ local useBottomNavigationStyles = componentStyles("BottomNavigation", function(t
|
|
|
54
54
|
BackgroundColor3 = theme.palette.primary.main,
|
|
55
55
|
BorderSizePixel = 0,
|
|
56
56
|
}
|
|
57
|
+
_object.badge = {
|
|
58
|
+
AnchorPoint = Vector2.new(1, 0),
|
|
59
|
+
Position = UDim2.new(1, -4, 0, 2),
|
|
60
|
+
AutomaticSize = Enum.AutomaticSize.X,
|
|
61
|
+
Size = UDim2.fromOffset(0, theme.spacing.calc(2)),
|
|
62
|
+
BackgroundColor3 = theme.palette.status.error.main,
|
|
63
|
+
BorderSizePixel = 0,
|
|
64
|
+
Font = theme.typography.fontFamilies.default,
|
|
65
|
+
TextSize = theme.typography.fontSizes.caption,
|
|
66
|
+
TextColor3 = theme.palette.text.inverse,
|
|
67
|
+
TextXAlignment = Enum.TextXAlignment.Center,
|
|
68
|
+
ZIndex = 2,
|
|
69
|
+
}
|
|
70
|
+
_object.badgePad = {
|
|
71
|
+
PaddingLeft = UDim.new(0, theme.padding.calc(0.5)),
|
|
72
|
+
PaddingRight = UDim.new(0, theme.padding.calc(0.5)),
|
|
73
|
+
}
|
|
74
|
+
_object.badgeCorner = {
|
|
75
|
+
CornerRadius = UDim.new(0, theme.spacing.calc(1)),
|
|
76
|
+
}
|
|
57
77
|
return createStyles(_object)
|
|
58
78
|
end)
|
|
59
79
|
local default = useBottomNavigationStyles
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
--* A missing or empty count stays off the item. Larger counts cap the same way as badgeText.
|
|
3
|
+
local function navBadge(count, max)
|
|
4
|
+
if max == nil then
|
|
5
|
+
max = 99
|
|
6
|
+
end
|
|
7
|
+
if count == nil or count <= 0 then
|
|
8
|
+
return nil
|
|
9
|
+
end
|
|
10
|
+
return if count > max then `{max}+` else `{count}`
|
|
11
|
+
end
|
|
12
|
+
return {
|
|
13
|
+
navBadge = navBadge,
|
|
14
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as BottomNavigation } from "./components/BottomNavigation";
|
|
2
|
-
export { BottomNavigationProps } from "./components/BottomNavigation";
|
|
2
|
+
export { BottomNavigationProps, BottomNavOption } from "./components/BottomNavigation";
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
|
-
local
|
|
3
|
+
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local React = _react
|
|
5
|
+
local useState = _react.useState
|
|
4
6
|
local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
|
|
5
7
|
local _breadcrumbItems = TS.import(script, script.Parent, "breadcrumbItems")
|
|
6
8
|
local breadcrumbCurrent = _breadcrumbItems.breadcrumbCurrent
|
|
9
|
+
local breadcrumbHasGap = _breadcrumbItems.breadcrumbHasGap
|
|
7
10
|
local breadcrumbVisible = _breadcrumbItems.breadcrumbVisible
|
|
8
11
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
9
12
|
local useBreadcrumbStyles = TS.import(script, script.Parent, "Breadcrumbs.styles").default
|
|
@@ -20,7 +23,9 @@ local function Breadcrumbs(props)
|
|
|
20
23
|
local id = _binding.id
|
|
21
24
|
local ref = _binding.ref
|
|
22
25
|
local styles = useBreadcrumbStyles()
|
|
23
|
-
local
|
|
26
|
+
local opened, setOpened = useState(false)
|
|
27
|
+
local gap = breadcrumbHasGap(#items, maxItems)
|
|
28
|
+
local visible = breadcrumbVisible(items, if opened or not gap then nil else maxItems)
|
|
24
29
|
local _attributes = {
|
|
25
30
|
tag = "frame",
|
|
26
31
|
}
|
|
@@ -30,11 +35,12 @@ local function Breadcrumbs(props)
|
|
|
30
35
|
end
|
|
31
36
|
_attributes.key = _condition
|
|
32
37
|
_attributes.hostRef = ref
|
|
33
|
-
_attributes.base = styles.root
|
|
38
|
+
_attributes.base = if opened then styles.opened else styles.root
|
|
34
39
|
_attributes.className = className
|
|
35
40
|
_attributes.sx = sx
|
|
36
41
|
local _attributes_1 = table.clone(styles.list)
|
|
37
42
|
setmetatable(_attributes_1, nil)
|
|
43
|
+
_attributes_1.Wraps = opened
|
|
38
44
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
39
45
|
-- ▼ ReadonlyArray.map ▼
|
|
40
46
|
local _newValue = table.create(#visible)
|
|
@@ -51,11 +57,16 @@ local function Breadcrumbs(props)
|
|
|
51
57
|
end
|
|
52
58
|
local _result
|
|
53
59
|
if entry.ellipsis then
|
|
54
|
-
local _attributes_2 = table.clone(styles.
|
|
60
|
+
local _attributes_2 = table.clone(styles.item)
|
|
55
61
|
setmetatable(_attributes_2, nil)
|
|
56
62
|
_attributes_2.Text = "…"
|
|
57
63
|
_attributes_2.LayoutOrder = order * 2 + 1
|
|
58
|
-
|
|
64
|
+
_attributes_2.Event = {
|
|
65
|
+
Activated = function()
|
|
66
|
+
return setOpened(true)
|
|
67
|
+
end,
|
|
68
|
+
}
|
|
69
|
+
_result = (React.createElement("textbutton", _attributes_2))
|
|
59
70
|
else
|
|
60
71
|
local _attributes_2 = table.clone(cx(styles.item, current and styles.current))
|
|
61
72
|
setmetatable(_attributes_2, nil)
|
|
@@ -11,6 +11,12 @@ local useBreadcrumbStyles = componentStyles("Breadcrumbs", function(theme)
|
|
|
11
11
|
BackgroundTransparency = 1,
|
|
12
12
|
BorderSizePixel = 0,
|
|
13
13
|
},
|
|
14
|
+
opened = {
|
|
15
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
16
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
17
|
+
BackgroundTransparency = 1,
|
|
18
|
+
BorderSizePixel = 0,
|
|
19
|
+
},
|
|
14
20
|
list = {
|
|
15
21
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
16
22
|
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
@@ -4,6 +4,8 @@ export interface BreadcrumbSlice {
|
|
|
4
4
|
index: number;
|
|
5
5
|
ellipsis?: boolean;
|
|
6
6
|
}
|
|
7
|
+
/** True when a middle gap is shown. A max of one item has no gap to open. */
|
|
8
|
+
export declare function breadcrumbHasGap(count: number, maxItems?: number): boolean;
|
|
7
9
|
/** Collapse middle items when over maxItems (keep ends). */
|
|
8
10
|
export declare function breadcrumbVisible<T extends {
|
|
9
11
|
label: string;
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
local function breadcrumbCurrent(index, count)
|
|
3
3
|
return count > 0 and index == count - 1
|
|
4
4
|
end
|
|
5
|
+
--* True when a middle gap is shown. A max of one item has no gap to open.
|
|
6
|
+
local function breadcrumbHasGap(count, maxItems)
|
|
7
|
+
if maxItems == nil or maxItems <= 1 then
|
|
8
|
+
return false
|
|
9
|
+
end
|
|
10
|
+
return count > maxItems
|
|
11
|
+
end
|
|
5
12
|
--* Collapse middle items when over maxItems (keep ends).
|
|
6
13
|
local function breadcrumbVisible(items, maxItems)
|
|
7
14
|
local count = #items
|
|
@@ -71,5 +78,6 @@ local function breadcrumbVisible(items, maxItems)
|
|
|
71
78
|
end
|
|
72
79
|
return {
|
|
73
80
|
breadcrumbCurrent = breadcrumbCurrent,
|
|
81
|
+
breadcrumbHasGap = breadcrumbHasGap,
|
|
74
82
|
breadcrumbVisible = breadcrumbVisible,
|
|
75
83
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { Icons } from "../../../enums/index";
|
|
2
3
|
import { ButtonSize, ButtonColor, ButtonVariant } from "../types/index";
|
|
3
4
|
import { LoadingPosition } from "./buttonLook";
|
|
4
5
|
export type DefaultButtonComponent = TextButton;
|
|
@@ -8,6 +9,7 @@ export interface ButtonProps {
|
|
|
8
9
|
color?: ButtonColor;
|
|
9
10
|
fullWidth?: boolean;
|
|
10
11
|
variant?: ButtonVariant;
|
|
12
|
+
icon?: Icons;
|
|
11
13
|
disabled?: boolean;
|
|
12
14
|
loading?: boolean;
|
|
13
15
|
loadingLabel?: string;
|
|
@@ -5,13 +5,16 @@ local React = _react
|
|
|
5
5
|
local useEffect = _react.useEffect
|
|
6
6
|
local useState = _react.useState
|
|
7
7
|
local useReducedMotion = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "hooks").useReducedMotion
|
|
8
|
-
local
|
|
8
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
9
|
+
local controlMetrics = _theme.controlMetrics
|
|
10
|
+
local useTheme = _theme.useTheme
|
|
9
11
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
10
12
|
local CircularProgress = TS.import(script, script.Parent.Parent.Parent, "circularProgress").CircularProgress
|
|
11
13
|
local LoadingStroke = TS.import(script, script.Parent.Parent.Parent, "loadingStroke").LoadingStroke
|
|
12
14
|
local canActivate = TS.import(script, script.Parent, "activation").canActivate
|
|
13
15
|
local _buttonLook = TS.import(script, script.Parent, "buttonLook")
|
|
14
16
|
local buttonFace = _buttonLook.buttonFace
|
|
17
|
+
local buttonIcon = _buttonLook.buttonIcon
|
|
15
18
|
local spinnerPixels = _buttonLook.spinnerPixels
|
|
16
19
|
local spinnerPlace = _buttonLook.spinnerPlace
|
|
17
20
|
local useButtonStyles = TS.import(script, script.Parent, "Button.styles").default
|
|
@@ -25,6 +28,7 @@ local function Button(props)
|
|
|
25
28
|
if variant == nil then
|
|
26
29
|
variant = "contained"
|
|
27
30
|
end
|
|
31
|
+
local icon = _binding.icon
|
|
28
32
|
local disabled = _binding.disabled
|
|
29
33
|
if disabled == nil then
|
|
30
34
|
disabled = false
|
|
@@ -69,8 +73,12 @@ local function Button(props)
|
|
|
69
73
|
local font = _binding_1.font
|
|
70
74
|
local corner = _binding_1.corner
|
|
71
75
|
local stroke = _binding_1.stroke
|
|
76
|
+
local focus = _binding_1.focus
|
|
72
77
|
local _binding_2 = useTheme()
|
|
73
78
|
local theme = _binding_2.theme
|
|
79
|
+
local metrics = controlMetrics(theme.density, props.size)
|
|
80
|
+
local glyph = buttonIcon(icon, loading)
|
|
81
|
+
local grow = glyph ~= nil and props.fullWidth ~= true
|
|
74
82
|
local reducedMotion = useReducedMotion(reducedProp)
|
|
75
83
|
local hovering, setHovering = useState(false)
|
|
76
84
|
local focused, setFocused = useState(false)
|
|
@@ -115,12 +123,18 @@ local function Button(props)
|
|
|
115
123
|
_attributes.Active = active
|
|
116
124
|
_attributes.AutoButtonColor = active
|
|
117
125
|
_attributes.Selectable = active
|
|
118
|
-
_attributes.Text = face.text
|
|
119
|
-
for _k, _v in (if face.hideText then {
|
|
126
|
+
_attributes.Text = if glyph ~= nil then "" else face.text
|
|
127
|
+
for _k, _v in (if glyph ~= nil then {} elseif face.hideText then {
|
|
120
128
|
TextTransparency = 1,
|
|
121
129
|
} else {}) do
|
|
122
130
|
_attributes[_k] = _v
|
|
123
131
|
end
|
|
132
|
+
for _k, _v in (if grow then {
|
|
133
|
+
AutomaticSize = Enum.AutomaticSize.X,
|
|
134
|
+
Size = UDim2.new(0, 0, 0, metrics.buttonHeight),
|
|
135
|
+
} else {}) do
|
|
136
|
+
_attributes[_k] = _v
|
|
137
|
+
end
|
|
124
138
|
local _result
|
|
125
139
|
if pressed then
|
|
126
140
|
_result = 0.75
|
|
@@ -191,23 +205,29 @@ local function Button(props)
|
|
|
191
205
|
end
|
|
192
206
|
end,
|
|
193
207
|
}
|
|
194
|
-
local _condition_1 =
|
|
208
|
+
local _condition_1 = not busy and focused
|
|
195
209
|
if _condition_1 then
|
|
196
|
-
local _attributes_1 = table.clone(
|
|
210
|
+
local _attributes_1 = table.clone(focus)
|
|
197
211
|
setmetatable(_attributes_1, nil)
|
|
198
212
|
_condition_1 = React.createElement("uistroke", _attributes_1)
|
|
199
213
|
end
|
|
214
|
+
local _condition_2 = not busy and not focused and variant == "outlined"
|
|
215
|
+
if _condition_2 then
|
|
216
|
+
local _attributes_1 = table.clone(stroke)
|
|
217
|
+
setmetatable(_attributes_1, nil)
|
|
218
|
+
_condition_2 = React.createElement("uistroke", _attributes_1)
|
|
219
|
+
end
|
|
200
220
|
local _exp = busy and React.createElement(LoadingStroke, {
|
|
201
221
|
animating = busy and not reducedMotion,
|
|
202
222
|
color = spinnerColor,
|
|
203
223
|
})
|
|
204
|
-
local
|
|
205
|
-
if
|
|
224
|
+
local _condition_3 = rounded
|
|
225
|
+
if _condition_3 then
|
|
206
226
|
local _attributes_1 = table.clone(corner)
|
|
207
227
|
setmetatable(_attributes_1, nil)
|
|
208
|
-
|
|
228
|
+
_condition_3 = React.createElement("uicorner", _attributes_1)
|
|
209
229
|
end
|
|
210
|
-
return React.createElement(SxHost, _attributes, _condition_1, _exp,
|
|
230
|
+
return React.createElement(SxHost, _attributes, _condition_1, _condition_2, _exp, _condition_3, loading and (React.createElement(CircularProgress, {
|
|
211
231
|
size = spinnerPixels(props.size),
|
|
212
232
|
thickness = 2,
|
|
213
233
|
color = spinnerColor,
|
|
@@ -217,7 +237,36 @@ local function Button(props)
|
|
|
217
237
|
Position = UDim2.new(place.xScale, place.xOffset, 0.5, 0),
|
|
218
238
|
ZIndex = 10001,
|
|
219
239
|
},
|
|
220
|
-
})),
|
|
240
|
+
})), glyph ~= nil and (React.createElement(React.Fragment, nil, React.createElement("uipadding", {
|
|
241
|
+
PaddingLeft = UDim.new(0, theme.padding.calc(2)),
|
|
242
|
+
PaddingRight = UDim.new(0, theme.padding.calc(2)),
|
|
243
|
+
}), React.createElement("uilistlayout", {
|
|
244
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
245
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
246
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Center,
|
|
247
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
248
|
+
Padding = UDim.new(0, theme.padding.calc(1)),
|
|
249
|
+
}), React.createElement("imagelabel", {
|
|
250
|
+
key = "Icon",
|
|
251
|
+
LayoutOrder = 1,
|
|
252
|
+
BackgroundTransparency = 1,
|
|
253
|
+
BorderSizePixel = 0,
|
|
254
|
+
ScaleType = Enum.ScaleType.Fit,
|
|
255
|
+
Image = glyph,
|
|
256
|
+
ImageColor3 = spinnerColor,
|
|
257
|
+
Size = UDim2.fromOffset(metrics.icon, metrics.icon),
|
|
258
|
+
}), React.createElement("textlabel", {
|
|
259
|
+
key = "Label",
|
|
260
|
+
LayoutOrder = 2,
|
|
261
|
+
BackgroundTransparency = 1,
|
|
262
|
+
BorderSizePixel = 0,
|
|
263
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
264
|
+
Size = UDim2.fromScale(0, 0),
|
|
265
|
+
Font = theme.typography.fontFamilies.default,
|
|
266
|
+
TextSize = metrics.font,
|
|
267
|
+
TextColor3 = spinnerColor,
|
|
268
|
+
Text = face.text,
|
|
269
|
+
}))), children)
|
|
221
270
|
end
|
|
222
271
|
local default = Button
|
|
223
272
|
return {
|
|
@@ -4,6 +4,7 @@ local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "the
|
|
|
4
4
|
local controlMetrics = _theme.controlMetrics
|
|
5
5
|
local createStyles = _theme.createStyles
|
|
6
6
|
local componentStyles = _theme.componentStyles
|
|
7
|
+
local focusRing = _theme.focusRing
|
|
7
8
|
local makeRootStyles = function(theme, _param)
|
|
8
9
|
local size = _param.size
|
|
9
10
|
local color = _param.color
|
|
@@ -121,6 +122,7 @@ local useButtonStyles = componentStyles("Button", function(theme, _param)
|
|
|
121
122
|
Transparency = 0,
|
|
122
123
|
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
123
124
|
},
|
|
125
|
+
focus = focusRing(theme.palette.focus),
|
|
124
126
|
})
|
|
125
127
|
end)
|
|
126
128
|
local default = useButtonStyles
|
|
@@ -8,5 +8,7 @@ export declare function spinnerPlace(position?: LoadingPosition): {
|
|
|
8
8
|
xOffset: number;
|
|
9
9
|
anchorX: number;
|
|
10
10
|
};
|
|
11
|
+
/** An empty glyph stays off the button. Loading keeps the spinner path. */
|
|
12
|
+
export declare function buttonIcon(icon?: string, loading?: boolean): string | undefined;
|
|
11
13
|
export declare function spinnerPixels(size?: "small" | "medium" | "large"): 16 | 14 | 12;
|
|
12
14
|
export declare function iconSpinnerPixels(size?: string): 16 | 12 | 8;
|
|
@@ -29,6 +29,16 @@ local function spinnerPlace(position)
|
|
|
29
29
|
anchorX = 0.5,
|
|
30
30
|
}
|
|
31
31
|
end
|
|
32
|
+
--* An empty glyph stays off the button. Loading keeps the spinner path.
|
|
33
|
+
local function buttonIcon(icon, loading)
|
|
34
|
+
if loading == true then
|
|
35
|
+
return nil
|
|
36
|
+
end
|
|
37
|
+
if icon == nil or icon == "" then
|
|
38
|
+
return nil
|
|
39
|
+
end
|
|
40
|
+
return icon
|
|
41
|
+
end
|
|
32
42
|
local function spinnerPixels(size)
|
|
33
43
|
if size == "large" then
|
|
34
44
|
return 16
|
|
@@ -50,6 +60,7 @@ end
|
|
|
50
60
|
return {
|
|
51
61
|
buttonFace = buttonFace,
|
|
52
62
|
spinnerPlace = spinnerPlace,
|
|
63
|
+
buttonIcon = buttonIcon,
|
|
53
64
|
spinnerPixels = spinnerPixels,
|
|
54
65
|
iconSpinnerPixels = iconSpinnerPixels,
|
|
55
66
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ControlSize, CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
export interface ButtonGroupItem {
|
|
3
|
+
label: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface ButtonGroupProps {
|
|
7
|
+
items: ButtonGroupItem[];
|
|
8
|
+
onItem?: (index: number) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
size?: ControlSize;
|
|
11
|
+
}
|
|
12
|
+
declare function ButtonGroup(props: CustomizedProps<Frame, ButtonGroupProps>): JSX.Element;
|
|
13
|
+
export default ButtonGroup;
|