@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
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ControlSize, Theme } from "../../theme/index";
|
|
2
|
+
export declare function editorPad(theme: Theme): number;
|
|
3
|
+
/** Same height as the Input these rows host, so the label and the field share one center. */
|
|
4
|
+
export declare function editorRowHeight(theme: Theme, size?: ControlSize): number;
|
|
5
|
+
export declare function editorText(theme: Theme): {
|
|
6
|
+
Font: Required<Enum.Font> | undefined;
|
|
7
|
+
TextSize: number | undefined;
|
|
8
|
+
TextTruncate: Enum.TextTruncate.AtEnd;
|
|
9
|
+
TextXAlignment: Enum.TextXAlignment.Left;
|
|
10
|
+
TextYAlignment: Enum.TextYAlignment.Center;
|
|
11
|
+
};
|
|
12
|
+
export declare function useEditorHover(disabled?: boolean): {
|
|
13
|
+
active: boolean;
|
|
14
|
+
face: {
|
|
15
|
+
BackgroundColor3: Color3;
|
|
16
|
+
BackgroundTransparency: number;
|
|
17
|
+
};
|
|
18
|
+
event: {
|
|
19
|
+
MouseEnter: () => void;
|
|
20
|
+
MouseLeave: () => void;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local useState = TS.import(script, TS.getModule(script, "@rbxts", "react")).useState
|
|
4
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent, "theme")
|
|
5
|
+
local controlMetrics = _theme.controlMetrics
|
|
6
|
+
local useTheme = _theme.useTheme
|
|
7
|
+
local function editorPad(theme)
|
|
8
|
+
return theme.padding.calc(1)
|
|
9
|
+
end
|
|
10
|
+
--* Same height as the Input these rows host, so the label and the field share one center.
|
|
11
|
+
local function editorRowHeight(theme, size)
|
|
12
|
+
return controlMetrics(theme.density, size).height
|
|
13
|
+
end
|
|
14
|
+
local function editorText(theme)
|
|
15
|
+
return {
|
|
16
|
+
Font = theme.typography.fontFamilies.default,
|
|
17
|
+
TextSize = theme.typography.fontSizes.caption,
|
|
18
|
+
TextTruncate = Enum.TextTruncate.AtEnd,
|
|
19
|
+
TextXAlignment = Enum.TextXAlignment.Left,
|
|
20
|
+
TextYAlignment = Enum.TextYAlignment.Center,
|
|
21
|
+
}
|
|
22
|
+
end
|
|
23
|
+
local function useEditorHover(disabled)
|
|
24
|
+
local _binding = useTheme()
|
|
25
|
+
local theme = _binding.theme
|
|
26
|
+
local hovering, setHovering = useState(false)
|
|
27
|
+
local active = hovering and disabled ~= true
|
|
28
|
+
return {
|
|
29
|
+
active = active,
|
|
30
|
+
face = {
|
|
31
|
+
BackgroundColor3 = theme.palette.action.hover,
|
|
32
|
+
BackgroundTransparency = if active then 0 else 1,
|
|
33
|
+
},
|
|
34
|
+
event = {
|
|
35
|
+
MouseEnter = function()
|
|
36
|
+
return setHovering(true)
|
|
37
|
+
end,
|
|
38
|
+
MouseLeave = function()
|
|
39
|
+
return setHovering(false)
|
|
40
|
+
end,
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
return {
|
|
45
|
+
editorPad = editorPad,
|
|
46
|
+
editorRowHeight = editorRowHeight,
|
|
47
|
+
editorText = editorText,
|
|
48
|
+
useEditorHover = useEditorHover,
|
|
49
|
+
}
|
|
@@ -4,7 +4,10 @@ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
4
4
|
local React = _react
|
|
5
5
|
local useEffect = _react.useEffect
|
|
6
6
|
local useState = _react.useState
|
|
7
|
-
local
|
|
7
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
8
|
+
local controlFade = _theme.controlFade
|
|
9
|
+
local focusRing = _theme.focusRing
|
|
10
|
+
local useTheme = _theme.useTheme
|
|
8
11
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
9
12
|
local CircularProgress = TS.import(script, script.Parent.Parent.Parent, "circularProgress").CircularProgress
|
|
10
13
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
@@ -46,6 +49,7 @@ local function Fab(props)
|
|
|
46
49
|
})
|
|
47
50
|
local _binding_1 = useTheme()
|
|
48
51
|
local theme = _binding_1.theme
|
|
52
|
+
local tone = if color == "accent" then theme.palette.accent else theme.palette.primary
|
|
49
53
|
local hovering, setHovering = useState(false)
|
|
50
54
|
local focused, setFocused = useState(false)
|
|
51
55
|
local iconPx = fabIconPixels(size)
|
|
@@ -104,7 +108,8 @@ local function Fab(props)
|
|
|
104
108
|
}
|
|
105
109
|
_attributes.Active = active
|
|
106
110
|
_attributes.Selectable = active
|
|
107
|
-
_attributes.
|
|
111
|
+
_attributes.BackgroundColor3 = if active and hovering then tone.hover else tone.main
|
|
112
|
+
_attributes.BackgroundTransparency = if disabled == true then controlFade else 0
|
|
108
113
|
_attributes.Event = {
|
|
109
114
|
Activated = function()
|
|
110
115
|
if active and onClick then
|
|
@@ -131,8 +136,16 @@ local function Fab(props)
|
|
|
131
136
|
local _attributes_1 = table.clone(styles.corner)
|
|
132
137
|
setmetatable(_attributes_1, nil)
|
|
133
138
|
local _exp = React.createElement("uicorner", _attributes_1)
|
|
134
|
-
local _exp_1 = React.createElement(Shadow)
|
|
135
139
|
local _result_1
|
|
140
|
+
if focused and active then
|
|
141
|
+
local _attributes_2 = table.clone(focusRing(theme.palette.focus))
|
|
142
|
+
setmetatable(_attributes_2, nil)
|
|
143
|
+
_result_1 = React.createElement("uistroke", _attributes_2)
|
|
144
|
+
else
|
|
145
|
+
_result_1 = nil
|
|
146
|
+
end
|
|
147
|
+
local _exp_1 = React.createElement(Shadow)
|
|
148
|
+
local _result_2
|
|
136
149
|
if extended then
|
|
137
150
|
local _attributes_2 = {
|
|
138
151
|
key = "Content",
|
|
@@ -158,11 +171,11 @@ local function Fab(props)
|
|
|
158
171
|
_attributes_5.Text = label
|
|
159
172
|
_condition_1 = React.createElement("textlabel", _attributes_5)
|
|
160
173
|
end
|
|
161
|
-
|
|
174
|
+
_result_2 = (React.createElement("frame", _attributes_2, _exp_2, _exp_3, _exp_4, _condition_1))
|
|
162
175
|
else
|
|
163
|
-
|
|
176
|
+
_result_2 = iconEl
|
|
164
177
|
end
|
|
165
|
-
return React.createElement(SxHost, _attributes, _exp, _exp_1,
|
|
178
|
+
return React.createElement(SxHost, _attributes, _exp, _result_1, _exp_1, _result_2)
|
|
166
179
|
end
|
|
167
180
|
local default = Fab
|
|
168
181
|
return {
|
|
@@ -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 controlFade = _theme.controlFade
|
|
5
6
|
local createStyles = _theme.createStyles
|
|
6
7
|
local fabPixels = TS.import(script, script.Parent, "fabSize").fabPixels
|
|
7
8
|
local useFabStyles = componentStyles("Fab", function(theme, _param)
|
|
@@ -22,7 +23,7 @@ local useFabStyles = componentStyles("Fab", function(theme, _param)
|
|
|
22
23
|
Size = if extended == true then UDim2.new(0, 0, 0, diameter) else UDim2.fromOffset(diameter, diameter),
|
|
23
24
|
AutomaticSize = if extended == true then Enum.AutomaticSize.X else Enum.AutomaticSize.None,
|
|
24
25
|
BackgroundColor3 = tone.main,
|
|
25
|
-
BackgroundTransparency = if disabled then
|
|
26
|
+
BackgroundTransparency = if disabled then controlFade else 0,
|
|
26
27
|
BorderSizePixel = 0,
|
|
27
28
|
AutoButtonColor = false,
|
|
28
29
|
Text = "",
|
|
@@ -54,7 +55,7 @@ local useFabStyles = componentStyles("Fab", function(theme, _param)
|
|
|
54
55
|
BorderSizePixel = 0,
|
|
55
56
|
ScaleType = Enum.ScaleType.Fit,
|
|
56
57
|
ImageColor3 = tone.on,
|
|
57
|
-
ImageTransparency =
|
|
58
|
+
ImageTransparency = 0,
|
|
58
59
|
LayoutOrder = 1,
|
|
59
60
|
},
|
|
60
61
|
label = {
|
|
@@ -65,7 +66,7 @@ local useFabStyles = componentStyles("Fab", function(theme, _param)
|
|
|
65
66
|
Font = theme.typography.fontFamilies.default,
|
|
66
67
|
TextSize = theme.typography.fontSizes.body,
|
|
67
68
|
TextColor3 = tone.on,
|
|
68
|
-
TextTransparency =
|
|
69
|
+
TextTransparency = 0,
|
|
69
70
|
LayoutOrder = 2,
|
|
70
71
|
},
|
|
71
72
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type FabSize = "small" | "medium" | "large";
|
|
2
|
-
export declare function fabPixels(size?: FabSize): 40 |
|
|
2
|
+
export declare function fabPixels(size?: FabSize): 40 | 64 | 56;
|
|
3
3
|
export declare function fabIconPixels(size?: FabSize): 18 | 24 | 28;
|
|
4
4
|
export declare function fabExtended(label?: string): boolean;
|
|
@@ -3,6 +3,7 @@ local TS = _G[script]
|
|
|
3
3
|
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local React = _react
|
|
5
5
|
local useState = _react.useState
|
|
6
|
+
local useEditorHover = TS.import(script, script.Parent.Parent.Parent, "editorFace").useEditorHover
|
|
6
7
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
7
8
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
8
9
|
local Input = TS.import(script, script.Parent.Parent.Parent, "input").Input
|
|
@@ -34,8 +35,10 @@ local function builtInFamilies()
|
|
|
34
35
|
end
|
|
35
36
|
local fonts = {}
|
|
36
37
|
for _, item in Enum.Font:GetEnumItems() do
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
if item ~= Enum.Font.Unknown then
|
|
39
|
+
local _arg0 = Font.fromEnum(item)
|
|
40
|
+
table.insert(fonts, _arg0)
|
|
41
|
+
end
|
|
39
42
|
end
|
|
40
43
|
cachedFamilies = enumFamilies(fonts)
|
|
41
44
|
return cachedFamilies
|
|
@@ -50,6 +53,7 @@ local function FontEditor(props)
|
|
|
50
53
|
local id = _binding.id
|
|
51
54
|
local ref = _binding.ref
|
|
52
55
|
local styles = useFontEditorStyles()
|
|
56
|
+
local hover = useEditorHover(disabled)
|
|
53
57
|
local active = canActivate(disabled)
|
|
54
58
|
local families = builtInFamilies()
|
|
55
59
|
-- ▼ ReadonlyArray.find ▼
|
|
@@ -83,12 +87,18 @@ local function FontEditor(props)
|
|
|
83
87
|
end
|
|
84
88
|
_attributes.key = _condition
|
|
85
89
|
_attributes.hostRef = ref
|
|
86
|
-
|
|
90
|
+
local _object = table.clone(styles.root)
|
|
91
|
+
setmetatable(_object, nil)
|
|
92
|
+
for _k, _v in hover.face do
|
|
93
|
+
_object[_k] = _v
|
|
94
|
+
end
|
|
95
|
+
_attributes.base = _object
|
|
87
96
|
_attributes.className = className
|
|
88
97
|
_attributes.sx = sx
|
|
89
98
|
_attributes.state = {
|
|
90
99
|
disabled = disabled,
|
|
91
100
|
}
|
|
101
|
+
_attributes.Event = hover.event
|
|
92
102
|
local _attributes_1 = table.clone(styles.column)
|
|
93
103
|
setmetatable(_attributes_1, nil)
|
|
94
104
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
@@ -3,8 +3,12 @@ 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 editorRowHeight = _editorFace.editorRowHeight
|
|
9
|
+
local editorText = _editorFace.editorText
|
|
6
10
|
local useFontEditorStyles = componentStyles("FontEditor", function(theme)
|
|
7
|
-
|
|
11
|
+
local _object = {
|
|
8
12
|
root = {
|
|
9
13
|
Size = UDim2.new(1, 0, 0, 0),
|
|
10
14
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
@@ -13,42 +17,47 @@ local useFontEditorStyles = componentStyles("FontEditor", function(theme)
|
|
|
13
17
|
},
|
|
14
18
|
column = {
|
|
15
19
|
FillDirection = Enum.FillDirection.Vertical,
|
|
16
|
-
Padding = UDim.new(0, theme
|
|
20
|
+
Padding = UDim.new(0, editorPad(theme)),
|
|
17
21
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
18
22
|
},
|
|
19
23
|
row = {
|
|
20
|
-
Size = UDim2.new(1, 0, 0,
|
|
24
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
25
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
21
26
|
BackgroundTransparency = 1,
|
|
22
27
|
},
|
|
23
28
|
pair = {
|
|
24
|
-
Size = UDim2.new(0.5, -theme.padding.calc(0.5), 0,
|
|
29
|
+
Size = UDim2.new(0.5, -theme.padding.calc(0.5), 0, 0),
|
|
30
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
25
31
|
BackgroundTransparency = 1,
|
|
26
32
|
},
|
|
27
33
|
fill = {
|
|
28
|
-
Size = UDim2.new(1, 0, 0, theme
|
|
29
|
-
},
|
|
30
|
-
preview = {
|
|
31
|
-
Size = UDim2.new(1, 0, 0, theme.spacing.calc(3)),
|
|
32
|
-
BackgroundColor3 = theme.palette.surface.input,
|
|
33
|
-
BorderSizePixel = 0,
|
|
34
|
-
Text = "The quick brown fox",
|
|
35
|
-
TextColor3 = theme.palette.text.primary,
|
|
36
|
-
TextSize = theme.typography.fontSizes.body,
|
|
37
|
-
TextXAlignment = Enum.TextXAlignment.Left,
|
|
38
|
-
TextTruncate = Enum.TextTruncate.AtEnd,
|
|
39
|
-
},
|
|
40
|
-
padding = {
|
|
41
|
-
PaddingLeft = UDim.new(0, theme.padding.default),
|
|
42
|
-
PaddingRight = UDim.new(0, theme.padding.default),
|
|
43
|
-
},
|
|
44
|
-
corner = {
|
|
45
|
-
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
46
|
-
},
|
|
47
|
-
stroke = {
|
|
48
|
-
Color = theme.palette.border,
|
|
49
|
-
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
34
|
+
Size = UDim2.new(1, 0, 0, editorRowHeight(theme)),
|
|
50
35
|
},
|
|
51
|
-
}
|
|
36
|
+
}
|
|
37
|
+
local _left = "preview"
|
|
38
|
+
local _object_1 = {
|
|
39
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(3)),
|
|
40
|
+
BackgroundColor3 = theme.palette.surface.input,
|
|
41
|
+
BorderSizePixel = 0,
|
|
42
|
+
Text = "The quick brown fox",
|
|
43
|
+
TextColor3 = theme.palette.text.primary,
|
|
44
|
+
}
|
|
45
|
+
for _k, _v in editorText(theme) do
|
|
46
|
+
_object_1[_k] = _v
|
|
47
|
+
end
|
|
48
|
+
_object[_left] = _object_1
|
|
49
|
+
_object.padding = {
|
|
50
|
+
PaddingLeft = UDim.new(0, editorPad(theme)),
|
|
51
|
+
PaddingRight = UDim.new(0, editorPad(theme)),
|
|
52
|
+
}
|
|
53
|
+
_object.corner = {
|
|
54
|
+
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
55
|
+
}
|
|
56
|
+
_object.stroke = {
|
|
57
|
+
Color = theme.palette.border,
|
|
58
|
+
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
59
|
+
}
|
|
60
|
+
return createStyles(_object)
|
|
52
61
|
end)
|
|
53
62
|
local default = useFontEditorStyles
|
|
54
63
|
return {
|
|
@@ -1,6 +1,7 @@
|
|
|
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 useEditorHover = TS.import(script, script.Parent.Parent.Parent, "editorFace").useEditorHover
|
|
4
5
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
5
6
|
local _colorPicker = TS.import(script, script.Parent.Parent.Parent, "colorPicker")
|
|
6
7
|
local ColorSequenceEditor = _colorPicker.ColorSequenceEditor
|
|
@@ -22,6 +23,7 @@ local function GradientEditor(props)
|
|
|
22
23
|
local id = _binding.id
|
|
23
24
|
local ref = _binding.ref
|
|
24
25
|
local styles = useGradientEditorStyles()
|
|
26
|
+
local hover = useEditorHover(disabled)
|
|
25
27
|
local _attributes = {
|
|
26
28
|
tag = "frame",
|
|
27
29
|
}
|
|
@@ -31,12 +33,18 @@ local function GradientEditor(props)
|
|
|
31
33
|
end
|
|
32
34
|
_attributes.key = _condition
|
|
33
35
|
_attributes.hostRef = ref
|
|
34
|
-
|
|
36
|
+
local _object = table.clone(styles.root)
|
|
37
|
+
setmetatable(_object, nil)
|
|
38
|
+
for _k, _v in hover.face do
|
|
39
|
+
_object[_k] = _v
|
|
40
|
+
end
|
|
41
|
+
_attributes.base = _object
|
|
35
42
|
_attributes.className = className
|
|
36
43
|
_attributes.sx = sx
|
|
37
44
|
_attributes.state = {
|
|
38
45
|
disabled = disabled,
|
|
39
46
|
}
|
|
47
|
+
_attributes.Event = hover.event
|
|
40
48
|
local _attributes_1 = table.clone(styles.column)
|
|
41
49
|
setmetatable(_attributes_1, nil)
|
|
42
50
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
@@ -58,10 +66,10 @@ local function GradientEditor(props)
|
|
|
58
66
|
value = value.color,
|
|
59
67
|
disabled = disabled,
|
|
60
68
|
onChange = function(color)
|
|
61
|
-
local
|
|
62
|
-
setmetatable(
|
|
63
|
-
|
|
64
|
-
return onChange(
|
|
69
|
+
local _object_1 = table.clone(value)
|
|
70
|
+
setmetatable(_object_1, nil)
|
|
71
|
+
_object_1.color = color
|
|
72
|
+
return onChange(_object_1)
|
|
65
73
|
end,
|
|
66
74
|
}))
|
|
67
75
|
local _attributes_5 = {
|
|
@@ -82,10 +90,10 @@ local function GradientEditor(props)
|
|
|
82
90
|
value = value.transparency,
|
|
83
91
|
disabled = disabled,
|
|
84
92
|
onChange = function(transparency)
|
|
85
|
-
local
|
|
86
|
-
setmetatable(
|
|
87
|
-
|
|
88
|
-
return onChange(
|
|
93
|
+
local _object_1 = table.clone(value)
|
|
94
|
+
setmetatable(_object_1, nil)
|
|
95
|
+
_object_1.transparency = transparency
|
|
96
|
+
return onChange(_object_1)
|
|
89
97
|
end,
|
|
90
98
|
}))
|
|
91
99
|
local _attributes_8 = {
|
|
@@ -142,10 +150,10 @@ local function GradientEditor(props)
|
|
|
142
150
|
value = value.offset,
|
|
143
151
|
disabled = disabled,
|
|
144
152
|
onChange = function(offset)
|
|
145
|
-
local
|
|
146
|
-
setmetatable(
|
|
147
|
-
|
|
148
|
-
return onChange(
|
|
153
|
+
local _object_1 = table.clone(value)
|
|
154
|
+
setmetatable(_object_1, nil)
|
|
155
|
+
_object_1.offset = offset
|
|
156
|
+
return onChange(_object_1)
|
|
149
157
|
end,
|
|
150
158
|
})))
|
|
151
159
|
local _attributes_17 = {
|
|
@@ -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 useGradientEditorStyles = componentStyles("GradientEditor", function(theme)
|
|
7
|
-
|
|
10
|
+
local _object = {
|
|
8
11
|
root = {
|
|
9
12
|
Size = UDim2.new(1, 0, 0, 0),
|
|
10
13
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
@@ -13,7 +16,7 @@ local useGradientEditorStyles = componentStyles("GradientEditor", function(theme
|
|
|
13
16
|
},
|
|
14
17
|
column = {
|
|
15
18
|
FillDirection = Enum.FillDirection.Vertical,
|
|
16
|
-
Padding = UDim.new(0, theme
|
|
19
|
+
Padding = UDim.new(0, editorPad(theme)),
|
|
17
20
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
18
21
|
},
|
|
19
22
|
block = {
|
|
@@ -21,48 +24,53 @@ local useGradientEditorStyles = componentStyles("GradientEditor", function(theme
|
|
|
21
24
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
22
25
|
BackgroundTransparency = 1,
|
|
23
26
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
27
|
+
}
|
|
28
|
+
local _left = "label"
|
|
29
|
+
local _object_1 = {
|
|
30
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(2)),
|
|
31
|
+
BackgroundTransparency = 1,
|
|
32
|
+
TextColor3 = theme.palette.text.secondary,
|
|
33
|
+
}
|
|
34
|
+
for _k, _v in editorText(theme) do
|
|
35
|
+
_object_1[_k] = _v
|
|
36
|
+
end
|
|
37
|
+
_object[_left] = _object_1
|
|
38
|
+
_object.metrics = {
|
|
39
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
40
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
41
|
+
BackgroundTransparency = 1,
|
|
42
|
+
}
|
|
43
|
+
_object.metricsRow = {
|
|
44
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
45
|
+
Padding = UDim.new(0, editorPad(theme)),
|
|
46
|
+
VerticalAlignment = Enum.VerticalAlignment.Top,
|
|
47
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
48
|
+
}
|
|
49
|
+
_object.metric = {
|
|
50
|
+
Size = UDim2.new(0.5, -editorPad(theme) / 2, 0, 0),
|
|
51
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
52
|
+
BackgroundTransparency = 1,
|
|
53
|
+
}
|
|
54
|
+
_object.metricInner = {
|
|
55
|
+
FillDirection = Enum.FillDirection.Vertical,
|
|
56
|
+
Padding = UDim.new(0, editorPad(theme)),
|
|
57
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
58
|
+
}
|
|
59
|
+
local _left_1 = "metricLabel"
|
|
60
|
+
local _object_2 = {
|
|
61
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(2)),
|
|
62
|
+
BackgroundTransparency = 1,
|
|
63
|
+
TextColor3 = theme.palette.text.secondary,
|
|
64
|
+
}
|
|
65
|
+
for _k, _v in editorText(theme) do
|
|
66
|
+
_object_2[_k] = _v
|
|
67
|
+
end
|
|
68
|
+
_object[_left_1] = _object_2
|
|
69
|
+
_object.metricField = {
|
|
70
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(3)),
|
|
71
|
+
BackgroundTransparency = 1,
|
|
72
|
+
}
|
|
73
|
+
return createStyles(_object)
|
|
66
74
|
end)
|
|
67
75
|
local default = useGradientEditorStyles
|
|
68
76
|
return {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Glyph } from "./glyphs";
|
|
2
|
+
interface DrawnGlyphProps {
|
|
3
|
+
name: Glyph;
|
|
4
|
+
size: number;
|
|
5
|
+
color: Color3;
|
|
6
|
+
transparency?: number;
|
|
7
|
+
zIndex?: number;
|
|
8
|
+
}
|
|
9
|
+
/** Fills its parent. Parts are placed by scale so only the stroke weight depends on `size`. */
|
|
10
|
+
export declare function DrawnGlyph(props: DrawnGlyphProps): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
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 _glyphs = TS.import(script, script.Parent, "glyphs")
|
|
5
|
+
local glyphParts = _glyphs.glyphParts
|
|
6
|
+
local glyphStroke = _glyphs.glyphStroke
|
|
7
|
+
local GRID = 24
|
|
8
|
+
local PILL = UDim.new(1, 0)
|
|
9
|
+
local CENTER = Vector2.new(0.5, 0.5)
|
|
10
|
+
--* Fills its parent. Parts are placed by scale so only the stroke weight depends on `size`.
|
|
11
|
+
local function DrawnGlyph(props)
|
|
12
|
+
local _binding = props
|
|
13
|
+
local name = _binding.name
|
|
14
|
+
local size = _binding.size
|
|
15
|
+
local color = _binding.color
|
|
16
|
+
local transparency = _binding.transparency
|
|
17
|
+
if transparency == nil then
|
|
18
|
+
transparency = 0
|
|
19
|
+
end
|
|
20
|
+
local zIndex = _binding.zIndex
|
|
21
|
+
local t = glyphStroke(size)
|
|
22
|
+
local _exp = glyphParts(name)
|
|
23
|
+
-- ▼ ReadonlyArray.map ▼
|
|
24
|
+
local _newValue = table.create(#_exp)
|
|
25
|
+
local _callback = function(part, index)
|
|
26
|
+
local key = `g{index}`
|
|
27
|
+
if part.kind == "bar" then
|
|
28
|
+
local dx = part.x2 - part.x1
|
|
29
|
+
local dy = part.y2 - part.y1
|
|
30
|
+
return React.createElement("frame", {
|
|
31
|
+
key = key,
|
|
32
|
+
AnchorPoint = CENTER,
|
|
33
|
+
Position = UDim2.fromScale((part.x1 + part.x2) / 2 / GRID, (part.y1 + part.y2) / 2 / GRID),
|
|
34
|
+
Size = UDim2.new(math.sqrt(dx * dx + dy * dy) / GRID, t, 0, t),
|
|
35
|
+
Rotation = math.deg(math.atan2(dy, dx)),
|
|
36
|
+
BackgroundColor3 = color,
|
|
37
|
+
BackgroundTransparency = transparency,
|
|
38
|
+
BorderSizePixel = 0,
|
|
39
|
+
ZIndex = zIndex,
|
|
40
|
+
}, React.createElement("uicorner", {
|
|
41
|
+
CornerRadius = PILL,
|
|
42
|
+
}))
|
|
43
|
+
end
|
|
44
|
+
if part.kind == "dot" then
|
|
45
|
+
return React.createElement("frame", {
|
|
46
|
+
key = key,
|
|
47
|
+
AnchorPoint = CENTER,
|
|
48
|
+
Position = UDim2.fromScale(part.x / GRID, part.y / GRID),
|
|
49
|
+
Size = UDim2.fromScale(part.d / GRID, part.d / GRID),
|
|
50
|
+
SizeConstraint = Enum.SizeConstraint.RelativeXX,
|
|
51
|
+
BackgroundColor3 = color,
|
|
52
|
+
BackgroundTransparency = transparency,
|
|
53
|
+
BorderSizePixel = 0,
|
|
54
|
+
ZIndex = zIndex,
|
|
55
|
+
}, React.createElement("uicorner", {
|
|
56
|
+
CornerRadius = PILL,
|
|
57
|
+
}))
|
|
58
|
+
end
|
|
59
|
+
local ringed = part.kind == "ring"
|
|
60
|
+
local w = if ringed then part.d else part.w
|
|
61
|
+
local h = if ringed then part.d else part.h
|
|
62
|
+
local x = if ringed then part.x - part.d / 2 else part.x
|
|
63
|
+
local y = if ringed then part.y - part.d / 2 else part.y
|
|
64
|
+
return React.createElement("frame", {
|
|
65
|
+
key = key,
|
|
66
|
+
Position = UDim2.new(x / GRID, t, y / GRID, t),
|
|
67
|
+
Size = UDim2.new(w / GRID, -t * 2, h / GRID, -t * 2),
|
|
68
|
+
BackgroundTransparency = 1,
|
|
69
|
+
BorderSizePixel = 0,
|
|
70
|
+
ZIndex = zIndex,
|
|
71
|
+
}, React.createElement("uicorner", {
|
|
72
|
+
CornerRadius = if ringed then PILL else UDim.new(0, t),
|
|
73
|
+
}), React.createElement("uistroke", {
|
|
74
|
+
Color = color,
|
|
75
|
+
Thickness = t,
|
|
76
|
+
Transparency = transparency,
|
|
77
|
+
}))
|
|
78
|
+
end
|
|
79
|
+
for _k, _v in _exp do
|
|
80
|
+
_newValue[_k] = _callback(_v, _k - 1, _exp)
|
|
81
|
+
end
|
|
82
|
+
-- ▲ ReadonlyArray.map ▲
|
|
83
|
+
return React.createElement(React.Fragment, nil, _newValue)
|
|
84
|
+
end
|
|
85
|
+
return {
|
|
86
|
+
DrawnGlyph = DrawnGlyph,
|
|
87
|
+
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Icons } from "../../../enums/index";
|
|
2
2
|
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
+
import { Glyph } from "./glyphs";
|
|
3
4
|
export interface IconProps {
|
|
4
|
-
icon
|
|
5
|
-
|
|
5
|
+
icon?: Icons;
|
|
6
|
+
/** Drawn glyph. Wins over `icon`. */
|
|
7
|
+
glyph?: Glyph;
|
|
8
|
+
/** Named step, or pixels from `controlMetrics().icon`. */
|
|
9
|
+
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | number;
|
|
6
10
|
tint?: Color3;
|
|
7
11
|
}
|
|
8
12
|
type DefaultIconComponent = ImageLabel;
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
5
|
+
local DrawnGlyph = TS.import(script, script.Parent, "DrawnGlyph").DrawnGlyph
|
|
5
6
|
local useIconStyles = TS.import(script, script.Parent, "Icon.styles").default
|
|
6
7
|
local function Icon(props)
|
|
7
8
|
local _binding = props
|
|
8
9
|
local icon = _binding.icon
|
|
10
|
+
local glyph = _binding.glyph
|
|
9
11
|
local tint = _binding.tint
|
|
10
12
|
local className = _binding.className
|
|
11
13
|
local sx = _binding.sx
|
|
@@ -13,6 +15,7 @@ local function Icon(props)
|
|
|
13
15
|
local ref = _binding.ref
|
|
14
16
|
local _binding_1 = useIconStyles(props)
|
|
15
17
|
local container = _binding_1.container
|
|
18
|
+
local color = tint or (container.ImageColor3)
|
|
16
19
|
local _attributes = {
|
|
17
20
|
tag = "imagelabel",
|
|
18
21
|
}
|
|
@@ -25,9 +28,26 @@ local function Icon(props)
|
|
|
25
28
|
_attributes.base = container
|
|
26
29
|
_attributes.className = className
|
|
27
30
|
_attributes.sx = sx
|
|
28
|
-
_attributes.Image = tostring(icon)
|
|
29
|
-
_attributes.ImageColor3 =
|
|
30
|
-
|
|
31
|
+
_attributes.Image = if glyph ~= nil or icon == nil then "" else tostring(icon)
|
|
32
|
+
_attributes.ImageColor3 = color
|
|
33
|
+
local _condition_1 = glyph ~= nil
|
|
34
|
+
if _condition_1 then
|
|
35
|
+
local _attributes_1 = {
|
|
36
|
+
name = glyph,
|
|
37
|
+
}
|
|
38
|
+
local _result = container.Size
|
|
39
|
+
if _result ~= nil then
|
|
40
|
+
_result = _result.X.Offset
|
|
41
|
+
end
|
|
42
|
+
local _condition_2 = _result
|
|
43
|
+
if _condition_2 == nil then
|
|
44
|
+
_condition_2 = 16
|
|
45
|
+
end
|
|
46
|
+
_attributes_1.size = _condition_2
|
|
47
|
+
_attributes_1.color = color
|
|
48
|
+
_condition_1 = (React.createElement(DrawnGlyph, _attributes_1))
|
|
49
|
+
end
|
|
50
|
+
return React.createElement(SxHost, _attributes, _condition_1)
|
|
31
51
|
end
|
|
32
52
|
local default = Icon
|
|
33
53
|
return {
|