@rbxts/uiblox 0.2.0-alpha.35 → 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 (284) 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 +12 -0
  125. package/out/ui/packages/init.luau +36 -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/reorder/index.d.ts +2 -0
  188. package/out/ui/packages/reorder/init.luau +14 -0
  189. package/out/ui/packages/reorder/reorder.d.ts +24 -0
  190. package/out/ui/packages/reorder/reorder.luau +178 -0
  191. package/out/ui/packages/reorder/useReorderDrag.d.ts +15 -0
  192. package/out/ui/packages/reorder/useReorderDrag.luau +129 -0
  193. package/out/ui/packages/scroll/components/ScrollView.luau +76 -7
  194. package/out/ui/packages/select/components/Select.luau +18 -1
  195. package/out/ui/packages/select/components/Select.styles.luau +2 -5
  196. package/out/ui/packages/select/components/selectWidth.d.ts +2 -0
  197. package/out/ui/packages/select/components/selectWidth.luau +15 -0
  198. package/out/ui/packages/shadow/components/Shadow.luau +14 -2
  199. package/out/ui/packages/slider/components/RangeSlider.d.ts +16 -0
  200. package/out/ui/packages/slider/components/RangeSlider.luau +231 -0
  201. package/out/ui/packages/slider/components/RangeSlider.styles.d.ts +7 -0
  202. package/out/ui/packages/slider/components/RangeSlider.styles.luau +48 -0
  203. package/out/ui/packages/slider/components/Slider.d.ts +1 -0
  204. package/out/ui/packages/slider/components/Slider.luau +44 -11
  205. package/out/ui/packages/slider/components/Slider.styles.d.ts +1 -0
  206. package/out/ui/packages/slider/components/Slider.styles.luau +19 -5
  207. package/out/ui/packages/slider/components/rangeValue.d.ts +21 -0
  208. package/out/ui/packages/slider/components/rangeValue.luau +77 -0
  209. package/out/ui/packages/slider/components/sliderLabel.d.ts +4 -0
  210. package/out/ui/packages/slider/components/sliderLabel.luau +30 -0
  211. package/out/ui/packages/slider/index.d.ts +3 -0
  212. package/out/ui/packages/slider/init.luau +6 -0
  213. package/out/ui/packages/snackbar/components/Snackbar.d.ts +1 -0
  214. package/out/ui/packages/snackbar/components/Snackbar.luau +2 -0
  215. package/out/ui/packages/sparkline/components/Sparkline.d.ts +3 -0
  216. package/out/ui/packages/sparkline/components/Sparkline.luau +69 -7
  217. package/out/ui/packages/sparkline/index.d.ts +1 -1
  218. package/out/ui/packages/sparkline/init.luau +6 -1
  219. package/out/ui/packages/sparkline/sparklineLayout.d.ts +17 -0
  220. package/out/ui/packages/sparkline/sparklineLayout.luau +132 -8
  221. package/out/ui/packages/speedDial/components/SpeedDial.d.ts +1 -0
  222. package/out/ui/packages/speedDial/components/SpeedDial.luau +56 -9
  223. package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +1 -0
  224. package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +45 -3
  225. package/out/ui/packages/speedDial/components/speedDialLabel.d.ts +4 -0
  226. package/out/ui/packages/speedDial/components/speedDialLabel.luau +16 -0
  227. package/out/ui/packages/stateMatrix.d.ts +1 -0
  228. package/out/ui/packages/stateMatrix.luau +9 -0
  229. package/out/ui/packages/stepper/components/Stepper.d.ts +2 -0
  230. package/out/ui/packages/stepper/components/Stepper.luau +35 -7
  231. package/out/ui/packages/stepper/components/Stepper.styles.luau +3 -0
  232. package/out/ui/packages/stepper/components/stepState.d.ts +4 -2
  233. package/out/ui/packages/stepper/components/stepState.luau +12 -1
  234. package/out/ui/packages/stepper/index.d.ts +1 -1
  235. package/out/ui/packages/stepper/init.luau +3 -1
  236. package/out/ui/packages/switch/components/Switch.styles.luau +2 -5
  237. package/out/ui/packages/table/components/Table.luau +8 -5
  238. package/out/ui/packages/table/components/tableSort.d.ts +2 -0
  239. package/out/ui/packages/table/components/tableSort.luau +95 -0
  240. package/out/ui/packages/table/index.d.ts +1 -0
  241. package/out/ui/packages/table/init.luau +1 -0
  242. package/out/ui/packages/tabs/components/Tabs.luau +70 -2
  243. package/out/ui/packages/tabs/components/tabScroll.d.ts +2 -0
  244. package/out/ui/packages/tabs/components/tabScroll.luau +18 -0
  245. package/out/ui/packages/text/components/Text.d.ts +7 -0
  246. package/out/ui/packages/text/components/Text.luau +54 -0
  247. package/out/ui/packages/text/components/textBox.d.ts +12 -0
  248. package/out/ui/packages/text/components/textBox.luau +21 -0
  249. package/out/ui/packages/text/index.d.ts +2 -0
  250. package/out/ui/packages/text/init.luau +5 -0
  251. package/out/ui/packages/timeField/components/TimeField.d.ts +13 -0
  252. package/out/ui/packages/timeField/components/TimeField.luau +102 -0
  253. package/out/ui/packages/timeField/index.d.ts +4 -0
  254. package/out/ui/packages/timeField/init.luau +9 -0
  255. package/out/ui/packages/timeField/timeValue.d.ts +8 -0
  256. package/out/ui/packages/timeField/timeValue.luau +49 -0
  257. package/out/ui/packages/timeline/components/Timeline.d.ts +12 -0
  258. package/out/ui/packages/timeline/components/Timeline.luau +99 -0
  259. package/out/ui/packages/timeline/components/Timeline.styles.d.ts +2 -0
  260. package/out/ui/packages/timeline/components/Timeline.styles.luau +106 -0
  261. package/out/ui/packages/timeline/components/timelineRail.d.ts +4 -0
  262. package/out/ui/packages/timeline/components/timelineRail.luau +15 -0
  263. package/out/ui/packages/timeline/index.d.ts +3 -0
  264. package/out/ui/packages/timeline/init.luau +8 -0
  265. package/out/ui/packages/toast/components/Toast.d.ts +1 -0
  266. package/out/ui/packages/toast/components/Toast.luau +59 -12
  267. package/out/ui/packages/toast/components/Toast.styles.luau +6 -3
  268. package/out/ui/packages/toast/components/toastPlace.d.ts +12 -0
  269. package/out/ui/packages/toast/components/toastPlace.luau +31 -0
  270. package/out/ui/packages/tooltip/components/Tooltip.d.ts +1 -0
  271. package/out/ui/packages/tooltip/components/Tooltip.luau +109 -31
  272. package/out/ui/packages/tooltip/components/Tooltip.styles.luau +30 -0
  273. package/out/ui/packages/tooltip/components/tooltipBox.d.ts +4 -0
  274. package/out/ui/packages/tooltip/components/tooltipBox.luau +12 -0
  275. package/out/ui/packages/tooltip/components/tooltipPointer.d.ts +2 -0
  276. package/out/ui/packages/tooltip/components/tooltipPointer.luau +11 -0
  277. package/out/ui/packages/vectorEditor/components/VectorEditor.luau +1 -0
  278. package/out/ui/packages/weekGrid/components/WeekGrid.d.ts +24 -0
  279. package/out/ui/packages/weekGrid/components/WeekGrid.luau +187 -0
  280. package/out/ui/packages/weekGrid/components/weekColumns.d.ts +9 -0
  281. package/out/ui/packages/weekGrid/components/weekColumns.luau +25 -0
  282. package/out/ui/packages/weekGrid/index.d.ts +3 -0
  283. package/out/ui/packages/weekGrid/init.luau +8 -0
  284. 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
