@rbxts/uiblox 0.2.0-alpha.3 → 0.2.0-alpha.30

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 (312) hide show
  1. package/README.md +27 -109
  2. package/out/hooks/index.d.ts +1 -0
  3. package/out/hooks/init.luau +3 -0
  4. package/out/hooks/useBreakpoints.luau +2 -11
  5. package/out/hooks/viewportObserver.d.ts +10 -0
  6. package/out/hooks/viewportObserver.luau +75 -0
  7. package/out/theme/interfaces/theme/Theme.d.ts +15 -0
  8. package/out/theme/styles/utilities/componentStyles.luau +45 -3
  9. package/out/theme/styles/utilities/componentTheme.d.ts +15 -0
  10. package/out/theme/styles/utilities/index.d.ts +2 -0
  11. package/out/theme/styles/utilities/init.luau +7 -0
  12. package/out/theme/styles/utilities/resolveStyle.d.ts +10 -2
  13. package/out/theme/styles/utilities/resolveStyle.luau +7 -3
  14. package/out/theme/styles/utilities/resolveSx.d.ts +110 -0
  15. package/out/theme/styles/utilities/resolveSx.luau +479 -0
  16. package/out/theme/styles/utilities/styleCache.d.ts +2 -0
  17. package/out/theme/styles/utilities/styleCache.luau +9 -0
  18. package/out/ui/packages/accordion/components/Accordion.d.ts +2 -0
  19. package/out/ui/packages/accordion/components/Accordion.luau +46 -30
  20. package/out/ui/packages/accordion/components/Accordion.styles.d.ts +1 -0
  21. package/out/ui/packages/accordion/components/Accordion.styles.luau +16 -4
  22. package/out/ui/packages/accordion/components/accordionOpen.d.ts +1 -0
  23. package/out/ui/packages/accordion/components/accordionOpen.luau +4 -0
  24. package/out/ui/packages/alert/components/Alert.d.ts +2 -0
  25. package/out/ui/packages/alert/components/Alert.luau +48 -42
  26. package/out/ui/packages/alert/components/Alert.styles.d.ts +2 -0
  27. package/out/ui/packages/alert/components/Alert.styles.luau +17 -8
  28. package/out/ui/packages/appBar/components/AppBar.d.ts +2 -1
  29. package/out/ui/packages/appBar/components/AppBar.luau +47 -36
  30. package/out/ui/packages/appBar/components/AppBar.styles.d.ts +2 -0
  31. package/out/ui/packages/appBar/components/AppBar.styles.luau +16 -5
  32. package/out/ui/packages/assetField/components/AssetField.luau +12 -16
  33. package/out/ui/packages/autocomplete/components/Autocomplete.luau +8 -0
  34. package/out/ui/packages/avatar/components/Avatar.d.ts +2 -0
  35. package/out/ui/packages/avatar/components/Avatar.luau +27 -26
  36. package/out/ui/packages/avatar/components/Avatar.styles.d.ts +2 -0
  37. package/out/ui/packages/avatar/components/Avatar.styles.luau +5 -1
  38. package/out/ui/packages/backdrop/components/Backdrop.d.ts +10 -0
  39. package/out/ui/packages/backdrop/components/Backdrop.luau +51 -0
  40. package/out/ui/packages/backdrop/components/Backdrop.styles.d.ts +4 -0
  41. package/out/ui/packages/backdrop/components/Backdrop.styles.luau +24 -0
  42. package/out/ui/packages/backdrop/index.d.ts +2 -0
  43. package/out/ui/packages/backdrop/init.luau +5 -0
  44. package/out/ui/packages/badge/components/Badge.d.ts +3 -0
  45. package/out/ui/packages/badge/components/Badge.luau +32 -24
  46. package/out/ui/packages/badge/components/Badge.styles.d.ts +5 -1
  47. package/out/ui/packages/badge/components/Badge.styles.luau +20 -8
  48. package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +1 -0
  49. package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +20 -18
  50. package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.d.ts +3 -1
  51. package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +6 -2
  52. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +1 -0
  53. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +67 -40
  54. package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +9 -0
  55. package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +68 -0
  56. package/out/ui/packages/breadcrumbs/index.d.ts +1 -0
  57. package/out/ui/packages/breadcrumbs/init.luau +3 -0
  58. package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +12 -16
  59. package/out/ui/packages/button/components/Button.luau +28 -22
  60. package/out/ui/packages/card/components/Card.d.ts +3 -1
  61. package/out/ui/packages/card/components/Card.luau +10 -0
  62. package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +75 -53
  63. package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +26 -9
  64. package/out/ui/packages/checkbox/components/Checkbox.luau +16 -16
  65. package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
  66. package/out/ui/packages/chip/components/Chip.d.ts +6 -1
  67. package/out/ui/packages/chip/components/Chip.luau +61 -17
  68. package/out/ui/packages/chip/components/Chip.styles.d.ts +6 -0
  69. package/out/ui/packages/chip/components/Chip.styles.luau +54 -9
  70. package/out/ui/packages/circularProgress/components/CircularProgress.luau +29 -18
  71. package/out/ui/packages/colorPicker/components/ColorPicker.luau +16 -20
  72. package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +34 -20
  73. package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +34 -35
  74. package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +65 -62
  75. package/out/ui/packages/dialog/components/Dialog.d.ts +3 -2
  76. package/out/ui/packages/dialog/components/Dialog.luau +41 -21
  77. package/out/ui/packages/divider/components/Divider.d.ts +1 -0
  78. package/out/ui/packages/divider/components/Divider.luau +52 -17
  79. package/out/ui/packages/divider/components/Divider.styles.luau +32 -0
  80. package/out/ui/packages/divider/components/dividerLabel.d.ts +1 -0
  81. package/out/ui/packages/divider/components/dividerLabel.luau +10 -0
  82. package/out/ui/packages/drawer/components/Drawer.d.ts +3 -1
  83. package/out/ui/packages/drawer/components/Drawer.luau +71 -37
  84. package/out/ui/packages/drawer/components/Drawer.styles.d.ts +3 -1
  85. package/out/ui/packages/drawer/components/Drawer.styles.luau +3 -2
  86. package/out/ui/packages/fab/components/Fab.d.ts +3 -0
  87. package/out/ui/packages/fab/components/Fab.luau +79 -37
  88. package/out/ui/packages/fab/components/Fab.styles.d.ts +3 -0
  89. package/out/ui/packages/fab/components/Fab.styles.luau +39 -3
  90. package/out/ui/packages/fab/components/fabSize.d.ts +1 -0
  91. package/out/ui/packages/fab/components/fabSize.luau +4 -0
  92. package/out/ui/packages/fab/index.d.ts +1 -1
  93. package/out/ui/packages/fab/init.luau +1 -0
  94. package/out/ui/packages/fontEditor/components/FontEditor.luau +12 -16
  95. package/out/ui/packages/formText/components/FormHelperText.d.ts +8 -0
  96. package/out/ui/packages/formText/components/FormHelperText.luau +40 -0
  97. package/out/ui/packages/formText/components/FormLabel.d.ts +9 -0
  98. package/out/ui/packages/formText/components/FormLabel.luau +42 -0
  99. package/out/ui/packages/formText/components/FormText.styles.d.ts +5 -0
  100. package/out/ui/packages/formText/components/FormText.styles.luau +33 -0
  101. package/out/ui/packages/formText/index.d.ts +4 -0
  102. package/out/ui/packages/formText/init.luau +6 -0
  103. package/out/ui/packages/gradientEditor/components/GradientEditor.luau +56 -42
  104. package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +37 -4
  105. package/out/ui/packages/host/components/SxHost.d.ts +18 -0
  106. package/out/ui/packages/host/components/SxHost.luau +202 -0
  107. package/out/ui/packages/host/hostPaint.d.ts +11 -0
  108. package/out/ui/packages/host/hostPaint.luau +33 -0
  109. package/out/ui/packages/host/hostRules.d.ts +15 -0
  110. package/out/ui/packages/host/hostRules.luau +92 -0
  111. package/out/ui/packages/host/index.d.ts +3 -0
  112. package/out/ui/packages/host/init.luau +13 -0
  113. package/out/ui/packages/icon/components/Icon.luau +9 -16
  114. package/out/ui/packages/iconButton/components/IconButton.luau +22 -17
  115. package/out/ui/packages/iconButton/components/IconButton.styles.luau +3 -0
  116. package/out/ui/packages/imageList/components/ImageList.d.ts +14 -0
  117. package/out/ui/packages/imageList/components/ImageList.luau +93 -0
  118. package/out/ui/packages/imageList/components/ImageList.styles.d.ts +6 -0
  119. package/out/ui/packages/imageList/components/ImageList.styles.luau +73 -0
  120. package/out/ui/packages/imageList/components/imageListLayout.d.ts +4 -0
  121. package/out/ui/packages/imageList/components/imageListLayout.luau +31 -0
  122. package/out/ui/packages/imageList/index.d.ts +2 -0
  123. package/out/ui/packages/imageList/init.luau +5 -0
  124. package/out/ui/packages/index.d.ts +8 -0
  125. package/out/ui/packages/init.luau +24 -0
  126. package/out/ui/packages/input/components/Input.d.ts +1 -0
  127. package/out/ui/packages/input/components/Input.luau +22 -19
  128. package/out/ui/packages/layout/components/Box.d.ts +11 -0
  129. package/out/ui/packages/layout/components/Box.luau +40 -0
  130. package/out/ui/packages/layout/components/Box.styles.d.ts +7 -0
  131. package/out/ui/packages/layout/components/Box.styles.luau +34 -0
  132. package/out/ui/packages/layout/components/Container.d.ts +10 -0
  133. package/out/ui/packages/layout/components/Container.luau +45 -0
  134. package/out/ui/packages/layout/components/Container.styles.d.ts +6 -0
  135. package/out/ui/packages/layout/components/Container.styles.luau +41 -0
  136. package/out/ui/packages/layout/components/FlexItem.d.ts +12 -0
  137. package/out/ui/packages/layout/components/FlexItem.luau +40 -0
  138. package/out/ui/packages/layout/components/FlexItem.styles.d.ts +8 -0
  139. package/out/ui/packages/layout/components/FlexItem.styles.luau +66 -0
  140. package/out/ui/packages/layout/components/Grid.d.ts +5 -1
  141. package/out/ui/packages/layout/components/Grid.luau +41 -19
  142. package/out/ui/packages/layout/components/List.luau +9 -16
  143. package/out/ui/packages/layout/components/Stack.d.ts +14 -0
  144. package/out/ui/packages/layout/components/Stack.luau +44 -0
  145. package/out/ui/packages/layout/components/Stack.styles.d.ts +10 -0
  146. package/out/ui/packages/layout/components/Stack.styles.luau +101 -0
  147. package/out/ui/packages/layout/components/boxPad.d.ts +14 -0
  148. package/out/ui/packages/layout/components/boxPad.luau +59 -0
  149. package/out/ui/packages/layout/components/containerWidth.d.ts +2 -0
  150. package/out/ui/packages/layout/components/containerWidth.luau +17 -0
  151. package/out/ui/packages/layout/components/flexItemMode.d.ts +6 -0
  152. package/out/ui/packages/layout/components/flexItemMode.luau +36 -0
  153. package/out/ui/packages/layout/components/gridProps.d.ts +3 -0
  154. package/out/ui/packages/layout/components/gridProps.luau +20 -0
  155. package/out/ui/packages/layout/components/stackAlign.d.ts +10 -0
  156. package/out/ui/packages/layout/components/stackAlign.luau +43 -0
  157. package/out/ui/packages/layout/index.d.ts +14 -0
  158. package/out/ui/packages/layout/init.luau +5 -0
  159. package/out/ui/packages/link/components/Link.d.ts +11 -0
  160. package/out/ui/packages/link/components/Link.luau +80 -0
  161. package/out/ui/packages/link/components/Link.styles.d.ts +8 -0
  162. package/out/ui/packages/link/components/Link.styles.luau +59 -0
  163. package/out/ui/packages/link/index.d.ts +3 -0
  164. package/out/ui/packages/link/init.luau +5 -0
  165. package/out/ui/packages/listItem/components/ListItem.d.ts +4 -1
  166. package/out/ui/packages/listItem/components/ListItem.luau +44 -4
  167. package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
  168. package/out/ui/packages/listItem/components/ListItem.styles.luau +16 -5
  169. package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +7 -1
  170. package/out/ui/packages/loadingStroke/components/LoadingStroke.luau +23 -19
  171. package/out/ui/packages/loadingStroke/components/loadingStrokeSx.d.ts +11 -0
  172. package/out/ui/packages/loadingStroke/components/loadingStrokeSx.luau +2 -0
  173. package/out/ui/packages/markdown/components/Markdown.d.ts +6 -0
  174. package/out/ui/packages/markdown/components/Markdown.luau +221 -0
  175. package/out/ui/packages/markdown/components/Markdown.styles.d.ts +2 -0
  176. package/out/ui/packages/markdown/components/Markdown.styles.luau +101 -0
  177. package/out/ui/packages/markdown/components/MarkdownEditor.d.ts +16 -0
  178. package/out/ui/packages/markdown/components/MarkdownEditor.luau +315 -0
  179. package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +6 -0
  180. package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +132 -0
  181. package/out/ui/packages/markdown/htmlToMarkdown.d.ts +2 -0
  182. package/out/ui/packages/markdown/htmlToMarkdown.luau +350 -0
  183. package/out/ui/packages/markdown/index.d.ts +8 -0
  184. package/out/ui/packages/markdown/init.luau +11 -0
  185. package/out/ui/packages/markdown/parseMarkdown.d.ts +42 -0
  186. package/out/ui/packages/markdown/parseMarkdown.luau +459 -0
  187. package/out/ui/packages/menu/components/Menu.d.ts +7 -1
  188. package/out/ui/packages/menu/components/Menu.luau +68 -26
  189. package/out/ui/packages/menu/components/Menu.styles.luau +5 -1
  190. package/out/ui/packages/modal/components/Modal.d.ts +2 -1
  191. package/out/ui/packages/modal/components/Modal.luau +79 -37
  192. package/out/ui/packages/motion/index.d.ts +1 -1
  193. package/out/ui/packages/motion/init.luau +1 -0
  194. package/out/ui/packages/motion/unit.d.ts +5 -0
  195. package/out/ui/packages/motion/unit.luau +23 -0
  196. package/out/ui/packages/numberInput/components/NumberInput.d.ts +2 -0
  197. package/out/ui/packages/numberInput/components/NumberInput.luau +16 -3
  198. package/out/ui/packages/numberInput/components/numberValue.d.ts +1 -0
  199. package/out/ui/packages/numberInput/components/numberValue.luau +45 -0
  200. package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +12 -16
  201. package/out/ui/packages/pagination/components/Pagination.d.ts +6 -1
  202. package/out/ui/packages/pagination/components/Pagination.luau +62 -38
  203. package/out/ui/packages/pagination/components/Pagination.styles.d.ts +6 -1
  204. package/out/ui/packages/pagination/components/Pagination.styles.luau +36 -4
  205. package/out/ui/packages/pagination/components/pageRange.d.ts +2 -1
  206. package/out/ui/packages/pagination/components/pageRange.luau +91 -8
  207. package/out/ui/packages/pagination/index.d.ts +1 -0
  208. package/out/ui/packages/pagination/init.luau +1 -0
  209. package/out/ui/packages/paper/components/Paper.d.ts +4 -2
  210. package/out/ui/packages/paper/components/Paper.luau +31 -9
  211. package/out/ui/packages/paper/components/Paper.styles.d.ts +1 -1
  212. package/out/ui/packages/paper/components/Paper.styles.luau +6 -0
  213. package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +63 -38
  214. package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +21 -7
  215. package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +2 -0
  216. package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +14 -0
  217. package/out/ui/packages/popup/components/Popup.d.ts +2 -1
  218. package/out/ui/packages/popup/components/Popup.luau +35 -18
  219. package/out/ui/packages/popup/index.d.ts +1 -0
  220. package/out/ui/packages/popup/init.luau +1 -0
  221. package/out/ui/packages/preloader/components/Preloader.luau +9 -16
  222. package/out/ui/packages/progressBar/components/ProgressBar.luau +12 -16
  223. package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +1 -0
  224. package/out/ui/packages/radioGroup/components/RadioGroup.luau +16 -18
  225. package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +1 -0
  226. package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +4 -1
  227. package/out/ui/packages/rating/components/Rating.d.ts +11 -0
  228. package/out/ui/packages/rating/components/Rating.luau +97 -0
  229. package/out/ui/packages/rating/components/Rating.styles.d.ts +6 -0
  230. package/out/ui/packages/rating/components/Rating.styles.luau +44 -0
  231. package/out/ui/packages/rating/index.d.ts +2 -0
  232. package/out/ui/packages/rating/init.luau +5 -0
  233. package/out/ui/packages/rayEditor/components/RayEditor.luau +12 -16
  234. package/out/ui/packages/rectEditor/components/RectEditor.luau +86 -43
  235. package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +30 -7
  236. package/out/ui/packages/select/components/Select.d.ts +5 -0
  237. package/out/ui/packages/select/components/Select.luau +61 -77
  238. package/out/ui/packages/select/components/Select.styles.luau +1 -1
  239. package/out/ui/packages/shadow/components/Shadow.d.ts +2 -1
  240. package/out/ui/packages/shadow/components/Shadow.luau +39 -17
  241. package/out/ui/packages/shadow/components/Shadow.styles.luau +7 -2
  242. package/out/ui/packages/sidebar/components/Sidebar.luau +9 -16
  243. package/out/ui/packages/skeleton/components/Skeleton.luau +22 -30
  244. package/out/ui/packages/skeleton/components/Skeleton.styles.luau +7 -2
  245. package/out/ui/packages/skeleton/components/skeletonMotion.luau +1 -1
  246. package/out/ui/packages/skeleton/components/skeletonTone.d.ts +20 -0
  247. package/out/ui/packages/skeleton/components/skeletonTone.luau +14 -0
  248. package/out/ui/packages/slider/components/Slider.d.ts +3 -0
  249. package/out/ui/packages/slider/components/Slider.luau +47 -19
  250. package/out/ui/packages/slider/components/Slider.styles.d.ts +2 -0
  251. package/out/ui/packages/slider/components/Slider.styles.luau +14 -1
  252. package/out/ui/packages/slider/components/sliderMarks.d.ts +1 -0
  253. package/out/ui/packages/slider/components/sliderMarks.luau +37 -0
  254. package/out/ui/packages/snackbar/components/Snackbar.d.ts +2 -0
  255. package/out/ui/packages/snackbar/components/Snackbar.luau +5 -0
  256. package/out/ui/packages/snackbar/components/snackbarAction.d.ts +1 -0
  257. package/out/ui/packages/snackbar/components/snackbarAction.luau +10 -0
  258. package/out/ui/packages/speedDial/components/SpeedDial.d.ts +19 -0
  259. package/out/ui/packages/speedDial/components/SpeedDial.luau +97 -0
  260. package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +5 -0
  261. package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +31 -0
  262. package/out/ui/packages/speedDial/index.d.ts +3 -0
  263. package/out/ui/packages/speedDial/init.luau +5 -0
  264. package/out/ui/packages/splitPane/components/SplitPane.luau +13 -17
  265. package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
  266. package/out/ui/packages/stateMatrix.d.ts +2 -0
  267. package/out/ui/packages/stateMatrix.luau +872 -881
  268. package/out/ui/packages/stepper/components/Stepper.d.ts +1 -0
  269. package/out/ui/packages/stepper/components/Stepper.luau +16 -17
  270. package/out/ui/packages/stepper/components/Stepper.styles.d.ts +3 -1
  271. package/out/ui/packages/stepper/components/Stepper.styles.luau +6 -2
  272. package/out/ui/packages/switch/components/Switch.d.ts +2 -0
  273. package/out/ui/packages/switch/components/Switch.luau +21 -16
  274. package/out/ui/packages/switch/components/Switch.styles.d.ts +2 -0
  275. package/out/ui/packages/switch/components/Switch.styles.luau +6 -1
  276. package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
  277. package/out/ui/packages/table/components/Table.d.ts +1 -0
  278. package/out/ui/packages/table/components/Table.luau +15 -19
  279. package/out/ui/packages/table/components/Table.styles.d.ts +3 -1
  280. package/out/ui/packages/table/components/Table.styles.luau +10 -6
  281. package/out/ui/packages/tabs/components/Tabs.d.ts +3 -0
  282. package/out/ui/packages/tabs/components/Tabs.luau +24 -19
  283. package/out/ui/packages/tabs/components/Tabs.styles.d.ts +5 -1
  284. package/out/ui/packages/tabs/components/Tabs.styles.luau +26 -10
  285. package/out/ui/packages/tabs/components/tabsOrientation.d.ts +2 -0
  286. package/out/ui/packages/tabs/components/tabsOrientation.luau +7 -0
  287. package/out/ui/packages/tabs/index.d.ts +1 -0
  288. package/out/ui/packages/tabs/init.luau +1 -0
  289. package/out/ui/packages/toast/components/Toast.d.ts +2 -0
  290. package/out/ui/packages/toast/components/Toast.luau +41 -13
  291. package/out/ui/packages/toast/components/Toast.styles.luau +23 -5
  292. package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +21 -0
  293. package/out/ui/packages/toggleButton/components/ToggleButton.luau +129 -0
  294. package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +9 -0
  295. package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +69 -0
  296. package/out/ui/packages/toggleButton/index.d.ts +2 -0
  297. package/out/ui/packages/toggleButton/init.luau +7 -0
  298. package/out/ui/packages/tooltip/components/Tooltip.luau +9 -16
  299. package/out/ui/packages/treeView/components/TreeView.luau +9 -16
  300. package/out/ui/packages/typography/components/Typography.luau +13 -14
  301. package/out/ui/packages/udimEditor/components/UDimEditor.luau +12 -16
  302. package/out/ui/packages/vectorEditor/components/VectorEditor.luau +12 -16
  303. package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +7 -0
  304. package/out/ui/packages/virtualList/components/EmptyListHint.luau +43 -0
  305. package/out/ui/packages/virtualList/components/EmptyListHint.styles.d.ts +5 -0
  306. package/out/ui/packages/virtualList/components/EmptyListHint.styles.luau +26 -0
  307. package/out/ui/packages/virtualList/components/VirtualList.luau +9 -16
  308. package/out/ui/packages/virtualList/index.d.ts +2 -0
  309. package/out/ui/packages/virtualList/init.luau +1 -0
  310. package/package.json +2 -2
  311. package/out/ui/packages/select/components/selectMotion.d.ts +0 -2
  312. package/out/ui/packages/select/components/selectMotion.luau +0 -12
