@rbxts/uiblox 0.2.0-alpha.36 → 0.2.0-alpha.37

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 (278) hide show
  1. package/out/theme/styles/utilities/focusRing.d.ts +5 -0
  2. package/out/theme/styles/utilities/focusRing.luau +11 -0
  3. package/out/theme/styles/utilities/index.d.ts +1 -0
  4. package/out/theme/styles/utilities/init.luau +1 -0
  5. package/out/theme/styles/utilities/resolveSx.d.ts +6 -1
  6. package/out/theme/styles/utilities/resolveSx.luau +53 -12
  7. package/out/ui/packages/accordion/components/Accordion.d.ts +1 -0
  8. package/out/ui/packages/accordion/components/Accordion.luau +55 -19
  9. package/out/ui/packages/accordion/components/Accordion.styles.luau +49 -29
  10. package/out/ui/packages/accordion/components/accordionNote.d.ts +2 -0
  11. package/out/ui/packages/accordion/components/accordionNote.luau +11 -0
  12. package/out/ui/packages/alert/components/Alert.d.ts +2 -0
  13. package/out/ui/packages/alert/components/Alert.luau +24 -1
  14. package/out/ui/packages/alert/components/Alert.styles.luau +11 -0
  15. package/out/ui/packages/alert/components/alertAction.d.ts +2 -0
  16. package/out/ui/packages/alert/components/alertAction.luau +11 -0
  17. package/out/ui/packages/appBar/components/AppBar.d.ts +1 -0
  18. package/out/ui/packages/appBar/components/AppBar.luau +59 -15
  19. package/out/ui/packages/appBar/components/AppBar.styles.luau +24 -0
  20. package/out/ui/packages/appBar/components/appBarSubtitle.d.ts +2 -0
  21. package/out/ui/packages/appBar/components/appBarSubtitle.luau +11 -0
  22. package/out/ui/packages/avatarGroup/components/AvatarGroup.d.ts +14 -0
  23. package/out/ui/packages/avatarGroup/components/AvatarGroup.luau +102 -0
  24. package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.d.ts +6 -0
  25. package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.luau +50 -0
  26. package/out/ui/packages/avatarGroup/components/avatarGroupCut.d.ts +2 -0
  27. package/out/ui/packages/avatarGroup/components/avatarGroupCut.luau +11 -0
  28. package/out/ui/packages/avatarGroup/index.d.ts +3 -0
  29. package/out/ui/packages/avatarGroup/init.luau +6 -0
  30. package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +4 -1
  31. package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +19 -1
  32. package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +20 -0
  33. package/out/ui/packages/bottomNavigation/components/navBadge.d.ts +2 -0
  34. package/out/ui/packages/bottomNavigation/components/navBadge.luau +14 -0
  35. package/out/ui/packages/bottomNavigation/index.d.ts +1 -1
  36. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +16 -5
  37. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.styles.luau +6 -0
  38. package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +2 -0
  39. package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +8 -0
  40. package/out/ui/packages/button/components/Button.d.ts +2 -0
  41. package/out/ui/packages/button/components/Button.luau +59 -10
  42. package/out/ui/packages/button/components/Button.styles.luau +2 -0
  43. package/out/ui/packages/button/components/buttonLook.d.ts +2 -0
  44. package/out/ui/packages/button/components/buttonLook.luau +11 -0
  45. package/out/ui/packages/buttonGroup/components/ButtonGroup.d.ts +13 -0
  46. package/out/ui/packages/buttonGroup/components/ButtonGroup.luau +102 -0
  47. package/out/ui/packages/buttonGroup/components/ButtonGroup.styles.d.ts +5 -0
  48. package/out/ui/packages/buttonGroup/components/ButtonGroup.styles.luau +57 -0
  49. package/out/ui/packages/buttonGroup/components/buttonGroupEdge.d.ts +2 -0
  50. package/out/ui/packages/buttonGroup/components/buttonGroupEdge.luau +16 -0
  51. package/out/ui/packages/buttonGroup/index.d.ts +3 -0
  52. package/out/ui/packages/buttonGroup/init.luau +6 -0
  53. package/out/ui/packages/card/components/Card.d.ts +1 -0
  54. package/out/ui/packages/card/components/Card.luau +21 -2
  55. package/out/ui/packages/card/components/Card.styles.d.ts +3 -1
  56. package/out/ui/packages/card/components/Card.styles.luau +16 -7
  57. package/out/ui/packages/card/components/cardWidth.d.ts +10 -0
  58. package/out/ui/packages/card/components/cardWidth.luau +36 -0
  59. package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +9 -4
  60. package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +10 -1
  61. package/out/ui/packages/cframeEditor/components/cframeValue.d.ts +1 -0
  62. package/out/ui/packages/cframeEditor/components/cframeValue.luau +13 -0
  63. package/out/ui/packages/checkbox/components/Checkbox.luau +2 -1
  64. package/out/ui/packages/checkbox/components/Checkbox.styles.luau +2 -0
  65. package/out/ui/packages/chip/components/Chip.styles.d.ts +2 -1
  66. package/out/ui/packages/chip/components/Chip.styles.luau +9 -6
  67. package/out/ui/packages/chip/components/chipTone.d.ts +3 -0
  68. package/out/ui/packages/chip/components/chipTone.luau +11 -0
  69. package/out/ui/packages/collapse/components/Collapse.d.ts +8 -0
  70. package/out/ui/packages/collapse/components/Collapse.luau +34 -0
  71. package/out/ui/packages/collapse/components/Collapse.styles.d.ts +2 -0
  72. package/out/ui/packages/collapse/components/Collapse.styles.luau +20 -0
  73. package/out/ui/packages/collapse/components/collapseOpen.d.ts +1 -0
  74. package/out/ui/packages/collapse/components/collapseOpen.luau +7 -0
  75. package/out/ui/packages/collapse/index.d.ts +3 -0
  76. package/out/ui/packages/collapse/init.luau +6 -0
  77. package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +4 -2
  78. package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +4 -2
  79. package/out/ui/packages/colorPicker/components/sequenceValue.d.ts +2 -0
  80. package/out/ui/packages/colorPicker/components/sequenceValue.luau +8 -0
  81. package/out/ui/packages/colorPicker/index.d.ts +1 -1
  82. package/out/ui/packages/colorPicker/init.luau +2 -0
  83. package/out/ui/packages/copyButton/components/CopyButton.d.ts +8 -0
  84. package/out/ui/packages/copyButton/components/CopyButton.luau +32 -0
  85. package/out/ui/packages/copyButton/components/copyInvoke.d.ts +2 -0
  86. package/out/ui/packages/copyButton/components/copyInvoke.luau +12 -0
  87. package/out/ui/packages/copyButton/index.d.ts +3 -0
  88. package/out/ui/packages/copyButton/init.luau +6 -0
  89. package/out/ui/packages/cover/components/Cover.d.ts +8 -0
  90. package/out/ui/packages/cover/components/Cover.luau +47 -0
  91. package/out/ui/packages/cover/components/coverFill.d.ts +2 -0
  92. package/out/ui/packages/cover/components/coverFill.luau +14 -0
  93. package/out/ui/packages/cover/index.d.ts +3 -0
  94. package/out/ui/packages/cover/init.luau +6 -0
  95. package/out/ui/packages/dateRange/components/DateRangePicker.d.ts +3 -0
  96. package/out/ui/packages/dateRange/components/DateRangePicker.luau +167 -88
  97. package/out/ui/packages/dateRange/dateRangeValue.d.ts +5 -0
  98. package/out/ui/packages/dateRange/dateRangeValue.luau +34 -0
  99. package/out/ui/packages/dateRange/index.d.ts +1 -1
  100. package/out/ui/packages/dateRange/init.luau +3 -0
  101. package/out/ui/packages/dialog/components/Dialog.d.ts +1 -0
  102. package/out/ui/packages/dialog/components/Dialog.luau +55 -6
  103. package/out/ui/packages/dialog/components/Dialog.styles.luau +5 -3
  104. package/out/ui/packages/dialog/components/dialogWidth.d.ts +7 -0
  105. package/out/ui/packages/dialog/components/dialogWidth.luau +35 -0
  106. package/out/ui/packages/divider/components/Divider.luau +57 -12
  107. package/out/ui/packages/divider/components/dividerLabel.d.ts +2 -0
  108. package/out/ui/packages/divider/components/dividerLabel.luau +11 -0
  109. package/out/ui/packages/drawer/components/Drawer.d.ts +1 -0
  110. package/out/ui/packages/drawer/components/Drawer.luau +18 -3
  111. package/out/ui/packages/drawer/components/drawerPlacement.d.ts +13 -1
  112. package/out/ui/packages/drawer/components/drawerPlacement.luau +28 -0
  113. package/out/ui/packages/fab/components/fabSize.d.ts +1 -1
  114. package/out/ui/packages/iconButton/components/IconButton.d.ts +2 -0
  115. package/out/ui/packages/iconButton/components/IconButton.luau +37 -3
  116. package/out/ui/packages/iconButton/components/transportGlyph.d.ts +9 -0
  117. package/out/ui/packages/iconButton/components/transportGlyph.luau +73 -0
  118. package/out/ui/packages/imageList/components/ImageList.d.ts +4 -0
  119. package/out/ui/packages/imageList/components/ImageList.luau +57 -11
  120. package/out/ui/packages/imageList/components/ImageList.styles.d.ts +1 -0
  121. package/out/ui/packages/imageList/components/ImageList.styles.luau +16 -10
  122. package/out/ui/packages/imageList/components/imageListLayout.d.ts +10 -0
  123. package/out/ui/packages/imageList/components/imageListLayout.luau +44 -0
  124. package/out/ui/packages/index.d.ts +11 -0
  125. package/out/ui/packages/init.luau +33 -0
  126. package/out/ui/packages/input/components/Input.d.ts +4 -0
  127. package/out/ui/packages/input/components/Input.luau +29 -9
  128. package/out/ui/packages/input/components/Input.styles.d.ts +1 -0
  129. package/out/ui/packages/input/components/Input.styles.luau +42 -12
  130. package/out/ui/packages/input/components/clampText.d.ts +2 -0
  131. package/out/ui/packages/input/components/clampText.luau +16 -0
  132. package/out/ui/packages/input/components/multilineHeight.d.ts +1 -0
  133. package/out/ui/packages/input/components/multilineHeight.luau +11 -0
  134. package/out/ui/packages/link/components/Link.luau +13 -9
  135. package/out/ui/packages/link/components/Link.styles.d.ts +0 -1
  136. package/out/ui/packages/link/components/Link.styles.luau +1 -12
  137. package/out/ui/packages/listItem/components/ListItem.d.ts +6 -0
  138. package/out/ui/packages/listItem/components/ListItem.luau +97 -39
  139. package/out/ui/packages/listItem/components/ListItem.styles.d.ts +3 -0
  140. package/out/ui/packages/listItem/components/ListItem.styles.luau +52 -30
  141. package/out/ui/packages/listItem/components/listItemInk.d.ts +3 -0
  142. package/out/ui/packages/listItem/components/listItemInk.luau +14 -0
  143. package/out/ui/packages/listItem/components/listItemLayout.d.ts +12 -0
  144. package/out/ui/packages/listItem/components/listItemLayout.luau +41 -0
  145. package/out/ui/packages/markdown/components/Markdown.d.ts +2 -0
  146. package/out/ui/packages/markdown/components/Markdown.luau +91 -6
  147. package/out/ui/packages/markdown/components/Markdown.styles.luau +25 -0
  148. package/out/ui/packages/markdown/index.d.ts +2 -2
  149. package/out/ui/packages/markdown/init.luau +2 -0
  150. package/out/ui/packages/markdown/parseMarkdown.d.ts +21 -1
  151. package/out/ui/packages/markdown/parseMarkdown.luau +109 -2
  152. package/out/ui/packages/menu/components/Menu.d.ts +3 -0
  153. package/out/ui/packages/menu/components/Menu.luau +68 -21
  154. package/out/ui/packages/menu/components/menuIcon.d.ts +6 -0
  155. package/out/ui/packages/menu/components/menuIcon.luau +32 -0
  156. package/out/ui/packages/numberInput/components/NumberInput.d.ts +1 -0
  157. package/out/ui/packages/numberInput/components/NumberInput.luau +67 -1
  158. package/out/ui/packages/numberInput/components/numberValue.d.ts +2 -0
  159. package/out/ui/packages/numberInput/components/numberValue.luau +10 -0
  160. package/out/ui/packages/pager/components/Pager.d.ts +11 -0
  161. package/out/ui/packages/pager/components/Pager.luau +112 -0
  162. package/out/ui/packages/pager/components/Pager.styles.d.ts +2 -0
  163. package/out/ui/packages/pager/components/Pager.styles.luau +61 -0
  164. package/out/ui/packages/pager/components/pagerStep.d.ts +3 -0
  165. package/out/ui/packages/pager/components/pagerStep.luau +24 -0
  166. package/out/ui/packages/pager/index.d.ts +3 -0
  167. package/out/ui/packages/pager/init.luau +9 -0
  168. package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +5 -0
  169. package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +5 -0
  170. package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +22 -0
  171. package/out/ui/packages/popover/components/Popover.d.ts +12 -0
  172. package/out/ui/packages/popover/components/Popover.luau +50 -0
  173. package/out/ui/packages/popover/components/Popover.styles.d.ts +2 -0
  174. package/out/ui/packages/popover/components/Popover.styles.luau +26 -0
  175. package/out/ui/packages/popover/index.d.ts +2 -0
  176. package/out/ui/packages/popover/init.luau +5 -0
  177. package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +4 -1
  178. package/out/ui/packages/radioGroup/components/RadioGroup.luau +51 -8
  179. package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +26 -2
  180. package/out/ui/packages/radioGroup/components/radioHint.d.ts +2 -0
  181. package/out/ui/packages/radioGroup/components/radioHint.luau +11 -0
  182. package/out/ui/packages/radioGroup/index.d.ts +1 -1
  183. package/out/ui/packages/rating/components/Rating.d.ts +1 -1
  184. package/out/ui/packages/rating/components/Rating.luau +4 -2
  185. package/out/ui/packages/rating/components/ratingCommit.d.ts +2 -0
  186. package/out/ui/packages/rating/components/ratingCommit.luau +11 -0
  187. package/out/ui/packages/scroll/components/ScrollView.luau +76 -7
  188. package/out/ui/packages/select/components/Select.luau +18 -1
  189. package/out/ui/packages/select/components/Select.styles.luau +2 -5
  190. package/out/ui/packages/select/components/selectWidth.d.ts +2 -0
  191. package/out/ui/packages/select/components/selectWidth.luau +15 -0
  192. package/out/ui/packages/shadow/components/Shadow.luau +14 -2
  193. package/out/ui/packages/slider/components/RangeSlider.d.ts +16 -0
  194. package/out/ui/packages/slider/components/RangeSlider.luau +231 -0
  195. package/out/ui/packages/slider/components/RangeSlider.styles.d.ts +7 -0
  196. package/out/ui/packages/slider/components/RangeSlider.styles.luau +48 -0
  197. package/out/ui/packages/slider/components/Slider.d.ts +1 -0
  198. package/out/ui/packages/slider/components/Slider.luau +44 -11
  199. package/out/ui/packages/slider/components/Slider.styles.d.ts +1 -0
  200. package/out/ui/packages/slider/components/Slider.styles.luau +19 -5
  201. package/out/ui/packages/slider/components/rangeValue.d.ts +21 -0
  202. package/out/ui/packages/slider/components/rangeValue.luau +77 -0
  203. package/out/ui/packages/slider/components/sliderLabel.d.ts +4 -0
  204. package/out/ui/packages/slider/components/sliderLabel.luau +30 -0
  205. package/out/ui/packages/slider/index.d.ts +3 -0
  206. package/out/ui/packages/slider/init.luau +6 -0
  207. package/out/ui/packages/snackbar/components/Snackbar.d.ts +1 -0
  208. package/out/ui/packages/snackbar/components/Snackbar.luau +2 -0
  209. package/out/ui/packages/sparkline/components/Sparkline.d.ts +3 -0
  210. package/out/ui/packages/sparkline/components/Sparkline.luau +69 -7
  211. package/out/ui/packages/sparkline/index.d.ts +1 -1
  212. package/out/ui/packages/sparkline/init.luau +6 -1
  213. package/out/ui/packages/sparkline/sparklineLayout.d.ts +17 -0
  214. package/out/ui/packages/sparkline/sparklineLayout.luau +132 -8
  215. package/out/ui/packages/speedDial/components/SpeedDial.d.ts +1 -0
  216. package/out/ui/packages/speedDial/components/SpeedDial.luau +56 -9
  217. package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +1 -0
  218. package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +45 -3
  219. package/out/ui/packages/speedDial/components/speedDialLabel.d.ts +4 -0
  220. package/out/ui/packages/speedDial/components/speedDialLabel.luau +16 -0
  221. package/out/ui/packages/stateMatrix.d.ts +1 -0
  222. package/out/ui/packages/stateMatrix.luau +9 -0
  223. package/out/ui/packages/stepper/components/Stepper.d.ts +2 -0
  224. package/out/ui/packages/stepper/components/Stepper.luau +35 -7
  225. package/out/ui/packages/stepper/components/Stepper.styles.luau +3 -0
  226. package/out/ui/packages/stepper/components/stepState.d.ts +4 -2
  227. package/out/ui/packages/stepper/components/stepState.luau +12 -1
  228. package/out/ui/packages/stepper/index.d.ts +1 -1
  229. package/out/ui/packages/stepper/init.luau +3 -1
  230. package/out/ui/packages/switch/components/Switch.styles.luau +2 -5
  231. package/out/ui/packages/table/components/Table.luau +8 -5
  232. package/out/ui/packages/table/components/tableSort.d.ts +2 -0
  233. package/out/ui/packages/table/components/tableSort.luau +95 -0
  234. package/out/ui/packages/table/index.d.ts +1 -0
  235. package/out/ui/packages/table/init.luau +1 -0
  236. package/out/ui/packages/tabs/components/Tabs.luau +70 -2
  237. package/out/ui/packages/tabs/components/tabScroll.d.ts +2 -0
  238. package/out/ui/packages/tabs/components/tabScroll.luau +18 -0
  239. package/out/ui/packages/text/components/Text.d.ts +7 -0
  240. package/out/ui/packages/text/components/Text.luau +54 -0
  241. package/out/ui/packages/text/components/textBox.d.ts +12 -0
  242. package/out/ui/packages/text/components/textBox.luau +21 -0
  243. package/out/ui/packages/text/index.d.ts +2 -0
  244. package/out/ui/packages/text/init.luau +5 -0
  245. package/out/ui/packages/timeField/components/TimeField.d.ts +13 -0
  246. package/out/ui/packages/timeField/components/TimeField.luau +102 -0
  247. package/out/ui/packages/timeField/index.d.ts +4 -0
  248. package/out/ui/packages/timeField/init.luau +9 -0
  249. package/out/ui/packages/timeField/timeValue.d.ts +8 -0
  250. package/out/ui/packages/timeField/timeValue.luau +49 -0
  251. package/out/ui/packages/timeline/components/Timeline.d.ts +12 -0
  252. package/out/ui/packages/timeline/components/Timeline.luau +99 -0
  253. package/out/ui/packages/timeline/components/Timeline.styles.d.ts +2 -0
  254. package/out/ui/packages/timeline/components/Timeline.styles.luau +106 -0
  255. package/out/ui/packages/timeline/components/timelineRail.d.ts +4 -0
  256. package/out/ui/packages/timeline/components/timelineRail.luau +15 -0
  257. package/out/ui/packages/timeline/index.d.ts +3 -0
  258. package/out/ui/packages/timeline/init.luau +8 -0
  259. package/out/ui/packages/toast/components/Toast.d.ts +1 -0
  260. package/out/ui/packages/toast/components/Toast.luau +59 -12
  261. package/out/ui/packages/toast/components/Toast.styles.luau +6 -3
  262. package/out/ui/packages/toast/components/toastPlace.d.ts +12 -0
  263. package/out/ui/packages/toast/components/toastPlace.luau +31 -0
  264. package/out/ui/packages/tooltip/components/Tooltip.d.ts +1 -0
  265. package/out/ui/packages/tooltip/components/Tooltip.luau +109 -31
  266. package/out/ui/packages/tooltip/components/Tooltip.styles.luau +30 -0
  267. package/out/ui/packages/tooltip/components/tooltipBox.d.ts +4 -0
  268. package/out/ui/packages/tooltip/components/tooltipBox.luau +12 -0
  269. package/out/ui/packages/tooltip/components/tooltipPointer.d.ts +2 -0
  270. package/out/ui/packages/tooltip/components/tooltipPointer.luau +11 -0
  271. package/out/ui/packages/vectorEditor/components/VectorEditor.luau +1 -0
  272. package/out/ui/packages/weekGrid/components/WeekGrid.d.ts +24 -0
  273. package/out/ui/packages/weekGrid/components/WeekGrid.luau +187 -0
  274. package/out/ui/packages/weekGrid/components/weekColumns.d.ts +9 -0
  275. package/out/ui/packages/weekGrid/components/weekColumns.luau +25 -0
  276. package/out/ui/packages/weekGrid/index.d.ts +3 -0
  277. package/out/ui/packages/weekGrid/init.luau +8 -0
  278. package/package.json +67 -69
