@rbxts/uiblox 0.2.0-alpha.25 → 0.2.0-alpha.27

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 (109) hide show
  1. package/README.md +27 -109
  2. package/out/ui/packages/accordion/components/Accordion.luau +12 -16
  3. package/out/ui/packages/alert/components/Alert.luau +9 -16
  4. package/out/ui/packages/appBar/components/AppBar.luau +9 -16
  5. package/out/ui/packages/assetField/components/AssetField.luau +12 -16
  6. package/out/ui/packages/avatar/components/Avatar.luau +9 -16
  7. package/out/ui/packages/backdrop/components/Backdrop.luau +9 -16
  8. package/out/ui/packages/badge/components/Badge.luau +9 -16
  9. package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +12 -16
  10. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +9 -16
  11. package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +12 -16
  12. package/out/ui/packages/button/components/Button.luau +20 -18
  13. package/out/ui/packages/card/components/Card.d.ts +2 -1
  14. package/out/ui/packages/card/components/Card.luau +8 -0
  15. package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +12 -16
  16. package/out/ui/packages/checkbox/components/Checkbox.luau +16 -16
  17. package/out/ui/packages/chip/components/Chip.luau +13 -16
  18. package/out/ui/packages/circularProgress/components/CircularProgress.luau +16 -16
  19. package/out/ui/packages/colorPicker/components/ColorPicker.luau +12 -16
  20. package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +12 -16
  21. package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +12 -16
  22. package/out/ui/packages/dialog/components/Dialog.d.ts +2 -1
  23. package/out/ui/packages/dialog/components/Dialog.luau +21 -10
  24. package/out/ui/packages/divider/components/Divider.luau +20 -33
  25. package/out/ui/packages/drawer/components/Drawer.d.ts +2 -1
  26. package/out/ui/packages/drawer/components/Drawer.luau +18 -5
  27. package/out/ui/packages/fab/components/Fab.luau +31 -26
  28. package/out/ui/packages/fab/components/Fab.styles.luau +6 -0
  29. package/out/ui/packages/fontEditor/components/FontEditor.luau +12 -16
  30. package/out/ui/packages/formText/components/FormHelperText.luau +12 -16
  31. package/out/ui/packages/formText/components/FormLabel.luau +12 -16
  32. package/out/ui/packages/gradientEditor/components/GradientEditor.luau +12 -16
  33. package/out/ui/packages/host/components/SxHost.d.ts +18 -0
  34. package/out/ui/packages/host/components/SxHost.luau +197 -0
  35. package/out/ui/packages/host/hostPaint.d.ts +11 -0
  36. package/out/ui/packages/host/hostPaint.luau +33 -0
  37. package/out/ui/packages/host/hostRules.d.ts +15 -0
  38. package/out/ui/packages/host/hostRules.luau +92 -0
  39. package/out/ui/packages/host/index.d.ts +3 -0
  40. package/out/ui/packages/host/init.luau +13 -0
  41. package/out/ui/packages/icon/components/Icon.luau +9 -16
  42. package/out/ui/packages/iconButton/components/IconButton.luau +16 -16
  43. package/out/ui/packages/imageList/components/ImageList.luau +9 -16
  44. package/out/ui/packages/imageList/components/ImageList.styles.luau +4 -3
  45. package/out/ui/packages/input/components/Input.luau +14 -16
  46. package/out/ui/packages/layout/components/Box.luau +6 -15
  47. package/out/ui/packages/layout/components/Container.luau +6 -15
  48. package/out/ui/packages/layout/components/FlexItem.luau +6 -15
  49. package/out/ui/packages/layout/components/Grid.luau +6 -15
  50. package/out/ui/packages/layout/components/List.luau +9 -16
  51. package/out/ui/packages/layout/components/Stack.luau +6 -15
  52. package/out/ui/packages/link/components/Link.luau +13 -16
  53. package/out/ui/packages/listItem/components/ListItem.d.ts +2 -1
  54. package/out/ui/packages/listItem/components/ListItem.luau +23 -4
  55. package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +5 -1
  56. package/out/ui/packages/loadingStroke/components/loadingStrokeSx.d.ts +11 -0
  57. package/out/ui/packages/loadingStroke/components/loadingStrokeSx.luau +2 -0
  58. package/out/ui/packages/markdown/components/Markdown.luau +9 -16
  59. package/out/ui/packages/markdown/components/MarkdownEditor.luau +9 -16
  60. package/out/ui/packages/menu/components/Menu.d.ts +2 -1
  61. package/out/ui/packages/menu/components/Menu.luau +23 -12
  62. package/out/ui/packages/modal/components/Modal.d.ts +2 -1
  63. package/out/ui/packages/modal/components/Modal.luau +29 -5
  64. package/out/ui/packages/numberInput/components/NumberInput.d.ts +1 -0
  65. package/out/ui/packages/numberInput/components/NumberInput.luau +14 -3
  66. package/out/ui/packages/numberInput/components/numberValue.d.ts +1 -0
  67. package/out/ui/packages/numberInput/components/numberValue.luau +45 -0
  68. package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +12 -16
  69. package/out/ui/packages/pagination/components/Pagination.luau +12 -16
  70. package/out/ui/packages/paper/components/Paper.d.ts +2 -1
  71. package/out/ui/packages/paper/components/Paper.luau +21 -12
  72. package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +63 -38
  73. package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +21 -7
  74. package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +2 -0
  75. package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +14 -0
  76. package/out/ui/packages/popup/components/Popup.d.ts +2 -1
  77. package/out/ui/packages/popup/components/Popup.luau +35 -18
  78. package/out/ui/packages/preloader/components/Preloader.luau +9 -16
  79. package/out/ui/packages/progressBar/components/ProgressBar.luau +12 -16
  80. package/out/ui/packages/radioGroup/components/RadioGroup.luau +12 -16
  81. package/out/ui/packages/rating/components/Rating.luau +12 -16
  82. package/out/ui/packages/rayEditor/components/RayEditor.luau +12 -16
  83. package/out/ui/packages/rectEditor/components/RectEditor.luau +86 -43
  84. package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +30 -7
  85. package/out/ui/packages/select/components/Select.luau +13 -16
  86. package/out/ui/packages/shadow/components/Shadow.d.ts +2 -1
  87. package/out/ui/packages/shadow/components/Shadow.luau +39 -17
  88. package/out/ui/packages/shadow/components/Shadow.styles.luau +7 -2
  89. package/out/ui/packages/sidebar/components/Sidebar.luau +9 -16
  90. package/out/ui/packages/skeleton/components/Skeleton.luau +19 -28
  91. package/out/ui/packages/slider/components/Slider.luau +16 -17
  92. package/out/ui/packages/speedDial/components/SpeedDial.luau +12 -16
  93. package/out/ui/packages/splitPane/components/SplitPane.luau +12 -16
  94. package/out/ui/packages/stateMatrix.luau +1209 -725
  95. package/out/ui/packages/stepper/components/Stepper.luau +9 -16
  96. package/out/ui/packages/switch/components/Switch.luau +16 -16
  97. package/out/ui/packages/table/components/Table.luau +9 -16
  98. package/out/ui/packages/tabs/components/Tabs.luau +12 -16
  99. package/out/ui/packages/toast/components/Toast.luau +16 -13
  100. package/out/ui/packages/toggleButton/components/ToggleButton.luau +24 -32
  101. package/out/ui/packages/tooltip/components/Tooltip.luau +9 -16
  102. package/out/ui/packages/treeView/components/TreeView.luau +9 -16
  103. package/out/ui/packages/typography/components/Typography.luau +13 -14
  104. package/out/ui/packages/udimEditor/components/UDimEditor.luau +12 -16
  105. package/out/ui/packages/vectorEditor/components/VectorEditor.luau +12 -16
  106. package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +2 -1
  107. package/out/ui/packages/virtualList/components/EmptyListHint.luau +15 -4
  108. package/out/ui/packages/virtualList/components/VirtualList.luau +9 -16
  109. package/package.json +2 -2
