@rbxts/uiblox 0.2.0-alpha.37 → 0.2.0-alpha.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 (212) hide show
  1. package/README.md +1 -18
  2. package/out/theme/constants/NumberConstants.d.ts +10 -0
  3. package/out/theme/constants/NumberConstants.luau +12 -0
  4. package/out/theme/interfaces/density/controlMetrics.luau +2 -2
  5. package/out/theme/interfaces/palette/Palette.d.ts +7 -0
  6. package/out/theme/interfaces/spacing/Shape.d.ts +6 -0
  7. package/out/theme/interfaces/theme/Theme.d.ts +6 -0
  8. package/out/theme/interfaces/typography/FontFamilies.luau +1 -0
  9. package/out/theme/interfaces/typography/FontFamilyOptions.d.ts +1 -1
  10. package/out/theme/interfaces/typography/FontSizeOptions.d.ts +1 -1
  11. package/out/theme/interfaces/typography/FontSizes.luau +2 -0
  12. package/out/theme/interfaces/typography/Variants.d.ts +3 -1
  13. package/out/theme/interfaces/typography/Variants.luau +25 -1
  14. package/out/theme/styles/utilities/focusRing.d.ts +2 -0
  15. package/out/theme/styles/utilities/focusRing.luau +3 -0
  16. package/out/theme/styles/utilities/index.d.ts +1 -1
  17. package/out/theme/styles/utilities/init.luau +3 -1
  18. package/out/theme/themes/DarkTheme.luau +4 -0
  19. package/out/theme/themes/LightTheme.luau +4 -0
  20. package/out/theme/themes/createPalette.luau +15 -0
  21. package/out/ui/packages/accordion/components/Accordion.luau +84 -40
  22. package/out/ui/packages/accordion/components/Accordion.styles.luau +35 -17
  23. package/out/ui/packages/alert/components/Alert.luau +15 -11
  24. package/out/ui/packages/alert/components/Alert.styles.luau +37 -26
  25. package/out/ui/packages/appBar/components/AppBar.luau +35 -13
  26. package/out/ui/packages/appBar/components/AppBar.styles.luau +41 -35
  27. package/out/ui/packages/autocomplete/components/Autocomplete.luau +4 -0
  28. package/out/ui/packages/avatar/components/Avatar.d.ts +2 -0
  29. package/out/ui/packages/avatar/components/Avatar.luau +9 -2
  30. package/out/ui/packages/avatar/components/Avatar.styles.luau +7 -0
  31. package/out/ui/packages/avatarGroup/components/AvatarGroup.luau +9 -4
  32. package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.luau +6 -1
  33. package/out/ui/packages/badge/components/Badge.luau +14 -11
  34. package/out/ui/packages/badge/components/Badge.styles.luau +5 -1
  35. package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +4 -3
  36. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +6 -2
  37. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.styles.luau +4 -0
  38. package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +20 -2
  39. package/out/ui/packages/brickColorPicker/components/BrickColorPicker.styles.luau +72 -66
  40. package/out/ui/packages/button/components/Button.luau +61 -34
  41. package/out/ui/packages/button/components/buttonPaint.d.ts +16 -0
  42. package/out/ui/packages/button/components/buttonPaint.luau +70 -0
  43. package/out/ui/packages/buttonGroup/components/ButtonGroup.d.ts +1 -0
  44. package/out/ui/packages/buttonGroup/components/ButtonGroup.luau +17 -2
  45. package/out/ui/packages/card/components/Card.styles.luau +4 -2
  46. package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +9 -1
  47. package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +50 -41
  48. package/out/ui/packages/checkbox/components/Checkbox.luau +5 -4
  49. package/out/ui/packages/checkbox/components/checkboxLook.d.ts +2 -2
  50. package/out/ui/packages/checkbox/components/checkboxLook.luau +2 -2
  51. package/out/ui/packages/chip/components/Chip.luau +16 -14
  52. package/out/ui/packages/chip/components/Chip.styles.luau +7 -4
  53. package/out/ui/packages/circularProgress/components/CircularProgress.luau +10 -3
  54. package/out/ui/packages/codeEditor/components/CodeEditor.d.ts +12 -0
  55. package/out/ui/packages/codeEditor/components/CodeEditor.luau +262 -0
  56. package/out/ui/packages/codeEditor/components/CodeEditor.styles.d.ts +6 -0
  57. package/out/ui/packages/codeEditor/components/CodeEditor.styles.luau +124 -0
  58. package/out/ui/packages/codeEditor/highlightCode.d.ts +11 -0
  59. package/out/ui/packages/codeEditor/highlightCode.luau +503 -0
  60. package/out/ui/packages/codeEditor/index.d.ts +2 -0
  61. package/out/ui/packages/codeEditor/init.luau +5 -0
  62. package/out/ui/packages/colorPicker/components/ColorPicker.luau +9 -1
  63. package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +74 -67
  64. package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +12 -4
  65. package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +12 -4
  66. package/out/ui/packages/dateRange/components/DateRangePicker.luau +31 -19
  67. package/out/ui/packages/dialog/components/Dialog.styles.luau +4 -2
  68. package/out/ui/packages/divider/components/Divider.luau +3 -1
  69. package/out/ui/packages/divider/components/Divider.styles.luau +1 -0
  70. package/out/ui/packages/drawer/components/Drawer.d.ts +1 -0
  71. package/out/ui/packages/drawer/components/Drawer.luau +43 -14
  72. package/out/ui/packages/drawer/components/Drawer.styles.luau +13 -5
  73. package/out/ui/packages/drawer/components/drawerPlacement.d.ts +2 -0
  74. package/out/ui/packages/drawer/components/drawerPlacement.luau +18 -0
  75. package/out/ui/packages/editorFace.d.ts +22 -0
  76. package/out/ui/packages/editorFace.luau +49 -0
  77. package/out/ui/packages/fab/components/Fab.luau +19 -6
  78. package/out/ui/packages/fab/components/Fab.styles.luau +4 -3
  79. package/out/ui/packages/fab/components/fabSize.d.ts +1 -1
  80. package/out/ui/packages/fontEditor/components/FontEditor.luau +13 -3
  81. package/out/ui/packages/fontEditor/components/FontEditor.styles.luau +36 -27
  82. package/out/ui/packages/gradientEditor/components/GradientEditor.luau +21 -13
  83. package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +52 -44
  84. package/out/ui/packages/icon/components/DrawnGlyph.d.ts +11 -0
  85. package/out/ui/packages/icon/components/DrawnGlyph.luau +87 -0
  86. package/out/ui/packages/icon/components/Icon.d.ts +6 -2
  87. package/out/ui/packages/icon/components/Icon.luau +23 -3
  88. package/out/ui/packages/icon/components/Icon.styles.luau +3 -0
  89. package/out/ui/packages/icon/components/glyphs.d.ts +28 -0
  90. package/out/ui/packages/icon/components/glyphs.luau +64 -0
  91. package/out/ui/packages/icon/index.d.ts +1 -0
  92. package/out/ui/packages/iconButton/components/IconButton.d.ts +5 -2
  93. package/out/ui/packages/iconButton/components/IconButton.luau +83 -16
  94. package/out/ui/packages/iconButton/components/IconButton.styles.luau +4 -27
  95. package/out/ui/packages/iconButton/components/iconButtonBox.d.ts +11 -0
  96. package/out/ui/packages/iconButton/components/iconButtonBox.luau +48 -0
  97. package/out/ui/packages/iconButton/components/transportGlyph.d.ts +1 -0
  98. package/out/ui/packages/iconButton/components/transportGlyph.luau +4 -0
  99. package/out/ui/packages/imageList/components/ImageList.luau +11 -36
  100. package/out/ui/packages/imageList/components/ImageList.styles.luau +1 -0
  101. package/out/ui/packages/imageList/components/imageListLayout.d.ts +0 -2
  102. package/out/ui/packages/imageList/components/imageListLayout.luau +0 -8
  103. package/out/ui/packages/index.d.ts +1 -0
  104. package/out/ui/packages/init.luau +3 -0
  105. package/out/ui/packages/input/components/Input.luau +46 -29
  106. package/out/ui/packages/input/components/Input.styles.luau +8 -11
  107. package/out/ui/packages/input/components/fieldChrome.d.ts +5 -0
  108. package/out/ui/packages/input/components/fieldChrome.luau +11 -0
  109. package/out/ui/packages/layout/components/Box.luau +92 -13
  110. package/out/ui/packages/layout/components/Box.styles.d.ts +0 -2
  111. package/out/ui/packages/layout/components/Box.styles.luau +0 -9
  112. package/out/ui/packages/layout/components/Grid.luau +81 -16
  113. package/out/ui/packages/layout/components/Pad.d.ts +24 -0
  114. package/out/ui/packages/layout/components/Pad.luau +88 -0
  115. package/out/ui/packages/layout/components/Stack.luau +79 -13
  116. package/out/ui/packages/link/components/Link.luau +19 -13
  117. package/out/ui/packages/link/components/Link.styles.luau +10 -1
  118. package/out/ui/packages/listItem/components/ListItem.luau +61 -4
  119. package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
  120. package/out/ui/packages/listItem/components/ListItem.styles.luau +28 -11
  121. package/out/ui/packages/listItem/components/listItemInk.d.ts +1 -1
  122. package/out/ui/packages/listItem/components/listItemLayout.d.ts +12 -2
  123. package/out/ui/packages/listItem/components/listItemLayout.luau +29 -2
  124. package/out/ui/packages/markdown/components/Markdown.luau +163 -50
  125. package/out/ui/packages/markdown/components/Markdown.styles.luau +125 -76
  126. package/out/ui/packages/markdown/components/MarkdownEditor.luau +215 -146
  127. package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +1 -0
  128. package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +153 -83
  129. package/out/ui/packages/markdown/index.d.ts +1 -1
  130. package/out/ui/packages/markdown/parseMarkdown.d.ts +9 -1
  131. package/out/ui/packages/markdown/parseMarkdown.luau +350 -29
  132. package/out/ui/packages/menu/components/Menu.d.ts +1 -1
  133. package/out/ui/packages/menu/components/Menu.luau +12 -11
  134. package/out/ui/packages/menu/components/Menu.styles.luau +6 -1
  135. package/out/ui/packages/menu/components/menuIcon.d.ts +1 -1
  136. package/out/ui/packages/numberInput/components/NumberInput.luau +19 -4
  137. package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +9 -1
  138. package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.styles.luau +23 -16
  139. package/out/ui/packages/pager/components/Pager.luau +15 -13
  140. package/out/ui/packages/pager/components/Pager.styles.luau +5 -0
  141. package/out/ui/packages/pagination/components/Pagination.styles.luau +4 -1
  142. package/out/ui/packages/paper/components/Paper.luau +17 -11
  143. package/out/ui/packages/paper/components/Paper.styles.luau +12 -5
  144. package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +9 -1
  145. package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +24 -19
  146. package/out/ui/packages/popover/components/Popover.d.ts +1 -1
  147. package/out/ui/packages/popover/components/Popover.luau +6 -4
  148. package/out/ui/packages/popover/components/Popover.styles.luau +6 -0
  149. package/out/ui/packages/popup/components/Popup.d.ts +2 -0
  150. package/out/ui/packages/popup/components/Popup.luau +64 -2
  151. package/out/ui/packages/popup/components/placement.luau +6 -4
  152. package/out/ui/packages/progressBar/components/ProgressBar.luau +1 -1
  153. package/out/ui/packages/progressBar/components/ProgressBar.styles.luau +3 -2
  154. package/out/ui/packages/radioGroup/components/RadioGroup.luau +2 -1
  155. package/out/ui/packages/rating/components/Rating.luau +45 -3
  156. package/out/ui/packages/rating/components/Rating.styles.luau +1 -1
  157. package/out/ui/packages/rayEditor/components/RayEditor.luau +9 -1
  158. package/out/ui/packages/rayEditor/components/RayEditor.styles.luau +17 -11
  159. package/out/ui/packages/rectEditor/components/RectEditor.luau +9 -1
  160. package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +49 -42
  161. package/out/ui/packages/select/components/Select.d.ts +2 -0
  162. package/out/ui/packages/select/components/Select.luau +148 -106
  163. package/out/ui/packages/select/components/Select.styles.d.ts +2 -0
  164. package/out/ui/packages/select/components/Select.styles.luau +29 -5
  165. package/out/ui/packages/shadow/components/Shadow.luau +188 -19
  166. package/out/ui/packages/sidebar/components/Sidebar.styles.luau +1 -0
  167. package/out/ui/packages/skeleton/components/Skeleton.luau +4 -0
  168. package/out/ui/packages/slider/components/RangeSlider.luau +6 -5
  169. package/out/ui/packages/slider/components/Slider.luau +11 -16
  170. package/out/ui/packages/sparkline/components/Sparkline.luau +7 -5
  171. package/out/ui/packages/speedDial/components/SpeedDial.luau +4 -1
  172. package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +5 -0
  173. package/out/ui/packages/speedDial/components/speedDialLabel.d.ts +1 -1
  174. package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
  175. package/out/ui/packages/stepper/components/Stepper.styles.luau +9 -6
  176. package/out/ui/packages/switch/components/Switch.luau +2 -2
  177. package/out/ui/packages/switch/components/switchLook.d.ts +3 -3
  178. package/out/ui/packages/switch/components/switchLook.luau +4 -10
  179. package/out/ui/packages/table/components/Table.d.ts +1 -0
  180. package/out/ui/packages/table/components/Table.luau +92 -53
  181. package/out/ui/packages/table/components/Table.styles.luau +23 -6
  182. package/out/ui/packages/table/components/tableColumns.d.ts +2 -0
  183. package/out/ui/packages/table/components/tableColumns.luau +2 -0
  184. package/out/ui/packages/tabs/components/Tabs.luau +7 -4
  185. package/out/ui/packages/tabs/components/Tabs.styles.luau +12 -11
  186. package/out/ui/packages/tabs/components/tabIndicator.d.ts +7 -0
  187. package/out/ui/packages/tabs/components/tabIndicator.luau +21 -0
  188. package/out/ui/packages/text/components/Text.d.ts +2 -0
  189. package/out/ui/packages/text/components/Text.luau +12 -2
  190. package/out/ui/packages/timeField/components/TimeField.luau +11 -7
  191. package/out/ui/packages/timeline/components/Timeline.luau +35 -32
  192. package/out/ui/packages/timeline/components/Timeline.styles.luau +19 -10
  193. package/out/ui/packages/toast/components/Toast.luau +168 -72
  194. package/out/ui/packages/toast/components/Toast.styles.luau +36 -19
  195. package/out/ui/packages/toast/components/toastPlace.d.ts +4 -0
  196. package/out/ui/packages/toast/components/toastPlace.luau +13 -0
  197. package/out/ui/packages/toast/enums/ToastVariants.d.ts +2 -1
  198. package/out/ui/packages/toast/enums/ToastVariants.luau +1 -0
  199. package/out/ui/packages/toggleButton/components/ToggleButton.luau +43 -4
  200. package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +1 -1
  201. package/out/ui/packages/tooltip/components/Tooltip.styles.luau +2 -2
  202. package/out/ui/packages/treeView/components/TreeView.luau +12 -13
  203. package/out/ui/packages/treeView/components/TreeView.styles.luau +6 -0
  204. package/out/ui/packages/typography/components/Typography.d.ts +2 -0
  205. package/out/ui/packages/typography/components/Typography.luau +8 -0
  206. package/out/ui/packages/typography/components/Typography.styles.luau +3 -1
  207. package/out/ui/packages/udimEditor/components/UDimEditor.luau +9 -1
  208. package/out/ui/packages/udimEditor/components/UDimEditor.styles.luau +25 -18
  209. package/out/ui/packages/vectorEditor/components/VectorEditor.luau +17 -3
  210. package/out/ui/packages/vectorEditor/components/VectorEditor.styles.luau +30 -16
  211. package/out/ui/packages/virtualList/components/VirtualList.styles.luau +1 -0
  212. package/package.json +69 -67