@@ -0,0 +1,11 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ --* Clicks commit only when the rating is editable and a handler was passed.
3
+ local function ratingCommit(readOnly, onChange, landed)
4
+ if readOnly == true or onChange == nil then
5
+ return nil
6
+ end
7
+ return landed
8
+ end
9
+ return {
10
+ ratingCommit = ratingCommit,
11
+ }
@@ -1,8 +1,30 @@
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 useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").useTheme
4
+ local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
5
+ local resolveSx = _theme.resolveSx
6
+ local useTheme = _theme.useTheme
5
7
  local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
8
+ local function isPadKey(key)
9
+ return key == "p" or key == "px" or key == "py" or key == "pt" or key == "pr" or key == "pb" or key == "pl" or key == "padding"
10
+ end
11
+ --* Padding on a scrolling frame offsets scale-sized children without shrinking them.
12
+ local function withoutPad(sx)
13
+ if sx == nil then
14
+ return nil
15
+ end
16
+ local rest = {}
17
+ local kept = false
18
+ for key, value in pairs(sx) do
19
+ local name = tostring(key)
20
+ if isPadKey(name) then
21
+ continue
22
+ end
23
+ rest[name] = value
24
+ kept = true
25
+ end
26
+ return if kept then rest else nil
27
+ end
6
28
  local function ScrollView(props)
