@rbxts/react-clean-ui 1.0.38 → 1.2.2

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