@@ -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 useEditorHover = TS.import(script, script.Parent.Parent.Parent, "editorFace").useEditorHover
4
5
  local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
5
6
  local VectorEditor = TS.import(script, script.Parent.Parent.Parent, "vectorEditor").VectorEditor
6
7
  local useRayEditorStyles = TS.import(script, script.Parent, "RayEditor.styles").default
@@ -14,6 +15,7 @@ local function RayEditor(props)
14
15
  local id = _binding.id
15
16
  local ref = _binding.ref
16
17
  local styles = useRayEditorStyles()
18
+ local hover = useEditorHover(disabled)
17
19
  local _attributes = {
18
20
  tag = "frame",
19
21
  }
@@ -23,12 +25,18 @@ local function RayEditor(props)
23
25
  end
24
26
  _attributes.key = _condition
25
27
  _attributes.hostRef = ref
26
- _attributes.base = styles.root
28
+ local _object = table.clone(styles.root)
29
+ setmetatable(_object, nil)
30
+ for _k, _v in hover.face do
31
+ _object[_k] = _v
32
+ end
33
+ _attributes.base = _object
27
34
  _attributes.className = className
28
35
  _attributes.sx = sx
29
36
  _attributes.state = {
30
37
  disabled = disabled,
31
38
  }
39
+ _attributes.Event = hover.event
32
40
  local _attributes_1 = table.clone(styles.column)