7
29
  local _binding = props
8
30
  local children = _binding.children
@@ -22,19 +44,66 @@ local function ScrollView(props)
22
44
  ScrollBarThickness = theme.spacing.calc(0.5),
23
45
  ScrollBarImageColor3 = theme.palette.text.secondary,
24
46
  }
47
+ local pad = resolveSx(theme, sx).padding
48
+ local _result = pad
49
+ if _result ~= nil then
50
+ _result = _result.PaddingLeft.Offset
51
+ end
52
+ local _condition = _result
53
+ if _condition == nil then
54
+ _condition = 0
55
+ end
56
+ local left = _condition
57
+ local _result_1 = pad
58
+ if _result_1 ~= nil then
59
+ _result_1 = _result_1.PaddingRight.Offset
60
+ end
61
+ local _condition_1 = _result_1
62
+ if _condition_1 == nil then
63
+ _condition_1 = 0
64
+ end
65
+ local right = _condition_1
66
+ local _result_2 = pad
67
+ if _result_2 ~= nil then
68
+ _result_2 = _result_2.PaddingTop.Offset
69
+ end
70
+ local _condition_2 = _result_2
71
+ if _condition_2 == nil then
72
+ _condition_2 = 0
73
+ end
74
+ local top = _condition_2
75
+ local _result_3 = pad
76
+ if _result_3 ~= nil then
77
+ _result_3 = _result_3.PaddingBottom.Offset
78
+ end
79
+ local _condition_3 = _result_3
80
+ if _condition_3 == nil then
81
+ _condition_3 = 0
82
+ end
83
+ local bottom = _condition_3
84
+ local inset = left + right + top + bottom > 0
25
85
  local _attributes = {
26
86
  tag = "scrollingframe",
27
87
  }