@@ -7,6 +7,7 @@ local useState = _react.useState
7
7
  local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
8
8
  local cx = _theme.cx
9
9
  local useTheme = _theme.useTheme
10
+ local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
10
11
  local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
11
12
  local Input = TS.import(script, script.Parent.Parent.Parent, "input").Input
12
13
  local Popup = TS.import(script, script.Parent.Parent.Parent, "popup").Popup
@@ -64,26 +65,21 @@ local function BrickColorPicker(props)
64
65
  setOpen(false)
65
66
  setQuery("")
66
67
  end
67
- local _attributes = {}
68
+ local _attributes = {
69
+ tag = "frame",
70
+ }
68
71
  local _condition = id
69
72
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
70
73
  _condition = "BrickColorPicker"
71
74
  end
72
75
  _attributes.key = _condition
73
- _attributes.ref = ref
74
- for _k, _v in styles.root do
75
- _attributes[_k] = _v
76
- end
77
- if className then
78
- for _k, _v in className do
79
- _attributes[_k] = _v
80
- end
81
- end
82
- if sx then
83
- for _k, _v in sx do
84
- _attributes[_k] = _v
85
- end
86
- end
76
+ _attributes.hostRef = ref
77
+ _attributes.base = styles.root
78
+ _attributes.className = className
79
+ _attributes.sx = sx
80
+ _attributes.state = {
81
+ disabled = disabled,
82
+ }
87
83
  local _attributes_1 = {
88
84
  key = "Trigger",
89
85
  ref = setAnchor,
@@ -226,7 +222,7 @@ local function BrickColorPicker(props)
226
222
  end,
227
223
  })))))
