@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
@@ -18,15 +18,14 @@ local TypographyHelper = _Helpers.TypographyHelper
18
18
  local _HoverButton = TS.import(script, script.Parent.Parent, "Input", "HoverButton")
19
19
  local HoverButton = _HoverButton.HoverButton
20
20
  local HoverButtonContext = _HoverButton.HoverButtonContext
21
- local function Tab(_props)
22
- return nil
23
- end
24
- local function TabTitle(_props)
25
- return nil
26
- end
27
- local function TabContent(props)
28
- return nil
29
- end
21
+ -- Selection only — Tabs.List/Tabs.Body/Tabs.Title/Tabs.Content each render
22
+ -- themselves for real (see Card.tsx's CardHeader/CardFooter for the same
23
+ -- "Root provides Context, subparts consume it independently" pattern), so
24
+ -- there's nothing here to scan or harvest from children.
25
+ local TabsContext = React.createContext({
26
+ selected = nil,
27
+ setSelected = function() end,
28
+ })
30
29
  local function TabButtonContent(props)
31
30
  local theme = React.useContext(CleanThemeContext)
32
31
  local hover = React.useContext(HoverButtonContext)
@@ -46,63 +45,112 @@ local function TabButtonContent(props)
46
45
  end
47
46
  local intent = ColorHelper:getIntentColors(theme, "primary", _result_1, theme.components.tabs.button.intents)
48
47
  return React.createElement(React.Fragment, nil, React.createElement(Corners, {
49
- radius = theme.components.tabs.button.cornerRadius,
48
+ radius = theme.components.tabs.list.cornerRadius,
50
49
  }), React.createElement(Padding, {
51
- resolvedPadding = SpacingHelper:GetResolvedPadding(theme, {}, theme.components.tabs.button.spacing),
50
+ resolvedPadding = SpacingHelper:GetResolvedPadding(theme, props, theme.components.tabs.button.spacing, theme.components.tabs.button.padding),
52
51
  }), React.createElement(BoxShadow, {
53
52
  value = intent.boxShadow,
54
53
  }), React.createElement(Text, {
54
+ name = "TabTitleText",
55
55
  TextColor3 = intent.textColor,
56
56
  text = props.text,
57
57
  typography = TypographyHelper:getTypography(theme, nil, intent.typography),
58
58
  }))
59
59
  end
60
- local Tabs = React.forwardRef(function(props, ref)
60
+ -- The real per-tab button — derives its own default/hover/focus color scheme
61
+ -- from the theme (same per-instance derivation Card.Header/Card.Footer use,
62
+ -- not hoisted to Root) and drives selection itself via TabsContext.
63
+ local function TabTitle(props)
61
64
  local theme = React.useContext(CleanThemeContext)
62
- local selected, setSelected = React.useState(0)
63
- local tabs = React.useMemo(function()
64
- local tabs = {}
65
- React.Children.forEach(props.children, function(child)
66
- if not React.isValidElement(child) or child.type ~= Tab then
67
- return nil
68
- end
69
- local title
70
- local content
71
- local tab = child
72
- React.Children.forEach(tab.props.children, function(tabChild)
73
- if not React.isValidElement(tabChild) then
74
- return nil
75
- end
76
- if tabChild.type == TabTitle then
77
- title = (tabChild.props)
78
- elseif tabChild.type == TabContent then
79
- content = (tabChild.props).children
80
- end
81
- end)
82
- if title ~= nil then
83
- local _arg0 = {
84
- title = title,
85
- content = content,
86
- }
87
- table.insert(tabs, _arg0)
88
- end
89
- end)
90
- return tabs
91
- end, { props.children })
92
- local tabCount = #tabs
65
+ local _binding = React.useContext(TabsContext)
66
+ local selected = _binding.selected
67
+ local setSelected = _binding.setSelected
68
+ local isSelected = selected == props.value
69
+ -- The first-mounted Tabs.Title claims the selection if none is set yet,
70
+ -- preserving "first tab selected by default" now that nothing scans the
71
+ -- tab list up front. Known limitation: if the currently-selected tab's
72
+ -- Tabs.Title unmounts, selection isn't automatically reassigned.
93
73
  React.useEffect(function()
94
- if selected >= tabCount then
95
- setSelected(math.max(0, tabCount - 1))
74
+ if selected == nil then
75
+ setSelected(props.value)
96
76
  end
97
- end, { selected, tabCount })
98
- local selectedTab = tabs[selected + 1]
77
+ end, {})
99
78
  local buttonDefault = ColorHelper:getIntentColors(theme, "primary", "default", theme.components.tabs.button.intents)