@@ -2,6 +2,7 @@
2
2
  local TS = _G[script]
3
3
  local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
4
  local Orientations = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Orientations
5
+ local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
5
6
  local dividerLabel = TS.import(script, script.Parent, "dividerLabel").dividerLabel
6
7
  local useDividerStyles = TS.import(script, script.Parent, "Divider.styles").default
7
8
  local function Divider(props)
@@ -20,26 +21,18 @@ local function Divider(props)
20
21
  local captionPad = _binding_1.captionPad
21
22
  local label = dividerLabel(text)
22
23
  if label ~= nil and orientation ~= Orientations.Vertical then
23
- local _attributes = {}
24
+ local _attributes = {
25
+ tag = "frame",
26
+ }
24
27
  local _condition = id
25
28
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
26
29
  _condition = "Divider"
27
30
  end
28
31
  _attributes.key = _condition
29
- _attributes.ref = ref
30
- for _k, _v in shell do
31
- _attributes[_k] = _v
32
- end
33
- if className ~= 0 and className == className and className ~= "" and className then
34
- for _k, _v in className do
35
- _attributes[_k] = _v
36
- end
37
- end
38
- if sx ~= 0 and sx == sx and sx ~= "" and sx then
39
- for _k, _v in sx do
40
- _attributes[_k] = _v
41
- end
42
- end
32
+ _attributes.hostRef = ref
33
+ _attributes.base = shell
34
+ _attributes.className = className
35
+ _attributes.sx = sx
43
36
  local _attributes_1 = {
44
37
  key = "Line",
45
38
  }
