@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
@@ -12,6 +12,7 @@ local Corners = _Decorator.Corners
12
12
  local Padding = _Decorator.Padding
13
13
  local _Helpers = TS.import(script, script.Parent.Parent.Parent, "Helpers")
14
14
  local ColorHelper = _Helpers.ColorHelper
15
+ local CssHelper = _Helpers.CssHelper
15
16
  local SpacingHelper = _Helpers.SpacingHelper
16
17
  local TypographyHelper = _Helpers.TypographyHelper
17
18
  local _HoverButton = TS.import(script, script.Parent.Parent, "Input", "HoverButton")
@@ -98,6 +99,20 @@ local Tabs = React.forwardRef(function(props, ref)
98
99
  local buttonDefault = ColorHelper:getIntentColors(theme, "primary", "default", theme.components.tabs.button.intents)
99
100
  local buttonHover = ColorHelper:getIntentColors(theme, "primary", "hover", theme.components.tabs.button.intents)
100
101
  local buttonFocus = ColorHelper:getIntentColors(theme, "primary", "focus", theme.components.tabs.button.intents)
102
+ local buttonDefaultBackgroundImage = CssHelper:resolveBackgroundImage(buttonDefault.backgroundImage)
103
+ local buttonHoverBackgroundImage = CssHelper:resolveBackgroundImage(buttonHover.backgroundImage)
104
+ local buttonFocusBackgroundImage = CssHelper:resolveBackgroundImage(buttonFocus.backgroundImage)
105
+ local _attributes = {
106
+ ref = ref,
107
+ BackgroundColor3 = theme.components.tabs.list.backgroundColor,
108
+ width = "100%",
109
+ }
110
+ local _condition = theme.components.tabs.list.backgroundTransparency
111
+ if _condition == nil then
112
+ _condition = 0
113
+ end
114
+ _attributes.BackgroundTransparency = _condition
115
+ _attributes.backgroundImage = theme.components.tabs.list.backgroundImage
101
116
  local _exp = React.createElement(Corners, {
102
117
  radius = theme.components.tabs.list.cornerRadius,
103
118
  })
@@ -112,11 +127,17 @@ local Tabs = React.forwardRef(function(props, ref)
112
127
  default = {
113
128
  Size = UDim2.fromScale(0, 0),
114
129
  AutomaticSize = Enum.AutomaticSize.XY,
115
- ImageTransparency = 1,
116
130
  BackgroundColor3 = buttonDefault.backgroundColor,
117
131
  BackgroundTransparency = buttonDefault.backgroundTransparency,
118
132
  BorderSizePixel = 0,
119
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,
120
141
  Event = {
121
142
  Activated = function()
122
143
  setSelected(index)
@@ -126,10 +147,24 @@ local Tabs = React.forwardRef(function(props, ref)
126
147
  hover = {
127
148
  BackgroundColor3 = buttonHover.backgroundColor,
128
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,
129
157
  },
130
158
  focus = {
131
159
  BackgroundColor3 = buttonFocus.backgroundColor,
132
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,
133
168
  },
134
169
  }, React.createElement(TabButtonContent, {
135
170
  text = tab.title.text,
@@ -139,12 +174,7 @@ local Tabs = React.forwardRef(function(props, ref)
139
174
  _newValue[_k] = _callback(_v, _k - 1, tabs)
140
175
  end
141
176
  -- ▲ ReadonlyArray.map ▲
142
- local _exp_2 = React.createElement(Container, {
143
- ref = ref,
144
- BackgroundColor3 = theme.components.tabs.list.backgroundColor,
145
- width = "100%",
146
- BackgroundTransparency = 0,
147
- }, _exp, _exp_1, React.createElement(HStack, nil, _newValue))
177
+ local _exp_2 = React.createElement(Container, _attributes, _exp, _exp_1, React.createElement(HStack, nil, _newValue))
148
178
  local _exp_3 = React.createElement("uistroke", {
149
179
  Thickness = theme.components.tabs.borderThickness,
150
180
  BorderStrokePosition = Enum.BorderStrokePosition.Inner,
@@ -1,11 +1,14 @@
1
- import React from "@rbxts/react";
1
+ import React, { Binding } from "@rbxts/react";
2
2
  import { SpacedElementProps } from "../../Interfaces";
3
3
  interface VStackProps extends SpacedElementProps {
4
+ valign?: Enum.VerticalAlignment | "Center" | "Top" | "Bottom" | React.Binding<Enum.VerticalAlignment> | undefined;
4
5
  children?: React.ReactNode;
5
6
  HorizontalFlex?: Enum.UIFlexAlignment;
6
7
  VerticalFlex?: Enum.UIFlexAlignment;
8
+ VerticalAlignment?: Enum.VerticalAlignment;
7
9
  Event?: React.InstanceEvent<UIListLayout>;
8
10
  Change?: React.InstanceChangeEvent<UIListLayout>;
11
+ Padding?: UDim | Binding<UDim>;
9
12
  }
10
13
  export declare function VStack(props: VStackProps): React.JSX.Element;
11
14
  export {};
@@ -5,12 +5,12 @@ 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
- local padding = UDim.new(0, SpacingHelper:GetPadding(theme, props.spacing))
9
8
  return React.createElement(React.Fragment, nil, React.createElement("uilistlayout", {
10
9
  FillDirection = Enum.FillDirection.Vertical,
11
10
  HorizontalFlex = props.HorizontalFlex or Enum.UIFlexAlignment.Fill,
12
11
  VerticalFlex = props.VerticalFlex,
13
- Padding = padding,
12
+ VerticalAlignment = props.VerticalAlignment or props.valign,
13
+ Padding = props.Padding or UDim.new(0, SpacingHelper:GetPadding(theme, props.spacing)),
14
14
  SortOrder = Enum.SortOrder.LayoutOrder,
15
15
  Change = props.Change,
16
16
  Event = props.Event,
@@ -1,4 +1,5 @@
1
1
  export * from './Column';
2
+ export * from './Accordion';
2
3
  export * from './Container';
3
4
  export * from './Draggable';
4
5
  export * from './Droppable';
@@ -4,6 +4,9 @@ local exports = {}
4
4
  for _k, _v in TS.import(script, script, "Column") or {} do
5
5
  exports[_k] = _v
6
6
  end
7
+ for _k, _v in TS.import(script, script, "Accordion") or {} do
8
+ exports[_k] = _v
9
+ end
7
10
  for _k, _v in TS.import(script, script, "Container") or {} do
8
11
  exports[_k] = _v
9
12
  end
@@ -8,7 +8,7 @@ interface MenuProps {
8
8
  title: string;
9
9
  collapsed?: boolean;
10
10
  }
11
- type MenuComponent = React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<Frame>> & {
11
+ type MenuComponent = React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<ImageLabel>> & {
12
12
  Item: typeof MenuItem;
13
13
  };
14
14
  declare const Menu: MenuComponent;
@@ -1,7 +1,9 @@
1
1
  import React from "@rbxts/react";
2
- import { BackgroundElementProps, ShadowElementProps, SizeElementProps, SpacedElementProps, ZIndexElementProps } from "../../Interfaces/";
3
- export interface BoxProps extends SpacedElementProps, ShadowElementProps, BackgroundElementProps, ZIndexElementProps, SizeElementProps, React.InstanceProps<Frame> {
2
+ import { BackgroundElementProps, PositionElementProps, ShadowElementProps, SizeElementProps, SpacedElementProps, ZIndexElementProps } from "../../Interfaces/";
3
+ import { CssBackgroundImage } from "../../Theme";
4
+ export interface BoxProps extends SpacedElementProps, ShadowElementProps, BackgroundElementProps, ZIndexElementProps, SizeElementProps, PositionElementProps, React.InstanceProps<ImageLabel> {
4
5
  'border-thickness'?: number;
5
6
  'border-color'?: Color3;
7
+ 'background-image'?: CssBackgroundImage;
6
8
  }
7
- export declare const Box: React.ForwardRefExoticComponent<Omit<BoxProps, "ref"> & React.RefAttributes<Frame>>;
9
+ export declare const Box: React.ForwardRefExoticComponent<Omit<BoxProps, "ref"> & React.RefAttributes<ImageLabel>>;
@@ -7,9 +7,17 @@ local Padding = _Decorator.Padding
7
7
  local Corners = _Decorator.Corners
8
8
  local BoxShadow = _Decorator.BoxShadow
9
9
  local Container = TS.import(script, script.Parent.Parent, "Layout").Container
10
- local SizeHelper = TS.import(script, script.Parent.Parent.Parent, "Helpers").SizeHelper
10
+ local _Helpers = TS.import(script, script.Parent.Parent.Parent, "Helpers")
11
+ local SizeHelper = _Helpers.SizeHelper
12
+ local CssHelper = _Helpers.CssHelper
11
13
  local Box = React.forwardRef(function(props, ref)
12
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
13
21
  local _attributes = {
14
22
  ref = ref,
15
23
  }
@@ -17,7 +25,7 @@ local Box = React.forwardRef(function(props, ref)
17
25
  _attributes[_k] = _v
18
26
  end
19
27
  _attributes.Size = SizeHelper:GetSize(props, UDim2.fromScale(1, 1))
20
- _attributes.AutomaticSize = Enum.AutomaticSize.XY
28
+ _attributes.AutomaticSize = SizeHelper:GetAutoSize(props)
21
29
  local _condition = props.BackgroundTransparency
22
30
  if _condition == nil then
23
31
  _condition = theme.components.box.backgroundTransparency
@@ -26,6 +34,7 @@ local Box = React.forwardRef(function(props, ref)
26
34
  _attributes.BackgroundColor3 = props.BackgroundColor3 or theme.components.box.backgroundColor
27
35
  _attributes.ZIndex = props.ZIndex
28
36
  _attributes.Event = props.Event
37
+ _attributes.backgroundImage = props["background-image"] or theme.components.box.backgroundImage
29
38
  local _attributes_1 = {}
30
39
  local _condition_1 = props["border-thickness"]
31
40
  if _condition_1 == nil then
@@ -39,7 +48,7 @@ local Box = React.forwardRef(function(props, ref)
39
48
  setmetatable(_attributes_2, nil)
40
49
  _attributes_2.value = theme.components.box.boxShadow
41
50
  local _exp_1 = React.createElement(BoxShadow, _attributes_2)
42
- local _attributes_3 = table.clone(props)
51
+ local _attributes_3 = table.clone(paddingProps)
43
52
  setmetatable(_attributes_3, nil)
44
53
  return React.createElement(Container, _attributes, _exp, _exp_1, React.createElement(Padding, _attributes_3), React.createElement(Corners, {
45
54
  radius = theme.components.box.cornerRadius,
@@ -1,19 +1,21 @@
1
1
  import React from "@rbxts/react";
2
2
  import { BoxProps } from "./Box";
3
- import { IntentElementProps } from "../../Interfaces";
4
- interface CardHeaderProps extends IntentElementProps {
3
+ import { IntentElementProps, PositionElementProps, ZIndexElementProps } from "../../Interfaces";
4
+ interface CardHeaderProps extends IntentElementProps, PositionElementProps, ZIndexElementProps {
5
5
  children?: React.ReactNode;
6
+ overlay?: boolean;
6
7
  }
7
- export declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<Frame>>;
8
+ export declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<ImageLabel>>;
8
9
  interface CardBodyProps extends BoxProps {
9
10
  }
10
- export declare const CardBody: React.ForwardRefExoticComponent<Omit<CardBodyProps, "ref"> & React.RefAttributes<Frame>>;
11
+ export declare const CardBody: React.ForwardRefExoticComponent<Omit<CardBodyProps, "ref"> & React.RefAttributes<ImageLabel>>;
11
12
  interface CardFooterProps extends BoxProps, IntentElementProps {
13
+ overlay?: boolean;
12
14
  }
13
- export declare const CardFooter: React.ForwardRefExoticComponent<Omit<CardFooterProps, "ref"> & React.RefAttributes<Frame>>;
15
+ export declare const CardFooter: React.ForwardRefExoticComponent<Omit<CardFooterProps, "ref"> & React.RefAttributes<ImageLabel>>;
14
16
  interface CardProps extends BoxProps, IntentElementProps {
15
17
  }
16
- type CardComponent = React.ForwardRefExoticComponent<CardProps & React.RefAttributes<Frame>> & {
18
+ type CardComponent = React.ForwardRefExoticComponent<CardProps & React.RefAttributes<ImageLabel>> & {
17
19
  Header: typeof CardHeader;
18
20
  Footer: typeof CardFooter;
19
21
  Body: typeof CardBody;