@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.
Files changed (110) hide show
  1. package/out/Components/Chart/BarChart.d.ts +1 -0
  2. package/out/Components/Chart/BarChart.luau +149 -112
  3. package/out/Components/Chart/Pie.d.ts +1 -0
  4. package/out/Components/Chart/Pie.luau +21 -6
  5. package/out/Components/Decorator/BoxShadow.d.ts +1 -0
  6. package/out/Components/Decorator/BoxShadow.luau +12 -5
  7. package/out/Components/Decorator/Corners.d.ts +1 -0
  8. package/out/Components/Decorator/Corners.luau +8 -3
  9. package/out/Components/Decorator/Gradient.d.ts +8 -0
  10. package/out/Components/Decorator/Gradient.luau +23 -0
  11. package/out/Components/Decorator/Padding.d.ts +3 -1
  12. package/out/Components/Decorator/Padding.luau +11 -6
  13. package/out/Components/Decorator/index.d.ts +1 -0
  14. package/out/Components/Decorator/init.luau +3 -0
  15. package/out/Components/Input/Button.d.ts +1 -0
  16. package/out/Components/Input/Button.luau +49 -34
  17. package/out/Components/Input/Checkbox.d.ts +1 -0
  18. package/out/Components/Input/Checkbox.luau +28 -18
  19. package/out/Components/Input/HoverButton.d.ts +1 -0
  20. package/out/Components/Input/HoverButton.luau +44 -42
  21. package/out/Components/Input/Increment.d.ts +1 -0
  22. package/out/Components/Input/Increment.luau +10 -3
  23. package/out/Components/Input/Input.d.ts +3 -1
  24. package/out/Components/Input/Input.luau +89 -68
  25. package/out/Components/Input/Select.d.ts +11 -1
  26. package/out/Components/Input/Select.luau +315 -39
  27. package/out/Components/Input/Slider.luau +44 -53
  28. package/out/Components/Input/Switch.d.ts +9 -0
  29. package/out/Components/Input/Switch.luau +145 -0
  30. package/out/Components/Input/index.d.ts +1 -0
  31. package/out/Components/Input/init.luau +3 -0
  32. package/out/Components/Interaction/Modal.d.ts +14 -0
  33. package/out/Components/Interaction/Modal.luau +262 -0
  34. package/out/Components/Interaction/Toast.d.ts +2 -1
  35. package/out/Components/Interaction/Toast.luau +53 -28
  36. package/out/Components/Interaction/Tooltip.luau +36 -25
  37. package/out/Components/Interaction/index.d.ts +1 -0
  38. package/out/Components/Interaction/init.luau +3 -0
  39. package/out/Components/Layout/Accordion.d.ts +1 -0
  40. package/out/Components/Layout/Accordion.luau +51 -55
  41. package/out/Components/Layout/Column.d.ts +1 -0
  42. package/out/Components/Layout/Column.luau +11 -6
  43. package/out/Components/Layout/Container.d.ts +3 -0
  44. package/out/Components/Layout/Container.luau +26 -17
  45. package/out/Components/Layout/Draggable.luau +25 -3
  46. package/out/Components/Layout/Fieldset.d.ts +1 -0
  47. package/out/Components/Layout/Fieldset.luau +14 -42
  48. package/out/Components/Layout/FlexItem.luau +7 -0
  49. package/out/Components/Layout/Grid.d.ts +10 -0
  50. package/out/Components/Layout/Grid.luau +172 -0
  51. package/out/Components/Layout/Group.d.ts +1 -0
  52. package/out/Components/Layout/Group.luau +48 -60
  53. package/out/Components/Layout/HStack.d.ts +4 -0
  54. package/out/Components/Layout/HStack.luau +17 -10
  55. package/out/Components/Layout/Pagination.d.ts +32 -0
  56. package/out/Components/Layout/Pagination.luau +400 -0
  57. package/out/Components/Layout/Row.d.ts +1 -0
  58. package/out/Components/Layout/Row.luau +20 -48
  59. package/out/Components/Layout/Scroller.d.ts +1 -0
  60. package/out/Components/Layout/Scroller.luau +26 -34
  61. package/out/Components/Layout/Table.d.ts +31 -0
  62. package/out/Components/Layout/Table.luau +342 -0
  63. package/out/Components/Layout/Tabs.d.ts +20 -10
  64. package/out/Components/Layout/Tabs.luau +113 -119
  65. package/out/Components/Layout/VStack.d.ts +3 -0
  66. package/out/Components/Layout/VStack.luau +17 -10
  67. package/out/Components/Layout/index.d.ts +3 -0
  68. package/out/Components/Layout/init.luau +9 -0
  69. package/out/Components/Navigation/Menu.d.ts +1 -0
  70. package/out/Components/Navigation/Menu.luau +12 -3
  71. package/out/Components/Surface/Box.d.ts +3 -1
  72. package/out/Components/Surface/Box.luau +15 -4
  73. package/out/Components/Surface/Card.d.ts +1 -0
  74. package/out/Components/Surface/Card.luau +56 -154
  75. package/out/Components/Surface/Icon.d.ts +1 -0
  76. package/out/Components/Surface/Icon.luau +25 -16
  77. package/out/Components/Surface/ProgressBar.d.ts +14 -0
  78. package/out/Components/Surface/ProgressBar.luau +230 -0
  79. package/out/Components/Surface/index.d.ts +1 -0
  80. package/out/Components/Surface/init.luau +3 -0
  81. package/out/Components/Typography/Text.d.ts +1 -0
  82. package/out/Components/Typography/Text.luau +57 -53
  83. package/out/Contexts/index.d.ts +1 -0
  84. package/out/Contexts/init.luau +3 -0
  85. package/out/Contexts/modal.context.d.ts +15 -0
  86. package/out/Contexts/modal.context.luau +23 -0
  87. package/out/Contexts/toast.context.d.ts +1 -0
  88. package/out/Helpers/color.helper.luau +28 -0
  89. package/out/Helpers/css.helper.d.ts +4 -1
  90. package/out/Helpers/css.helper.luau +76 -6
  91. package/out/Helpers/gui.helper.luau +0 -3
  92. package/out/Helpers/size.helper.luau +0 -2
  93. package/out/Helpers/spacing.helper.luau +0 -3
  94. package/out/Helpers/typography.helper.luau +0 -2
  95. package/out/Interfaces/css.types.d.ts +7 -0
  96. package/out/Interfaces/css.types.luau +0 -20
  97. package/out/Providers/app.provider.luau +2 -1
  98. package/out/Providers/index.d.ts +1 -0
  99. package/out/Providers/init.luau +3 -0
  100. package/out/Providers/modal.provider.d.ts +6 -0
  101. package/out/Providers/modal.provider.luau +86 -0
  102. package/out/Providers/overlay.provider.luau +1 -0
  103. package/out/Providers/registry.provider.luau +0 -2
  104. package/out/Theme/theme.style.d.ts +2 -1
  105. package/out/Theme/theme.template.d.ts +126 -1
  106. package/out/Theme/themes/dark.theme.luau +225 -0
  107. package/out/Theme/themes/default.theme.luau +210 -0
  108. package/out/Theme/themes/sandstone.theme.luau +173 -0
  109. package/out/Theme/themes/wooden.theme.luau +195 -0
  110. 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 FieldsetContext = TS.import(script, script.Parent.Parent, "Layout").FieldsetContext
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 _attributes = table.clone(props)
57
- setmetatable(_attributes, nil)
58
- local _exp_2 = React.createElement(Padding, _attributes)
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 _condition = props.PlaceholderText
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 = typography.transparency
104
+ _condition_1 = props.placeholder
81
105
  end
82
- _attributes_1.TextTransparency = _condition_1
83
- _attributes_1.Active = props.Active
84
- _attributes_1.Archivable = props.Archivable
85
- _attributes_1.BorderColor3 = props.BorderColor3
86
- _attributes_1.BorderMode = props.BorderMode
87
- _attributes_1.BorderSizePixel = props.BorderSizePixel
88
- _attributes_1.ClipsDescendants = props.ClipsDescendants
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 = false
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
- _attributes_1.ClearTextOnFocus = _condition_2
107
- _attributes_1.CursorPosition = props.CursorPosition
108
- _attributes_1.MultiLine = props.MultiLine
109
- _attributes_1.SelectionStart = props.SelectionStart
110
- _attributes_1.ShowNativeInput = props.ShowNativeInput
111
- _attributes_1.TextEditable = props.TextEditable
112
- _attributes_1.TextTruncate = props.TextTruncate
113
- _attributes_1.RichText = props.RichText
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
- _attributes_1.Event = _object
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
- _attributes_1.Change = _object_1
169
- return React.createElement("imagelabel", {
170
- Size = props.Size or UDim2.fromScale(1, 0),
171
- AutomaticSize = Enum.AutomaticSize.Y,
172
- BackgroundTransparency = 1,
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 };