@rbxts/uiblox 0.2.0-alpha.37 → 0.2.0-alpha.38
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 +1 -18
- package/out/theme/constants/NumberConstants.d.ts +10 -0
- package/out/theme/constants/NumberConstants.luau +12 -0
- package/out/theme/interfaces/density/controlMetrics.luau +2 -2
- package/out/theme/interfaces/palette/Palette.d.ts +7 -0
- package/out/theme/interfaces/spacing/Shape.d.ts +6 -0
- package/out/theme/interfaces/theme/Theme.d.ts +6 -0
- package/out/theme/interfaces/typography/FontFamilies.luau +1 -0
- package/out/theme/interfaces/typography/FontFamilyOptions.d.ts +1 -1
- package/out/theme/interfaces/typography/FontSizeOptions.d.ts +1 -1
- package/out/theme/interfaces/typography/FontSizes.luau +2 -0
- package/out/theme/interfaces/typography/Variants.d.ts +3 -1
- package/out/theme/interfaces/typography/Variants.luau +25 -1
- package/out/theme/styles/utilities/focusRing.d.ts +2 -0
- package/out/theme/styles/utilities/focusRing.luau +3 -0
- package/out/theme/styles/utilities/index.d.ts +1 -1
- package/out/theme/styles/utilities/init.luau +3 -1
- package/out/theme/themes/DarkTheme.luau +4 -0
- package/out/theme/themes/LightTheme.luau +4 -0
- package/out/theme/themes/createPalette.luau +15 -0
- package/out/ui/packages/accordion/components/Accordion.luau +84 -40
- package/out/ui/packages/accordion/components/Accordion.styles.luau +35 -17
- package/out/ui/packages/alert/components/Alert.luau +15 -11
- package/out/ui/packages/alert/components/Alert.styles.luau +37 -26
- package/out/ui/packages/appBar/components/AppBar.luau +35 -13
- package/out/ui/packages/appBar/components/AppBar.styles.luau +41 -35
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +4 -0
- package/out/ui/packages/avatar/components/Avatar.d.ts +2 -0
- package/out/ui/packages/avatar/components/Avatar.luau +9 -2
- package/out/ui/packages/avatar/components/Avatar.styles.luau +7 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.luau +9 -4
- package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.luau +6 -1
- package/out/ui/packages/badge/components/Badge.luau +14 -11
- package/out/ui/packages/badge/components/Badge.styles.luau +5 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +4 -3
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +6 -2
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.styles.luau +4 -0
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +20 -2
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.styles.luau +72 -66
- package/out/ui/packages/button/components/Button.luau +61 -34
- package/out/ui/packages/button/components/buttonPaint.d.ts +16 -0
- package/out/ui/packages/button/components/buttonPaint.luau +70 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.d.ts +1 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.luau +17 -2
- package/out/ui/packages/card/components/Card.styles.luau +4 -2
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +9 -1
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +50 -41
- package/out/ui/packages/checkbox/components/Checkbox.luau +5 -4
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +2 -2
- package/out/ui/packages/checkbox/components/checkboxLook.luau +2 -2
- package/out/ui/packages/chip/components/Chip.luau +16 -14
- package/out/ui/packages/chip/components/Chip.styles.luau +7 -4
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +10 -3
- package/out/ui/packages/codeEditor/components/CodeEditor.d.ts +12 -0
- package/out/ui/packages/codeEditor/components/CodeEditor.luau +262 -0
- package/out/ui/packages/codeEditor/components/CodeEditor.styles.d.ts +6 -0
- package/out/ui/packages/codeEditor/components/CodeEditor.styles.luau +124 -0
- package/out/ui/packages/codeEditor/highlightCode.d.ts +11 -0
- package/out/ui/packages/codeEditor/highlightCode.luau +503 -0
- package/out/ui/packages/codeEditor/index.d.ts +2 -0
- package/out/ui/packages/codeEditor/init.luau +5 -0
- package/out/ui/packages/colorPicker/components/ColorPicker.luau +9 -1
- package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +74 -67
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +12 -4
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +12 -4
- package/out/ui/packages/dateRange/components/DateRangePicker.luau +31 -19
- package/out/ui/packages/dialog/components/Dialog.styles.luau +4 -2
- package/out/ui/packages/divider/components/Divider.luau +3 -1
- package/out/ui/packages/divider/components/Divider.styles.luau +1 -0
- package/out/ui/packages/drawer/components/Drawer.d.ts +1 -0
- package/out/ui/packages/drawer/components/Drawer.luau +43 -14
- package/out/ui/packages/drawer/components/Drawer.styles.luau +13 -5
- package/out/ui/packages/drawer/components/drawerPlacement.d.ts +2 -0
- package/out/ui/packages/drawer/components/drawerPlacement.luau +18 -0
- package/out/ui/packages/editorFace.d.ts +22 -0
- package/out/ui/packages/editorFace.luau +49 -0
- package/out/ui/packages/fab/components/Fab.luau +19 -6
- package/out/ui/packages/fab/components/Fab.styles.luau +4 -3
- package/out/ui/packages/fab/components/fabSize.d.ts +1 -1
- package/out/ui/packages/fontEditor/components/FontEditor.luau +13 -3
- package/out/ui/packages/fontEditor/components/FontEditor.styles.luau +36 -27
- package/out/ui/packages/gradientEditor/components/GradientEditor.luau +21 -13
- package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +52 -44
- package/out/ui/packages/icon/components/DrawnGlyph.d.ts +11 -0
- package/out/ui/packages/icon/components/DrawnGlyph.luau +87 -0
- package/out/ui/packages/icon/components/Icon.d.ts +6 -2
- package/out/ui/packages/icon/components/Icon.luau +23 -3
- package/out/ui/packages/icon/components/Icon.styles.luau +3 -0
- package/out/ui/packages/icon/components/glyphs.d.ts +28 -0
- package/out/ui/packages/icon/components/glyphs.luau +64 -0
- package/out/ui/packages/icon/index.d.ts +1 -0
- package/out/ui/packages/iconButton/components/IconButton.d.ts +5 -2
- package/out/ui/packages/iconButton/components/IconButton.luau +83 -16
- package/out/ui/packages/iconButton/components/IconButton.styles.luau +4 -27
- package/out/ui/packages/iconButton/components/iconButtonBox.d.ts +11 -0
- package/out/ui/packages/iconButton/components/iconButtonBox.luau +48 -0
- package/out/ui/packages/iconButton/components/transportGlyph.d.ts +1 -0
- package/out/ui/packages/iconButton/components/transportGlyph.luau +4 -0
- package/out/ui/packages/imageList/components/ImageList.luau +11 -36
- package/out/ui/packages/imageList/components/ImageList.styles.luau +1 -0
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +0 -2
- package/out/ui/packages/imageList/components/imageListLayout.luau +0 -8
- package/out/ui/packages/index.d.ts +1 -0
- package/out/ui/packages/init.luau +3 -0
- package/out/ui/packages/input/components/Input.luau +46 -29
- package/out/ui/packages/input/components/Input.styles.luau +8 -11
- package/out/ui/packages/input/components/fieldChrome.d.ts +5 -0
- package/out/ui/packages/input/components/fieldChrome.luau +11 -0
- package/out/ui/packages/layout/components/Box.luau +92 -13
- package/out/ui/packages/layout/components/Box.styles.d.ts +0 -2
- package/out/ui/packages/layout/components/Box.styles.luau +0 -9
- package/out/ui/packages/layout/components/Grid.luau +81 -16
- package/out/ui/packages/layout/components/Pad.d.ts +24 -0
- package/out/ui/packages/layout/components/Pad.luau +88 -0
- package/out/ui/packages/layout/components/Stack.luau +79 -13
- package/out/ui/packages/link/components/Link.luau +19 -13
- package/out/ui/packages/link/components/Link.styles.luau +10 -1
- package/out/ui/packages/listItem/components/ListItem.luau +61 -4
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +28 -11
- package/out/ui/packages/listItem/components/listItemInk.d.ts +1 -1
- package/out/ui/packages/listItem/components/listItemLayout.d.ts +12 -2
- package/out/ui/packages/listItem/components/listItemLayout.luau +29 -2
- package/out/ui/packages/markdown/components/Markdown.luau +163 -50
- package/out/ui/packages/markdown/components/Markdown.styles.luau +125 -76
- package/out/ui/packages/markdown/components/MarkdownEditor.luau +215 -146
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +1 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +153 -83
- package/out/ui/packages/markdown/index.d.ts +1 -1
- package/out/ui/packages/markdown/parseMarkdown.d.ts +9 -1
- package/out/ui/packages/markdown/parseMarkdown.luau +350 -29
- package/out/ui/packages/menu/components/Menu.d.ts +1 -1
- package/out/ui/packages/menu/components/Menu.luau +12 -11
- package/out/ui/packages/menu/components/Menu.styles.luau +6 -1
- package/out/ui/packages/menu/components/menuIcon.d.ts +1 -1
- package/out/ui/packages/numberInput/components/NumberInput.luau +19 -4
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +9 -1
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.styles.luau +23 -16
- package/out/ui/packages/pager/components/Pager.luau +15 -13
- package/out/ui/packages/pager/components/Pager.styles.luau +5 -0
- package/out/ui/packages/pagination/components/Pagination.styles.luau +4 -1
- package/out/ui/packages/paper/components/Paper.luau +17 -11
- package/out/ui/packages/paper/components/Paper.styles.luau +12 -5
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +9 -1
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +24 -19
- package/out/ui/packages/popover/components/Popover.d.ts +1 -1
- package/out/ui/packages/popover/components/Popover.luau +6 -4
- package/out/ui/packages/popover/components/Popover.styles.luau +6 -0
- package/out/ui/packages/popup/components/Popup.d.ts +2 -0
- package/out/ui/packages/popup/components/Popup.luau +64 -2
- package/out/ui/packages/popup/components/placement.luau +6 -4
- package/out/ui/packages/progressBar/components/ProgressBar.luau +1 -1
- package/out/ui/packages/progressBar/components/ProgressBar.styles.luau +3 -2
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +2 -1
- package/out/ui/packages/rating/components/Rating.luau +45 -3
- package/out/ui/packages/rating/components/Rating.styles.luau +1 -1
- package/out/ui/packages/rayEditor/components/RayEditor.luau +9 -1
- package/out/ui/packages/rayEditor/components/RayEditor.styles.luau +17 -11
- package/out/ui/packages/rectEditor/components/RectEditor.luau +9 -1
- package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +49 -42
- package/out/ui/packages/select/components/Select.d.ts +2 -0
- package/out/ui/packages/select/components/Select.luau +148 -106
- package/out/ui/packages/select/components/Select.styles.d.ts +2 -0
- package/out/ui/packages/select/components/Select.styles.luau +29 -5
- package/out/ui/packages/shadow/components/Shadow.luau +188 -19
- package/out/ui/packages/sidebar/components/Sidebar.styles.luau +1 -0
- package/out/ui/packages/skeleton/components/Skeleton.luau +4 -0
- package/out/ui/packages/slider/components/RangeSlider.luau +6 -5
- package/out/ui/packages/slider/components/Slider.luau +11 -16
- package/out/ui/packages/sparkline/components/Sparkline.luau +7 -5
- package/out/ui/packages/speedDial/components/SpeedDial.luau +4 -1
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +5 -0
- package/out/ui/packages/speedDial/components/speedDialLabel.d.ts +1 -1
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stepper/components/Stepper.styles.luau +9 -6
- package/out/ui/packages/switch/components/Switch.luau +2 -2
- package/out/ui/packages/switch/components/switchLook.d.ts +3 -3
- package/out/ui/packages/switch/components/switchLook.luau +4 -10
- package/out/ui/packages/table/components/Table.d.ts +1 -0
- package/out/ui/packages/table/components/Table.luau +92 -53
- package/out/ui/packages/table/components/Table.styles.luau +23 -6
- package/out/ui/packages/table/components/tableColumns.d.ts +2 -0
- package/out/ui/packages/table/components/tableColumns.luau +2 -0
- package/out/ui/packages/tabs/components/Tabs.luau +7 -4
- package/out/ui/packages/tabs/components/Tabs.styles.luau +12 -11
- package/out/ui/packages/tabs/components/tabIndicator.d.ts +7 -0
- package/out/ui/packages/tabs/components/tabIndicator.luau +21 -0
- package/out/ui/packages/text/components/Text.d.ts +2 -0
- package/out/ui/packages/text/components/Text.luau +12 -2
- package/out/ui/packages/timeField/components/TimeField.luau +11 -7
- package/out/ui/packages/timeline/components/Timeline.luau +35 -32
- package/out/ui/packages/timeline/components/Timeline.styles.luau +19 -10
- package/out/ui/packages/toast/components/Toast.luau +168 -72
- package/out/ui/packages/toast/components/Toast.styles.luau +36 -19
- package/out/ui/packages/toast/components/toastPlace.d.ts +4 -0
- package/out/ui/packages/toast/components/toastPlace.luau +13 -0
- package/out/ui/packages/toast/enums/ToastVariants.d.ts +2 -1
- package/out/ui/packages/toast/enums/ToastVariants.luau +1 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +43 -4
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +1 -1
- package/out/ui/packages/tooltip/components/Tooltip.styles.luau +2 -2
- package/out/ui/packages/treeView/components/TreeView.luau +12 -13
- package/out/ui/packages/treeView/components/TreeView.styles.luau +6 -0
- package/out/ui/packages/typography/components/Typography.d.ts +2 -0
- package/out/ui/packages/typography/components/Typography.luau +8 -0
- package/out/ui/packages/typography/components/Typography.styles.luau +3 -1
- package/out/ui/packages/udimEditor/components/UDimEditor.luau +9 -1
- package/out/ui/packages/udimEditor/components/UDimEditor.styles.luau +25 -18
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +17 -3
- package/out/ui/packages/vectorEditor/components/VectorEditor.styles.luau +30 -16
- package/out/ui/packages/virtualList/components/VirtualList.styles.luau +1 -0
- package/package.json +69 -67
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
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
|
+
local controlMetrics = _theme.controlMetrics
|
|
5
6
|
local createStyles = _theme.createStyles
|
|
6
7
|
local useAccordionStyles = componentStyles("Accordion", function(theme, _param)
|
|
7
8
|
local disabled = _param.disabled
|
|
9
|
+
local heading = theme.typography.variants.h6
|
|
10
|
+
local padX = theme.padding.calc(1.5)
|
|
11
|
+
local padY = theme.padding.calc(1)
|
|
12
|
+
local icon = controlMetrics(theme.density).icon
|
|
13
|
+
local firstLine = padY + math.floor((heading.size * heading.leading) / 2)
|
|
8
14
|
local _object = {
|
|
9
15
|
root = {
|
|
10
16
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
@@ -27,20 +33,38 @@ local useAccordionStyles = componentStyles("Accordion", function(theme, _param)
|
|
|
27
33
|
Active = disabled ~= true,
|
|
28
34
|
Selectable = disabled ~= true,
|
|
29
35
|
},
|
|
36
|
+
hover = {
|
|
37
|
+
BackgroundColor3 = theme.palette.action.hover,
|
|
38
|
+
BackgroundTransparency = 0,
|
|
39
|
+
},
|
|
40
|
+
tail = {
|
|
41
|
+
PaddingBottom = UDim.new(0, padY),
|
|
42
|
+
},
|
|
43
|
+
band = {
|
|
44
|
+
Position = UDim2.new(0, padX, 0, padY),
|
|
45
|
+
Size = UDim2.new(1, -(padX * 2), 0, 0),
|
|
46
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
47
|
+
BackgroundTransparency = 1,
|
|
48
|
+
BorderSizePixel = 0,
|
|
49
|
+
},
|
|
30
50
|
title = {
|
|
31
51
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
32
|
-
|
|
52
|
+
Position = UDim2.new(0, padX, 0, padY),
|
|
53
|
+
Size = UDim2.new(1, -(padX * 2 + icon), 0, 0),
|
|
33
54
|
BackgroundTransparency = 1,
|
|
34
55
|
BorderSizePixel = 0,
|
|
35
|
-
Font = theme.typography.fontFamilies.
|
|
36
|
-
TextSize =
|
|
56
|
+
Font = theme.typography.fontFamilies[heading.family],
|
|
57
|
+
TextSize = heading.size,
|
|
58
|
+
LineHeight = heading.leading,
|
|
59
|
+
TextWrapped = true,
|
|
37
60
|
TextColor3 = theme.palette.text.primary,
|
|
38
61
|
TextTransparency = if disabled == true then 0.5 else 0,
|
|
39
62
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
40
63
|
},
|
|
41
64
|
copy = {
|
|
42
65
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
43
|
-
|
|
66
|
+
Position = UDim2.new(0, padX, 0, padY),
|
|
67
|
+
Size = UDim2.new(1, -(padX * 2 + icon), 0, 0),
|
|
44
68
|
BackgroundTransparency = 1,
|
|
45
69
|
BorderSizePixel = 0,
|
|
46
70
|
},
|
|
@@ -59,25 +83,14 @@ local useAccordionStyles = componentStyles("Accordion", function(theme, _param)
|
|
|
59
83
|
_condition = theme.typography.fontSizes.body
|
|
60
84
|
end
|
|
61
85
|
_object_1[_left_1] = _condition
|
|
86
|
+
_object_1.TextWrapped = true
|
|
62
87
|
_object_1.TextColor3 = theme.palette.text.secondary
|
|
63
88
|
_object_1.TextTransparency = if disabled == true then 0.5 else 0
|
|
64
89
|
_object_1.TextXAlignment = Enum.TextXAlignment.Left
|
|
65
90
|
_object[_left] = _object_1
|
|
66
91
|
_object.icon = {
|
|
67
|
-
|
|
68
|
-
Position = UDim2.new(1, -theme.padding.calc(1.5), 0.5, 0),
|
|
92
|
+
Position = UDim2.new(1, -padX, 0, firstLine),
|
|
69
93
|
AnchorPoint = Vector2.new(1, 0.5),
|
|
70
|
-
BackgroundTransparency = 1,
|
|
71
|
-
BorderSizePixel = 0,
|
|
72
|
-
ScaleType = Enum.ScaleType.Fit,
|
|
73
|
-
ImageColor3 = theme.palette.text.primary,
|
|
74
|
-
ImageTransparency = if disabled == true then 0.5 else 0,
|
|
75
|
-
}
|
|
76
|
-
_object.padding = {
|
|
77
|
-
PaddingTop = UDim.new(0, theme.padding.calc(1)),
|
|
78
|
-
PaddingBottom = UDim.new(0, theme.padding.calc(1)),
|
|
79
|
-
PaddingLeft = UDim.new(0, theme.padding.calc(1.5)),
|
|
80
|
-
PaddingRight = UDim.new(0, theme.padding.calc(1.5)),
|
|
81
94
|
}
|
|
82
95
|
_object.body = {
|
|
83
96
|
LayoutOrder = 2,
|
|
@@ -89,6 +102,11 @@ local useAccordionStyles = componentStyles("Accordion", function(theme, _param)
|
|
|
89
102
|
_object.corner = {
|
|
90
103
|
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
91
104
|
}
|
|
105
|
+
_object.stroke = {
|
|
106
|
+
Color = theme.palette.border,
|
|
107
|
+
Thickness = 1,
|
|
108
|
+
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
109
|
+
}
|
|
92
110
|
return createStyles(_object)
|
|
93
111
|
end)
|
|
94
112
|
local default = useAccordionStyles
|
|
@@ -1,8 +1,8 @@
|
|
|
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 Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
|
|
5
4
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
5
|
+
local IconButton = TS.import(script, script.Parent.Parent.Parent, "iconButton").IconButton
|
|
6
6
|
local alertAction = TS.import(script, script.Parent, "alertAction").alertAction
|
|
7
7
|
local useAlertStyles = TS.import(script, script.Parent, "Alert.styles").default
|
|
8
8
|
local function Alert(props)
|
|
@@ -53,18 +53,22 @@ local function Alert(props)
|
|
|
53
53
|
local _condition_2 = dismissible
|
|
54
54
|
if _condition_2 then
|
|
55
55
|
local _attributes_3 = {
|
|
56
|
-
|
|
56
|
+
id = "Close",
|
|
57
|
+
glyph = "close",
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
local _result = (styles.closeGlyph).Size
|
|
60
|
+
if _result ~= nil then
|
|
61
|
+
_result = _result.X.Offset
|
|
60
62
|
end
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
local _condition_3 = _result
|
|
64
|
+
if _condition_3 == nil then
|
|
65
|
+
_condition_3 = 16
|
|
66
|
+
end
|
|
67
|
+
_attributes_3.iconSize = _condition_3
|
|
68
|
+
_attributes_3.tint = (styles.closeGlyph).ImageColor3
|
|
69
|
+
_attributes_3.className = styles.close
|
|
70
|
+
_attributes_3.onClick = onClose
|
|
71
|
+
_condition_2 = (React.createElement(IconButton, _attributes_3))
|
|
68
72
|
end
|
|
69
73
|
local _attributes_3 = {
|
|
70
74
|
key = "Body",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
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
|
+
local controlMetrics = _theme.controlMetrics
|
|
5
6
|
local createStyles = _theme.createStyles
|
|
6
7
|
local alertSeverity = TS.import(script, script.Parent, "alertTone").alertSeverity
|
|
7
8
|
local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
@@ -9,7 +10,17 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
|
9
10
|
local dismissible = _param.dismissible
|
|
10
11
|
local filled = _param.filled
|
|
11
12
|
local tone = theme.palette.status[alertSeverity(severity)]
|
|
12
|
-
local
|
|
13
|
+
local padX = theme.padding.calc(2)
|
|
14
|
+
local padY = theme.padding.calc(1.5)
|
|
15
|
+
local _condition = theme.typography.fontSizes.body
|
|
16
|
+
if _condition == nil then
|
|
17
|
+
_condition = theme.typography.variants.body.size
|
|
18
|
+
end
|
|
19
|
+
local glyph = _condition
|
|
20
|
+
local icon = controlMetrics(theme.density).icon
|
|
21
|
+
local hit = math.max(theme.spacing.calc(3), icon + theme.padding.calc(2))
|
|
22
|
+
local closeGap = if dismissible == true then hit + theme.padding.calc(1) else 0
|
|
23
|
+
local ink = if filled == true then tone.on else theme.palette.text.primary
|
|
13
24
|
local _object = {
|
|
14
25
|
root = {
|
|
15
26
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
@@ -18,10 +29,7 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
|
18
29
|
BorderSizePixel = 0,
|
|
19
30
|
},
|
|
20
31
|
padding = {
|
|
21
|
-
|
|
22
|
-
PaddingBottom = UDim.new(0, theme.padding.calc(1.5)),
|
|
23
|
-
PaddingLeft = UDim.new(0, theme.padding.calc(2)),
|
|
24
|
-
PaddingRight = UDim.new(0, theme.padding.calc(2)),
|
|
32
|
+
PaddingBottom = UDim.new(0, padY),
|
|
25
33
|
},
|
|
26
34
|
corner = {
|
|
27
35
|
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
@@ -33,8 +41,9 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
|
33
41
|
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
34
42
|
},
|
|
35
43
|
body = {
|
|
44
|
+
Position = UDim2.new(0, padX, 0, padY),
|
|
36
45
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
37
|
-
Size = UDim2.new(1,
|
|
46
|
+
Size = UDim2.new(1, -(padX * 2 + closeGap), 0, 0),
|
|
38
47
|
BackgroundTransparency = 1,
|
|
39
48
|
BorderSizePixel = 0,
|
|
40
49
|
},
|
|
@@ -46,57 +55,59 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
|
46
55
|
Padding = UDim.new(0, theme.padding.calc(0.5)),
|
|
47
56
|
},
|
|
48
57
|
title = {
|
|
49
|
-
AutomaticSize = Enum.AutomaticSize.
|
|
50
|
-
Size = UDim2.
|
|
58
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
59
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
51
60
|
BackgroundTransparency = 1,
|
|
52
61
|
BorderSizePixel = 0,
|
|
53
62
|
Font = theme.typography.fontFamilies.default,
|
|
54
63
|
TextSize = theme.typography.fontSizes.body,
|
|
55
|
-
TextColor3 =
|
|
64
|
+
TextColor3 = ink,
|
|
56
65
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
66
|
+
TextWrapped = true,
|
|
57
67
|
LayoutOrder = 1,
|
|
58
68
|
},
|
|
59
69
|
}
|
|
60
70
|
local _left = "message"
|
|
61
71
|
local _object_1 = {
|
|
62
|
-
AutomaticSize = Enum.AutomaticSize.
|
|
63
|
-
Size = UDim2.
|
|
72
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
73
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
64
74
|
BackgroundTransparency = 1,
|
|
65
75
|
BorderSizePixel = 0,
|
|
66
76
|
Font = theme.typography.fontFamilies.default,
|
|
67
77
|
}
|
|
68
78
|
local _left_1 = "TextSize"
|
|
69
|
-
local
|
|
70
|
-
if
|
|
71
|
-
|
|
79
|
+
local _condition_1 = theme.typography.fontSizes.caption
|
|
80
|
+
if _condition_1 == nil then
|
|
81
|
+
_condition_1 = theme.typography.fontSizes.body
|
|
72
82
|
end
|
|
73
|
-
_object_1[_left_1] =
|
|
74
|
-
_object_1.TextColor3 =
|
|
83
|
+
_object_1[_left_1] = _condition_1
|
|
84
|
+
_object_1.TextColor3 = ink
|
|
75
85
|
_object_1.TextXAlignment = Enum.TextXAlignment.Left
|
|
76
86
|
_object_1.TextWrapped = true
|
|
77
87
|
_object_1.LayoutOrder = 2
|
|
78
88
|
_object[_left] = _object_1
|
|
79
89
|
_object.action = {
|
|
80
|
-
AutomaticSize = Enum.AutomaticSize.
|
|
81
|
-
Size = UDim2.
|
|
90
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
91
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
92
|
+
TextWrapped = true,
|
|
82
93
|
BackgroundTransparency = 1,
|
|
83
94
|
BorderSizePixel = 0,
|
|
84
95
|
Font = theme.typography.fontFamilies.default,
|
|
85
96
|
TextSize = theme.typography.fontSizes.body,
|
|
86
|
-
TextColor3 =
|
|
97
|
+
TextColor3 = ink,
|
|
87
98
|
AutoButtonColor = false,
|
|
88
99
|
LayoutOrder = 3,
|
|
89
100
|
}
|
|
90
101
|
_object.close = {
|
|
91
|
-
Size = UDim2.fromOffset(
|
|
92
|
-
Position = UDim2.new(1,
|
|
93
|
-
AnchorPoint = Vector2.new(1, 0),
|
|
94
|
-
BackgroundTransparency = 1,
|
|
95
|
-
BorderSizePixel = 0,
|
|
96
|
-
ImageColor3 = if filled == true then tone.on else theme.palette.text.secondary,
|
|
97
|
-
ScaleType = Enum.ScaleType.Fit,
|
|
102
|
+
Size = UDim2.fromOffset(hit, hit),
|
|
103
|
+
Position = UDim2.new(1, -padX, 0, padY + glyph / 2),
|
|
104
|
+
AnchorPoint = Vector2.new(1, 0.5),
|
|
98
105
|
ZIndex = 2,
|
|
99
106
|
}
|
|
107
|
+
_object.closeGlyph = {
|
|
108
|
+
Size = UDim2.fromOffset(icon, icon),
|
|
109
|
+
ImageColor3 = ink,
|
|
110
|
+
}
|
|
100
111
|
return createStyles(_object)
|
|
101
112
|
end)
|
|
102
113
|
local default = useAlertStyles
|
|
@@ -43,7 +43,10 @@ local function AppBar(props)
|
|
|
43
43
|
_attributes[_k] = _v
|
|
44
44
|
end
|
|
45
45
|
_attributes.Text = title
|
|
46
|
-
_condition = React.createElement("textlabel", _attributes
|
|
46
|
+
_condition = (React.createElement("textlabel", _attributes, hasActions and React.createElement("uiflexitem", {
|
|
47
|
+
key = "Flex",
|
|
48
|
+
FlexMode = Enum.UIFlexMode.Fill,
|
|
49
|
+
})))
|
|
47
50
|
end
|
|
48
51
|
_result = _condition
|
|
49
52
|
else
|
|
@@ -53,7 +56,11 @@ local function AppBar(props)
|
|
|
53
56
|
for _k, _v in styles.titles do
|
|
54
57
|
_attributes[_k] = _v
|
|
55
58
|
end
|
|
56
|
-
local _exp = React.createElement("
|
|
59
|
+
local _exp = hasActions and React.createElement("uiflexitem", {
|
|
60
|
+
key = "Flex",
|
|
61
|
+
FlexMode = Enum.UIFlexMode.Fill,
|
|
62
|
+
})
|
|
63
|
+
local _exp_1 = React.createElement("uilistlayout", {
|
|
57
64
|
FillDirection = Enum.FillDirection.Vertical,
|
|
58
65
|
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
59
66
|
HorizontalAlignment = Enum.HorizontalAlignment.Left,
|
|
@@ -68,8 +75,10 @@ local function AppBar(props)
|
|
|
68
75
|
for _k, _v in styles.title do
|
|
69
76
|
_attributes_1[_k] = _v
|
|
70
77
|
end
|
|
71
|
-
_attributes_1.Size = UDim2.new(
|
|
72
|
-
_attributes_1.AutomaticSize = Enum.AutomaticSize.
|
|
78
|
+
_attributes_1.Size = UDim2.new(1, 0, 0, 0)
|
|
79
|
+
_attributes_1.AutomaticSize = Enum.AutomaticSize.Y
|
|
80
|
+
_attributes_1.TextWrapped = true
|
|
81
|
+
_attributes_1.TextTruncate = Enum.TextTruncate.None
|
|
73
82
|
_attributes_1.Text = title
|
|
74
83
|
_attributes_1.LayoutOrder = 1
|
|
75
84
|
_condition = (React.createElement("textlabel", _attributes_1))
|
|
@@ -82,7 +91,7 @@ local function AppBar(props)
|
|
|
82
91
|
end
|
|
83
92
|
_attributes_1.Text = line
|
|
84
93
|
_attributes_1.LayoutOrder = 2
|
|
85
|
-
_result = (React.createElement("frame", _attributes, _exp, _condition, React.createElement("textlabel", _attributes_1)))
|
|
94
|
+
_result = (React.createElement("frame", _attributes, _exp, _exp_1, _condition, React.createElement("textlabel", _attributes_1)))
|
|
86
95
|
end
|
|
87
96
|
local titleLabel = _result
|
|
88
97
|
local _attributes = {
|
|
@@ -97,16 +106,29 @@ local function AppBar(props)
|
|
|
97
106
|
_attributes.base = styles.root
|
|
98
107
|
_attributes.className = className
|
|
99
108
|
_attributes.sx = sx
|
|
100
|
-
local
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
109
|
+
local _exp = elevation == "raised" and React.createElement(Shadow)
|
|
110
|
+
local _condition_1 = elevation == "flat" and color == "default"
|
|
111
|
+
if _condition_1 then
|
|
112
|
+
local _attributes_1 = {
|
|
113
|
+
key = "Divider",
|
|
114
|
+
}
|
|
115
|
+
for _k, _v in styles.divider do
|
|
116
|
+
_attributes_1[_k] = _v
|
|
117
|
+
end
|
|
118
|
+
_condition_1 = React.createElement("frame", _attributes_1)
|
|
119
|
+
end
|
|
120
|
+
local _attributes_1 = {
|
|
121
|
+
key = "Inset",
|
|
122
|
+
}
|
|
123
|
+
for _k, _v in styles.inset do
|
|
124
|
+
_attributes_1[_k] = _v
|
|
125
|
+
end
|
|
104
126
|
local _result_1
|
|
105
127
|
if hasActions then
|
|
106
128
|
local _attributes_2 = table.clone(styles.row)
|
|
107
129
|
setmetatable(_attributes_2, nil)
|
|
108
|
-
local
|
|
109
|
-
local
|
|
130
|
+
local _exp_1 = React.createElement("uilistlayout", _attributes_2)
|
|
131
|
+
local _exp_2 = titleLabel
|
|
110
132
|
local _attributes_3 = {
|
|
111
133
|
key = "Actions",
|
|
112
134
|
}
|
|
@@ -120,11 +142,11 @@ local function AppBar(props)
|
|
|
120
142
|
Size = UDim2.fromScale(1, 1),
|
|
121
143
|
BackgroundTransparency = 1,
|
|
122
144
|
BorderSizePixel = 0,
|
|
123
|
-
},
|
|
145
|
+
}, _exp_1, _exp_2, React.createElement("frame", _attributes_3, React.createElement("uilistlayout", _attributes_4), children)))
|
|
124
146
|
else
|
|
125
147
|
_result_1 = titleLabel
|
|
126
148
|
end
|
|
127
|
-
return React.createElement(SxHost, _attributes, _exp,
|
|
149
|
+
return React.createElement(SxHost, _attributes, _exp, _condition_1, React.createElement("frame", _attributes_1, _result_1))
|
|
128
150
|
end
|
|
129
151
|
local default = AppBar
|
|
130
152
|
return {
|
|
@@ -16,6 +16,8 @@ local useAppBarStyles = componentStyles("AppBar", function(theme, _param)
|
|
|
16
16
|
if hasActions == nil then
|
|
17
17
|
hasActions = false
|
|
18
18
|
end
|
|
19
|
+
local heading = theme.typography.variants.h6
|
|
20
|
+
local pad = theme.padding.calc(2)
|
|
19
21
|
local _object = {
|
|
20
22
|
root = {
|
|
21
23
|
Size = UDim2.new(1, 0, 0, theme.spacing.calc(7)),
|
|
@@ -23,9 +25,18 @@ local useAppBarStyles = componentStyles("AppBar", function(theme, _param)
|
|
|
23
25
|
BorderSizePixel = 0,
|
|
24
26
|
ZIndex = 11000,
|
|
25
27
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
divider = {
|
|
29
|
+
AnchorPoint = Vector2.new(0, 1),
|
|
30
|
+
Position = UDim2.fromScale(0, 1),
|
|
31
|
+
Size = UDim2.new(1, 0, 0, 1),
|
|
32
|
+
BackgroundColor3 = theme.palette.border,
|
|
33
|
+
BorderSizePixel = 0,
|
|
34
|
+
},
|
|
35
|
+
inset = {
|
|
36
|
+
Position = UDim2.new(0, pad, 0, 0),
|
|
37
|
+
Size = UDim2.new(1, -(pad * 2), 1, 0),
|
|
38
|
+
BackgroundTransparency = 1,
|
|
39
|
+
BorderSizePixel = 0,
|
|
29
40
|
},
|
|
30
41
|
row = {
|
|
31
42
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
@@ -33,51 +44,46 @@ local useAppBarStyles = componentStyles("AppBar", function(theme, _param)
|
|
|
33
44
|
HorizontalFlex = Enum.UIFlexAlignment.SpaceBetween,
|
|
34
45
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
35
46
|
},
|
|
47
|
+
title = {
|
|
48
|
+
LayoutOrder = 1,
|
|
49
|
+
AutomaticSize = Enum.AutomaticSize.None,
|
|
50
|
+
Size = if hasActions then UDim2.new(0, 0, 1, 0) else UDim2.new(1, 0, 1, 0),
|
|
51
|
+
BackgroundTransparency = 1,
|
|
52
|
+
BorderSizePixel = 0,
|
|
53
|
+
Font = theme.typography.fontFamilies[heading.family],
|
|
54
|
+
TextSize = heading.size,
|
|
55
|
+
LineHeight = heading.leading,
|
|
56
|
+
TextColor3 = if color == "primary" then theme.palette.primary.on else theme.palette.text.primary,
|
|
57
|
+
TextXAlignment = Enum.TextXAlignment.Left,
|
|
58
|
+
TextYAlignment = Enum.TextYAlignment.Center,
|
|
59
|
+
TextTruncate = Enum.TextTruncate.AtEnd,
|
|
60
|
+
},
|
|
61
|
+
titles = {
|
|
62
|
+
LayoutOrder = 1,
|
|
63
|
+
AutomaticSize = if hasActions then Enum.AutomaticSize.None else Enum.AutomaticSize.Y,
|
|
64
|
+
Size = if hasActions then UDim2.new(0, 0, 1, 0) else UDim2.new(1, 0, 1, 0),
|
|
65
|
+
BackgroundTransparency = 1,
|
|
66
|
+
BorderSizePixel = 0,
|
|
67
|
+
},
|
|
36
68
|
}
|
|
37
|
-
local _left = "
|
|
69
|
+
local _left = "subtitle"
|
|
38
70
|
local _object_1 = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
71
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
72
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
73
|
+
TextWrapped = true,
|
|
42
74
|
BackgroundTransparency = 1,
|
|
43
75
|
BorderSizePixel = 0,
|
|
44
76
|
Font = theme.typography.fontFamilies.default,
|
|
45
77
|
}
|
|
46
78
|
local _left_1 = "TextSize"
|
|
47
|
-
local _condition = theme.typography.fontSizes.
|
|
79
|
+
local _condition = theme.typography.fontSizes.caption
|
|
48
80
|
if _condition == nil then
|
|
49
81
|
_condition = theme.typography.fontSizes.body
|
|
50
82
|
end
|
|
51
83
|
_object_1[_left_1] = _condition
|
|
52
|
-
_object_1.TextColor3 = if color == "primary" then theme.palette.primary.on else theme.palette.text.
|
|
84
|
+
_object_1.TextColor3 = if color == "primary" then theme.palette.primary.on else theme.palette.text.secondary
|
|
53
85
|
_object_1.TextXAlignment = Enum.TextXAlignment.Left
|
|
54
|
-
_object_1.TextYAlignment = Enum.TextYAlignment.Center
|
|
55
|
-
_object_1.TextTruncate = Enum.TextTruncate.AtEnd
|
|
56
86
|
_object[_left] = _object_1
|
|
57
|
-
_object.titles = {
|
|
58
|
-
LayoutOrder = 1,
|
|
59
|
-
AutomaticSize = if hasActions then Enum.AutomaticSize.XY else Enum.AutomaticSize.Y,
|
|
60
|
-
Size = if hasActions then UDim2.fromScale(0, 0) else UDim2.new(1, 0, 1, 0),
|
|
61
|
-
BackgroundTransparency = 1,
|
|
62
|
-
BorderSizePixel = 0,
|
|
63
|
-
}
|
|
64
|
-
local _left_2 = "subtitle"
|
|
65
|
-
local _object_2 = {
|
|
66
|
-
AutomaticSize = Enum.AutomaticSize.XY,
|
|
67
|
-
Size = UDim2.fromScale(0, 0),
|
|
68
|
-
BackgroundTransparency = 1,
|
|
69
|
-
BorderSizePixel = 0,
|
|
70
|
-
Font = theme.typography.fontFamilies.default,
|
|
71
|
-
}
|
|
72
|
-
local _left_3 = "TextSize"
|
|
73
|
-
local _condition_1 = theme.typography.fontSizes.caption
|
|
74
|
-
if _condition_1 == nil then
|
|
75
|
-
_condition_1 = theme.typography.fontSizes.body
|
|
76
|
-
end
|
|
77
|
-
_object_2[_left_3] = _condition_1
|
|
78
|
-
_object_2.TextColor3 = if color == "primary" then theme.palette.primary.on else theme.palette.text.secondary
|
|
79
|
-
_object_2.TextXAlignment = Enum.TextXAlignment.Left
|
|
80
|
-
_object[_left_2] = _object_2
|
|
81
87
|
_object.actions = {
|
|
82
88
|
LayoutOrder = 2,
|
|
83
89
|
AutomaticSize = Enum.AutomaticSize.X,
|
|
@@ -19,6 +19,8 @@ local function Autocomplete(props)
|
|
|
19
19
|
local empty = _binding.empty
|
|
20
20
|
local reducedMotion = _binding.reducedMotion
|
|
21
21
|
local size = _binding.size
|
|
22
|
+
local hasError = _binding.hasError
|
|
23
|
+
local helperText = _binding.helperText
|
|
22
24
|
local className = _binding.className
|
|
23
25
|
local sx = _binding.sx
|
|
24
26
|
local id = _binding.id
|
|
@@ -38,6 +40,8 @@ local function Autocomplete(props)
|
|
|
38
40
|
empty = empty,
|
|
39
41
|
reducedMotion = reducedMotion,
|
|
40
42
|
size = size,
|
|
43
|
+
hasError = hasError,
|
|
44
|
+
helperText = helperText,
|
|
41
45
|
className = className,
|
|
42
46
|
sx = sx,
|
|
43
47
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
1
2
|
import { CustomizedProps } from "../../../../theme/index";
|
|
2
3
|
import { AvatarVariant } from "./Avatar.styles";
|
|
3
4
|
export interface AvatarProps {
|
|
@@ -5,6 +6,7 @@ export interface AvatarProps {
|
|
|
5
6
|
image?: string;
|
|
6
7
|
size?: number;
|
|
7
8
|
variant?: AvatarVariant;
|
|
9
|
+
children?: React.ReactNode;
|
|
8
10
|
}
|
|
9
11
|
declare function Avatar(props: CustomizedProps<Frame, AvatarProps>): JSX.Element;
|
|
10
12
|
export default Avatar;
|
|
@@ -16,6 +16,7 @@ local function Avatar(props)
|
|
|
16
16
|
if variant == nil then
|
|
17
17
|
variant = "circular"
|
|
18
18
|
end
|
|
19
|
+
local children = _binding.children
|
|
19
20
|
local className = _binding.className
|
|
20
21
|
local sx = _binding.sx
|
|
21
22
|
local id = _binding.id
|
|
@@ -51,7 +52,13 @@ local function Avatar(props)
|
|
|
51
52
|
_attributes_1[_k] = _v
|
|
52
53
|
end
|
|
53
54
|
_attributes_1.Image = image
|
|
54
|
-
|
|
55
|
+
local _condition_2 = variant ~= "square"
|
|
56
|
+
if _condition_2 then
|
|
57
|
+
local _attributes_2 = table.clone(styles.corner)
|
|
58
|
+
setmetatable(_attributes_2, nil)
|
|
59
|
+
_condition_2 = React.createElement("uicorner", _attributes_2)
|
|
60
|
+
end
|
|
61
|
+
_result = (React.createElement("imagelabel", _attributes_1, _condition_2))
|
|
55
62
|
else
|
|
56
63
|
local _attributes_1 = {
|
|
57
64
|
key = "Initials",
|
|
@@ -62,7 +69,7 @@ local function Avatar(props)
|
|
|
62
69
|
_attributes_1.Text = avatarInitials(name)
|
|
63
70
|
_result = (React.createElement("textlabel", _attributes_1))
|
|
64
71
|
end
|
|
65
|
-
return React.createElement(SxHost, _attributes, _condition_1, _result)
|
|
72
|
+
return React.createElement(SxHost, _attributes, _condition_1, _result, children)
|
|
66
73
|
end
|
|
67
74
|
local default = Avatar
|
|
68
75
|
return {
|
|
@@ -20,17 +20,24 @@ local useAvatarStyles = componentStyles("Avatar", function(theme, _param)
|
|
|
20
20
|
ClipsDescendants = true,
|
|
21
21
|
},
|
|
22
22
|
image = {
|
|
23
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
24
|
+
Position = UDim2.fromScale(0.5, 0.5),
|
|
23
25
|
Size = UDim2.fromScale(1, 1),
|
|
24
26
|
BackgroundTransparency = 1,
|
|
25
27
|
BorderSizePixel = 0,
|
|
28
|
+
ScaleType = Enum.ScaleType.Crop,
|
|
26
29
|
},
|
|
27
30
|
text = {
|
|
31
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
32
|
+
Position = UDim2.fromScale(0.5, 0.5),
|
|
28
33
|
Size = UDim2.fromScale(1, 1),
|
|
29
34
|
BackgroundTransparency = 1,
|
|
30
35
|
BorderSizePixel = 0,
|
|
31
36
|
Font = theme.typography.fontFamilies.default,
|
|
32
37
|
TextSize = math.max(12, size * 0.4),
|
|
33
38
|
TextColor3 = theme.palette.primary.on,
|
|
39
|
+
TextXAlignment = Enum.TextXAlignment.Center,
|
|
40
|
+
TextYAlignment = Enum.TextYAlignment.Center,
|
|
34
41
|
},
|
|
35
42
|
corner = {
|
|
36
43
|
CornerRadius = if variant == "rounded" then UDim.new(0, theme.shape.borderRadius) else UDim.new(1, 0),
|
|
@@ -63,7 +63,9 @@ local function AvatarGroup(props)
|
|
|
63
63
|
LayoutOrder = index,
|
|
64
64
|
ZIndex = index + 1,
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
local _attributes_3 = table.clone(styles.ring)
|
|
67
|
+
setmetatable(_attributes_3, nil)
|
|
68
|
+
return React.createElement(Avatar, _attributes_2, React.createElement("uistroke", _attributes_3))
|
|
67
69
|
end
|
|
68
70
|
for _k, _v in items do
|
|
69
71
|
_newValue[_k] = _callback(_v, _k - 1, items)
|
|
@@ -87,10 +89,13 @@ local function AvatarGroup(props)
|
|
|
87
89
|
else
|
|
88
90
|
_result_1 = nil
|
|
89
91
|
end
|
|
90
|
-
local _attributes_3 = table.clone(styles.
|
|
92
|
+
local _attributes_3 = table.clone(styles.ring)
|
|
91
93
|
setmetatable(_attributes_3, nil)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
+
local _exp_1 = React.createElement("uistroke", _attributes_3)
|
|
95
|
+
local _attributes_4 = table.clone(styles.surplusText)
|
|
96
|
+
setmetatable(_attributes_4, nil)
|
|
97
|
+
_attributes_4.Text = `+{extra}`
|
|
98
|
+
_result = (React.createElement("frame", _attributes_2, _result_1, _exp_1, React.createElement("textlabel", _attributes_4)))
|
|
94
99
|
else
|
|
95
100
|
_result = nil
|
|
96
101
|
end
|
|
@@ -12,7 +12,7 @@ local useAvatarGroupStyles = componentStyles("AvatarGroup", function(theme, _par
|
|
|
12
12
|
if variant == nil then
|
|
13
13
|
variant = "circular"
|
|
14
14
|
end
|
|
15
|
-
local overlap = math.max(theme.padding.calc(1), math.floor(size /
|
|
15
|
+
local overlap = math.max(theme.padding.calc(1), math.floor(size / 5))
|
|
16
16
|
return createStyles({
|
|
17
17
|
root = {
|
|
18
18
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -39,6 +39,11 @@ local useAvatarGroupStyles = componentStyles("AvatarGroup", function(theme, _par
|
|
|
39
39
|
TextSize = math.max(12, size * 0.35),
|
|
40
40
|
TextColor3 = theme.palette.text.primary,
|
|
41
41
|
},
|
|
42
|
+
ring = {
|
|
43
|
+
Color = theme.palette.surface.canvas,
|
|
44
|
+
Thickness = 2,
|
|
45
|
+
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
46
|
+
},
|
|
42
47
|
corner = {
|
|
43
48
|
CornerRadius = if variant == "rounded" then UDim.new(0, theme.shape.borderRadius) else UDim.new(1, 0),
|
|
44
49
|
},
|
|
@@ -49,27 +49,30 @@ local function Badge(props)
|
|
|
49
49
|
_attributes.base = styles.root
|
|
50
50
|
_attributes.className = className
|
|
51
51
|
_attributes.sx = sx
|
|
52
|
-
local
|
|
52
|
+
local _attributes_1 = table.clone(styles.inset)
|
|
53
|
+
setmetatable(_attributes_1, nil)
|
|
54
|
+
local _exp = React.createElement("uipadding", _attributes_1)
|
|
55
|
+
local _exp_1 = children
|
|
53
56
|
local _condition_1 = shown
|
|
54
57
|
if _condition_1 then
|
|
55
|
-
local
|
|
58
|
+
local _attributes_2 = {
|
|
56
59
|
key = "Count",
|
|
57
60
|
}
|
|
58
61
|
for _k, _v in styles.badge do
|
|
59
|
-
|
|
62
|
+
_attributes_2[_k] = _v
|
|
60
63
|
end
|
|
61
|
-
|
|
64
|
+
_attributes_2.Text = if isDot then "" else badgeText(count, max)
|
|
62
65
|
local _condition_2 = isDot ~= true
|
|
63
66
|
if _condition_2 then
|
|
64
|
-
local
|
|
65
|
-
setmetatable(
|
|
66
|
-
_condition_2 = React.createElement("uipadding",
|
|
67
|
+
local _attributes_3 = table.clone(styles.padding)
|
|
68
|
+
setmetatable(_attributes_3, nil)
|
|
69
|
+
_condition_2 = React.createElement("uipadding", _attributes_3)
|
|
67
70
|
end
|
|
68
|
-
local
|
|
69
|
-
setmetatable(
|
|
70
|
-
_condition_1 = (React.createElement("textlabel",
|
|
71
|
+
local _attributes_3 = table.clone(styles.corner)
|
|
72
|
+
setmetatable(_attributes_3, nil)
|
|
73
|
+
_condition_1 = (React.createElement("textlabel", _attributes_2, _condition_2, React.createElement("uicorner", _attributes_3)))
|
|
71
74
|
end
|
|
72
|
-
return React.createElement(SxHost, _attributes, _exp, _condition_1)
|
|
75
|
+
return React.createElement(SxHost, _attributes, _exp, _exp_1, _condition_1)
|
|
73
76
|
end
|
|
74
77
|
local default = Badge
|
|
75
78
|
return {
|