28
- local _condition = id
29
- if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
30
- _condition = "ScrollView"
88
+ local _condition_4 = id
89
+ if not (_condition_4 ~= 0 and _condition_4 == _condition_4 and _condition_4 ~= "" and _condition_4) then
90
+ _condition_4 = "ScrollView"
31
91
  end
32
- _attributes.key = _condition
92
+ _attributes.key = _condition_4
33
93
  _attributes.hostRef = ref
34
94
  _attributes.base = root
35
95
  _attributes.className = className
36
- _attributes.sx = sx
37
- return React.createElement(SxHost, _attributes, children)
96
+ _attributes.sx = withoutPad(sx)
97
+ return React.createElement(SxHost, _attributes, if inset then (React.createElement("frame", {
98
+ key = "Pad",
99
+ Size = UDim2.new(1, -(left + right), 0, 0),
100
+ Position = UDim2.new(0, left, 0, top),
101
+ AutomaticSize = Enum.AutomaticSize.Y,
102
+ BackgroundTransparency = 1,
103
+ BorderSizePixel = 0,
104
+ }, React.createElement("uipadding", {
105
+ PaddingBottom = UDim.new(0, bottom),
106
+ }), children)) else children)
38
107
  end
39
108
  local default = ScrollView
40
109
  return {
@@ -7,6 +7,7 @@ local useRef = _react.useRef
7
7
  local useState = _react.useState
8
8
  local _services = TS.import(script, TS.getModule(script, "@rbxts", "services"))
9
9
  local GuiService = _services.GuiService
10
+ local TextService = _services.TextService
10
11
  local UserInputService = _services.UserInputService
11
12
  local useReducedMotion = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "hooks").useReducedMotion
