@rbxts/uiblox 0.2.0-alpha.2 → 0.2.0-alpha.20

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 (234) hide show
  1. package/README.md +2 -0
  2. package/out/theme/constants/NumberConstants.d.ts +2 -0
  3. package/out/theme/constants/NumberConstants.luau +3 -0
  4. package/out/theme/interfaces/spacing/Shape.d.ts +3 -0
  5. package/out/theme/interfaces/typography/FontSizes.d.ts +1 -1
  6. package/out/theme/interfaces/typography/FontSizes.luau +15 -8
  7. package/out/theme/interfaces/typography/ThemeTypography.d.ts +3 -0
  8. package/out/theme/interfaces/typography/Variants.d.ts +14 -15
  9. package/out/theme/interfaces/typography/Variants.luau +68 -18
  10. package/out/theme/themes/DarkTheme.luau +4 -0
  11. package/out/theme/themes/LightTheme.luau +4 -0
  12. package/out/ui/packages/accordion/components/Accordion.d.ts +2 -0
  13. package/out/ui/packages/accordion/components/Accordion.luau +36 -16
  14. package/out/ui/packages/accordion/components/Accordion.styles.d.ts +1 -0
  15. package/out/ui/packages/accordion/components/Accordion.styles.luau +16 -4
  16. package/out/ui/packages/accordion/components/accordionOpen.d.ts +1 -0
  17. package/out/ui/packages/accordion/components/accordionOpen.luau +4 -0
  18. package/out/ui/packages/alert/components/Alert.d.ts +2 -0
  19. package/out/ui/packages/alert/components/Alert.luau +40 -27
  20. package/out/ui/packages/alert/components/Alert.styles.d.ts +2 -0
  21. package/out/ui/packages/alert/components/Alert.styles.luau +17 -8
  22. package/out/ui/packages/appBar/components/AppBar.d.ts +2 -1
  23. package/out/ui/packages/appBar/components/AppBar.luau +5 -0
  24. package/out/ui/packages/appBar/components/AppBar.styles.d.ts +2 -0
  25. package/out/ui/packages/appBar/components/AppBar.styles.luau +6 -2
  26. package/out/ui/packages/autocomplete/components/Autocomplete.luau +8 -0
  27. package/out/ui/packages/avatar/components/Avatar.d.ts +2 -0
  28. package/out/ui/packages/avatar/components/Avatar.luau +20 -12
  29. package/out/ui/packages/avatar/components/Avatar.styles.d.ts +2 -0
  30. package/out/ui/packages/avatar/components/Avatar.styles.luau +5 -1
  31. package/out/ui/packages/backdrop/components/Backdrop.d.ts +10 -0
  32. package/out/ui/packages/backdrop/components/Backdrop.luau +58 -0
  33. package/out/ui/packages/backdrop/components/Backdrop.styles.d.ts +4 -0
  34. package/out/ui/packages/backdrop/components/Backdrop.styles.luau +24 -0
  35. package/out/ui/packages/backdrop/index.d.ts +2 -0
  36. package/out/ui/packages/backdrop/init.luau +5 -0
  37. package/out/ui/packages/badge/components/Badge.d.ts +3 -0
  38. package/out/ui/packages/badge/components/Badge.luau +23 -8
  39. package/out/ui/packages/badge/components/Badge.styles.d.ts +5 -1
  40. package/out/ui/packages/badge/components/Badge.styles.luau +20 -8
  41. package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +1 -0
  42. package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +8 -2
  43. package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.d.ts +3 -1
  44. package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +6 -2
  45. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +1 -0
  46. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +58 -24
  47. package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +9 -0
  48. package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +68 -0
  49. package/out/ui/packages/breadcrumbs/index.d.ts +1 -0
  50. package/out/ui/packages/breadcrumbs/init.luau +3 -0
  51. package/out/ui/packages/brickColorPicker/components/brickColorCatalog.luau +1 -1
  52. package/out/ui/packages/button/components/Button.luau +9 -5
  53. package/out/ui/packages/card/components/Card.d.ts +1 -0
  54. package/out/ui/packages/card/components/Card.luau +2 -0
  55. package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
  56. package/out/ui/packages/chip/components/Chip.d.ts +6 -1
  57. package/out/ui/packages/chip/components/Chip.luau +49 -2
  58. package/out/ui/packages/chip/components/Chip.styles.d.ts +6 -0
  59. package/out/ui/packages/chip/components/Chip.styles.luau +55 -10
  60. package/out/ui/packages/circularProgress/components/CircularProgress.luau +13 -2
  61. package/out/ui/packages/dialog/components/Dialog.d.ts +1 -1
  62. package/out/ui/packages/dialog/components/Dialog.luau +27 -18
  63. package/out/ui/packages/divider/components/Divider.d.ts +1 -0
  64. package/out/ui/packages/divider/components/Divider.luau +48 -0
  65. package/out/ui/packages/divider/components/Divider.styles.luau +29 -0
  66. package/out/ui/packages/divider/components/dividerLabel.d.ts +1 -0
  67. package/out/ui/packages/divider/components/dividerLabel.luau +10 -0
  68. package/out/ui/packages/drawer/components/Drawer.d.ts +1 -0
  69. package/out/ui/packages/drawer/components/Drawer.luau +4 -1
  70. package/out/ui/packages/drawer/components/Drawer.styles.d.ts +3 -1
  71. package/out/ui/packages/drawer/components/Drawer.styles.luau +3 -2
  72. package/out/ui/packages/fab/components/Fab.d.ts +3 -0
  73. package/out/ui/packages/fab/components/Fab.luau +62 -25
  74. package/out/ui/packages/fab/components/Fab.styles.d.ts +3 -0
  75. package/out/ui/packages/fab/components/Fab.styles.luau +33 -3
  76. package/out/ui/packages/fab/components/fabSize.d.ts +1 -0
  77. package/out/ui/packages/fab/components/fabSize.luau +4 -0
  78. package/out/ui/packages/fab/index.d.ts +1 -1
  79. package/out/ui/packages/fab/init.luau +1 -0
  80. package/out/ui/packages/formText/components/FormHelperText.d.ts +8 -0
  81. package/out/ui/packages/formText/components/FormHelperText.luau +44 -0
  82. package/out/ui/packages/formText/components/FormLabel.d.ts +9 -0
  83. package/out/ui/packages/formText/components/FormLabel.luau +46 -0
  84. package/out/ui/packages/formText/components/FormText.styles.d.ts +5 -0
  85. package/out/ui/packages/formText/components/FormText.styles.luau +33 -0
  86. package/out/ui/packages/formText/index.d.ts +4 -0
  87. package/out/ui/packages/formText/init.luau +6 -0
  88. package/out/ui/packages/iconButton/components/IconButton.luau +7 -2
  89. package/out/ui/packages/iconButton/components/IconButton.styles.luau +3 -0
  90. package/out/ui/packages/imageList/components/ImageList.d.ts +14 -0
  91. package/out/ui/packages/imageList/components/ImageList.luau +100 -0
  92. package/out/ui/packages/imageList/components/ImageList.styles.d.ts +6 -0
  93. package/out/ui/packages/imageList/components/ImageList.styles.luau +73 -0
  94. package/out/ui/packages/imageList/components/imageListLayout.d.ts +4 -0
  95. package/out/ui/packages/imageList/components/imageListLayout.luau +31 -0
  96. package/out/ui/packages/imageList/index.d.ts +2 -0
  97. package/out/ui/packages/imageList/init.luau +5 -0
  98. package/out/ui/packages/index.d.ts +7 -0
  99. package/out/ui/packages/init.luau +21 -0
  100. package/out/ui/packages/input/components/Input.d.ts +1 -0
  101. package/out/ui/packages/input/components/Input.luau +8 -3
  102. package/out/ui/packages/layout/components/Box.d.ts +11 -0
  103. package/out/ui/packages/layout/components/Box.luau +49 -0
  104. package/out/ui/packages/layout/components/Box.styles.d.ts +7 -0
  105. package/out/ui/packages/layout/components/Box.styles.luau +34 -0
  106. package/out/ui/packages/layout/components/Container.d.ts +10 -0
  107. package/out/ui/packages/layout/components/Container.luau +54 -0
  108. package/out/ui/packages/layout/components/Container.styles.d.ts +6 -0
  109. package/out/ui/packages/layout/components/Container.styles.luau +41 -0
  110. package/out/ui/packages/layout/components/Grid.d.ts +1 -1
  111. package/out/ui/packages/layout/components/Stack.d.ts +12 -0
  112. package/out/ui/packages/layout/components/Stack.luau +49 -0
  113. package/out/ui/packages/layout/components/Stack.styles.d.ts +8 -0
  114. package/out/ui/packages/layout/components/Stack.styles.luau +72 -0
  115. package/out/ui/packages/layout/components/boxPad.d.ts +14 -0
  116. package/out/ui/packages/layout/components/boxPad.luau +59 -0
  117. package/out/ui/packages/layout/components/containerWidth.d.ts +2 -0
  118. package/out/ui/packages/layout/components/containerWidth.luau +17 -0
  119. package/out/ui/packages/layout/components/stackAlign.d.ts +8 -0
  120. package/out/ui/packages/layout/components/stackAlign.luau +29 -0
  121. package/out/ui/packages/layout/index.d.ts +10 -0
  122. package/out/ui/packages/layout/init.luau +4 -0
  123. package/out/ui/packages/link/components/Link.d.ts +11 -0
  124. package/out/ui/packages/link/components/Link.luau +83 -0
  125. package/out/ui/packages/link/components/Link.styles.d.ts +8 -0
  126. package/out/ui/packages/link/components/Link.styles.luau +59 -0
  127. package/out/ui/packages/link/index.d.ts +3 -0
  128. package/out/ui/packages/link/init.luau +5 -0
  129. package/out/ui/packages/listItem/components/ListItem.d.ts +2 -0
  130. package/out/ui/packages/listItem/components/ListItem.luau +22 -1
  131. package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
  132. package/out/ui/packages/listItem/components/ListItem.styles.luau +16 -5
  133. package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +2 -0
  134. package/out/ui/packages/loadingStroke/components/LoadingStroke.luau +23 -19
  135. package/out/ui/packages/menu/components/Menu.d.ts +5 -0
  136. package/out/ui/packages/menu/components/Menu.luau +54 -23
  137. package/out/ui/packages/menu/components/Menu.styles.luau +5 -1
  138. package/out/ui/packages/modal/components/Modal.d.ts +1 -1
  139. package/out/ui/packages/modal/components/Modal.luau +55 -37
  140. package/out/ui/packages/motion/index.d.ts +1 -1
  141. package/out/ui/packages/motion/init.luau +1 -0
  142. package/out/ui/packages/motion/unit.d.ts +5 -0
  143. package/out/ui/packages/motion/unit.luau +23 -0
  144. package/out/ui/packages/numberInput/components/NumberInput.d.ts +1 -0
  145. package/out/ui/packages/numberInput/components/NumberInput.luau +2 -0
  146. package/out/ui/packages/pagination/components/Pagination.d.ts +4 -1
  147. package/out/ui/packages/pagination/components/Pagination.luau +41 -22
  148. package/out/ui/packages/pagination/components/Pagination.styles.d.ts +4 -1
  149. package/out/ui/packages/pagination/components/Pagination.styles.luau +19 -4
  150. package/out/ui/packages/pagination/components/pageRange.d.ts +2 -1
  151. package/out/ui/packages/pagination/components/pageRange.luau +91 -8
  152. package/out/ui/packages/pagination/index.d.ts +1 -0
  153. package/out/ui/packages/pagination/init.luau +1 -0
  154. package/out/ui/packages/paper/components/Paper.d.ts +2 -1
  155. package/out/ui/packages/paper/components/Paper.luau +14 -3
  156. package/out/ui/packages/paper/components/Paper.styles.d.ts +1 -1
  157. package/out/ui/packages/paper/components/Paper.styles.luau +6 -0
  158. package/out/ui/packages/popup/index.d.ts +1 -0
  159. package/out/ui/packages/popup/init.luau +1 -0
  160. package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +1 -0
  161. package/out/ui/packages/radioGroup/components/RadioGroup.luau +4 -2
  162. package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +1 -0
  163. package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +4 -1
  164. package/out/ui/packages/rating/components/Rating.d.ts +11 -0
  165. package/out/ui/packages/rating/components/Rating.luau +101 -0
  166. package/out/ui/packages/rating/components/Rating.styles.d.ts +6 -0
  167. package/out/ui/packages/rating/components/Rating.styles.luau +44 -0
  168. package/out/ui/packages/rating/index.d.ts +2 -0
  169. package/out/ui/packages/rating/init.luau +5 -0
  170. package/out/ui/packages/select/components/Select.d.ts +5 -0
  171. package/out/ui/packages/select/components/Select.luau +48 -24
  172. package/out/ui/packages/select/components/Select.styles.luau +1 -1
  173. package/out/ui/packages/skeleton/components/Skeleton.luau +3 -2
  174. package/out/ui/packages/skeleton/components/Skeleton.styles.luau +7 -2
  175. package/out/ui/packages/skeleton/components/skeletonMotion.luau +1 -1
  176. package/out/ui/packages/skeleton/components/skeletonTone.d.ts +20 -0
  177. package/out/ui/packages/skeleton/components/skeletonTone.luau +14 -0
  178. package/out/ui/packages/slider/components/Slider.d.ts +3 -0
  179. package/out/ui/packages/slider/components/Slider.luau +32 -3
  180. package/out/ui/packages/slider/components/Slider.styles.d.ts +2 -0
  181. package/out/ui/packages/slider/components/Slider.styles.luau +14 -1
  182. package/out/ui/packages/slider/components/sliderMarks.d.ts +1 -0
  183. package/out/ui/packages/slider/components/sliderMarks.luau +37 -0
  184. package/out/ui/packages/snackbar/components/Snackbar.d.ts +2 -0
  185. package/out/ui/packages/snackbar/components/Snackbar.luau +5 -0
  186. package/out/ui/packages/snackbar/components/snackbarAction.d.ts +1 -0
  187. package/out/ui/packages/snackbar/components/snackbarAction.luau +10 -0
  188. package/out/ui/packages/speedDial/components/SpeedDial.d.ts +19 -0
  189. package/out/ui/packages/speedDial/components/SpeedDial.luau +101 -0
  190. package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +5 -0
  191. package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +31 -0
  192. package/out/ui/packages/speedDial/index.d.ts +3 -0
  193. package/out/ui/packages/speedDial/init.luau +5 -0
  194. package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
  195. package/out/ui/packages/stateMatrix.d.ts +2 -0
  196. package/out/ui/packages/stateMatrix.luau +809 -252
  197. package/out/ui/packages/stepper/components/Stepper.d.ts +1 -0
  198. package/out/ui/packages/stepper/components/Stepper.luau +7 -1
  199. package/out/ui/packages/stepper/components/Stepper.styles.d.ts +3 -1
  200. package/out/ui/packages/stepper/components/Stepper.styles.luau +6 -2
  201. package/out/ui/packages/switch/components/Switch.d.ts +2 -0
  202. package/out/ui/packages/switch/components/Switch.luau +5 -0
  203. package/out/ui/packages/switch/components/Switch.styles.d.ts +2 -0
  204. package/out/ui/packages/switch/components/Switch.styles.luau +7 -2
  205. package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
  206. package/out/ui/packages/table/components/Table.d.ts +1 -0
  207. package/out/ui/packages/table/components/Table.luau +4 -1
  208. package/out/ui/packages/table/components/Table.styles.d.ts +3 -1
  209. package/out/ui/packages/table/components/Table.styles.luau +10 -6
  210. package/out/ui/packages/tabs/components/Tabs.d.ts +3 -0
  211. package/out/ui/packages/tabs/components/Tabs.luau +12 -3
  212. package/out/ui/packages/tabs/components/Tabs.styles.d.ts +5 -1
  213. package/out/ui/packages/tabs/components/Tabs.styles.luau +26 -10
  214. package/out/ui/packages/tabs/components/tabsOrientation.d.ts +2 -0
  215. package/out/ui/packages/tabs/components/tabsOrientation.luau +7 -0
  216. package/out/ui/packages/tabs/index.d.ts +1 -0
  217. package/out/ui/packages/tabs/init.luau +1 -0
  218. package/out/ui/packages/toast/components/Toast.d.ts +2 -0
  219. package/out/ui/packages/toast/components/Toast.luau +26 -1
  220. package/out/ui/packages/toast/components/Toast.styles.luau +22 -4
  221. package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +19 -0
  222. package/out/ui/packages/toggleButton/components/ToggleButton.luau +135 -0
  223. package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +7 -0
  224. package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +65 -0
  225. package/out/ui/packages/toggleButton/index.d.ts +2 -0
  226. package/out/ui/packages/toggleButton/init.luau +7 -0
  227. package/out/ui/packages/typography/components/Typography.styles.luau +4 -5
  228. package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +6 -0
  229. package/out/ui/packages/virtualList/components/EmptyListHint.luau +32 -0
  230. package/out/ui/packages/virtualList/components/EmptyListHint.styles.d.ts +5 -0
  231. package/out/ui/packages/virtualList/components/EmptyListHint.styles.luau +26 -0
  232. package/out/ui/packages/virtualList/index.d.ts +2 -0
  233. package/out/ui/packages/virtualList/init.luau +1 -0
  234. package/package.json +2 -2