33
41
  setmetatable(_attributes_1, nil)
34
42
  local _exp = React.createElement("uilistlayout", _attributes_1)
@@ -3,8 +3,11 @@ local TS = _G[script]
3
3
  local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
4
4
  local createStyles = _theme.createStyles
5
5
  local componentStyles = _theme.componentStyles
6
+ local _editorFace = TS.import(script, script.Parent.Parent.Parent, "editorFace")
7
+ local editorPad = _editorFace.editorPad
8
+ local editorText = _editorFace.editorText
6
9
  local useRayEditorStyles = componentStyles("RayEditor", function(theme)
7
- return createStyles({
10
+ local _object = {
8
11
  root = {
9
12
  Size = UDim2.new(1, 0, 0, 0),
10
13
  AutomaticSize = Enum.AutomaticSize.Y,
@@ -13,7 +16,7 @@ local useRayEditorStyles = componentStyles("RayEditor", function(theme)
13
16
  },
14
17
  column = {
15
18
  FillDirection = Enum.FillDirection.Vertical,
16
- Padding = UDim.new(0, theme.padding.calc(1)),
19
+ Padding = UDim.new(0, editorPad(theme)),
17
20
  SortOrder = Enum.SortOrder.LayoutOrder,
18
21
  },
19
22
  row = {
@@ -21,15 +24,18 @@ local useRayEditorStyles = componentStyles("RayEditor", function(theme)
21
24
  AutomaticSize = Enum.AutomaticSize.Y,
22
25
  BackgroundTransparency = 1,
23
26
  },
24
- label = {
25
- Size = UDim2.new(1, 0, 0, theme.spacing.calc(1.5)),
26
- BackgroundTransparency = 1,
27
- Font = theme.typography.fontFamilies.default,
28
- TextSize = theme.typography.fontSizes.caption,
29
- TextColor3 = theme.palette.text.secondary,
30
- TextXAlignment = Enum.TextXAlignment.Left,
31
- },
32
- })
27
+ }
28
+ local _left = "label"
29
+ local _object_1 = {
30
+ Size = UDim2.new(1, 0, 0, theme.spacing.calc(1.5)),
31
+ BackgroundTransparency = 1,
32
+ TextColor3 = theme.palette.text.secondary,
33
+ }
34
+ for _k, _v in editorText(theme) do
35
+ _object_1[_k] = _v
36
+ end
37
+ _object[_left] = _object_1
38
+ return createStyles(_object)
33
39
  end)
34
40
  local default = useRayEditorStyles
35
41
  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 useEditorHover = TS.import(script, script.Parent.Parent.Parent, "editorFace").useEditorHover
4
5
  local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
5
6
  local NumberInput = TS.import(script, script.Parent.Parent.Parent, "numberInput").NumberInput
6
7
  local useRectEditorStyles = TS.import(script, script.Parent, "RectEditor.styles").default
@@ -22,6 +23,7 @@ local function RectEditor(props)
22
23
  local id = _binding.id
23
24
  local ref = _binding.ref
24
25
  local styles = useRectEditorStyles()
26
+ local hover = useEditorHover(disabled)
25
27
  local amounts = {
26
28
  MinX = value.Min.X,
27
29
  MinY = value.Min.Y,
@@ -41,12 +43,18 @@ local function RectEditor(props)
41
43
  end
42
44
  _attributes.key = _condition
43
45
  _attributes.hostRef = ref
44
- _attributes.base = styles.root
46
+ local _object = table.clone(styles.root)
47
+ setmetatable(_object, nil)
48
+ for _k, _v in hover.face do
49
+ _object[_k] = _v
50
+ end
51
+ _attributes.base = _object
45
52
  _attributes.className = className
46
53
  _attributes.sx = sx
47
54
  _attributes.state = {
48
55
  disabled = disabled,
49
56
  }
57
+ _attributes.Event = hover.event
50
58
  local _attributes_1 = table.clone(styles.wrap)
51
59
  setmetatable(_attributes_1, nil)
52
60
  local _exp = React.createElement("uilistlayout", _attributes_1)
@@ -4,9 +4,12 @@ local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "the
4
4
  local controlMetrics = _theme.controlMetrics
5
5
  local createStyles = _theme.createStyles
6
6
  local componentStyles = _theme.componentStyles
7
+ local _editorFace = TS.import(script, script.Parent.Parent.Parent, "editorFace")
8
+ local editorPad = _editorFace.editorPad
9
+ local editorText = _editorFace.editorText
7
10
  local useRectEditorStyles = componentStyles("RectEditor", function(theme)
8
- local gap = theme.padding.calc(1)
9
- return createStyles({
11
+ local gap = editorPad(theme)
12
+ local _object = {
10
13
  root = {
11
14
  Size = UDim2.new(1, 0, 0, 0),
12
15
  AutomaticSize = Enum.AutomaticSize.Y,
@@ -15,53 +18,57 @@ local useRectEditorStyles = componentStyles("RectEditor", function(theme)
15
18
  },
16
19
  wrap = {
17
20
  FillDirection = Enum.FillDirection.Vertical,
18
- Padding = UDim.new(0, theme.padding.calc(0.5)),
19
- SortOrder = Enum.SortOrder.LayoutOrder,
20
- },
21
- group = {
22
- Size = UDim2.new(1, 0, 0, 0),
23
- AutomaticSize = Enum.AutomaticSize.Y,
24
- BackgroundTransparency = 1,
25
- },
26
- groupLabel = {
27
- Size = UDim2.new(1, 0, 0, 0),
28
- AutomaticSize = Enum.AutomaticSize.Y,
29
- BackgroundTransparency = 1,
30
- Font = theme.typography.fontFamilies.default,
31
- TextSize = theme.typography.fontSizes.caption,
32
- TextColor3 = theme.palette.text.secondary,
33
- TextXAlignment = Enum.TextXAlignment.Left,
34
- },
35
- pair = {
36
- FillDirection = Enum.FillDirection.Horizontal,
37
21
  Padding = UDim.new(0, gap),
38
22
  SortOrder = Enum.SortOrder.LayoutOrder,
39
23
  },
40
- cell = {
41
- Size = UDim2.new(0.5, -gap / 2, 0, 0),
42
- AutomaticSize = Enum.AutomaticSize.Y,
43
- BackgroundTransparency = 1,
44
- },
45
- stack = {
46
- FillDirection = Enum.FillDirection.Vertical,
47
- Padding = UDim.new(0, theme.padding.calc(0.5)),
48
- SortOrder = Enum.SortOrder.LayoutOrder,
49
- },
50
- label = {
24
+ group = {
51
25
  Size = UDim2.new(1, 0, 0, 0),
52
26
  AutomaticSize = Enum.AutomaticSize.Y,
53
27
  BackgroundTransparency = 1,
54
- Font = theme.typography.fontFamilies.default,
55
- TextSize = theme.typography.fontSizes.caption,
56
- TextColor3 = theme.palette.text.secondary,
57
- TextXAlignment = Enum.TextXAlignment.Left,
58
- TextTruncate = Enum.TextTruncate.AtEnd,
59
- },
60
- field = {
61
- Size = UDim2.new(1, 0, 0, controlMetrics(theme.density).height),
62
- BackgroundTransparency = 1,
63
28
  },
64
- })
29
+ }
30
+ local _left = "groupLabel"
31
+ local _object_1 = {
32
+ Size = UDim2.new(1, 0, 0, 0),
33
+ AutomaticSize = Enum.AutomaticSize.Y,
34
+ BackgroundTransparency = 1,
35
+ TextColor3 = theme.palette.text.secondary,
36
+ }
37
+ for _k, _v in editorText(theme) do
38
+ _object_1[_k] = _v
39
+ end
40
+ _object[_left] = _object_1
41
+ _object.pair = {
42
+ FillDirection = Enum.FillDirection.Horizontal,
43
+ Padding = UDim.new(0, gap),
44
+ SortOrder = Enum.SortOrder.LayoutOrder,
45
+ }
46
+ _object.cell = {
47
+ Size = UDim2.new(0.5, -gap / 2, 0, 0),
48
+ AutomaticSize = Enum.AutomaticSize.Y,
49
+ BackgroundTransparency = 1,
50
+ }
51
+ _object.stack = {
52
+ FillDirection = Enum.FillDirection.Vertical,
53
+ Padding = UDim.new(0, gap),
54
+ SortOrder = Enum.SortOrder.LayoutOrder,
55
+ }
56
+ local _left_1 = "label"
57
+ local _object_2 = {
58
+ Size = UDim2.new(1, 0, 0, 0),
59
+ AutomaticSize = Enum.AutomaticSize.Y,
60
+ BackgroundTransparency = 1,
61
+ TextColor3 = theme.palette.text.secondary,
62
+ }
63
+ for _k, _v in editorText(theme) do
64
+ _object_2[_k] = _v
65
+ end
66
+ _object[_left_1] = _object_2
67
+ _object.field = {
68
+ Size = UDim2.new(1, 0, 0, controlMetrics(theme.density).height),
69
+ BackgroundTransparency = 1,
70
+ }
71
+ return createStyles(_object)
65
72
  end)
66
73
  local default = useRectEditorStyles
67
74
  return {
@@ -16,6 +16,8 @@ export interface SelectProps<T> {
16
16
  empty?: React.Element;
17
17
  reducedMotion?: boolean;
18
18
  size?: ControlSize;
19
+ hasError?: boolean;
20
+ helperText?: string;
19
21
  }
20
22
  declare function Select<T>(props: CustomizedProps<Frame, SelectProps<T>>): JSX.Element;
21
23
  export default Select;
@@ -17,6 +17,7 @@ local useTheme = _theme.useTheme
17
17
  local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
18
18
  local spinnerPixels = TS.import(script, script.Parent.Parent.Parent, "button", "components", "buttonLook").spinnerPixels
19
19
  local CircularProgress = TS.import(script, script.Parent.Parent.Parent, "circularProgress").CircularProgress
20
+ local Icon = TS.import(script, script.Parent.Parent.Parent, "icon").Icon
20
21
  local Input = TS.import(script, script.Parent.Parent.Parent, "input").Input
21
22
  local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
22
23
  local Popup = TS.import(script, script.Parent.Parent.Parent, "popup").Popup
@@ -38,6 +39,7 @@ local _selectMulti = TS.import(script, script.Parent, "selectMulti")
38
39
  local includesChoice = _selectMulti.includesChoice
39
40
  local selectionLabel = _selectMulti.selectionLabel
40
41
  local typeaheadChoice = TS.import(script, script.Parent, "selectTypeahead").typeaheadChoice
42
+ local fieldChrome = TS.import(script, script.Parent.Parent.Parent, "input", "components", "fieldChrome").fieldChrome
41
43
  local selectWidth = TS.import(script, script.Parent, "selectWidth").selectWidth
42
44
  local stepChoice = TS.import(script, script.Parent, "stepChoice").stepChoice
43
45
  local function Select(props)
@@ -62,6 +64,11 @@ local function Select(props)
62
64
  local empty = _binding.empty
63
65
  local reducedProp = _binding.reducedMotion
64
66
  local size = _binding.size
67
+ local hasError = _binding.hasError
68
+ if hasError == nil then
69
+ hasError = false
70
+ end
71
+ local helperText = _binding.helperText
65
72
  local className = _binding.className
66
73
  local sx = _binding.sx
67
74
  local id = _binding.id
@@ -69,10 +76,13 @@ local function Select(props)
69
76
  local reducedMotion = useReducedMotion(reducedProp)
70
77
  local styles = useSelectStyles({
71
78
  size = size,
79
+ hasError = hasError,
80
+ helperText = helperText,
72
81
  })
73
82
  local _binding_1 = useTheme()
74
83
  local theme = _binding_1.theme
75
84
  local metrics = controlMetrics(theme.density, size)
85
+ local mark = metrics.icon
76
86
  local row = metrics.height
77
87
  local active = canActivate(disabled, loading)
78
88
  local anchor, setAnchor = useState()
@@ -117,7 +127,7 @@ local function Select(props)
117
127
  widest = bounds.X
118
128
  end
119
129
  end
120
- local pad = theme.padding.calc(1.5) * 2
130
+ local pad = fieldChrome(metrics.height, theme.padding.calc(1)).padX * 2
121
131
  local floor = if anchor ~= nil then anchor.AbsoluteSize.X else 0
122
132
  local popupWidth = if #rows == 0 then 0 else selectWidth(widest, pad, floor)
123
133
  local _condition_1 = empty
@@ -281,7 +291,7 @@ local function Select(props)
281
291
  key = "Trigger",
282
292
  ref = setAnchor,
283
293
  }
284
- for _k, _v in cx(styles.trigger, current == nil and styles.placeholder, not active and {
294
+ for _k, _v in cx(styles.trigger, current == nil and styles.placeholder, hasError and styles.errorText, not active and {
285
295
  TextTransparency = 0.5,
286
296
  }) do
287
297
  _attributes_1[_k] = _v
@@ -321,134 +331,166 @@ local function Select(props)
321
331
  return onKey(input, true)
322
332
  end,
323
333
  }
324
- local _attributes_2 = table.clone(cx(styles.padding, loading and {
325
- PaddingRight = UDim.new(0, theme.padding.calc(1.5) + spinnerPixels(size) + theme.padding.calc(1)),
334
+ local _attributes_2 = table.clone(cx(styles.padding, {
335
+ PaddingRight = UDim.new(0, theme.padding.calc(1) + (if loading then spinnerPixels(size) else mark) + theme.padding.calc(1)),
326
336
  }))
327
337
  setmetatable(_attributes_2, nil)
328
338
  local _exp = React.createElement("uipadding", _attributes_2)
329
339
  local _attributes_3 = table.clone(styles.corner)
330
340
  setmetatable(_attributes_3, nil)
331
341
  local _exp_1 = React.createElement("uicorner", _attributes_3)
332
- local _attributes_4 = table.clone(cx(styles.stroke, focused and styles.focusStroke))
342
+ local _exp_2 = styles.stroke
343
+ local _condition_3 = focused
344
+ if _condition_3 then
345
+ local _result_2
346
+ if hasError then
347
+ local _object = table.clone(styles.focusStroke)
348
+ setmetatable(_object, nil)
349
+ _object.Color = theme.palette.status.error.main
350
+ _result_2 = _object
351
+ else
352
+ _result_2 = styles.focusStroke
353
+ end
354
+ _condition_3 = _result_2
355
+ end
356
+ local _attributes_4 = table.clone(cx(_exp_2, _condition_3))
333
357
  setmetatable(_attributes_4, nil)
334
- local _exp_2 = React.createElement("textbutton", _attributes_1, _exp, _exp_1, React.createElement("uistroke", _attributes_4), loading and (React.createElement(CircularProgress, {
358
+ local _exp_3 = React.createElement("textbutton", _attributes_1, _exp, _exp_1, React.createElement("uistroke", _attributes_4), if loading then (React.createElement(CircularProgress, {
335
359
  size = spinnerPixels(size),
336
360
  thickness = 2,
337
361
  color = theme.palette.text.secondary,
338
362
  reducedMotion = reducedMotion,
339
363
  className = {
340
364
  AnchorPoint = Vector2.new(1, 0.5),
341
- Position = UDim2.new(1, -theme.padding.calc(1), 0.5, 0),
365
+ Position = UDim2.new(1, spinnerPixels(size) + theme.padding.calc(1), 0.5, 0),
366
+ },
367
+ })) else (React.createElement(Icon, {
368
+ id = "Chevron",
369
+ glyph = "chevronDown",
370
+ size = mark,
371
+ tint = theme.palette.text.secondary,
372
+ className = {
373
+ AnchorPoint = Vector2.new(1, 0.5),
374
+ Position = UDim2.new(1, mark + theme.padding.calc(1), 0.5, 0),
375
+ Rotation = if shown then 180 else 0,
342
376
  },
343
377
  })))
344
- local _condition_3 = shown
345
- if _condition_3 then
378
+ local _condition_4 = helperText ~= nil
379
+ if _condition_4 then
346
380
  local _attributes_5 = {
347
- key = "Menu",
381
+ key = "Helper",
348
382
  }
349
- for _k, _v in styles.menu do
383
+ for _k, _v in styles.helper do
350
384
  _attributes_5[_k] = _v
351
385
  end
352
- local _exp_3 = React.createElement(Shadow)
353
- local _attributes_6 = table.clone(styles.corner)
354
- setmetatable(_attributes_6, nil)
355
- local _exp_4 = React.createElement("uicorner", _attributes_6)
356
- local _attributes_7 = table.clone(styles.stroke)
357
- setmetatable(_attributes_7, nil)
358
- local _exp_5 = React.createElement("uistroke", _attributes_7)
359
- local _exp_6 = React.createElement("uilistlayout", {
360
- FillDirection = Enum.FillDirection.Vertical,
361
- SortOrder = Enum.SortOrder.LayoutOrder,
362
- })
363
- local _condition_4 = search
364
- if _condition_4 then
386
+ _attributes_5.Text = helperText
387
+ _condition_4 = React.createElement("textlabel", _attributes_5)
388
+ end
389
+ local _attributes_5 = {
390
+ key = "Menu",
391
+ }
392
+ for _k, _v in styles.menu do
393
+ _attributes_5[_k] = _v
394
+ end
395
+ local _exp_4 = React.createElement(Shadow)
396
+ local _attributes_6 = table.clone(styles.corner)
397
+ setmetatable(_attributes_6, nil)
398
+ local _exp_5 = React.createElement("uicorner", _attributes_6)
399
+ local _attributes_7 = table.clone(styles.stroke)
400
+ setmetatable(_attributes_7, nil)
401
+ local _exp_6 = React.createElement("uistroke", _attributes_7)
402
+ local _exp_7 = React.createElement("uilistlayout", {
403
+ FillDirection = Enum.FillDirection.Vertical,
404
+ SortOrder = Enum.SortOrder.LayoutOrder,
405
+ })
406
+ local _condition_5 = search
407
+ if _condition_5 then
408
+ local _attributes_8 = {
409
+ key = "Search",
410
+ }
411
+ for _k, _v in styles.search do
412
+ _attributes_8[_k] = _v
413
+ end
414
+ _attributes_8.LayoutOrder = 1
415
+ _condition_5 = (React.createElement("frame", _attributes_8, React.createElement(Input, {
416
+ text = query,
417
+ placeholder = "Search",
418
+ width = UDim.new(1, 0),
419
+ onInput = function(text)
420
+ setQuery(text)
421
+ setHighlight(0)
422
+ end,
423
+ })))
424
+ end
425
+ return React.createElement(SxHost, _attributes, _exp_3, _condition_4, React.createElement(Popup, {
426
+ open = shown,
427
+ anchor = anchor,
428
+ preferredHeight = menuHeight,
429
+ preferredWidth = popupWidth,
430
+ onDismiss = close,
431
+ onInput = function(input)
432
+ return onKey(input, true)
433
+ end,
434
+ }, React.createElement("frame", _attributes_5, _exp_4, _exp_5, _exp_6, _exp_7, _condition_5, React.createElement("frame", {
435
+ key = "ListHost",
436
+ Size = UDim2.new(1, 0, 1, if search then -row else 0),
437
+ BackgroundTransparency = 1,
438
+ LayoutOrder = 2,
439
+ }, React.createElement(VirtualList, {
440
+ key = "Options",
441
+ items = rows,
442
+ getKey = function(row, index)
443
+ return `{row.kind}-{row.label}-{index}`
444
+ end,
445
+ itemHeight = row,
446
+ listRef = listRef,
447
+ empty = emptyHint,
448
+ className = styles.list,
449
+ renderItem = function(row)
450
+ if row.kind == "header" then
451
+ local _attributes_8 = table.clone(styles.group)
452
+ setmetatable(_attributes_8, nil)
453
+ _attributes_8.Text = row.label
454
+ local _attributes_9 = table.clone(styles.padding)
455
+ setmetatable(_attributes_9, nil)
456
+ return React.createElement("textlabel", _attributes_8, React.createElement("uipadding", _attributes_9))
457
+ end
458
+ local index = row.optionIndex
459
+ local picked = if values ~= nil then includesChoice(values, filtered[index + 1].value) else filtered[index + 1].value == value
365
460
  local _attributes_8 = {
366
- key = "Search",
461
+ ref = function(button)
462
+ if button and index == highlight and canFocusGui(button) then
463
+ GuiService.SelectedObject = button
464
+ end
465
+ end,
367
466
  }
368
- for _k, _v in styles.search do
467
+ for _k, _v in cx(styles.option, picked and styles.selected, index == highlight and styles.highlighted, row.disabled == true and styles.disabledOption) do
369
468
  _attributes_8[_k] = _v
370
469
  end
371
- _attributes_8.LayoutOrder = 1
372
- _condition_4 = (React.createElement("frame", _attributes_8, React.createElement(Input, {
373
- text = query,
374
- placeholder = "Search",
375
- width = UDim.new(1, 0),
376
- onInput = function(text)
377
- setQuery(text)
378
- setHighlight(0)
470
+ _attributes_8.Text = optionLabel(row.label, picked)
471
+ _attributes_8.Active = row.disabled ~= true
472
+ _attributes_8.Selectable = row.disabled ~= true
473
+ _attributes_8.Event = {
474
+ Activated = function()
475
+ return choose(index, true)
379
476
  end,
380
- })))
381
- end
382
- _condition_3 = (React.createElement(Popup, {
383
- anchor = anchor,
384
- preferredHeight = menuHeight,
385
- preferredWidth = popupWidth,
386
- onDismiss = close,
387
- onInput = function(input)
388
- return onKey(input, true)
389
- end,
390
- }, React.createElement("frame", _attributes_5, _exp_3, _exp_4, _exp_5, _exp_6, _condition_4, React.createElement("frame", {
391
- key = "ListHost",
392
- Size = UDim2.new(1, 0, 1, if search then -row else 0),
393
- BackgroundTransparency = 1,
394
- LayoutOrder = 2,
395
- }, React.createElement(VirtualList, {
396
- key = "Options",
397
- items = rows,
398
- getKey = function(row, index)
399
- return `{row.kind}-{row.label}-{index}`
400
- end,
401
- itemHeight = row,
402
- listRef = listRef,
403
- empty = emptyHint,
404
- className = styles.list,
405
- renderItem = function(row)
406
- if row.kind == "header" then
407
- local _attributes_8 = table.clone(styles.group)
408
- setmetatable(_attributes_8, nil)
409
- _attributes_8.Text = row.label
410
- local _attributes_9 = table.clone(styles.padding)
411
- setmetatable(_attributes_9, nil)
412
- return React.createElement("textlabel", _attributes_8, React.createElement("uipadding", _attributes_9))
413
- end
414
- local index = row.optionIndex
415
- local picked = if values ~= nil then includesChoice(values, filtered[index + 1].value) else filtered[index + 1].value == value
416
- local _attributes_8 = {
417
- ref = function(button)
418
- if button and index == highlight and canFocusGui(button) then
419
- GuiService.SelectedObject = button
420
- end
421
- end,
422
- }
423
- for _k, _v in cx(styles.option, picked and styles.selected, index == highlight and styles.highlighted, row.disabled == true and styles.disabledOption) do
424
- _attributes_8[_k] = _v
425
- end
426
- _attributes_8.Text = optionLabel(row.label, picked)
427
- _attributes_8.Active = row.disabled ~= true
428
- _attributes_8.Selectable = row.disabled ~= true
429
- _attributes_8.Event = {
430
- Activated = function()
431
- return choose(index, true)
432
- end,
433
- MouseEnter = function()
434
- if row.disabled ~= true then
435
- setHighlight(index)
436
- end
437
- end,
438
- SelectionGained = function()
439
- return setHighlight(index)
440
- end,
441
- InputBegan = function(_, input)
442
- return onKey(input, true)
443
- end,
444
- }
445
- local _attributes_9 = table.clone(styles.padding)
446
- setmetatable(_attributes_9, nil)
447
- return React.createElement("textbutton", _attributes_8, React.createElement("uipadding", _attributes_9))
448
- end,
449
- })))))
450
- end
451
- return React.createElement(SxHost, _attributes, _exp_2, _condition_3)
477
+ MouseEnter = function()
478
+ if row.disabled ~= true then
479
+ setHighlight(index)
480
+ end
481
+ end,
482
+ SelectionGained = function()
483
+ return setHighlight(index)
484
+ end,
485
+ InputBegan = function(_, input)
486
+ return onKey(input, true)
487
+ end,
488
+ }
489
+ local _attributes_9 = table.clone(styles.padding)
490
+ setmetatable(_attributes_9, nil)
491
+ return React.createElement("textbutton", _attributes_8, React.createElement("uipadding", _attributes_9))
492
+ end,
493
+ })))))
452
494
  end
453
495
  local default = Select
454
496
  return {
@@ -1,6 +1,8 @@
1
1
  import { ControlSize } from "../../../../theme/index";
2
2
  export interface SelectStyleProps {
3
3
  size?: ControlSize;
4
+ hasError?: boolean;
5
+ helperText?: string;
4
6
  }
5
7
  declare const useSelectStyles: (props: SelectStyleProps) => import("../../../../theme/index").ClassNameMap<string>;
6
8
  export default useSelectStyles;
@@ -5,17 +5,25 @@ local controlMetrics = _theme.controlMetrics
5
5
  local createStyles = _theme.createStyles
6
6
  local componentStyles = _theme.componentStyles
7
7
  local focusRing = _theme.focusRing
8
+ local fieldChrome = TS.import(script, script.Parent.Parent.Parent, "input", "components", "fieldChrome").fieldChrome
8
9
  local useSelectStyles = componentStyles("Select", function(theme, _param)
9
10
  local size = _param.size
11
+ local hasError = _param.hasError
12
+ if hasError == nil then
13
+ hasError = false
14
+ end
15
+ local helperText = _param.helperText
10
16
  local metrics = controlMetrics(theme.density, size)
17
+ local chrome = fieldChrome(metrics.height, theme.padding.calc(1))
18
+ local withHelper = helperText ~= nil
11
19
  return createStyles({
12
20
  root = {
13
- Size = UDim2.fromOffset(theme.spacing.calc(12), metrics.height),
21
+ Size = UDim2.fromOffset(theme.spacing.calc(12), if withHelper then chrome.height + metrics.height else chrome.height),
14
22
  BackgroundTransparency = 1,
15
23
  BorderSizePixel = 0,
16
24
  },
17
25
  trigger = {
18
- Size = UDim2.fromScale(1, 1),
26
+ Size = UDim2.new(1, 0, 0, chrome.height),
19
27
  BackgroundColor3 = theme.palette.surface.input,
20
28
  BorderSizePixel = 0,
21
29
  AutoButtonColor = false,
@@ -29,8 +37,8 @@ local useSelectStyles = componentStyles("Select", function(theme, _param)
29
37
  TextColor3 = theme.palette.text.secondary,
30
38
  },
31
39
  padding = {
32
- PaddingLeft = UDim.new(0, theme.padding.calc(1.5)),
33
- PaddingRight = UDim.new(0, theme.padding.calc(1.5)),
40
+ PaddingLeft = UDim.new(0, chrome.padX),
41
+ PaddingRight = UDim.new(0, chrome.padX),
34
42
  },
35
43
  menu = {
36
44
  Size = UDim2.fromScale(1, 1),
@@ -89,9 +97,25 @@ local useSelectStyles = componentStyles("Select", function(theme, _param)
89
97
  CornerRadius = UDim.new(0, theme.shape.borderRadius),
90
98
  },
91
99
  stroke = {
92
- Color = theme.palette.border,
100
+ Color = if hasError then theme.palette.status.error.main else theme.palette.border,
101
+ Transparency = 0,
102
+ Thickness = 1,
93
103
  ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
94
104
  },
105
+ errorText = {
106
+ TextColor3 = theme.palette.status.error.main,
107
+ },
108
+ helper = {
109
+ Size = UDim2.new(1, 0, 0, theme.spacing.calc(2)),
110
+ Position = UDim2.new(0, 0, 1, 0),
111
+ AnchorPoint = Vector2.new(0, 1),
112
+ BackgroundTransparency = 1,
113
+ BorderSizePixel = 0,
114
+ TextColor3 = if hasError then theme.palette.status.error.main else theme.palette.text.secondary,
115
+ Font = theme.typography.fontFamilies.default,
116
+ TextSize = metrics.font,
117
+ TextXAlignment = Enum.TextXAlignment.Left,
118
+ },
95
119
  focusStroke = focusRing(theme.palette.focus),
96
120
  })
97
121
  end)