12
13
  local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
@@ -37,6 +38,7 @@ local _selectMulti = TS.import(script, script.Parent, "selectMulti")
37
38
  local includesChoice = _selectMulti.includesChoice
38
39
  local selectionLabel = _selectMulti.selectionLabel
39
40
  local typeaheadChoice = TS.import(script, script.Parent, "selectTypeahead").typeaheadChoice
41
+ local selectWidth = TS.import(script, script.Parent, "selectWidth").selectWidth
40
42
  local stepChoice = TS.import(script, script.Parent, "stepChoice").stepChoice
41
43
  local function Select(props)
42
44
  local _binding = props
@@ -70,7 +72,8 @@ local function Select(props)
70
72
  })
71
73
  local _binding_1 = useTheme()
72
74
  local theme = _binding_1.theme
73
- local row = controlMetrics(theme.density, size).height
75
+ local metrics = controlMetrics(theme.density, size)
76
+ local row = metrics.height
74
77
  local active = canActivate(disabled, loading)
75
78
  local anchor, setAnchor = useState()
76
79
  local open, setOpen = useState(defaultOpen == true and not loading)
@@ -104,6 +107,19 @@ local function Select(props)
104
107
  local rows = groupRows(filtered)
105
108
  local listHeight = if #rows == 0 then row else math.min(#rows * row, theme.spacing.calc(16))
106
109
  local menuHeight = listHeight + (if search then row else 0)
110
+ local font = theme.typography.fontFamilies.default or Enum.Font.SourceSans
111
+ local textSize = metrics.font
112
+ local widest = 0
113
+ for _, line in rows do
114
+ local shown = if line.kind == "header" then line.label else optionLabel(line.label, if values ~= nil then includesChoice(values, filtered[line.optionIndex + 1].value) else filtered[line.optionIndex + 1].value == value)
115
+ local bounds = TextService:GetTextSize(shown, textSize, font, Vector2.new(10000, 100))
116
+ if bounds.X > widest then
117
+ widest = bounds.X
118
+ end
119
+ end
120
+ local pad = theme.padding.calc(1.5) * 2
121
+ local floor = if anchor ~= nil then anchor.AbsoluteSize.X else 0
122
+ local popupWidth = if #rows == 0 then 0 else selectWidth(widest, pad, floor)
107
123
  local _condition_1 = empty
108
124
  if _condition_1 == nil then
109
125
  local _attributes = {}