@@ -56,30 +49,24 @@ local function Divider(props)
56
49
  _attributes_2.Text = label
57
50
  local _attributes_3 = table.clone(captionPad)
58
51
  setmetatable(_attributes_3, nil)
59
- return React.createElement("frame", _attributes, _exp, React.createElement("textlabel", _attributes_2, React.createElement("uipadding", _attributes_3)))
52
+ return React.createElement(SxHost, _attributes, _exp, React.createElement("textlabel", _attributes_2, React.createElement("uipadding", _attributes_3)))
60
53
  end
61
- local _attributes = {}
54
+ local _attributes = {
55
+ tag = "frame",
56
+ }
62
57
  local _condition = id
63
58
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
64
59
  _condition = "Divider"
65
60
  end
66
61
  _attributes.key = _condition
67
- _attributes.ref = ref
68
- for _k, _v in root do
69
- _attributes[_k] = _v
70
- end
71
- _attributes.BorderSizePixel = 0
72
- if className ~= 0 and className == className and className ~= "" and className then
73
- for _k, _v in className do
74
- _attributes[_k] = _v
75
- end
76
- end
77
- if sx ~= 0 and sx == sx and sx ~= "" and sx then
78
- for _k, _v in sx do
79
- _attributes[_k] = _v
80
- end
81
- end
82
- return React.createElement("frame", _attributes)
62
+ _attributes.hostRef = ref
63
+ local _object = table.clone(root)
64
+ setmetatable(_object, nil)
65
+ _object.BorderSizePixel = 0
66
+ _attributes.base = _object
67
+ _attributes.className = className
68
+ _attributes.sx = sx
69
+ return React.createElement(SxHost, _attributes)
83
70
  end
84
71
  local default = Divider
