@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
|
@@ -3,8 +3,11 @@ local TS = _G[script]
|
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local createStyles = _theme.createStyles
|
|
5
5
|
local componentStyles = _theme.componentStyles
|
|
6
|
+
local _editorFace = TS.import(script, script.Parent.Parent.Parent, "editorFace")
|
|
7
|
+
local editorPad = _editorFace.editorPad
|
|
8
|
+
local editorText = _editorFace.editorText
|
|
6
9
|
local useColorPickerStyles = componentStyles("ColorPicker", function(theme)
|
|
7
|
-
|
|
10
|
+
local _object = {
|
|
8
11
|
root = {
|
|
9
12
|
Size = UDim2.new(1, 0, 0, 0),
|
|
10
13
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
@@ -15,7 +18,7 @@ local useColorPickerStyles = componentStyles("ColorPicker", function(theme)
|
|
|
15
18
|
},
|
|
16
19
|
column = {
|
|
17
20
|
FillDirection = Enum.FillDirection.Vertical,
|
|
18
|
-
Padding = UDim.new(0, theme
|
|
21
|
+
Padding = UDim.new(0, editorPad(theme)),
|
|
19
22
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
20
23
|
},
|
|
21
24
|
row = {
|
|
@@ -25,7 +28,7 @@ local useColorPickerStyles = componentStyles("ColorPicker", function(theme)
|
|
|
25
28
|
},
|
|
26
29
|
rowLayout = {
|
|
27
30
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
28
|
-
Padding = UDim.new(0, theme
|
|
31
|
+
Padding = UDim.new(0, editorPad(theme)),
|
|
29
32
|
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
30
33
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
31
34
|
},
|
|
@@ -86,72 +89,76 @@ local useColorPickerStyles = componentStyles("ColorPicker", function(theme)
|
|
|
86
89
|
BorderSizePixel = 0,
|
|
87
90
|
},
|
|
88
91
|
channel = {
|
|
89
|
-
Size = UDim2.new(1 / 3, -theme
|
|
92
|
+
Size = UDim2.new(1 / 3, -editorPad(theme), 0, theme.spacing.calc(3)),
|
|
90
93
|
BackgroundTransparency = 1,
|
|
91
94
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
95
|
+
}
|
|
96
|
+
local _left = "label"
|
|
97
|
+
local _object_1 = {
|
|
98
|
+
Size = UDim2.new(0, theme.spacing.calc(1.5), 1, 0),
|
|
99
|
+
BackgroundTransparency = 1,
|
|
100
|
+
TextColor3 = theme.palette.text.secondary,
|
|
101
|
+
}
|
|
102
|
+
for _k, _v in editorText(theme) do
|
|
103
|
+
_object_1[_k] = _v
|
|
104
|
+
end
|
|
105
|
+
_object[_left] = _object_1
|
|
106
|
+
_object.channelField = {
|
|
107
|
+
Size = UDim2.new(1, -theme.spacing.calc(1.5), 1, 0),
|
|
108
|
+
BackgroundTransparency = 1,
|
|
109
|
+
}
|
|
110
|
+
_object.field = {
|
|
111
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(3)),
|
|
112
|
+
BackgroundTransparency = 1,
|
|
113
|
+
BorderSizePixel = 0,
|
|
114
|
+
}
|
|
115
|
+
_object.swatchButton = {
|
|
116
|
+
Size = UDim2.fromOffset(theme.spacing.calc(3), theme.spacing.calc(3)),
|
|
117
|
+
BorderSizePixel = 0,
|
|
118
|
+
AutoButtonColor = false,
|
|
119
|
+
Text = "",
|
|
120
|
+
}
|
|
121
|
+
_object.value = {
|
|
122
|
+
Size = UDim2.new(1, -theme.spacing.calc(4), 1, 0),
|
|
123
|
+
BackgroundTransparency = 1,
|
|
124
|
+
}
|
|
125
|
+
_object.shell = {
|
|
126
|
+
Size = UDim2.fromScale(1, 1),
|
|
127
|
+
BackgroundColor3 = theme.palette.surface.elevated,
|
|
128
|
+
BorderSizePixel = 0,
|
|
129
|
+
}
|
|
130
|
+
_object.shellPad = {
|
|
131
|
+
PaddingTop = UDim.new(0, editorPad(theme)),
|
|
132
|
+
PaddingBottom = UDim.new(0, editorPad(theme)),
|
|
133
|
+
PaddingLeft = UDim.new(0, editorPad(theme)),
|
|
134
|
+
PaddingRight = UDim.new(0, editorPad(theme)),
|
|
135
|
+
}
|
|
136
|
+
_object.shellStroke = {
|
|
137
|
+
Color = theme.palette.divider,
|
|
138
|
+
Thickness = 1,
|
|
139
|
+
}
|
|
140
|
+
_object.recent = {
|
|
141
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(2)),
|
|
142
|
+
BackgroundTransparency = 1,
|
|
143
|
+
}
|
|
144
|
+
_object.recentChip = {
|
|
145
|
+
Size = UDim2.fromOffset(theme.spacing.calc(2), theme.spacing.calc(2)),
|
|
146
|
+
BorderSizePixel = 0,
|
|
147
|
+
AutoButtonColor = false,
|
|
148
|
+
Text = "",
|
|
149
|
+
}
|
|
150
|
+
local _left_1 = "link"
|
|
151
|
+
local _object_2 = {
|
|
152
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(2)),
|
|
153
|
+
BackgroundTransparency = 1,
|
|
154
|
+
AutoButtonColor = false,
|
|
155
|
+
TextColor3 = theme.palette.text.secondary,
|
|
156
|
+
}
|
|
157
|
+
for _k, _v in editorText(theme) do
|
|
158
|
+
_object_2[_k] = _v
|
|
159
|
+
end
|
|
160
|
+
_object[_left_1] = _object_2
|
|
161
|
+
return createStyles(_object)
|
|
155
162
|
end)
|
|
156
163
|
local default = useColorPickerStyles
|
|
157
164
|
return {
|
|
@@ -4,6 +4,7 @@ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
4
4
|
local React = _react
|
|
5
5
|
local useRef = _react.useRef
|
|
6
6
|
local useState = _react.useState
|
|
7
|
+
local useEditorHover = TS.import(script, script.Parent.Parent.Parent, "editorFace").useEditorHover
|
|
7
8
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
8
9
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
9
10
|
local ColorPicker = TS.import(script, script.Parent, "ColorPicker").default
|
|
@@ -27,6 +28,7 @@ local function ColorSequenceEditor(props)
|
|
|
27
28
|
local id = _binding.id
|
|
28
29
|
local ref = _binding.ref
|
|
29
30
|
local styles = useColorPickerStyles()
|
|
31
|
+
local hover = useEditorHover(disabled)
|
|
30
32
|
local active = canActivate(disabled)
|
|
31
33
|
local stops = readColorStops(value)
|
|
32
34
|
local selected, setSelected = useState(0)
|
|
@@ -55,12 +57,18 @@ local function ColorSequenceEditor(props)
|
|
|
55
57
|
end
|
|
56
58
|
_attributes.key = _condition
|
|
57
59
|
_attributes.hostRef = ref
|
|
58
|
-
|
|
60
|
+
local _object = table.clone(styles.root)
|
|
61
|
+
setmetatable(_object, nil)
|
|
62
|
+
for _k, _v in hover.face do
|
|
63
|
+
_object[_k] = _v
|
|
64
|
+
end
|
|
65
|
+
_attributes.base = _object
|
|
59
66
|
_attributes.className = className
|
|
60
67
|
_attributes.sx = sx
|
|
61
68
|
_attributes.state = {
|
|
62
69
|
disabled = disabled,
|
|
63
70
|
}
|
|
71
|
+
_attributes.Event = hover.event
|
|
64
72
|
_attributes.Selectable = false
|
|
65
73
|
local _attributes_1 = table.clone(styles.column)
|
|
66
74
|
setmetatable(_attributes_1, nil)
|
|
@@ -140,9 +148,9 @@ local function ColorSequenceEditor(props)
|
|
|
140
148
|
_attributes_5.BackgroundColor3 = stop.color
|
|
141
149
|
_attributes_5.Position = UDim2.fromScale(stop.t, 0.5)
|
|
142
150
|
_attributes_5.ZIndex = if stopIndex == index then 2 else 1
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
151
|
+
local _attributes_6 = table.clone(styles.corner)
|
|
152
|
+
setmetatable(_attributes_6, nil)
|
|
153
|
+
return React.createElement("frame", _attributes_5, React.createElement("uicorner", _attributes_6), React.createElement("uistroke", {
|
|
146
154
|
Thickness = if stopIndex == index then 2 else 1,
|
|
147
155
|
Color = Color3.new(1, 1, 1),
|
|
148
156
|
}))
|
|
@@ -4,6 +4,7 @@ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
4
4
|
local React = _react
|
|
5
5
|
local useRef = _react.useRef
|
|
6
6
|
local useState = _react.useState
|
|
7
|
+
local useEditorHover = TS.import(script, script.Parent.Parent.Parent, "editorFace").useEditorHover
|
|
7
8
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
8
9
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
9
10
|
local NumberInput = TS.import(script, script.Parent.Parent.Parent, "numberInput").NumberInput
|
|
@@ -27,6 +28,7 @@ local function NumberSequenceEditor(props)
|
|
|
27
28
|
local id = _binding.id
|
|
28
29
|
local ref = _binding.ref
|
|
29
30
|
local styles = useColorPickerStyles()
|
|
31
|
+
local hover = useEditorHover(disabled)
|
|
30
32
|
local active = canActivate(disabled)
|
|
31
33
|
local stops = readNumberStops(value)
|
|
32
34
|
local selected, setSelected = useState(0)
|
|
@@ -56,12 +58,18 @@ local function NumberSequenceEditor(props)
|
|
|
56
58
|
end
|
|
57
59
|
_attributes.key = _condition
|
|
58
60
|
_attributes.hostRef = ref
|
|
59
|
-
|
|
61
|
+
local _object = table.clone(styles.root)
|
|
62
|
+
setmetatable(_object, nil)
|
|
63
|
+
for _k, _v in hover.face do
|
|
64
|
+
_object[_k] = _v
|
|
65
|
+
end
|
|
66
|
+
_attributes.base = _object
|
|
60
67
|
_attributes.className = className
|
|
61
68
|
_attributes.sx = sx
|
|
62
69
|
_attributes.state = {
|
|
63
70
|
disabled = disabled,
|
|
64
71
|
}
|
|
72
|
+
_attributes.Event = hover.event
|
|
65
73
|
_attributes.Selectable = false
|
|
66
74
|
local _attributes_1 = table.clone(styles.column)
|
|
67
75
|
setmetatable(_attributes_1, nil)
|
|
@@ -142,9 +150,9 @@ local function NumberSequenceEditor(props)
|
|
|
142
150
|
_attributes_5.BackgroundColor3 = Color3.new(0.85, 0.85, 0.85)
|
|
143
151
|
_attributes_5.Position = UDim2.fromScale(stop.t, 0.5)
|
|
144
152
|
_attributes_5.ZIndex = if stopIndex == index then 2 else 1
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
153
|
+
local _attributes_6 = table.clone(styles.corner)
|
|
154
|
+
setmetatable(_attributes_6, nil)
|
|
155
|
+
return React.createElement("frame", _attributes_5, React.createElement("uicorner", _attributes_6), React.createElement("uistroke", {
|
|
148
156
|
Thickness = if stopIndex == index then 2 else 1,
|
|
149
157
|
Color = Color3.new(1, 1, 1),
|
|
150
158
|
}))
|
|
@@ -1,7 +1,10 @@
|
|
|
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
|
|
4
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
5
|
+
local controlMetrics = _theme.controlMetrics
|
|
6
|
+
local useTheme = _theme.useTheme
|
|
7
|
+
local fieldChrome = TS.import(script, script.Parent.Parent.Parent, "input", "components", "fieldChrome").fieldChrome
|
|
5
8
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
9
|
local _dateRangeValue = TS.import(script, script.Parent.Parent, "dateRangeValue")
|
|
7
10
|
local dateStamp = _dateRangeValue.dateStamp
|
|
@@ -48,6 +51,9 @@ local function DateRangePicker(props)
|
|
|
48
51
|
local week = if weekMode then weekStamps(anchorStamp) else {}
|
|
49
52
|
local _binding_1 = useTheme()
|
|
50
53
|
local theme = _binding_1.theme
|
|
54
|
+
local chrome = fieldChrome(controlMetrics(theme.density).height, theme.padding.calc(1))
|
|
55
|
+
local pad = chrome.padX
|
|
56
|
+
local row = chrome.height
|
|
51
57
|
local lead = weekday(year, month, 1)
|
|
52
58
|
local count = daysInMonth(year, month)
|
|
53
59
|
local cells = {}
|
|
@@ -140,24 +146,24 @@ local function DateRangePicker(props)
|
|
|
140
146
|
_attributes.className = className
|
|
141
147
|
_attributes.sx = sx
|
|
142
148
|
local _exp = React.createElement("uipadding", {
|
|
143
|
-
PaddingTop = UDim.new(0,
|
|
144
|
-
PaddingBottom = UDim.new(0,
|
|
145
|
-
PaddingLeft = UDim.new(0,
|
|
146
|
-
PaddingRight = UDim.new(0,
|
|
149
|
+
PaddingTop = UDim.new(0, pad),
|
|
150
|
+
PaddingBottom = UDim.new(0, pad),
|
|
151
|
+
PaddingLeft = UDim.new(0, pad),
|
|
152
|
+
PaddingRight = UDim.new(0, pad),
|
|
147
153
|
})
|
|
148
154
|
local _exp_1 = React.createElement("uilistlayout", {
|
|
149
155
|
FillDirection = Enum.FillDirection.Vertical,
|
|
150
|
-
Padding = UDim.new(0,
|
|
156
|
+
Padding = UDim.new(0, pad),
|
|
151
157
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
152
158
|
})
|
|
153
159
|
local _exp_2 = React.createElement("frame", {
|
|
154
|
-
Size = UDim2.new(1, 0, 0,
|
|
160
|
+
Size = UDim2.new(1, 0, 0, row),
|
|
155
161
|
BackgroundTransparency = 1,
|
|
156
162
|
BorderSizePixel = 0,
|
|
157
163
|
LayoutOrder = 0,
|
|
158
164
|
}, React.createElement("textbutton", {
|
|
159
165
|
Text = if weekMode then "Earlier" else "Prev",
|
|
160
|
-
Size = UDim2.fromOffset(if weekMode then 72 else 56,
|
|
166
|
+
Size = UDim2.fromOffset(if weekMode then 72 else 56, row),
|
|
161
167
|
BackgroundTransparency = 1,
|
|
162
168
|
BorderSizePixel = 0,
|
|
163
169
|
TextColor3 = theme.palette.text.secondary,
|
|
@@ -172,9 +178,11 @@ local function DateRangePicker(props)
|
|
|
172
178
|
Text = title,
|
|
173
179
|
AnchorPoint = Vector2.new(0.5, 0),
|
|
174
180
|
Position = UDim2.fromScale(0.5, 0),
|
|
175
|
-
Size = UDim2.
|
|
181
|
+
Size = UDim2.new(1, -(if weekMode then 72 else 56) * 2, 1, 0),
|
|
176
182
|
BackgroundTransparency = 1,
|
|
177
183
|
BorderSizePixel = 0,
|
|
184
|
+
TextTruncate = Enum.TextTruncate.AtEnd,
|
|
185
|
+
TextWrapped = false,
|
|
178
186
|
TextColor3 = theme.palette.text.primary,
|
|
179
187
|
Font = theme.typography.fontFamilies.semibold,
|
|
180
188
|
TextSize = theme.typography.fontSizes.body,
|
|
@@ -182,7 +190,7 @@ local function DateRangePicker(props)
|
|
|
182
190
|
Text = if weekMode then "Later" else "Next",
|
|
183
191
|
AnchorPoint = Vector2.new(1, 0),
|
|
184
192
|
Position = UDim2.fromScale(1, 0),
|
|
185
|
-
Size = UDim2.fromOffset(if weekMode then 72 else 56,
|
|
193
|
+
Size = UDim2.fromOffset(if weekMode then 72 else 56, row),
|
|
186
194
|
BackgroundTransparency = 1,
|
|
187
195
|
BorderSizePixel = 0,
|
|
188
196
|
TextColor3 = theme.palette.text.secondary,
|
|
@@ -196,9 +204,11 @@ local function DateRangePicker(props)
|
|
|
196
204
|
}))
|
|
197
205
|
local _exp_3 = React.createElement("textlabel", {
|
|
198
206
|
Text = if value.start == nil then "Choose a start and finish" elseif value.finish == nil then formatStamp(value.start) else `{formatStamp(value.start)} – {formatStamp(value.finish)}`,
|
|
199
|
-
Size = UDim2.new(1, 0, 0,
|
|
207
|
+
Size = UDim2.new(1, 0, 0, row),
|
|
200
208
|
BackgroundTransparency = 1,
|
|
201
209
|
BorderSizePixel = 0,
|
|
210
|
+
TextTruncate = Enum.TextTruncate.AtEnd,
|
|
211
|
+
TextWrapped = false,
|
|
202
212
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
203
213
|
TextColor3 = theme.palette.text.secondary,
|
|
204
214
|
Font = theme.typography.fontFamilies.default,
|
|
@@ -209,7 +219,8 @@ local function DateRangePicker(props)
|
|
|
209
219
|
if weekMode then
|
|
210
220
|
local _exp_4 = React.createElement("uilistlayout", {
|
|
211
221
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
212
|
-
|
|
222
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Center,
|
|
223
|
+
Padding = UDim.new(0, pad),
|
|
213
224
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
214
225
|
})
|
|
215
226
|
-- ▼ ReadonlyArray.map ▼
|
|
@@ -226,7 +237,7 @@ local function DateRangePicker(props)
|
|
|
226
237
|
end
|
|
227
238
|
_attributes_1.Text = `{_condition_2}\n{stamp % 100}`
|
|
228
239
|
_attributes_1.LayoutOrder = index
|
|
229
|
-
_attributes_1.Size = UDim2.new(1 / 7, -
|
|
240
|
+
_attributes_1.Size = UDim2.new(1 / 7, -math.ceil((pad * 6) / 7), 1, 0)
|
|
230
241
|
_attributes_1.BackgroundColor3 = if chosen then theme.palette.primary.main else theme.palette.surface.input
|
|
231
242
|
_attributes_1.BackgroundTransparency = if chosen and not endpoint then 0.55 else 0
|
|
232
243
|
_attributes_1.BorderSizePixel = 0
|
|
@@ -241,7 +252,7 @@ local function DateRangePicker(props)
|
|
|
241
252
|
end,
|
|
242
253
|
}
|
|
243
254
|
return React.createElement("textbutton", _attributes_1, React.createElement("uicorner", {
|
|
244
|
-
CornerRadius = UDim.new(0,
|
|
255
|
+
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
245
256
|
}))
|
|
246
257
|
end
|
|
247
258
|
for _k, _v in week do
|
|
@@ -249,16 +260,17 @@ local function DateRangePicker(props)
|
|
|
249
260
|
end
|
|
250
261
|
-- ▲ ReadonlyArray.map ▲
|
|
251
262
|
_result_1 = (React.createElement("frame", {
|
|
252
|
-
Size = UDim2.new(1, 0, 0,
|
|
263
|
+
Size = UDim2.new(1, 0, 0, row * 2),
|
|
253
264
|
BackgroundTransparency = 1,
|
|
254
265
|
BorderSizePixel = 0,
|
|
255
266
|
LayoutOrder = 2,
|
|
256
267
|
}, _exp_4, _newValue))
|
|
257
268
|
else
|
|
258
269
|
local _exp_4 = React.createElement("uigridlayout", {
|
|
259
|
-
CellSize = UDim2.
|
|
260
|
-
CellPadding = UDim2.fromOffset(
|
|
270
|
+
CellSize = UDim2.new(1 / 7, -math.ceil((pad * 6) / 7), 0, row),
|
|
271
|
+
CellPadding = UDim2.fromOffset(pad, pad),
|
|
261
272
|
FillDirectionMaxCells = 7,
|
|
273
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Center,
|
|
262
274
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
263
275
|
})
|
|
264
276
|
-- ▼ ReadonlyArray.map ▼
|
|
@@ -310,7 +322,7 @@ local function DateRangePicker(props)
|
|
|
310
322
|
end,
|
|
311
323
|
},
|
|
312
324
|
}, React.createElement("uicorner", {
|
|
313
|
-
CornerRadius = UDim.new(0,
|
|
325
|
+
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
314
326
|
}))
|
|
315
327
|
end
|
|
316
328
|
for _k, _v in cells do
|
|
@@ -318,7 +330,7 @@ local function DateRangePicker(props)
|
|
|
318
330
|
end
|
|
319
331
|
-- ▲ ReadonlyArray.map ▲
|
|
320
332
|
_result_1 = (React.createElement("frame", {
|
|
321
|
-
Size = UDim2.new(1, 0, 0,
|
|
333
|
+
Size = UDim2.new(1, 0, 0, row * 7 + pad * 6),
|
|
322
334
|
BackgroundTransparency = 1,
|
|
323
335
|
BorderSizePixel = 0,
|
|
324
336
|
LayoutOrder = 2,
|
|
@@ -4,6 +4,7 @@ local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "the
|
|
|
4
4
|
local createStyles = _theme.createStyles
|
|
5
5
|
local componentStyles = _theme.componentStyles
|
|
6
6
|
local useDialogStyles = componentStyles("Dialog", function(theme)
|
|
7
|
+
local heading = theme.typography.variants.h6
|
|
7
8
|
return createStyles({
|
|
8
9
|
column = {
|
|
9
10
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
@@ -22,8 +23,9 @@ local useDialogStyles = componentStyles("Dialog", function(theme)
|
|
|
22
23
|
Size = UDim2.new(1, 0, 0, 0),
|
|
23
24
|
BackgroundTransparency = 1,
|
|
24
25
|
BorderSizePixel = 0,
|
|
25
|
-
Font = theme.typography.fontFamilies.
|
|
26
|
-
TextSize =
|
|
26
|
+
Font = theme.typography.fontFamilies[heading.family],
|
|
27
|
+
TextSize = heading.size,
|
|
28
|
+
LineHeight = heading.leading,
|
|
27
29
|
TextColor3 = theme.palette.text.primary,
|
|
28
30
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
29
31
|
TextWrapped = true,
|
|
@@ -94,7 +94,9 @@ local function Divider(props)
|
|
|
94
94
|
_attributes_2.AutomaticSize = if fit > 0 then Enum.AutomaticSize.None else Enum.AutomaticSize.X
|
|
95
95
|
local _attributes_3 = table.clone(captionPad)
|
|
96
96
|
setmetatable(_attributes_3, nil)
|
|
97
|
-
return React.createElement(SxHost, _attributes, _exp, React.createElement("textlabel", _attributes_2, React.createElement("uipadding", _attributes_3)
|
|
97
|
+
return React.createElement(SxHost, _attributes, _exp, React.createElement("textlabel", _attributes_2, React.createElement("uipadding", _attributes_3), if room > 0 then React.createElement("uisizeconstraint", {
|
|
98
|
+
MaxSize = Vector2.new(room, math.huge),
|
|
99
|
+
}) else nil))
|
|
98
100
|
end
|
|
99
101
|
local _attributes = {
|
|
100
102
|
tag = "frame",
|
|
@@ -57,6 +57,7 @@ local useDividerStyles = componentStyles("Divider", function(theme, props)
|
|
|
57
57
|
TextSize = theme.typography.fontSizes.caption,
|
|
58
58
|
TextColor3 = theme.palette.text.secondary,
|
|
59
59
|
TextTruncate = Enum.TextTruncate.AtEnd,
|
|
60
|
+
TextWrapped = false,
|
|
60
61
|
TextXAlignment = Enum.TextXAlignment.Center,
|
|
61
62
|
ZIndex = 2,
|
|
62
63
|
},
|
|
@@ -6,14 +6,13 @@ local useEffect = _react.useEffect
|
|
|
6
6
|
local useRef = _react.useRef
|
|
7
7
|
local useState = _react.useState
|
|
8
8
|
local UserInputService = TS.import(script, TS.getModule(script, "@rbxts", "services")).UserInputService
|
|
9
|
+
local useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").useTheme
|
|
9
10
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
10
11
|
local isDismissInput = TS.import(script, script.Parent.Parent.Parent, "modal", "components", "dismissInput").isDismissInput
|
|
11
12
|
local _popup = TS.import(script, script.Parent.Parent.Parent, "popup")
|
|
12
13
|
local Portal = _popup.Portal
|
|
13
14
|
local portalTarget = _popup.portalTarget
|
|
14
|
-
local
|
|
15
|
-
local drawerAnchor = _drawerPlacement.drawerAnchor
|
|
16
|
-
local drawerBox = _drawerPlacement.drawerBox
|
|
15
|
+
local drawerFit = TS.import(script, script.Parent, "drawerPlacement").drawerFit
|
|
17
16
|
local useDrawerStyles = TS.import(script, script.Parent, "Drawer.styles").default
|
|
18
17
|
local function Drawer(props)
|
|
19
18
|
local _binding = props
|
|
@@ -25,6 +24,7 @@ local function Drawer(props)
|
|
|
25
24
|
end
|
|
26
25
|
local width = _binding.width
|
|
27
26
|
local height = _binding.height
|
|
27
|
+
local title = _binding.title
|
|
28
28
|
local onClose = _binding.onClose
|
|
29
29
|
local children = _binding.children
|
|
30
30
|
local className = _binding.className
|
|
@@ -34,6 +34,8 @@ local function Drawer(props)
|
|
|
34
34
|
local styles = useDrawerStyles({
|
|
35
35
|
width = width,
|
|
36
36
|
})
|
|
37
|
+
local _binding_1 = useTheme()
|
|
38
|
+
local theme = _binding_1.theme
|
|
37
39
|
local close = useRef(onClose)
|
|
38
40
|
local anchor = useRef()
|
|
39
41
|
local layer, setLayer = useState(function()
|
|
@@ -56,18 +58,23 @@ local function Drawer(props)
|
|
|
56
58
|
return connection:Disconnect()
|
|
57
59
|
end
|
|
58
60
|
end, { open, layer })
|
|
59
|
-
local placement = drawerAnchor(edge)
|
|
60
61
|
local _result
|
|
61
62
|
if edge == "bottom" then
|
|
62
63
|
local _condition = height
|
|
63
64
|
if _condition == nil then
|
|
64
|
-
_condition =
|
|
65
|
+
_condition = theme.spacing.calc(20)
|
|
65
66
|
end
|
|
66
|
-
_result =
|
|
67
|
+
_result = _condition
|
|
67
68
|
else
|
|
68
|
-
|
|
69
|
+
local _condition = width
|
|
70
|
+
if _condition == nil then
|
|
71
|
+
_condition = theme.spacing.calc(20)
|
|
72
|
+
end
|
|
73
|
+
_result = _condition
|
|
69
74
|
end
|
|
70
|
-
local
|
|
75
|
+
local span = _result
|
|
76
|
+
local room = if layer ~= nil then (if edge == "bottom" then layer.AbsoluteSize.Y else layer.AbsoluteSize.X) else 0
|
|
77
|
+
local box = drawerFit(edge, span, room)
|
|
71
78
|
local panelStyle = styles.panel
|
|
72
79
|
local _exp = React.createElement("frame", {
|
|
73
80
|
key = "DrawerAnchor",
|
|
@@ -108,15 +115,37 @@ local function Drawer(props)
|
|
|
108
115
|
_attributes_2.base = panelStyle
|
|
109
116
|
_attributes_2.className = className
|
|
110
117
|
_attributes_2.sx = sx
|
|
111
|
-
_attributes_2.AnchorPoint = Vector2.new(
|
|
112
|
-
_attributes_2.Position = UDim2.fromScale(
|
|
113
|
-
_attributes_2.Size =
|
|
118
|
+
_attributes_2.AnchorPoint = Vector2.new(box.anchorX, box.anchorY)
|
|
119
|
+
_attributes_2.Position = UDim2.fromScale(box.posX, box.posY)
|
|
120
|
+
_attributes_2.Size = UDim2.new(box.sizeX, box.sizeXO, box.sizeY, box.sizeYO)
|
|
114
121
|
_attributes_2.ZIndex = panelStyle.ZIndex
|
|
115
|
-
local
|
|
116
|
-
|
|
122
|
+
local _exp_2 = React.createElement("uilistlayout", {
|
|
123
|
+
FillDirection = Enum.FillDirection.Vertical,
|
|
124
|
+
Padding = UDim.new(0, theme.padding.calc(1)),
|
|
125
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
126
|
+
})
|
|
127
|
+
local _result_1
|
|
128
|
+
if title ~= nil and #title > 0 then
|
|
129
|
+
local _attributes_3 = {
|
|
130
|
+
key = "Title",
|
|
131
|
+
}
|
|
132
|
+
for _k, _v in styles.title do
|
|
133
|
+
_attributes_3[_k] = _v
|
|
134
|
+
end
|
|
135
|
+
_attributes_3.Text = title
|
|
136
|
+
_result_1 = (React.createElement("textlabel", _attributes_3))
|
|
137
|
+
else
|
|
138
|
+
_result_1 = nil
|
|
139
|
+
end
|
|
117
140
|
_condition = (React.createElement(Portal, {
|
|
118
141
|
host = layer,
|
|
119
|
-
}, React.createElement("frame", _attributes, _exp_1, React.createElement(SxHost, _attributes_2, React.createElement("
|
|
142
|
+
}, React.createElement("frame", _attributes, _exp_1, React.createElement(SxHost, _attributes_2, React.createElement("frame", {
|
|
143
|
+
key = "Pad",
|
|
144
|
+
Size = UDim2.new(1, -theme.padding.calc(4), 1, -theme.padding.calc(4)),
|
|
145
|
+
Position = UDim2.new(0, theme.padding.calc(2), 0, theme.padding.calc(2)),
|
|
146
|
+
BackgroundTransparency = 1,
|
|
147
|
+
BorderSizePixel = 0,
|
|
148
|
+
}, _exp_2, _result_1, children)))))
|
|
120
149
|
end
|
|
121
150
|
return React.createElement(React.Fragment, nil, _exp, _condition)
|
|
122
151
|
end
|
|
@@ -5,6 +5,7 @@ local componentStyles = _theme.componentStyles
|
|
|
5
5
|
local createStyles = _theme.createStyles
|
|
6
6
|
local useDrawerStyles = componentStyles("Drawer", function(theme, _param)
|
|
7
7
|
local width = _param.width
|
|
8
|
+
local heading = theme.typography.variants.h6
|
|
8
9
|
return createStyles({
|
|
9
10
|
root = {
|
|
10
11
|
Size = UDim2.fromScale(1, 1),
|
|
@@ -27,11 +28,18 @@ local useDrawerStyles = componentStyles("Drawer", function(theme, _param)
|
|
|
27
28
|
BorderSizePixel = 0,
|
|
28
29
|
ZIndex = 30001,
|
|
29
30
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
title = {
|
|
32
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
33
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
34
|
+
BackgroundTransparency = 1,
|
|
35
|
+
BorderSizePixel = 0,
|
|
36
|
+
TextWrapped = true,
|
|
37
|
+
Font = theme.typography.fontFamilies[heading.family],
|
|
38
|
+
TextSize = heading.size,
|
|
39
|
+
LineHeight = heading.leading,
|
|
40
|
+
TextColor3 = theme.palette.text.primary,
|
|
41
|
+
TextXAlignment = Enum.TextXAlignment.Left,
|
|
42
|
+
ZIndex = 30002,
|
|
35
43
|
},
|
|
36
44
|
})
|
|
37
45
|
end)
|
|
@@ -12,3 +12,5 @@ export interface DrawerBox {
|
|
|
12
12
|
}
|
|
13
13
|
/** Side drawers keep a column. A bottom sheet spans the width and sits on the lower edge. */
|
|
14
14
|
export declare function drawerBox(edge: DrawerEdge, span: number): DrawerBox;
|
|
15
|
+
/** Keep the panel on its edge and leave the scrim visible. */
|
|
16
|
+
export declare function drawerFit(edge: DrawerEdge, span: number, limit: number): DrawerBox;
|
|
@@ -29,7 +29,25 @@ local function drawerBox(edge, span)
|
|
|
29
29
|
sizeYO = 0,
|
|
30
30
|
}
|
|
31
31
|
end
|
|
32
|
+
--* Keep the panel on its edge and leave the scrim visible.
|
|
33
|
+
local function drawerFit(edge, span, limit)
|
|
34
|
+
local box = drawerBox(edge, span)
|
|
35
|
+
local room = if limit > 0 then limit else 0
|
|
36
|
+
if edge == "bottom" then
|
|
37
|
+
local size = if room > 0 and box.sizeYO > room then room else box.sizeYO
|
|
38
|
+
local _object = table.clone(box)
|
|
39
|
+
setmetatable(_object, nil)
|
|
40
|
+
_object.sizeYO = size
|
|
41
|
+
return _object
|
|
42
|
+
end
|
|
43
|
+
local size = if room > 0 and box.sizeXO > room then room else box.sizeXO
|
|
44
|
+
local _object = table.clone(box)
|
|
45
|
+
setmetatable(_object, nil)
|
|
46
|
+
_object.sizeXO = size
|
|
47
|
+
return _object
|
|
48
|
+
end
|
|
32
49
|
return {
|
|
33
50
|
drawerAnchor = drawerAnchor,
|
|
34
51
|
drawerBox = drawerBox,
|
|
52
|
+
drawerFit = drawerFit,
|
|
35
53
|
}
|