+ }
@@ -0,0 +1,2 @@
1
+ export { DragRect, hitRect, isReorderMove, isReorderPress, isReorderRelease, passedDragThreshold, placeItem, REORDER_THRESHOLD, transferId } from "./reorder";
2
+ export { ReorderDragHandle, ReorderDragState, useReorderDrag } from "./useReorderDrag";
@@ -0,0 +1,14 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ local _reorder = TS.import(script, script, "reorder")
5
+ exports.hitRect = _reorder.hitRect
6
+ exports.isReorderMove = _reorder.isReorderMove
7
+ exports.isReorderPress = _reorder.isReorderPress
8
+ exports.isReorderRelease = _reorder.isReorderRelease
9
+ exports.passedDragThreshold = _reorder.passedDragThreshold
10
+ exports.placeItem = _reorder.placeItem
11
+ exports.REORDER_THRESHOLD = _reorder.REORDER_THRESHOLD
12
+ exports.transferId = _reorder.transferId
13
+ exports.useReorderDrag = TS.import(script, script, "useReorderDrag").useReorderDrag
14
+ return exports
@@ -0,0 +1,24 @@
1
+ export declare const REORDER_THRESHOLD = 6;
2
+ export interface DragRect {
3
+ id: string;
4
+ x: number;
5
+ y: number;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export declare function isReorderPress(kind: Enum.UserInputType): boolean;
10
+ export declare function isReorderMove(kind: Enum.UserInputType): boolean;
11
+ export declare function isReorderRelease(kind: Enum.UserInputType): boolean;
12
+ export declare function passedDragThreshold(startX: number, startY: number, x: number, y: number, threshold?: number): boolean;
13
+ /** Smallest rect containing the point wins, so a card beats the column behind it. */
14
+ export declare function hitRect(rects: readonly DragRect[], x: number, y: number): string | undefined;
15
+ /** Final index after the move. Out-of-range or a no-op returns a copy. */
16
+ export declare function placeItem<T extends defined>(items: readonly T[], from: number, to: number): T[];
17
+ /**
18
+ * Insert `id` at `index` in `dest` and remove it from `source`.
19
+ * The same list uses placeItem, where index is the final index.
20
+ */
21
+ export declare function transferId(source: readonly string[], dest: readonly string[], id: string, index: number): {
22
+ source: string[];
23
+ dest: string[];
24
+ };
@@ -0,0 +1,178 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local REORDER_THRESHOLD = 6
3
+ local function isReorderPress(kind)
4
+ return kind == Enum.UserInputType.MouseButton1 or kind == Enum.UserInputType.Touch
5
+ end
6
+ local function isReorderMove(kind)
7
+ return kind == Enum.UserInputType.MouseMovement or kind == Enum.UserInputType.Touch
8
+ end
9
+ local function isReorderRelease(kind)
10
+ return kind == Enum.UserInputType.MouseButton1 or kind == Enum.UserInputType.Touch
11
+ end
12
+ local function passedDragThreshold(startX, startY, x, y, threshold)
13
+ if threshold == nil then
14
+ threshold = REORDER_THRESHOLD
15
+ end
16
+ local dx = x - startX
17
+ local dy = y - startY
18
+ return dx * dx + dy * dy >= threshold * threshold
19
+ end
20
+ --* Smallest rect containing the point wins, so a card beats the column behind it.
21
+ local function hitRect(rects, x, y)
22
+ local best
23
+ local bestArea = math.huge
24
+ for _, rect in rects do
25
+ if x < rect.x or y < rect.y or x > rect.x + rect.width or y > rect.y + rect.height then
26
+ continue
27
+ end
28
+ local area = rect.width * rect.height
29
+ if area < bestArea then
30
+ best = rect
31
+ bestArea = area
32
+ end
33
+ end
34
+ local _result = best
35
+ if _result ~= nil then
36
+ _result = _result.id
37
+ end
38
+ return _result
39
+ end
40
+ --* Final index after the move. Out-of-range or a no-op returns a copy.
41
+ local function placeItem(items, from, to)
42
+ local listed = {}
43
+ for _, item in items do
44
+ table.insert(listed, item)
45
+ end
46
+ local count = #listed
47
+ if from < 0 or to < 0 or from >= count or to >= count or from == to then
48
+ return listed
49
+ end
50
+ local moved = listed[from + 1]
51
+ if from < to then
52
+ do
53
+ local index = from
54
+ local _shouldIncrement = false
55
+ while true do
56
+ if _shouldIncrement then
57
+ index += 1
58
+ else
59
+ _shouldIncrement = true
60
+ end
61
+ if not (index < to) then
62
+ break
63
+ end
64
+ listed[index + 1] = listed[index + 2]
65
+ end
66
+ end
67
+ else
68
+ do
69
+ local index = from
70
+ local _shouldIncrement = false
71
+ while true do
72
+ if _shouldIncrement then
73
+ index -= 1
74
+ else
75
+ _shouldIncrement = true
76
+ end
77
+ if not (index > to) then
78
+ break
79
+ end
80
+ listed[index + 1] = listed[index]
81
+ end
82
+ end
83
+ end
84
+ listed[to + 1] = moved
85
+ return listed
86
+ end
87
+ local function indexOfId(ids, id)
88
+ for index = 0, #ids - 1 do
89
+ if ids[index + 1] == id then
90
+ return index
91
+ end
92
+ end
93
+ return -1
94
+ end
95
+ --[[
96
+ *
97
+ * Insert `id` at `index` in `dest` and remove it from `source`.
98
+ * The same list uses placeItem, where index is the final index.
99
+
100
+ ]]
101
+ local function transferId(source, dest, id, index)
102
+ if source == dest then
103
+ local placed = placeItem(source, indexOfId(source, id), math.clamp(index, 0, math.max(0, #source - 1)))
104
+ return {
105
+ source = placed,
106
+ dest = placed,
107
+ }
108
+ end
109
+ local nextSource = {}
110
+ local found = false
111
+ for _, item in source do
112
+ if item == id then
113
+ found = true
114
+ else
115
+ table.insert(nextSource, item)
116
+ end
117
+ end
118
+ local nextDest = {}
119
+ for _, item in dest do
120
+ table.insert(nextDest, item)
121
+ end
122
+ if not found then
123
+ return {
124
+ source = nextSource,
125
+ dest = nextDest,
126
+ }
127
+ end
128
+ local at = math.clamp(math.floor(index), 0, #nextDest)
129
+ local inserted = {}
130
+ do
131
+ local cursor = 0
132
+ local _shouldIncrement = false
133
+ while true do
134
+ if _shouldIncrement then
135
+ cursor += 1
136
+ else
137
+ _shouldIncrement = true
138
+ end
139
+ if not (cursor < at) then
140
+ break
141
+ end
142
+ local _arg0 = nextDest[cursor + 1]
143
+ table.insert(inserted, _arg0)
144
+ end
145
+ end
146
+ local _id = id
147
+ table.insert(inserted, _id)
148
+ do
149
+ local cursor = at
150
+ local _shouldIncrement = false
151
+ while true do
152
+ if _shouldIncrement then
153
+ cursor += 1
154
+ else
155
+ _shouldIncrement = true
156
+ end
157
+ if not (cursor < #nextDest) then
158
+ break
159
+ end
160
+ local _arg0 = nextDest[cursor + 1]
161
+ table.insert(inserted, _arg0)
162
+ end
163
+ end
164
+ return {
165
+ source = nextSource,
166
+ dest = inserted,
167
+ }
168
+ end
169
+ return {
170
+ isReorderPress = isReorderPress,
171
+ isReorderMove = isReorderMove,
172
+ isReorderRelease = isReorderRelease,
173
+ passedDragThreshold = passedDragThreshold,
174
+ hitRect = hitRect,
175
+ placeItem = placeItem,
176
+ transferId = transferId,
177
+ REORDER_THRESHOLD = REORDER_THRESHOLD,
178
+ }
@@ -0,0 +1,15 @@
1
+ import { DragRect } from "./reorder";
2
+ export interface ReorderDragState {
3
+ active: boolean;
4
+ id?: string;
5
+ overId?: string;
6
+ x: number;
7
+ y: number;
8
+ }
9
+ export interface ReorderDragHandle {
10
+ drag: ReorderDragState;
11
+ begin: (id: string, input: InputObject) => boolean;
12
+ cancel: () => void;
13
+ suppressClick: () => boolean;
14
+ }
15
+ export declare function useReorderDrag(onDrop: (fromId: string, overId?: string) => void, getRects: () => readonly DragRect[]): ReorderDragHandle;
@@ -0,0 +1,129 @@
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 useEffect = _react.useEffect
5
+ local useRef = _react.useRef
6
+ local useState = _react.useState
7
+ local UserInputService = TS.import(script, TS.getModule(script, "@rbxts", "services")).UserInputService
8
+ local _reorder = TS.import(script, script.Parent, "reorder")
9
+ local hitRect = _reorder.hitRect
10
+ local isReorderMove = _reorder.isReorderMove
11
+ local isReorderPress = _reorder.isReorderPress
12
+ local isReorderRelease = _reorder.isReorderRelease
13
+ local passedDragThreshold = _reorder.passedDragThreshold
14
+ local rest = function()
15
+ return {
16
+ active = false,
17
+ x = 0,
18
+ y = 0,
19
+ }
20
+ end
21
+ local function useReorderDrag(onDrop, getRects)
22
+ local drag, setDrag = useState(rest())
23
+ local tracking = useRef({
24
+ down = false,
25
+ active = false,
26
+ x = 0,
27
+ y = 0,
28
+ startX = 0,
29
+ startY = 0,
30
+ })
31
+ local onDropRef = useRef(onDrop)
32
+ local rectsRef = useRef(getRects)
33
+ local took = useRef(false)
34
+ onDropRef.current = onDrop
35
+ rectsRef.current = getRects
36
+ local clear = function(drop)
37
+ local current = tracking.current
38
+ tracking.current = {
39
+ down = false,
40
+ active = false,
41
+ x = 0,
42
+ y = 0,
43
+ startX = 0,
44
+ startY = 0,
45
+ }
46
+ setDrag(rest())
47
+ if drop and current.active and current.id ~= nil then
48
+ took.current = true
49
+ onDropRef.current(current.id, current.overId)
50
+ end
51
+ end
52
+ useEffect(function()
53
+ local changed = UserInputService.InputChanged:Connect(function(input)
54
+ local current = tracking.current
55
+ if not current.down or not isReorderMove(input.UserInputType) then
56
+ return nil
57
+ end
58
+ local x = input.Position.X
59
+ local y = input.Position.Y
60
+ local active = current.active or passedDragThreshold(current.startX, current.startY, x, y)
61
+ local overId = if active then hitRect(rectsRef.current(), x, y) else nil
62
+ local _object = table.clone(current)
63
+ setmetatable(_object, nil)
64
+ _object.active = active
65
+ _object.x = x
66
+ _object.y = y
67
+ _object.overId = overId
68
+ tracking.current = _object
69
+ if active then
70
+ setDrag({
71
+ active = true,
72
+ id = current.id,
73
+ overId = overId,
74
+ x = x,
75
+ y = y,
76
+ })
77
+ end
78
+ end)
79
+ local ended = UserInputService.InputEnded:Connect(function(input)
80
+ if not tracking.current.down or not isReorderRelease(input.UserInputType) then
81
+ return nil
82
+ end
83
+ clear(true)
84
+ end)
85
+ local began = UserInputService.InputBegan:Connect(function(input)
86
+ if input.KeyCode == Enum.KeyCode.Escape then
87
+ clear(false)
88
+ end
89
+ end)
90
+ return function()
91
+ changed:Disconnect()
92
+ ended:Disconnect()
93
+ began:Disconnect()
94
+ end
95
+ end, {})
96
+ return {
97
+ drag = drag,
98
+ begin = function(id, input)
99
+ if not isReorderPress(input.UserInputType) then
100
+ return false
101
+ end
102
+ local x = input.Position.X
103
+ local y = input.Position.Y
104
+ tracking.current = {
105
+ down = true,
106
+ active = false,
107
+ id = id,
108
+ x = x,
109
+ y = y,
110
+ startX = x,
111
+ startY = y,
112
+ }
113
+ return true
114
+ end,
115
+ cancel = function()
116
+ return clear(false)
117
+ end,
118
+ suppressClick = function()
119
+ if not took.current then
120
+ return false
121
+ end
122
+ took.current = false
123
+ return true
124
+ end,
125
+ }
126
+ end
127
+ return {
128
+ useReorderDrag = useReorderDrag,
129
+ }
@@ -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;