228
224
  end
229
- return React.createElement("frame", _attributes, _exp_6, _condition_1)
225
+ return React.createElement(SxHost, _attributes, _exp_6, _condition_1)
230
226
  end
231
227
  local default = BrickColorPicker
232
228
  return {
@@ -4,7 +4,9 @@ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
4
  local React = _react
5
5
  local useEffect = _react.useEffect
6
6
  local useState = _react.useState
7
+ local useReducedMotion = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "hooks").useReducedMotion
7
8
  local useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").useTheme
9
+ local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
8
10
  local CircularProgress = TS.import(script, script.Parent.Parent.Parent, "circularProgress").CircularProgress
9
11
  local LoadingStroke = TS.import(script, script.Parent.Parent.Parent, "loadingStroke").LoadingStroke
10
12
  local canActivate = TS.import(script, script.Parent, "activation").canActivate
@@ -36,7 +38,7 @@ local function Button(props)
36
38
  if loadingPosition == nil then
37
39
  loadingPosition = "center"
38
40
  end
39
- local reducedMotion = _binding.reducedMotion
41
+ local reducedProp = _binding.reducedMotion
40
42
  local rounded = _binding.rounded
41
43
  if rounded == nil then
42
44
  rounded = true
@@ -69,12 +71,14 @@ local function Button(props)
69
71
  local stroke = _binding_1.stroke
