@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,19 @@
|
|
|
1
|
+
import React, { Component } from "@rbxts/react";
|
|
2
|
+
import { ButtonProps } from "../Input";
|
|
3
|
+
interface MenuItemProps extends ButtonProps {
|
|
4
|
+
title: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function MenuItem(props: MenuItemProps): React.JSX.Element;
|
|
7
|
+
interface MenuProps {
|
|
8
|
+
title: string;
|
|
9
|
+
collapsed?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface MenuState {
|
|
12
|
+
collapsed: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare class Menu extends Component<MenuProps, MenuState> {
|
|
15
|
+
static Item: typeof MenuItem;
|
|
16
|
+
state: MenuState;
|
|
17
|
+
render(): React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
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 Component = _react.Component
|
|
6
|
+
local ReactComponent = _react.ReactComponent
|
|
7
|
+
local Button = TS.import(script, script.Parent.Parent, "Input").Button
|
|
8
|
+
local _Layout = TS.import(script, script.Parent.Parent, "Layout")
|
|
9
|
+
local Container = _Layout.Container
|
|
10
|
+
local FlexItem = _Layout.FlexItem
|
|
11
|
+
local Group = _Layout.Group
|
|
12
|
+
local HStack = _Layout.HStack
|
|
13
|
+
local Scroller = _Layout.Scroller
|
|
14
|
+
local VStack = _Layout.VStack
|
|
15
|
+
local Text = TS.import(script, script.Parent.Parent, "Typography").Text
|
|
16
|
+
local NavigationContext = TS.import(script, script.Parent.Parent.Parent, "Contexts").NavigationContext
|
|
17
|
+
local function MenuItem(props)
|
|
18
|
+
local context = React.useContext(NavigationContext)
|
|
19
|
+
return React.createElement(Button, {
|
|
20
|
+
text = if not context.collapsed then props.title else nil,
|
|
21
|
+
icon = props.icon,
|
|
22
|
+
Event = props.Event,
|
|
23
|
+
group = true,
|
|
24
|
+
})
|
|
25
|
+
end
|
|
26
|
+
local Menu
|
|
27
|
+
do
|
|
28
|
+
local super = Component
|
|
29
|
+
Menu = setmetatable({}, {
|
|
30
|
+
__tostring = function()
|
|
31
|
+
return "Menu"
|
|
32
|
+
end,
|
|
33
|
+
__index = super,
|
|
34
|
+
})
|
|
35
|
+
Menu.__index = Menu
|
|
36
|
+
function Menu.new(...)
|
|
37
|
+
local self = setmetatable({}, Menu)
|
|
38
|
+
return self:constructor(...) or self
|
|
39
|
+
end
|
|
40
|
+
function Menu:constructor(...)
|
|
41
|
+
super.constructor(self, ...)
|
|
42
|
+
local _object = {}
|
|
43
|
+
local _left = "collapsed"
|
|
44
|
+
local _condition = self.props.collapsed
|
|
45
|
+
if _condition == nil then
|
|
46
|
+
_condition = false
|
|
47
|
+
end
|
|
48
|
+
_object[_left] = _condition
|
|
49
|
+
self.state = _object
|
|
50
|
+
end
|
|
51
|
+
function Menu:render()
|
|
52
|
+
return React.createElement(NavigationContext.Provider, {
|
|
53
|
+
value = {
|
|
54
|
+
collapsed = self.state.collapsed,
|
|
55
|
+
},
|
|
56
|
+
}, React.createElement(Group, nil, React.createElement(VStack, {
|
|
57
|
+
spacing = "sm",
|
|
58
|
+
}, React.createElement(Container, {
|
|
59
|
+
group = true,
|
|
60
|
+
}, React.createElement(HStack, {
|
|
61
|
+
valign = "Center",
|
|
62
|
+
}, React.createElement(Button, {
|
|
63
|
+
icon = "bars",
|
|
64
|
+
Event = {
|
|
65
|
+
Activated = function()
|
|
66
|
+
self:setState(function(state)
|
|
67
|
+
return {
|
|
68
|
+
collapsed = not state.collapsed,
|
|
69
|
+
}
|
|
70
|
+
end)
|
|
71
|
+
end,
|
|
72
|
+
},
|
|
73
|
+
}), not self.state.collapsed and React.createElement(Text, {
|
|
74
|
+
text = self.props.title,
|
|
75
|
+
variant = "heading",
|
|
76
|
+
}))), React.createElement(FlexItem, {
|
|
77
|
+
mode = "Fill",
|
|
78
|
+
}, React.createElement(Scroller, {
|
|
79
|
+
height = "100%",
|
|
80
|
+
}, React.createElement(VStack, {
|
|
81
|
+
spacing = "sm",
|
|
82
|
+
HorizontalFlex = Enum.UIFlexAlignment.None,
|
|
83
|
+
}, self.props.children))))))
|
|
84
|
+
end
|
|
85
|
+
Menu.Item = MenuItem
|
|
86
|
+
Menu = ReactComponent(Menu) or Menu
|
|
87
|
+
end
|
|
88
|
+
return {
|
|
89
|
+
MenuItem = MenuItem,
|
|
90
|
+
Menu = Menu,
|
|
91
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Menu';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
2
|
+
import { BackgroundElementProps, ShadowElementProps, SizeElementProps, SpacedElementProps, ZIndexElementProps } from "../../Interfaces/";
|
|
3
|
+
export interface BoxProps extends SpacedElementProps, ShadowElementProps, BackgroundElementProps, ZIndexElementProps, SizeElementProps, React.InstanceProps<Frame> {
|
|
4
|
+
'border-thickness'?: number;
|
|
5
|
+
'border-color'?: Color3;
|
|
6
|
+
}
|
|
7
|
+
export declare const Box: React.ForwardRefExoticComponent<Omit<BoxProps, "ref"> & React.RefAttributes<Frame>>;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 CleanThemeContext = TS.import(script, script.Parent.Parent.Parent, "Contexts").CleanThemeContext
|
|
5
|
+
local _Decorator = TS.import(script, script.Parent.Parent, "Decorator")
|
|
6
|
+
local Padding = _Decorator.Padding
|
|
7
|
+
local Corners = _Decorator.Corners
|
|
8
|
+
local BoxShadow = _Decorator.BoxShadow
|
|
9
|
+
local Container = TS.import(script, script.Parent.Parent, "Layout").Container
|
|
10
|
+
local SizeHelper = TS.import(script, script.Parent.Parent.Parent, "Helpers").SizeHelper
|
|
11
|
+
local Box = React.forwardRef(function(props, ref)
|
|
12
|
+
local theme = React.useContext(CleanThemeContext)
|
|
13
|
+
local _attributes = {
|
|
14
|
+
ref = ref,
|
|
15
|
+
}
|
|
16
|
+
for _k, _v in props do
|
|
17
|
+
_attributes[_k] = _v
|
|
18
|
+
end
|
|
19
|
+
_attributes.Size = SizeHelper:GetSize(props, UDim2.fromScale(1, 1))
|
|
20
|
+
_attributes.AutomaticSize = Enum.AutomaticSize.XY
|
|
21
|
+
local _condition = props.BackgroundTransparency
|
|
22
|
+
if _condition == nil then
|
|
23
|
+
_condition = theme.components.box.backgroundTransparency
|
|
24
|
+
end
|
|
25
|
+
_attributes.BackgroundTransparency = _condition
|
|
26
|
+
_attributes.BackgroundColor3 = props.BackgroundColor3 or theme.components.box.backgroundColor
|
|
27
|
+
_attributes.ZIndex = props.ZIndex
|
|
28
|
+
_attributes.Event = props.Event
|
|
29
|
+
local _attributes_1 = {}
|
|
30
|
+
local _condition_1 = props["border-thickness"]
|
|
31
|
+
if _condition_1 == nil then
|
|
32
|
+
_condition_1 = theme.components.box.borderThickness
|
|
33
|
+
end
|
|
34
|
+
_attributes_1.Thickness = _condition_1
|
|
35
|
+
_attributes_1.BorderStrokePosition = Enum.BorderStrokePosition.Inner
|
|
36
|
+
_attributes_1.Color = props["border-color"] or theme.components.box.borderColor
|
|
37
|
+
local _exp = React.createElement("uistroke", _attributes_1)
|
|
38
|
+
local _attributes_2 = table.clone(props)
|
|
39
|
+
setmetatable(_attributes_2, nil)
|
|
40
|
+
_attributes_2.value = theme.components.box.boxShadow
|
|
41
|
+
local _exp_1 = React.createElement(BoxShadow, _attributes_2)
|
|
42
|
+
local _attributes_3 = table.clone(props)
|
|
43
|
+
setmetatable(_attributes_3, nil)
|
|
44
|
+
return React.createElement(Container, _attributes, _exp, _exp_1, React.createElement(Padding, _attributes_3), React.createElement(Corners, {
|
|
45
|
+
radius = theme.components.box.cornerRadius,
|
|
46
|
+
}), props.children)
|
|
47
|
+
end)
|
|
48
|
+
return {
|
|
49
|
+
Box = Box,
|
|
50
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { Component } from "@rbxts/react";
|
|
2
|
+
import { BoxProps } from "./Box";
|
|
3
|
+
import { CleanThemeContext } from "../../Contexts";
|
|
4
|
+
import { IntentElementProps } from "../../Interfaces";
|
|
5
|
+
interface CardHeaderProps extends IntentElementProps {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<Frame>>;
|
|
9
|
+
interface CardBodyProps extends BoxProps {
|
|
10
|
+
}
|
|
11
|
+
export declare const CardBody: React.ForwardRefExoticComponent<Omit<CardBodyProps, "ref"> & React.RefAttributes<Frame>>;
|
|
12
|
+
interface CardFooterProps extends BoxProps, IntentElementProps {
|
|
13
|
+
}
|
|
14
|
+
export declare const CardFooter: React.ForwardRefExoticComponent<Omit<CardFooterProps, "ref"> & React.RefAttributes<Frame>>;
|
|
15
|
+
interface CardProps extends BoxProps, IntentElementProps {
|
|
16
|
+
}
|
|
17
|
+
export declare class Card extends Component<CardProps> {
|
|
18
|
+
static Header: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<Frame>>;
|
|
19
|
+
static Footer: React.ForwardRefExoticComponent<Omit<CardFooterProps, "ref"> & React.RefAttributes<Frame>>;
|
|
20
|
+
static Body: React.ForwardRefExoticComponent<Omit<CardBodyProps, "ref"> & React.RefAttributes<Frame>>;
|
|
21
|
+
static contextType: React.Context<import("../..").CleanTheme>;
|
|
22
|
+
context: React.ContextType<typeof CleanThemeContext>;
|
|
23
|
+
render(): React.JSX.Element;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,138 @@
|
|
|
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 Component = _react.Component
|
|
6
|
+
local ReactComponent = _react.ReactComponent
|
|
7
|
+
local Box = TS.import(script, script.Parent, "Box").Box
|
|
8
|
+
local _Layout = TS.import(script, script.Parent.Parent, "Layout")
|
|
9
|
+
local Container = _Layout.Container
|
|
10
|
+
local FlexItem = _Layout.FlexItem
|
|
11
|
+
local VStack = _Layout.VStack
|
|
12
|
+
local _Helpers = TS.import(script, script.Parent.Parent.Parent, "Helpers")
|
|
13
|
+
local ColorHelper = _Helpers.ColorHelper
|
|
14
|
+
local CssHelper = _Helpers.CssHelper
|
|
15
|
+
local SpacingHelper = _Helpers.SpacingHelper
|
|
16
|
+
local CleanThemeContext = TS.import(script, script.Parent.Parent.Parent, "Contexts").CleanThemeContext
|
|
17
|
+
local Padding = TS.import(script, script.Parent.Parent, "Decorator").Padding
|
|
18
|
+
local CardContext = React.createContext({})
|
|
19
|
+
local CardHeader = React.forwardRef(function(props, ref)
|
|
20
|
+
local theme = React.useContext(CleanThemeContext)
|
|
21
|
+
local card = React.useContext(CardContext)
|
|
22
|
+
local intent = ColorHelper:getIntentColors(theme, props.intent or card.intent or "primary", "default", theme.components.card.header.intents)
|
|
23
|
+
local padding = SpacingHelper:ResolveNumberPadding(SpacingHelper:GetPadding(theme, "md", theme.components.card.header.spacing))
|
|
24
|
+
local corners = CssHelper:parseCssSize(theme.components.card.cornerRadius)
|
|
25
|
+
local _attributes = {
|
|
26
|
+
ref = ref,
|
|
27
|
+
}
|
|
28
|
+
for _k, _v in props do
|
|
29
|
+
_attributes[_k] = _v
|
|
30
|
+
end
|
|
31
|
+
_attributes.Size = UDim2.fromScale(1, 0)
|
|
32
|
+
_attributes.AutomaticSize = Enum.AutomaticSize.Y
|
|
33
|
+
_attributes.BackgroundTransparency = intent.backgroundTransparency
|
|
34
|
+
_attributes.BackgroundColor3 = intent.backgroundColor
|
|
35
|
+
_attributes.BorderSizePixel = 0
|
|
36
|
+
return React.createElement(Container, _attributes, React.createElement(Padding, {
|
|
37
|
+
resolvedPadding = padding,
|
|
38
|
+
}), React.createElement("uistroke", {
|
|
39
|
+
Thickness = 1,
|
|
40
|
+
Color = intent.borderColor,
|
|
41
|
+
BorderStrokePosition = Enum.BorderStrokePosition.Inner,
|
|
42
|
+
}), React.createElement("uicorner", {
|
|
43
|
+
TopLeftRadius = corners,
|
|
44
|
+
TopRightRadius = corners,
|
|
45
|
+
BottomLeftRadius = UDim.new(0, 0),
|
|
46
|
+
BottomRightRadius = UDim.new(0, 0),
|
|
47
|
+
}), props.children)
|
|
48
|
+
end)
|
|
49
|
+
local CardBody = React.forwardRef(function(props, ref)
|
|
50
|
+
local theme = React.useContext(CleanThemeContext)
|
|
51
|
+
local padding = SpacingHelper:ResolveNumberPadding(SpacingHelper:GetPadding(theme, "md", theme.components.card.header.spacing))
|
|
52
|
+
local _attributes = {
|
|
53
|
+
ref = ref,
|
|
54
|
+
}
|
|
55
|
+
for _k, _v in props do
|
|
56
|
+
_attributes[_k] = _v
|
|
57
|
+
end
|
|
58
|
+
_attributes.Size = UDim2.fromScale(1, 0)
|
|
59
|
+
_attributes.AutomaticSize = Enum.AutomaticSize.Y
|
|
60
|
+
return React.createElement(FlexItem, nil, React.createElement(Container, _attributes, React.createElement(Padding, {
|
|
61
|
+
resolvedPadding = padding,
|
|
62
|
+
}), props.children))
|
|
63
|
+
end)
|
|
64
|
+
local CardFooter = React.forwardRef(function(props, ref)
|
|
65
|
+
local theme = React.useContext(CleanThemeContext)
|
|
66
|
+
local card = React.useContext(CardContext)
|
|
67
|
+
local intent = ColorHelper:getIntentColors(theme, props.intent or card.intent or "primary", "default", theme.components.card.footer.intents)
|
|
68
|
+
local padding = SpacingHelper:ResolveNumberPadding(SpacingHelper:GetPadding(theme, "md", theme.components.card.footer.spacing))
|
|
69
|
+
local corners = CssHelper:parseCssSize(theme.components.card.cornerRadius)
|
|
70
|
+
local _attributes = {
|
|
71
|
+
ref = ref,
|
|
72
|
+
}
|
|
73
|
+
for _k, _v in props do
|
|
74
|
+
_attributes[_k] = _v
|
|
75
|
+
end
|
|
76
|
+
_attributes.Size = UDim2.fromScale(1, 0)
|
|
77
|
+
_attributes.AutomaticSize = Enum.AutomaticSize.Y
|
|
78
|
+
_attributes.BackgroundTransparency = intent.backgroundTransparency
|
|
79
|
+
_attributes.BackgroundColor3 = intent.backgroundColor
|
|
80
|
+
_attributes.BorderSizePixel = 0
|
|
81
|
+
return React.createElement(Container, _attributes, React.createElement(Padding, {
|
|
82
|
+
resolvedPadding = padding,
|
|
83
|
+
}), React.createElement("uistroke", {
|
|
84
|
+
Thickness = 1,
|
|
85
|
+
Color = intent.borderColor,
|
|
86
|
+
BorderStrokePosition = Enum.BorderStrokePosition.Inner,
|
|
87
|
+
}), React.createElement("uicorner", {
|
|
88
|
+
TopLeftRadius = UDim.new(0, 0),
|
|
89
|
+
TopRightRadius = UDim.new(0, 0),
|
|
90
|
+
BottomLeftRadius = corners,
|
|
91
|
+
BottomRightRadius = corners,
|
|
92
|
+
}), props.children)
|
|
93
|
+
end)
|
|
94
|
+
local Card
|
|
95
|
+
do
|
|
96
|
+
local super = Component
|
|
97
|
+
Card = setmetatable({}, {
|
|
98
|
+
__tostring = function()
|
|
99
|
+
return "Card"
|
|
100
|
+
end,
|
|
101
|
+
__index = super,
|
|
102
|
+
})
|
|
103
|
+
Card.__index = Card
|
|
104
|
+
function Card.new(...)
|
|
105
|
+
local self = setmetatable({}, Card)
|
|
106
|
+
return self:constructor(...) or self
|
|
107
|
+
end
|
|
108
|
+
function Card:constructor(...)
|
|
109
|
+
super.constructor(self, ...)
|
|
110
|
+
end
|
|
111
|
+
function Card:render()
|
|
112
|
+
local contextValue = {
|
|
113
|
+
intent = self.props.intent,
|
|
114
|
+
}
|
|
115
|
+
local intent = ColorHelper:getIntentColors(self.context, self.props.intent or "primary", "default", self.context.components.card.header.intents)
|
|
116
|
+
local _attributes = table.clone(self.props)
|
|
117
|
+
setmetatable(_attributes, nil)
|
|
118
|
+
_attributes.ref = self.props.ref
|
|
119
|
+
_attributes.spacing = "None"
|
|
120
|
+
_attributes["border-color"] = intent.borderColor
|
|
121
|
+
return React.createElement(CardContext.Provider, {
|
|
122
|
+
value = contextValue,
|
|
123
|
+
}, React.createElement(Box, _attributes, React.createElement(VStack, {
|
|
124
|
+
spacing = "None",
|
|
125
|
+
}, self.props.children)))
|
|
126
|
+
end
|
|
127
|
+
Card.Header = CardHeader
|
|
128
|
+
Card.Footer = CardFooter
|
|
129
|
+
Card.Body = CardBody
|
|
130
|
+
Card.contextType = CleanThemeContext
|
|
131
|
+
Card = ReactComponent(Card) or Card
|
|
132
|
+
end
|
|
133
|
+
return {
|
|
134
|
+
CardHeader = CardHeader,
|
|
135
|
+
CardBody = CardBody,
|
|
136
|
+
CardFooter = CardFooter,
|
|
137
|
+
Card = Card,
|
|
138
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { Binding } from "@rbxts/react";
|
|
2
|
+
import { IconElementProps, ScalableElementProps } from "../../Interfaces/";
|
|
3
|
+
export interface IconProps extends IconElementProps, ScalableElementProps {
|
|
4
|
+
color?: Color3;
|
|
5
|
+
Size?: UDim2;
|
|
6
|
+
spinning?: boolean;
|
|
7
|
+
speed?: number;
|
|
8
|
+
Rotation?: number | Binding<number>;
|
|
9
|
+
}
|
|
10
|
+
export declare function Icon(props: IconProps): React.JSX.Element;
|
|
@@ -0,0 +1,64 @@
|
|
|
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 useTween = TS.import(script, TS.getModule(script, "@rbxts", "react-ripple").src).useTween
|
|
5
|
+
local CleanThemeContext = TS.import(script, script.Parent.Parent.Parent, "Contexts").CleanThemeContext
|
|
6
|
+
local DefaultIconSet = TS.import(script, script.Parent.Parent.Parent, "Theme").DefaultIconSet
|
|
7
|
+
local Icon
|
|
8
|
+
local function SpinningIcon(props)
|
|
9
|
+
local _object = {}
|
|
10
|
+
local _left = "duration"
|
|
11
|
+
local _condition = props.speed
|
|
12
|
+
if _condition == nil then
|
|
13
|
+
_condition = 1
|
|
14
|
+
end
|
|
15
|
+
_object[_left] = _condition
|
|
16
|
+
_object.easing = "linear"
|
|
17
|
+
_object.repeats = math.huge
|
|
18
|
+
local rotation, tween = useTween(0, _object)
|
|
19
|
+
React.useEffect(function()
|
|
20
|
+
tween:setGoal(360)
|
|
21
|
+
tween:start()
|
|
22
|
+
end)
|
|
23
|
+
return React.createElement("frame", {
|
|
24
|
+
BackgroundTransparency = 1,
|
|
25
|
+
Size = UDim2.fromOffset(0, 0),
|
|
26
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
27
|
+
}, React.createElement(Icon, {
|
|
28
|
+
Size = props.Size,
|
|
29
|
+
color = props.color,
|
|
30
|
+
icon = props.icon,
|
|
31
|
+
scale = props.scale,
|
|
32
|
+
Rotation = rotation,
|
|
33
|
+
}))
|
|
34
|
+
end
|
|
35
|
+
function Icon(props)
|
|
36
|
+
local theme = React.useContext(CleanThemeContext)
|
|
37
|
+
local _result
|
|
38
|
+
if props.icon == nil then
|
|
39
|
+
_result = nil
|
|
40
|
+
else
|
|
41
|
+
local _condition = theme.icons[props.icon]
|
|
42
|
+
if _condition == nil then
|
|
43
|
+
_condition = DefaultIconSet[props.icon]
|
|
44
|
+
end
|
|
45
|
+
_result = _condition
|
|
46
|
+
end
|
|
47
|
+
local iconId = _result
|
|
48
|
+
local size = theme.iconSize[props.scale or theme.default.scale]
|
|
49
|
+
if props.spinning then
|
|
50
|
+
local _attributes = table.clone(props)
|
|
51
|
+
setmetatable(_attributes, nil)
|
|
52
|
+
return React.createElement(SpinningIcon, _attributes)
|
|
53
|
+
end
|
|
54
|
+
return React.createElement("imagelabel", {
|
|
55
|
+
Rotation = props.Rotation,
|
|
56
|
+
Size = props.Size or UDim2.fromOffset(size, size),
|
|
57
|
+
Image = if iconId == nil then nil else `rbxassetid://{iconId}`,
|
|
58
|
+
BackgroundTransparency = 1,
|
|
59
|
+
ImageColor3 = props.color or theme.colors.intents.primary.default.textColor,
|
|
60
|
+
})
|
|
61
|
+
end
|
|
62
|
+
return {
|
|
63
|
+
Icon = Icon,
|
|
64
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 Component = _react.Component
|
|
6
|
+
local ReactComponent = _react.ReactComponent
|
|
7
|
+
local Box = TS.import(script, script.Parent, "Box").Box
|
|
8
|
+
local VStack = TS.import(script, script.Parent.Parent, "Layout", "VStack").VStack
|
|
9
|
+
local Panel
|
|
10
|
+
do
|
|
11
|
+
local super = Component
|
|
12
|
+
Panel = setmetatable({}, {
|
|
13
|
+
__tostring = function()
|
|
14
|
+
return "Panel"
|
|
15
|
+
end,
|
|
16
|
+
__index = super,
|
|
17
|
+
})
|
|
18
|
+
Panel.__index = Panel
|
|
19
|
+
function Panel.new(...)
|
|
20
|
+
local self = setmetatable({}, Panel)
|
|
21
|
+
return self:constructor(...) or self
|
|
22
|
+
end
|
|
23
|
+
function Panel:constructor(...)
|
|
24
|
+
super.constructor(self, ...)
|
|
25
|
+
end
|
|
26
|
+
function Panel:render()
|
|
27
|
+
return React.createElement(Box, nil, React.createElement(VStack))
|
|
28
|
+
end
|
|
29
|
+
Panel = ReactComponent(Panel) or Panel
|
|
30
|
+
end
|
|
31
|
+
return {
|
|
32
|
+
Panel = Panel,
|
|
33
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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, "Box") or {} do
|
|
5
|
+
exports[_k] = _v
|
|
6
|
+
end
|
|
7
|
+
for _k, _v in TS.import(script, script, "Card") or {} do
|
|
8
|
+
exports[_k] = _v
|
|
9
|
+
end
|
|
10
|
+
for _k, _v in TS.import(script, script, "Icon") or {} do
|
|
11
|
+
exports[_k] = _v
|
|
12
|
+
end
|
|
13
|
+
for _k, _v in TS.import(script, script, "Panel") or {} do
|
|
14
|
+
exports[_k] = _v
|
|
15
|
+
end
|
|
16
|
+
return exports
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { Component } from "@rbxts/react";
|
|
2
|
+
import { CleanThemeContext } from "../../Contexts";
|
|
3
|
+
import { TypographyStyle } from "../../Theme";
|
|
4
|
+
import { TextVariant } from "../../Interfaces/";
|
|
5
|
+
interface TextProps extends React.InstanceProps<TextLabel> {
|
|
6
|
+
text: string;
|
|
7
|
+
variant?: TextVariant;
|
|
8
|
+
typography?: TypographyStyle;
|
|
9
|
+
weight?: Enum.FontWeight | "bold";
|
|
10
|
+
align?: "Left" | "Right" | "Center";
|
|
11
|
+
TextWrap?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare class Text extends Component<TextProps> {
|
|
14
|
+
static contextType: React.Context<import("../../Theme").CleanTheme>;
|
|
15
|
+
context: React.ContextType<typeof CleanThemeContext>;
|
|
16
|
+
render(): React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
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 Component = _react.Component
|
|
6
|
+
local ReactComponent = _react.ReactComponent
|
|
7
|
+
local CleanThemeContext = TS.import(script, script.Parent.Parent.Parent, "Contexts").CleanThemeContext
|
|
8
|
+
local Text
|
|
9
|
+
do
|
|
10
|
+
local super = Component
|
|
11
|
+
Text = setmetatable({}, {
|
|
12
|
+
__tostring = function()
|
|
13
|
+
return "Text"
|
|
14
|
+
end,
|
|
15
|
+
__index = super,
|
|
16
|
+
})
|
|
17
|
+
Text.__index = Text
|
|
18
|
+
function Text.new(...)
|
|
19
|
+
local self = setmetatable({}, Text)
|
|
20
|
+
return self:constructor(...) or self
|
|
21
|
+
end
|
|
22
|
+
function Text:constructor(...)
|
|
23
|
+
super.constructor(self, ...)
|
|
24
|
+
end
|
|
25
|
+
function Text:render()
|
|
26
|
+
local style = self.props.typography or self.context.typography[self.props.variant or "body"]
|
|
27
|
+
local weight = if self.props.weight == "bold" then Enum.FontWeight.Bold else self.props.weight or style.weight or Enum.FontWeight.Regular
|
|
28
|
+
return React.createElement("textlabel", {
|
|
29
|
+
Size = UDim2.fromScale(0, 0),
|
|
30
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
31
|
+
LineHeight = style.lineHeight,
|
|
32
|
+
BackgroundTransparency = 1,
|
|
33
|
+
TextXAlignment = self.props.align or (self.props.TextXAlignment or Enum.TextXAlignment.Left),
|
|
34
|
+
TextColor3 = self.props.TextColor3 or self.context.colors.intents.primary.default.textColor,
|
|
35
|
+
Text = self.props.text,
|
|
36
|
+
TextWrap = self.props.TextWrap == nil or self.props.TextWrap == true,
|
|
37
|
+
FontFace = Font.fromName(style.font.Name, weight),
|
|
38
|
+
FontSize = style.size,
|
|
39
|
+
RichText = true,
|
|
40
|
+
TextScaled = false,
|
|
41
|
+
}, self.props.children)
|
|
42
|
+
end
|
|
43
|
+
Text.contextType = CleanThemeContext
|
|
44
|
+
Text = ReactComponent(Text) or Text
|
|
45
|
+
end
|
|
46
|
+
return {
|
|
47
|
+
Text = Text,
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Text';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './Decorator/BoxShadow';
|
|
2
|
+
export * from './Decorator/Corners';
|
|
3
|
+
export * from './Decorator/Padding';
|
|
4
|
+
export * from './Surface/';
|
|
5
|
+
export * from './Layout/';
|
|
6
|
+
export * from './Input/';
|
|
7
|
+
export * from './Typography/Text';
|
|
8
|
+
export * from './Navigation/Menu';
|
|
@@ -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, "Decorator", "BoxShadow") or {} do
|
|
5
|
+
exports[_k] = _v
|
|
6
|
+
end
|
|
7
|
+
for _k, _v in TS.import(script, script, "Decorator", "Corners") or {} do
|
|
8
|
+
exports[_k] = _v
|
|
9
|
+
end
|
|
10
|
+
for _k, _v in TS.import(script, script, "Decorator", "Padding") or {} do
|
|
11
|
+
exports[_k] = _v
|
|
12
|
+
end
|
|
13
|
+
for _k, _v in TS.import(script, script, "Surface") or {} do
|
|
14
|
+
exports[_k] = _v
|
|
15
|
+
end
|
|
16
|
+
for _k, _v in TS.import(script, script, "Layout") or {} do
|
|
17
|
+
exports[_k] = _v
|
|
18
|
+
end
|
|
19
|
+
for _k, _v in TS.import(script, script, "Input") or {} do
|
|
20
|
+
exports[_k] = _v
|
|
21
|
+
end
|
|
22
|
+
for _k, _v in TS.import(script, script, "Typography", "Text") or {} do
|
|
23
|
+
exports[_k] = _v
|
|
24
|
+
end
|
|
25
|
+
for _k, _v in TS.import(script, script, "Navigation", "Menu") or {} do
|
|
26
|
+
exports[_k] = _v
|
|
27
|
+
end
|
|
28
|
+
return exports
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
2
|
+
export interface DraggableContextValue {
|
|
3
|
+
isDragging: boolean;
|
|
4
|
+
beginDrag: (input: InputObject, handle: GuiObject) => void;
|
|
5
|
+
updateDrag: (input: InputObject) => void;
|
|
6
|
+
endDrag: (input: InputObject) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const DraggableContext: React.Context<DraggableContextValue | undefined>;
|
|
@@ -0,0 +1,22 @@
|
|
|
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, "draggable.context") or {} do
|
|
5
|
+
exports[_k] = _v
|
|
6
|
+
end
|
|
7
|
+
for _k, _v in TS.import(script, script, "droppable.context") or {} do
|
|
8
|
+
exports[_k] = _v
|
|
9
|
+
end
|
|
10
|
+
for _k, _v in TS.import(script, script, "navigation.context") or {} do
|
|
11
|
+
exports[_k] = _v
|
|
12
|
+
end
|
|
13
|
+
for _k, _v in TS.import(script, script, "overlay.context") or {} do
|
|
14
|
+
exports[_k] = _v
|
|
15
|
+
end
|
|
16
|
+
for _k, _v in TS.import(script, script, "row.context") or {} do
|
|
17
|
+
exports[_k] = _v
|
|
18
|
+
end
|
|
19
|
+
for _k, _v in TS.import(script, script, "theme.context") or {} do
|
|
20
|
+
exports[_k] = _v
|
|
21
|
+
end
|
|
22
|
+
return exports
|