@rbxts/react-clean-ui 1.0.19 → 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.
Files changed (99) hide show
  1. package/out/Components/Chart/BarChart.d.ts +47 -0
  2. package/out/Components/Chart/BarChart.luau +880 -0
  3. package/out/Components/Chart/Pie.luau +12 -12
  4. package/out/Components/Chart/index.d.ts +1 -0
  5. package/out/Components/Chart/init.luau +3 -0
  6. package/out/Components/Input/Button.d.ts +9 -0
  7. package/out/Components/Input/Button.luau +155 -46
  8. package/out/Components/Input/Checkbox.luau +21 -5
  9. package/out/Components/Input/Increment.d.ts +11 -0
  10. package/out/Components/Input/Increment.luau +107 -0
  11. package/out/Components/Input/Increment.step.d.ts +1 -0
  12. package/out/Components/Input/Increment.step.luau +25 -0
  13. package/out/Components/Input/Input.d.ts +4 -3
  14. package/out/Components/Input/Input.luau +124 -17
  15. package/out/Components/Input/Input.validation.d.ts +3 -0
  16. package/out/Components/Input/Input.validation.luau +21 -0
  17. package/out/Components/Input/Select.d.ts +4 -3
  18. package/out/Components/Input/Select.luau +23 -18
  19. package/out/Components/Input/Slider.d.ts +1 -1
  20. package/out/Components/Input/Slider.luau +68 -34
  21. package/out/Components/Input/index.d.ts +1 -0
  22. package/out/Components/Input/init.luau +3 -0
  23. package/out/Components/Interaction/Toast.d.ts +1 -1
  24. package/out/Components/Interaction/Toast.luau +4 -4
  25. package/out/Components/Interaction/Tooltip.d.ts +1 -1
  26. package/out/Components/Interaction/Tooltip.luau +8 -1
  27. package/out/Components/Layout/Accordion.d.ts +34 -0
  28. package/out/Components/Layout/Accordion.luau +431 -0
  29. package/out/Components/Layout/Container.d.ts +4 -2
  30. package/out/Components/Layout/Container.luau +32 -7
  31. package/out/Components/Layout/Draggable.luau +1 -1
  32. package/out/Components/Layout/Fieldset.d.ts +1 -1
  33. package/out/Components/Layout/FlexItem.d.ts +2 -1
  34. package/out/Components/Layout/FlexItem.luau +1 -0
  35. package/out/Components/Layout/HStack.d.ts +2 -1
  36. package/out/Components/Layout/HStack.luau +1 -2
  37. package/out/Components/Layout/Scroller.d.ts +1 -0
  38. package/out/Components/Layout/Scroller.luau +1 -1
  39. package/out/Components/Layout/Tabs.d.ts +1 -1
  40. package/out/Components/Layout/Tabs.luau +37 -7
  41. package/out/Components/Layout/VStack.d.ts +4 -1
  42. package/out/Components/Layout/VStack.luau +2 -2
  43. package/out/Components/Layout/index.d.ts +1 -0
  44. package/out/Components/Layout/init.luau +3 -0
  45. package/out/Components/Navigation/Menu.d.ts +1 -1
  46. package/out/Components/Surface/Box.d.ts +5 -3
  47. package/out/Components/Surface/Box.luau +12 -3
  48. package/out/Components/Surface/Card.d.ts +8 -6
  49. package/out/Components/Surface/Card.luau +430 -26
  50. package/out/Components/Surface/Icon.d.ts +1 -1
  51. package/out/Components/Surface/Icon.luau +43 -4
  52. package/out/Components/Typography/Text.d.ts +1 -0
  53. package/out/Components/Typography/Text.luau +135 -13
  54. package/out/Contexts/row.context.d.ts +1 -1
  55. package/out/Contexts/theme.context.d.ts +2 -2
  56. package/out/Helpers/color.helper.d.ts +5 -3
  57. package/out/Helpers/color.helper.luau +62 -34
  58. package/out/Helpers/create-ui-story.d.ts +8 -6
  59. package/out/Helpers/create-ui-story.luau +48 -5
  60. package/out/Helpers/css.helper.d.ts +28 -2
  61. package/out/Helpers/css.helper.luau +208 -0
  62. package/out/Helpers/index.d.ts +1 -0
  63. package/out/Helpers/init.luau +3 -0
  64. package/out/Helpers/size.helper.d.ts +3 -1
  65. package/out/Helpers/size.helper.luau +10 -9
  66. package/out/Helpers/spacing.helper.d.ts +3 -3
  67. package/out/Helpers/typography.helper.d.ts +2 -2
  68. package/out/Interfaces/css.types.d.ts +28 -0
  69. package/out/Interfaces/css.types.luau +17 -0
  70. package/out/Interfaces/element.props.d.ts +61 -0
  71. package/out/Interfaces/element.props.luau +1 -0
  72. package/out/Interfaces/index.d.ts +4 -2
  73. package/out/Interfaces/init.luau +9 -3
  74. package/out/Interfaces/responsive.types.d.ts +26 -0
  75. package/out/Interfaces/semantics.d.ts +3 -0
  76. package/out/Interfaces/semantics.luau +2 -0
  77. package/out/Providers/app.provider.d.ts +2 -2
  78. package/out/Providers/theme.provider.d.ts +2 -2
  79. package/out/Theme/index.d.ts +1 -0
  80. package/out/Theme/theme.factory.d.ts +3 -3
  81. package/out/Theme/theme.style.d.ts +48 -0
  82. package/out/Theme/theme.style.luau +1 -0
  83. package/out/Theme/theme.template.d.ts +90 -36
  84. package/out/Theme/themes/dark.theme.d.ts +1 -1
  85. package/out/Theme/themes/dark.theme.luau +73 -1
  86. package/out/Theme/themes/default.theme.d.ts +2 -2
  87. package/out/Theme/themes/default.theme.luau +122 -12
  88. package/out/Theme/themes/index.d.ts +1 -0
  89. package/out/Theme/themes/init.luau +3 -0
  90. package/out/Theme/themes/sandstone.theme.d.ts +1 -1
  91. package/out/Theme/themes/sandstone.theme.luau +81 -10
  92. package/out/Theme/themes/wooden.theme.d.ts +1 -0
  93. package/out/Theme/themes/wooden.theme.luau +443 -0
  94. package/out/index.d.ts +8 -8
  95. package/package.json +20 -6
  96. package/out/Interfaces/clean.element.props.d.ts +0 -114
  97. /package/out/{Interfaces/userinput.d.ts → Helpers/input.helper.d.ts} +0 -0
  98. /package/out/{Interfaces/userinput.luau → Helpers/input.helper.luau} +0 -0
  99. /package/out/Interfaces/{clean.element.props.luau → responsive.types.luau} +0 -0