85
72
  return {
@@ -1,4 +1,5 @@
1
1
  import React from "@rbxts/react";
2
+ import { CustomizedProps } from "../../../../theme/index";
2
3
  import { DrawerEdge } from "./drawerPlacement";
3
4
  export interface DrawerProps {
4
5
  host?: Instance;
@@ -8,5 +9,5 @@ export interface DrawerProps {
8
9
  onClose: () => void;
9
10
  children?: React.ReactNode;
10
11
  }
11
- declare function Drawer(props: DrawerProps): JSX.Element;
12
+ declare function Drawer(props: CustomizedProps<Frame, DrawerProps>): JSX.Element;
12
13
  export default Drawer;
@@ -6,10 +6,11 @@ local useEffect = _react.useEffect
6
6
  local useRef = _react.useRef
7
7
  local useState = _react.useState
8
8
  local UserInputService = TS.import(script, TS.getModule(script, "@rbxts", "services")).UserInputService
9
+ local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
10
+ local isDismissInput = TS.import(script, script.Parent.Parent.Parent, "modal", "components", "dismissInput").isDismissInput
9
11
  local _popup = TS.import(script, script.Parent.Parent.Parent, "popup")
10
12
  local Portal = _popup.Portal
11
13
  local portalTarget = _popup.portalTarget
12
- local isDismissInput = TS.import(script, script.Parent.Parent.Parent, "modal", "components", "dismissInput").isDismissInput
13
14
  local drawerAnchor = TS.import(script, script.Parent, "drawerPlacement").drawerAnchor
14
15
  local useDrawerStyles = TS.import(script, script.Parent, "Drawer.styles").default
15
16
  local function Drawer(props)
@@ -23,6 +24,10 @@ local function Drawer(props)
23
24
  local width = _binding.width
24
25
  local onClose = _binding.onClose
25
26
  local children = _binding.children
27
+ local className = _binding.className
28
+ local sx = _binding.sx
29
+ local id = _binding.id
30
+ local ref = _binding.ref
26
31
  local styles = useDrawerStyles({
27
32
  width = width,
28
33
  })
@@ -49,6 +54,7 @@ local function Drawer(props)
49
54
  end
50
55
  end, { open, layer })
51
56
  local placement = drawerAnchor(edge)
57
+ local panelStyle = styles.panel
52
58
  local _exp = React.createElement("frame", {
53
59
  key = "DrawerAnchor",
54
60
  ref = anchor,
@@ -77,18 +83,25 @@ local function Drawer(props)
77
83
  }
78
84
  local _exp_1 = React.createElement("textbutton", _attributes_1)
79
85
  local _attributes_2 = {
80
- key = "Panel",
86
+ tag = "frame",
81
87
  }
82
- for _k, _v in styles.panel do
83
- _attributes_2[_k] = _v
88
+ local _condition_1 = id
89
+ if not (_condition_1 ~= 0 and _condition_1 == _condition_1 and _condition_1 ~= "" and _condition_1) then
90
+ _condition_1 = "Panel"
84
91
  end
92
+ _attributes_2.key = _condition_1
93
+ _attributes_2.hostRef = ref
94
+ _attributes_2.base = panelStyle
95
+ _attributes_2.className = className
96
+ _attributes_2.sx = sx
85
97
  _attributes_2.AnchorPoint = Vector2.new(placement, 0)
86
98
  _attributes_2.Position = UDim2.fromScale(placement, 0)
99
+ _attributes_2.ZIndex = panelStyle.ZIndex
87
100
  local _attributes_3 = table.clone(styles.padding)
88
101
  setmetatable(_attributes_3, nil)
89
102
  _condition = (React.createElement(Portal, {
90
103
  host = layer,
91
- }, React.createElement("frame", _attributes, _exp_1, React.createElement("frame", _attributes_2, React.createElement("uipadding", _attributes_3), children))))
104
+ }, React.createElement("frame", _attributes, _exp_1, React.createElement(SxHost, _attributes_2, React.createElement("uipadding", _attributes_3), children))))
92
105
  end
93
106
  return React.createElement(React.Fragment, nil, _exp, _condition)
94
107
  end
@@ -7,6 +7,7 @@ local useState = _react.useState
7
7
  local useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").useTheme
8
8
  local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
9
9
  local CircularProgress = TS.import(script, script.Parent.Parent.Parent, "circularProgress").CircularProgress
10
+ local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
10
11
  local Shadow = TS.import(script, script.Parent.Parent.Parent, "shadow").Shadow
11
12
  local _fabSize = TS.import(script, script.Parent, "fabSize")
12
13
  local fabExtended = _fabSize.fabExtended
@@ -83,26 +84,24 @@ local function Fab(props)
83
84
  _result = (React.createElement("imagelabel", _attributes))
84
85
  end
85
86
  local iconEl = _result
86
- local _attributes = {}
87
+ local _attributes = {
88
+ tag = "textbutton",
89
+ }
87
90
  local _condition = id
88
91
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
89
92
  _condition = "Fab"
90
93
  end
91
94
  _attributes.key = _condition