@@ -366,6 +382,7 @@ local function Select(props)
366
382
  _condition_3 = (React.createElement(Popup, {
367
383
  anchor = anchor,
368
384
  preferredHeight = menuHeight,
385
+ preferredWidth = popupWidth,
369
386
  onDismiss = close,
370
387
  onInput = function(input)
371
388
  return onKey(input, true)
@@ -4,6 +4,7 @@ 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 focusRing = _theme.focusRing
7
8
  local useSelectStyles = componentStyles("Select", function(theme, _param)
8
9
  local size = _param.size
9
10
  local metrics = controlMetrics(theme.density, size)
@@ -91,11 +92,7 @@ local useSelectStyles = componentStyles("Select", function(theme, _param)
91
92
  Color = theme.palette.border,
92
93
  ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
93
94
  },
94
- focusStroke = {
95
- Color = theme.palette.focus,
96
- Thickness = 2,
97
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
98
- },
95
+ focusStroke = focusRing(theme.palette.focus),
99
96
  })
100
97
  end)
101
98
  local default = useSelectStyles
@@ -0,0 +1,2 @@
1
+ /** Grow past a narrow field so the option fits. Stay at least as wide as the field. */
2
+ export declare function selectWidth(text: number, pad: number, floor: number): number;
@@ -0,0 +1,15 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ --* Grow past a narrow field so the option fits. Stay at least as wide as the field.
3
+ local function selectWidth(text, pad, floor)
4
+ local need = text + pad
5
+ if need < 0 then
6
+ need = 0
7
+ end
8
+ if floor > need then
9
+ return floor
10
+ end
11
+ return need
12
+ end
13
+ return {
14
+ selectWidth = selectWidth,
15
+ }
@@ -77,10 +77,22 @@ local function Shadow(props)
77
77
  end
78
78
  _attributes_1.Size = blobSize
79
79
  _attributes_1.ZIndex = zIndex
80
- return React.createElement(SxHost, _attributes, React.createElement("frame", _attributes_1, cornerRadius ~= nil and React.createElement("uicorner", {
80
+ return React.createElement(SxHost, _attributes, React.createElement("scrollingframe", {
81
+ key = "Bounds",
82
+ Size = UDim2.fromOffset(0, 0),
83
+ BackgroundTransparency = 1,
84
+ BorderSizePixel = 0,
85
+ ScrollBarThickness = 0,
86
+ ScrollingEnabled = false,
87
+ AutomaticCanvasSize = Enum.AutomaticSize.None,
88
+ CanvasSize = UDim2.fromOffset(0, 0),
89
+ ClipsDescendants = false,
90
+ Active = false,
91
+ Selectable = false,
92
+ }, React.createElement("frame", _attributes_1, cornerRadius ~= nil and React.createElement("uicorner", {
81
93
  key = "Corner",
82
94
  CornerRadius = cornerRadius,
83
- })))
95
+ }))))
84
96
  end
85
97
  local default = Shadow
86
98
  return {
@@ -0,0 +1,16 @@
1
+ import { ControlSize, CustomizedProps } from "../../../../theme/index";
2
+ import { SliderColor } from "./Slider.styles";
3
+ import { RangeValue } from "./rangeValue";
4
+ export interface RangeSliderProps {
5
+ value: RangeValue;
6
+ onChange: (value: RangeValue) => void;
7
+ onCommit?: (value: RangeValue) => void;
8
+ min: number;
9
+ max: number;
10
+ step?: number;
11
+ disabled?: boolean;
12
+ size?: ControlSize;
13
+ color?: SliderColor;
14
+ }
15
+ declare function RangeSlider(props: CustomizedProps<Frame, RangeSliderProps>): JSX.Element;
16
+ export default RangeSlider;
@@ -0,0 +1,231 @@
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 useRef = _react.useRef
6
+ local useState = _react.useState
7
+ local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
8
+ local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
9
+ local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
10
+ local commitNumber = TS.import(script, script.Parent.Parent.Parent, "numberInput", "components", "numberValue").commitNumber
11
+ local _sliderNudge = TS.import(script, script.Parent, "sliderNudge")
12
+ local isSliderDrag = _sliderNudge.isSliderDrag
13
+ local isSliderMove = _sliderNudge.isSliderMove
14
+ local nudgeDelta = _sliderNudge.nudgeDelta
15
+ local nudgeValue = _sliderNudge.nudgeValue
16
+ local useRangeSliderStyles = TS.import(script, script.Parent, "RangeSlider.styles").default
17
+ local _rangeValue = TS.import(script, script.Parent, "rangeValue")
18
+ local orderRange = _rangeValue.orderRange
19
+ local rangeMove = _rangeValue.rangeMove
20
+ local rangeRatios = _rangeValue.rangeRatios
21
+ local rangeThumb = _rangeValue.rangeThumb
22
+ local function RangeSlider(props)
23
+ local _binding = props
24
+ local value = _binding.value
25
+ local onChange = _binding.onChange
26
+ local onCommit = _binding.onCommit
27
+ local min = _binding.min
28
+ local max = _binding.max
29
+ local step = _binding.step
30
+ local disabled = _binding.disabled
31
+ local size = _binding.size
32
+ local color = _binding.color
33
+ if color == nil then
34
+ color = "primary"
35
+ end
36
+ local className = _binding.className
37
+ local sx = _binding.sx
38
+ local id = _binding.id
39
+ local ref = _binding.ref
40
+ local styles = useRangeSliderStyles({
41
+ size = size,
42
+ color = color,
43
+ })
44
+ local ordered = orderRange(value.start, value.finish)
45
+ local ratios = rangeRatios(ordered.start, ordered.finish, min, max)
46
+ local active = canActivate(disabled)
47
+ local focused, setFocused = useState(false)
48
+ local pressed, setPressed = useState(false)
49
+ local dragging = useRef(false)
50
+ local thumb = useRef("low")
51
+ local latest = useRef(ordered)
52
+ latest.current = ordered
53
+ local faded = disabled == true
54
+ local showFocus = focused and active
55
+ local pointerValue = function(rbx, x)
56
+ local width = rbx.AbsoluteSize.X
57
+ if width <= 0 then
58
+ return nil
59
+ end
60
+ return commitNumber(min + ((x - rbx.AbsolutePosition.X) / width) * (max - min), min, max, step)
61
+ end
62
+ local publish = function(landed, commit)
63
+ thumb.current = landed.thumb
64
+ if landed.start == latest.current.start and landed.finish == latest.current.finish then
65
+ return nil
66
+ end
67
+ latest.current = {
68
+ start = landed.start,
69
+ finish = landed.finish,
70
+ }
71
+ onChange(latest.current)
72
+ if commit and onCommit then
73
+ onCommit(latest.current)
74
+ end
75
+ end
76
+ local update = function(rbx, x)
77
+ local landed = pointerValue(rbx, x)
78
+ if landed == nil then
79
+ return nil
80
+ end
81
+ publish(rangeMove(thumb.current, landed, latest.current.start, latest.current.finish), false)
82
+ end
83
+ local finish = function()
84
+ if not dragging.current then
85
+ return nil
86
+ end
87
+ dragging.current = false
88
+ setPressed(false)
89
+ if onCommit then
90
+ onCommit(latest.current)
91
+ end
92
+ end
93
+ local nudge = function(direction)
94
+ if not active then
95
+ return nil
96
+ end
97
+ local current = if thumb.current == "low" then latest.current.start else latest.current.finish
98
+ local nudged = nudgeValue(current, min, max, step, direction)
99
+ if nudged == nil then
100
+ return nil
101
+ end
102
+ publish(rangeMove(thumb.current, nudged, latest.current.start, latest.current.finish), true)
103
+ end
104
+ local knobLook = function(ratio, which)
105
+ return cx(styles.knob, {
106
+ Position = UDim2.fromScale(ratio, 0.5),
107
+ BackgroundTransparency = if faded then 0.45 else 0,
108
+ ZIndex = if which == thumb.current then 3 else 2,
109
+ })
110
+ end
111
+ local _attributes = {
112
+ tag = "frame",
113
+ }
114
+ local _condition = id
115
+ if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
116
+ _condition = "RangeSlider"
117
+ end
118
+ _attributes.key = _condition
119
+ _attributes.hostRef = ref
120
+ _attributes.base = styles.root
121
+ _attributes.className = className
122
+ _attributes.sx = sx
123
+ _attributes.state = {
124
+ disabled = disabled,
125
+ pressed = pressed,
126
+ focused = focused,
127
+ }
128
+ _attributes.Active = active
129
+ _attributes.Selectable = active
130
+ _attributes.BackgroundTransparency = if showFocus then 0.85 else 1
131
+ _attributes.Event = {
132
+ InputBegan = function(rbx, input)
133
+ if not active then
134
+ return nil
135
+ end
136
+ local direction = nudgeDelta(input.KeyCode.Name)
137
+ if direction ~= nil then
138
+ nudge(direction)
139
+ return nil
140
+ end
141
+ if not isSliderDrag(input.UserInputType.Name) then
142
+ return nil
143
+ end
144
+ local landed = pointerValue(rbx, input.Position.X)
145
+ if landed ~= nil then
146
+ thumb.current = rangeThumb(landed, latest.current.start, latest.current.finish)
147
+ end
148
+ dragging.current = true
149
+ setPressed(true)
150
+ update(rbx, input.Position.X)
151
+ end,
152
+ InputChanged = function(rbx, input)
153
+ if dragging.current and isSliderMove(input.UserInputType.Name) then
154
+ update(rbx, input.Position.X)
155
+ end
156
+ end,
157
+ InputEnded = function(_rbx, input)
158
+ if isSliderDrag(input.UserInputType.Name) then
159
+ finish()
160
+ end
161
+ end,
162
+ MouseLeave = function()
163
+ return finish()
164
+ end,
165
+ SelectionGained = function()
166
+ return setFocused(true)
167
+ end,
168
+ SelectionLost = function()
169
+ return setFocused(false)
170
+ end,
171
+ }
172
+ local _attributes_1 = {
173
+ key = "Track",
174
+ }
175
+ for _k, _v in styles.track do
176
+ _attributes_1[_k] = _v
177
+ end
178
+ _attributes_1.BackgroundTransparency = if faded then 0.55 else 0.35
179
+ local _attributes_2 = table.clone(styles.corner)
180
+ setmetatable(_attributes_2, nil)
181
+ local _exp = React.createElement("uicorner", _attributes_2)
182
+ local _attributes_3 = {
183
+ key = "Fill",
184
+ }
185
+ for _k, _v in cx(styles.fill, {
186
+ Position = UDim2.fromScale(ratios.low, 0),
187
+ Size = UDim2.fromScale(ratios.high - ratios.low, 1),
188
+ BackgroundTransparency = if faded then 0.55 elseif pressed then 0.1 else 0,
189
+ }) do
190
+ _attributes_3[_k] = _v
191
+ end
192
+ local _attributes_4 = table.clone(styles.corner)
193
+ setmetatable(_attributes_4, nil)
194
+ local _exp_1 = React.createElement("frame", _attributes_3, React.createElement("uicorner", _attributes_4))
195
+ local _attributes_5 = {
196
+ key = "Low",
197
+ }
198
+ for _k, _v in knobLook(ratios.low, "low") do
199
+ _attributes_5[_k] = _v
200
+ end
201
+ local _attributes_6 = table.clone(styles.corner)
202
+ setmetatable(_attributes_6, nil)
203
+ local _exp_2 = React.createElement("uicorner", _attributes_6)
204
+ local _condition_1 = showFocus and thumb.current == "low"
205
+ if _condition_1 then
206
+ local _attributes_7 = table.clone(styles.stroke)
207
+ setmetatable(_attributes_7, nil)
208
+ _condition_1 = React.createElement("uistroke", _attributes_7)
209
+ end
210
+ local _exp_3 = React.createElement("frame", _attributes_5, _exp_2, _condition_1)
211
+ local _attributes_7 = {
212
+ key = "High",
213
+ }
214
+ for _k, _v in knobLook(ratios.high, "high") do
215
+ _attributes_7[_k] = _v
216
+ end
217
+ local _attributes_8 = table.clone(styles.corner)
218
+ setmetatable(_attributes_8, nil)
219
+ local _exp_4 = React.createElement("uicorner", _attributes_8)
220
+ local _condition_2 = showFocus and thumb.current == "high"
221
+ if _condition_2 then
222
+ local _attributes_9 = table.clone(styles.stroke)
223
+ setmetatable(_attributes_9, nil)
224
+ _condition_2 = React.createElement("uistroke", _attributes_9)
225
+ end
226
+ return React.createElement(SxHost, _attributes, React.createElement("frame", _attributes_1, _exp, _exp_1, _exp_3, React.createElement("frame", _attributes_7, _exp_4, _condition_2)))
227
+ end
228
+ local default = RangeSlider
229
+ return {
230
+ default = default,
231
+ }
@@ -0,0 +1,7 @@
1
+ import { ControlSize } from "../../../../theme/index";
2
+ import { SliderColor } from "./Slider.styles";
3
+ declare const useRangeSliderStyles: (props: {
4
+ size?: ControlSize;
5
+ color?: SliderColor;
6
+ }) => import("../../../../theme/index").ClassNameMap<string>;
7
+ export default useRangeSliderStyles;
@@ -0,0 +1,48 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
4
+ local componentStyles = _theme.componentStyles
5
+ local controlMetrics = _theme.controlMetrics
6
+ local createStyles = _theme.createStyles
7
+ local focusRing = _theme.focusRing
8
+ local useRangeSliderStyles = componentStyles("RangeSlider", function(theme, _param)
9
+ local size = _param.size
10
+ local color = _param.color
11
+ if color == nil then
12
+ color = "primary"
13
+ end
14
+ local metrics = controlMetrics(theme.density, size)
15
+ local tone = if color == "accent" then theme.palette.accent.main else theme.palette.primary.main
16
+ return createStyles({
17
+ root = {
18
+ Size = UDim2.new(1, 0, 0, metrics.sliderHeight),
19
+ BackgroundTransparency = 1,
20
+ BorderSizePixel = 0,
21
+ },
22
+ track = {
23
+ Size = UDim2.new(1, 0, 0, metrics.sliderTrack),
24
+ Position = UDim2.fromScale(0, 0.5),
25
+ AnchorPoint = Vector2.new(0, 0.5),
26
+ BackgroundColor3 = theme.palette.action.disabled,
27
+ BorderSizePixel = 0,
28
+ },
29
+ fill = {
30
+ BackgroundColor3 = tone,
31
+ BorderSizePixel = 0,
32
+ },
33
+ knob = {
34
+ Size = UDim2.fromOffset(metrics.sliderKnob, metrics.sliderKnob),
35
+ AnchorPoint = Vector2.new(0.5, 0.5),
36
+ BackgroundColor3 = theme.palette.text.primary,
37
+ BorderSizePixel = 0,
38
+ },
39
+ corner = {
40
+ CornerRadius = UDim.new(1, 0),
41
+ },
42
+ stroke = focusRing(theme.palette.focus),
43
+ })
44
+ end)
45
+ local default = useRangeSliderStyles
46
+ return {
47
+ default = default,
48
+ }
@@ -10,6 +10,7 @@ export interface SliderProps {
10
10
  disabled?: boolean;
11
11
  size?: ControlSize;
12
12
  marks?: boolean | ReadonlyArray<number>;
13
+ format?: (value: number) => string;
13
14
  color?: SliderColor;
14
15
  }
15
16
  declare function Slider(props: CustomizedProps<Frame, SliderProps>): JSX.Element;
@@ -4,11 +4,18 @@ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
4
  local React = _react
5
5
  local useRef = _react.useRef
6
6
  local useState = _react.useState
7
- local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
7
+ local TextService = TS.import(script, TS.getModule(script, "@rbxts", "services")).TextService
8
+ local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
9
+ local controlMetrics = _theme.controlMetrics
10
+ local cx = _theme.cx
11
+ local useTheme = _theme.useTheme
8
12
  local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
9
13
  local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
10
14
  local commitNumber = TS.import(script, script.Parent.Parent.Parent, "numberInput", "components", "numberValue").commitNumber
11
15
  local useSliderStyles = TS.import(script, script.Parent, "Slider.styles").default
16
+ local _sliderLabel = TS.import(script, script.Parent, "sliderLabel")
17
+ local sliderLabel = _sliderLabel.sliderLabel
18
+ local sliderSlot = _sliderLabel.sliderSlot
12
19
  local sliderMarkValues = TS.import(script, script.Parent, "sliderMarks").sliderMarkValues
13
20
  local _sliderNudge = TS.import(script, script.Parent, "sliderNudge")
14
21
  local isSliderDrag = _sliderNudge.isSliderDrag
@@ -26,6 +33,7 @@ local function Slider(props)
26
33
  local disabled = _binding.disabled
27
34
  local size = _binding.size
28
35
  local marks = _binding.marks
36
+ local format = _binding.format
29
37
  local color = _binding.color
30
38
  if color == nil then
31
39
  color = "primary"
@@ -34,17 +42,26 @@ local function Slider(props)
34
42
  local sx = _binding.sx
35
43
  local id = _binding.id
36
44
  local ref = _binding.ref
37
- local _binding_1 = useSliderStyles({
45
+ local labelText = sliderLabel(format, value)
46
+ local _binding_1 = useTheme()
47
+ local theme = _binding_1.theme
48
+ local metrics = controlMetrics(theme.density, size)
49
+ local caption = theme.typography.variants.caption
50
+ local font = theme.typography.fontFamilies[caption.family] or Enum.Font.SourceSans
51
+ local slot = if labelText == nil then 0 else sliderSlot(TextService:GetTextSize(labelText, caption.size, font, Vector2.new(10000, 100)).X, 52, 4)
52
+ local _binding_2 = useSliderStyles({
38
53
  size = size,
39
54
  color = color,
55
+ labeled = labelText ~= nil,
40
56
  })
41
- local root = _binding_1.root
42
- local track = _binding_1.track
43
- local fill = _binding_1.fill
44
- local knob = _binding_1.knob
45
- local corner = _binding_1.corner
46
- local stroke = _binding_1.stroke
47
- local mark = _binding_1.mark
57
+ local root = _binding_2.root
58
+ local track = _binding_2.track
59
+ local fill = _binding_2.fill
60
+ local knob = _binding_2.knob
61
+ local corner = _binding_2.corner
62
+ local stroke = _binding_2.stroke
63
+ local mark = _binding_2.mark
64
+ local label = _binding_2.label
48
65
  local active = canActivate(disabled)
49
66
  local focused, setFocused = useState(false)
50
67
  local hovering, setHovering = useState(false)
@@ -162,6 +179,8 @@ local function Slider(props)
162
179
  }
163
180
  for _k, _v in cx(track, {
164
181
  BackgroundTransparency = if faded then 0.55 elseif hovering and active then 0.2 else 0.35,
182
+ }, labelText ~= nil and {
183
+ Size = UDim2.new(1, -(slot + 4), 0, metrics.sliderTrack),
165
184
  }) do
166
185
  _attributes_1[_k] = _v
167
186
  end
@@ -221,10 +240,24 @@ local function Slider(props)
221
240
  if _condition_2 then
222
241
  local _attributes_7 = table.clone(stroke)
223
242
  setmetatable(_attributes_7, nil)
224
- _attributes_7.Thickness = 1
225
243
  _condition_2 = React.createElement("uistroke", _attributes_7)
226
244
  end
227
- return React.createElement(SxHost, _attributes, React.createElement("frame", _attributes_1, _exp, _condition_1, _exp_1, _exp_2, React.createElement("frame", _attributes_5, _exp_3, _condition_2)))
245
+ local _exp_4 = React.createElement("frame", _attributes_1, _exp, _condition_1, _exp_1, _exp_2, React.createElement("frame", _attributes_5, _exp_3, _condition_2))
246
+ local _result
247
+ if labelText ~= nil then
248
+ local _attributes_7 = {
249
+ key = "Value",
250
+ }
251
+ for _k, _v in label do
252
+ _attributes_7[_k] = _v
253
+ end
254
+ _attributes_7.Size = UDim2.new(0, slot, 1, 0)
255
+ _attributes_7.Text = labelText
256
+ _result = React.createElement("textlabel", _attributes_7)
257
+ else
258
+ _result = nil
259
+ end
260
+ return React.createElement(SxHost, _attributes, _exp_4, _result)
228
261
  end
229
262
  local default = Slider
230
263
  return {
@@ -3,6 +3,7 @@ export type SliderColor = "primary" | "accent";
3
3
  export interface SliderStyleProps {
4
4
  size?: ControlSize;
5
5
  color?: SliderColor;
6
+ labeled?: boolean;
6
7
  }
7
8
  declare const useSliderStyles: (props: SliderStyleProps) => import("../../../../theme/index").ClassNameMap<string>;
8
9
  export default useSliderStyles;