100
79
  local buttonHover = ColorHelper:getIntentColors(theme, "primary", "hover", theme.components.tabs.button.intents)
101
80
  local buttonFocus = ColorHelper:getIntentColors(theme, "primary", "focus", theme.components.tabs.button.intents)
102
81
  local buttonDefaultBackgroundImage = CssHelper:resolveBackgroundImage(buttonDefault.backgroundImage)
103
82
  local buttonHoverBackgroundImage = CssHelper:resolveBackgroundImage(buttonHover.backgroundImage)
104
83
  local buttonFocusBackgroundImage = CssHelper:resolveBackgroundImage(buttonFocus.backgroundImage)
84
+ local _attributes = table.clone(props)
85
+ setmetatable(_attributes, nil)
86
+ return React.createElement(HoverButton, {
87
+ isSelected = isSelected,
88
+ name = `TabButton-{props.value}`,
89
+ default = {
90
+ Size = UDim2.fromScale(0, 0),
91
+ AutomaticSize = Enum.AutomaticSize.XY,
92
+ BackgroundColor3 = buttonDefault.backgroundColor,
93
+ BackgroundTransparency = buttonDefault.backgroundTransparency,
94
+ BorderSizePixel = 0,
95
+ AutoButtonColor = false,
96
+ Image = buttonDefaultBackgroundImage.Image,
97
+ ImageColor3 = buttonDefaultBackgroundImage.ImageColor3,
98
+ ImageTransparency = buttonDefaultBackgroundImage.ImageTransparency,
99
+ ScaleType = buttonDefaultBackgroundImage.ScaleType,
100
+ SliceCenter = buttonDefaultBackgroundImage.SliceCenter,
101
+ SliceScale = buttonDefaultBackgroundImage.SliceScale,
102
+ TileSize = buttonDefaultBackgroundImage.TileSize,
103
+ Event = {
104
+ Activated = function()
105
+ setSelected(props.value)
106
+ end,
107
+ },
108
+ },
109
+ hover = {
110
+ BackgroundColor3 = buttonHover.backgroundColor,
111
+ BackgroundTransparency = buttonHover.backgroundTransparency,
112
+ Image = buttonHoverBackgroundImage.Image,
113
+ ImageColor3 = buttonHoverBackgroundImage.ImageColor3,
114
+ ImageTransparency = buttonHoverBackgroundImage.ImageTransparency,
115
+ ScaleType = buttonHoverBackgroundImage.ScaleType,
116
+ SliceCenter = buttonHoverBackgroundImage.SliceCenter,
117
+ SliceScale = buttonHoverBackgroundImage.SliceScale,
118
+ TileSize = buttonHoverBackgroundImage.TileSize,
119
+ },
120
+ focus = {
121
+ BackgroundColor3 = buttonFocus.backgroundColor,
122
+ BackgroundTransparency = buttonFocus.backgroundTransparency,
123
+ Image = buttonFocusBackgroundImage.Image,
124
+ ImageColor3 = buttonFocusBackgroundImage.ImageColor3,
125
+ ImageTransparency = buttonFocusBackgroundImage.ImageTransparency,
126
+ ScaleType = buttonFocusBackgroundImage.ScaleType,
127
+ SliceCenter = buttonFocusBackgroundImage.SliceCenter,
128
+ SliceScale = buttonFocusBackgroundImage.SliceScale,
129
+ TileSize = buttonFocusBackgroundImage.TileSize,
130
+ },
131
+ }, React.createElement(TabButtonContent, _attributes))
132
+ end
133
+ -- Always mounted — visibility is toggled rather than the panel being
134
+ -- unmounted/remounted, so per-tab local state (e.g. a Scroller's scroll
135
+ -- position) survives switching tabs. Roblox excludes a GuiObject with
136
+ -- Visible=false from its ancestors' AutomaticSize/UIListLayout
137
+ -- content-size calculations, so the hidden panels don't inflate Tabs.Body's
138
+ -- own AutomaticSize; since only one panel is ever visible at a time, the
139
+ -- default (unset) Position/AnchorPoint every panel shares never causes a
140
+ -- visible overlap either.
141
+ local function TabContent(props)
142
+ local _binding = React.useContext(TabsContext)
143
+ local selected = _binding.selected
144
+ return React.createElement(Container, {
145
+ name = `TabContent_{props.value}`,
146
+ width = "100%",
147
+ Visible = selected == props.value,
148
+ }, props.children)
149
+ end
150
+ local TabsList = React.forwardRef(function(props, ref)
151
+ local theme = React.useContext(CleanThemeContext)
105
152
  local _attributes = {
153
+ name = "TabsList",
106
154
  ref = ref,
107
155
  BackgroundColor3 = theme.components.tabs.list.backgroundColor,
108
156
  width = "100%",
@@ -113,87 +161,56 @@ local Tabs = React.forwardRef(function(props, ref)
113
161
  end
114
162
  _attributes.BackgroundTransparency = _condition
115
163
  _attributes.backgroundImage = theme.components.tabs.list.backgroundImage
116
- local _exp = React.createElement(Corners, {
164
+ return React.createElement(Container, _attributes, React.createElement(Corners, {
117
165
  radius = theme.components.tabs.list.cornerRadius,
118
- })
119
- local _exp_1 = React.createElement(Padding, {
120
- resolvedPadding = SpacingHelper:GetResolvedPadding(theme, {}, theme.components.tabs.list.spacing),
121
- })
122
- -- ReadonlyArray.map
123
- local _newValue = table.create(#tabs)
124
- local _callback = function(tab, index)
125
- return React.createElement(HoverButton, {
126
- isSelected = selected == index,
127
- default = {
128
- Size = UDim2.fromScale(0, 0),
129
- AutomaticSize = Enum.AutomaticSize.XY,
130
- BackgroundColor3 = buttonDefault.backgroundColor,
131
- BackgroundTransparency = buttonDefault.backgroundTransparency,
132
- BorderSizePixel = 0,
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,
141
- Event = {
142
- Activated = function()
143
- setSelected(index)
144
- end,
145
- },
146
- },
147
- hover = {
148
- BackgroundColor3 = buttonHover.backgroundColor,
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,
157
- },
158
- focus = {
159
- BackgroundColor3 = buttonFocus.backgroundColor,
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,
168
- },
169
- }, React.createElement(TabButtonContent, {
170
- text = tab.title.text,
171
- }))
172
- end
173
- for _k, _v in tabs do
174
- _newValue[_k] = _callback(_v, _k - 1, tabs)
175
- end
176
- -- ▲ ReadonlyArray.map ▲
177
- local _exp_2 = React.createElement(Container, _attributes, _exp, _exp_1, React.createElement(HStack, nil, _newValue))
178
- local _exp_3 = React.createElement("uistroke", {
166
+ }), React.createElement(Padding, {
167
+ resolvedPadding = SpacingHelper:GetResolvedPadding(theme, {}, theme.components.tabs.list.spacing, theme.components.tabs.list.padding),
168
+ }), React.createElement(HStack, nil, props.children))
169
+ end)
170
+ local TabsBody = React.forwardRef(function(props, ref)
171
+ local theme = React.useContext(CleanThemeContext)
172
+ return React.createElement(Container, {
173
+ name = "TabsBody",
174
+ ref = ref,
175
+ width = "100%",
176
+ backgroundImage = props.backgroundImage or theme.components.tabs.backgroundImage,
177
+ }, React.createElement("uistroke", {
178
+ key = "Stroke",
179
179
  Thickness = theme.components.tabs.borderThickness,
180
180
  BorderStrokePosition = Enum.BorderStrokePosition.Inner,
181
181
  Color = theme.components.tabs.borderColor,
182
- })
183
- local _exp_4 = React.createElement(Padding, {
184
- resolvedPadding = SpacingHelper:GetResolvedPadding(theme, {}, theme.components.tabs.spacing),
185
- })
186
- local _exp_5 = React.createElement(Corners, {
187
- radius = theme.components.tabs.list.cornerRadius,
188
- })
189
- local _result = selectedTab
190
- if _result ~= nil then
191
- _result = _result.content
192
- end
193
- return React.createElement(VStack, nil, _exp_2, React.createElement(Container, nil, _exp_3, _exp_4, _exp_5, _result))
182
+ }), React.createElement(Padding, {
183
+ resolvedPadding = SpacingHelper:GetResolvedPadding(theme, {}, theme.components.tabs.spacing, theme.components.tabs.padding),
184
+ }), React.createElement(Corners, {
185
+ radius = theme.components.tabs.cornerRadius,
186
+ }), props.children)
187
+ end)
188
+ -- Root doesn't render a real Roblox Instance of its own (just a Context
189
+ -- Provider around a VStack, itself just a Fragment) — see Group.tsx for the
190
+ -- same shape. It's still wrapped in React.forwardRef, not a plain function,
191
+ -- because roblox-ts compiles a bare arrow function to an actual Lua
192
+ -- `function` value, and Lua functions can't have table-style properties
193
+ -- (Tabs.List = ...) assigned onto them forwardRef's return value compiles
194
+ -- to a table instead. The ref itself is genuinely unused: there's no
195
+ -- sensible Instance for it to point at, so RefAttributes<Frame> below is a
196
+ -- type-level placeholder to keep this consistent with every other compound
197
+ -- component's shape, not a real forwarded ref — Tabs does not support a
198
+ -- `ref` prop in practice.
199
+ local Tabs = React.forwardRef(function(props, _ref)
200
+ local selected, setSelected = React.useState(props.defaultValue)
201
+ local contextValue = React.useMemo(function()
202
+ return {
203
+ selected = selected,
204
+ setSelected = setSelected,
205
+ }
206
+ end, { selected })
207
+ return React.createElement(TabsContext.Provider, {
208
+ value = contextValue,
209
+ }, React.createElement(VStack, nil, props.children))
194
210
  end)
211
+ Tabs.List = TabsList
212
+ Tabs.Body = TabsBody
195
213
  Tabs.Title = TabTitle
196
- Tabs.Tab = Tab
197
214
  Tabs.Content = TabContent
198
215
  return {
199
216
  Tabs = Tabs,
@@ -4,11 +4,14 @@ interface VStackProps extends SpacedElementProps {
4
4
  valign?: Enum.VerticalAlignment | "Center" | "Top" | "Bottom" | React.Binding<Enum.VerticalAlignment> | undefined;
5
5
  children?: React.ReactNode;
6
6
  HorizontalFlex?: Enum.UIFlexAlignment;
7
+ HorizontalAlignment?: Enum.HorizontalAlignment;
7
8
  VerticalFlex?: Enum.UIFlexAlignment;
8
9
  VerticalAlignment?: Enum.VerticalAlignment;
9
10
  Event?: React.InstanceEvent<UIListLayout>;
10
11
  Change?: React.InstanceChangeEvent<UIListLayout>;
11
12
  Padding?: UDim | Binding<UDim>;
13
+ Wraps?: boolean;
14
+ name?: string;
12
15
  }
13
16
  export declare function VStack(props: VStackProps): React.JSX.Element;
14
17
  export {};
@@ -5,16 +5,23 @@ local CleanThemeContext = TS.import(script, script.Parent.Parent.Parent, "Contex
5
5
  local SpacingHelper = TS.import(script, script.Parent.Parent.Parent, "Helpers").SpacingHelper
6
6
  local function VStack(props)
7
7
  local theme = React.useContext(CleanThemeContext)
8
- return React.createElement(React.Fragment, nil, React.createElement("uilistlayout", {
9
- FillDirection = Enum.FillDirection.Vertical,
10
- HorizontalFlex = props.HorizontalFlex or Enum.UIFlexAlignment.Fill,
11
- VerticalFlex = props.VerticalFlex,
12
- VerticalAlignment = props.VerticalAlignment or props.valign,
13
- Padding = props.Padding or UDim.new(0, SpacingHelper:GetPadding(theme, props.spacing)),
14
- SortOrder = Enum.SortOrder.LayoutOrder,
15
- Change = props.Change,
16
- Event = props.Event,
17
- }), props.children)
8
+ local _attributes = {}
9
+ local _condition = props.name
10
+ if _condition == nil then
11
+ _condition = "VStack"
12
+ end
13
+ _attributes.key = _condition
14
+ _attributes.FillDirection = Enum.FillDirection.Vertical
15
+ _attributes.HorizontalFlex = props.HorizontalFlex or Enum.UIFlexAlignment.Fill
16
+ _attributes.VerticalFlex = props.VerticalFlex
17
+ _attributes.VerticalAlignment = props.VerticalAlignment or props.valign
18
+ _attributes.HorizontalAlignment = props.HorizontalAlignment
19
+ _attributes.Padding = props.Padding or UDim.new(0, SpacingHelper:GetPadding(theme, props.spacing))
20
+ _attributes.Wraps = props.Wraps
21
+ _attributes.SortOrder = Enum.SortOrder.LayoutOrder
22
+ _attributes.Change = props.Change
23
+ _attributes.Event = props.Event
24
+ return React.createElement(React.Fragment, nil, React.createElement("uilistlayout", _attributes), props.children)
18
25
  end
19
26
  return {
20
27
  VStack = VStack,
@@ -7,7 +7,9 @@ export * from './Fieldset';
7
7
  export * from './FlexItem';
8
8
  export * from './Group';
9
9
  export * from './HStack';
10
+ export * from './Pagination';
10
11
  export * from './Row';
11
12
  export * from './Scroller';
12
13
  export * from './Tabs';
14
+ export * from './Table';
13
15
  export * from './VStack';
@@ -28,6 +28,9 @@ end
28
28
  for _k, _v in TS.import(script, script, "HStack") or {} do
29
29
  exports[_k] = _v
30
30
  end
31
+ for _k, _v in TS.import(script, script, "Pagination") or {} do
32
+ exports[_k] = _v
33
+ end
31
34
  for _k, _v in TS.import(script, script, "Row") or {} do
32
35
  exports[_k] = _v
33
36
  end
@@ -37,6 +40,9 @@ end
37
40
  for _k, _v in TS.import(script, script, "Tabs") or {} do
38
41
  exports[_k] = _v
39
42
  end
43
+ for _k, _v in TS.import(script, script, "Table") or {} do
44
+ exports[_k] = _v
45
+ end
40
46
  for _k, _v in TS.import(script, script, "VStack") or {} do
41
47
  exports[_k] = _v
42
48
  end
@@ -7,6 +7,7 @@ export declare function MenuItem(props: MenuItemProps): React.JSX.Element;
7
7
  interface MenuProps {
8
8
  title: string;
9
9
  collapsed?: boolean;
10
+ name?: string;
10
11
  }
11
12
  type MenuComponent = React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<ImageLabel>> & {
12
13
  Item: typeof MenuItem;
@@ -14,6 +14,7 @@ local NavigationContext = TS.import(script, script.Parent.Parent.Parent, "Contex
14
14
  local function MenuItem(props)
15
15
  local context = React.useContext(NavigationContext)
16
16
  return React.createElement(Button, {
17
+ name = "MenuItem",
17
18
  text = if not context.collapsed then props.title else nil,
18
19
  icon = props.icon,
19
20
  Event = props.Event,
@@ -26,28 +27,38 @@ local Menu = React.forwardRef(function(props, ref)
26
27
  _condition = false
27
28
  end
28
29
  local collapsed, setCollapsed = React.useState(_condition)
30
+ local _attributes = {}
31
+ local _condition_1 = props.name
32
+ if _condition_1 == nil then
33
+ _condition_1 = "Menu"
34
+ end
35
+ _attributes.name = _condition_1
36
+ _attributes.ref = ref
29
37
  return React.createElement(NavigationContext.Provider, {
30
38
  value = {
31
39
  collapsed = collapsed,
32
40
  },
33
- }, React.createElement(Container, {
34
- ref = ref,
35
- }, React.createElement(Group, nil, React.createElement(VStack, {
41
+ }, React.createElement(Container, _attributes, React.createElement(Group, nil, React.createElement(VStack, {
36
42
  spacing = "sm",
37
43
  }, React.createElement(Container, {
44
+ name = "MenuHeader",
38
45
  group = true,
39
46
  }, React.createElement(HStack, {
40
47
  valign = "Center",
41
48
  }, React.createElement(Button, {
49
+ name = "MenuToggleButton",
42
50
  icon = "bars",
51
+ LayoutOrder = 1,
43
52
  Event = {
44
53
  Activated = function()
45
54
  setCollapsed(not collapsed)
46
55
  end,
47
56
  },
48
57
  }), not collapsed and React.createElement(Text, {
58
+ name = "MenuTitle",
49
59
  text = props.title,
50
60
  variant = "heading",
61
+ LayoutOrder = 2,
51
62
  }))), React.createElement(FlexItem, {
52
63
  mode = "Fill",
53
64
  }, React.createElement(Scroller, {
@@ -5,5 +5,6 @@ export interface BoxProps extends SpacedElementProps, ShadowElementProps, Backgr
5
5
  'border-thickness'?: number;
6
6
  'border-color'?: Color3;
7
7
  'background-image'?: CssBackgroundImage;
8
+ name?: string;
8
9
  }
9
10
  export declare const Box: React.ForwardRefExoticComponent<Omit<BoxProps, "ref"> & React.RefAttributes<ImageLabel>>;
@@ -9,16 +9,21 @@ local BoxShadow = _Decorator.BoxShadow
9
9
  local Container = TS.import(script, script.Parent.Parent, "Layout").Container
10
10
  local _Helpers = TS.import(script, script.Parent.Parent.Parent, "Helpers")
11
11
  local SizeHelper = _Helpers.SizeHelper
12
- local CssHelper = _Helpers.CssHelper
12
+ local SpacingHelper = _Helpers.SpacingHelper
13
13
  local Box = React.forwardRef(function(props, ref)
14
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
15
+ local _condition = props["border-thickness"]
16
+ if _condition == nil then
17
+ _condition = theme.components.box.borderThickness
18
+ end
19
+ local borderThickness = _condition
20
+ local _condition_1 = props.name
21
+ if _condition_1 == nil then
22
+ _condition_1 = "Box"
23
+ end
24
+ local name = _condition_1
21
25
  local _attributes = {
26
+ name = name,
22
27
  ref = ref,
23
28
  }
24
29
  for _k, _v in props do
@@ -26,31 +31,28 @@ local Box = React.forwardRef(function(props, ref)
26
31
  end
27
32
  _attributes.Size = SizeHelper:GetSize(props, UDim2.fromScale(1, 1))
28
33
  _attributes.AutomaticSize = SizeHelper:GetAutoSize(props)
29
- local _condition = props.BackgroundTransparency
30
- if _condition == nil then
31
- _condition = theme.components.box.backgroundTransparency
34
+ local _condition_2 = props.BackgroundTransparency
35
+ if _condition_2 == nil then
36
+ _condition_2 = theme.components.box.backgroundTransparency
32
37
  end
33
- _attributes.BackgroundTransparency = _condition
38
+ _attributes.BackgroundTransparency = _condition_2
34
39
  _attributes.BackgroundColor3 = props.BackgroundColor3 or theme.components.box.backgroundColor
35
40
  _attributes.ZIndex = props.ZIndex
36
41
  _attributes.Event = props.Event
37
42
  _attributes.backgroundImage = props["background-image"] or theme.components.box.backgroundImage
38
- local _attributes_1 = {}
39
- local _condition_1 = props["border-thickness"]
40
- if _condition_1 == nil then
41
- _condition_1 = theme.components.box.borderThickness
42
- end
43
- _attributes_1.Thickness = _condition_1
44
- _attributes_1.BorderStrokePosition = Enum.BorderStrokePosition.Inner
45
- _attributes_1.Color = props["border-color"] or theme.components.box.borderColor
46
- local _exp = React.createElement("uistroke", _attributes_1)
47
- local _attributes_2 = table.clone(props)
48
- setmetatable(_attributes_2, nil)
49
- _attributes_2.value = theme.components.box.boxShadow
50
- local _exp_1 = React.createElement(BoxShadow, _attributes_2)
51
- local _attributes_3 = table.clone(paddingProps)
52
- setmetatable(_attributes_3, nil)
53
- return React.createElement(Container, _attributes, _exp, _exp_1, React.createElement(Padding, _attributes_3), React.createElement(Corners, {
43
+ local _exp = borderThickness > 0 and (React.createElement("uistroke", {
44
+ key = "Stroke",
45
+ Thickness = borderThickness,
46
+ BorderStrokePosition = Enum.BorderStrokePosition.Inner,
47
+ Color = props["border-color"] or theme.components.box.borderColor,
48
+ }))
49
+ local _attributes_1 = table.clone(props)
50
+ setmetatable(_attributes_1, nil)
51
+ _attributes_1.value = theme.components.box.boxShadow
52
+ _attributes_1.name = `{name}BoxShadow`
53
+ return React.createElement(Container, _attributes, _exp, React.createElement(BoxShadow, _attributes_1), React.createElement(Padding, {
54
+ resolvedPadding = SpacingHelper:GetResolvedPadding(theme, props, theme.components.box.spacing, theme.components.box.padding),
55
+ }), React.createElement(Corners, {
54
56
  radius = theme.components.box.cornerRadius,
55
57
  }), props.children)
56
58
  end)
@@ -1,9 +1,11 @@
1
1
  import React from "@rbxts/react";
2
2
  import { BoxProps } from "./Box";
3
- import { IntentElementProps, PositionElementProps, ZIndexElementProps } from "../../Interfaces";
4
- interface CardHeaderProps extends IntentElementProps, PositionElementProps, ZIndexElementProps {
3
+ import { CssPadding, IntentElementProps, PositionElementProps, ResolvedPadding, SpacedElementProps, ZIndexElementProps } from "../../Interfaces";
4
+ interface CardHeaderProps extends IntentElementProps, PositionElementProps, ZIndexElementProps, SpacedElementProps {
5
5
  children?: React.ReactNode;
6
6
  overlay?: boolean;
7
+ padding?: CssPadding;
8
+ resolvedPadding?: ResolvedPadding;
7
9
  }
8
10
  export declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<ImageLabel>>;
9
11
  interface CardBodyProps extends BoxProps {
@@ -11,6 +13,8 @@ interface CardBodyProps extends BoxProps {
11
13
  export declare const CardBody: React.ForwardRefExoticComponent<Omit<CardBodyProps, "ref"> & React.RefAttributes<ImageLabel>>;
12
14
  interface CardFooterProps extends BoxProps, IntentElementProps {
13
15
  overlay?: boolean;
16
+ padding?: CssPadding;
17
+ resolvedPadding?: ResolvedPadding;
14
18
  }
15
19
  export declare const CardFooter: React.ForwardRefExoticComponent<Omit<CardFooterProps, "ref"> & React.RefAttributes<ImageLabel>>;
16
20
  interface CardProps extends BoxProps, IntentElementProps {
@@ -19,6 +23,7 @@ type CardComponent = React.ForwardRefExoticComponent<CardProps & React.RefAttrib
19
23
  Header: typeof CardHeader;
20
24
  Footer: typeof CardFooter;
21
25
  Body: typeof CardBody;
26
+ name?: string;
22
27
  };
23
28
  declare const Card: CardComponent;
24
29
  export { Card };