@rbxts/react-clean-ui 1.1.0 → 1.2.4
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/Chart/BarChart.d.ts +1 -0
- package/out/Components/Chart/BarChart.luau +149 -112
- package/out/Components/Chart/Pie.d.ts +1 -0
- package/out/Components/Chart/Pie.luau +21 -6
- package/out/Components/Decorator/BoxShadow.d.ts +1 -0
- package/out/Components/Decorator/BoxShadow.luau +12 -5
- package/out/Components/Decorator/Corners.d.ts +1 -0
- package/out/Components/Decorator/Corners.luau +8 -3
- package/out/Components/Decorator/Gradient.d.ts +8 -0
- package/out/Components/Decorator/Gradient.luau +23 -0
- package/out/Components/Decorator/Padding.d.ts +3 -1
- package/out/Components/Decorator/Padding.luau +11 -6
- package/out/Components/Decorator/index.d.ts +1 -0
- package/out/Components/Decorator/init.luau +3 -0
- package/out/Components/Input/Button.d.ts +1 -0
- package/out/Components/Input/Button.luau +49 -34
- package/out/Components/Input/Checkbox.d.ts +1 -0
- package/out/Components/Input/Checkbox.luau +28 -18
- package/out/Components/Input/HoverButton.d.ts +1 -0
- package/out/Components/Input/HoverButton.luau +44 -42
- package/out/Components/Input/Increment.d.ts +1 -0
- package/out/Components/Input/Increment.luau +10 -3
- package/out/Components/Input/Input.d.ts +3 -1
- package/out/Components/Input/Input.luau +89 -68
- package/out/Components/Input/Select.d.ts +11 -1
- package/out/Components/Input/Select.luau +315 -39
- package/out/Components/Input/Slider.luau +44 -53
- package/out/Components/Input/Switch.d.ts +9 -0
- package/out/Components/Input/Switch.luau +145 -0
- package/out/Components/Input/index.d.ts +1 -0
- package/out/Components/Input/init.luau +3 -0
- package/out/Components/Interaction/Modal.d.ts +14 -0
- package/out/Components/Interaction/Modal.luau +262 -0
- package/out/Components/Interaction/Toast.d.ts +2 -1
- package/out/Components/Interaction/Toast.luau +53 -28
- package/out/Components/Interaction/Tooltip.luau +36 -25
- package/out/Components/Interaction/index.d.ts +1 -0
- package/out/Components/Interaction/init.luau +3 -0
- package/out/Components/Layout/Accordion.d.ts +1 -0
- package/out/Components/Layout/Accordion.luau +51 -55
- package/out/Components/Layout/Column.d.ts +1 -0
- package/out/Components/Layout/Column.luau +11 -6
- package/out/Components/Layout/Container.d.ts +3 -0
- package/out/Components/Layout/Container.luau +26 -17
- package/out/Components/Layout/Draggable.luau +25 -3
- package/out/Components/Layout/Fieldset.d.ts +1 -0
- package/out/Components/Layout/Fieldset.luau +14 -42
- package/out/Components/Layout/FlexItem.luau +7 -0
- package/out/Components/Layout/Grid.d.ts +10 -0
- package/out/Components/Layout/Grid.luau +172 -0
- package/out/Components/Layout/Group.d.ts +1 -0
- package/out/Components/Layout/Group.luau +48 -60
- package/out/Components/Layout/HStack.d.ts +4 -0
- package/out/Components/Layout/HStack.luau +17 -10
- package/out/Components/Layout/Pagination.d.ts +32 -0
- package/out/Components/Layout/Pagination.luau +400 -0
- package/out/Components/Layout/Row.d.ts +1 -0
- package/out/Components/Layout/Row.luau +20 -48
- package/out/Components/Layout/Scroller.d.ts +1 -0
- package/out/Components/Layout/Scroller.luau +26 -34
- package/out/Components/Layout/Table.d.ts +31 -0
- package/out/Components/Layout/Table.luau +342 -0
- package/out/Components/Layout/Tabs.d.ts +20 -10
- package/out/Components/Layout/Tabs.luau +113 -119
- package/out/Components/Layout/VStack.d.ts +3 -0
- package/out/Components/Layout/VStack.luau +17 -10
- package/out/Components/Layout/index.d.ts +3 -0
- package/out/Components/Layout/init.luau +9 -0
- package/out/Components/Navigation/Menu.d.ts +1 -0
- package/out/Components/Navigation/Menu.luau +12 -3
- package/out/Components/Surface/Box.d.ts +3 -1
- package/out/Components/Surface/Box.luau +15 -4
- package/out/Components/Surface/Card.d.ts +1 -0
- package/out/Components/Surface/Card.luau +56 -154
- package/out/Components/Surface/Icon.d.ts +1 -0
- package/out/Components/Surface/Icon.luau +25 -16
- package/out/Components/Surface/ProgressBar.d.ts +14 -0
- package/out/Components/Surface/ProgressBar.luau +230 -0
- package/out/Components/Surface/index.d.ts +1 -0
- package/out/Components/Surface/init.luau +3 -0
- package/out/Components/Typography/Text.d.ts +1 -0
- package/out/Components/Typography/Text.luau +57 -53
- package/out/Contexts/index.d.ts +1 -0
- package/out/Contexts/init.luau +3 -0
- package/out/Contexts/modal.context.d.ts +15 -0
- package/out/Contexts/modal.context.luau +23 -0
- package/out/Contexts/toast.context.d.ts +1 -0
- package/out/Helpers/color.helper.luau +28 -0
- package/out/Helpers/css.helper.d.ts +4 -1
- package/out/Helpers/css.helper.luau +76 -6
- package/out/Helpers/gui.helper.luau +0 -3
- package/out/Helpers/size.helper.luau +0 -2
- package/out/Helpers/spacing.helper.luau +0 -3
- package/out/Helpers/typography.helper.luau +0 -2
- package/out/Interfaces/css.types.d.ts +7 -0
- package/out/Interfaces/css.types.luau +0 -20
- package/out/Providers/app.provider.luau +2 -1
- package/out/Providers/index.d.ts +1 -0
- package/out/Providers/init.luau +3 -0
- package/out/Providers/modal.provider.d.ts +6 -0
- package/out/Providers/modal.provider.luau +86 -0
- package/out/Providers/overlay.provider.luau +1 -0
- package/out/Providers/registry.provider.luau +0 -2
- package/out/Theme/theme.style.d.ts +2 -1
- package/out/Theme/theme.template.d.ts +126 -1
- package/out/Theme/themes/dark.theme.luau +225 -0
- package/out/Theme/themes/default.theme.luau +210 -0
- package/out/Theme/themes/sandstone.theme.luau +173 -0
- package/out/Theme/themes/wooden.theme.luau +195 -0
- package/package.json +1 -1
|
@@ -10,8 +10,13 @@ local CssHelper = _Helpers.CssHelper
|
|
|
10
10
|
local TypographyHelper = _Helpers.TypographyHelper
|
|
11
11
|
local _Decorator = TS.import(script, script.Parent.Parent, "Decorator")
|
|
12
12
|
local Corners = _Decorator.Corners
|
|
13
|
+
local Gradient = _Decorator.Gradient
|
|
13
14
|
local Padding = _Decorator.Padding
|
|
14
|
-
local
|
|
15
|
+
local _Layout = TS.import(script, script.Parent.Parent, "Layout")
|
|
16
|
+
local FieldsetContext = _Layout.FieldsetContext
|
|
17
|
+
local FlexItem = _Layout.FlexItem
|
|
18
|
+
local HStack = _Layout.HStack
|
|
19
|
+
local Icon = TS.import(script, script.Parent.Parent, "Surface").Icon
|
|
15
20
|
local _Input_validation = TS.import(script, script.Parent, "Input.validation")
|
|
16
21
|
local resolveClampedText = _Input_validation.resolveClampedText
|
|
17
22
|
local resolveValidatedText = _Input_validation.resolveValidatedText
|
|
@@ -27,8 +32,6 @@ local function Input(props)
|
|
|
27
32
|
local value, setValue = useState(props.value)
|
|
28
33
|
local lastValidText = useRef(props.value)
|
|
29
34
|
local typography = TypographyHelper:getTypography(theme, props.scale, theme.components.input.typography)
|
|
30
|
-
-- Roblox's TextBox has no PlaceholderTransparency and shares font/size/weight/lineHeight
|
|
31
|
-
-- between Text and PlaceholderText, so only `.color` from this resolution is actually used below.
|
|
32
35
|
local placeholderTypography = TypographyHelper:getTypography(theme, props.scale, theme.components.input.placeholder)
|
|
33
36
|
local backgroundImage = CssHelper:resolveBackgroundImage(theme.components.input.backgroundImage)
|
|
34
37
|
React.useEffect(function()
|
|
@@ -45,7 +48,29 @@ local function Input(props)
|
|
|
45
48
|
return connection:Disconnect()
|
|
46
49
|
end
|
|
47
50
|
end, { labelActivated, ref })
|
|
51
|
+
local _attributes = {}
|
|
52
|
+
local _condition = props.name
|
|
53
|
+
if _condition == nil then
|
|
54
|
+
_condition = "Input"
|
|
55
|
+
end
|
|
56
|
+
_attributes.key = _condition
|
|
57
|
+
_attributes.Size = props.Size or UDim2.fromScale(1, 0)
|
|
58
|
+
_attributes.AutomaticSize = Enum.AutomaticSize.Y
|
|
59
|
+
_attributes.BackgroundTransparency = 1
|
|
60
|
+
_attributes.AnchorPoint = props.AnchorPoint
|
|
61
|
+
_attributes.Position = props.Position
|
|
62
|
+
_attributes.LayoutOrder = props.LayoutOrder
|
|
63
|
+
_attributes.Visible = props.Visible
|
|
64
|
+
_attributes.ZIndex = props.ZIndex
|
|
65
|
+
_attributes.Image = backgroundImage.Image
|
|
66
|
+
_attributes.ImageColor3 = backgroundImage.ImageColor3
|
|
67
|
+
_attributes.ImageTransparency = backgroundImage.ImageTransparency
|
|
68
|
+
_attributes.ScaleType = backgroundImage.ScaleType
|
|
69
|
+
_attributes.SliceCenter = backgroundImage.SliceCenter
|
|
70
|
+
_attributes.SliceScale = backgroundImage.SliceScale
|
|
71
|
+
_attributes.TileSize = backgroundImage.TileSize
|
|
48
72
|
local _exp = React.createElement("uistroke", {
|
|
73
|
+
key = "Stroke",
|
|
49
74
|
Thickness = theme.components.input.borderThickness,
|
|
50
75
|
BorderStrokePosition = Enum.BorderStrokePosition.Inner,
|
|
51
76
|
Color = theme.components.input.borderColor,
|
|
@@ -53,10 +78,19 @@ local function Input(props)
|
|
|
53
78
|
local _exp_1 = React.createElement(Corners, {
|
|
54
79
|
radius = theme.components.input.cornerRadius,
|
|
55
80
|
})
|
|
56
|
-
local
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
local _attributes_1 =
|
|
81
|
+
local _exp_2 = React.createElement(Gradient, {
|
|
82
|
+
value = theme.components.input.backgroundGradient,
|
|
83
|
+
})
|
|
84
|
+
local _attributes_1 = table.clone(props)
|
|
85
|
+
setmetatable(_attributes_1, nil)
|
|
86
|
+
local _exp_3 = React.createElement(Padding, _attributes_1)
|
|
87
|
+
local _exp_4 = props.icon ~= nil and (React.createElement(Icon, {
|
|
88
|
+
name = "InputIcon",
|
|
89
|
+
icon = props.icon,
|
|
90
|
+
color = theme.components.input.iconColor,
|
|
91
|
+
}))
|
|
92
|
+
local _attributes_2 = {
|
|
93
|
+
key = "TextBox",
|
|
60
94
|
ref = ref,
|
|
61
95
|
Size = UDim2.fromScale(1, 0),
|
|
62
96
|
BackgroundTransparency = 1,
|
|
@@ -65,52 +99,52 @@ local function Input(props)
|
|
|
65
99
|
FontFace = Font.fromName(typography.font.Name, typography.weight or Enum.FontWeight.Regular),
|
|
66
100
|
FontSize = typography.size,
|
|
67
101
|
}
|
|
68
|
-
local
|
|
69
|
-
if _condition == nil then
|
|
70
|
-
_condition = props.placeholder
|
|
71
|
-
end
|
|
72
|
-
_attributes_1.PlaceholderText = _condition
|
|
73
|
-
_attributes_1.PlaceholderColor3 = props.PlaceholderColor3 or placeholderTypography.color
|
|
74
|
-
_attributes_1.TextScaled = props.TextScaled
|
|
75
|
-
_attributes_1.LineHeight = typography.lineHeight
|
|
76
|
-
_attributes_1.Text = if props.controlled then props.value else value
|
|
77
|
-
_attributes_1.TextColor3 = props.TextColor3 or typography.color or theme.colors.intents.primary.default.textColor
|
|
78
|
-
local _condition_1 = props.TextTransparency
|
|
102
|
+
local _condition_1 = props.PlaceholderText
|
|
79
103
|
if _condition_1 == nil then
|
|
80
|
-
_condition_1 =
|
|
104
|
+
_condition_1 = props.placeholder
|
|
81
105
|
end
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
_attributes_1.Rotation = props.Rotation
|
|
90
|
-
_attributes_1.Selectable = props.Selectable
|
|
91
|
-
_attributes_1.SelectionImageObject = props.SelectionImageObject
|
|
92
|
-
_attributes_1.SizeConstraint = props.SizeConstraint
|
|
93
|
-
_attributes_1.Tag = props.Tag
|
|
94
|
-
_attributes_1.AutoLocalize = props.AutoLocalize
|
|
95
|
-
_attributes_1.RootLocalizationTable = props.RootLocalizationTable
|
|
96
|
-
_attributes_1.NextSelectionDown = props.NextSelectionDown
|
|
97
|
-
_attributes_1.NextSelectionLeft = props.NextSelectionLeft
|
|
98
|
-
_attributes_1.NextSelectionRight = props.NextSelectionRight
|
|
99
|
-
_attributes_1.NextSelectionUp = props.NextSelectionUp
|
|
100
|
-
_attributes_1.SelectionGroup = props.SelectionGroup
|
|
101
|
-
_attributes_1.SelectionOrder = props.SelectionOrder
|
|
102
|
-
local _condition_2 = props.ClearTextOnFocus
|
|
106
|
+
_attributes_2.PlaceholderText = _condition_1
|
|
107
|
+
_attributes_2.PlaceholderColor3 = props.PlaceholderColor3 or placeholderTypography.color
|
|
108
|
+
_attributes_2.TextScaled = props.TextScaled
|
|
109
|
+
_attributes_2.LineHeight = typography.lineHeight
|
|
110
|
+
_attributes_2.Text = if props.controlled then props.value else value
|
|
111
|
+
_attributes_2.TextColor3 = props.TextColor3 or typography.color or theme.colors.intents.primary.default.textColor
|
|
112
|
+
local _condition_2 = props.TextTransparency
|
|
103
113
|
if _condition_2 == nil then
|
|
104
|
-
_condition_2 =
|
|
114
|
+
_condition_2 = typography.transparency
|
|
115
|
+
end
|
|
116
|
+
_attributes_2.TextTransparency = _condition_2
|
|
117
|
+
_attributes_2.Active = props.Active
|
|
118
|
+
_attributes_2.Archivable = props.Archivable
|
|
119
|
+
_attributes_2.BorderColor3 = props.BorderColor3
|
|
120
|
+
_attributes_2.BorderMode = props.BorderMode
|
|
121
|
+
_attributes_2.BorderSizePixel = props.BorderSizePixel
|
|
122
|
+
_attributes_2.ClipsDescendants = props.ClipsDescendants
|
|
123
|
+
_attributes_2.Rotation = props.Rotation
|
|
124
|
+
_attributes_2.Selectable = props.Selectable
|
|
125
|
+
_attributes_2.SelectionImageObject = props.SelectionImageObject
|
|
126
|
+
_attributes_2.SizeConstraint = props.SizeConstraint
|
|
127
|
+
_attributes_2.Tag = props.Tag
|
|
128
|
+
_attributes_2.AutoLocalize = props.AutoLocalize
|
|
129
|
+
_attributes_2.RootLocalizationTable = props.RootLocalizationTable
|
|
130
|
+
_attributes_2.NextSelectionDown = props.NextSelectionDown
|
|
131
|
+
_attributes_2.NextSelectionLeft = props.NextSelectionLeft
|
|
132
|
+
_attributes_2.NextSelectionRight = props.NextSelectionRight
|
|
133
|
+
_attributes_2.NextSelectionUp = props.NextSelectionUp
|
|
134
|
+
_attributes_2.SelectionGroup = props.SelectionGroup
|
|
135
|
+
_attributes_2.SelectionOrder = props.SelectionOrder
|
|
136
|
+
local _condition_3 = props.ClearTextOnFocus
|
|
137
|
+
if _condition_3 == nil then
|
|
138
|
+
_condition_3 = false
|
|
105
139
|
end
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
140
|
+
_attributes_2.ClearTextOnFocus = _condition_3
|
|
141
|
+
_attributes_2.CursorPosition = props.CursorPosition
|
|
142
|
+
_attributes_2.MultiLine = props.MultiLine
|
|
143
|
+
_attributes_2.SelectionStart = props.SelectionStart
|
|
144
|
+
_attributes_2.ShowNativeInput = props.ShowNativeInput
|
|
145
|
+
_attributes_2.TextEditable = props.TextEditable
|
|
146
|
+
_attributes_2.TextTruncate = props.TextTruncate
|
|
147
|
+
_attributes_2.RichText = props.RichText
|
|
114
148
|
local _object = {}
|
|
115
149
|
local _spread = props.Event
|
|
116
150
|
if _spread then
|
|
@@ -137,7 +171,7 @@ local function Input(props)
|
|
|
137
171
|
end
|
|
138
172
|
end
|
|
139
173
|
end
|
|
140
|
-
|
|
174
|
+
_attributes_2.Event = _object
|
|
141
175
|
local _object_1 = {}
|
|
142
176
|
local _spread_1 = props.Change
|
|
143
177
|
if _spread_1 then
|
|
@@ -165,24 +199,11 @@ local function Input(props)
|
|
|
165
199
|
end
|
|
166
200
|
end
|
|
167
201
|
end
|
|
168
|
-
|
|
169
|
-
return React.createElement("imagelabel", {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
AnchorPoint = props.AnchorPoint,
|
|
174
|
-
Position = props.Position,
|
|
175
|
-
LayoutOrder = props.LayoutOrder,
|
|
176
|
-
Visible = props.Visible,
|
|
177
|
-
ZIndex = props.ZIndex,
|
|
178
|
-
Image = backgroundImage.Image,
|
|
179
|
-
ImageColor3 = backgroundImage.ImageColor3,
|
|
180
|
-
ImageTransparency = backgroundImage.ImageTransparency,
|
|
181
|
-
ScaleType = backgroundImage.ScaleType,
|
|
182
|
-
SliceCenter = backgroundImage.SliceCenter,
|
|
183
|
-
SliceScale = backgroundImage.SliceScale,
|
|
184
|
-
TileSize = backgroundImage.TileSize,
|
|
185
|
-
}, _exp, _exp_1, _exp_2, React.createElement("textbox", _attributes_1))
|
|
202
|
+
_attributes_2.Change = _object_1
|
|
203
|
+
return React.createElement("imagelabel", _attributes, _exp, _exp_1, _exp_2, _exp_3, React.createElement(HStack, {
|
|
204
|
+
valign = "Center",
|
|
205
|
+
Wraps = false,
|
|
206
|
+
}, _exp_4, React.createElement(FlexItem, nil, React.createElement("textbox", _attributes_2))))
|
|
186
207
|
end
|
|
187
208
|
return {
|
|
188
209
|
Input = Input,
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
|
-
import { CssSize, ScalableElementProps, SpacedElementProps } from "../../Interfaces";
|
|
2
|
+
import { CssBackgroundGradient, CssSize, ScalableElementProps, SpacedElementProps } from "../../Interfaces";
|
|
3
3
|
import { CssBackgroundImage } from "../../Theme";
|
|
4
4
|
export interface SelectProps extends ScalableElementProps, SpacedElementProps, React.InstanceProps<ImageLabel> {
|
|
5
5
|
selected?: number;
|
|
6
6
|
'max-height'?: CssSize;
|
|
7
7
|
backgroundImage?: CssBackgroundImage;
|
|
8
|
+
backgroundGradient?: CssBackgroundGradient;
|
|
8
9
|
onChange?: (selected: number, value?: string) => void;
|
|
10
|
+
name?: string;
|
|
11
|
+
searchable?: boolean;
|
|
12
|
+
searchPlaceholder?: string;
|
|
9
13
|
}
|
|
10
14
|
interface SelectOptionProps {
|
|
11
15
|
text?: string;
|
|
@@ -16,8 +20,14 @@ interface SelectOptionProps {
|
|
|
16
20
|
BackgroundColor3?: Color3;
|
|
17
21
|
}
|
|
18
22
|
declare function SelectOption(props: SelectOptionProps): React.JSX.Element;
|
|
23
|
+
interface SelectOptGroupProps {
|
|
24
|
+
label: string;
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
declare function SelectOptGroup(_props: SelectOptGroupProps): undefined;
|
|
19
28
|
type SelectComponent = React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<ImageLabel>> & {
|
|
20
29
|
Option: typeof SelectOption;
|
|
30
|
+
OptGroup: typeof SelectOptGroup;
|
|
21
31
|
};
|
|
22
32
|
declare const Select: SelectComponent;
|
|
23
33
|
export { Select };
|