@@ -5,11 +5,14 @@ local React = _react
5
5
  local useRef = _react.useRef
6
6
  local useState = _react.useState
7
7
  local CleanThemeContext = TS.import(script, script.Parent.Parent.Parent, "Contexts").CleanThemeContext
8
- local TypographyHelper = TS.import(script, script.Parent.Parent.Parent, "Helpers").TypographyHelper
8
+ local _Helpers = TS.import(script, script.Parent.Parent.Parent, "Helpers")
9
+ local CssHelper = _Helpers.CssHelper
10
+ local TypographyHelper = _Helpers.TypographyHelper
9
11
  local _Decorator = TS.import(script, script.Parent.Parent, "Decorator")
10
12
  local Corners = _Decorator.Corners
11
13
  local Padding = _Decorator.Padding
12
14
  local FieldsetContext = TS.import(script, script.Parent.Parent, "Layout").FieldsetContext
15
+ local resolveValidatedText = TS.import(script, script.Parent, "Input.validation").resolveValidatedText
13
16
  local function Input(props)
14
17
  local theme = React.useContext(CleanThemeContext)
15
18
  local fieldset = React.useContext(FieldsetContext)
@@ -20,7 +23,12 @@ local function Input(props)
20
23
  local labelActivated = _labelActivated
21
24
  local ref = useRef()
22
25
  local value, setValue = useState(props.value)
26
+ local lastValidText = useRef(props.value)
23
27
  local typography = TypographyHelper:getTypography(theme, props.scale, theme.components.input.typography)