70
72
  local _binding_2 = useTheme()
71
73
  local theme = _binding_2.theme
74
+ local reducedMotion = useReducedMotion(reducedProp)
72
75
  local hovering, setHovering = useState(false)
73
76
  local focused, setFocused = useState(false)
74
77
  local active = canActivate(disabled, loading)
75
78
  local pressed = disabled or (not hoveringDisabled and active and (hovering or focused))
76
79
  local face = buttonFace(text, loading, loadingLabel)
77
80
  local place = spinnerPlace(loadingPosition)
81
+ local busy = loading or animating
78
82
  local branded = (props.color or "primary") == "primary"
79
83
  local spinnerColor = if variant == "contained" then if branded then theme.palette.primary.on else theme.palette.text.inverse elseif branded then theme.palette.primary.main else theme.palette.text.primary
80
84
  useEffect(function()
@@ -84,29 +88,30 @@ local function Button(props)
84
88
  setHovering(false)
85
89
  setFocused(false)
86
90
  end, { active })
87
- local _attributes = {}
91
+ local _attributes = {
92
+ tag = "textbutton",
93
+ }
88
94
  local _condition = id
89
95
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
90
96
  _condition = "Button"
91
97
  end
92
98
  _attributes.key = _condition
93
- _attributes.ref = ref
94
- for _k, _v in root do
95
- _attributes[_k] = _v
96
- end
99
+ _attributes.hostRef = ref
100
+ local _object = table.clone(root)
101
+ setmetatable(_object, nil)
97
102
  for _k, _v in font do