@@ -2,6 +2,74 @@
2
2
  local function breadcrumbCurrent(index, count)
3
3
  return count > 0 and index == count - 1
4
4
  end
5
+ --* Collapse middle items when over maxItems (keep ends).
6
+ local function breadcrumbVisible(items, maxItems)
7
+ local count = #items
8
+ if maxItems == nil or maxItems < 1 or count <= maxItems then
9
+ local out = {}
10
+ do
11
+ local i = 0
12
+ local _shouldIncrement = false
13
+ while true do
14
+ if _shouldIncrement then
15
+ i += 1
16
+ else
17
+ _shouldIncrement = true
18
+ end
19
+ if not (i < count) then
20
+ break
21
+ end
22
+ local _arg0 = {
23
+ label = items[i + 1].label,
24
+ index = i,
25
+ }
26
+ table.insert(out, _arg0)
27
+ end
28
+ end
29
+ return out
30
+ end
31
+ if maxItems == 1 then
32
+ return { {
33
+ label = items[count].label,
34
+ index = count - 1,
35
+ } }
36
+ end
37
+ local keepEnd = 1
38
+ local rawStart = maxItems - keepEnd - 1
39
+ local keepStart = if rawStart < 1 then 1 else rawStart
40
+ local out = {}
41
+ do
42
+ local i = 0
43
+ local _shouldIncrement = false
44
+ while true do
45
+ if _shouldIncrement then
46
+ i += 1
47
+ else
48
+ _shouldIncrement = true
49
+ end
50
+ if not (i < keepStart) then
51
+ break
52
+ end
53
+ local _arg0 = {
54
+ label = items[i + 1].label,
55
+ index = i,
56
+ }
57
+ table.insert(out, _arg0)
58
+ end
59
+ end
60
+ table.insert(out, {
61
+ label = "…",
62
+ index = -1,
63
+ ellipsis = true,
64
+ })
65
+ local _arg0 = {
66
+ label = items[count].label,
67
+ index = count - 1,
68
+ }
69
+ table.insert(out, _arg0)
70
+ return out
71
+ end
5
72
  return {
6
73
  breadcrumbCurrent = breadcrumbCurrent,
74
+ breadcrumbVisible = breadcrumbVisible,
7
75
  }
