@rbxts/react-clean-ui 1.0.5
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 +3 -0
- package/out/Components/Decorator/BoxShadow.d.ts +10 -0
- package/out/Components/Decorator/BoxShadow.luau +41 -0
- package/out/Components/Decorator/Corners.d.ts +7 -0
- package/out/Components/Decorator/Corners.luau +15 -0
- package/out/Components/Decorator/Padding.d.ts +3 -0
- package/out/Components/Decorator/Padding.luau +18 -0
- package/out/Components/Decorator/index.d.ts +3 -0
- package/out/Components/Decorator/init.luau +13 -0
- package/out/Components/Input/Button.d.ts +24 -0
- package/out/Components/Input/Button.luau +159 -0
- package/out/Components/Input/Checkbox.d.ts +12 -0
- package/out/Components/Input/Checkbox.luau +79 -0
- package/out/Components/Input/HoverButton.d.ts +16 -0
- package/out/Components/Input/HoverButton.luau +127 -0
- package/out/Components/Input/Input.d.ts +12 -0
- package/out/Components/Input/Input.luau +92 -0
- package/out/Components/Input/Select.d.ts +30 -0
- package/out/Components/Input/Select.luau +288 -0
- package/out/Components/Input/Slider.d.ts +51 -0
- package/out/Components/Input/Slider.luau +415 -0
- package/out/Components/Input/index.d.ts +6 -0
- package/out/Components/Input/init.luau +22 -0
- package/out/Components/Layout/Column.d.ts +13 -0
- package/out/Components/Layout/Column.luau +60 -0
- package/out/Components/Layout/Container.d.ts +6 -0
- package/out/Components/Layout/Container.luau +73 -0
- package/out/Components/Layout/Draggable.d.ts +46 -0
- package/out/Components/Layout/Draggable.luau +315 -0
- package/out/Components/Layout/Droppable.d.ts +10 -0
- package/out/Components/Layout/Droppable.luau +34 -0
- package/out/Components/Layout/Fieldset.d.ts +34 -0
- package/out/Components/Layout/Fieldset.luau +130 -0
- package/out/Components/Layout/FlexItem.d.ts +11 -0
- package/out/Components/Layout/FlexItem.luau +20 -0
- package/out/Components/Layout/Group.d.ts +34 -0
- package/out/Components/Layout/Group.luau +168 -0
- package/out/Components/Layout/HStack.d.ts +12 -0
- package/out/Components/Layout/HStack.luau +21 -0
- package/out/Components/Layout/Row.d.ts +15 -0
- package/out/Components/Layout/Row.luau +87 -0
- package/out/Components/Layout/Scroller.d.ts +7 -0
- package/out/Components/Layout/Scroller.luau +54 -0
- package/out/Components/Layout/Tabs.d.ts +31 -0
- package/out/Components/Layout/Tabs.luau +189 -0
- package/out/Components/Layout/VStack.d.ts +11 -0
- package/out/Components/Layout/VStack.luau +21 -0
- package/out/Components/Layout/index.d.ts +12 -0
- package/out/Components/Layout/init.luau +40 -0
- package/out/Components/Navigation/Menu.d.ts +19 -0
- package/out/Components/Navigation/Menu.luau +91 -0
- package/out/Components/Navigation/index.d.ts +1 -0
- package/out/Components/Navigation/init.luau +7 -0
- package/out/Components/Surface/Box.d.ts +7 -0
- package/out/Components/Surface/Box.luau +50 -0
- package/out/Components/Surface/Card.d.ts +25 -0
- package/out/Components/Surface/Card.luau +138 -0
- package/out/Components/Surface/Icon.d.ts +10 -0
- package/out/Components/Surface/Icon.luau +64 -0
- package/out/Components/Surface/Panel.d.ts +4 -0
- package/out/Components/Surface/Panel.luau +33 -0
- package/out/Components/Surface/index.d.ts +4 -0
- package/out/Components/Surface/init.luau +16 -0
- package/out/Components/Typography/Text.d.ts +18 -0
- package/out/Components/Typography/Text.luau +48 -0
- package/out/Components/Typography/index.d.ts +1 -0
- package/out/Components/Typography/init.luau +7 -0
- package/out/Components/index.d.ts +8 -0
- package/out/Components/init.luau +28 -0
- package/out/Contexts/draggable.context.d.ts +8 -0
- package/out/Contexts/draggable.context.luau +7 -0
- package/out/Contexts/droppable.context.d.ts +6 -0
- package/out/Contexts/droppable.context.luau +7 -0
- package/out/Contexts/index.d.ts +6 -0
- package/out/Contexts/init.luau +22 -0
- package/out/Contexts/navigation.context.d.ts +5 -0
- package/out/Contexts/navigation.context.luau +9 -0
- package/out/Contexts/overlay.context.d.ts +13 -0
- package/out/Contexts/overlay.context.luau +17 -0
- package/out/Contexts/row.context.d.ts +9 -0
- package/out/Contexts/row.context.luau +12 -0
- package/out/Contexts/theme.context.d.ts +3 -0
- package/out/Contexts/theme.context.luau +8 -0
- package/out/Helpers/breakpoint.helper.d.ts +7 -0
- package/out/Helpers/breakpoint.helper.luau +124 -0
- package/out/Helpers/color.helper.d.ts +5 -0
- package/out/Helpers/color.helper.luau +101 -0
- package/out/Helpers/create-ui-story.d.ts +16 -0
- package/out/Helpers/create-ui-story.luau +38 -0
- package/out/Helpers/css.helper.d.ts +12 -0
- package/out/Helpers/css.helper.luau +114 -0
- package/out/Helpers/gui.helper.d.ts +10 -0
- package/out/Helpers/gui.helper.luau +134 -0
- package/out/Helpers/index.d.ts +8 -0
- package/out/Helpers/init.luau +28 -0
- package/out/Helpers/size.helper.d.ts +14 -0
- package/out/Helpers/size.helper.luau +162 -0
- package/out/Helpers/spacing.helper.d.ts +7 -0
- package/out/Helpers/spacing.helper.luau +57 -0
- package/out/Helpers/typography.helper.d.ts +7 -0
- package/out/Helpers/typography.helper.luau +91 -0
- package/out/Interfaces/clean.element.props.d.ts +109 -0
- package/out/Interfaces/clean.element.props.luau +5 -0
- package/out/Interfaces/icon.d.ts +2 -0
- package/out/Interfaces/icon.luau +2 -0
- package/out/Interfaces/index.d.ts +3 -0
- package/out/Interfaces/init.luau +13 -0
- package/out/Interfaces/userinput.d.ts +22 -0
- package/out/Interfaces/userinput.luau +8 -0
- package/out/Providers/index.d.ts +3 -0
- package/out/Providers/init.luau +13 -0
- package/out/Providers/overlay.provider.d.ts +3 -0
- package/out/Providers/overlay.provider.luau +25 -0
- package/out/Providers/registry.provider.d.ts +33 -0
- package/out/Providers/registry.provider.luau +119 -0
- package/out/Providers/theme.provider.d.ts +8 -0
- package/out/Providers/theme.provider.luau +12 -0
- package/out/Theme/CleanTheme.d.ts +169 -0
- package/out/Theme/CleanTheme.luau +2 -0
- package/out/Theme/DefaultIcons.d.ts +2 -0
- package/out/Theme/DefaultIcons.luau +791 -0
- package/out/Theme/index.d.ts +3 -0
- package/out/Theme/init.luau +13 -0
- package/out/Theme/themes/dark.theme.d.ts +2 -0
- package/out/Theme/themes/dark.theme.luau +345 -0
- package/out/Theme/themes/default.theme.d.ts +2 -0
- package/out/Theme/themes/default.theme.luau +403 -0
- package/out/Theme/themes/index.d.ts +3 -0
- package/out/Theme/themes/init.luau +13 -0
- package/out/Theme/themes/sandstone.theme.d.ts +2 -0
- package/out/Theme/themes/sandstone.theme.luau +345 -0
- package/out/index.d.ts +6 -0
- package/out/init.luau +22 -0
- package/package.json +43 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
for _k, _v in TS.import(script, script, "breakpoint.helper") or {} do
|
|
5
|
+
exports[_k] = _v
|
|
6
|
+
end
|
|
7
|
+
for _k, _v in TS.import(script, script, "color.helper") or {} do
|
|
8
|
+
exports[_k] = _v
|
|
9
|
+
end
|
|
10
|
+
for _k, _v in TS.import(script, script, "create-ui-story") or {} do
|
|
11
|
+
exports[_k] = _v
|
|
12
|
+
end
|
|
13
|
+
for _k, _v in TS.import(script, script, "css.helper") or {} do
|
|
14
|
+
exports[_k] = _v
|
|
15
|
+
end
|
|
16
|
+
for _k, _v in TS.import(script, script, "gui.helper") or {} do
|
|
17
|
+
exports[_k] = _v
|
|
18
|
+
end
|
|
19
|
+
for _k, _v in TS.import(script, script, "size.helper") or {} do
|
|
20
|
+
exports[_k] = _v
|
|
21
|
+
end
|
|
22
|
+
for _k, _v in TS.import(script, script, "spacing.helper") or {} do
|
|
23
|
+
exports[_k] = _v
|
|
24
|
+
end
|
|
25
|
+
for _k, _v in TS.import(script, script, "typography.helper") or {} do
|
|
26
|
+
exports[_k] = _v
|
|
27
|
+
end
|
|
28
|
+
return exports
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Binding } from "@rbxts/react";
|
|
2
|
+
import { CssSize, Breakpoint, ResponsiveValue, SizeElementProps, PositionElementProps } from "../Interfaces/clean.element.props";
|
|
3
|
+
export declare class SizeHelper {
|
|
4
|
+
static GetSize(props: SizeElementProps, defaultSize?: UDim2): UDim2 | Binding<UDim2>;
|
|
5
|
+
static GetPosition(props: PositionElementProps): UDim2 | Binding<UDim2>;
|
|
6
|
+
static GetAnchor(props: PositionElementProps): Vector2 | Binding<Vector2>;
|
|
7
|
+
static GetAutoSize(props: SizeElementProps, defaultValue?: Enum.AutomaticSize): Enum.AutomaticSize | "None" | "X" | "Y" | "XY" | Binding<Enum.AutomaticSize>;
|
|
8
|
+
static toUDim(size?: CssSize): UDim;
|
|
9
|
+
private static parseNumber;
|
|
10
|
+
private static fromFarEdge;
|
|
11
|
+
private static isBreakpointSize;
|
|
12
|
+
private static isBreakpointValue;
|
|
13
|
+
static resolveResponsiveValue<T>(value: ResponsiveValue<T> | undefined, breakpoint: Breakpoint): T | undefined;
|
|
14
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local breakpointOrder = { "xs", "sm", "md", "lg", "xl" }
|
|
3
|
+
local SizeHelper
|
|
4
|
+
do
|
|
5
|
+
SizeHelper = setmetatable({}, {
|
|
6
|
+
__tostring = function()
|
|
7
|
+
return "SizeHelper"
|
|
8
|
+
end,
|
|
9
|
+
})
|
|
10
|
+
SizeHelper.__index = SizeHelper
|
|
11
|
+
function SizeHelper.new(...)
|
|
12
|
+
local self = setmetatable({}, SizeHelper)
|
|
13
|
+
return self:constructor(...) or self
|
|
14
|
+
end
|
|
15
|
+
function SizeHelper:constructor()
|
|
16
|
+
end
|
|
17
|
+
function SizeHelper:GetSize(props, defaultSize)
|
|
18
|
+
if props.Size then
|
|
19
|
+
return props.Size
|
|
20
|
+
end
|
|
21
|
+
if props.width == nil and props.height == nil and defaultSize ~= nil then
|
|
22
|
+
return defaultSize
|
|
23
|
+
end
|
|
24
|
+
local width
|
|
25
|
+
if props.width ~= nil then
|
|
26
|
+
if props.width == "Auto" then
|
|
27
|
+
width = 0
|
|
28
|
+
elseif self:isBreakpointSize(props.width) then
|
|
29
|
+
width = self:resolveResponsiveValue(props.width, "sm")
|
|
30
|
+
else
|
|
31
|
+
width = props.width
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
return UDim2.new(self:toUDim(width), self:toUDim(props.height))
|
|
35
|
+
end
|
|
36
|
+
function SizeHelper:GetPosition(props)
|
|
37
|
+
if props.Position ~= nil then
|
|
38
|
+
return props.Position
|
|
39
|
+
end
|
|
40
|
+
if props.center ~= nil then
|
|
41
|
+
local _center = props.center
|
|
42
|
+
local c = if type(_center) == "boolean" then (if props.center then "50%" else nil) else props.center
|
|
43
|
+
local center = self:toUDim(c)
|
|
44
|
+
return UDim2.new(center, center)
|
|
45
|
+
end
|
|
46
|
+
local x = if props.left ~= nil then self:toUDim(props.left) elseif props.right ~= nil then self:fromFarEdge(props.right) else UDim.new(0, 0)
|
|
47
|
+
local y = if props.top ~= nil then self:toUDim(props.top) elseif props.bottom ~= nil then self:fromFarEdge(props.bottom) else UDim.new(0, 0)
|
|
48
|
+
return UDim2.new(x, y)
|
|
49
|
+
end
|
|
50
|
+
function SizeHelper:GetAnchor(props)
|
|
51
|
+
if props.AnchorPoint ~= nil then
|
|
52
|
+
return props.AnchorPoint
|
|
53
|
+
end
|
|
54
|
+
if props.center ~= nil then
|
|
55
|
+
return Vector2.new(0.5, 0.5)
|
|
56
|
+
end
|
|
57
|
+
local x = if props.left == nil and props.right ~= nil then 1 else 0
|
|
58
|
+
local y = if props.top == nil and props.bottom ~= nil then 1 else 0
|
|
59
|
+
return Vector2.new(x, y)
|
|
60
|
+
end
|
|
61
|
+
function SizeHelper:GetAutoSize(props, defaultValue)
|
|
62
|
+
if props.AutomaticSize ~= nil then
|
|
63
|
+
return props.AutomaticSize
|
|
64
|
+
end
|
|
65
|
+
if props.width == "Auto" then
|
|
66
|
+
return Enum.AutomaticSize.X
|
|
67
|
+
end
|
|
68
|
+
local _condition = props.Size
|
|
69
|
+
if not _condition then
|
|
70
|
+
local _condition_1 = props.width
|
|
71
|
+
if _condition_1 ~= 0 and _condition_1 == _condition_1 and _condition_1 ~= "" and _condition_1 then
|
|
72
|
+
_condition_1 = props.height
|
|
73
|
+
end
|
|
74
|
+
_condition = _condition_1
|
|
75
|
+
end
|
|
76
|
+
if _condition ~= 0 and _condition == _condition and _condition ~= "" and _condition then
|
|
77
|
+
return Enum.AutomaticSize.None
|
|
78
|
+
end
|
|
79
|
+
if props.width == nil and props.height == nil and defaultValue == nil then
|
|
80
|
+
return Enum.AutomaticSize.XY
|
|
81
|
+
end
|
|
82
|
+
local _value = props.width
|
|
83
|
+
if not (_value ~= 0 and _value == _value and _value ~= "" and _value) then
|
|
84
|
+
return Enum.AutomaticSize.X
|
|
85
|
+
end
|
|
86
|
+
return if defaultValue ~= nil then defaultValue else Enum.AutomaticSize.Y
|
|
87
|
+
end
|
|
88
|
+
function SizeHelper:toUDim(size)
|
|
89
|
+
if size == nil then
|
|
90
|
+
return UDim.new(0, 0)
|
|
91
|
+
end
|
|
92
|
+
local _size = size
|
|
93
|
+
if type(_size) == "number" then
|
|
94
|
+
return UDim.new(0, size)
|
|
95
|
+
end
|
|
96
|
+
local text = (string.gsub(string.lower(size), "%s+", ""))
|
|
97
|
+
if string.sub(text, -1) == "%" then
|
|
98
|
+
local value = self:parseNumber(string.sub(text, 1, -2), size)
|
|
99
|
+
return UDim.new(value / 100, 0)
|
|
100
|
+
end
|
|
101
|
+
if string.sub(text, -2) == "px" then
|
|
102
|
+
local value = self:parseNumber(string.sub(text, 1, -3), size)
|
|
103
|
+
return UDim.new(0, value)
|
|
104
|
+
end
|
|
105
|
+
local value = self:parseNumber(text, size)
|
|
106
|
+
return UDim.new(0, value)
|
|
107
|
+
end
|
|
108
|
+
function SizeHelper:parseNumber(text, originalValue)
|
|
109
|
+
local value = tonumber(text)
|
|
110
|
+
local _arg0 = value ~= nil
|
|
111
|
+
local _arg1 = `Invalid size value "{originalValue}". Expected a number, "25px", or "25%".`
|
|
112
|
+
assert(_arg0, _arg1)
|
|
113
|
+
return value
|
|
114
|
+
end
|
|
115
|
+
function SizeHelper:fromFarEdge(size)
|
|
116
|
+
local value = self:toUDim(size)
|
|
117
|
+
return UDim.new(1 - value.Scale, -value.Offset)
|
|
118
|
+
end
|
|
119
|
+
function SizeHelper:isBreakpointSize(value)
|
|
120
|
+
local _value = value
|
|
121
|
+
return type(_value) == "table"
|
|
122
|
+
end
|
|
123
|
+
function SizeHelper:isBreakpointValue(value)
|
|
124
|
+
local _value = value
|
|
125
|
+
if not (type(_value) == "table") then
|
|
126
|
+
return false
|
|
127
|
+
end
|
|
128
|
+
return value.xs ~= nil or value.sm ~= nil or value.md ~= nil or value.lg ~= nil or value.xl ~= nil
|
|
129
|
+
end
|
|
130
|
+
function SizeHelper:resolveResponsiveValue(value, breakpoint)
|
|
131
|
+
if value == nil then
|
|
132
|
+
return nil
|
|
133
|
+
end
|
|
134
|
+
if not self:isBreakpointValue(value) then
|
|
135
|
+
return value
|
|
136
|
+
end
|
|
137
|
+
local _breakpoint = breakpoint
|
|
138
|
+
local breakpointIndex = (table.find(breakpointOrder, _breakpoint) or 0) - 1
|
|
139
|
+
do
|
|
140
|
+
local index = breakpointIndex
|
|
141
|
+
local _shouldIncrement = false
|
|
142
|
+
while true do
|
|
143
|
+
if _shouldIncrement then
|
|
144
|
+
index -= 1
|
|
145
|
+
else
|
|
146
|
+
_shouldIncrement = true
|
|
147
|
+
end
|
|
148
|
+
if not (index >= 0) then
|
|
149
|
+
break
|
|
150
|
+
end
|
|
151
|
+
local candidate = value[breakpointOrder[index + 1]]
|
|
152
|
+
if candidate ~= nil then
|
|
153
|
+
return candidate
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
return nil
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
return {
|
|
161
|
+
SizeHelper = SizeHelper,
|
|
162
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PaddingProps, ResolvedPadding, ScaleSize, ScaleSizeValue } from "../Interfaces";
|
|
2
|
+
import { CleanTheme } from "../Theme";
|
|
3
|
+
export declare class SpacingHelper {
|
|
4
|
+
static GetResolvedPadding(theme: CleanTheme, props: PaddingProps, component?: ScaleSizeValue<number>): ResolvedPadding;
|
|
5
|
+
static GetPadding(theme: CleanTheme, spacing?: ScaleSize | "None", component?: ScaleSizeValue<number>): number;
|
|
6
|
+
static ResolveNumberPadding(value: number): ResolvedPadding;
|
|
7
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local SpacingHelper
|
|
3
|
+
do
|
|
4
|
+
SpacingHelper = setmetatable({}, {
|
|
5
|
+
__tostring = function()
|
|
6
|
+
return "SpacingHelper"
|
|
7
|
+
end,
|
|
8
|
+
})
|
|
9
|
+
SpacingHelper.__index = SpacingHelper
|
|
10
|
+
function SpacingHelper.new(...)
|
|
11
|
+
local self = setmetatable({}, SpacingHelper)
|
|
12
|
+
return self:constructor(...) or self
|
|
13
|
+
end
|
|
14
|
+
function SpacingHelper:constructor()
|
|
15
|
+
end
|
|
16
|
+
function SpacingHelper:GetResolvedPadding(theme, props, component)
|
|
17
|
+
local amount = self:GetPadding(theme, props.spacing, component)
|
|
18
|
+
return {
|
|
19
|
+
top = if props.top then self:GetPadding(theme, props.top) else amount,
|
|
20
|
+
bottom = if props.bottom then self:GetPadding(theme, props.bottom) else amount,
|
|
21
|
+
left = if props.left then self:GetPadding(theme, props.left) else amount,
|
|
22
|
+
right = if props.right then self:GetPadding(theme, props.right) else amount,
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
function SpacingHelper:GetPadding(theme, spacing, component)
|
|
26
|
+
if spacing == "None" then
|
|
27
|
+
return 0
|
|
28
|
+
end
|
|
29
|
+
local resolveSpacing = if spacing ~= nil then spacing else theme.default.spacing
|
|
30
|
+
local _result
|
|
31
|
+
if component ~= nil then
|
|
32
|
+
local _condition = component[resolveSpacing]
|
|
33
|
+
if _condition == nil then
|
|
34
|
+
_condition = 0
|
|
35
|
+
end
|
|
36
|
+
_result = _condition
|
|
37
|
+
else
|
|
38
|
+
local _condition = theme.spacing[resolveSpacing]
|
|
39
|
+
if _condition == nil then
|
|
40
|
+
_condition = 0
|
|
41
|
+
end
|
|
42
|
+
_result = _condition
|
|
43
|
+
end
|
|
44
|
+
return _result
|
|
45
|
+
end
|
|
46
|
+
function SpacingHelper:ResolveNumberPadding(value)
|
|
47
|
+
return {
|
|
48
|
+
top = value,
|
|
49
|
+
bottom = value,
|
|
50
|
+
left = value,
|
|
51
|
+
right = value,
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
return {
|
|
56
|
+
SpacingHelper = SpacingHelper,
|
|
57
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ScaleSize } from "../Interfaces";
|
|
2
|
+
import { TypographyStyle, ScaledTypographyStyle, CleanTheme } from "../Theme";
|
|
3
|
+
export declare class TypographyHelper {
|
|
4
|
+
static getTypography(theme: CleanTheme, scale?: ScaleSize, component?: Partial<TypographyStyle> | ScaledTypographyStyle): TypographyStyle;
|
|
5
|
+
private static getClosestTypography;
|
|
6
|
+
private static isScaledTypographyStyle;
|
|
7
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local ScaleSizes = TS.import(script, script.Parent.Parent, "Interfaces").ScaleSizes
|
|
4
|
+
local TypographyHelper
|
|
5
|
+
do
|
|
6
|
+
TypographyHelper = setmetatable({}, {
|
|
7
|
+
__tostring = function()
|
|
8
|
+
return "TypographyHelper"
|
|
9
|
+
end,
|
|
10
|
+
})
|
|
11
|
+
TypographyHelper.__index = TypographyHelper
|
|
12
|
+
function TypographyHelper.new(...)
|
|
13
|
+
local self = setmetatable({}, TypographyHelper)
|
|
14
|
+
return self:constructor(...) or self
|
|
15
|
+
end
|
|
16
|
+
function TypographyHelper:constructor()
|
|
17
|
+
end
|
|
18
|
+
function TypographyHelper:getTypography(theme, scale, component)
|
|
19
|
+
local resolvedScale = scale or theme.default.scale
|
|
20
|
+
local _object = table.clone(theme.typography[theme.typeScaleMap[resolvedScale]])
|
|
21
|
+
setmetatable(_object, nil)
|
|
22
|
+
local typography = _object
|
|
23
|
+
if component == nil then
|
|
24
|
+
return typography
|
|
25
|
+
end
|
|
26
|
+
local componentTypography = if self:isScaledTypographyStyle(component) then self:getClosestTypography(component, resolvedScale) else component
|
|
27
|
+
if componentTypography ~= nil then
|
|
28
|
+
local _object_1 = table.clone(typography)
|
|
29
|
+
setmetatable(_object_1, nil)
|
|
30
|
+
for _k, _v in componentTypography do
|
|
31
|
+
_object_1[_k] = _v
|
|
32
|
+
end
|
|
33
|
+
typography = _object_1
|
|
34
|
+
end
|
|
35
|
+
return typography
|
|
36
|
+
end
|
|
37
|
+
function TypographyHelper:getClosestTypography(typography, scale)
|
|
38
|
+
local _scale = scale
|
|
39
|
+
local scaleIndex = (table.find(ScaleSizes, _scale) or 0) - 1
|
|
40
|
+
-- Prefer the exact scale, then progressively smaller scales.
|
|
41
|
+
do
|
|
42
|
+
local index = scaleIndex
|
|
43
|
+
local _shouldIncrement = false
|
|
44
|
+
while true do
|
|
45
|
+
if _shouldIncrement then
|
|
46
|
+
index -= 1
|
|
47
|
+
else
|
|
48
|
+
_shouldIncrement = true
|
|
49
|
+
end
|
|
50
|
+
if not (index >= 0) then
|
|
51
|
+
break
|
|
52
|
+
end
|
|
53
|
+
local value = typography[ScaleSizes[index + 1]]
|
|
54
|
+
if value ~= nil then
|
|
55
|
+
return value
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
-- If no smaller scale exists, use the nearest larger scale.
|
|
60
|
+
do
|
|
61
|
+
local index = scaleIndex + 1
|
|
62
|
+
local _shouldIncrement = false
|
|
63
|
+
while true do
|
|
64
|
+
if _shouldIncrement then
|
|
65
|
+
index += 1
|
|
66
|
+
else
|
|
67
|
+
_shouldIncrement = true
|
|
68
|
+
end
|
|
69
|
+
if not (index < #ScaleSizes) then
|
|
70
|
+
break
|
|
71
|
+
end
|
|
72
|
+
local value = typography[ScaleSizes[index + 1]]
|
|
73
|
+
if value ~= nil then
|
|
74
|
+
return value
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
return nil
|
|
79
|
+
end
|
|
80
|
+
function TypographyHelper:isScaledTypographyStyle(value)
|
|
81
|
+
for _, key in ScaleSizes do
|
|
82
|
+
if value[key] ~= nil then
|
|
83
|
+
return true
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
return false
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
return {
|
|
90
|
+
TypographyHelper = TypographyHelper,
|
|
91
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Binding } from "@rbxts/react";
|
|
2
|
+
import { IconName } from "./icon";
|
|
3
|
+
export type ButtonFlag = "default" | "hover" | "focus";
|
|
4
|
+
export type CssUnit = "px" | "%";
|
|
5
|
+
export type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl";
|
|
6
|
+
export declare const ScaleSizes: readonly ["xs", "sm", "md", "lg", "xl"];
|
|
7
|
+
export type ScaleSize = typeof ScaleSizes[number];
|
|
8
|
+
export type TextVariant = "display" | "title" | "heading" | "body" | "label" | "caption";
|
|
9
|
+
export type Intent = "primary" | "success" | "warning" | "danger" | "info";
|
|
10
|
+
export type GridSpan = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
11
|
+
export interface ResponsiveGridSpan {
|
|
12
|
+
xs?: GridSpan;
|
|
13
|
+
sm?: GridSpan;
|
|
14
|
+
md?: GridSpan;
|
|
15
|
+
lg?: GridSpan;
|
|
16
|
+
xl?: GridSpan;
|
|
17
|
+
}
|
|
18
|
+
export type ResponsiveValue<T> = T | Partial<Record<Breakpoint, T>>;
|
|
19
|
+
export interface BreakpointValue<T> {
|
|
20
|
+
xs?: T;
|
|
21
|
+
sm?: T;
|
|
22
|
+
md?: T;
|
|
23
|
+
lg?: T;
|
|
24
|
+
xl?: T;
|
|
25
|
+
}
|
|
26
|
+
export interface ScaleSizeValue<T> {
|
|
27
|
+
xs?: T;
|
|
28
|
+
sm?: T;
|
|
29
|
+
md?: T;
|
|
30
|
+
lg?: T;
|
|
31
|
+
xl?: T;
|
|
32
|
+
}
|
|
33
|
+
export type CssSize = "Auto" | number | `${number}` | `${number}${CssUnit}`;
|
|
34
|
+
export type CssBreakpoint = {
|
|
35
|
+
xs: number;
|
|
36
|
+
sm: number;
|
|
37
|
+
md: number;
|
|
38
|
+
lg: number;
|
|
39
|
+
xl: number;
|
|
40
|
+
};
|
|
41
|
+
export type CssBreakpointSize = {
|
|
42
|
+
xs?: CssSize;
|
|
43
|
+
sm?: CssSize;
|
|
44
|
+
md?: CssSize;
|
|
45
|
+
lg?: CssSize;
|
|
46
|
+
xl?: CssSize;
|
|
47
|
+
};
|
|
48
|
+
export type CssQuad = CssSize | `${CssSize} ${CssSize}` | `${CssSize} ${CssSize} ${CssSize}` | `${CssSize} ${CssSize} ${CssSize} ${CssSize}`;
|
|
49
|
+
export type CssShadow = CssQuad;
|
|
50
|
+
export type CssPadding = CssQuad;
|
|
51
|
+
export type ResponsiveCssSize = CssSize | CssBreakpointSize;
|
|
52
|
+
export interface ZIndexElementProps {
|
|
53
|
+
ZIndex?: number | Binding<number> | undefined;
|
|
54
|
+
}
|
|
55
|
+
export interface BackgroundElementProps {
|
|
56
|
+
BackgroundTransparency?: number | Binding<number> | undefined;
|
|
57
|
+
BackgroundColor3?: Color3 | Binding<Color3> | undefined;
|
|
58
|
+
}
|
|
59
|
+
export interface SizeElementProps {
|
|
60
|
+
Size?: UDim2 | Binding<UDim2>;
|
|
61
|
+
width?: ResponsiveCssSize;
|
|
62
|
+
height?: CssSize;
|
|
63
|
+
AutomaticSize?: Enum.AutomaticSize | Binding<Enum.AutomaticSize> | "None" | "X" | "Y" | "XY" | undefined;
|
|
64
|
+
}
|
|
65
|
+
export interface ScalableElementProps {
|
|
66
|
+
scale?: ScaleSize;
|
|
67
|
+
}
|
|
68
|
+
export interface PositionElementProps {
|
|
69
|
+
Position?: UDim2 | Binding<UDim2>;
|
|
70
|
+
AnchorPoint?: Vector2 | Binding<Vector2> | undefined;
|
|
71
|
+
center?: CssSize | boolean;
|
|
72
|
+
top?: CssSize;
|
|
73
|
+
left?: CssSize;
|
|
74
|
+
right?: CssSize;
|
|
75
|
+
bottom?: CssSize;
|
|
76
|
+
}
|
|
77
|
+
export interface IntentElementProps {
|
|
78
|
+
intent?: Intent;
|
|
79
|
+
}
|
|
80
|
+
export interface CleanElementProps extends SizeElementProps, PositionElementProps {
|
|
81
|
+
}
|
|
82
|
+
export interface SpacedElementProps {
|
|
83
|
+
spacing?: ScaleSize | "None";
|
|
84
|
+
}
|
|
85
|
+
export interface BreakPointElementProps {
|
|
86
|
+
breakpoints?: BreakpointValue<number>;
|
|
87
|
+
}
|
|
88
|
+
export interface ShadowElementProps {
|
|
89
|
+
"box-shadow"?: CssShadow;
|
|
90
|
+
"box-shadow-color"?: Color3;
|
|
91
|
+
"box-shadow-transparency"?: number;
|
|
92
|
+
}
|
|
93
|
+
export interface IconElementProps {
|
|
94
|
+
icon?: IconName;
|
|
95
|
+
}
|
|
96
|
+
export interface PaddingProps extends SpacedElementProps {
|
|
97
|
+
right?: ScaleSize | "None";
|
|
98
|
+
left?: ScaleSize | "None";
|
|
99
|
+
top?: ScaleSize | "None";
|
|
100
|
+
bottom?: ScaleSize | "None";
|
|
101
|
+
padding?: CssPadding;
|
|
102
|
+
resolvedPadding?: ResolvedPadding;
|
|
103
|
+
}
|
|
104
|
+
export interface ResolvedPadding {
|
|
105
|
+
top: number;
|
|
106
|
+
bottom: number;
|
|
107
|
+
left: number;
|
|
108
|
+
right: number;
|
|
109
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export type IconName = "500px" | "address-book-o" | "address-book" | "address-card-o" | "address-card" | "adjust" | "adn" | "align-center" | "align-justify" | "align-left" | "align-right" | "amazon" | "ambulance" | "american-sign-language-interpreting" | "anchor" | "android" | "angellist" | "angle-double-down" | "angle-double-left" | "angle-double-right" | "angle-double-up" | "angle-down" | "angle-left" | "angle-right" | "angle-up" | "apple" | "archive" | "area-chart" | "arrow-circle-down" | "arrow-circle-left" | "arrow-circle-o-down" | "arrow-circle-o-left" | "arrow-circle-o-right" | "arrow-circle-o-up" | "arrow-circle-right" | "arrow-circle-up" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "arrows-alt" | "arrows-h" | "arrows-v" | "arrows" | "asl-interpreting" | "assistive-listening-systems" | "asterisk" | "at" | "audio-description" | "automobile" | "backward" | "balance-scale" | "ban" | "bandcamp" | "bank" | "bar-chart-o" | "bar-chart" | "barcode" | "bars" | "bath" | "bathtub" | "battery-0" | "battery-1" | "battery-2" | "battery-3" | "battery-4" | "battery-empty" | "battery-full" | "battery-half" | "battery-quarter" | "battery-three-quarters" | "battery" | "bed" | "beer" | "bell-o" | "bell-slash-o" | "bell-slash" | "bell" | "bicycle" | "binoculars" | "birthday-cake" | "bitbucket-square" | "bitbucket" | "bitcoin" | "black-tie" | "blind" | "bluetooth-b" | "bluetooth" | "bold" | "bolt" | "bomb" | "book" | "bookmark-o" | "bookmark" | "braille" | "briefcase" | "btc" | "bug" | "building-o" | "building" | "bullhorn" | "bullseye" | "bus" | "buysellads" | "cab" | "calculator" | "calendar-check-o" | "calendar-minus-o" | "calendar-o" | "calendar-plus-o" | "calendar-times-o" | "calendar" | "camera-retro" | "camera" | "car" | "caret-down" | "caret-left" | "caret-right" | "caret-square-o-down" | "caret-square-o-left" | "caret-square-o-right" | "caret-square-o-up" | "caret-up" | "cart-arrow-down" | "cart-plus" | "cc-amex" | "cc-diners-club" | "cc-discover" | "cc-jcb" | "cc-mastercard" | "cc-paypal" | "cc-stripe" | "cc-visa" | "cc" | "certificate" | "chain-broken" | "chain" | "check-circle-o" | "check-circle" | "check-square-o" | "check-square" | "check" | "chevron-circle-down" | "chevron-circle-left" | "chevron-circle-right" | "chevron-circle-up" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "child" | "chrome" | "circle-o-notch" | "circle-o" | "circle-thin" | "circle" | "clipboard" | "clock-o" | "clone" | "close" | "cloud-download" | "cloud-upload" | "cloud" | "cny" | "code-fork" | "code" | "codepen" | "codiepie" | "coffee" | "cog" | "cogs" | "columns" | "comment-o" | "comment" | "commenting-o" | "commenting" | "comments-o" | "comments" | "compass" | "compress" | "connectdevelop" | "contao" | "copy" | "copyright" | "creative-commons" | "credit-card-alt" | "credit-card" | "crop" | "crosshairs" | "css3" | "cube" | "cubes" | "cut" | "cutlery" | "dashboard" | "dashcube" | "database" | "deaf" | "deafness" | "dedent" | "delicious" | "desktop" | "deviantart" | "diamond" | "digg" | "dollar" | "dot-circle-o" | "download" | "dribbble" | "drivers-license-o" | "drivers-license" | "dropbox" | "drupal" | "edge" | "edit" | "eercast" | "eject" | "ellipsis-h" | "ellipsis-v" | "empire" | "envelope-o" | "envelope-open-o" | "envelope-open" | "envelope-square" | "envelope" | "envira" | "eraser" | "etsy" | "eur" | "euro" | "exchange" | "exclamation-circle" | "exclamation-triangle" | "exclamation" | "expand" | "expeditedssl" | "external-link-square" | "external-link" | "eye-slash" | "eye" | "eyedropper" | "fa" | "facebook-f" | "facebook-official" | "facebook-square" | "facebook" | "fast-backward" | "fast-forward" | "fax" | "feed" | "female" | "fighter-jet" | "file-archive-o" | "file-audio-o" | "file-code-o" | "file-excel-o" | "file-image-o" | "file-movie-o" | "file-o" | "file-pdf-o" | "file-photo-o" | "file-picture-o" | "file-powerpoint-o" | "file-sound-o" | "file-text-o" | "file-text" | "file-video-o" | "file-word-o" | "file-zip-o" | "file" | "files-o" | "film" | "filter" | "fire-extinguisher" | "fire" | "firefox" | "first-order" | "flag-checkered" | "flag-o" | "flag" | "flash" | "flask" | "flickr" | "floppy" | "floppy-o" | "folder-o" | "folder-open-o" | "folder-open" | "folder" | "font-awesome" | "font" | "fonticons" | "fort-awesome" | "forumbee" | "forward" | "foursquare" | "free-code-camp" | "frown-o" | "futbol-o" | "gamepad" | "gavel" | "gbp" | "ge" | "gear" | "gears" | "genderless" | "get-pocket" | "gg-circle" | "gg" | "gift" | "git-square" | "git" | "github-alt" | "github-square" | "github" | "gitlab" | "gittip" | "glass" | "glide-g" | "glide" | "globe" | "google-plus-circle" | "google-plus-official" | "google-plus-square" | "google-plus" | "google-wallet" | "google" | "graduation-cap" | "gratipay" | "grav" | "group" | "h-square" | "hacker-news" | "hand-grab-o" | "hand-lizard-o" | "hand-o-down" | "hand-o-left" | "hand-o-right" | "hand-o-up" | "hand-paper-o" | "hand-peace-o" | "hand-pointer-o" | "hand-rock-o" | "hand-scissors-o" | "hand-spock-o" | "hand-stop-o" | "handshake-o" | "hard-of-hearing" | "hashtag" | "hdd-o" | "header" | "headphones" | "heart-o" | "heart" | "heartbeat" | "history" | "home" | "hospital-o" | "hotel" | "hourglass-1" | "hourglass-2" | "hourglass-3" | "hourglass-end" | "hourglass-half" | "hourglass-o" | "hourglass-start" | "hourglass" | "houzz" | "html5" | "i-cursor" | "id-badge" | "id-card-o" | "id-card" | "ils" | "image" | "imdb" | "inbox" | "indent" | "industry" | "info-circle" | "info" | "inr" | "instagram" | "institution" | "internet-explorer" | "intersex" | "ioxhost" | "italic" | "joomla" | "jpy" | "jsfiddle" | "key" | "keyboard-o" | "krw" | "language" | "laptop" | "lastfm-square" | "lastfm" | "leaf" | "leanpub" | "legal" | "lemon-o" | "level-down" | "level-up" | "life-bouy" | "life-buoy" | "life-ring" | "life-saver" | "lightbulb-o" | "line-chart" | "link" | "linkedin-square" | "linkedin" | "linode" | "linux" | "list-alt" | "list-ol" | "list-ul" | "list" | "location-arrow" | "lock" | "long-arrow-down" | "long-arrow-left" | "long-arrow-right" | "long-arrow-up" | "low-vision" | "magic" | "magnet" | "mail-forward" | "mail-reply-all" | "mail-reply" | "male" | "map-marker" | "map-o" | "map-pin" | "map-signs" | "map" | "mars-double" | "mars-stroke-h" | "mars-stroke-v" | "mars-stroke" | "mars" | "maxcdn" | "meanpath" | "medium" | "medkit" | "meetup" | "meh-o" | "mercury" | "microchip" | "microphone-slash" | "microphone" | "minus-circle" | "minus-square-o" | "minus-square" | "minus" | "mixcloud" | "mobile-phone" | "mobile" | "modx" | "money" | "moon-o" | "mortar-board" | "motorcycle" | "mouse-pointer" | "music" | "navicon" | "neuter" | "newspaper-o" | "object-group" | "object-ungroup" | "odnoklassniki-square" | "odnoklassniki" | "opencart" | "openid" | "opera" | "optin-monster" | "outdent" | "pagelines" | "paint-brush" | "paper-plane-o" | "paper-plane" | "paperclip" | "paragraph" | "paste" | "pause-circle-o" | "pause-circle" | "pause" | "paw" | "paypal" | "pencil-square-o" | "pencil-square" | "pencil" | "percent" | "phone-square" | "phone" | "photo" | "picture-o" | "pie-chart" | "pied-piper-alt" | "pied-piper-pp" | "pied-piper" | "pinterest-p" | "pinterest-square" | "pinterest" | "plane" | "play-circle-o" | "play-circle" | "play" | "plug" | "plus-circle" | "plus-square-o" | "plus-square" | "plus" | "podcast" | "power-off" | "print" | "product-hunt" | "puzzle-piece" | "qq" | "qrcode" | "question-circle-o" | "question-circle" | "question" | "quora" | "quote-left" | "quote-right" | "ra" | "random" | "ravelry" | "rebel" | "recycle" | "reddit-alien" | "reddit-square" | "reddit" | "refresh" | "registered" | "remove" | "renren" | "reorder" | "repeat" | "reply-all" | "reply" | "resistance" | "retweet" | "rmb" | "road" | "rocket" | "rotate-left" | "rotate-right" | "rouble" | "rss-square" | "rss" | "rub" | "ruble" | "rupee" | "s15" | "safari" | "save" | "scissors" | "scribd" | "search-minus" | "search-plus" | "search" | "sellsy" | "send-o" | "send" | "server" | "share-alt-square" | "share-alt" | "share-square-o" | "share-square" | "share" | "shekel" | "sheqel" | "shield" | "ship" | "shirtsinbulk" | "shopping-bag" | "shopping-basket" | "shopping-cart" | "shower" | "sign-in" | "sign-language" | "sign-out" | "signal" | "signing" | "simplybuilt" | "sitemap" | "skyatlas" | "skype" | "slack" | "sliders" | "slideshare" | "smile-o" | "snapchat-ghost" | "snapchat-square" | "snapchat" | "snowflake-o" | "soccer-ball-o" | "sort-alpha-asc" | "sort-alpha-desc" | "sort-amount-asc" | "sort-amount-desc" | "sort-asc" | "sort-desc" | "sort-down" | "sort-numeric-asc" | "sort-numeric-desc" | "sort-up" | "sort" | "soundcloud" | "space-shuttle" | "spinner" | "spoon" | "spotify" | "square-o" | "square" | "stack-exchange" | "stack-overflow" | "star-half-empty" | "star-half-full" | "star-half-o" | "star-half" | "star-o" | "star" | "steam-square" | "steam" | "step-backward" | "step-forward" | "stethoscope" | "sticky-note-o" | "sticky-note" | "stop-circle-o" | "stop-circle" | "stop" | "street-view" | "strikethrough" | "stumbleupon-circle" | "stumbleupon" | "subscript" | "subway" | "suitcase" | "sun-o" | "superpowers" | "superscript" | "support" | "table" | "tablet" | "tachometer" | "tag" | "tags" | "tasks" | "taxi" | "telegram" | "television" | "tencent-weibo" | "terminal" | "text-height" | "text-width" | "th-large" | "th-list" | "th" | "themeisle" | "thermometer-0" | "thermometer-1" | "thermometer-2" | "thermometer-3" | "thermometer-4" | "thermometer-empty" | "thermometer-full" | "thermometer-half" | "thermometer-quarter" | "thermometer-three-quarters" | "thermometer" | "thumb-tack" | "thumbs-down" | "thumbs-o-down" | "thumbs-o-up" | "thumbs-up" | "ticket" | "times-circle-o" | "times-circle" | "times-rectangle-o" | "times-rectangle" | "times" | "tint" | "toggle-down" | "toggle-left" | "toggle-off" | "toggle-on" | "toggle-right" | "toggle-up" | "trademark" | "train" | "transgender-alt" | "transgender" | "trash-o" | "trash" | "tree" | "trello" | "tripadvisor" | "trophy" | "truck" | "try" | "tty" | "tumblr-square" | "tumblr" | "turkish-lira" | "tv" | "twitch" | "twitter-square" | "twitter" | "umbrella" | "underline" | "undo" | "universal-access" | "university" | "unlink" | "unlock-alt" | "unlock" | "unsorted" | "upload" | "usb" | "usd" | "user-circle-o" | "user-circle" | "user-md" | "user-o" | "user-plus" | "user-secret" | "user-times" | "user" | "users" | "vcard-o" | "vcard" | "venus-double" | "venus-mars" | "venus" | "viacoin" | "viadeo-square" | "viadeo" | "video-camera" | "vimeo-square" | "vimeo" | "vine" | "vk" | "volume-control-phone" | "volume-down" | "volume-off" | "volume-up" | "warning" | "wechat" | "weibo" | "weixin" | "whatsapp" | "wheelchair-alt" | "wheelchair" | "wifi" | "wikipedia-w" | "window-close-o" | "window-close" | "window-maximize" | "window-minimize" | "window-restore" | "windows" | "won" | "wordpress" | "wpbeginner" | "wpexplorer" | "wpforms" | "wrench" | "xing-square" | "xing" | "y-combinator-square" | "y-combinator" | "yahoo" | "yc-square" | "yc" | "yelp" | "yen" | "yoast" | "youtube-play" | "youtube-square" | "youtube";
|
|
2
|
+
export type IconSet = Record<IconName, number>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
for _k, _v in TS.import(script, script, "clean.element.props") or {} do
|
|
5
|
+
exports[_k] = _v
|
|
6
|
+
end
|
|
7
|
+
for _k, _v in TS.import(script, script, "icon") or {} do
|
|
8
|
+
exports[_k] = _v
|
|
9
|
+
end
|
|
10
|
+
for _k, _v in TS.import(script, script, "userinput") or {} do
|
|
11
|
+
exports[_k] = _v
|
|
12
|
+
end
|
|
13
|
+
return exports
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface DisconnectableSignal {
|
|
2
|
+
Disconnect(): void;
|
|
3
|
+
}
|
|
4
|
+
export interface ConnectableSignal<TArgs extends unknown[]> {
|
|
5
|
+
Connect(callback: (...args: TArgs) => void): DisconnectableSignal;
|
|
6
|
+
}
|
|
7
|
+
interface InputSignalsLike {
|
|
8
|
+
InputBegan: ConnectableSignal<[
|
|
9
|
+
input: InputObject,
|
|
10
|
+
gameProcessed: boolean
|
|
11
|
+
]>;
|
|
12
|
+
InputChanged: ConnectableSignal<[
|
|
13
|
+
input: InputObject,
|
|
14
|
+
gameProcessed: boolean
|
|
15
|
+
]>;
|
|
16
|
+
InputEnded: ConnectableSignal<[
|
|
17
|
+
input: InputObject,
|
|
18
|
+
gameProcessed: boolean
|
|
19
|
+
]>;
|
|
20
|
+
}
|
|
21
|
+
export declare const CustomInputService: InputSignalsLike;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local UserInputService = TS.import(script, TS.getModule(script, "@rbxts", "services")).UserInputService
|
|
4
|
+
local Environment = TS.import(script, TS.getModule(script, "@rbxts", "ui-labs").src).Environment
|
|
5
|
+
local CustomInputService = if Environment.IsStory() then Environment.InputListener else UserInputService
|
|
6
|
+
return {
|
|
7
|
+
CustomInputService = CustomInputService,
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
for _k, _v in TS.import(script, script, "overlay.provider") or {} do
|
|
5
|
+
exports[_k] = _v
|
|
6
|
+
end
|
|
7
|
+
for _k, _v in TS.import(script, script, "registry.provider") or {} do
|
|
8
|
+
exports[_k] = _v
|
|
9
|
+
end
|
|
10
|
+
for _k, _v in TS.import(script, script, "theme.provider") or {} do
|
|
11
|
+
exports[_k] = _v
|
|
12
|
+
end
|
|
13
|
+
return exports
|
|
@@ -0,0 +1,25 @@
|
|
|
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 React = _react
|
|
5
|
+
local useState = _react.useState
|
|
6
|
+
local OverlayContext = TS.import(script, script.Parent.Parent, "Contexts").OverlayContext
|
|
7
|
+
local function OverlayProvider(props)
|
|
8
|
+
local overlay, setOverlay = useState()
|
|
9
|
+
return React.createElement(OverlayContext.Provider, {
|
|
10
|
+
value = {
|
|
11
|
+
overlay = overlay,
|
|
12
|
+
},
|
|
13
|
+
}, props.children, React.createElement("frame", {
|
|
14
|
+
ref = function(instance)
|
|
15
|
+
setOverlay(instance)
|
|
16
|
+
end,
|
|
17
|
+
Size = UDim2.fromScale(1, 1),
|
|
18
|
+
BackgroundTransparency = 1,
|
|
19
|
+
ZIndex = 100000,
|
|
20
|
+
Active = false,
|
|
21
|
+
}))
|
|
22
|
+
end
|
|
23
|
+
return {
|
|
24
|
+
OverlayProvider = OverlayProvider,
|
|
25
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
2
|
+
import { DraggableContextValue } from "../Contexts";
|
|
3
|
+
export interface RegistryKey<T extends defined> {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DroppableRegistration {
|
|
7
|
+
guiObject: GuiObject;
|
|
8
|
+
id?: string;
|
|
9
|
+
drop: (draggedObject: GuiObject) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const DroppableRegistryKey: RegistryKey<DroppableRegistration>;
|
|
12
|
+
export interface DraggableRegistration {
|
|
13
|
+
guiObject: GuiObject;
|
|
14
|
+
id?: string;
|
|
15
|
+
draggable: DraggableContextValue;
|
|
16
|
+
}
|
|
17
|
+
export declare const DraggableRegistryKey: RegistryKey<DraggableRegistration>;
|
|
18
|
+
export interface RegistryContextValue {
|
|
19
|
+
register: <T extends defined>(guiObject: GuiObject, key: RegistryKey<T>, value: T) => void;
|
|
20
|
+
unregister: <T extends defined>(guiObject: GuiObject, key: RegistryKey<T>) => void;
|
|
21
|
+
get: <T extends defined>(guiObject: GuiObject, key: RegistryKey<T>) => T | undefined;
|
|
22
|
+
getAll: <T extends defined>(key: RegistryKey<T>) => T[];
|
|
23
|
+
}
|
|
24
|
+
export declare const RegistryContext: React.Context<RegistryContextValue | undefined>;
|
|
25
|
+
export interface RegistryProviderProps {
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export declare function RegistryProvider(props: RegistryProviderProps): React.JSX.Element;
|
|
29
|
+
export declare function useRegistryRegistration<T extends defined>(key: RegistryKey<T>, createRegistration: (guiObject: GuiObject) => T, dependencies: React.DependencyList): {
|
|
30
|
+
ref: React.Dispatch<React.SetStateAction<GuiObject | undefined>>;
|
|
31
|
+
guiObject: GuiObject | undefined;
|
|
32
|
+
registration: T | undefined;
|
|
33
|
+
};
|