28
+ -- Roblox's TextBox has no PlaceholderTransparency and shares font/size/weight/lineHeight
29
+ -- between Text and PlaceholderText, so only `.color` from this resolution is actually used below.
30
+ local placeholderTypography = TypographyHelper:getTypography(theme, props.scale, theme.components.input.placeholder)
31
+ local backgroundImage = CssHelper:resolveBackgroundImage(theme.components.input.backgroundImage)
24
32
  React.useEffect(function()
25
33
  if not labelActivated then
26
34
  return nil
@@ -60,31 +68,130 @@ local function Input(props)
60
68
  _condition = props.placeholder
61
69
  end
62
70
  _attributes_1.PlaceholderText = _condition
63
- _attributes_1.PlaceholderColor3 = props.PlaceholderColor3
71
+ _attributes_1.PlaceholderColor3 = props.PlaceholderColor3 or placeholderTypography.color
64
72
  _attributes_1.TextScaled = props.TextScaled
65
73
  _attributes_1.LineHeight = typography.lineHeight
66
74
  _attributes_1.Text = if props.controlled then props.value else value
67
- _attributes_1.TextColor3 = props.TextColor3 or theme.colors.intents.primary.default.textColor
68
- _attributes_1.ClearTextOnFocus = false
69
- _attributes_1.Event = props.Event
70
- _attributes_1.Change = {
71
- Text = function(rbx)
75
+ _attributes_1.TextColor3 = props.TextColor3 or typography.color or theme.colors.intents.primary.default.textColor
76
+ local _condition_1 = props.TextTransparency
77
+ if _condition_1 == nil then
78
+ _condition_1 = typography.transparency
79
+ 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
101
+ if _condition_2 == nil then
102
+ _condition_2 = false
103
+ 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
112
+ local _object = {}
113
+ local _spread = props.Event
114
+ if _spread then
115
+ for _k, _v in _spread do
116
+ _object[_k] = _v
117
+ end
118
+ end
119
+ _object.FocusLost = function(rbx, enterPressed, inputThatCausedFocusLoss)
120
+ if props.validation == "Number" or props.validation == "Int" then
72
121
  local number = tonumber(rbx.Text)
73
- if (props.validation == "Number" or props.validation == "Int") and number == nil and rbx.Text ~= "" and rbx.Text ~= "-" then
74
- ref.current.Text = props.value
75
- return nil
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
76
140
  end
77
- setValue(rbx.Text)
78
- local _result = props.onChange
141
+ end
142
+ local _result = props.Event
143
+ if _result ~= nil then
144
+ _result = _result.FocusLost
79
145
  if _result ~= nil then
80
- _result(rbx.Text)
146
+ _result(rbx, enterPressed, inputThatCausedFocusLoss)
81
147
  end
82
- end,
83
- }
84
- return React.createElement("frame", {
85
- Size = UDim2.fromScale(1, 0),
148
+ end
149
+ end
150
+ _attributes_1.Event = _object
151
+ local _object_1 = {}
152
+ local _spread_1 = props.Change
153
+ if _spread_1 then
154
+ for _k, _v in _spread_1 do
155
+ _object_1[_k] = _v
156
+ end
157
+ end
158
+ _object_1.Text = function(rbx)
159
+ local resolved = resolveValidatedText(props.validation, rbx.Text, lastValidText.current)
160
+ if resolved ~= rbx.Text then
161
+ ref.current.Text = resolved
162
+ return nil
163
+ end
164
+ lastValidText.current = rbx.Text
165
+ setValue(rbx.Text)
166
+ local _result = props.onChange
167
+ if _result ~= nil then
168
+ _result(rbx.Text)
169
+ end
170
+ local _result_1 = props.Change
171
+ if _result_1 ~= nil then
172
+ _result_1 = _result_1.Text
173
+ if _result_1 ~= nil then
174
+ _result_1(rbx)
175
+ end
176
+ end
177
+ end
178
+ _attributes_1.Change = _object_1
179
+ return React.createElement("imagelabel", {
180
+ Size = props.Size or UDim2.fromScale(1, 0),
86
181
  AutomaticSize = Enum.AutomaticSize.Y,
87
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,
88
195
  }, _exp, _exp_1, _exp_2, React.createElement("textbox", _attributes_1))
89
196
  end
90
197
  return {
@@ -0,0 +1,3 @@
1
+ import { InputProps } from "./Input";
2
+ export declare const CHARACTER_ALLOW_LIST_PATTERNS: Partial<Record<NonNullable<InputProps["validation"]>, string>>;
3
+ export declare function resolveValidatedText(validation: InputProps["validation"], candidateText: string, lastValidText: string): string;
@@ -0,0 +1,21 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local CHARACTER_ALLOW_LIST_PATTERNS = {
3
+ Telephone = "^[%d%+%-%s%(%)]*$",
4
+ Alphanumeric = "^[%w]*$",
5
+ Email = "^[%w@%._%-+]*$",
6
+ }
7
+ local function resolveValidatedText(validation, candidateText, lastValidText)
8
+ local number = tonumber(candidateText)
9
+ if (validation == "Number" or validation == "Int") and number == nil and candidateText ~= "" and candidateText ~= "-" then
10
+ return lastValidText
11
+ end
12
+ local allowedPattern = CHARACTER_ALLOW_LIST_PATTERNS[validation or "None"]
13
+ if allowedPattern ~= nil and (string.match(candidateText, allowedPattern)) == nil then
14
+ return lastValidText
15
+ end
16
+ return candidateText
17
+ end
18
+ return {
19
+ resolveValidatedText = resolveValidatedText,
20
+ CHARACTER_ALLOW_LIST_PATTERNS = CHARACTER_ALLOW_LIST_PATTERNS,
21
+ }
@@ -1,10 +1,11 @@
1
1
  import React from "@rbxts/react";
2
2
  import { CssSize, ScalableElementProps, SpacedElementProps } from "../../Interfaces";
3
- interface SelectProps extends ScalableElementProps, SpacedElementProps, React.InstanceProps<TextBox> {
3
+ import { CssBackgroundImage } from "../../Theme";
4
+ export interface SelectProps extends ScalableElementProps, SpacedElementProps, React.InstanceProps<ImageLabel> {
4
5
  selected?: number;
5
6
  'max-height'?: CssSize;
7
+ backgroundImage?: CssBackgroundImage;
6
8
  onChange?: (selected: number, value?: string) => void;
7
- Event?: React.InstanceEvent<TextBox>;
8
9
  }
9
10
  interface SelectOptionProps {
10
11
  text?: string;
@@ -15,7 +16,7 @@ interface SelectOptionProps {
15
16
  BackgroundColor3?: Color3;
16
17
  }
17
18
  declare function SelectOption(props: SelectOptionProps): React.JSX.Element;
18
- type SelectComponent = React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<Frame>> & {
19
+ type SelectComponent = React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<ImageLabel>> & {
19
20
  Option: typeof SelectOption;
20
21
  };
21
22
  declare const Select: SelectComponent;
@@ -161,6 +161,15 @@ local Select = React.forwardRef(function(props, ref)
161
161
  if open and overlay.overlay == nil then
162
162
  warn("You have used a Select component without using the Overlay Provider")
163
163
  end
164
+ local _attributes = {
165
+ ref = ref,
166
+ }
167
+ for _k, _v in props do
168
+ _attributes[_k] = _v
169
+ end
170
+ _attributes.Size = UDim2.fromScale(1, 0)
171
+ _attributes.AutomaticSize = Enum.AutomaticSize.Y
172
+ _attributes.backgroundImage = props.backgroundImage or theme.components.select.backgroundImage
164
173
  local _exp_1 = React.createElement("uistroke", {
165
174
  Thickness = theme.components.select.borderThickness,
166
175
  BorderStrokePosition = Enum.BorderStrokePosition.Inner,
@@ -169,10 +178,10 @@ local Select = React.forwardRef(function(props, ref)
169
178
  local _exp_2 = React.createElement(Corners, {
170
179
  radius = theme.components.select.cornerRadius,
171
180
  })
172
- local _attributes = table.clone(props)
173
- setmetatable(_attributes, nil)
174
- local _exp_3 = React.createElement(Padding, _attributes)
175
- local _attributes_1 = {}
181
+ local _attributes_1 = table.clone(props)
182
+ setmetatable(_attributes_1, nil)
183
+ local _exp_3 = React.createElement(Padding, _attributes_1)
184
+ local _attributes_2 = {}
176
185
  local _result_1 = selectedOption
177
186
  if _result_1 ~= nil then
178
187
  _result_1 = _result_1.props.text
@@ -181,25 +190,25 @@ local Select = React.forwardRef(function(props, ref)
181
190
  if _condition_1 == nil then
182
191
  _condition_1 = "No Options"
183
192
  end
184
- _attributes_1.text = _condition_1
185
- _attributes_1.typography = typography
186
- local _exp_4 = React.createElement(HStack, nil, React.createElement(FlexItem, nil, React.createElement(Text, _attributes_1)), React.createElement(Icon, {
193
+ _attributes_2.text = _condition_1
194
+ _attributes_2.typography = typography
195
+ local _exp_4 = React.createElement(HStack, nil, React.createElement(FlexItem, nil, React.createElement(Text, _attributes_2)), React.createElement(Icon, {
187
196
  icon = "caret-down",
188
197
  color = theme.colors.intents.primary.default.textColor,
189
198
  }))
190
199
  local _condition_2 = open and overlay.overlay ~= nil
191
200
  if _condition_2 then
192
- local _attributes_2 = {
201
+ local _attributes_3 = {
193
202
  BackgroundTransparency = 0,
194
203
  BackgroundColor3 = theme.components.select.dropDownBackgroundColor,
195
204
  AnchorPoint = Vector2.zero,
196
205
  }
197
206
  local _uDim2 = UDim2.new(0, 0, 0, dropdownSize.Y.Offset)
198
- _attributes_2.Position = dropdownPosition + _uDim2
199
- _attributes_2.Size = UDim2.fromOffset(dropdownSize.X.Offset, 0)
200
- _attributes_2.AutomaticSize = Enum.AutomaticSize.Y
201
- _attributes_2.ClipsDescendants = true
202
- _condition_2 = ReactRoblox.createPortal(React.createElement("frame", _attributes_2, React.createElement("uistroke", {
207
+ _attributes_3.Position = dropdownPosition + _uDim2
208
+ _attributes_3.Size = UDim2.fromOffset(dropdownSize.X.Offset, 0)
209
+ _attributes_3.AutomaticSize = Enum.AutomaticSize.Y
210
+ _attributes_3.ClipsDescendants = true
211
+ _condition_2 = ReactRoblox.createPortal(React.createElement("frame", _attributes_3, React.createElement("uistroke", {
203
212
  Thickness = theme.components.select.borderThickness,
204
213
  BorderStrokePosition = Enum.BorderStrokePosition.Outer,
205
214
  Color = theme.components.select.borderColor,
@@ -226,11 +235,7 @@ local Select = React.forwardRef(function(props, ref)
226
235
  })
227
236
  end)))), overlay.overlay)
228
237
  end
229
- return React.createElement(Container, {
230
- ref = ref,
231
- Size = UDim2.fromScale(1, 0),
232
- AutomaticSize = Enum.AutomaticSize.Y,
233
- }, React.createElement(SelectContext.Provider, {
238
+ return React.createElement(Container, _attributes, React.createElement(SelectContext.Provider, {
234
239
  value = context,
235
240
  }, React.createElement("imagebutton", {
236
241
  ref = buttonRef,
@@ -2,7 +2,7 @@ import React from "@rbxts/react";
2
2
  import { ContainerProps } from "../Layout";
3
3
  type SliderValue = number | Vector2;
4
4
  type HighlightOption = "start" | "end" | "middle";
5
- export interface SliderProps extends ContainerProps {
5
+ export interface SliderProps extends Omit<ContainerProps, keyof React.InstanceProps<ImageLabel>>, React.InstanceProps<Frame> {
6
6
  "max-value": number;
7
7
  "min-value"?: number;
8
8
  value?: SliderValue;
@@ -1,7 +1,7 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
2
  local TS = _G[script]
3
3
  local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
- local CustomInputService = TS.import(script, script.Parent.Parent.Parent, "Interfaces").CustomInputService
4
+ local CustomInputService = TS.import(script, script.Parent.Parent.Parent, "Helpers").CustomInputService
5
5
  local CleanThemeContext = TS.import(script, script.Parent.Parent.Parent, "Contexts").CleanThemeContext
6
6
  local SizeHelper = TS.import(script, script.Parent.Parent.Parent, "Helpers").SizeHelper
7
7
  local BoxShadow = TS.import(script, script.Parent.Parent, "Decorator").BoxShadow
@@ -248,6 +248,44 @@ local Slider = React.forwardRef(function(props, ref)
248
248
  }
249
249
  table.insert(handles, _arg0)
250
250
  end
251
+ local _attributes = {
252
+ ref = ref,
253
+ Archivable = props.Archivable,
254
+ Tag = props.Tag,
255
+ Active = props.Active,
256
+ AnchorPoint = SizeHelper:GetAnchor(props),
257
+ BackgroundColor3 = props.BackgroundColor3,
258
+ }
259
+ local _condition_1 = props.BackgroundTransparency
260
+ if _condition_1 == nil then
261
+ _condition_1 = 1
262
+ end
263
+ _attributes.BackgroundTransparency = _condition_1
264
+ _attributes.BorderColor3 = props.BorderColor3
265
+ _attributes.BorderMode = props.BorderMode
266
+ _attributes.BorderSizePixel = props.BorderSizePixel
267
+ _attributes.ClipsDescendants = props.ClipsDescendants
268
+ _attributes.Interactable = props.Interactable
269
+ _attributes.LayoutOrder = props.LayoutOrder
270
+ _attributes.NextSelectionDown = props.NextSelectionDown
271
+ _attributes.NextSelectionLeft = props.NextSelectionLeft
272
+ _attributes.NextSelectionRight = props.NextSelectionRight
273
+ _attributes.NextSelectionUp = props.NextSelectionUp
274
+ _attributes.Position = SizeHelper:GetPosition(props)
275
+ _attributes.Rotation = props.Rotation
276
+ _attributes.Selectable = props.Selectable
277
+ _attributes.SelectionGroup = props.SelectionGroup
278
+ _attributes.SelectionImageObject = props.SelectionImageObject
279
+ _attributes.SelectionOrder = props.SelectionOrder
280
+ _attributes.Size = SizeHelper:GetSize(props, UDim2.new(UDim.new(1, 0), height))
281
+ _attributes.SizeConstraint = props.SizeConstraint
282
+ _attributes.Visible = props.Visible
283
+ _attributes.ZIndex = props.ZIndex
284
+ _attributes.AutoLocalize = props.AutoLocalize
285
+ _attributes.RootLocalizationTable = props.RootLocalizationTable
286
+ _attributes.Style = props.Style
287
+ _attributes.Change = props.Change
288
+ _attributes.Event = props.Event
251
289
  local _exp = React.createElement("frame", {
252
290
  Size = UDim2.new(UDim.new(1, 0), SizeHelper:toUDim(theme.bar.height)),
253
291
  Position = UDim2.fromScale(0.5, 0.5),
@@ -260,18 +298,18 @@ local Slider = React.forwardRef(function(props, ref)
260
298
  }), React.createElement("uicorner", {
261
299
  CornerRadius = SizeHelper:toUDim(theme.bar.cornerRadius),
262
300
  }))
263
- local _attributes = {
301
+ local _attributes_1 = {
264
302
  ref = containerRef,
265
303
  }
266
304
  local _exp_1 = UDim2.fromScale(1, 1)
267
305
  local _uDim2 = UDim2.new(padding + padding, UDim.new(0, 0))
268
- _attributes.Size = _exp_1 - _uDim2
269
- _attributes.BackgroundTransparency = 1
270
- _attributes.Position = UDim2.fromScale(0.5, 0.5)
271
- _attributes.AnchorPoint = Vector2.new(0.5, 0.5)
272
- local _condition_1 = props.highlight ~= nil
273
- if _condition_1 then
274
- local _attributes_1 = {
306
+ _attributes_1.Size = _exp_1 - _uDim2
307
+ _attributes_1.BackgroundTransparency = 1
308
+ _attributes_1.Position = UDim2.fromScale(0.5, 0.5)
309
+ _attributes_1.AnchorPoint = Vector2.new(0.5, 0.5)
310
+ local _condition_2 = props.highlight ~= nil
311
+ if _condition_2 then
312
+ local _attributes_2 = {
275
313
  BackgroundColor3 = theme.bar.highlight.backgroundColor,
276
314
  BackgroundTransparency = theme.bar.highlight.backgroundTransparency,
277
315
  }
@@ -291,8 +329,8 @@ local Slider = React.forwardRef(function(props, ref)
291
329
  end
292
330
  _result = _result_1
293
331
  end
294
- _attributes_1.Position = _result
295
- _attributes_1.AnchorPoint = if props.highlight == "end" then Vector2.new(1, 0.5) else Vector2.new(0, 0.5)
332
+ _attributes_2.Position = _result
333
+ _attributes_2.AnchorPoint = if props.highlight == "end" then Vector2.new(1, 0.5) else Vector2.new(0, 0.5)
296
334
  local _result_1
297
335
  if props.highlight == "start" then
298
336
  local _uDim2_1 = UDim2.new(UDim.new(firstPosition, 0), SizeHelper:toUDim(theme.bar.height))
@@ -301,24 +339,24 @@ local Slider = React.forwardRef(function(props, ref)
301
339
  else
302
340
  local _result_2
303
341
  if props.highlight == "end" then
304
- local _condition_2 = secondPosition
305
- if _condition_2 == nil then
306
- _condition_2 = firstPosition
342
+ local _condition_3 = secondPosition
343
+ if _condition_3 == nil then
344
+ _condition_3 = firstPosition
307
345
  end
308
- local _uDim2_1 = UDim2.new(UDim.new(1 - _condition_2, 0), SizeHelper:toUDim(theme.bar.height))
346
+ local _uDim2_1 = UDim2.new(UDim.new(1 - _condition_3, 0), SizeHelper:toUDim(theme.bar.height))
309
347
  local _uDim2_2 = UDim2.new(padding, UDim.new(0, 0))
310
348
  _result_2 = _uDim2_1 + _uDim2_2
311
349
  else
312
- local _condition_2 = secondPosition
313
- if _condition_2 == nil then
314
- _condition_2 = 0
350
+ local _condition_3 = secondPosition
351
+ if _condition_3 == nil then
352
+ _condition_3 = 0
315
353
  end
316
- _result_2 = UDim2.new(UDim.new(_condition_2 - firstPosition, 0), SizeHelper:toUDim(theme.bar.height))
354
+ _result_2 = UDim2.new(UDim.new(_condition_3 - firstPosition, 0), SizeHelper:toUDim(theme.bar.height))
317
355
  end
318
356
  _result_1 = _result_2
319
357
  end
320
- _attributes_1.Size = _result_1
321
- _condition_1 = (React.createElement("frame", _attributes_1, React.createElement("uistroke", {
358
+ _attributes_2.Size = _result_1
359
+ _condition_2 = (React.createElement("frame", _attributes_2, React.createElement("uistroke", {
322
360
  Thickness = theme.bar.borderThickness,
323
361
  Color = theme.bar.highlight.borderColor,
324
362
  }), React.createElement("uicorner", {
@@ -340,14 +378,14 @@ local Slider = React.forwardRef(function(props, ref)
340
378
  local _exp_4 = (hoveredHandle == index or (dragging and activeHandleRef.current == index)) and (React.createElement(BoxShadow, {
341
379
  ["box-shadow"] = theme.handle.boxShadow,
342
380
  }))
343
- local _attributes_1 = {}
344
- local _condition_2 = theme.handle.aspectRation
345
- if _condition_2 == nil then
346
- _condition_2 = 1
381
+ local _attributes_2 = {}
382
+ local _condition_3 = theme.handle.aspectRatio
383
+ if _condition_3 == nil then
384
+ _condition_3 = 1
347
385
  end
348
- _attributes_1.AspectRatio = _condition_2
349
- _attributes_1.DominantAxis = Enum.DominantAxis.Height
350
- _attributes_1.AspectType = Enum.AspectType.ScaleWithParentSize
386
+ _attributes_2.AspectRatio = _condition_3
387
+ _attributes_2.DominantAxis = Enum.DominantAxis.Height
388
+ _attributes_2.AspectType = Enum.AspectType.ScaleWithParentSize
351
389
  return React.createElement("frame", {
352
390
  key = index,
353
391
  Position = UDim2.fromScale(position, 0.5),
@@ -369,17 +407,13 @@ local Slider = React.forwardRef(function(props, ref)
369
407
  end)
370
408
  end,
371
409
  },
372
- }, _exp_2, _exp_3, _exp_4, React.createElement("uiaspectratioconstraint", _attributes_1))
410
+ }, _exp_2, _exp_3, _exp_4, React.createElement("uiaspectratioconstraint", _attributes_2))
373
411
  end
374
412
  for _k, _v in handles do
375
413
  _newValue[_k] = _callback(_v, _k - 1, handles)
376
414
  end
377
415
  -- ▲ ReadonlyArray.map ▲
378
- return React.createElement("frame", {
379
- ref = ref,
380
- Size = UDim2.new(UDim.new(1, 0), height),
381
- BackgroundTransparency = 1,
382
- }, _exp, React.createElement("frame", _attributes, _condition_1, _newValue))
416
+ return React.createElement("frame", _attributes, _exp, React.createElement("frame", _attributes_1, _condition_2, _newValue))
383
417
  end)
384
418
  return {
385
419
  Slider = Slider,
@@ -1,6 +1,7 @@
1
1
  export * from './Button';
2
2
  export * from './Checkbox';
3
3
  export * from './HoverButton';
4
+ export * from './Increment';
4
5
  export * from './Input';
5
6
  export * from './Select';
6
7
  export * from './Slider';
@@ -10,6 +10,9 @@ end
10
10
  for _k, _v in TS.import(script, script, "HoverButton") or {} do
11
11
  exports[_k] = _v
12
12
  end
13
+ for _k, _v in TS.import(script, script, "Increment") or {} do
14
+ exports[_k] = _v
15
+ end
13
16
  for _k, _v in TS.import(script, script, "Input") or {} do
14
17
  exports[_k] = _v
15
18
  end
@@ -1,6 +1,6 @@
1
1
  import React from "@rbxts/react";
2
2
  import { SizeElementProps } from "../../Interfaces";
3
- import { ToastOptions } from "../../Contexts/";
3
+ import { ToastOptions } from "../../Contexts";
4
4
  interface ToastProps extends ToastOptions {
5
5
  onDismiss: () => void;
6
6
  }
@@ -10,11 +10,11 @@ local Container = _Layout.Container
10
10
  local FlexItem = _Layout.FlexItem
11
11
  local HStack = _Layout.HStack
12
12
  local VStack = _Layout.VStack
13
- local Button = TS.import(script, script.Parent.Parent, "Input").Button
13
+ local Button = TS.import(script, script.Parent.Parent, "Input", "Button").Button
14
14
  local Text = TS.import(script, script.Parent.Parent, "Typography").Text
15
- local _ = TS.import(script, script.Parent.Parent.Parent, "Contexts")
16
- local CleanThemeContext = _.CleanThemeContext
17
- local useToast = _.useToast
15
+ local _Contexts = TS.import(script, script.Parent.Parent.Parent, "Contexts")
16
+ local CleanThemeContext = _Contexts.CleanThemeContext
17
+ local useToast = _Contexts.useToast
18
18
  local _Helpers = TS.import(script, script.Parent.Parent.Parent, "Helpers")
19
19
  local ColorHelper = _Helpers.ColorHelper
20
20
  local SizeHelper = _Helpers.SizeHelper
@@ -1,7 +1,7 @@
1
1
  import React from "@rbxts/react";
2
2
  import { IntentElementProps } from "../../Interfaces";
3
3
  import { BoxProps } from "../Surface";
4
- type TooltipPlacement = "Top" | "Bottom" | "Left" | "Right";
4
+ type TooltipPlacement = "Top" | "Bottom" | "Left" | "Right" | "Center";
5
5
  interface TooltipProps extends BoxProps, IntentElementProps {
6
6
  content: React.ReactNode | string;
7
7
  children: React.ReactElement<React.InstanceProps<GuiObject>>;
@@ -38,7 +38,7 @@ local function TooltipPopup(props)
38
38
  resolvedPadding.left += shadow.blurRadius.Offset + shadow.spread.X.Offset - shadow.offset.X.Offset
39
39
  resolvedPadding.right += shadow.blurRadius.Offset + shadow.spread.X.Offset + shadow.offset.X.Offset
40
40
  end
41
- local pointerSize = theme.components.tooltip.pointerSize
41
+ local pointerSize = if props.placement == "Center" then 0 else theme.components.tooltip.pointerSize
42
42
  local anchor = Vector2.zero
43
43
  local _position = props.target.position
44
44
  local _absolutePosition = props.overlay.AbsolutePosition
@@ -93,6 +93,13 @@ local function TooltipPopup(props)
93
93
  resolvedPadding.left = math.max(math.floor(pointerHeight), resolvedPadding.left)
94
94
  break
95
95
  end
96
+ if _exp == "Center" then
97
+ anchor = Vector2.new(0.5, 0.5)
98
+ local _position_1 = position
99
+ local _vector2 = Vector2.new(props.target.size.X / 2, props.target.size.Y / 2)
100
+ position = _position_1 + _vector2
101
+ break
102
+ end
96
103
  until true
97
104
  local intent = ColorHelper:getIntentColors(theme, props.intent, "default", theme.components.tooltip.intents)
98
105
  local padding = SpacingHelper:ResolveNumberPadding(SpacingHelper:GetPadding(theme, props.spacing, theme.components.tooltip.spacing))
@@ -0,0 +1,34 @@
1
+ import React from "@rbxts/react";
2
+ import { IconName, ScalableElementProps } from "../../Interfaces";
3
+ interface AccordionItemProps {
4
+ children?: React.ReactNode;
5
+ value: string;
6
+ disabled?: boolean;
7
+ }
8
+ declare function AccordionItem(_props: AccordionItemProps): undefined;
9
+ interface AccordionHeaderProps {
10
+ children?: React.ReactNode | string;
11
+ icon?: IconName;
12
+ text?: string;
13
+ }
14
+ declare function AccordionHeader(_props: AccordionHeaderProps): undefined;
15
+ interface AccordionContentProps {
16
+ children?: React.ReactNode;
17
+ text?: string;
18
+ }
19
+ declare function AccordionContent(_props: AccordionContentProps): undefined;
20
+ export interface AccordionProps extends ScalableElementProps {
21
+ children?: React.ReactNode;
22
+ collapsible?: boolean;
23
+ animationDuration?: number;
24
+ defaultValue?: string;
25
+ value?: string;
26
+ onValueChange?: (value: string | undefined) => void;
27
+ }
28
+ type AccordionComponent = React.ForwardRefExoticComponent<AccordionProps & React.RefAttributes<ImageLabel>> & {
29
+ Item: typeof AccordionItem;
30
+ Header: typeof AccordionHeader;
31
+ Content: typeof AccordionContent;
32
+ };
33
+ declare const Accordion: AccordionComponent;
34
+ export { Accordion };