@@ -1,2 +1,3 @@
1
1
  export { default as Breadcrumbs } from "./components/Breadcrumbs";
2
2
  export { BreadcrumbItem, BreadcrumbsProps } from "./components/Breadcrumbs";
3
+ export { breadcrumbCurrent, breadcrumbVisible } from "./components/breadcrumbItems";
@@ -2,4 +2,7 @@
2
2
  local TS = _G[script]
3
3
  local exports = {}
4
4
  exports.Breadcrumbs = TS.import(script, script, "components", "Breadcrumbs").default
5
+ local _breadcrumbItems = TS.import(script, script, "components", "breadcrumbItems")
6
+ exports.breadcrumbCurrent = _breadcrumbItems.breadcrumbCurrent
7
+ exports.breadcrumbVisible = _breadcrumbItems.breadcrumbVisible
5
8
  return exports
@@ -5,7 +5,7 @@ local function brickColorCatalog()
5
5
  return cached
6
6
  end
7
7
  local colors = {}
8
- for i = 1, 128 do
8
+ for i = 1, 127 do
9
9
  local color = BrickColor.palette(i)
10
10
  local seen = false
11
11
  for _, existing in colors do
@@ -4,6 +4,7 @@ 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
8
9
  local CircularProgress = TS.import(script, script.Parent.Parent.Parent, "circularProgress").CircularProgress
