@rbxts/react-clean-ui 1.0.36 → 1.0.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/out/Components/Input/Button.d.ts +9 -0
- package/out/Components/Input/Button.luau +155 -46
- package/out/Components/Input/Checkbox.luau +21 -5
- package/out/Components/Input/Increment.d.ts +11 -0
- package/out/Components/Input/Increment.luau +107 -0
- package/out/Components/Input/Increment.step.d.ts +1 -0
- package/out/Components/Input/Increment.step.luau +25 -0
- package/out/Components/Input/Input.d.ts +4 -3
- package/out/Components/Input/Input.luau +124 -17
- package/out/Components/Input/Input.validation.d.ts +3 -0
- package/out/Components/Input/Input.validation.luau +21 -0
- package/out/Components/Input/Select.d.ts +4 -3
- package/out/Components/Input/Select.luau +23 -18
- package/out/Components/Input/Slider.d.ts +1 -1
- package/out/Components/Input/Slider.luau +68 -34
- package/out/Components/Input/index.d.ts +1 -0
- package/out/Components/Input/init.luau +3 -0
- package/out/Components/Layout/Accordion.d.ts +1 -1
- package/out/Components/Layout/Accordion.luau +7 -6
- package/out/Components/Layout/Container.d.ts +4 -2
- package/out/Components/Layout/Container.luau +12 -3
- package/out/Components/Layout/Draggable.luau +1 -1
- package/out/Components/Layout/Fieldset.d.ts +1 -1
- package/out/Components/Layout/FlexItem.d.ts +2 -1
- package/out/Components/Layout/FlexItem.luau +1 -0
- package/out/Components/Layout/Scroller.d.ts +1 -0
- package/out/Components/Layout/Scroller.luau +1 -1
- package/out/Components/Layout/Tabs.d.ts +1 -1
- package/out/Components/Layout/Tabs.luau +37 -7
- package/out/Components/Navigation/Menu.d.ts +1 -1
- package/out/Components/Surface/Box.d.ts +4 -2
- package/out/Components/Surface/Box.luau +12 -3
- package/out/Components/Surface/Card.d.ts +8 -6
- package/out/Components/Surface/Card.luau +416 -24
- package/out/Components/Surface/Icon.luau +42 -4
- package/out/Components/Typography/Text.d.ts +1 -0
- package/out/Components/Typography/Text.luau +119 -10
- package/out/Contexts/row.context.d.ts +1 -1
- package/out/Contexts/theme.context.d.ts +2 -2
- package/out/Helpers/color.helper.d.ts +5 -3
- package/out/Helpers/color.helper.luau +62 -34
- package/out/Helpers/create-ui-story.d.ts +2 -2
- package/out/Helpers/create-ui-story.luau +33 -1
- package/out/Helpers/css.helper.d.ts +28 -2
- package/out/Helpers/css.helper.luau +208 -0
- package/out/Helpers/index.d.ts +1 -0
- package/out/Helpers/init.luau +3 -0
- package/out/Helpers/size.helper.d.ts +3 -1
- package/out/Helpers/size.helper.luau +10 -9
- package/out/Helpers/spacing.helper.d.ts +3 -3
- package/out/Helpers/typography.helper.d.ts +2 -2
- package/out/Interfaces/css.types.d.ts +28 -0
- package/out/Interfaces/css.types.luau +17 -0
- package/out/Interfaces/element.props.d.ts +61 -0
- package/out/Interfaces/element.props.luau +1 -0
- package/out/Interfaces/index.d.ts +4 -2
- package/out/Interfaces/init.luau +9 -3
- package/out/Interfaces/responsive.types.d.ts +26 -0
- package/out/Interfaces/semantics.d.ts +3 -0
- package/out/Interfaces/semantics.luau +2 -0
- package/out/Providers/app.provider.d.ts +2 -2
- package/out/Providers/theme.provider.d.ts +2 -2
- package/out/Theme/index.d.ts +1 -0
- package/out/Theme/theme.factory.d.ts +3 -3
- package/out/Theme/theme.style.d.ts +48 -0
- package/out/Theme/theme.style.luau +1 -0
- package/out/Theme/theme.template.d.ts +23 -26
- package/out/Theme/themes/dark.theme.d.ts +1 -1
- package/out/Theme/themes/dark.theme.luau +28 -0
- package/out/Theme/themes/default.theme.d.ts +2 -2
- package/out/Theme/themes/default.theme.luau +11 -1
- package/out/Theme/themes/index.d.ts +1 -0
- package/out/Theme/themes/init.luau +3 -0
- package/out/Theme/themes/sandstone.theme.d.ts +1 -1
- package/out/Theme/themes/sandstone.theme.luau +25 -0
- package/out/Theme/themes/wooden.theme.d.ts +1 -0
- package/out/Theme/themes/wooden.theme.luau +443 -0
- package/out/index.d.ts +8 -8
- package/package.json +18 -6
- package/out/Interfaces/clean.element.props.d.ts +0 -114
- /package/out/{Interfaces/userinput.d.ts → Helpers/input.helper.d.ts} +0 -0
- /package/out/{Interfaces/userinput.luau → Helpers/input.helper.luau} +0 -0
- /package/out/Interfaces/{clean.element.props.luau → responsive.types.luau} +0 -0
|
@@ -41,7 +41,7 @@ local function Scroller(props)
|
|
|
41
41
|
ScrollBarThickness = thickness,
|
|
42
42
|
VerticalScrollBarInset = Enum.ScrollBarInset.ScrollBar,
|
|
43
43
|
AutomaticCanvasSize = Enum.AutomaticSize.Y,
|
|
44
|
-
}, React.createElement("uilistlayout", {
|
|
44
|
+
}, props.AutomaticSizeParent and React.createElement("uilistlayout", {
|
|
45
45
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
46
46
|
}), React.createElement("frame", {
|
|
47
47
|
Size = UDim2.new(1, if isScrolling then -thickness - spacing else 0, 0, 0),
|
|
@@ -14,7 +14,7 @@ interface TabContentProps {
|
|
|
14
14
|
declare function TabContent(props: TabContentProps): undefined;
|
|
15
15
|
interface TabsProps extends ScalableElementProps {
|
|
16
16
|
}
|
|
17
|
-
type TabsComponent = React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<
|
|
17
|
+
type TabsComponent = React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<ImageLabel>> & {
|
|
18
18
|
Tab: typeof Tab;
|
|
19
19
|
Title: typeof TabTitle;
|
|
20
20
|
Content: typeof TabContent;
|
|
@@ -12,6 +12,7 @@ local Corners = _Decorator.Corners
|
|
|
12
12
|
local Padding = _Decorator.Padding
|
|
13
13
|
local _Helpers = TS.import(script, script.Parent.Parent.Parent, "Helpers")
|
|
14
14
|
local ColorHelper = _Helpers.ColorHelper
|
|
15
|
+
local CssHelper = _Helpers.CssHelper
|
|
15
16
|
local SpacingHelper = _Helpers.SpacingHelper
|
|
16
17
|
local TypographyHelper = _Helpers.TypographyHelper
|
|
17
18
|
local _HoverButton = TS.import(script, script.Parent.Parent, "Input", "HoverButton")
|
|
@@ -98,6 +99,20 @@ local Tabs = React.forwardRef(function(props, ref)
|
|
|
98
99
|
local buttonDefault = ColorHelper:getIntentColors(theme, "primary", "default", theme.components.tabs.button.intents)
|
|
99
100
|
local buttonHover = ColorHelper:getIntentColors(theme, "primary", "hover", theme.components.tabs.button.intents)
|
|
100
101
|
local buttonFocus = ColorHelper:getIntentColors(theme, "primary", "focus", theme.components.tabs.button.intents)
|
|
102
|
+
local buttonDefaultBackgroundImage = CssHelper:resolveBackgroundImage(buttonDefault.backgroundImage)
|
|
103
|
+
local buttonHoverBackgroundImage = CssHelper:resolveBackgroundImage(buttonHover.backgroundImage)
|
|
104
|
+
local buttonFocusBackgroundImage = CssHelper:resolveBackgroundImage(buttonFocus.backgroundImage)
|
|
105
|
+
local _attributes = {
|
|
106
|
+
ref = ref,
|
|
107
|
+
BackgroundColor3 = theme.components.tabs.list.backgroundColor,
|
|
108
|
+
width = "100%",
|
|
109
|
+
}
|
|
110
|
+
local _condition = theme.components.tabs.list.backgroundTransparency
|
|
111
|
+
if _condition == nil then
|
|
112
|
+
_condition = 0
|
|
113
|
+
end
|
|
114
|
+
_attributes.BackgroundTransparency = _condition
|
|
115
|
+
_attributes.backgroundImage = theme.components.tabs.list.backgroundImage
|
|
101
116
|
local _exp = React.createElement(Corners, {
|
|
102
117
|
radius = theme.components.tabs.list.cornerRadius,
|
|
103
118
|
})
|
|
@@ -112,11 +127,17 @@ local Tabs = React.forwardRef(function(props, ref)
|
|
|
112
127
|
default = {
|
|
113
128
|
Size = UDim2.fromScale(0, 0),
|
|
114
129
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
115
|
-
ImageTransparency = 1,
|
|
116
130
|
BackgroundColor3 = buttonDefault.backgroundColor,
|
|
117
131
|
BackgroundTransparency = buttonDefault.backgroundTransparency,
|
|
118
132
|
BorderSizePixel = 0,
|
|
119
133
|
AutoButtonColor = false,
|
|
134
|
+
Image = buttonDefaultBackgroundImage.Image,
|
|
135
|
+
ImageColor3 = buttonDefaultBackgroundImage.ImageColor3,
|
|
136
|
+
ImageTransparency = buttonDefaultBackgroundImage.ImageTransparency,
|
|
137
|
+
ScaleType = buttonDefaultBackgroundImage.ScaleType,
|
|
138
|
+
SliceCenter = buttonDefaultBackgroundImage.SliceCenter,
|
|
139
|
+
SliceScale = buttonDefaultBackgroundImage.SliceScale,
|
|
140
|
+
TileSize = buttonDefaultBackgroundImage.TileSize,
|
|
120
141
|
Event = {
|
|
121
142
|
Activated = function()
|
|
122
143
|
setSelected(index)
|
|
@@ -126,10 +147,24 @@ local Tabs = React.forwardRef(function(props, ref)
|
|
|
126
147
|
hover = {
|
|
127
148
|
BackgroundColor3 = buttonHover.backgroundColor,
|
|
128
149
|
BackgroundTransparency = buttonHover.backgroundTransparency,
|
|
150
|
+
Image = buttonHoverBackgroundImage.Image,
|
|
151
|
+
ImageColor3 = buttonHoverBackgroundImage.ImageColor3,
|
|
152
|
+
ImageTransparency = buttonHoverBackgroundImage.ImageTransparency,
|
|
153
|
+
ScaleType = buttonHoverBackgroundImage.ScaleType,
|
|
154
|
+
SliceCenter = buttonHoverBackgroundImage.SliceCenter,
|
|
155
|
+
SliceScale = buttonHoverBackgroundImage.SliceScale,
|
|
156
|
+
TileSize = buttonHoverBackgroundImage.TileSize,
|
|
129
157
|
},
|
|
130
158
|
focus = {
|
|
131
159
|
BackgroundColor3 = buttonFocus.backgroundColor,
|
|
132
160
|
BackgroundTransparency = buttonFocus.backgroundTransparency,
|
|
161
|
+
Image = buttonFocusBackgroundImage.Image,
|
|
162
|
+
ImageColor3 = buttonFocusBackgroundImage.ImageColor3,
|
|
163
|
+
ImageTransparency = buttonFocusBackgroundImage.ImageTransparency,
|
|
164
|
+
ScaleType = buttonFocusBackgroundImage.ScaleType,
|
|
165
|
+
SliceCenter = buttonFocusBackgroundImage.SliceCenter,
|
|
166
|
+
SliceScale = buttonFocusBackgroundImage.SliceScale,
|
|
167
|
+
TileSize = buttonFocusBackgroundImage.TileSize,
|
|
133
168
|
},
|
|
134
169
|
}, React.createElement(TabButtonContent, {
|
|
135
170
|
text = tab.title.text,
|
|
@@ -139,12 +174,7 @@ local Tabs = React.forwardRef(function(props, ref)
|
|
|
139
174
|
_newValue[_k] = _callback(_v, _k - 1, tabs)
|
|
140
175
|
end
|
|
141
176
|
-- ▲ ReadonlyArray.map ▲
|
|
142
|
-
local _exp_2 = React.createElement(Container,
|
|
143
|
-
ref = ref,
|
|
144
|
-
BackgroundColor3 = theme.components.tabs.list.backgroundColor,
|
|
145
|
-
width = "100%",
|
|
146
|
-
BackgroundTransparency = 0,
|
|
147
|
-
}, _exp, _exp_1, React.createElement(HStack, nil, _newValue))
|
|
177
|
+
local _exp_2 = React.createElement(Container, _attributes, _exp, _exp_1, React.createElement(HStack, nil, _newValue))
|
|
148
178
|
local _exp_3 = React.createElement("uistroke", {
|
|
149
179
|
Thickness = theme.components.tabs.borderThickness,
|
|
150
180
|
BorderStrokePosition = Enum.BorderStrokePosition.Inner,
|
|
@@ -8,7 +8,7 @@ interface MenuProps {
|
|
|
8
8
|
title: string;
|
|
9
9
|
collapsed?: boolean;
|
|
10
10
|
}
|
|
11
|
-
type MenuComponent = React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<
|
|
11
|
+
type MenuComponent = React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<ImageLabel>> & {
|
|
12
12
|
Item: typeof MenuItem;
|
|
13
13
|
};
|
|
14
14
|
declare const Menu: MenuComponent;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
2
|
import { BackgroundElementProps, PositionElementProps, ShadowElementProps, SizeElementProps, SpacedElementProps, ZIndexElementProps } from "../../Interfaces/";
|
|
3
|
-
|
|
3
|
+
import { CssBackgroundImage } from "../../Theme";
|
|
4
|
+
export interface BoxProps extends SpacedElementProps, ShadowElementProps, BackgroundElementProps, ZIndexElementProps, SizeElementProps, PositionElementProps, React.InstanceProps<ImageLabel> {
|
|
4
5
|
'border-thickness'?: number;
|
|
5
6
|
'border-color'?: Color3;
|
|
7
|
+
'background-image'?: CssBackgroundImage;
|
|
6
8
|
}
|
|
7
|
-
export declare const Box: React.ForwardRefExoticComponent<Omit<BoxProps, "ref"> & React.RefAttributes<
|
|
9
|
+
export declare const Box: React.ForwardRefExoticComponent<Omit<BoxProps, "ref"> & React.RefAttributes<ImageLabel>>;
|
|
@@ -7,9 +7,17 @@ local Padding = _Decorator.Padding
|
|
|
7
7
|
local Corners = _Decorator.Corners
|
|
8
8
|
local BoxShadow = _Decorator.BoxShadow
|
|
9
9
|
local Container = TS.import(script, script.Parent.Parent, "Layout").Container
|
|
10
|
-
local
|
|
10
|
+
local _Helpers = TS.import(script, script.Parent.Parent.Parent, "Helpers")
|
|
11
|
+
local SizeHelper = _Helpers.SizeHelper
|
|
12
|
+
local CssHelper = _Helpers.CssHelper
|
|
11
13
|
local Box = React.forwardRef(function(props, ref)
|
|
12
14
|
local theme = React.useContext(CleanThemeContext)
|
|
15
|
+
local paddingSourceProps = props
|
|
16
|
+
local hasCustomPadding = paddingSourceProps.top ~= nil or paddingSourceProps.bottom ~= nil or paddingSourceProps.left ~= nil or paddingSourceProps.right ~= nil or paddingSourceProps.spacing ~= nil or paddingSourceProps.padding ~= nil or paddingSourceProps.resolvedPadding ~= nil
|
|
17
|
+
local themePadding = theme.components.box.padding
|
|
18
|
+
local paddingProps = if not hasCustomPadding and themePadding ~= nil then {
|
|
19
|
+
resolvedPadding = CssHelper:parseCssQuad(themePadding),
|
|
20
|
+
} else paddingSourceProps
|
|
13
21
|
local _attributes = {
|
|
14
22
|
ref = ref,
|
|
15
23
|
}
|
|
@@ -17,7 +25,7 @@ local Box = React.forwardRef(function(props, ref)
|
|
|
17
25
|
_attributes[_k] = _v
|
|
18
26
|
end
|
|
19
27
|
_attributes.Size = SizeHelper:GetSize(props, UDim2.fromScale(1, 1))
|
|
20
|
-
_attributes.AutomaticSize =
|
|
28
|
+
_attributes.AutomaticSize = SizeHelper:GetAutoSize(props)
|
|
21
29
|
local _condition = props.BackgroundTransparency
|
|
22
30
|
if _condition == nil then
|
|
23
31
|
_condition = theme.components.box.backgroundTransparency
|
|
@@ -26,6 +34,7 @@ local Box = React.forwardRef(function(props, ref)
|
|
|
26
34
|
_attributes.BackgroundColor3 = props.BackgroundColor3 or theme.components.box.backgroundColor
|
|
27
35
|
_attributes.ZIndex = props.ZIndex
|
|
28
36
|
_attributes.Event = props.Event
|
|
37
|
+
_attributes.backgroundImage = props["background-image"] or theme.components.box.backgroundImage
|
|
29
38
|
local _attributes_1 = {}
|
|
30
39
|
local _condition_1 = props["border-thickness"]
|
|
31
40
|
if _condition_1 == nil then
|
|
@@ -39,7 +48,7 @@ local Box = React.forwardRef(function(props, ref)
|
|
|
39
48
|
setmetatable(_attributes_2, nil)
|
|
40
49
|
_attributes_2.value = theme.components.box.boxShadow
|
|
41
50
|
local _exp_1 = React.createElement(BoxShadow, _attributes_2)
|
|
42
|
-
local _attributes_3 = table.clone(
|
|
51
|
+
local _attributes_3 = table.clone(paddingProps)
|
|
43
52
|
setmetatable(_attributes_3, nil)
|
|
44
53
|
return React.createElement(Container, _attributes, _exp, _exp_1, React.createElement(Padding, _attributes_3), React.createElement(Corners, {
|
|
45
54
|
radius = theme.components.box.cornerRadius,
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
2
|
import { BoxProps } from "./Box";
|
|
3
|
-
import { IntentElementProps } from "../../Interfaces";
|
|
4
|
-
interface CardHeaderProps extends IntentElementProps {
|
|
3
|
+
import { IntentElementProps, PositionElementProps, ZIndexElementProps } from "../../Interfaces";
|
|
4
|
+
interface CardHeaderProps extends IntentElementProps, PositionElementProps, ZIndexElementProps {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
+
overlay?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<
|
|
8
|
+
export declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<ImageLabel>>;
|
|
8
9
|
interface CardBodyProps extends BoxProps {
|
|
9
10
|
}
|
|
10
|
-
export declare const CardBody: React.ForwardRefExoticComponent<Omit<CardBodyProps, "ref"> & React.RefAttributes<
|
|
11
|
+
export declare const CardBody: React.ForwardRefExoticComponent<Omit<CardBodyProps, "ref"> & React.RefAttributes<ImageLabel>>;
|
|
11
12
|
interface CardFooterProps extends BoxProps, IntentElementProps {
|
|
13
|
+
overlay?: boolean;
|
|
12
14
|
}
|
|
13
|
-
export declare const CardFooter: React.ForwardRefExoticComponent<Omit<CardFooterProps, "ref"> & React.RefAttributes<
|
|
15
|
+
export declare const CardFooter: React.ForwardRefExoticComponent<Omit<CardFooterProps, "ref"> & React.RefAttributes<ImageLabel>>;
|
|
14
16
|
interface CardProps extends BoxProps, IntentElementProps {
|
|
15
17
|
}
|
|
16
|
-
type CardComponent = React.ForwardRefExoticComponent<CardProps & React.RefAttributes<
|
|
18
|
+
type CardComponent = React.ForwardRefExoticComponent<CardProps & React.RefAttributes<ImageLabel>> & {
|
|
17
19
|
Header: typeof CardHeader;
|
|
18
20
|
Footer: typeof CardFooter;
|
|
19
21
|
Body: typeof CardBody;
|