@rbxts/uiblox 0.2.0-alpha.24 → 0.2.0-alpha.26

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 (122) hide show
  1. package/out/hooks/index.d.ts +1 -0
  2. package/out/hooks/init.luau +3 -0
  3. package/out/hooks/useBreakpoints.luau +2 -11
  4. package/out/hooks/viewportObserver.d.ts +10 -0
  5. package/out/hooks/viewportObserver.luau +75 -0
  6. package/out/theme/interfaces/theme/Theme.d.ts +15 -0
  7. package/out/theme/styles/utilities/componentStyles.luau +45 -3
  8. package/out/theme/styles/utilities/componentTheme.d.ts +15 -0
  9. package/out/theme/styles/utilities/index.d.ts +2 -0
  10. package/out/theme/styles/utilities/init.luau +7 -0
  11. package/out/theme/styles/utilities/resolveStyle.d.ts +10 -2
  12. package/out/theme/styles/utilities/resolveStyle.luau +7 -3
  13. package/out/theme/styles/utilities/resolveSx.d.ts +110 -0
  14. package/out/theme/styles/utilities/resolveSx.luau +479 -0
  15. package/out/theme/styles/utilities/styleCache.d.ts +2 -0
  16. package/out/theme/styles/utilities/styleCache.luau +9 -0
  17. package/out/ui/packages/accordion/components/Accordion.luau +12 -16
  18. package/out/ui/packages/alert/components/Alert.luau +9 -16
  19. package/out/ui/packages/appBar/components/AppBar.luau +9 -16
  20. package/out/ui/packages/assetField/components/AssetField.luau +12 -16
  21. package/out/ui/packages/avatar/components/Avatar.luau +9 -16
  22. package/out/ui/packages/backdrop/components/Backdrop.luau +9 -16
  23. package/out/ui/packages/badge/components/Badge.luau +9 -16
  24. package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +12 -16
  25. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +9 -16
  26. package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +12 -16
  27. package/out/ui/packages/button/components/Button.luau +20 -18
  28. package/out/ui/packages/card/components/Card.d.ts +2 -1
  29. package/out/ui/packages/card/components/Card.luau +8 -0
  30. package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +12 -16
  31. package/out/ui/packages/checkbox/components/Checkbox.luau +16 -16
  32. package/out/ui/packages/chip/components/Chip.luau +13 -16
  33. package/out/ui/packages/circularProgress/components/CircularProgress.luau +16 -16
  34. package/out/ui/packages/colorPicker/components/ColorPicker.luau +12 -16
  35. package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +12 -16
  36. package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +12 -16
  37. package/out/ui/packages/dialog/components/Dialog.d.ts +2 -1
  38. package/out/ui/packages/dialog/components/Dialog.luau +21 -10
  39. package/out/ui/packages/divider/components/Divider.luau +20 -33
  40. package/out/ui/packages/drawer/components/Drawer.d.ts +2 -1
  41. package/out/ui/packages/drawer/components/Drawer.luau +18 -5
  42. package/out/ui/packages/fab/components/Fab.luau +15 -16
  43. package/out/ui/packages/fontEditor/components/FontEditor.luau +12 -16
  44. package/out/ui/packages/formText/components/FormHelperText.luau +12 -16
  45. package/out/ui/packages/formText/components/FormLabel.luau +12 -16
  46. package/out/ui/packages/gradientEditor/components/GradientEditor.luau +12 -16
  47. package/out/ui/packages/host/components/SxHost.d.ts +18 -0
  48. package/out/ui/packages/host/components/SxHost.luau +197 -0
  49. package/out/ui/packages/host/hostPaint.d.ts +11 -0
  50. package/out/ui/packages/host/hostPaint.luau +33 -0
  51. package/out/ui/packages/host/hostRules.d.ts +15 -0
  52. package/out/ui/packages/host/hostRules.luau +92 -0
  53. package/out/ui/packages/host/index.d.ts +3 -0
  54. package/out/ui/packages/host/init.luau +13 -0
  55. package/out/ui/packages/icon/components/Icon.luau +9 -16
  56. package/out/ui/packages/iconButton/components/IconButton.luau +16 -16
  57. package/out/ui/packages/imageList/components/ImageList.luau +9 -16
  58. package/out/ui/packages/imageList/components/ImageList.styles.luau +4 -3
  59. package/out/ui/packages/input/components/Input.luau +14 -16
  60. package/out/ui/packages/layout/components/Box.luau +6 -15
  61. package/out/ui/packages/layout/components/Container.luau +6 -15
  62. package/out/ui/packages/layout/components/FlexItem.luau +6 -15
  63. package/out/ui/packages/layout/components/Grid.luau +6 -15
  64. package/out/ui/packages/layout/components/List.luau +9 -16
  65. package/out/ui/packages/layout/components/Stack.luau +6 -15
  66. package/out/ui/packages/link/components/Link.luau +13 -16
  67. package/out/ui/packages/listItem/components/ListItem.d.ts +2 -1
  68. package/out/ui/packages/listItem/components/ListItem.luau +23 -4
  69. package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +5 -1
  70. package/out/ui/packages/loadingStroke/components/loadingStrokeSx.d.ts +11 -0
  71. package/out/ui/packages/loadingStroke/components/loadingStrokeSx.luau +2 -0
  72. package/out/ui/packages/markdown/components/Markdown.luau +9 -16
  73. package/out/ui/packages/markdown/components/MarkdownEditor.luau +9 -16
  74. package/out/ui/packages/menu/components/Menu.d.ts +2 -1
  75. package/out/ui/packages/menu/components/Menu.luau +23 -12
  76. package/out/ui/packages/modal/components/Modal.d.ts +2 -1
  77. package/out/ui/packages/modal/components/Modal.luau +29 -5
  78. package/out/ui/packages/numberInput/components/NumberInput.d.ts +1 -0
  79. package/out/ui/packages/numberInput/components/NumberInput.luau +14 -3
  80. package/out/ui/packages/numberInput/components/numberValue.d.ts +1 -0
  81. package/out/ui/packages/numberInput/components/numberValue.luau +45 -0
  82. package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +12 -16
  83. package/out/ui/packages/pagination/components/Pagination.luau +12 -16
  84. package/out/ui/packages/paper/components/Paper.d.ts +2 -1
  85. package/out/ui/packages/paper/components/Paper.luau +21 -12
  86. package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +63 -38
  87. package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +21 -7
  88. package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +2 -0
  89. package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +14 -0
  90. package/out/ui/packages/popup/components/Popup.d.ts +2 -1
  91. package/out/ui/packages/popup/components/Popup.luau +35 -18
  92. package/out/ui/packages/preloader/components/Preloader.luau +9 -16
  93. package/out/ui/packages/progressBar/components/ProgressBar.luau +12 -16
  94. package/out/ui/packages/radioGroup/components/RadioGroup.luau +12 -16
  95. package/out/ui/packages/rating/components/Rating.luau +12 -16
  96. package/out/ui/packages/rayEditor/components/RayEditor.luau +12 -16
  97. package/out/ui/packages/rectEditor/components/RectEditor.luau +86 -43
  98. package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +30 -7
  99. package/out/ui/packages/select/components/Select.luau +13 -16
  100. package/out/ui/packages/shadow/components/Shadow.d.ts +2 -1
  101. package/out/ui/packages/shadow/components/Shadow.luau +17 -5
  102. package/out/ui/packages/sidebar/components/Sidebar.luau +9 -16
  103. package/out/ui/packages/skeleton/components/Skeleton.luau +19 -28
  104. package/out/ui/packages/slider/components/Slider.luau +16 -17
  105. package/out/ui/packages/speedDial/components/SpeedDial.luau +12 -16
  106. package/out/ui/packages/splitPane/components/SplitPane.luau +12 -16
  107. package/out/ui/packages/stateMatrix.luau +1171 -675
  108. package/out/ui/packages/stepper/components/Stepper.luau +9 -16
  109. package/out/ui/packages/switch/components/Switch.luau +16 -16
  110. package/out/ui/packages/table/components/Table.luau +9 -16
  111. package/out/ui/packages/tabs/components/Tabs.luau +12 -16
  112. package/out/ui/packages/toast/components/Toast.luau +16 -13
  113. package/out/ui/packages/toggleButton/components/ToggleButton.luau +24 -32
  114. package/out/ui/packages/tooltip/components/Tooltip.luau +9 -16
  115. package/out/ui/packages/treeView/components/TreeView.luau +9 -16
  116. package/out/ui/packages/typography/components/Typography.luau +13 -14
  117. package/out/ui/packages/udimEditor/components/UDimEditor.luau +12 -16
  118. package/out/ui/packages/vectorEditor/components/VectorEditor.luau +12 -16
  119. package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +2 -1
  120. package/out/ui/packages/virtualList/components/EmptyListHint.luau +15 -4
  121. package/out/ui/packages/virtualList/components/VirtualList.luau +9 -16
  122. package/package.json +2 -2
