@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
@@ -159,12 +159,13 @@ local CardHeader = React.forwardRef(function(props, ref)
159
159
  local theme = React.useContext(CleanThemeContext)
160
160
  local card = React.useContext(CardContext)
161
161
  local intent = ColorHelper:getIntentColors(theme, props.intent or card.intent or "primary", "default", theme.components.card.header.intents)
162
- local padding = SpacingHelper:ResolveNumberPadding(SpacingHelper:GetPadding(theme, "md", theme.components.card.header.spacing))
162
+ local padding = SpacingHelper:GetResolvedPadding(theme, props, theme.components.card.header.spacing, theme.components.card.header.padding, "md")
163
163
  local corners = CssHelper:parseCssSize(theme.components.card.cornerRadius)
164
164
  local _binding = resolveOverlayPosition(props, theme.components.card.header.position)
165
165
  local overlay = _binding.overlay
166
166
  local positionProps = _binding.positionProps
167
167
  local _attributes = {
168
+ name = "CardHeader",
168
169
  ref = ref,
169
170
  }
170
171
  for _k, _v in props do
@@ -190,7 +191,9 @@ local CardHeader = React.forwardRef(function(props, ref)
190
191
  local _exp = React.createElement(Padding, {
191
192
  resolvedPadding = padding,
192
193
  })
193
- local _attributes_1 = {}
194
+ local _attributes_1 = {
195
+ key = "Stroke",
196
+ }
194
197
  local _condition = theme.components.card.header.borderThickness
195
198
  if _condition == nil then
196
199
  _condition = theme.components.card.borderThickness
@@ -199,6 +202,7 @@ local CardHeader = React.forwardRef(function(props, ref)
199
202
  _attributes_1.Color = intent.borderColor
200
203
  _attributes_1.BorderStrokePosition = Enum.BorderStrokePosition.Inner
201
204
  return React.createElement(Container, _attributes, _exp, React.createElement("uistroke", _attributes_1), React.createElement("uicorner", {
205
+ key = "Corners",
202
206
  TopLeftRadius = corners,
203
207
  TopRightRadius = corners,
204
208
  BottomLeftRadius = UDim.new(0, 0),
@@ -207,40 +211,17 @@ local CardHeader = React.forwardRef(function(props, ref)
207
211
  end)
208
212
  local CardBody = React.forwardRef(function(props, ref)
209
213
  local theme = React.useContext(CleanThemeContext)
210
- -- Mirrors Box.tsx's own padding resolution (CardBody wraps its
211
- -- children in a Container, not a Box, so it doesn't get Box's
212
- -- automatic `box.padding` application for free) apply the card
213
- -- body's own theme padding only when the caller hasn't set explicit
214
- -- padding props. `card.body.padding`, when set, is an intentional
215
- -- full-override escape hatch and wins wholesale over everything
216
- -- below. Absent that, top/bottom fall back to the same generic
217
- -- md-scale default Header/Footer use for their own padding (NOT
218
- -- `box.padding`'s top/bottom) — CardBody's bottom padding stacks
219
- -- directly against an in-flow CardFooter's own top padding (the
220
- -- VStack's spacing is "None"), so inheriting `box.padding`'s
221
- -- vertical values here would double them up with Footer's/Header's
222
- -- own padding. Left/right still inherit `box.padding` since nothing
223
- -- else contributes horizontal padding at that seam.
214
+ -- Unified 4-tier padding resolution (see SpacingHelper.GetResolvedPadding):
215
+ -- `card.body.spacing` (tier 2) overrides the global spacing map per
216
+ -- scale key, falling back to it for any key it doesn't define, and
217
+ -- `card.body.padding` (tier 3) overrides the scale-based tiers
218
+ -- entirely at the active key. CardBody wraps its children in a
219
+ -- Container, not a Box, so it doesn't get Box's automatic
220
+ -- `box.padding` application for free this resolves independently
221
+ -- against `theme.components.card.body`'s own tiers.
224
222
  local paddingSourceProps = props
225
- 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
226
- local _bodyThemePadding = theme.components.card.body
227
- if _bodyThemePadding ~= nil then
228
- _bodyThemePadding = _bodyThemePadding.padding
229
- end
230
- local bodyThemePadding = _bodyThemePadding
231
- local boxThemePadding = theme.components.box.padding
232
- local mdPadding = SpacingHelper:GetPadding(theme, "md")
233
- local paddingProps = if hasCustomPadding then paddingSourceProps elseif bodyThemePadding ~= nil then {
234
- resolvedPadding = CssHelper:parseCssQuad(bodyThemePadding),
235
- } else {
236
- resolvedPadding = {
237
- top = mdPadding,
238
- bottom = mdPadding,
239
- left = if boxThemePadding ~= nil then CssHelper:parseCssQuad(boxThemePadding).left else mdPadding,
240
- right = if boxThemePadding ~= nil then CssHelper:parseCssQuad(boxThemePadding).right else mdPadding,
241
- },
242
- }
243
223
  local _attributes = {
224
+ name = "CardBody",
244
225
  ref = ref,
245
226
  Size = SizeHelper:GetSize(props, UDim2.fromScale(0, 0)),
246
227
  }
@@ -248,20 +229,29 @@ local CardBody = React.forwardRef(function(props, ref)
248
229
  _attributes[_k] = _v
249
230
  end
250
231
  _attributes.AutomaticSize = Enum.AutomaticSize.XY
251
- local _attributes_1 = table.clone(paddingProps)
252
- setmetatable(_attributes_1, nil)
232
+ local _attributes_1 = {}
233
+ local _result = theme.components.card.body
234
+ if _result ~= nil then
235
+ _result = _result.spacing
236
+ end
237
+ local _result_1 = theme.components.card.body
238
+ if _result_1 ~= nil then
239
+ _result_1 = _result_1.padding
240
+ end
241
+ _attributes_1.resolvedPadding = SpacingHelper:GetResolvedPadding(theme, paddingSourceProps, _result, _result_1)
253
242
  return React.createElement(FlexItem, nil, React.createElement(Container, _attributes, React.createElement(Padding, _attributes_1), props.children))
254
243
  end)
255
244
  local CardFooter = React.forwardRef(function(props, ref)
256
245
  local theme = React.useContext(CleanThemeContext)
257
246
  local card = React.useContext(CardContext)
258
247
  local intent = ColorHelper:getIntentColors(theme, props.intent or card.intent or "primary", "default", theme.components.card.footer.intents)
259
- local padding = SpacingHelper:ResolveNumberPadding(SpacingHelper:GetPadding(theme, "md", theme.components.card.footer.spacing))
248
+ local padding = SpacingHelper:GetResolvedPadding(theme, props, theme.components.card.footer.spacing, theme.components.card.footer.padding, "md")
260
249
  local corners = CssHelper:parseCssSize(theme.components.card.cornerRadius)
261
250
  local _binding = resolveOverlayPosition(props, theme.components.card.footer.position)
262
251
  local overlay = _binding.overlay
263
252
  local positionProps = _binding.positionProps
264
253
  local _attributes = {
254
+ name = "CardFooter",
265
255
  ref = ref,
266
256
  }
267
257
  for _k, _v in props do
@@ -287,7 +277,9 @@ local CardFooter = React.forwardRef(function(props, ref)
287
277
  local _exp = React.createElement(Padding, {
288
278
  resolvedPadding = padding,
289
279
  })
290
- local _attributes_1 = {}
280
+ local _attributes_1 = {
281
+ key = "Stroke",
282
+ }
291
283
  local _condition = theme.components.card.footer.borderThickness
292
284
  if _condition == nil then
293
285
  _condition = theme.components.card.borderThickness
@@ -296,6 +288,7 @@ local CardFooter = React.forwardRef(function(props, ref)
296
288
  _attributes_1.Color = intent.borderColor
297
289
  _attributes_1.BorderStrokePosition = Enum.BorderStrokePosition.Inner
298
290
  return React.createElement(Container, _attributes, _exp, React.createElement("uistroke", _attributes_1), React.createElement("uicorner", {
291
+ key = "Corners",
299
292
  TopLeftRadius = UDim.new(0, 0),
300
293
  TopRightRadius = UDim.new(0, 0),
301
294
  BottomLeftRadius = corners,
@@ -353,8 +346,11 @@ local Card = React.forwardRef(function(props, ref)
353
346
  if child == nil then
354
347
  return nil
355
348
  end
356
- if React.isValidElement(child) and child.type == CardHeader and header == nil then
357
- local headerElement = child
349
+ local directHeader = if React.isValidElement(child) and child.type == CardHeader then child else nil
350
+ local wrappedChild = if React.isValidElement(child) then (child.props).children else nil
351
+ local wrappedHeader = if React.isValidElement(wrappedChild) and wrappedChild.type == CardHeader then wrappedChild else nil
352
+ local headerElement = directHeader or wrappedHeader
353
+ if headerElement ~= nil and header == nil then
358
354
  local _condition = headerElement.props.overlay
359
355
  if _condition == nil then
360
356
  local _result = theme.components.card.header.position
@@ -364,7 +360,7 @@ local Card = React.forwardRef(function(props, ref)
364
360
  _condition = (_result == "absolute")
365
361
  end
366
362
  if _condition then
367
- header = headerElement
363
+ header = child
368
364
  return nil
369
365
  end
370
366
  end
@@ -428,29 +424,61 @@ local Card = React.forwardRef(function(props, ref)
428
424
  _result = props
429
425
  end
430
426
  local boxProps = _result
431
- -- When an overlay header and/or footer measurably overlaps into the
432
- -- Box (headerClearance/footerClearance > 0), reserve that much extra
433
- -- top/bottom padding via resolvedPaddingthis takes over Box's own
434
- -- outer padding, which is harmless since Card always forces
435
- -- spacing="None" on Box below anyway (so it was always 0/0/0/0 until
436
- -- now).
427
+ -- When there's no footer at all, footerClearance is always 0 (there's
428
+ -- nothing to measure an overlap against), so fall back to the Box's
429
+ -- own explicit theme.components.box.padding bottom insetif the
430
+ -- theme sets one as a floor instead. This keeps content clear of a
431
+ -- themed Box's decorative border image (e.g. wooden's wood-frame art,
432
+ -- which needs a real bottom inset) even when there's no footer to
433
+ -- reserve that space via measured overlap. Themes that don't set an
434
+ -- explicit box padding (GetExplicitPadding returns undefined) resolve
435
+ -- this floor to 0, so behavior there is unchanged. When a footer IS
436
+ -- present, footerClearance (its real measured overlap) is used as-is
437
+ -- exactly as before — this floor never applies then, since the
438
+ -- footer's own overlap already reserves whatever space it needs.
437
439
  local _result_1
438
- if headerClearance > 0 or footerClearance > 0 then
440
+ if overlayFooter == nil then
441
+ local _result_2 = SpacingHelper:GetExplicitPadding(theme.components.box.padding, theme.default.spacing)
442
+ if _result_2 ~= nil then
443
+ _result_2 = _result_2.bottom
444
+ end
445
+ local _condition = _result_2
446
+ if _condition == nil then
447
+ _condition = 0
448
+ end
449
+ _result_1 = _condition
450
+ else
451
+ _result_1 = 0
452
+ end
453
+ local explicitBoxBottomFloor = _result_1
454
+ -- When an overlay header and/or footer measurably overlaps into the
455
+ -- Box (headerClearance/footerClearance > 0), or the footer-absent
456
+ -- floor above is nonzero, reserve that much extra top/bottom padding
457
+ -- via resolvedPadding — this takes over Box's own outer padding,
458
+ -- which is otherwise 0/0/0/0 since Card always forces spacing="None"
459
+ -- on Box below.
460
+ local _result_2
461
+ if headerClearance > 0 or footerClearance > 0 or explicitBoxBottomFloor > 0 then
439
462
  local _object = table.clone(boxProps)
440
463
  setmetatable(_object, nil)
441
464
  _object.resolvedPadding = {
442
465
  top = headerClearance,
443
- bottom = footerClearance,
466
+ bottom = math.max(footerClearance, explicitBoxBottomFloor),
444
467
  left = 0,
445
468
  right = 0,
446
469
  }
447
- _result_1 = _object
470
+ _result_2 = _object
448
471
  else
449
- _result_1 = boxProps
472
+ _result_2 = boxProps
450
473
  end
451
- local boxPropsWithOverlayClearance = _result_1
474
+ local boxPropsWithOverlayClearance = _result_2
452
475
  local _attributes = table.clone(boxPropsWithOverlayClearance)
453
476
  setmetatable(_attributes, nil)
477
+ local _condition = props.name
478
+ if _condition == nil then
479
+ _condition = "Card"
480
+ end
481
+ _attributes.name = _condition
454
482
  _attributes.ref = ref
455
483
  _attributes.center = nil
456
484
  _attributes.spacing = "None"
@@ -479,33 +507,46 @@ local Card = React.forwardRef(function(props, ref)
479
507
  setmetatable(_object, nil)
480
508
  _object.center = nil
481
509
  local wrapperPositionProps = _object
482
- local boxWithOverlay = if hasOverlay then (React.createElement("frame", {
483
- ref = overlayWrapperRef,
484
- BackgroundTransparency = 1,
485
- ClipsDescendants = false,
486
- Size = SizeHelper:GetSize(props, UDim2.fromScale(1, 1)),
487
- AutomaticSize = SizeHelper:GetAutoSize(props),
488
- Position = SizeHelper:GetPosition(wrapperPositionProps),
489
- AnchorPoint = SizeHelper:GetAnchor(wrapperPositionProps),
490
- ZIndex = props.ZIndex,
491
- LayoutOrder = props.LayoutOrder,
492
- Change = {
510
+ local _result_3
511
+ if hasOverlay then
512
+ local _attributes_1 = {}
513
+ local _condition_1 = props.name
514
+ if _condition_1 == nil then
515
+ _condition_1 = "CardOverlayWrapper"
516
+ end
517
+ _attributes_1.key = _condition_1
518
+ _attributes_1.ref = overlayWrapperRef
519
+ _attributes_1.BackgroundTransparency = 1
520
+ _attributes_1.ClipsDescendants = false
521
+ _attributes_1.Size = SizeHelper:GetSize(props, UDim2.fromScale(1, 1))
522
+ _attributes_1.AutomaticSize = SizeHelper:GetAutoSize(props)
523
+ _attributes_1.Position = SizeHelper:GetPosition(wrapperPositionProps)
524
+ _attributes_1.AnchorPoint = SizeHelper:GetAnchor(wrapperPositionProps)
525
+ _attributes_1.ZIndex = props.ZIndex
526
+ _attributes_1.LayoutOrder = props.LayoutOrder
527
+ _attributes_1.Change = {
493
528
  AbsolutePosition = function(instance)
494
529
  return setWrapperAbsoluteY(instance.AbsolutePosition.Y)
495
530
  end,
496
531
  AbsoluteSize = function(instance)
497
532
  return setWrapperAbsoluteSize(instance.AbsoluteSize)
498
533
  end,
499
- },
500
- }, cardBox, overlayHeader, overlayFooter)) else cardBox
534
+ }
535
+ _result_3 = (React.createElement("frame", _attributes_1, cardBox, overlayHeader, overlayFooter))
536
+ else
537
+ _result_3 = cardBox
538
+ end
539
+ local boxWithOverlay = _result_3
501
540
  local isCentered = props.center == true and props.Position == nil and props.AnchorPoint == nil
502
541
  return React.createElement(CardContext.Provider, {
503
542
  value = contextValue,
504
543
  }, if isCentered then (React.createElement(Container, {
544
+ name = "CardCenterWrapper",
505
545
  Size = UDim2.fromScale(1, 1),
506
546
  ZIndex = props.ZIndex,
507
547
  LayoutOrder = props.LayoutOrder,
508
548
  }, React.createElement("uilistlayout", {
549
+ key = "CenterLayout",
509
550
  FillDirection = Enum.FillDirection.Horizontal,
510
551
  HorizontalAlignment = Enum.HorizontalAlignment.Center,
511
552
  VerticalAlignment = Enum.VerticalAlignment.Center,
@@ -6,5 +6,6 @@ export interface IconProps extends IconElementProps, ScalableElementProps, React
6
6
  spinning?: boolean;
7
7
  speed?: number;
8
8
  Rotation?: number | Binding<number>;
9
+ name?: string;
9
10
  }
10
11
  export declare function Icon(props: IconProps): React.JSX.Element;
@@ -20,11 +20,16 @@ local function SpinningIcon(props)
20
20
  tween:setGoal(360)
21
21
  tween:start()
22
22
  end)
23
- return React.createElement("frame", {
24
- BackgroundTransparency = 1,
25
- Size = UDim2.fromOffset(0, 0),
26
- AutomaticSize = Enum.AutomaticSize.XY,
27
- }, React.createElement(Icon, {
23
+ local _attributes = {}
24
+ local _condition_1 = props.name
25
+ if _condition_1 == nil then
26
+ _condition_1 = "Icon"
27
+ end
28
+ _attributes.key = _condition_1
29
+ _attributes.BackgroundTransparency = 1
30
+ _attributes.Size = UDim2.fromOffset(0, 0)
31
+ _attributes.AutomaticSize = Enum.AutomaticSize.XY
32
+ return React.createElement("frame", _attributes, React.createElement(Icon, {
28
33
  Size = props.Size,
29
34
  color = props.color,
30
35
  icon = props.icon,
@@ -51,19 +56,23 @@ function Icon(props)
51
56
  setmetatable(_attributes, nil)
52
57
  return React.createElement(SpinningIcon, _attributes)
53
58
  end
54
- local _attributes = {
55
- AnchorPoint = props.AnchorPoint,
56
- Rotation = props.Rotation,
57
- Size = props.Size or UDim2.fromOffset(size, size),
58
- Position = props.Position,
59
- LayoutOrder = props.LayoutOrder,
60
- Image = if iconId == nil then nil else `rbxassetid://{iconId}`,
61
- }
62
- local _condition = props.BackgroundTransparency
59
+ local _attributes = {}
60
+ local _condition = props.name
63
61
  if _condition == nil then
64
- _condition = 1
62
+ _condition = "Icon"
63
+ end
64
+ _attributes.key = _condition
65
+ _attributes.AnchorPoint = props.AnchorPoint
66
+ _attributes.Rotation = props.Rotation
67
+ _attributes.Size = props.Size or UDim2.fromOffset(size, size)
68
+ _attributes.Position = props.Position
69
+ _attributes.LayoutOrder = props.LayoutOrder
70
+ _attributes.Image = if iconId == nil then nil else `rbxassetid://{iconId}`
71
+ local _condition_1 = props.BackgroundTransparency
72
+ if _condition_1 == nil then
73
+ _condition_1 = 1
65
74
  end
66
- _attributes.BackgroundTransparency = _condition
75
+ _attributes.BackgroundTransparency = _condition_1
67
76
  _attributes.ImageColor3 = props.color or theme.colors.intents.primary.default.textColor
68
77
  _attributes.ZIndex = props.ZIndex
69
78
  _attributes.Visible = props.Visible
@@ -9,6 +9,7 @@ interface TextProps extends React.InstanceProps<TextLabel> {
9
9
  align?: "Left" | "Right" | "Center";
10
10
  TextWrap?: boolean;
11
11
  letterSpacing?: number;
12
+ name?: string;
12
13
  }
13
14
  export declare const Text: React.ForwardRefExoticComponent<Omit<TextProps, "ref"> & React.RefAttributes<TextLabel>>;
14
15
  export {};
@@ -27,7 +27,23 @@ local Text = React.forwardRef(function(props, ref)
27
27
  local _arg0_1 = string.sub(_text, _arg0, _arg1)
28
28
  table.insert(characters, _arg0_1)
29
29
  end
30
+ local _attributes = {}
31
+ local _condition_1 = props.name
32
+ if _condition_1 == nil then
33
+ _condition_1 = "Text"
34
+ end
35
+ _attributes.key = _condition_1
36
+ _attributes.Size = UDim2.fromScale(0, 0)
37
+ _attributes.AutomaticSize = Enum.AutomaticSize.XY
38
+ _attributes.AnchorPoint = props.AnchorPoint
39
+ _attributes.BackgroundTransparency = 1
40
+ _attributes.Position = props.Position
41
+ _attributes.ZIndex = props.ZIndex
42
+ _attributes.LayoutOrder = props.LayoutOrder
43
+ _attributes.Visible = props.Visible
44
+ _attributes.Rotation = props.Rotation
30
45
  local _exp = React.createElement("uilistlayout", {
46
+ key = "LetterSpacing",
31
47
  FillDirection = Enum.FillDirection.Horizontal,
32
48
  SortOrder = Enum.SortOrder.LayoutOrder,
33
49
  Padding = UDim.new(0, letterSpacing),
@@ -37,7 +53,7 @@ local Text = React.forwardRef(function(props, ref)
37
53
  -- ▼ ReadonlyArray.map ▼
38
54
  local _newValue = table.create(#characters)
39
55
  local _callback = function(character, index)
40
- local _attributes = {
56
+ local _attributes_1 = {
41
57
  key = index,
42
58
  LayoutOrder = index,
43
59
  Size = UDim2.fromScale(0, 0),
@@ -46,56 +62,50 @@ local Text = React.forwardRef(function(props, ref)
46
62
  TextColor3 = props.TextColor3 or theme.colors.intents.primary.default.textColor,
47
63
  Text = character,
48
64
  }
49
- local _condition_1 = props.LineHeight
50
- if _condition_1 == nil then
51
- _condition_1 = style.lineHeight
52
- end
53
- _attributes.LineHeight = _condition_1
54
- _attributes.FontFace = Font.fromName(style.font.Name, weight)
55
- _attributes.FontSize = style.size
56
- _attributes.RichText = false
57
- local _condition_2 = props.TextScaled
65
+ local _condition_2 = props.LineHeight
58
66
  if _condition_2 == nil then
59
- _condition_2 = false
67
+ _condition_2 = style.lineHeight
60
68
  end
61
- _attributes.TextScaled = _condition_2
62
- _attributes.TextStrokeColor3 = props.TextStrokeColor3
63
- _attributes.TextStrokeTransparency = props.TextStrokeTransparency
64
- _attributes.TextTransparency = props.TextTransparency
65
- return React.createElement("textlabel", _attributes)
69
+ _attributes_1.LineHeight = _condition_2
70
+ _attributes_1.FontFace = Font.fromName(style.font.Name, weight)
71
+ _attributes_1.FontSize = style.size
72
+ _attributes_1.RichText = false
73
+ local _condition_3 = props.TextScaled
74
+ if _condition_3 == nil then
75
+ _condition_3 = false
76
+ end
77
+ _attributes_1.TextScaled = _condition_3
78
+ _attributes_1.TextStrokeColor3 = props.TextStrokeColor3
79
+ _attributes_1.TextStrokeTransparency = props.TextStrokeTransparency
80
+ _attributes_1.TextTransparency = props.TextTransparency
81
+ return React.createElement("textlabel", _attributes_1)
66
82
  end
67
83
  for _k, _v in characters do
68
84
  _newValue[_k] = _callback(_v, _k - 1, characters)
69
85
  end
70
86
  -- ▲ ReadonlyArray.map ▲
71
- return React.createElement("frame", {
72
- Size = UDim2.fromScale(0, 0),
73
- AutomaticSize = Enum.AutomaticSize.XY,
74
- AnchorPoint = props.AnchorPoint,
75
- BackgroundTransparency = 1,
76
- Position = props.Position,
77
- ZIndex = props.ZIndex,
78
- LayoutOrder = props.LayoutOrder,
79
- Visible = props.Visible,
80
- Rotation = props.Rotation,
81
- }, _exp, _newValue)
87
+ return React.createElement("frame", _attributes, _exp, _newValue)
82
88
  end
83
- local _attributes = {
84
- ref = ref,
85
- Size = UDim2.fromScale(0, 0),
86
- AutomaticSize = Enum.AutomaticSize.XY,
87
- AnchorPoint = props.AnchorPoint,
88
- }
89
- local _condition_1 = props.LineHeight
89
+ local _attributes = {}
90
+ local _condition_1 = props.name
90
91
  if _condition_1 == nil then
91
- _condition_1 = style.lineHeight
92
+ _condition_1 = "Text"
92
93
  end
93
- _attributes.LineHeight = _condition_1
94
- local _condition_2 = props.BackgroundTransparency
94
+ _attributes.key = _condition_1
95
+ _attributes.ref = ref
96
+ _attributes.Size = UDim2.fromScale(0, 0)
97
+ _attributes.AutomaticSize = Enum.AutomaticSize.XY
98
+ _attributes.AnchorPoint = props.AnchorPoint
99
+ local _condition_2 = props.LineHeight
95
100
  if _condition_2 == nil then
96
- _condition_2 = 1
101
+ _condition_2 = style.lineHeight
102
+ end
103
+ _attributes.LineHeight = _condition_2
104
+ local _condition_3 = props.BackgroundTransparency
105
+ if _condition_3 == nil then
106
+ _condition_3 = 1
97
107
  end
98
- _attributes.BackgroundTransparency = _condition_2
108
+ _attributes.BackgroundTransparency = _condition_3
99
109
  _attributes.TextXAlignment = props.align or (props.TextXAlignment or Enum.TextXAlignment.Left)
100
110
  _attributes.TextColor3 = props.TextColor3 or theme.colors.intents.primary.default.textColor
101
111
  _attributes.Text = props.text
@@ -104,16 +114,16 @@ local Text = React.forwardRef(function(props, ref)
104
114
  _attributes.TextWrapped = textwrapped
105
115
  _attributes.FontFace = Font.fromName(style.font.Name, weight)
106
116
  _attributes.FontSize = style.size
107
- local _condition_3 = props.RichText
108
- if _condition_3 == nil then
109
- _condition_3 = true
110
- end
111
- _attributes.RichText = _condition_3
112
- local _condition_4 = props.TextScaled
117
+ local _condition_4 = props.RichText
113
118
  if _condition_4 == nil then
114
- _condition_4 = false
119
+ _condition_4 = true
120
+ end
121
+ _attributes.RichText = _condition_4
122
+ local _condition_5 = props.TextScaled
123
+ if _condition_5 == nil then
124
+ _condition_5 = false
115
125
  end
116
- _attributes.TextScaled = _condition_4
126
+ _attributes.TextScaled = _condition_5
117
127
  _attributes.ZIndex = props.ZIndex
118
128
  _attributes.LayoutOrder = props.LayoutOrder
119
129
  _attributes.Visible = props.Visible
@@ -1,5 +1,6 @@
1
1
  export * from './draggable.context';
2
2
  export * from './droppable.context';
3
+ export * from './modal.context';
3
4
  export * from './navigation.context';
4
5
  export * from './overlay.context';
5
6
  export * from './row.context';
@@ -7,6 +7,9 @@ end
7
7
  for _k, _v in TS.import(script, script, "droppable.context") or {} do
8
8
  exports[_k] = _v
9
9
  end
10
+ for _k, _v in TS.import(script, script, "modal.context") or {} do
11
+ exports[_k] = _v
12
+ end
10
13
  for _k, _v in TS.import(script, script, "navigation.context") or {} do
11
14
  exports[_k] = _v
12
15
  end
@@ -0,0 +1,15 @@
1
+ import React from "@rbxts/react";
2
+ export interface ModalStackLayer {
3
+ id: string;
4
+ closeOnEscape: () => boolean;
5
+ requestClose: () => void;
6
+ }
7
+ export interface ModalStackContextValue {
8
+ register: (layer: ModalStackLayer) => void;
9
+ unregister: (id: string) => void;
10
+ getLayerIndex: (id: string) => number;
11
+ }
12
+ export declare const ModalStackContext: React.Context<ModalStackContextValue | undefined>;
13
+ export declare function useModalStack(): ModalStackContextValue;
14
+ export declare const ModalCloseContext: React.Context<(() => void) | undefined>;
15
+ export declare function useModalClose(): () => void;
@@ -0,0 +1,26 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local ModalStackContext = React.createContext(nil)
5
+ local function useModalStack()
6
+ local context = React.useContext(ModalStackContext)
7
+ local _arg0 = context ~= nil
8
+ assert(_arg0, "ModalProvider is missing.")
9
+ return context
10
+ end
11
+ -- Per-instance, provided by each <Modal> around its own children so a
12
+ -- header close button or footer button can close the nearest modal
13
+ -- without the consumer threading their own handler down manually.
14
+ local ModalCloseContext = React.createContext(nil)
15
+ local function useModalClose()
16
+ local context = React.useContext(ModalCloseContext)
17
+ local _arg0 = context ~= nil
18
+ assert(_arg0, "useModalClose must be used inside a Modal.")
19
+ return context
20
+ end
21
+ return {
22
+ useModalStack = useModalStack,
23
+ useModalClose = useModalClose,
24
+ ModalStackContext = ModalStackContext,
25
+ ModalCloseContext = ModalCloseContext,
26
+ }
@@ -9,6 +9,7 @@ export interface ToastOptions {
9
9
  duration?: number;
10
10
  dismissible?: boolean;
11
11
  children?: React.ReactNode;
12
+ name?: string;
12
13
  }
13
14
  export interface ToastRecord extends ToastOptions {
14
15
  id: string;
@@ -1,7 +1,8 @@
1
- import { PaddingProps, ResolvedPadding, ScaleSize, ScaleSizeValue } from "../Interfaces";
1
+ import { PaddingProps, ResolvedPadding, ScaleSize, ScaleSizeValue, ScaledCssPadding } from "../Interfaces";
2
2
  import { ThemeTemplate } from "../Theme";
3
3
  export declare class SpacingHelper {
4
- static GetResolvedPadding(theme: ThemeTemplate, props: PaddingProps, component?: ScaleSizeValue<number>): ResolvedPadding;
5
4
  static GetPadding(theme: ThemeTemplate, spacing?: ScaleSize | "None", component?: ScaleSizeValue<number>): number;
5
+ static GetResolvedPadding(theme: ThemeTemplate, props: PaddingProps, componentSpacing?: ScaleSizeValue<number>, componentPadding?: ScaledCssPadding, defaultSpacing?: ScaleSize): ResolvedPadding;
6
+ static GetExplicitPadding(componentPadding: ScaledCssPadding | undefined, key: ScaleSize): ResolvedPadding | undefined;
6
7
  static ResolveNumberPadding(value: number): ResolvedPadding;
7
8
  }