9
10
  local LoadingStroke = TS.import(script, script.Parent.Parent.Parent, "loadingStroke").LoadingStroke
@@ -36,10 +37,10 @@ local function Button(props)
36
37
  if loadingPosition == nil then
37
38
  loadingPosition = "center"
38
39
  end
39
- local reducedMotion = _binding.reducedMotion
40
+ local reducedProp = _binding.reducedMotion
40
41
  local rounded = _binding.rounded
41
42
  if rounded == nil then
42
- rounded = false
43
+ rounded = true
43
44
  end
44
45
  local hoveringDisabled = _binding.hoveringDisabled
45
46
  if hoveringDisabled == nil then
@@ -69,12 +70,14 @@ local function Button(props)
69
70
  local stroke = _binding_1.stroke
70
71
  local _binding_2 = useTheme()
71
72
  local theme = _binding_2.theme
73
+ local reducedMotion = useReducedMotion(reducedProp)
72
74
  local hovering, setHovering = useState(false)
73
75
  local focused, setFocused = useState(false)
74
76
  local active = canActivate(disabled, loading)
75
77
  local pressed = disabled or (not hoveringDisabled and active and (hovering or focused))
76
78
  local face = buttonFace(text, loading, loadingLabel)
77
79
  local place = spinnerPlace(loadingPosition)