@@ -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;
@@ -0,0 +1,197 @@
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 React = _react
5
+ local useEffect = _react.useEffect
6
+ local useRef = _react.useRef
7
+ local useState = _react.useState
8
+ local observeViewport = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "hooks", "viewportObserver").observeViewport
9
+ local useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").useTheme
10
+ local _hostRules = TS.import(script, script.Parent.Parent, "hostRules")
11
+ local elementProps = _hostRules.elementProps
12
+ local elementType = _hostRules.elementType
13
+ local hostKind = _hostRules.hostKind
14
+ local hostRest = _hostRules.hostRest
15
+ local layoutGapPatch = _hostRules.layoutGapPatch
16
+ local sxUsesBreakpoints = _hostRules.sxUsesBreakpoints
17
+ local paintHostStyle = TS.import(script, script.Parent.Parent, "hostPaint").paintHostStyle
18
+ local function setRef(hostRef, instance)
19
+ if hostRef == nil then
20
+ return nil
21
+ end
22
+ local _hostRef = hostRef
23
+ if type(_hostRef) == "function" then
24
+ hostRef(instance)
25
+ return nil
26
+ end
27
+ hostRef.current = instance
28
+ end
29
+ local function SxHost(props)
30
+ local _condition = props.tag
31
+ if _condition == nil then
32
+ _condition = "frame"
33
+ end
34
+ local tag = _condition
35
+ local sx = props.sx
36
+ local _binding = useTheme()
37
+ local theme = _binding.theme
38
+ local bound = useRef()
39
+ local width, setWidth = useState(nil)
40
+ local hover, setHover = useState(false)
41
+ local pressed, setPressed = useState(false)
42
+ local focused, setFocused = useState(false)
43
+ useEffect(function()
44
+ local host = bound.current
45
+ if host == nil or not sxUsesBreakpoints(sx) then
46
+ return nil
47
+ end
48
+ return observeViewport(host, function(size)
49
+ setWidth(function(prev)
50
+ return if prev == size.width then prev else size.width
51
+ end)
52
+ end)
53
+ end, { sx })
54
+ local passed = props.state
55
+ local _result = passed
56
+ if _result ~= nil then
57
+ _result = _result.disabled
58
+ end
59
+ local locked = _result == true
60
+ local _exp = props.base
61
+ local _exp_1 = props.className
62
+ local _object = {
63
+ hover = hover,
64
+ pressed = pressed,
65
+ focused = focused,
66
+ }
67
+ if passed then
68
+ for _k, _v in passed do
69
+ _object[_k] = _v
70
+ end
71
+ end
72
+ local paint = paintHostStyle(theme, _exp, _exp_1, sx, width, _object)
73
+ local rest = hostRest(props)
74
+ local caller = rest.Event
75
+ local _object_1 = {}
76
+ if caller then
77
+ for _k, _v in caller do
78
+ _object_1[_k] = _v
79
+ end
80
+ end
81
+ _object_1.MouseEnter = function(...)
82
+ local args = { ... }
83
+ if not locked then
84
+ setHover(true)
85
+ end
86
+ local _result_1 = caller
87
+ if _result_1 ~= nil then
88
+ _result_1 = _result_1.MouseEnter
89
+ if _result_1 ~= nil then
90
+ _result_1(unpack(args))
91
+ end
92
+ end
93
+ end
94
+ _object_1.MouseLeave = function(...)
95
+ local args = { ... }
96
+ setHover(false)
97
+ setPressed(false)
98
+ local _result_1 = caller
99
+ if _result_1 ~= nil then
100
+ _result_1 = _result_1.MouseLeave
101
+ if _result_1 ~= nil then
102
+ _result_1(unpack(args))
103
+ end
104
+ end
105
+ end
106
+ _object_1.MouseButton1Down = function(...)
107
+ local args = { ... }
108
+ if not locked then
109
+ setPressed(true)
110
+ end
111
+ local _result_1 = caller
112
+ if _result_1 ~= nil then
113
+ _result_1 = _result_1.MouseButton1Down
114
+ if _result_1 ~= nil then
115
+ _result_1(unpack(args))
116
+ end
117
+ end
118
+ end
119
+ _object_1.MouseButton1Up = function(...)
120
+ local args = { ... }
121
+ setPressed(false)
122
+ local _result_1 = caller
123
+ if _result_1 ~= nil then
124
+ _result_1 = _result_1.MouseButton1Up
125
+ if _result_1 ~= nil then
126
+ _result_1(unpack(args))
127
+ end
128
+ end
129
+ end
130
+ _object_1.SelectionGained = function(...)
131
+ local args = { ... }
132
+ if not locked then
133
+ setFocused(true)
134
+ end
135
+ local _result_1 = caller
136
+ if _result_1 ~= nil then
137
+ _result_1 = _result_1.SelectionGained
138
+ if _result_1 ~= nil then
139
+ _result_1(unpack(args))
140
+ end
141
+ end
142
+ end
143
+ _object_1.SelectionLost = function(...)
144
+ local args = { ... }
145
+ setFocused(false)
146
+ local _result_1 = caller
147
+ if _result_1 ~= nil then
148
+ _result_1 = _result_1.SelectionLost
149
+ if _result_1 ~= nil then
150
+ _result_1(unpack(args))
151
+ end
152
+ end
153
+ end
154
+ rest.Event = _object_1
155
+ local nodes = React.Children.toArray(props.children)
156
+ local painted = {}
157
+ local hasPad = false
158
+ local hasCorner = false
159
+ for _, node in nodes do
160
+ if not React.isValidElement(node) then
161
+ continue
162
+ end
163
+ local kind = hostKind(elementType(node))
164
+ if kind == "uipadding" then
165
+ hasPad = true
166
+ end
167
+ if kind == "uicorner" then
168
+ hasCorner = true
169
+ end
170
+ local patch = if kind ~= nil then layoutGapPatch(kind, elementProps(node), paint.gap) else nil
171
+ local _arg0 = if patch ~= nil then React.cloneElement(node, patch) else node
172
+ table.insert(painted, _arg0)
173
+ end
174
+ if not hasPad and paint.padding ~= nil then
175
+ local _arg0 = React.createElement("uipadding", paint.padding)
176
+ table.insert(painted, _arg0)
177
+ end
178
+ if not hasCorner and paint.corner ~= nil then
179
+ local _arg0 = React.createElement("uicorner", paint.corner)
180
+ table.insert(painted, _arg0)
181
+ end
182
+ local _object_2 = table.clone(paint.props)
183
+ setmetatable(_object_2, nil)
184
+ for _k, _v in rest do
185
+ _object_2[_k] = _v
186
+ end
187
+ _object_2.ref = function(instance)
188
+ bound.current = instance
189
+ setRef(props.hostRef, instance)
190
+ end
191
+ _object_2.children = painted
192
+ return React.createElement(tag, _object_2)
193
+ end
194
+ local default = SxHost
195
+ return {
196
+ default = default,
197
+ }
@@ -0,0 +1,11 @@
1
+ import { resolveSx, ResolvedSx, SxInput } from "../../../theme/styles/utilities/resolveSx";
2
+ import { StyleState } from "../../../theme/styles/utilities/resolveStyle";
3
+ export interface HostPaint {
4
+ props: {
5
+ [key: string]: unknown;
6
+ };
7
+ padding?: ResolvedSx["padding"];
8
+ corner?: ResolvedSx["corner"];
9
+ gap?: number;
10
+ }
11
+ export declare function paintHostStyle(theme: Parameters<typeof resolveSx>[0], base: object | undefined, className: object | undefined, sx: SxInput | undefined, width: number | undefined, state: StyleState | undefined): HostPaint;
@@ -0,0 +1,33 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local resolveSx = TS.import(script, script.Parent.Parent.Parent.Parent, "theme", "styles", "utilities", "resolveSx").resolveSx
4
+ local resolveStyle = TS.import(script, script.Parent.Parent.Parent.Parent, "theme", "styles", "utilities", "resolveStyle").resolveStyle
5
+ local function paintHostStyle(theme, base, className, sx, width, state)
6
+ local resolved = resolveSx(theme, sx, width)
7
+ local _object = {}
8
+ local _spread = (base or {})
9
+ if _spread then
10
+ for _k, _v in _spread do
11
+ _object[_k] = _v
12
+ end
13
+ end
14
+ local _spread_1 = (className or {})
15
+ if _spread_1 then
16
+ for _k, _v in _spread_1 do
17
+ _object[_k] = _v
18
+ end
19
+ end
20
+ for _k, _v in resolved.root do
21
+ _object[_k] = _v
22
+ end
23
+ local merged = _object
24
+ return {
25
+ props = resolveStyle(merged, state or {}),
26
+ padding = resolved.padding,
27
+ corner = resolved.corner,
28
+ gap = resolved.gap,
29
+ }
30
+ end
31
+ return {
32
+ paintHostStyle = paintHostStyle,
33
+ }
@@ -0,0 +1,15 @@
1
+ export declare function sxUsesBreakpoints(sx: object | undefined): boolean;
2
+ export declare function elementProps(element: unknown): {
3
+ [key: string]: unknown;
4
+ };
5
+ export declare function elementType(element: unknown): unknown;
6
+ export declare function hostKind(typeName: unknown): string | undefined;
7
+ /** Explicit layout padding wins. Otherwise sx `gap` fills the empty field. */
8
+ export declare function layoutGapPatch(kind: string, props: {
9
+ [key: string]: unknown;
10
+ }, gap: number | undefined): {
11
+ [key: string]: unknown;
12
+ } | undefined;
13
+ export declare function hostRest(props: object): {
14
+ [key: string]: unknown;
15
+ };
@@ -0,0 +1,92 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local SKIP = {
3
+ tag = true,
4
+ base = true,
5
+ className = true,
6
+ sx = true,
7
+ state = true,
8
+ hostRef = true,
9
+ children = true,
10
+ }
11
+ local function sxUsesBreakpoints(sx)
12
+ if sx == nil then
13
+ return false
14
+ end
15
+ for _, value in pairs(sx) do
16
+ if typeof(value) ~= "table" then
17
+ continue
18
+ end
19
+ local record = value
20
+ if record.phone ~= nil or record.tablet ~= nil or record.desktop ~= nil then
21
+ return true
22
+ end
23
+ end
24
+ return false
25
+ end
26
+ local function elementProps(element)
27
+ local _element = element
28
+ if typeof(_element) ~= "table" then
29
+ return {}
30
+ end
31
+ local props = element.props
32
+ if typeof(props) ~= "table" then
33
+ return {}
34
+ end
35
+ return props
36
+ end
37
+ local function elementType(element)
38
+ local _element = element
39
+ if typeof(_element) ~= "table" then
40
+ return nil
41
+ end
42
+ return element.type
43
+ end
44
+ local function hostKind(typeName)
45
+ local _typeName = typeName
46
+ if not (type(_typeName) == "string") then
47
+ return nil
48
+ end
49
+ return string.lower(typeName)
50
+ end
51
+ --* Explicit layout padding wins. Otherwise sx `gap` fills the empty field.
52
+ local function layoutGapPatch(kind, props, gap)
53
+ if gap == nil then
54
+ return nil
55
+ end
56
+ if kind == "uilistlayout" then
57
+ if props.Padding ~= nil then
58
+ return nil
59
+ end
60
+ return {
61
+ Padding = UDim.new(0, gap),
62
+ }
63
+ end
64
+ if kind == "uigridlayout" then
65
+ if props.CellPadding ~= nil then
66
+ return nil
67
+ end
68
+ return {
69
+ CellPadding = UDim2.new(0, gap, 0, gap),
70
+ }
71
+ end
72
+ return nil
73
+ end
74
+ local function hostRest(props)
75
+ local rest = {}
76
+ for key, value in pairs(props) do
77
+ local name = key
78
+ if SKIP[name] == true then
79
+ continue
80
+ end
81
+ rest[name] = value
82
+ end
83
+ return rest
84
+ end
85
+ return {
86
+ sxUsesBreakpoints = sxUsesBreakpoints,
87
+ elementProps = elementProps,
88
+ elementType = elementType,
89
+ hostKind = hostKind,
90
+ layoutGapPatch = layoutGapPatch,
91
+ hostRest = hostRest,
92
+ }
@@ -0,0 +1,3 @@
1
+ export { default as SxHost, SxHostProps } from "./components/SxHost";
2
+ export { paintHostStyle } from "./hostPaint";
3
+ export { elementProps, elementType, hostKind, hostRest, layoutGapPatch, sxUsesBreakpoints } from "./hostRules";
@@ -0,0 +1,13 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ exports.SxHost = TS.import(script, script, "components", "SxHost").default
5
+ exports.paintHostStyle = TS.import(script, script, "hostPaint").paintHostStyle
6
+ local _hostRules = TS.import(script, script, "hostRules")
7
+ exports.elementProps = _hostRules.elementProps
8
+ exports.elementType = _hostRules.elementType
9
+ exports.hostKind = _hostRules.hostKind
10
+ exports.hostRest = _hostRules.hostRest
11
+ exports.layoutGapPatch = _hostRules.layoutGapPatch
12
+ exports.sxUsesBreakpoints = _hostRules.sxUsesBreakpoints
13
+ return exports
@@ -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 useIconStyles = TS.import(script, script.Parent, "Icon.styles").default
5
6
  local function Icon(props)