92
- _attributes.ref = ref
93
- for _k, _v in styles.root do
94
- _attributes[_k] = _v
95
- end
96
- if className then
97
- for _k, _v in className do
98
- _attributes[_k] = _v
99
- end
100
- end
101
- if sx then
102
- for _k, _v in sx do
103
- _attributes[_k] = _v
104
- end
105
- end
95
+ _attributes.hostRef = ref
96
+ _attributes.base = styles.root
97
+ _attributes.className = className
98
+ _attributes.sx = sx
99
+ _attributes.state = {
100
+ disabled = disabled,
101
+ loading = loading,
102
+ hover = hovering,
103
+ focused = focused,
104
+ }
106
105
  _attributes.Active = active
107
106
  _attributes.Selectable = active
108
107
  _attributes.BackgroundTransparency = if not active then 0.5 elseif hovering or focused then 0.15 else 0
@@ -135,29 +134,35 @@ local function Fab(props)
135
134
  local _exp_1 = React.createElement(Shadow)
136
135
  local _result_1
137
136
  if extended then
138
- local _attributes_2 = table.clone(styles.padding)
139
- setmetatable(_attributes_2, nil)
140
- local _exp_2 = React.createElement("uipadding", _attributes_2)
141
- local _attributes_3 = table.clone(styles.row)
137
+ local _attributes_2 = {
138
+ key = "Content",
139
+ }
140
+ for _k, _v in styles.content do
141
+ _attributes_2[_k] = _v
142
+ end
143
+ local _attributes_3 = table.clone(styles.padding)
142
144
  setmetatable(_attributes_3, nil)
143
- local _exp_3 = React.createElement("uilistlayout", _attributes_3)
145
+ local _exp_2 = React.createElement("uipadding", _attributes_3)
146
+ local _attributes_4 = table.clone(styles.row)
147
+ setmetatable(_attributes_4, nil)
148
+ local _exp_3 = React.createElement("uilistlayout", _attributes_4)
144
149
  local _exp_4 = iconEl
145
150
  local _condition_1 = not loading
146
151
  if _condition_1 then