80
+ local busy = loading or animating
78
81
  local branded = (props.color or "primary") == "primary"
79
82
  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
83
  useEffect(function()
@@ -186,14 +189,15 @@ local function Button(props)
186
189
  end
187
190
  end,
188
191
  }
189
- local _condition_1 = variant == "outlined" and not animating
192
+ local _condition_1 = variant == "outlined" and not busy
190
193
  if _condition_1 then
191
194
  local _attributes_1 = table.clone(stroke)
192
195
  setmetatable(_attributes_1, nil)
193
196
  _condition_1 = React.createElement("uistroke", _attributes_1)
194
197
  end
195
- local _exp = animating and React.createElement(LoadingStroke, {
196
- animating = animating,
198
+ local _exp = busy and React.createElement(LoadingStroke, {
199
+ animating = busy and not reducedMotion,
200
+ color = spinnerColor,
197
201
  })
198
202
  local _condition_2 = rounded
199
203
  if _condition_2 then
@@ -4,6 +4,7 @@ export interface CardProps {
4
4
  title?: string;
5
5
  subtitle?: string;
6
6
  elevation?: PaperElevation;
7
+ square?: boolean;
7
8
  actions?: React.ReactNode;
8
9
  children?: React.ReactNode;
9
10
  }
@@ -11,6 +11,7 @@ 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
16
17
  local styles = useCardStyles()
@@ -66,6 +67,7 @@ local function Card(props)
66
67
  end
67
68
  return React.createElement(Paper, {
68
69
  elevation = elevation,
70
+ square = square,
69
71
  }, React.createElement("frame", _attributes, _exp, _condition, _condition_1, _exp_1, _condition_2))
70
72
  end
71
73
  local default = Card
@@ -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,20 +1,36 @@
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
4
5
  local useChipStyles = TS.import(script, script.Parent, "Chip.styles").default
5
6
  local function Chip(props)
6
7
  local _binding = props
7
8
  local label = _binding.label
8
9
  local selected = _binding.selected
9
10
  local disabled = _binding.disabled
11
+ local size = _binding.size
12
+ local variant = _binding.variant
13
+ if variant == nil then
14
+ variant = "filled"
15
+ end
16
+ local color = _binding.color
17
+ if color == nil then
18
+ color = "default"
19
+ end
10
20
  local onActivated = _binding.onActivated
21
+ local onDelete = _binding.onDelete
11
22
  local className = _binding.className
12
23
  local sx = _binding.sx
13
24
  local id = _binding.id
14
25
  local ref = _binding.ref
26
+ local deletable = onDelete ~= nil
15
27
  local styles = useChipStyles({
16
28
  selected = selected,
17
29
  disabled = disabled,
30
+ deletable = deletable,
31
+ size = size,
32
+ variant = variant,
33
+ color = color,
18
34
  })
19
35
  local _attributes = {}
20
36
  local _condition = id
@@ -36,7 +52,7 @@ local function Chip(props)
36
52
  _attributes[_k] = _v
37
53
  end
38
54
  end
39
- _attributes.Text = label
55
+ _attributes.Text = if deletable then "" else label
40
56
  _attributes.Event = {
41
57
  Activated = function()
42
58
  if disabled ~= true then
@@ -55,7 +71,38 @@ local function Chip(props)
55
71
  local _exp_1 = React.createElement("uicorner", _attributes_2)
56
72
  local _attributes_3 = table.clone(styles.stroke)
57
73
  setmetatable(_attributes_3, nil)
58
- return React.createElement("textbutton", _attributes, _exp, _exp_1, React.createElement("uistroke", _attributes_3))
74
+ local _exp_2 = React.createElement("uistroke", _attributes_3)
75
+ local _condition_1 = deletable
76
+ if _condition_1 then
77
+ local _attributes_4 = table.clone(styles.row)
78
+ setmetatable(_attributes_4, nil)
79
+ local _exp_3 = React.createElement("uilistlayout", _attributes_4)
80
+ local _attributes_5 = {
81
+ key = "Label",
82
+ }
83
+ for _k, _v in styles.label do
84
+ _attributes_5[_k] = _v
85
+ end
86
+ _attributes_5.Text = label
87
+ local _exp_4 = React.createElement("textlabel", _attributes_5)
88
+ local _attributes_6 = {
89
+ key = "Delete",
90
+ }
91
+ for _k, _v in styles.delete do
92
+ _attributes_6[_k] = _v
93
+ end
94
+ _attributes_6.Image = tostring(Icons.Close)
95
+ _attributes_6.Active = disabled ~= true
96
+ _attributes_6.Event = {
97
+ Activated = function()
98
+ if disabled ~= true then
99
+ onDelete()
100
+ end
101
+ end,
102
+ }
103
+ _condition_1 = (React.createElement(React.Fragment, nil, _exp_3, _exp_4, React.createElement("imagebutton", _attributes_6)))
104
+ end
105
+ return React.createElement("textbutton", _attributes, _exp, _exp_1, _exp_2, _condition_1)
59
106
  end
60
107
  local default = Chip
61
108
  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;
@@ -2,6 +2,7 @@
2
2
  local TS = _G[script]
3
3
  local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
4
4
  local componentStyles = _theme.componentStyles
5
+ local controlMetrics = _theme.controlMetrics
5
6
  local createStyles = _theme.createStyles
6
7
  local useChipStyles = componentStyles("Chip", function(theme, _param)
7
8
  local selected = _param.selected
@@ -12,32 +13,76 @@ local useChipStyles = componentStyles("Chip", function(theme, _param)
12
13
  if disabled == nil then
13
14
  disabled = false
14
15
  end
16
+ local deletable = _param.deletable
17
+ if deletable == nil then
18
+ deletable = false
19
+ end
20
+ local size = _param.size
21
+ local variant = _param.variant
22
+ if variant == nil then
23
+ variant = "filled"
24
+ end
25
+ local color = _param.color
26
+ if color == nil then
27
+ color = "default"
28
+ end
29
+ local metrics = controlMetrics(theme.density, size)
30
+ local padY = if size == "small" then 0.25 elseif size == "large" then 0.75 else 0.5
31
+ local padX = if size == "small" then 1 elseif size == "large" then 2 else 1.5
32
+ local deletePx = metrics.icon
33
+ local primary = color == "primary"
34
+ local ink = if disabled then theme.palette.text.disabled elseif primary then if variant == "outlined" then theme.palette.primary.main else theme.palette.primary.on else theme.palette.text.primary
15
35
  return createStyles({
16
36
  root = {
17
37
  AutomaticSize = Enum.AutomaticSize.XY,
18
38
  Size = UDim2.fromScale(0, 0),
19
- BackgroundColor3 = if selected then theme.palette.action.selected else theme.palette.surface.input,
39
+ BackgroundColor3 = if primary and variant ~= "outlined" then theme.palette.primary.main elseif selected then theme.palette.action.selected else theme.palette.surface.input,
40
+ BackgroundTransparency = if variant == "outlined" and selected ~= true then 1 else 0,
20
41
  BorderSizePixel = 0,
21
42
  AutoButtonColor = false,
22
43
  Active = not disabled,
23
44
  Selectable = not disabled,
24
- TextColor3 = if disabled then theme.palette.text.disabled else theme.palette.text.primary,
45
+ TextColor3 = ink,
25
46
  Font = theme.typography.fontFamilies.default,
26
- TextSize = theme.typography.fontSizes.body,
47
+ TextSize = metrics.font,
27
48
  },
28
49
  padding = {
29
- PaddingTop = UDim.new(0, theme.padding.calc(0.5)),
30
- PaddingBottom = UDim.new(0, theme.padding.calc(0.5)),
31
- PaddingLeft = UDim.new(0, theme.padding.calc(1.5)),
32
- PaddingRight = UDim.new(0, theme.padding.calc(1.5)),
50
+ PaddingTop = UDim.new(0, theme.padding.calc(padY)),
51
+ PaddingBottom = UDim.new(0, theme.padding.calc(padY)),
52
+ PaddingLeft = UDim.new(0, theme.padding.calc(padX)),
53
+ PaddingRight = UDim.new(0, theme.padding.calc(if deletable then 0.5 else padX)),
33
54
  },
34
55
  corner = {
35
- CornerRadius = UDim.new(1, 0),
56
+ CornerRadius = UDim.new(theme.shape.pillScale, 0),
36
57
  },
37
58
  stroke = {
38
- Color = theme.palette.border,
59
+ Color = if primary then theme.palette.primary.main else theme.palette.border,
39
60
  ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
40
- Transparency = if selected then 1 else 0,
61
+ Transparency = if variant == "outlined" then (if disabled then 0.5 else 0) elseif primary or selected then 1 else 0,
62
+ },
63
+ row = {
64
+ FillDirection = Enum.FillDirection.Horizontal,
65
+ VerticalAlignment = Enum.VerticalAlignment.Center,
66
+ SortOrder = Enum.SortOrder.LayoutOrder,
67
+ Padding = UDim.new(0, theme.padding.calc(0.5)),
68
+ },
69
+ label = {
70
+ AutomaticSize = Enum.AutomaticSize.XY,
71
+ Size = UDim2.fromScale(0, 0),
72
+ BackgroundTransparency = 1,
73
+ BorderSizePixel = 0,
74
+ TextColor3 = ink,
75
+ Font = theme.typography.fontFamilies.default,
76
+ TextSize = metrics.font,
77
+ LayoutOrder = 1,
78
+ },
79
+ delete = {
80
+ Size = UDim2.fromOffset(deletePx, deletePx),
81
+ BackgroundTransparency = 1,
82
+ BorderSizePixel = 0,
83
+ AutoButtonColor = false,
84
+ ImageColor3 = if disabled then theme.palette.text.disabled elseif primary and variant ~= "outlined" then theme.palette.primary.on else theme.palette.text.secondary,
85
+ LayoutOrder = 2,
41
86
  },
42
87
  })
43
88
  end)
@@ -10,6 +10,7 @@ local _motion = TS.import(script, script.Parent.Parent.Parent, "motion")
10
10
  local arcKeys = _motion.arcKeys
11
11
  local loopProperty = _motion.loopProperty
12
12
  local progressSpin = _motion.progressSpin
13
+ local spinArcKeys = _motion.spinArcKeys
13
14
  local function CircularProgress(props)
14
15
  local _binding = props
15
16
  local value = _binding.value
@@ -38,7 +39,17 @@ local function CircularProgress(props)
38
39
  local shown = if indeterminate then (if motion == "spin" then nil else 0.25) else value
39
40
  local _result
40
41
  if shown == nil then
41
- _result = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.35, 1), NumberSequenceKeypoint.new(0.5, 0), NumberSequenceKeypoint.new(0.65, 1), NumberSequenceKeypoint.new(1, 1) })
42
+ local _exp = spinArcKeys()
43
+ -- ▼ ReadonlyArray.map ▼
44
+ local _newValue = table.create(#_exp)
45
+ local _callback = function(key)
46
+ return NumberSequenceKeypoint.new(key.time, key.transparency)
47
+ end
48
+ for _k, _v in _exp do
49
+ _newValue[_k] = _callback(_v, _k - 1, _exp)
50
+ end
51
+ -- ▲ ReadonlyArray.map ▲
52
+ _result = NumberSequence.new(_newValue)
42
53
  else
43
54
  local _exp = arcKeys(shown)
44
55
  -- ▼ ReadonlyArray.map ▼
@@ -91,7 +102,7 @@ local function CircularProgress(props)
91
102
  }), React.createElement("uistroke", {
92
103
  Color = tint,
93
104
  Thickness = thickness,
94
- Transparency = if disabled then 0.75 else 0.7,
105
+ Transparency = if disabled then 0.85 else 0.82,
95
106
  }), React.createElement("uistroke", {
96
107
  Color = tint,
97
108
  Thickness = thickness,
@@ -2,7 +2,7 @@ import React from "@rbxts/react";
2
2
  export interface DialogProps {
3
3
  host?: Instance;
4
4
  open: boolean;
5
- title: string;
5
+ title?: string;
6
6
  onClose: () => void;
7
7
  children?: React.ReactNode;
8
8
  actions?: React.ReactNode;
@@ -12,6 +12,8 @@ local function Dialog(props)
12
12
  local children = _binding.children
13
13
  local actions = _binding.actions
14
14
  local styles = useDialogStyles()
15
+ local hasTitle = title ~= nil and title ~= ""
16
+ local hasActions = actions ~= nil
15
17
  local _attributes = {
16
18
  key = "Column",
17
19
  }
@@ -21,34 +23,41 @@ local function Dialog(props)
21
23
  local _attributes_1 = table.clone(styles.columnList)
22
24
  setmetatable(_attributes_1, nil)
23
25
  local _exp = React.createElement("uilistlayout", _attributes_1)
24
- local _attributes_2 = {
25
- key = "Title",
26
- }
27
- for _k, _v in styles.title do
28
- _attributes_2[_k] = _v
26
+ local _condition = hasTitle
27
+ if _condition then
28
+ local _attributes_2 = {
29
+ key = "Title",
30
+ }
31
+ for _k, _v in styles.title do
32
+ _attributes_2[_k] = _v
33
+ end
34
+ _attributes_2.Text = title
35
+ _condition = React.createElement("textlabel", _attributes_2)
29
36
  end
30
- _attributes_2.Text = title
31
- local _exp_1 = React.createElement("textlabel", _attributes_2)
32
- local _attributes_3 = {
37
+ local _attributes_2 = {
33
38
  key = "Body",
34
39
  }
35
40
  for _k, _v in styles.body do
36
- _attributes_3[_k] = _v
41
+ _attributes_2[_k] = _v
37
42
  end
38
- local _exp_2 = React.createElement("frame", _attributes_3, children)
39
- local _attributes_4 = {
40
- key = "Actions",
41
- }
42
- for _k, _v in styles.actions do
43
- _attributes_4[_k] = _v
43
+ local _exp_1 = React.createElement("frame", _attributes_2, children)
44
+ local _condition_1 = hasActions
45
+ if _condition_1 then
46
+ local _attributes_3 = {
47
+ key = "Actions",
48
+ }
49
+ for _k, _v in styles.actions do
50
+ _attributes_3[_k] = _v
51
+ end
52
+ local _attributes_4 = table.clone(styles.actionList)
53
+ setmetatable(_attributes_4, nil)
54
+ _condition_1 = (React.createElement("frame", _attributes_3, React.createElement("uilistlayout", _attributes_4), actions))
44
55
  end
45
- local _attributes_5 = table.clone(styles.actionList)
46
- setmetatable(_attributes_5, nil)
47
56
  return React.createElement(Modal, {
48
57
  host = host,
49
58
  open = open,
50
59
  onClose = onClose,
51
- }, React.createElement("frame", _attributes, _exp, _exp_1, _exp_2, React.createElement("frame", _attributes_4, React.createElement("uilistlayout", _attributes_5), actions)))
60
+ }, React.createElement("frame", _attributes, _exp, _condition, _exp_1, _condition_1))
52
61
  end
53
62
  local default = Dialog
54
63
  return {
@@ -9,6 +9,7 @@ export interface DividerProps {
9
9
  transparency?: number;
10
10
  weight?: number;
11
11
  anchorPoint?: Vector2;
12
+ text?: string;
12
13
  }
13
14
  declare function Divider<T extends DefaultDividerComponent>(props: CustomizedProps<T, DividerProps>): JSX.Element;
14
15
  export default Divider;
@@ -1,15 +1,63 @@
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 Orientations = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Orientations
5
+ local dividerLabel = TS.import(script, script.Parent, "dividerLabel").dividerLabel
4
6
  local useDividerStyles = TS.import(script, script.Parent, "Divider.styles").default
5
7
  local function Divider(props)
6
8
  local _binding = props
9
+ local text = _binding.text
10
+ local orientation = _binding.orientation
7
11
  local className = _binding.className
8
12
  local sx = _binding.sx
9
13
  local id = _binding.id
10
14
  local ref = _binding.ref
11
15
  local _binding_1 = useDividerStyles(props)
12
16
  local root = _binding_1.root
17
+ local shell = _binding_1.shell
18
+ local line = _binding_1.line
19
+ local caption = _binding_1.caption
20
+ local captionPad = _binding_1.captionPad
21
+ local label = dividerLabel(text)
22
+ if label ~= nil and orientation ~= Orientations.Vertical then
23
+ local _attributes = {}
24
+ local _condition = id
25
+ if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
26
+ _condition = "Divider"
27
+ end
28
+ _attributes.key = _condition
29
+ _attributes.ref = ref
30
+ for _k, _v in shell do
31
+ _attributes[_k] = _v
32
+ end
33
+ if className ~= 0 and className == className and className ~= "" and className then
34
+ for _k, _v in className do
35
+ _attributes[_k] = _v
36
+ end
37
+ end
38
+ if sx ~= 0 and sx == sx and sx ~= "" and sx then
39
+ for _k, _v in sx do
40
+ _attributes[_k] = _v
41
+ end
42
+ end
43
+ local _attributes_1 = {
44
+ key = "Line",
45
+ }
46
+ for _k, _v in line do
47
+ _attributes_1[_k] = _v
48
+ end
49
+ local _exp = React.createElement("frame", _attributes_1)
50
+ local _attributes_2 = {
51
+ key = "Label",
52
+ }
53
+ for _k, _v in caption do
54
+ _attributes_2[_k] = _v
55
+ end
56
+ _attributes_2.Text = label
57
+ local _attributes_3 = table.clone(captionPad)
58
+ setmetatable(_attributes_3, nil)
59
+ return React.createElement("frame", _attributes, _exp, React.createElement("textlabel", _attributes_2, React.createElement("uipadding", _attributes_3)))
60
+ end
13
61
  local _attributes = {}
14
62
  local _condition = id
15
63
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
@@ -32,6 +32,35 @@ local useDividerStyles = componentStyles("Divider", function(theme, props)
32
32
  anchorPoint = Vector2.new(0, 0)
33
33
  end
34
34
  return createStyles({
35
+ shell = {
36
+ Size = UDim2.new(1, 0, 0, theme.spacing.calc(2)),
37
+ BackgroundTransparency = 1,
38
+ BorderSizePixel = 0,
39
+ },
40
+ line = {
41
+ Size = UDim2.new(1, 0, 0, weight),
42
+ Position = UDim2.new(0, 0, 0.5, 0),
43
+ AnchorPoint = Vector2.new(0, 0.5),
44
+ BackgroundColor3 = color,
45
+ BackgroundTransparency = transparency,
46
+ BorderSizePixel = 0,
47
+ },
48
+ caption = {
49
+ AutomaticSize = Enum.AutomaticSize.XY,
50
+ Size = UDim2.fromScale(0, 0),
51
+ AnchorPoint = Vector2.new(0.5, 0.5),
52
+ Position = UDim2.new(0.5, 0, 0.5, 0),
53
+ BackgroundColor3 = theme.palette.surface.canvas,
54
+ BorderSizePixel = 0,
55
+ Font = theme.typography.fontFamilies.default,
56
+ TextSize = theme.typography.fontSizes.caption,
57
+ TextColor3 = theme.palette.text.secondary,
58
+ ZIndex = 2,
59
+ },
60
+ captionPad = {
61
+ PaddingLeft = UDim.new(0, theme.padding.calc(1)),
62
+ PaddingRight = UDim.new(0, theme.padding.calc(1)),
63
+ },
35
64
  root = {
36
65
  Position = position or UDim2.new(0, 0, 0, 0),
37
66
  Size = UDim2.new(if orientation == Orientations.Horizontal then 1 else 0, if orientation == Orientations.Horizontal then -padding * 2 else weight, if orientation == Orientations.Vertical then 1 else 0, if orientation == Orientations.Vertical then -padding * 2 else weight),
@@ -0,0 +1 @@
1
+ export declare function dividerLabel(text?: string): string | undefined;
@@ -0,0 +1,10 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local function dividerLabel(text)
3
+ if text == nil or #text == 0 then
4
+ return nil
5
+ end
6
+ return text
7
+ end
8
+ return {
9
+ dividerLabel = dividerLabel,
10
+ }
@@ -4,6 +4,7 @@ export interface DrawerProps {
4
4
  host?: Instance;
5
5
  open: boolean;
6
6
  edge?: DrawerEdge;
7
+ width?: number;
7
8
  onClose: () => void;
8
9
  children?: React.ReactNode;
9
10
  }
@@ -17,9 +17,12 @@ local function Drawer(props)
17
17
  if edge == nil then
18
18
  edge = "left"
19
19
  end
20
+ local width = _binding.width
20
21
  local onClose = _binding.onClose
21
22
  local children = _binding.children
22
- local styles = useDrawerStyles()
23
+ local styles = useDrawerStyles({
24
+ width = width,
25
+ })
23
26
  local close = useRef(onClose)
24
27
  close.current = onClose
25
28
  useEffect(function()
@@ -1,2 +1,4 @@
1
- declare const useDrawerStyles: () => import("../../../../theme/index").ClassNameMap<string>;
1
+ declare const useDrawerStyles: (props: {
2
+ width?: number;
3
+ }) => import("../../../../theme/index").ClassNameMap<string>;
2
4
  export default useDrawerStyles;