6
7
  local _binding = props
@@ -12,29 +13,21 @@ local function Icon(props)
12
13
  local ref = _binding.ref
13
14
  local _binding_1 = useIconStyles(props)
14
15
  local container = _binding_1.container
15
- local _attributes = {}
16
+ local _attributes = {
17
+ tag = "imagelabel",
18
+ }
16
19
  local _condition = id
17
20
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
18
21
  _condition = "Icon"
19
22
  end
20
23
  _attributes.key = _condition
21
- _attributes.ref = ref
22
- for _k, _v in container do
23
- _attributes[_k] = _v
24
- end
25
- if className then
26
- for _k, _v in className do
27
- _attributes[_k] = _v
28
- end
29
- end
30
- if sx then
31
- for _k, _v in sx do
32
- _attributes[_k] = _v
33
- end
34
- end
24
+ _attributes.hostRef = ref
25
+ _attributes.base = container
26
+ _attributes.className = className
27
+ _attributes.sx = sx
35
28
  _attributes.Image = tostring(icon)
36
29
  _attributes.ImageColor3 = tint or container.ImageColor3
37
- return React.createElement("imagelabel", _attributes)
30
+ return React.createElement(SxHost, _attributes)
38
31
  end
39
32
  local default = Icon
40
33
  return {
@@ -5,6 +5,7 @@ local React = _react
5
5
  local useEffect = _react.useEffect
6
6
  local useState = _react.useState
7
7
  local useReducedMotion = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "hooks").useReducedMotion