98
- _attributes[_k] = _v
99
- end
100
- if className then
101
- for _k, _v in className do
102
- _attributes[_k] = _v
103
- end
104
- end
105
- if sx then
106
- for _k, _v in sx do
107
- _attributes[_k] = _v
108
- end
109
- end
103
+ _object[_k] = _v
104
+ end
105
+ _attributes.base = _object
106
+ _attributes.className = className
107
+ _attributes.sx = sx
108
+ _attributes.state = {
109
+ disabled = disabled,
110
+ loading = loading,
111
+ hover = hovering,
112
+ pressed = pressed,
113
+ focused = focused,
114
+ }
110
115
  _attributes.Active = active
111
116
  _attributes.AutoButtonColor = active
112
117
  _attributes.Selectable = active
@@ -186,14 +191,15 @@ local function Button(props)
186
191
  end
187
192
  end,
188
193
  }
189
- local _condition_1 = variant == "outlined" and not animating
194
+ local _condition_1 = variant == "outlined" and not busy
190
195
  if _condition_1 then
191
196
  local _attributes_1 = table.clone(stroke)
192
197
  setmetatable(_attributes_1, nil)
193
198
  _condition_1 = React.createElement("uistroke", _attributes_1)
194
199
  end
195
- local _exp = animating and React.createElement(LoadingStroke, {
196
- animating = animating,
200
+ local _exp = busy and React.createElement(LoadingStroke, {
201
+ animating = busy and not reducedMotion,
202
+ color = spinnerColor,
197
203
  })
198
204
  local _condition_2 = rounded
199
205
  if _condition_2 then
@@ -201,7 +207,7 @@ local function Button(props)
201
207
  setmetatable(_attributes_1, nil)
202
208
  _condition_2 = React.createElement("uicorner", _attributes_1)
203
209
  end
204
- return React.createElement("textbutton", _attributes, _condition_1, _exp, _condition_2, loading and (React.createElement(CircularProgress, {
210
+ return React.createElement(SxHost, _attributes, _condition_1, _exp, _condition_2, loading and (React.createElement(CircularProgress, {
205
211
  size = spinnerPixels(props.size),
206
212
  thickness = 2,
207
213
  color = spinnerColor,
@@ -1,11 +1,13 @@
1
1
  import React from "@rbxts/react";
2
+ import { CustomizedProps } from "../../../../theme/index";
2
3
  import { PaperElevation } from "../../paper/index";
3
4
  export interface CardProps {
4
5
  title?: string;
5
6
  subtitle?: string;
6
7
  elevation?: PaperElevation;
8
+ square?: boolean;
7
9
  actions?: React.ReactNode;
8
10
  children?: React.ReactNode;
9
11
  }
10
- declare function Card(props: CardProps): JSX.Element;
12
+ declare function Card(props: CustomizedProps<Frame, CardProps>): JSX.Element;
11
13
  export default Card;
@@ -11,8 +11,13 @@ local function Card(props)
11
11
  if elevation == nil then
12
12
  elevation = "flat"
13
13
  end
14
+ local square = _binding.square
14
15
  local actions = _binding.actions
15
16
  local children = _binding.children
17
+ local className = _binding.className
18
+ local sx = _binding.sx
19
+ local id = _binding.id
20
+ local ref = _binding.ref
16
21
  local styles = useCardStyles()
17
22
  local _attributes = {
18
23
  key = "Column",
@@ -66,6 +71,11 @@ local function Card(props)
66
71
  end
67
72
  return React.createElement(Paper, {
68
73
  elevation = elevation,
74
+ square = square,
75
+ className = className,
76
+ sx = sx,
77
+ id = id,
78
+ ref = ref,
69
79
  }, React.createElement("frame", _attributes, _exp, _condition, _condition_1, _exp_1, _condition_2))
70
80
  end
71
81
  local default = Card
@@ -1,11 +1,12 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
2
  local TS = _G[script]
3
3
  local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
4
5
  local NumberInput = TS.import(script, script.Parent.Parent.Parent, "numberInput").NumberInput
5
6
  local useCFrameEditorStyles = TS.import(script, script.Parent, "CFrameEditor.styles").default
6
- local _cframeValue = TS.import(script, script.Parent, "cframeValue")
7
- local cframeFields = _cframeValue.cframeFields
8
- local nextCFrameParts = _cframeValue.nextCFrameParts
7
+ local nextCFrameParts = TS.import(script, script.Parent, "cframeValue").nextCFrameParts
8
+ local POSITION = { "X", "Y", "Z" }
9
+ local ORIENTATION = { "RX", "RY", "RZ" }
9
10
  local function CFrameEditor(props)
10
11
  local _binding = props
11
12
  local value = _binding.value
@@ -25,63 +26,84 @@ local function CFrameEditor(props)
25
26
  local _arg0 = CFrame.Angles(math.rad(parts[4]), math.rad(parts[5]), math.rad(parts[6]))
26
27
  onChange(_cFrame * _arg0)
27
28
  end
28
- local _attributes = {}
29
- local _condition = id
30
- if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
31
- _condition = "CFrameEditor"
32
- end
33
- _attributes.key = _condition
34
- _attributes.ref = ref
35
- for _k, _v in styles.root do
36
- _attributes[_k] = _v
37
- end
38
- if className then
39
- for _k, _v in className do
40
- _attributes[_k] = _v
41
- end
42
- end
43
- if sx then
44
- for _k, _v in sx do
29
+ local group = function(title, fields, order, offset)
30
+ local _attributes = {
31
+ key = title,
32
+ }
33
+ for _k, _v in styles.group do
45
34
  _attributes[_k] = _v
46
35
  end
47
- end
48
- local _attributes_1 = table.clone(styles.wrap)
49
- setmetatable(_attributes_1, nil)
50
- local _exp = React.createElement("uilistlayout", _attributes_1)
51
- local _exp_1 = cframeFields()
52
- -- ▼ ReadonlyArray.map ▼
53
- local _newValue = table.create(#_exp_1)
54
- local _callback = function(field, index)
55
- local _attributes_2 = {
56
- key = field,
36
+ _attributes.LayoutOrder = order
37
+ local _attributes_1 = table.clone(styles.wrap)
38
+ setmetatable(_attributes_1, nil)
39
+ local _exp = React.createElement("uilistlayout", _attributes_1)
40
+ local _attributes_2 = table.clone(styles.groupLabel)
41
+ setmetatable(_attributes_2, nil)
42
+ _attributes_2.Text = title
43
+ _attributes_2.LayoutOrder = 1
44
+ local _exp_1 = React.createElement("textlabel", _attributes_2)
45
+ local _attributes_3 = {
46
+ key = "Axes",
57
47
  }
58
- for _k, _v in styles.axis do
59
- _attributes_2[_k] = _v
48
+ for _k, _v in styles.axes do
49
+ _attributes_3[_k] = _v
60
50
  end
61
- _attributes_2.LayoutOrder = index + 1
62
- local _attributes_3 = table.clone(styles.row)
63
- setmetatable(_attributes_3, nil)
64
- local _exp_2 = React.createElement("uilistlayout", _attributes_3)
65
- local _attributes_4 = table.clone(styles.label)
51
+ _attributes_3.LayoutOrder = 2
52
+ local _attributes_4 = table.clone(styles.row)
66
53
  setmetatable(_attributes_4, nil)
67
- _attributes_4.Text = field
68
- local _exp_3 = React.createElement("textlabel", _attributes_4)
69
- local _attributes_5 = table.clone(styles.field)
70
- setmetatable(_attributes_5, nil)
71
- return React.createElement("frame", _attributes_2, _exp_2, _exp_3, React.createElement("frame", _attributes_5, React.createElement(NumberInput, {
72
- value = amounts[index + 1],
73
- disabled = disabled,
74
- width = UDim.new(1, 0),
75
- onChange = function(amount)
76
- return commit(field, amount)
77
- end,
78
- })))
54
+ local _exp_2 = React.createElement("uilistlayout", _attributes_4)
55
+ -- ▼ ReadonlyArray.map ▼
56
+ local _newValue = table.create(#fields)
57
+ local _callback = function(field, index)
58
+ local _attributes_5 = {
59
+ key = field,
60
+ }
61
+ for _k, _v in styles.axis do
62
+ _attributes_5[_k] = _v
63
+ end
64
+ _attributes_5.LayoutOrder = index + 1
65
+ local _attributes_6 = table.clone(styles.row)
66
+ setmetatable(_attributes_6, nil)
67
+ local _exp_3 = React.createElement("uilistlayout", _attributes_6)
68
+ local _attributes_7 = table.clone(styles.label)
69
+ setmetatable(_attributes_7, nil)
70
+ _attributes_7.Text = field
71
+ local _exp_4 = React.createElement("textlabel", _attributes_7)
72
+ local _attributes_8 = table.clone(styles.field)
73
+ setmetatable(_attributes_8, nil)
74
+ return React.createElement("frame", _attributes_5, _exp_3, _exp_4, React.createElement("frame", _attributes_8, React.createElement(NumberInput, {
75
+ value = amounts[offset + index + 1],
76
+ disabled = disabled,
77
+ width = UDim.new(1, 0),
78
+ onChange = function(amount)
79
+ return commit(field, amount)
80
+ end,
81
+ })))
82
+ end
83
+ for _k, _v in fields do
84
+ _newValue[_k] = _callback(_v, _k - 1, fields)
85
+ end
86
+ -- ▲ ReadonlyArray.map ▲
87
+ return React.createElement("frame", _attributes, _exp, _exp_1, React.createElement("frame", _attributes_3, _exp_2, React.createElement(React.Fragment, nil, _newValue)))
79
88
  end
80
- for _k, _v in _exp_1 do
81
- _newValue[_k] = _callback(_v, _k - 1, _exp_1)
89
+ local _attributes = {
90
+ tag = "frame",
91
+ }
92
+ local _condition = id
93
+ if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
94
+ _condition = "CFrameEditor"
82
95
  end
83
- -- ▲ ReadonlyArray.map ▲
84
- return React.createElement("frame", _attributes, _exp, _newValue)
96
+ _attributes.key = _condition
97
+ _attributes.hostRef = ref
98
+ _attributes.base = styles.root
99
+ _attributes.className = className
100
+ _attributes.sx = sx
101
+ _attributes.state = {
102
+ disabled = disabled,
103
+ }
104
+ local _attributes_1 = table.clone(styles.wrap)
105
+ setmetatable(_attributes_1, nil)
106
+ return React.createElement(SxHost, _attributes, React.createElement("uilistlayout", _attributes_1), group("Position", POSITION, 1, 0), group("Orientation", ORIENTATION, 2, 3))
85
107
  end
86
108
  local default = CFrameEditor
87
109
  return {
@@ -11,31 +11,48 @@ local useCFrameEditorStyles = componentStyles("CFrameEditor", function(theme)
11
11
  BackgroundTransparency = 1,
12
12
  BorderSizePixel = 0,
13
13
  },
14
+ wrap = {
15
+ FillDirection = Enum.FillDirection.Vertical,
16
+ Padding = UDim.new(0, theme.padding.calc(0.5)),
17
+ SortOrder = Enum.SortOrder.LayoutOrder,
18
+ },
14
19
  row = {
15
20
  FillDirection = Enum.FillDirection.Horizontal,
16
- Padding = UDim.new(0, theme.padding.calc(1)),
21
+ Padding = UDim.new(0, theme.padding.calc(0.5)),
17
22
  VerticalAlignment = Enum.VerticalAlignment.Center,
18
23
  SortOrder = Enum.SortOrder.LayoutOrder,
19
24
  },
20
- wrap = {
21
- FillDirection = Enum.FillDirection.Vertical,
22
- Padding = UDim.new(0, theme.padding.calc(0.5)),
23
- SortOrder = Enum.SortOrder.LayoutOrder,
25
+ group = {
26
+ Size = UDim2.new(1, 0, 0, 0),
27
+ AutomaticSize = Enum.AutomaticSize.Y,
28
+ BackgroundTransparency = 1,
24
29
  },
25
- axis = {
30
+ groupLabel = {
26
31
  Size = UDim2.new(1, 0, 0, theme.spacing.calc(2)),
27
32
  BackgroundTransparency = 1,
33
+ Font = theme.typography.fontFamilies.default,
34
+ TextSize = theme.typography.fontSizes.button,
35
+ TextColor3 = theme.palette.text.secondary,
36
+ TextXAlignment = Enum.TextXAlignment.Left,
37
+ },
38
+ axes = {
39
+ Size = UDim2.new(1, 0, 0, theme.spacing.calc(3)),
40
+ BackgroundTransparency = 1,
41
+ },
42
+ axis = {
43
+ Size = UDim2.new(1 / 3, -theme.padding.calc(0.5), 1, 0),
44
+ BackgroundTransparency = 1,
28
45
  },
29
46
  label = {
30
- Size = UDim2.new(0, theme.spacing.calc(2), 1, 0),
47
+ Size = UDim2.new(0, theme.spacing.calc(2.5), 1, 0),
31
48
  BackgroundTransparency = 1,
32
49
  Font = theme.typography.fontFamilies.default,
33
- TextSize = theme.typography.fontSizes.caption,
50
+ TextSize = theme.typography.fontSizes.button,
34
51
  TextColor3 = theme.palette.text.secondary,
35
52
  TextXAlignment = Enum.TextXAlignment.Left,
36
53
  },
37
54
  field = {
38
- Size = UDim2.new(1, -theme.spacing.calc(2), 1, 0),
55
+ Size = UDim2.new(1, -theme.spacing.calc(2.5), 1, 0),
39
56
  BackgroundTransparency = 1,
40
57
  },
41
58
  })
@@ -5,6 +5,7 @@ local React = _react
5
5
  local useState = _react.useState
6
6
  local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
7
7
  local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
8
+ local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
8
9
  local useCheckboxStyles = TS.import(script, script.Parent, "Checkbox.styles").default
9
10
  local _checkboxLook = TS.import(script, script.Parent, "checkboxLook")
10
11
  local checkboxBoxTransparency = _checkboxLook.checkboxBoxTransparency
@@ -45,26 +46,25 @@ local function Checkbox(props)
45
46
  local pointer = if active then checkboxPointer(hovering, pressed, focused) else "rest"
46
47
  local boxTransparency = checkboxBoxTransparency(filled, disabled == true, pointer)
47
48
  local strokeTransparency = checkboxStrokeTransparency(filled, disabled == true, pointer)
48
- local _attributes = {}
49
+ local _attributes = {
50
+ tag = "textbutton",
51
+ }
49
52
  local _condition = id
50
53
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
51
54
  _condition = "Checkbox"
52
55
  end
53
56
  _attributes.key = _condition
54
- _attributes.ref = ref
55
- for _k, _v in root do
56
- _attributes[_k] = _v
57
- end
58
- if className then
59
- for _k, _v in className do
60
- _attributes[_k] = _v
61
- end
62
- end
63
- if sx then
64
- for _k, _v in sx do
65
- _attributes[_k] = _v
66
- end
67
- end
57
+ _attributes.hostRef = ref
58
+ _attributes.base = root
59
+ _attributes.className = className
60
+ _attributes.sx = sx
61
+ _attributes.state = {
62
+ disabled = disabled,
63
+ checked = filled,
64
+ hover = hovering,
65
+ pressed = pressed,
66
+ focused = focused,
67
+ }
68
68
  _attributes.Active = active
69
69
  _attributes.Selectable = not disabled
70
70
  _attributes.BackgroundTransparency = if focused and active then 0.85 else 1
@@ -128,7 +128,7 @@ local function Checkbox(props)
128
128
  _attributes_6.LayoutOrder = 2
129
129
  _condition_1 = (React.createElement("textlabel", _attributes_6))
130
130
  end
131
- return React.createElement("textbutton", _attributes, _exp, _exp_3, _condition_1)
131
+ return React.createElement(SxHost, _attributes, _exp, _exp_3, _condition_1)
132
132
  end
133
133
  local default = Checkbox
134
134
  return {
@@ -2,4 +2,4 @@ export type CheckboxPointer = "rest" | "hover" | "press" | "focus";
2
2
  export declare function checkboxMark(value: boolean, mixed?: boolean): "" | "–" | "✓";
3
3
  export declare function checkboxPointer(hovering: boolean, pressed: boolean, focused: boolean): CheckboxPointer;
4
4
  export declare function checkboxBoxTransparency(filled: boolean, disabled: boolean, pointer: CheckboxPointer): 1 | 0 | 0.7 | 0.55 | 0.85;
5
- export declare function checkboxStrokeTransparency(filled: boolean, disabled: boolean, pointer: CheckboxPointer): 0 | 0.25 | 0.55 | 0.45 | 0.2;
5
+ export declare function checkboxStrokeTransparency(filled: boolean, disabled: boolean, pointer: CheckboxPointer): 0 | 0.25 | 0.45 | 0.55 | 0.2;
@@ -1,9 +1,14 @@
1
- import { CustomizedProps } from "../../../../theme/index";
1
+ import { ControlSize, CustomizedProps } from "../../../../theme/index";
2
+ import { ChipColor } from "./Chip.styles";
2
3
  export interface ChipProps {
3
4
  label: string;
4
5
  selected?: boolean;
5
6
  disabled?: boolean;
7
+ size?: ControlSize;
8
+ variant?: "filled" | "outlined";
9
+ color?: ChipColor;
6
10
  onActivated?: () => void;
11
+ onDelete?: () => void;
7
12
  }
8
13
  declare function Chip(props: CustomizedProps<TextButton, ChipProps>): JSX.Element;
9
14
  export default Chip;
@@ -1,42 +1,55 @@
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 Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
5
+ local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
4
6
  local useChipStyles = TS.import(script, script.Parent, "Chip.styles").default
5
7
  local function Chip(props)
6
8
  local _binding = props
7
9
  local label = _binding.label
8
10
  local selected = _binding.selected
9
11
  local disabled = _binding.disabled
12
+ local size = _binding.size
13
+ local variant = _binding.variant
14
+ if variant == nil then
15
+ variant = "filled"
16
+ end
17
+ local color = _binding.color
18
+ if color == nil then
19
+ color = "default"
20
+ end
10
21
  local onActivated = _binding.onActivated
22
+ local onDelete = _binding.onDelete
11
23
  local className = _binding.className
12
24
  local sx = _binding.sx
13
25
  local id = _binding.id
14
26
  local ref = _binding.ref
27
+ local deletable = onDelete ~= nil
15
28
  local styles = useChipStyles({
16
29
  selected = selected,
17
30
  disabled = disabled,
31
+ deletable = deletable,
32
+ size = size,
33
+ variant = variant,
34
+ color = color,
18
35
  })
19
- local _attributes = {}
36
+ local _attributes = {
37
+ tag = "textbutton",
38
+ }
20
39
  local _condition = id
21
40
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
22
41
  _condition = "Chip"
23
42
  end
24
43
  _attributes.key = _condition
25
- _attributes.ref = ref
26
- for _k, _v in styles.root do
27
- _attributes[_k] = _v
28
- end
29
- if className then
30
- for _k, _v in className do
31
- _attributes[_k] = _v
32
- end
33
- end
34
- if sx then
35
- for _k, _v in sx do
36
- _attributes[_k] = _v
37
- end
38
- end
39
- _attributes.Text = label
44
+ _attributes.hostRef = ref
45
+ _attributes.base = styles.root
46
+ _attributes.className = className
47
+ _attributes.sx = sx
48
+ _attributes.state = {
49
+ disabled = disabled,
50
+ selected = selected,
51
+ }
52
+ _attributes.Text = if deletable then "" else label
40
53
  _attributes.Event = {
41
54
  Activated = function()
42
55
  if disabled ~= true then
@@ -55,7 +68,38 @@ local function Chip(props)
55
68
  local _exp_1 = React.createElement("uicorner", _attributes_2)
56
69
  local _attributes_3 = table.clone(styles.stroke)
57
70
  setmetatable(_attributes_3, nil)
58
- return React.createElement("textbutton", _attributes, _exp, _exp_1, React.createElement("uistroke", _attributes_3))
71
+ local _exp_2 = React.createElement("uistroke", _attributes_3)
72
+ local _condition_1 = deletable
73
+ if _condition_1 then
74
+ local _attributes_4 = table.clone(styles.row)
75
+ setmetatable(_attributes_4, nil)
76
+ local _exp_3 = React.createElement("uilistlayout", _attributes_4)
77
+ local _attributes_5 = {
78
+ key = "Label",
79
+ }
80
+ for _k, _v in styles.label do
81
+ _attributes_5[_k] = _v
82
+ end
83
+ _attributes_5.Text = label
84
+ local _exp_4 = React.createElement("textlabel", _attributes_5)
85
+ local _attributes_6 = {
86
+ key = "Delete",
87
+ }
88
+ for _k, _v in styles.delete do
89
+ _attributes_6[_k] = _v
90
+ end
91
+ _attributes_6.Image = tostring(Icons.Close)
92
+ _attributes_6.Active = disabled ~= true
93
+ _attributes_6.Event = {
94
+ Activated = function()
95
+ if disabled ~= true then
96
+ onDelete()
97
+ end
98
+ end,
99
+ }
100
+ _condition_1 = (React.createElement(React.Fragment, nil, _exp_3, _exp_4, React.createElement("imagebutton", _attributes_6)))
101
+ end
102
+ return React.createElement(SxHost, _attributes, _exp, _exp_1, _exp_2, _condition_1)
59
103
  end
60
104
  local default = Chip
61
105
  return {
@@ -1,5 +1,11 @@
1
+ import { ControlSize } from "../../../../theme/index";
2
+ export type ChipColor = "default" | "primary";
1
3
  declare const useChipStyles: (props: {
2
4
  selected?: boolean;
3
5
  disabled?: boolean;
6
+ deletable?: boolean;
7
+ size?: ControlSize;
8
+ variant?: "filled" | "outlined";
9
+ color?: ChipColor;
4
10
  }) => import("../../../../theme/index").ClassNameMap<string>;
5
11
  export default useChipStyles;