@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
@@ -23,6 +23,15 @@ end
23
23
  local function parseNumberDraft(text, min, max, step)
24
24
  return commitNumber(tonumber(text), min, max, step)
25
25
  end
26
+ --* One step up or down. Undefined when the value would not change.
27
+ local function stepNumber(value, direction, min, max, step)
28
+ local size = if step ~= nil and step > 0 then step else 1
29
+ local landed = commitNumber(value + direction * size, min, max, step)
30
+ if landed == nil or landed == value then
31
+ return nil
32
+ end
33
+ return landed
34
+ end
26
35
  local function formatNumber(value, places)
27
36
  if places == nil then
28
37
  places = 4
@@ -70,5 +79,6 @@ end
70
79
  return {
71
80
  commitNumber = commitNumber,
72
81
  parseNumberDraft = parseNumberDraft,
82
+ stepNumber = stepNumber,
73
83
  formatNumber = formatNumber,
74
84
  }
@@ -0,0 +1,11 @@
1
+ import React from "@rbxts/react";
2
+ import { CustomizedProps } from "../../../../theme/index";
3
+ export interface PagerProps {
4
+ index: number;
5
+ count: number;
6
+ disabled?: boolean;
7
+ onChange: (index: number) => void;
8
+ children?: React.ReactNode;
9
+ }
10
+ declare function Pager(props: CustomizedProps<Frame, PagerProps>): JSX.Element;
11
+ export default Pager;
@@ -0,0 +1,112 @@
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 canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
5
+ local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
6
+ local usePagerStyles = TS.import(script, script.Parent, "Pager.styles").default
7
+ local _pagerStep = TS.import(script, script.Parent, "pagerStep")
8
+ local pagerLabel = _pagerStep.pagerLabel
9
+ local pagerPlace = _pagerStep.pagerPlace
10
+ local pagerStep = _pagerStep.pagerStep
11
+ local function Pager(props)
12
+ local _binding = props
13
+ local index = _binding.index
14
+ local count = _binding.count
15
+ local disabled = _binding.disabled
16
+ local onChange = _binding.onChange
17
+ local children = _binding.children
18
+ local className = _binding.className
19
+ local sx = _binding.sx
20
+ local id = _binding.id
21
+ local ref = _binding.ref
22
+ local styles = usePagerStyles()
23
+ local place = pagerPlace(index, count)
24
+ local back = pagerStep(index, count, -1)
25
+ local forward = pagerStep(index, count, 1)
26
+ local groupOff = disabled == true
27
+ local _attributes = {
28
+ tag = "frame",
29
+ }
30
+ local _condition = id
31
+ if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
32
+ _condition = "Pager"
33
+ end
34
+ _attributes.key = _condition
35
+ _attributes.hostRef = ref
36
+ _attributes.base = styles.root
37
+ _attributes.className = className
38
+ _attributes.sx = sx
39
+ _attributes.state = {
40
+ disabled = groupOff,
41
+ }
42
+ local _attributes_1 = table.clone(styles.list)
43
+ setmetatable(_attributes_1, nil)
44
+ local _exp = React.createElement("uilistlayout", _attributes_1)
45
+ local _attributes_2 = {
46
+ key = "Bar",
47
+ }
48
+ for _k, _v in styles.bar do
49
+ _attributes_2[_k] = _v
50
+ end
51
+ _attributes_2.LayoutOrder = 0
52
+ local _attributes_3 = table.clone(styles.barList)
53
+ setmetatable(_attributes_3, nil)
54
+ local _exp_1 = React.createElement("uilistlayout", _attributes_3)
55
+ local _attributes_4 = {
56
+ key = "Back",
57
+ }
58
+ for _k, _v in styles.button do
59
+ _attributes_4[_k] = _v
60
+ end
61
+ _attributes_4.Text = "Back"
62
+ _attributes_4.TextTransparency = if groupOff or back == place then 0.5 else 0
63
+ _attributes_4.Active = canActivate(groupOff or back == place)
64
+ _attributes_4.LayoutOrder = 0
65
+ _attributes_4.Event = {
66
+ Activated = function()
67
+ if not groupOff and back ~= place then
68
+ onChange(back)
69
+ end
70
+ end,
71
+ }
72
+ local _exp_2 = React.createElement("textbutton", _attributes_4)
73
+ local _attributes_5 = {
74
+ key = "Count",
75
+ }
76
+ for _k, _v in styles.label do
77
+ _attributes_5[_k] = _v
78
+ end
79
+ _attributes_5.Text = pagerLabel(index, count)
80
+ _attributes_5.LayoutOrder = 1
81
+ local _exp_3 = React.createElement("textlabel", _attributes_5)
82
+ local _attributes_6 = {
83
+ key = "Next",
84
+ }
85
+ for _k, _v in styles.button do
86
+ _attributes_6[_k] = _v
87
+ end
88
+ _attributes_6.Text = "Next"
89
+ _attributes_6.TextTransparency = if groupOff or forward == place then 0.5 else 0
90
+ _attributes_6.Active = canActivate(groupOff or forward == place)
91
+ _attributes_6.LayoutOrder = 2
92
+ _attributes_6.Event = {
93
+ Activated = function()
94
+ if not groupOff and forward ~= place then
95
+ onChange(forward)
96
+ end
97
+ end,
98
+ }
99
+ local _exp_4 = React.createElement("frame", _attributes_2, _exp_1, _exp_2, _exp_3, React.createElement("textbutton", _attributes_6))
100
+ local _attributes_7 = {
101
+ key = "Body",
102
+ }
103
+ for _k, _v in styles.body do
104
+ _attributes_7[_k] = _v
105
+ end
106
+ _attributes_7.LayoutOrder = 1
107
+ return React.createElement(SxHost, _attributes, _exp, _exp_4, React.createElement("frame", _attributes_7, children))
108
+ end
109
+ local default = Pager
110
+ return {
111
+ default = default,
112
+ }
@@ -0,0 +1,2 @@
1
+ declare const usePagerStyles: () => import("../../../../theme/index").ClassNameMap<string>;
2
+ export default usePagerStyles;
@@ -0,0 +1,61 @@
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 usePagerStyles = componentStyles("Pager", function(theme)
8
+ local metrics = controlMetrics(theme.density, "small")
9
+ return createStyles({
10
+ root = {
11
+ AutomaticSize = Enum.AutomaticSize.XY,
12
+ BackgroundTransparency = 1,
13
+ BorderSizePixel = 0,
14
+ Size = UDim2.fromScale(0, 0),
15
+ },
16
+ list = {
17
+ FillDirection = Enum.FillDirection.Vertical,
18
+ Padding = UDim.new(0, theme.padding.calc(2)),
19
+ SortOrder = Enum.SortOrder.LayoutOrder,
20
+ },
21
+ bar = {
22
+ AutomaticSize = Enum.AutomaticSize.XY,
23
+ BackgroundTransparency = 1,
24
+ BorderSizePixel = 0,
25
+ Size = UDim2.fromScale(0, 0),
26
+ },
27
+ barList = {
28
+ FillDirection = Enum.FillDirection.Horizontal,
29
+ Padding = UDim.new(0, theme.padding.calc(2)),
30
+ VerticalAlignment = Enum.VerticalAlignment.Center,
31
+ SortOrder = Enum.SortOrder.LayoutOrder,
32
+ },
33
+ button = {
34
+ Size = UDim2.fromOffset(64, metrics.buttonHeight),
35
+ BackgroundTransparency = 1,
36
+ BorderSizePixel = 0,
37
+ TextColor3 = theme.palette.text.primary,
38
+ Font = theme.typography.fontFamilies.default,
39
+ TextSize = metrics.font,
40
+ AutoButtonColor = false,
41
+ },
42
+ label = {
43
+ AutomaticSize = Enum.AutomaticSize.XY,
44
+ BackgroundTransparency = 1,
45
+ Size = UDim2.fromScale(0, 0),
46
+ TextColor3 = theme.palette.text.secondary,
47
+ Font = theme.typography.fontFamilies.default,
48
+ TextSize = theme.typography.fontSizes.caption,
49
+ },
50
+ body = {
51
+ AutomaticSize = Enum.AutomaticSize.XY,
52
+ BackgroundTransparency = 1,
53
+ BorderSizePixel = 0,
54
+ Size = UDim2.fromScale(0, 0),
55
+ },
56
+ })
57
+ end)
58
+ local default = usePagerStyles
59
+ return {
60
+ default = default,
61
+ }
@@ -0,0 +1,3 @@
1
+ export declare function pagerPlace(index: number, count: number): number;
2
+ export declare function pagerStep(index: number, count: number, delta: number): number;
3
+ export declare function pagerLabel(index: number, count: number): string;
@@ -0,0 +1,24 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local function pagerPlace(index, count)
3
+ if count <= 0 or index <= 0 then
4
+ return 0
5
+ end
6
+ if index >= count then
7
+ return count - 1
8
+ end
9
+ return index
10
+ end
11
+ local function pagerStep(index, count, delta)
12
+ return pagerPlace(pagerPlace(index, count) + delta, count)
13
+ end
14
+ local function pagerLabel(index, count)
15
+ local place = pagerPlace(index, count)
16
+ local shown = if count <= 0 then 0 else place + 1
17
+ local total = if count < 0 then 0 else count
18
+ return `{shown} / {total}`
19
+ end
20
+ return {
21
+ pagerPlace = pagerPlace,
22
+ pagerStep = pagerStep,
23
+ pagerLabel = pagerLabel,
24
+ }
@@ -0,0 +1,3 @@
1
+ export { default as Pager } from "./components/Pager";
2
+ export { PagerProps } from "./components/Pager";
3
+ export { pagerLabel, pagerPlace, pagerStep } from "./components/pagerStep";
@@ -0,0 +1,9 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ exports.Pager = TS.import(script, script, "components", "Pager").default
5
+ local _pagerStep = TS.import(script, script, "components", "pagerStep")
6
+ exports.pagerLabel = _pagerStep.pagerLabel
7
+ exports.pagerPlace = _pagerStep.pagerPlace
8
+ exports.pagerStep = _pagerStep.pagerStep
9
+ return exports
@@ -6,6 +6,7 @@ local NumberInput = TS.import(script, script.Parent.Parent.Parent, "numberInput"
6
6
  local usePhysicalPropertiesEditorStyles = TS.import(script, script.Parent, "PhysicalPropertiesEditor.styles").default
7
7
  local _physicalParts = TS.import(script, script.Parent, "physicalParts")
8
8
  local patchPhysicalParts = _physicalParts.patchPhysicalParts
9
+ local physicalBounds = _physicalParts.physicalBounds
9
10
  local physicalCaption = _physicalParts.physicalCaption
10
11
  local physicalRows = _physicalParts.physicalRows
11
12
  local function PhysicalPropertiesEditor(props)
@@ -84,8 +85,12 @@ local function PhysicalPropertiesEditor(props)
84
85
  _attributes_7.LayoutOrder = 2
85
86
  return React.createElement("frame", _attributes_4, _exp_3, _exp_4, React.createElement("frame", _attributes_7, React.createElement(NumberInput, {
86
87
  value = amounts[field],
88
+ min = physicalBounds(field).min,
89
+ max = physicalBounds(field).max,
90
+ step = physicalBounds(field).step,
87
91
  places = 4,
88
92
  disabled = disabled,
93
+ size = "small",
89
94
  width = UDim.new(1, 0),
90
95
  onChange = function(amount)
91
96
  return commit(field, amount)
@@ -2,4 +2,9 @@ export type PhysicalField = "Density" | "Friction" | "Elasticity" | "FrictionWei
2
2
  export declare function physicalFields(): PhysicalField[];
3
3
  export declare function physicalCaption(field: PhysicalField): "Density" | "Friction" | "Elasticity" | "Friction wt" | "Elasticity wt";
4
4
  export declare function physicalRows(): PhysicalField[][];
5
+ export declare function physicalBounds(field: PhysicalField): {
6
+ min: number;
7
+ max: number;
8
+ step: number;
9
+ };
5
10
  export declare function patchPhysicalParts(density: number, friction: number, elasticity: number, frictionWeight: number, elasticityWeight: number, field: PhysicalField, amount: number): number[];
@@ -14,6 +14,27 @@ end
14
14
  local function physicalRows()
15
15
  return { { "Density", "Friction" }, { "Elasticity", "FrictionWeight" }, { "ElasticityWeight" } }
16
16
  end
17
+ local function physicalBounds(field)
18
+ if field == "Density" then
19
+ return {
20
+ min = 0.01,
21
+ max = 100,
22
+ step = 0.01,
23
+ }
24
+ end
25
+ if field == "Friction" or field == "Elasticity" then
26
+ return {
27
+ min = 0,
28
+ max = 1,
29
+ step = 0.01,
30
+ }
31
+ end
32
+ return {
33
+ min = 0,
34
+ max = 100,
35
+ step = 0.1,
36
+ }
37
+ end
17
38
  local function patchPhysicalParts(density, friction, elasticity, frictionWeight, elasticityWeight, field, amount)
18
39
  local parts = { density, friction, elasticity, frictionWeight, elasticityWeight }
19
40
  local index = if field == "Density" then 0 elseif field == "Friction" then 1 elseif field == "Elasticity" then 2 elseif field == "FrictionWeight" then 3 else 4
@@ -24,5 +45,6 @@ return {
24
45
  physicalFields = physicalFields,
25
46
  physicalCaption = physicalCaption,
26
47
  physicalRows = physicalRows,
48
+ physicalBounds = physicalBounds,
27
49
  patchPhysicalParts = patchPhysicalParts,
28
50
  }
@@ -0,0 +1,12 @@
1
+ import React from "@rbxts/react";
2
+ import { CustomizedProps } from "../../../../theme/index";
3
+ export interface PopoverProps {
4
+ anchor?: GuiObject;
5
+ open?: boolean;
6
+ preferredHeight?: number;
7
+ preferredWidth?: number;
8
+ onDismiss?: () => void;
9
+ children?: React.ReactNode;
10
+ }
11
+ declare function Popover(props: CustomizedProps<Frame, PopoverProps>): JSX.Element | undefined;
12
+ export default Popover;
@@ -0,0 +1,50 @@
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 SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
5
+ local Popup = TS.import(script, script.Parent.Parent.Parent, "popup").Popup
6
+ local usePopoverStyles = TS.import(script, script.Parent, "Popover.styles").default
7
+ local function Popover(props)
8
+ local _binding = props
9
+ local anchor = _binding.anchor
10
+ local open = _binding.open
11
+ local preferredHeight = _binding.preferredHeight
12
+ local preferredWidth = _binding.preferredWidth
13
+ local onDismiss = _binding.onDismiss
14
+ local children = _binding.children
15
+ local className = _binding.className
16
+ local sx = _binding.sx
17
+ local id = _binding.id
18
+ local ref = _binding.ref
19
+ local styles = usePopoverStyles()
20
+ if open ~= true then
21
+ return nil
22
+ end
23
+ local _attributes = {
24
+ tag = "frame",
25
+ }
26
+ local _condition = id
27
+ if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
28
+ _condition = "Popover"
29
+ end
30
+ _attributes.key = _condition
31
+ _attributes.hostRef = ref
32
+ _attributes.base = styles.root
33
+ _attributes.className = className
34
+ _attributes.sx = sx
35
+ local _attributes_1 = table.clone(styles.corner)
36
+ setmetatable(_attributes_1, nil)
37
+ local _exp = React.createElement("uicorner", _attributes_1)
38
+ local _attributes_2 = table.clone(styles.stroke)
39
+ setmetatable(_attributes_2, nil)
40
+ return React.createElement(Popup, {
41
+ anchor = anchor,
42
+ preferredHeight = preferredHeight,
43
+ preferredWidth = preferredWidth,
44
+ onDismiss = onDismiss,
45
+ }, React.createElement(SxHost, _attributes, _exp, React.createElement("uistroke", _attributes_2), children))
46
+ end
47
+ local default = Popover
48
+ return {
49
+ default = default,
50
+ }
@@ -0,0 +1,2 @@
1
+ declare const usePopoverStyles: () => import("../../../../theme/index").ClassNameMap<string>;
2
+ export default usePopoverStyles;
@@ -0,0 +1,26 @@
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 createStyles = _theme.createStyles
6
+ local usePopoverStyles = componentStyles("Popover", function(theme)
7
+ return createStyles({
8
+ root = {
9
+ Size = UDim2.new(1, 0, 0, 0),
10
+ AutomaticSize = Enum.AutomaticSize.Y,
11
+ BackgroundColor3 = theme.palette.surface.elevated,
12
+ BorderSizePixel = 0,
13
+ },
14
+ corner = {
15
+ CornerRadius = UDim.new(0, theme.shape.borderRadius),
16
+ },
17
+ stroke = {
18
+ Color = theme.palette.border,
19
+ ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
20
+ },
21
+ })
22
+ end)
23
+ local default = usePopoverStyles
24
+ return {
25
+ default = default,
26
+ }
@@ -0,0 +1,2 @@
1
+ export { default as Popover } from "./components/Popover";
2
+ export { PopoverProps } from "./components/Popover";
@@ -0,0 +1,5 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ exports.Popover = TS.import(script, script, "components", "Popover").default
5
+ return exports
@@ -5,9 +5,12 @@ export interface ChoiceOption<T> {
5
5
  disabled?: boolean;
6
6
  group?: string;
7
7
  }
8
+ export interface RadioOption<T> extends ChoiceOption<T> {
9
+ hint?: string;
10
+ }
8
11
  export interface RadioGroupProps<T> {
9
12
  value: T;
10
- options: ChoiceOption<T>[];
13
+ options: RadioOption<T>[];
11
14
  onChange: (value: T) => void;
12
15
  disabled?: boolean;
13
16
  size?: ControlSize;
@@ -1,8 +1,11 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
2
  local TS = _G[script]
3
- local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
3
+ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local React = _react
5
+ local useState = _react.useState
4
6
  local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
5
7
  local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
8
+ local radioHint = TS.import(script, script.Parent, "radioHint").radioHint
6
9
  local useRadioGroupStyles = TS.import(script, script.Parent, "RadioGroup.styles").default
7
10
  local function RadioGroup(props)
8
11
  local _binding = props
@@ -27,8 +30,12 @@ local function RadioGroup(props)
27
30
  local ring = _binding_1.ring
28
31
  local dot = _binding_1.dot
29
32
  local stroke = _binding_1.stroke
33
+ local focus = _binding_1.focus
30
34
  local corner = _binding_1.corner
31
35
  local label = _binding_1.label
36
+ local hint = _binding_1.hint
37
+ local notes = _binding_1.notes
38
+ local focused, setFocused = useState(nil)
32
39
  local _attributes = {
33
40
  tag = "frame",
34
41
  }
@@ -52,6 +59,7 @@ local function RadioGroup(props)
52
59
  local _callback = function(choice, index)
53
60
  local active = canActivate(disabled or choice.disabled)
54
61
  local fade = if active then 0 else 0.5
62
+ local note = radioHint(choice.hint)
55
63
  local _attributes_2 = {
56
64
  key = `{choice.label}-{index}`,
57
65
  }
@@ -67,6 +75,16 @@ local function RadioGroup(props)
67
75
  onChange(choice.value)
68
76
  end
69
77
  end,
78
+ SelectionGained = function()
79
+ if active then
80
+ setFocused(index)
81
+ end
82
+ end,
83
+ SelectionLost = function()
84
+ setFocused(function(current)
85
+ return if current == index then nil else current
86
+ end)
87
+ end,
70
88
  }
71
89
  local _attributes_3 = table.clone(optionRow)
72
90
  setmetatable(_attributes_3, nil)
@@ -77,7 +95,7 @@ local function RadioGroup(props)
77
95
  local _attributes_5 = table.clone(corner)
78
96
  setmetatable(_attributes_5, nil)
79
97
  local _exp_2 = React.createElement("uicorner", _attributes_5)
80
- local _attributes_6 = table.clone(stroke)
98
+ local _attributes_6 = table.clone((if focused == index then focus else stroke))
81
99
  setmetatable(_attributes_6, nil)
82
100
  _attributes_6.Transparency = fade
83
101
  local _exp_3 = React.createElement("uistroke", _attributes_6)
@@ -91,12 +109,37 @@ local function RadioGroup(props)
91
109
  _condition_1 = (React.createElement("frame", _attributes_7, React.createElement("uicorner", _attributes_8)))
92
110
  end
93
111
  local _exp_4 = React.createElement("frame", _attributes_4, _exp_2, _exp_3, _condition_1)
94
- local _attributes_7 = table.clone(label)
95
- setmetatable(_attributes_7, nil)
96
- _attributes_7.Text = choice.label
97
- _attributes_7.TextTransparency = fade
98
- _attributes_7.LayoutOrder = 2
99
- return React.createElement("textbutton", _attributes_2, _exp_1, _exp_4, React.createElement("textlabel", _attributes_7))
112
+ local _result
113
+ if note == nil then
114
+ local _attributes_7 = table.clone(label)
115
+ setmetatable(_attributes_7, nil)
116
+ _attributes_7.Text = choice.label
117
+ _attributes_7.TextTransparency = fade
118
+ _attributes_7.LayoutOrder = 2
119
+ _result = (React.createElement("textlabel", _attributes_7))
120
+ else
121
+ local _attributes_7 = table.clone(notes)
122
+ setmetatable(_attributes_7, nil)
123
+ _attributes_7.LayoutOrder = 2
124
+ local _exp_5 = React.createElement("uilistlayout", {
125
+ FillDirection = Enum.FillDirection.Vertical,
126
+ SortOrder = Enum.SortOrder.LayoutOrder,
127
+ Padding = UDim.new(0, 0),
128
+ })
129
+ local _attributes_8 = table.clone(label)
130
+ setmetatable(_attributes_8, nil)
131
+ _attributes_8.Text = choice.label
132
+ _attributes_8.TextTransparency = fade
133
+ _attributes_8.LayoutOrder = 1
134
+ local _exp_6 = React.createElement("textlabel", _attributes_8)
135
+ local _attributes_9 = table.clone(hint)
136
+ setmetatable(_attributes_9, nil)
137
+ _attributes_9.Text = note
138
+ _attributes_9.TextTransparency = fade
139
+ _attributes_9.LayoutOrder = 2
140
+ _result = (React.createElement("frame", _attributes_7, _exp_5, _exp_6, React.createElement("textlabel", _attributes_9)))
141
+ end
142
+ return React.createElement("textbutton", _attributes_2, _exp_1, _exp_4, _result)
100
143
  end
101
144
  for _k, _v in options do
102
145
  _newValue[_k] = _callback(_v, _k - 1, options)
@@ -4,11 +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 focusRing = _theme.focusRing
7
8
  local useRadioGroupStyles = componentStyles("RadioGroup", function(theme, _param)
8
9
  local size = _param.size
9
10
  local row = _param.row
10
11
  local metrics = controlMetrics(theme.density, size)
11
- return createStyles({
12
+ local _object = {
12
13
  root = {
13
14
  AutomaticSize = Enum.AutomaticSize.XY,
14
15
  Size = UDim2.fromScale(0, 0),
@@ -50,6 +51,7 @@ local useRadioGroupStyles = componentStyles("RadioGroup", function(theme, _param
50
51
  Color = theme.palette.text.primary,
51
52
  Thickness = 1,
52
53
  },
54
+ focus = focusRing(theme.palette.focus),
53
55
  corner = {
54
56
  CornerRadius = UDim.new(1, 0),
55
57
  },
@@ -61,7 +63,29 @@ local useRadioGroupStyles = componentStyles("RadioGroup", function(theme, _param
61
63
  Font = theme.typography.fontFamilies.default,
62
64
  TextSize = metrics.font,
63
65
  },
64
- })
66
+ }
67
+ local _left = "hint"
68
+ local _object_1 = {
69
+ AutomaticSize = Enum.AutomaticSize.XY,
70
+ Size = UDim2.fromScale(0, 0),
71
+ BackgroundTransparency = 1,
72
+ TextColor3 = theme.palette.text.secondary,
73
+ Font = theme.typography.fontFamilies.default,
74
+ }
75
+ local _left_1 = "TextSize"
76
+ local _condition = theme.typography.fontSizes.caption
77
+ if _condition == nil then
78
+ _condition = metrics.font
79
+ end
80
+ _object_1[_left_1] = _condition
81
+ _object[_left] = _object_1
82
+ _object.notes = {
83
+ AutomaticSize = Enum.AutomaticSize.XY,
84
+ Size = UDim2.fromScale(0, 0),
85
+ BackgroundTransparency = 1,
86
+ BorderSizePixel = 0,
87
+ }
88
+ return createStyles(_object)
65
89
  end)
66
90
  local default = useRadioGroupStyles
67
91
  return {
@@ -0,0 +1,2 @@
1
+ /** An empty note stays off the option. */
2
+ export declare function radioHint(hint?: string): string | undefined;
@@ -0,0 +1,11 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ --* An empty note stays off the option.
3
+ local function radioHint(hint)
4
+ if hint == nil or hint == "" then
5
+ return nil
6
+ end
7
+ return hint
8
+ end
9
+ return {
10
+ radioHint = radioHint,
11
+ }
@@ -1,2 +1,2 @@
1
1
  export { default as RadioGroup } from "./components/RadioGroup";
2
- export { RadioGroupProps, ChoiceOption } from "./components/RadioGroup";
2
+ export { RadioGroupProps, ChoiceOption, RadioOption } from "./components/RadioGroup";
@@ -5,7 +5,7 @@ export interface RatingProps {
5
5
  size?: ControlSize;
6
6
  disabled?: boolean;
7
7
  readOnly?: boolean;
8
- onChange: (value: number) => void;
8
+ onChange?: (value: number) => void;
9
9
  }
10
10
  declare function Rating(props: CustomizedProps<Frame, RatingProps>): JSX.Element;
11
11
  export default Rating;
@@ -4,6 +4,7 @@ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
4
  local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
5
5
  local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
6
6
  local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
7
+ local ratingCommit = TS.import(script, script.Parent, "ratingCommit").ratingCommit
7
8
  local useRatingStyles = TS.import(script, script.Parent, "Rating.styles").default
8
9
  local function Rating(props)
9
10
  local _binding = props
@@ -78,8 +79,9 @@ local function Rating(props)
78
79
  _attributes_2.Selectable = active
79
80
  _attributes_2.Event = {
80
81
  Activated = function()
81
- if active then
82
- onChange(if n == value then 0 else n)
82
+ local landed = ratingCommit(readOnly, onChange, if n == value then 0 else n)
83
+ if landed ~= nil and onChange ~= nil then
84
+ onChange(landed)
83
85
  end
84
86
  end,
85
87
  }
@@ -0,0 +1,2 @@
1
+ /** Clicks commit only when the rating is editable and a handler was passed. */
2
+ export declare function ratingCommit(readOnly: boolean | undefined, onChange: ((value: number) => void) | undefined, landed: number): number | undefined;