8
+ local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
8
9
  local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
9
10
  local iconSpinnerPixels = TS.import(script, script.Parent.Parent.Parent, "button", "components", "buttonLook").iconSpinnerPixels
10
11
  local CircularProgress = TS.import(script, script.Parent.Parent.Parent, "circularProgress").CircularProgress
@@ -39,26 +40,25 @@ local function IconButton(props)
39
40
  setHovering(false)
40
41
  setFocused(false)
41
42
  end, { active })
42
- local _attributes = {}
43
+ local _attributes = {
44
+ tag = "imagebutton",
45
+ }
43
46
  local _condition = id
44
47
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
45
48
  _condition = "IconButton"
46
49
  end
47
50
  _attributes.key = _condition
48
- _attributes.ref = ref
49
- for _k, _v in container do
50
- _attributes[_k] = _v
51
- end
52
- if className then
53
- for _k, _v in className do
54
- _attributes[_k] = _v
55
- end
56
- end
57
- if sx then
58
- for _k, _v in sx do
59
- _attributes[_k] = _v
60
- end
61
- end
51
+ _attributes.hostRef = ref
52
+ _attributes.base = container
53
+ _attributes.className = className
54
+ _attributes.sx = sx
55
+ _attributes.state = {
56
+ disabled = disabled,
57
+ loading = loading,
58
+ selected = selected,
59
+ hover = hovering,
60
+ focused = focused,
61
+ }
62
62
  _attributes.Active = active
