@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,14 +3,16 @@ local TS = _G[script]
|
|
|
3
3
|
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local React = _react
|
|
5
5
|
local useEffect = _react.useEffect
|
|
6
|
+
local useRef = _react.useRef
|
|
6
7
|
local useState = _react.useState
|
|
7
8
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
8
9
|
local useShadowStyles = TS.import(script, script.Parent, "Shadow.styles").default
|
|
10
|
+
local ORIGIN = UDim2.fromOffset(0, 0)
|
|
11
|
+
local ZERO_ANCHOR = Vector2.new(0, 0)
|
|
9
12
|
local function Shadow(props)
|
|
10
13
|
local _binding = useShadowStyles()
|
|
11
14
|
local container = _binding.container
|
|
12
15
|
local blob = _binding.blob
|
|
13
|
-
local parent, setParent = useState(nil)
|
|
14
16
|
local cornerRadius, setCornerRadius = useState()
|
|
15
17
|
local blobSize, setBlobSize = useState(UDim2.fromOffset(0, 0))
|
|
16
18
|
local _binding_1 = props
|
|
@@ -24,31 +26,189 @@ local function Shadow(props)
|
|
|
24
26
|
end
|
|
25
27
|
local defaultZIndex = _condition
|
|
26
28
|
local zIndex, setZIndex = useState(defaultZIndex)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
local alive = useRef(true)
|
|
30
|
+
local gen = useRef(0)
|
|
31
|
+
local shadowRef = useRef()
|
|
32
|
+
local wrapRef = useRef()
|
|
33
|
+
local faceRef = useRef()
|
|
34
|
+
local conns = useRef({})
|
|
35
|
+
local disconnect = function()
|
|
36
|
+
for _, conn in conns.current do
|
|
37
|
+
conn:Disconnect()
|
|
38
|
+
end
|
|
39
|
+
conns.current = {}
|
|
40
|
+
end
|
|
41
|
+
local follow = function(face)
|
|
42
|
+
local wrap = wrapRef.current
|
|
43
|
+
if not wrap or face.Parent ~= wrap then
|
|
29
44
|
return nil
|
|
30
45
|
end
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
46
|
+
if face.Position ~= ORIGIN then
|
|
47
|
+
wrap.Position = face.Position
|
|
48
|
+
face.Position = ORIGIN
|
|
34
49
|
end
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if _condition_1 == nil then
|
|
39
|
-
_condition_1 = defaultZIndex
|
|
50
|
+
if face.AnchorPoint ~= ZERO_ANCHOR then
|
|
51
|
+
wrap.AnchorPoint = face.AnchorPoint
|
|
52
|
+
face.AnchorPoint = ZERO_ANCHOR
|
|
40
53
|
end
|
|
41
|
-
|
|
42
|
-
|
|
54
|
+
wrap.Size = face.Size
|
|
55
|
+
wrap.AutomaticSize = face.AutomaticSize
|
|
56
|
+
wrap.LayoutOrder = face.LayoutOrder
|
|
57
|
+
wrap.ZIndex = face.ZIndex
|
|
58
|
+
wrap.Visible = face.Visible
|
|
59
|
+
local size = UDim2.fromOffset(face.AbsoluteSize.X, face.AbsoluteSize.Y)
|
|
60
|
+
setBlobSize(function(prev)
|
|
61
|
+
return if prev.X.Offset == size.X.Offset and prev.Y.Offset == size.Y.Offset then prev else size
|
|
62
|
+
end)
|
|
63
|
+
local _radius = face:FindFirstChildOfClass("UICorner")
|
|
64
|
+
if _radius ~= nil then
|
|
65
|
+
_radius = _radius.CornerRadius
|
|
66
|
+
end
|
|
67
|
+
local radius = _radius
|
|
68
|
+
setCornerRadius(function(prev)
|
|
69
|
+
if radius == nil then
|
|
70
|
+
return if prev == nil then prev else nil
|
|
71
|
+
end
|
|
72
|
+
if prev ~= nil and prev.Offset == radius.Offset and prev.Scale == radius.Scale then
|
|
73
|
+
return prev
|
|
74
|
+
end
|
|
75
|
+
return radius
|
|
76
|
+
end)
|
|
77
|
+
setZIndex(face.ZIndex - 1)
|
|
78
|
+
end
|
|
79
|
+
local schedule
|
|
80
|
+
local bind = function(face)
|
|
81
|
+
disconnect()
|
|
43
82
|
local sync = function()
|
|
44
|
-
|
|
83
|
+
return follow(face)
|
|
45
84
|
end
|
|
46
85
|
sync()
|
|
47
|
-
local
|
|
86
|
+
local watch = { "AbsoluteSize", "Size", "AutomaticSize", "Position", "AnchorPoint", "LayoutOrder", "ZIndex", "Visible" }
|
|
87
|
+
-- ▼ ReadonlyArray.map ▼
|
|
88
|
+
local _newValue = table.create(#watch)
|
|
89
|
+
local _callback = function(name)
|
|
90
|
+
return face:GetPropertyChangedSignal(name):Connect(sync)
|
|
91
|
+
end
|
|
92
|
+
for _k, _v in watch do
|
|
93
|
+
_newValue[_k] = _callback(_v, _k - 1, watch)
|
|
94
|
+
end
|
|
95
|
+
-- ▲ ReadonlyArray.map ▲
|
|
96
|
+
conns.current = _newValue
|
|
97
|
+
local _current = conns.current
|
|
98
|
+
local _arg0 = face.AncestryChanged:Connect(function()
|
|
99
|
+
local shadow = shadowRef.current
|
|
100
|
+
if shadow then
|
|
101
|
+
schedule(shadow)
|
|
102
|
+
end
|
|
103
|
+
end)
|
|
104
|
+
table.insert(_current, _arg0)
|
|
105
|
+
end
|
|
106
|
+
local lift = function(shadow)
|
|
107
|
+
if not alive.current then
|
|
108
|
+
return nil
|
|
109
|
+
end
|
|
110
|
+
local parent = shadow.Parent
|
|
111
|
+
if not parent or not parent:IsA("GuiObject") then
|
|
112
|
+
return nil
|
|
113
|
+
end
|
|
114
|
+
local existing = wrapRef.current
|
|
115
|
+
if existing and parent == existing then
|
|
116
|
+
local face = faceRef.current
|
|
117
|
+
if not face or face.Parent == existing then
|
|
118
|
+
return nil
|
|
119
|
+
end
|
|
120
|
+
if face.Position ~= ORIGIN then
|
|
121
|
+
existing.Position = face.Position
|
|
122
|
+
face.Position = ORIGIN
|
|
123
|
+
end
|
|
124
|
+
if face.AnchorPoint ~= ZERO_ANCHOR then
|
|
125
|
+
existing.AnchorPoint = face.AnchorPoint
|
|
126
|
+
face.AnchorPoint = ZERO_ANCHOR
|
|
127
|
+
end
|
|
128
|
+
shadow.Parent = existing
|
|
129
|
+
face.Parent = existing
|
|
130
|
+
return nil
|
|
131
|
+
end
|
|
132
|
+
local face = parent
|
|
133
|
+
local wrapped = existing ~= nil and face.Parent == existing
|
|
134
|
+
local holder = if wrapped then existing.Parent else face.Parent
|
|
135
|
+
if not holder then
|
|
136
|
+
return nil
|
|
137
|
+
end
|
|
138
|
+
disconnect()
|
|
139
|
+
local wrap = existing or Instance.new("Frame")
|
|
140
|
+
if existing == nil then
|
|
141
|
+
wrap.Name = "ShadowWrap"
|
|
142
|
+
wrap.BackgroundTransparency = 1
|
|
143
|
+
wrap.BorderSizePixel = 0
|
|
144
|
+
wrap.ClipsDescendants = false
|
|
145
|
+
wrapRef.current = wrap
|
|
146
|
+
end
|
|
147
|
+
wrap.Size = face.Size
|
|
148
|
+
wrap.AutomaticSize = face.AutomaticSize
|
|
149
|
+
wrap.LayoutOrder = face.LayoutOrder
|
|
150
|
+
wrap.ZIndex = face.ZIndex
|
|
151
|
+
wrap.Visible = face.Visible
|
|
152
|
+
if not wrapped then
|
|
153
|
+
wrap.Position = face.Position
|
|
154
|
+
wrap.AnchorPoint = face.AnchorPoint
|
|
155
|
+
-- Shadow first, surface next, so the face paints over the blob.
|
|
156
|
+
shadow.Parent = wrap
|
|
157
|
+
face.Parent = wrap
|
|
158
|
+
face.Position = ORIGIN
|
|
159
|
+
face.AnchorPoint = ZERO_ANCHOR
|
|
160
|
+
wrap.Parent = holder
|
|
161
|
+
else
|
|
162
|
+
shadow.Parent = wrap
|
|
163
|
+
end
|
|
164
|
+
faceRef.current = face
|
|
165
|
+
bind(face)
|
|
166
|
+
end
|
|
167
|
+
schedule = function(shadow)
|
|
168
|
+
if not alive.current then
|
|
169
|
+
return nil
|
|
170
|
+
end
|
|
171
|
+
local wrap = wrapRef.current
|
|
172
|
+
local face = faceRef.current
|
|
173
|
+
if wrap and shadow.Parent == wrap and face and face.Parent == wrap then
|
|
174
|
+
return nil
|
|
175
|
+
end
|
|
176
|
+
gen.current += 1
|
|
177
|
+
local token = gen.current
|
|
178
|
+
task.defer(function()
|
|
179
|
+
if not alive.current or gen.current ~= token then
|
|
180
|
+
return nil
|
|
181
|
+
end
|
|
182
|
+
lift(shadow)
|
|
183
|
+
end)
|
|
184
|
+
end
|
|
185
|
+
useEffect(function()
|
|
186
|
+
local shadow = shadowRef.current
|
|
187
|
+
if shadow then
|
|
188
|
+
schedule(shadow)
|
|
189
|
+
end
|
|
48
190
|
return function()
|
|
49
|
-
|
|
191
|
+
alive.current = false
|
|
192
|
+
gen.current += 1
|
|
193
|
+
disconnect()
|
|
194
|
+
local wrap = wrapRef.current
|
|
195
|
+
local face = faceRef.current
|
|
196
|
+
local host = shadowRef.current
|
|
197
|
+
wrapRef.current = nil
|
|
198
|
+
if wrap and face and face.Parent == wrap then
|
|
199
|
+
face.Position = wrap.Position
|
|
200
|
+
face.AnchorPoint = wrap.AnchorPoint
|
|
201
|
+
if host and host.Parent == wrap then
|
|
202
|
+
host.Parent = face
|
|
203
|
+
end
|
|
204
|
+
face.Parent = wrap.Parent
|
|
205
|
+
end
|
|
206
|
+
local _result = wrap
|
|
207
|
+
if _result ~= nil then
|
|
208
|
+
_result:Destroy()
|
|
209
|
+
end
|
|
50
210
|
end
|
|
51
|
-
end, {
|
|
211
|
+
end, {})
|
|
52
212
|
local _attributes = {
|
|
53
213
|
tag = "frame",
|
|
54
214
|
}
|
|
@@ -57,7 +217,16 @@ local function Shadow(props)
|
|
|
57
217
|
_condition_1 = "Shadow"
|
|
58
218
|
end
|
|
59
219
|
_attributes.key = _condition_1
|
|
60
|
-
_attributes.hostRef =
|
|
220
|
+
_attributes.hostRef = function(instance)
|
|
221
|
+
shadowRef.current = instance
|
|
222
|
+
if type(ref) == "function" then
|
|
223
|
+
ref(instance)
|
|
224
|
+
return nil
|
|
225
|
+
end
|
|
226
|
+
if ref ~= nil then
|
|
227
|
+
ref.current = instance
|
|
228
|
+
end
|
|
229
|
+
end
|
|
61
230
|
_attributes.base = container
|
|
62
231
|
_attributes.className = className
|
|
63
232
|
_attributes.sx = sx
|
|
@@ -65,7 +234,7 @@ local function Shadow(props)
|
|
|
65
234
|
_attributes.Event = {
|
|
66
235
|
AncestryChanged = function(rbx, parent)
|
|
67
236
|
if parent:IsA("GuiObject") and rbx.Parent == parent then
|
|
68
|
-
|
|
237
|
+
schedule(rbx)
|
|
69
238
|
end
|
|
70
239
|
end,
|
|
71
240
|
}
|
|
@@ -69,6 +69,8 @@ local function SkeletonBlock(props)
|
|
|
69
69
|
_attributes.base = {
|
|
70
70
|
BackgroundTransparency = 1,
|
|
71
71
|
BorderSizePixel = 0,
|
|
72
|
+
AutomaticSize = Enum.AutomaticSize.None,
|
|
73
|
+
ClipsDescendants = true,
|
|
72
74
|
}
|
|
73
75
|
_attributes.className = className
|
|
74
76
|
_attributes.sx = sx
|
|
@@ -179,6 +181,8 @@ local function Skeleton(props)
|
|
|
179
181
|
_attributes.className = className
|
|
180
182
|
_attributes.sx = sx
|
|
181
183
|
_attributes.Size = UDim2.new(0, width, 0, blockHeight)
|
|
184
|
+
_attributes.AutomaticSize = Enum.AutomaticSize.None
|
|
185
|
+
_attributes.ClipsDescendants = true
|
|
182
186
|
_attributes.BackgroundTransparency = 1
|
|
183
187
|
_attributes.BorderSizePixel = 0
|
|
184
188
|
local _exp = React.createElement("uilistlayout", {
|
|
@@ -4,7 +4,9 @@ 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
|
|
7
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
8
|
+
local controlFade = _theme.controlFade
|
|
9
|
+
local cx = _theme.cx
|
|
8
10
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
9
11
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
10
12
|
local commitNumber = TS.import(script, script.Parent.Parent.Parent, "numberInput", "components", "numberValue").commitNumber
|
|
@@ -104,7 +106,7 @@ local function RangeSlider(props)
|
|
|
104
106
|
local knobLook = function(ratio, which)
|
|
105
107
|
return cx(styles.knob, {
|
|
106
108
|
Position = UDim2.fromScale(ratio, 0.5),
|
|
107
|
-
BackgroundTransparency = if faded then
|
|
109
|
+
BackgroundTransparency = if faded then controlFade else 0,
|
|
108
110
|
ZIndex = if which == thumb.current then 3 else 2,
|
|
109
111
|
})
|
|
110
112
|
end
|
|
@@ -127,7 +129,6 @@ local function RangeSlider(props)
|
|
|
127
129
|
}
|
|
128
130
|
_attributes.Active = active
|
|
129
131
|
_attributes.Selectable = active
|
|
130
|
-
_attributes.BackgroundTransparency = if showFocus then 0.85 else 1
|
|
131
132
|
_attributes.Event = {
|
|
132
133
|
InputBegan = function(rbx, input)
|
|
133
134
|
if not active then
|
|
@@ -175,7 +176,7 @@ local function RangeSlider(props)
|
|
|
175
176
|
for _k, _v in styles.track do
|
|
176
177
|
_attributes_1[_k] = _v
|
|
177
178
|
end
|
|
178
|
-
_attributes_1.BackgroundTransparency = if faded then
|
|
179
|
+
_attributes_1.BackgroundTransparency = if faded then controlFade else 0.35
|
|
179
180
|
local _attributes_2 = table.clone(styles.corner)
|
|
180
181
|
setmetatable(_attributes_2, nil)
|
|
181
182
|
local _exp = React.createElement("uicorner", _attributes_2)
|
|
@@ -185,7 +186,7 @@ local function RangeSlider(props)
|
|
|
185
186
|
for _k, _v in cx(styles.fill, {
|
|
186
187
|
Position = UDim2.fromScale(ratios.low, 0),
|
|
187
188
|
Size = UDim2.fromScale(ratios.high - ratios.low, 1),
|
|
188
|
-
BackgroundTransparency = if faded then
|
|
189
|
+
BackgroundTransparency = if faded then controlFade elseif pressed then 0.1 else 0,
|
|
189
190
|
}) do
|
|
190
191
|
_attributes_3[_k] = _v
|
|
191
192
|
end
|
|
@@ -6,6 +6,7 @@ local useRef = _react.useRef
|
|
|
6
6
|
local useState = _react.useState
|
|
7
7
|
local TextService = TS.import(script, TS.getModule(script, "@rbxts", "services")).TextService
|
|
8
8
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
9
|
+
local controlFade = _theme.controlFade
|
|
9
10
|
local controlMetrics = _theme.controlMetrics
|
|
10
11
|
local cx = _theme.cx
|
|
11
12
|
local useTheme = _theme.useTheme
|
|
@@ -129,7 +130,6 @@ local function Slider(props)
|
|
|
129
130
|
}
|
|
130
131
|
_attributes.Active = active
|
|
131
132
|
_attributes.Selectable = active
|
|
132
|
-
_attributes.BackgroundTransparency = if showFocus then 0.85 else 1
|
|
133
133
|
_attributes.Event = {
|
|
134
134
|
InputBegan = function(rbx, input)
|
|
135
135
|
if not active then
|
|
@@ -178,7 +178,7 @@ local function Slider(props)
|
|
|
178
178
|
key = "Track",
|
|
179
179
|
}
|
|
180
180
|
for _k, _v in cx(track, {
|
|
181
|
-
BackgroundTransparency = if faded then
|
|
181
|
+
BackgroundTransparency = if faded then controlFade elseif hovering and active then 0.2 else 0.35,
|
|
182
182
|
}, labelText ~= nil and {
|
|
183
183
|
Size = UDim2.new(1, -(slot + 4), 0, metrics.sliderTrack),
|
|
184
184
|
}) do
|
|
@@ -187,12 +187,6 @@ local function Slider(props)
|
|
|
187
187
|
local _attributes_2 = table.clone(corner)
|
|
188
188
|
setmetatable(_attributes_2, nil)
|
|
189
189
|
local _exp = React.createElement("uicorner", _attributes_2)
|
|
190
|
-
local _condition_1 = showFocus
|
|
191
|
-
if _condition_1 then
|
|
192
|
-
local _attributes_3 = table.clone(stroke)
|
|
193
|
-
setmetatable(_attributes_3, nil)
|
|
194
|
-
_condition_1 = React.createElement("uistroke", _attributes_3)
|
|
195
|
-
end
|
|
196
190
|
-- ▼ ReadonlyArray.map ▼
|
|
197
191
|
local _newValue = table.create(#markValues)
|
|
198
192
|
local _callback = function(markValue, index)
|
|
@@ -204,7 +198,7 @@ local function Slider(props)
|
|
|
204
198
|
_attributes_3[_k] = _v
|
|
205
199
|
end
|
|
206
200
|
_attributes_3.Position = UDim2.fromScale(markRatio, 0.5)
|
|
207
|
-
_attributes_3.BackgroundTransparency = if faded then
|
|
201
|
+
_attributes_3.BackgroundTransparency = if faded then controlFade else 0.35
|
|
208
202
|
return React.createElement("frame", _attributes_3)
|
|
209
203
|
end
|
|
210
204
|
for _k, _v in markValues do
|
|
@@ -216,7 +210,7 @@ local function Slider(props)
|
|
|
216
210
|
key = "Fill",
|
|
217
211
|
}
|
|
218
212
|
for _k, _v in cx(fill, {
|
|
219
|
-
BackgroundTransparency = if faded then
|
|
213
|
+
BackgroundTransparency = if faded then controlFade elseif pressed then 0.1 else 0,
|
|
220
214
|
}) do
|
|
221
215
|
_attributes_3[_k] = _v
|
|
222
216
|
end
|
|
@@ -228,7 +222,7 @@ local function Slider(props)
|
|
|
228
222
|
key = "Knob",
|
|
229
223
|
}
|
|
230
224
|
for _k, _v in cx(knob, {
|
|
231
|
-
BackgroundTransparency = if faded then
|
|
225
|
+
BackgroundTransparency = if faded then controlFade else 0,
|
|
232
226
|
}) do
|
|
233
227
|
_attributes_5[_k] = _v
|
|
234
228
|
end
|
|
@@ -236,13 +230,13 @@ local function Slider(props)
|
|
|
236
230
|
local _attributes_6 = table.clone(corner)
|
|
237
231
|
setmetatable(_attributes_6, nil)
|
|
238
232
|
local _exp_3 = React.createElement("uicorner", _attributes_6)
|
|
239
|
-
local
|
|
240
|
-
if
|
|
233
|
+
local _condition_1 = showFocus
|
|
234
|
+
if _condition_1 then
|
|
241
235
|
local _attributes_7 = table.clone(stroke)
|
|
242
236
|
setmetatable(_attributes_7, nil)
|
|
243
|
-
|
|
237
|
+
_condition_1 = React.createElement("uistroke", _attributes_7)
|
|
244
238
|
end
|
|
245
|
-
local _exp_4 = React.createElement("frame", _attributes_1, _exp,
|
|
239
|
+
local _exp_4 = React.createElement("frame", _attributes_1, _exp, _exp_1, _exp_2, React.createElement("frame", _attributes_5, _exp_3, _condition_1))
|
|
246
240
|
local _result
|
|
247
241
|
if labelText ~= nil then
|
|
248
242
|
local _attributes_7 = {
|
|
@@ -253,7 +247,8 @@ local function Slider(props)
|
|
|
253
247
|
end
|
|
254
248
|
_attributes_7.Size = UDim2.new(0, slot, 1, 0)
|
|
255
249
|
_attributes_7.Text = labelText
|
|
256
|
-
|
|
250
|
+
_attributes_7.TextTransparency = if faded then controlFade else 0
|
|
251
|
+
_result = (React.createElement("textlabel", _attributes_7))
|
|
257
252
|
else
|
|
258
253
|
_result = nil
|
|
259
254
|
end
|
|
@@ -32,9 +32,11 @@ local function Sparkline(props)
|
|
|
32
32
|
local _binding_1 = useTheme()
|
|
33
33
|
local theme = _binding_1.theme
|
|
34
34
|
local host = useRef()
|
|
35
|
-
local
|
|
36
|
-
local
|
|
37
|
-
local
|
|
35
|
+
local inset = 6
|
|
36
|
+
local dot = 6
|
|
37
|
+
local segments = sparklineLayout(values, width, height, inset)
|
|
38
|
+
local bars = if area == true then sparklineArea(values, width, height, inset) else {}
|
|
39
|
+
local marked = if mark ~= nil then sparklinePoint(values, mark, width, height, inset) else nil
|
|
38
40
|
local stroke = color or theme.palette.primary.main
|
|
39
41
|
local _attributes = {
|
|
40
42
|
tag = "frame",
|
|
@@ -65,7 +67,7 @@ local function Sparkline(props)
|
|
|
65
67
|
if input.UserInputType ~= Enum.UserInputType.MouseButton1 and input.UserInputType ~= Enum.UserInputType.Touch then
|
|
66
68
|
return nil
|
|
67
69
|
end
|
|
68
|
-
sparklinePick(input.Position.X - frame.AbsolutePosition.X, #values, width, onPick)
|
|
70
|
+
sparklinePick(input.Position.X - frame.AbsolutePosition.X, #values, width, onPick, inset)
|
|
69
71
|
end,
|
|
70
72
|
}
|
|
71
73
|
_attributes.base = {
|
|
@@ -96,7 +98,7 @@ local function Sparkline(props)
|
|
|
96
98
|
key = "Mark",
|
|
97
99
|
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
98
100
|
Position = UDim2.fromOffset(marked.x, marked.y),
|
|
99
|
-
Size = UDim2.fromOffset(
|
|
101
|
+
Size = UDim2.fromOffset(dot, dot),
|
|
100
102
|
BackgroundColor3 = stroke,
|
|
101
103
|
BorderSizePixel = 0,
|
|
102
104
|
ZIndex = 3,
|
|
@@ -118,7 +118,10 @@ local function SpeedDial(props)
|
|
|
118
118
|
local _exp_2 = React.createElement("uipadding", _attributes_5)
|
|
119
119
|
local _attributes_6 = table.clone(styles.actionCorner)
|
|
120
120
|
setmetatable(_attributes_6, nil)
|
|
121
|
-
|
|
121
|
+
local _exp_3 = React.createElement("uicorner", _attributes_6)
|
|
122
|
+
local _attributes_7 = table.clone(styles.actionCap)
|
|
123
|
+
setmetatable(_attributes_7, nil)
|
|
124
|
+
return React.createElement("frame", _attributes_2, _exp_1, React.createElement("textlabel", _attributes_4, _exp_2, _exp_3, React.createElement("uisizeconstraint", _attributes_7)), button)
|
|
122
125
|
end
|
|
123
126
|
for _k, _v in actions do
|
|
124
127
|
_newValue[_k] = _callback_1(_v, _k - 1, actions)
|
|
@@ -55,7 +55,12 @@ local useSpeedDialStyles = componentStyles("SpeedDial", function(theme, _param)
|
|
|
55
55
|
end
|
|
56
56
|
_object_1[_left_1] = _condition
|
|
57
57
|
_object_1.TextColor3 = theme.palette.text.primary
|
|
58
|
+
_object_1.TextTruncate = Enum.TextTruncate.AtEnd
|
|
59
|
+
_object_1.TextWrapped = false
|
|
58
60
|
_object[_left] = _object_1
|
|
61
|
+
_object.actionCap = {
|
|
62
|
+
MaxSize = Vector2.new(theme.spacing.calc(16), math.huge),
|
|
63
|
+
}
|
|
59
64
|
_object.actionPad = {
|
|
60
65
|
PaddingLeft = UDim.new(0, theme.padding.calc(1)),
|
|
61
66
|
PaddingRight = UDim.new(0, theme.padding.calc(1)),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** An empty name stays off the action. */
|
|
2
2
|
export declare function speedDialLabel(text?: string): string | undefined;
|
|
3
3
|
/** The name sits beside the button, opposite the way the dial travels. */
|
|
4
|
-
export declare function speedDialLabelFirst(direction: "up" | "down" | "left" | "right"): direction is "
|
|
4
|
+
export declare function speedDialLabelFirst(direction: "up" | "down" | "left" | "right"): direction is "down" | "up" | "right";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type SplitPointer = "rest" | "hover" | "press";
|
|
2
2
|
export declare function splitPointer(hovering: boolean, pressed: boolean): SplitPointer;
|
|
3
|
-
export declare function splitRuleTransparency(pointer: SplitPointer, disabled?: boolean): 0.25 | 0.
|
|
3
|
+
export declare function splitRuleTransparency(pointer: SplitPointer, disabled?: boolean): 0.25 | 0.35 | 0.7 | 0.55;
|
|
4
4
|
export declare function splitMarkTransparency(pointer: SplitPointer, disabled?: boolean): 0 | 0.55 | 0.1;
|
|
5
5
|
export declare function splitHitTransparency(pointer: SplitPointer, disabled?: boolean): 1 | 0.9 | 0.94;
|
|
@@ -8,10 +8,11 @@ local useStepperStyles = componentStyles("Stepper", function(theme, _param)
|
|
|
8
8
|
if orientation == nil then
|
|
9
9
|
orientation = "horizontal"
|
|
10
10
|
end
|
|
11
|
+
local heading = theme.typography.variants.h6
|
|
11
12
|
return createStyles({
|
|
12
13
|
root = {
|
|
13
|
-
AutomaticSize = Enum.AutomaticSize.XY,
|
|
14
|
-
Size = UDim2.fromScale(0, 0),
|
|
14
|
+
AutomaticSize = if orientation == "vertical" then Enum.AutomaticSize.Y else Enum.AutomaticSize.XY,
|
|
15
|
+
Size = if orientation == "vertical" then UDim2.new(1, 0, 0, 0) else UDim2.fromScale(0, 0),
|
|
15
16
|
BackgroundTransparency = 1,
|
|
16
17
|
BorderSizePixel = 0,
|
|
17
18
|
},
|
|
@@ -21,12 +22,14 @@ local useStepperStyles = componentStyles("Stepper", function(theme, _param)
|
|
|
21
22
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
22
23
|
},
|
|
23
24
|
step = {
|
|
24
|
-
AutomaticSize = Enum.AutomaticSize.XY,
|
|
25
|
-
Size = UDim2.fromScale(0, 0),
|
|
25
|
+
AutomaticSize = if orientation == "vertical" then Enum.AutomaticSize.Y else Enum.AutomaticSize.XY,
|
|
26
|
+
Size = if orientation == "vertical" then UDim2.new(1, 0, 0, 0) else UDim2.fromScale(0, 0),
|
|
26
27
|
BackgroundTransparency = 1,
|
|
27
28
|
BorderSizePixel = 0,
|
|
28
|
-
Font = theme.typography.fontFamilies.
|
|
29
|
-
TextSize =
|
|
29
|
+
Font = theme.typography.fontFamilies[heading.family],
|
|
30
|
+
TextSize = heading.size,
|
|
31
|
+
LineHeight = heading.leading,
|
|
32
|
+
TextWrapped = true,
|
|
30
33
|
TextColor3 = theme.palette.text.secondary,
|
|
31
34
|
},
|
|
32
35
|
active = {
|
|
@@ -7,6 +7,7 @@ local useRef = _react.useRef
|
|
|
7
7
|
local useState = _react.useState
|
|
8
8
|
local useReducedMotion = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "hooks").useReducedMotion
|
|
9
9
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
10
|
+
local controlFade = _theme.controlFade
|
|
10
11
|
local controlMetrics = _theme.controlMetrics
|
|
11
12
|
local cx = _theme.cx
|
|
12
13
|
local useTheme = _theme.useTheme
|
|
@@ -100,7 +101,6 @@ local function Switch(props)
|
|
|
100
101
|
}
|
|
101
102
|
_attributes.Active = active
|
|
102
103
|
_attributes.Selectable = not disabled
|
|
103
|
-
_attributes.BackgroundTransparency = if focused and active then 0.85 else 1
|
|
104
104
|
_attributes.Event = {
|
|
105
105
|
MouseButton1Click = function()
|
|
106
106
|
if active then
|
|
@@ -163,7 +163,7 @@ local function Switch(props)
|
|
|
163
163
|
local _attributes_7 = table.clone(labelStyle)
|
|
164
164
|
setmetatable(_attributes_7, nil)
|
|
165
165
|
_attributes_7.Text = label
|
|
166
|
-
_attributes_7.TextTransparency = if disabled == true then
|
|
166
|
+
_attributes_7.TextTransparency = if disabled == true then controlFade else 0
|
|
167
167
|
_attributes_7.LayoutOrder = 2
|
|
168
168
|
_condition_1 = (React.createElement("textlabel", _attributes_7))
|
|
169
169
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type SwitchPointer = "rest" | "hover" | "press" | "focus";
|
|
2
2
|
export declare function switchPointer(hovering: boolean, pressed: boolean, focused: boolean): SwitchPointer;
|
|
3
|
-
export declare function switchTrackTransparency(on: boolean, disabled: boolean, pointer: SwitchPointer): 0 | 0.
|
|
4
|
-
export declare function switchThumbTransparency(disabled: boolean): 0 | 0.
|
|
5
|
-
export declare function switchStrokeTransparency(disabled: boolean, pointer: SwitchPointer): 1 | 0
|
|
3
|
+
export declare function switchTrackTransparency(on: boolean, disabled: boolean, pointer: SwitchPointer): 0 | 0.5 | 0.25 | 0.35 | 0.15 | 0.08;
|
|
4
|
+
export declare function switchThumbTransparency(disabled: boolean): 0 | 0.5;
|
|
5
|
+
export declare function switchStrokeTransparency(disabled: boolean, pointer: SwitchPointer): 1 | 0;
|
|
6
6
|
export declare function switchThumbPlacement(on: boolean, inset: number): {
|
|
7
7
|
scaleX: number;
|
|
8
8
|
offsetX: number;
|
|
@@ -13,7 +13,7 @@ local function switchPointer(hovering, pressed, focused)
|
|
|
13
13
|
end
|
|
14
14
|
local function switchTrackTransparency(on, disabled, pointer)
|
|
15
15
|
if disabled then
|
|
16
|
-
return
|
|
16
|
+
return 0.5
|
|
17
17
|
end
|
|
18
18
|
if not on then
|
|
19
19
|
if pointer == "press" then
|
|
@@ -33,19 +33,13 @@ local function switchTrackTransparency(on, disabled, pointer)
|
|
|
33
33
|
return 0
|
|
34
34
|
end
|
|
35
35
|
local function switchThumbTransparency(disabled)
|
|
36
|
-
return if disabled then 0.
|
|
36
|
+
return if disabled then 0.5 else 0
|
|
37
37
|
end
|
|
38
38
|
local function switchStrokeTransparency(disabled, pointer)
|
|
39
|
-
if disabled then
|
|
39
|
+
if disabled or pointer ~= "focus" then
|
|
40
40
|
return 1
|
|
41
41
|
end
|
|
42
|
-
|
|
43
|
-
return 0
|
|
44
|
-
end
|
|
45
|
-
if pointer == "hover" then
|
|
46
|
-
return 0.35
|
|
47
|
-
end
|
|
48
|
-
return 1
|
|
42
|
+
return 0
|
|
49
43
|
end
|
|
50
44
|
local function switchThumbPlacement(on, inset)
|
|
51
45
|
return {
|