147
- local _attributes_4 = {
152
+ local _attributes_5 = {
148
153
  key = "Label",
149
154
  }
150
155
  for _k, _v in styles.label do
151
- _attributes_4[_k] = _v
156
+ _attributes_5[_k] = _v
152
157
  end
153
- _attributes_4.Text = label
154
- _condition_1 = React.createElement("textlabel", _attributes_4)
158
+ _attributes_5.Text = label
159
+ _condition_1 = React.createElement("textlabel", _attributes_5)
155
160
  end
156
- _result_1 = (React.createElement(React.Fragment, nil, _exp_2, _exp_3, _exp_4, _condition_1))
161
+ _result_1 = (React.createElement("frame", _attributes_2, _exp_2, _exp_3, _exp_4, _condition_1))
157
162
  else
158
163
  _result_1 = iconEl
159
164
  end
160
- return React.createElement("textbutton", _attributes, _exp, _exp_1, _result_1)
165
+ return React.createElement(SxHost, _attributes, _exp, _exp_1, _result_1)
161
166
  end
162
167
  local default = Fab
163
168
  return {
@@ -31,6 +31,12 @@ local useFabStyles = componentStyles("Fab", function(theme, _param)
31
31
  corner = {
32
32
  CornerRadius = UDim.new(1, 0),
33
33
  },
34
+ content = {
35
+ Size = UDim2.new(0, 0, 0, diameter),
36
+ AutomaticSize = Enum.AutomaticSize.X,
37
+ BackgroundTransparency = 1,
38
+ BorderSizePixel = 0,
39
+ },
34
40
  padding = {
35
41
  PaddingLeft = UDim.new(0, theme.padding.calc(2)),
36
42
  PaddingRight = UDim.new(0, theme.padding.calc(2.5)),
@@ -3,6 +3,7 @@ local TS = _G[script]
3
3
  local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
4
  local React = _react
5
5
  local useState = _react.useState
6
+ local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
6
7
  local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
7
8
  local Input = TS.import(script, script.Parent.Parent.Parent, "input").Input
8
9
  local Select = TS.import(script, script.Parent.Parent.Parent, "select").Select
@@ -73,26 +74,21 @@ local function FontEditor(props)
73
74
  local custom, setCustom = useState(value.Family)
74
75
  local weights = enumOptions(Enum.FontWeight:GetEnumItems())
75
76
  local stylesList = enumOptions(Enum.FontStyle:GetEnumItems())
76
- local _attributes = {}
77
+ local _attributes = {
78
+ tag = "frame",
79
+ }
77
80
  local _condition = id
78
81
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
79
82
  _condition = "FontEditor"
80
83
  end
81
84
  _attributes.key = _condition
82
- _attributes.ref = ref
83
- for _k, _v in styles.root do
84
- _attributes[_k] = _v
85
- end
86
- if className then
87
- for _k, _v in className do
88
- _attributes[_k] = _v
89
- end
90
- end
91
- if sx then
92
- for _k, _v in sx do
93
- _attributes[_k] = _v
94
- end
95
- end
85
+ _attributes.hostRef = ref
86
+ _attributes.base = styles.root
87
+ _attributes.className = className
88
+ _attributes.sx = sx
89
+ _attributes.state = {
90
+ disabled = disabled,
91
+ }
96
92
  local _attributes_1 = table.clone(styles.column)
97
93
  setmetatable(_attributes_1, nil)
98
94
  local _exp = React.createElement("uilistlayout", _attributes_1)
@@ -215,7 +211,7 @@ local function FontEditor(props)
215
211
  local _exp_7 = React.createElement("uicorner", _attributes_10)
216
212
  local _attributes_11 = table.clone(styles.stroke)
217
213
  setmetatable(_attributes_11, nil)
218
- return React.createElement("frame", _attributes, _exp, _exp_1, _exp_2, _exp_5, React.createElement("textlabel", _attributes_8, _exp_6, _exp_7, React.createElement("uistroke", _attributes_11)))
214
+ return React.createElement(SxHost, _attributes, _exp, _exp_1, _exp_2, _exp_5, React.createElement("textlabel", _attributes_8, _exp_6, _exp_7, React.createElement("uistroke", _attributes_11)))
219
215
  end
220
216
  local default = FontEditor
221
217
  return {
@@ -1,6 +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 SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
4
5
  local useFormTextStyles = TS.import(script, script.Parent, "FormText.styles").default
5
6
  local function FormHelperText(props)
6
7
  local _binding = props
@@ -15,28 +16,23 @@ local function FormHelperText(props)
15
16
  hasError = hasError,
16
17
  disabled = disabled,
17
18
  })
18
- local _attributes = {}
19
+ local _attributes = {
20
+ tag = "textlabel",
21
+ }
19
22
  local _condition = id
20
23
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
21
24
  _condition = "FormHelperText"
22
25
  end
23
26
  _attributes.key = _condition
24
- _attributes.ref = ref
25
- for _k, _v in styles.root do
26
- _attributes[_k] = _v
27
- end
28
- if className then
29
- for _k, _v in className do
30
- _attributes[_k] = _v
31
- end
32
- end
33
- if sx then
34
- for _k, _v in sx do
35
- _attributes[_k] = _v
36
- end
37
- end
27
+ _attributes.hostRef = ref
28
+ _attributes.base = styles.root
29
+ _attributes.className = className
30
+ _attributes.sx = sx
31
+ _attributes.state = {
32
+ disabled = disabled,
33
+ }
38
34
  _attributes.Text = text
39
- return React.createElement("textlabel", _attributes)
35
+ return React.createElement(SxHost, _attributes)
40
36
  end
41
37
  local default = FormHelperText
42
38
  return {
@@ -1,6 +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 SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
4
5
  local useFormTextStyles = TS.import(script, script.Parent, "FormText.styles").default
5
6
  local function FormLabel(props)
6
7
  local _binding = props
@@ -17,28 +18,23 @@ local function FormLabel(props)
17
18
  disabled = disabled,
18
19
  })
19
20
  local caption = if required == true then `{text} *` else text
20
- local _attributes = {}
21
+ local _attributes = {
22
+ tag = "textlabel",
23
+ }
21
24
  local _condition = id
22
25
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
23
26
  _condition = "FormLabel"
24
27
  end
25
28
  _attributes.key = _condition
26
- _attributes.ref = ref
27
- for _k, _v in styles.root do
28
- _attributes[_k] = _v
29
- end
30
- if className then
31
- for _k, _v in className do
32
- _attributes[_k] = _v
33
- end
34
- end
35
- if sx then
36
- for _k, _v in sx do
37
- _attributes[_k] = _v
38
- end
39
- end
29
+ _attributes.hostRef = ref
30
+ _attributes.base = styles.root
31
+ _attributes.className = className
32
+ _attributes.sx = sx
33
+ _attributes.state = {
34
+ disabled = disabled,
35
+ }
40
36
  _attributes.Text = caption
41
- return React.createElement("textlabel", _attributes)
37
+ return React.createElement(SxHost, _attributes)
42
38
  end
43
39
  local default = FormLabel
44
40
  return {
@@ -1,6 +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 SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
4
5
  local _colorPicker = TS.import(script, script.Parent.Parent.Parent, "colorPicker")
5
6
  local ColorSequenceEditor = _colorPicker.ColorSequenceEditor
6
7
  local NumberSequenceEditor = _colorPicker.NumberSequenceEditor
@@ -21,26 +22,21 @@ local function GradientEditor(props)
21
22
  local id = _binding.id
22
23
  local ref = _binding.ref
23
24
  local styles = useGradientEditorStyles()
24
- local _attributes = {}
25
+ local _attributes = {
26
+ tag = "frame",
27
+ }
25
28
  local _condition = id
26
29
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
27
30
  _condition = "GradientEditor"
28
31
  end
29
32
  _attributes.key = _condition
30
- _attributes.ref = ref
31
- for _k, _v in styles.root do
32
- _attributes[_k] = _v
33
- end
34
- if className then
35
- for _k, _v in className do
36
- _attributes[_k] = _v
37
- end
38
- end
39
- if sx then
40
- for _k, _v in sx do
41
- _attributes[_k] = _v
42
- end
43
- end
33
+ _attributes.hostRef = ref
34
+ _attributes.base = styles.root
35
+ _attributes.className = className
36
+ _attributes.sx = sx
37
+ _attributes.state = {
38
+ disabled = disabled,
39
+ }
44
40
  local _attributes_1 = table.clone(styles.column)
45
41
  setmetatable(_attributes_1, nil)
46
42
  local _exp = React.createElement("uilistlayout", _attributes_1)
@@ -159,7 +155,7 @@ local function GradientEditor(props)
159
155
  _attributes_17[_k] = _v
160
156
  end
161
157
  _attributes_17.LayoutOrder = 4
162
- return React.createElement("frame", _attributes, _exp, _exp_2, _exp_4, _exp_10, React.createElement("frame", _attributes_17, React.createElement(Switch, {
158
+ return React.createElement(SxHost, _attributes, _exp, _exp_2, _exp_4, _exp_10, React.createElement("frame", _attributes_17, React.createElement(Switch, {
163
159
  value = value.enabled,
164
160
  disabled = disabled,
165
161
  label = "Enabled",
@@ -0,0 +1,18 @@
1
+ import React from "@rbxts/react";
2
+ import { StyleState } from "../../../../theme/styles/utilities/resolveStyle";
3
+ import { SxInput } from "../../../../theme/styles/utilities/resolveSx";
4
+ export interface SxHostProps {
5
+ tag?: string;
6
+ base?: object;
7
+ className?: object;
8
+ sx?: SxInput | object;
9
+ state?: StyleState;
10
+ hostRef?: React.Ref<any>;
11
+ children?: React.ReactNode;
12
+ [key: string]: unknown;
13
+ }
14
+ declare function SxHost(props: SxHostProps): React.ReactElement<{
15
+ ref: (instance: GuiObject) => void;
16
+ children: React.Element<any, string | React.JSXElementConstructor<any>>[];
17
+ }, string | React.JSXElementConstructor<any>>;
18
+ export default SxHost;