63
63
  _attributes.AutoButtonColor = active
64
64
  _attributes.Selectable = active
@@ -91,7 +91,7 @@ local function IconButton(props)
91
91
  }
92
92
  local _attributes_1 = table.clone(corner)
93
93
  setmetatable(_attributes_1, nil)
94
- return React.createElement("imagebutton", _attributes, React.createElement("uicorner", _attributes_1), loading and (React.createElement(CircularProgress, {
94
+ return React.createElement(SxHost, _attributes, React.createElement("uicorner", _attributes_1), loading and (React.createElement(CircularProgress, {
95
95
  size = iconSpinnerPixels(props.size),
96
96
  thickness = 2,
97
97
  color = tint,
@@ -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 imageListTitle = TS.import(script, script.Parent, "imageListLayout").imageListTitle
5
6
  local useImageListStyles = TS.import(script, script.Parent, "ImageList.styles").default
6
7
  local function ImageList(props)
@@ -19,26 +20,18 @@ local function ImageList(props)
19
20
  gap = gap,
20
21
  itemSize = itemSize,
21
22
  })
22
- local _attributes = {}
23
+ local _attributes = {
24
+ tag = "frame",
25
+ }
23
26
  local _condition = id
24
27
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
25
28
  _condition = "ImageList"
26
29
  end
27
30
  _attributes.key = _condition
28
- _attributes.ref = ref
29
- for _k, _v in styles.root do
30
- _attributes[_k] = _v
31
- end
32
- if className then
33
- for _k, _v in className do
34
- _attributes[_k] = _v
35
- end
36
- end
37
- if sx then
38
- for _k, _v in sx do
39
- _attributes[_k] = _v
40
- end
41
- end
31
+ _attributes.hostRef = ref
32
+ _attributes.base = styles.root
33
+ _attributes.className = className
34
+ _attributes.sx = sx
42
35
  local _attributes_1 = table.clone(styles.grid)
43
36
  setmetatable(_attributes_1, nil)
44
37
  local _exp = React.createElement("uigridlayout", _attributes_1)
@@ -92,7 +85,7 @@ local function ImageList(props)
92
85
  _newValue[_k] = _callback(_v, _k - 1, items)
93
86
  end
94
87
  -- ▲ ReadonlyArray.map ▲
95
- return React.createElement("frame", _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
88
+ return React.createElement(SxHost, _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
96
89
  end
97
90
  local default = ImageList
98
91
  return {
@@ -1,6 +1,7 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
2
  local TS = _G[script]
3
3
  local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
4
+ local Common = _theme.Common
4
5
  local componentStyles = _theme.componentStyles
5
6
  local createStyles = _theme.createStyles
6
7
  local _imageListLayout = TS.import(script, script.Parent, "imageListLayout")
@@ -50,12 +51,12 @@ local useImageListStyles = componentStyles("ImageList", function(theme, _param)
50
51
  title = {
51
52
  Size = UDim2.new(1, 0, 0, bar),
52
53
  Position = UDim2.new(0, 0, 1, -bar),
53
- BackgroundColor3 = theme.palette.surface.overlay,
54
- BackgroundTransparency = 0.25,
54
+ BackgroundColor3 = theme.palette.backdrop,
55
+ BackgroundTransparency = 0.35,
55
56
  BorderSizePixel = 0,
56
57
  Font = theme.typography.fontFamilies.default,
57
58
  TextSize = theme.typography.fontSizes.caption,
58
- TextColor3 = theme.palette.text.inverse,
59
+ TextColor3 = Common.White,
59
60
  TextXAlignment = Enum.TextXAlignment.Left,
60
61
  TextTruncate = Enum.TextTruncate.AtEnd,
61
62
  ZIndex = 2,