@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
@@ -0,0 +1,101 @@
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 Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
5
+ local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
6
+ local useRatingStyles = TS.import(script, script.Parent, "Rating.styles").default
7
+ local function Rating(props)
8
+ local _binding = props
9
+ local value = _binding.value
10
+ local max = _binding.max
11
+ if max == nil then
12
+ max = 5
13
+ end
14
+ local size = _binding.size
15
+ if size == nil then
16
+ size = "medium"
17
+ end
18
+ local disabled = _binding.disabled
19
+ local readOnly = _binding.readOnly
20
+ local onChange = _binding.onChange
21
+ local className = _binding.className
22
+ local sx = _binding.sx
23
+ local id = _binding.id
24
+ local ref = _binding.ref
25
+ local styles = useRatingStyles({
26
+ disabled = disabled,
27
+ size = size,
28
+ })
29
+ local active = canActivate(disabled) and readOnly ~= true
30
+ local stars = {}
31
+ do
32
+ local i = 1
33
+ local _shouldIncrement = false
34
+ while true do
35
+ if _shouldIncrement then
36
+ i += 1
37
+ else
38
+ _shouldIncrement = true
39
+ end
40
+ if not (i <= max) then
41
+ break
42
+ end
43
+ local _i = i
44
+ table.insert(stars, _i)
45
+ end
46
+ end
47
+ local _attributes = {}
48
+ local _condition = id
49
+ if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
50
+ _condition = "Rating"
51
+ end
52
+ _attributes.key = _condition
53
+ _attributes.ref = ref
54
+ for _k, _v in styles.root do
55
+ _attributes[_k] = _v
56
+ end
57
+ if className then
58
+ for _k, _v in className do
59
+ _attributes[_k] = _v
60
+ end
61
+ end
62
+ if sx then
63
+ for _k, _v in sx do
64
+ _attributes[_k] = _v
65
+ end
66
+ end
67
+ local _attributes_1 = table.clone(styles.list)
68
+ setmetatable(_attributes_1, nil)
69
+ local _exp = React.createElement("uilistlayout", _attributes_1)
70
+ -- ▼ ReadonlyArray.map ▼
71
+ local _newValue = table.create(#stars)
72
+ local _callback = function(n)
73
+ local _attributes_2 = {
74
+ key = `Star-{n}`,
75
+ }
76
+ for _k, _v in styles.star do
77
+ _attributes_2[_k] = _v
78
+ end
79
+ _attributes_2.Image = tostring(if n <= value then Icons.StarFilled else Icons.Star)
80
+ _attributes_2.LayoutOrder = n
81
+ _attributes_2.Active = active
82
+ _attributes_2.Selectable = active
83
+ _attributes_2.Event = {
84
+ Activated = function()
85
+ if active then
86
+ onChange(if n == value then 0 else n)
87
+ end
88
+ end,
89
+ }
90
+ return React.createElement("imagebutton", _attributes_2)
91
+ end
92
+ for _k, _v in stars do
93
+ _newValue[_k] = _callback(_v, _k - 1, stars)
94
+ end
95
+ -- ▲ ReadonlyArray.map ▲
96
+ return React.createElement("frame", _attributes, _exp, _newValue)
97
+ end
98
+ local default = Rating
99
+ return {
100
+ default = default,
101
+ }
@@ -0,0 +1,6 @@
1
+ import { ControlSize } from "../../../../theme/index";
2
+ declare const useRatingStyles: (props: {
3
+ disabled?: boolean;
4
+ size?: ControlSize;
5
+ }) => import("../../../../theme/index").ClassNameMap<string>;
6
+ export default useRatingStyles;
@@ -0,0 +1,44 @@
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 useRatingStyles = componentStyles("Rating", function(theme, _param)
7
+ local disabled = _param.disabled
8
+ if disabled == nil then
9
+ disabled = false
10
+ end
11
+ local size = _param.size
12
+ if size == nil then
13
+ size = "medium"
14
+ end
15
+ local star = if size == "small" then theme.spacing.calc(2) elseif size == "large" then theme.spacing.calc(4) else theme.spacing.calc(3)
16
+ return createStyles({
17
+ root = {
18
+ AutomaticSize = Enum.AutomaticSize.XY,
19
+ Size = UDim2.fromScale(0, 0),
20
+ BackgroundTransparency = 1,
21
+ BorderSizePixel = 0,
22
+ },
23
+ list = {
24
+ FillDirection = Enum.FillDirection.Horizontal,
25
+ HorizontalAlignment = Enum.HorizontalAlignment.Left,
26
+ VerticalAlignment = Enum.VerticalAlignment.Center,
27
+ SortOrder = Enum.SortOrder.LayoutOrder,
28
+ Padding = UDim.new(0, theme.padding.calc(if size == "small" then 0.25 else 0.5)),
29
+ },
30
+ star = {
31
+ Size = UDim2.fromOffset(star, star),
32
+ BackgroundTransparency = 1,
33
+ BorderSizePixel = 0,
34
+ AutoButtonColor = false,
35
+ Active = not disabled,
36
+ Selectable = not disabled,
37
+ ImageColor3 = if disabled then theme.palette.text.disabled else theme.palette.primary.main,
38
+ },
39
+ })
40
+ end)
41
+ local default = useRatingStyles
42
+ return {
43
+ default = default,
44
+ }
@@ -0,0 +1,2 @@
1
+ export { default as Rating } from "./components/Rating";
2
+ export { RatingProps } from "./components/Rating";
@@ -0,0 +1,5 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ exports.Rating = TS.import(script, script, "components", "Rating").default
5
+ return exports
@@ -1,3 +1,4 @@
1
+ import React from "@rbxts/react";
1
2
  import { ControlSize, CustomizedProps } from "../../../../theme/index";
2
3
  import { ChoiceOption } from "../../radioGroup/index";
3
4
  export interface SelectProps<T> {
@@ -9,6 +10,10 @@ export interface SelectProps<T> {
9
10
  loading?: boolean;
10
11
  placeholder?: string;
11
12
  searchable?: boolean;
13
+ defaultOpen?: boolean;
14
+ defaultQuery?: string;
15
+ emptyText?: string;
16
+ empty?: React.Element;
12
17
  reducedMotion?: boolean;
13
18
  size?: ControlSize;
14
19
  }
@@ -20,7 +20,9 @@ local Input = TS.import(script, script.Parent.Parent.Parent, "input").Input
20
20
  local playProperty = TS.import(script, script.Parent.Parent.Parent, "motion").playProperty
21
21
  local Popup = TS.import(script, script.Parent.Parent.Parent, "popup").Popup
22
22
  local Shadow = TS.import(script, script.Parent.Parent.Parent, "shadow").Shadow
23
- local VirtualList = TS.import(script, script.Parent.Parent.Parent, "virtualList").VirtualList
23
+ local _virtualList = TS.import(script, script.Parent.Parent.Parent, "virtualList")
24
+ local EmptyListHint = _virtualList.EmptyListHint
25
+ local VirtualList = _virtualList.VirtualList
24
26
  local useSelectStyles = TS.import(script, script.Parent, "Select.styles").default
25
27
  local optionLabel = TS.import(script, script.Parent, "optionLabel").optionLabel
26
28
  local _selectFilter = TS.import(script, script.Parent, "selectFilter")
@@ -53,6 +55,10 @@ local function Select(props)
53
55
  placeholder = ""
54
56
  end
55
57
  local searchable = _binding.searchable
58
+ local defaultOpen = _binding.defaultOpen
59
+ local defaultQuery = _binding.defaultQuery
60
+ local emptyText = _binding.emptyText
61
+ local empty = _binding.empty
56
62
  local reducedProp = _binding.reducedMotion
57
63
  local size = _binding.size
58
64
  local className = _binding.className
@@ -68,11 +74,15 @@ local function Select(props)
68
74
  local row = controlMetrics(theme.density, size).height
69
75
  local active = canActivate(disabled, loading)
70
76
  local anchor, setAnchor = useState()
71
- local open, setOpen = useState(false)
77
+ local open, setOpen = useState(defaultOpen == true and not loading)
72
78
  local held, setHeld = useState(false)
73
79
  local focused, setFocused = useState(false)
74
80
  local highlight, setHighlight = useState(-1)
75
- local query, setQuery = useState("")
81
+ local _condition = defaultQuery
82
+ if _condition == nil then
83
+ _condition = ""
84
+ end
85
+ local query, setQuery = useState(_condition)
76
86
  local recent = useRef()
77
87
  local typed = useRef()
78
88
  local onKeyRef = useRef()
@@ -95,7 +105,20 @@ local function Select(props)
95
105
  local search = usesSelectSearch(#options, searchable)
96
106
  local filtered = filterChoices(options, query)
97
107
  local rows = groupRows(filtered)
98
- local menuHeight = math.min(#rows * row, theme.spacing.calc(16)) + (if search then row else 0)
108
+ local listHeight = if #rows == 0 then row else math.min(#rows * row, theme.spacing.calc(16))
109
+ local menuHeight = listHeight + (if search then row else 0)
110
+ local _condition_1 = empty
111
+ if _condition_1 == nil then
112
+ local _attributes = {}
113
+ local _condition_2 = emptyText
114
+ if _condition_2 == nil then
115
+ _condition_2 = (if #query > 0 or #options > 0 then "No results" else "No options")
116
+ end
117
+ _attributes.text = _condition_2
118
+ _attributes.height = row
119
+ _condition_1 = (React.createElement(EmptyListHint, _attributes))
120
+ end
121
+ local emptyHint = _condition_1
99
122
  local close = function()
100
123
  setOpen(false)
101
124
  setQuery("")
@@ -125,15 +148,15 @@ local function Select(props)
125
148
  if fromPointer == nil then
126
149
  fromPointer = false
127
150
  end
128
- local _condition = fromPointer
129
- if _condition then
151
+ local _condition_2 = fromPointer
152
+ if _condition_2 then
130
153
  local _result_1 = listRef.current
131
154
  if _result_1 ~= nil then
132
155
  _result_1 = _result_1.suppressClick()
133
156
  end
134
- _condition = _result_1
157
+ _condition_2 = _result_1
135
158
  end
136
- if _condition then
159
+ if _condition_2 then
137
160
  return nil
138
161
  end
139
162
  local choice = filtered[index + 1]
@@ -254,11 +277,11 @@ local function Select(props)
254
277
  end
255
278
  end, { shown, held, reducedMotion })
256
279
  local _attributes = {}
257
- local _condition = id
258
- if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
259
- _condition = "Select"
280
+ local _condition_2 = id
281
+ if not (_condition_2 ~= 0 and _condition_2 == _condition_2 and _condition_2 ~= "" and _condition_2) then
282
+ _condition_2 = "Select"
260
283
  end
261
- _attributes.key = _condition
284
+ _attributes.key = _condition_2
262
285
  _attributes.ref = ref
263
286
  for _k, _v in styles.root do
264
287
  _attributes[_k] = _v
@@ -290,11 +313,11 @@ local function Select(props)
290
313
  if _result_2 ~= nil then
291
314
  _result_2 = _result_2.label
292
315
  end
293
- local _condition_1 = _result_2
294
- if _condition_1 == nil then
295
- _condition_1 = placeholder
316
+ local _condition_3 = _result_2
317
+ if _condition_3 == nil then
318
+ _condition_3 = placeholder
296
319
  end
297
- _result_1 = _condition_1
320
+ _result_1 = _condition_3
298
321
  end
299
322
  _attributes_1.Text = _result_1
300
323
  _attributes_1.Active = active
@@ -337,8 +360,8 @@ local function Select(props)
337
360
  Position = UDim2.new(1, -theme.padding.calc(1), 0.5, 0),
338
361
  },
339
362
  })))
340
- local _condition_1 = (shown or held)
341
- if _condition_1 then
363
+ local _condition_3 = (shown or held)
364
+ if _condition_3 then
342
365
  local _attributes_5 = {
343
366
  key = "Menu",
344
367
  }
@@ -356,8 +379,8 @@ local function Select(props)
356
379
  FillDirection = Enum.FillDirection.Vertical,
357
380
  SortOrder = Enum.SortOrder.LayoutOrder,
358
381
  })
359
- local _condition_2 = search
360
- if _condition_2 then
382
+ local _condition_4 = search
383
+ if _condition_4 then
361
384
  local _attributes_8 = {
362
385
  key = "Search",
363
386
  }
@@ -365,7 +388,7 @@ local function Select(props)
365
388
  _attributes_8[_k] = _v
366
389
  end
367
390
  _attributes_8.LayoutOrder = 1
368
- _condition_2 = (React.createElement("frame", _attributes_8, React.createElement(Input, {
391
+ _condition_4 = (React.createElement("frame", _attributes_8, React.createElement(Input, {
369
392
  text = query,
370
393
  placeholder = "Search",
371
394
  width = UDim.new(1, 0),
@@ -375,7 +398,7 @@ local function Select(props)
375
398
  end,
376
399
  })))
377
400
  end
378
- _condition_1 = (React.createElement(Popup, {
401
+ _condition_3 = (React.createElement(Popup, {
379
402
  anchor = anchor,
380
403
  preferredHeight = menuHeight,
381
404
  onDismiss = close,
@@ -387,7 +410,7 @@ local function Select(props)
387
410
  Size = UDim2.fromScale(1, 1),
388
411
  BackgroundTransparency = 1,
389
412
  GroupTransparency = 1,
390
- }, React.createElement("frame", _attributes_5, _exp_3, _exp_4, _exp_5, _exp_6, _condition_2, React.createElement("frame", {
413
+ }, React.createElement("frame", _attributes_5, _exp_3, _exp_4, _exp_5, _exp_6, _condition_4, React.createElement("frame", {
391
414
  key = "ListHost",
392
415
  Size = UDim2.new(1, 0, 1, if search then -row else 0),
393
416
  BackgroundTransparency = 1,
@@ -400,6 +423,7 @@ local function Select(props)
400
423
  end,
401
424
  itemHeight = row,
402
425
  listRef = listRef,
426
+ empty = emptyHint,
403
427
  className = styles.list,
404
428
  renderItem = function(row)
405
429
  if row.kind == "header" then
@@ -447,7 +471,7 @@ local function Select(props)
447
471
  end,
448
472
  }))))))
449
473
  end
450
- return React.createElement("frame", _attributes, _exp_2, _condition_1)
474
+ return React.createElement("frame", _attributes, _exp_2, _condition_3)
451
475
  end
452
476
  local default = Select
453
477
  return {
@@ -44,7 +44,7 @@ local useSelectStyles = componentStyles("Select", function(theme, _param)
44
44
  },
45
45
  list = {
46
46
  Size = UDim2.fromScale(1, 1),
47
- BackgroundColor3 = theme.palette.surface.elevated,
47
+ BackgroundTransparency = 1,
48
48
  BorderSizePixel = 0,
49
49
  ScrollBarThickness = theme.padding.default,
50
50
  ScrollBarImageColor3 = theme.palette.text.secondary,
@@ -30,6 +30,7 @@ local function SkeletonBlock(props)
30
30
  local circular = _binding_1.circular
31
31
  local fillRef = useRef()
32
32
  local gradientRef = useRef()
33
+ local showGradient = motion ~= "pulse"
33
34
  useEffect(function()
34
35
  local fill = fillRef.current
35
36
  local gradient = gradientRef.current
@@ -45,7 +46,7 @@ local function SkeletonBlock(props)
45
46
  if motion == "pulse" then
46
47
  fill.BackgroundTransparency = 0
47
48
  return loopProperty(fill, {
48
- BackgroundTransparency = 0.55,
49
+ BackgroundTransparency = 0.45,
49
50
  }, 0.9, true)
50
51
  end
51
52
  fill.BackgroundTransparency = 0
@@ -90,7 +91,7 @@ local function SkeletonBlock(props)
90
91
  _attributes_1[_k] = _v
91
92
  end
92
93
  _attributes_1.Size = UDim2.new(1, 0, 1, 0)
93
- local _condition_3 = motion == "shimmer"
94
+ local _condition_3 = showGradient
94
95
  if _condition_3 then
95
96
  local _attributes_2 = {
96
97
  ref = gradientRef,
@@ -3,15 +3,20 @@ local TS = _G[script]
3
3
  local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
4
4
  local createStyles = _theme.createStyles
5
5
  local componentStyles = _theme.componentStyles
6
+ local skeletonTone = TS.import(script, script.Parent, "skeletonTone").skeletonTone
6
7
  local useSkeletonStyles = componentStyles("Skeleton", function(theme)
8
+ local _binding = skeletonTone(theme)
9
+ local bone = _binding.bone
10
+ local shine = _binding.shine
7
11
  return createStyles({
8
12
  block = {
9
- BackgroundColor3 = theme.palette.surface.paper,
13
+ BackgroundColor3 = bone,
10
14
  BackgroundTransparency = 0,
11
15
  BorderSizePixel = 0,
12
16
  },
13
17
  highlight = {
14
- Color = ColorSequence.new({ ColorSequenceKeypoint.new(0, theme.palette.surface.paper), ColorSequenceKeypoint.new(0.5, theme.palette.text.secondary), ColorSequenceKeypoint.new(1, theme.palette.surface.paper) }),
18
+ Color = ColorSequence.new({ ColorSequenceKeypoint.new(0, bone), ColorSequenceKeypoint.new(0.5, shine), ColorSequenceKeypoint.new(1, bone) }),
19
+ Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.35), NumberSequenceKeypoint.new(0.5, 0), NumberSequenceKeypoint.new(1, 0.35) }),
15
20
  },
16
21
  rounded = {
17
22
  CornerRadius = UDim.new(0, theme.shape.borderRadius),
@@ -3,7 +3,7 @@ local function skeletonMotion(animation, reducedMotion)
3
3
  if animation == false or reducedMotion == true then
4
4
  return false
5
5
  end
6
- return animation or "pulse"
6
+ return animation or "shimmer"
7
7
  end
8
8
  local function skeletonLineWidth(width, index, count)
9
9
  if count > 1 and index == count - 1 then
@@ -0,0 +1,20 @@
1
+ interface SkeletonPalette {
2
+ surface: {
3
+ canvas: Color3;
4
+ elevated: Color3;
5
+ };
6
+ action: {
7
+ hover: Color3;
8
+ };
9
+ text: {
10
+ secondary: Color3;
11
+ };
12
+ }
13
+ /** Bone + shimmer peak from semantic tokens; shine always lifts off the bone vs canvas. */
14
+ export declare function skeletonTone(theme: {
15
+ palette: SkeletonPalette;
16
+ }): {
17
+ bone: Color3;
18
+ shine: Color3;
19
+ };
20
+ export {};
@@ -0,0 +1,14 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local relativeLuminance = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme", "utilites", "colorMath").relativeLuminance
4
+ --* Bone + shimmer peak from semantic tokens; shine always lifts off the bone vs canvas.
5
+ local function skeletonTone(theme)
6
+ local lightCanvas = relativeLuminance(theme.palette.surface.canvas) > 0.5
7
+ return {
8
+ bone = theme.palette.action.hover,
9
+ shine = if lightCanvas then theme.palette.surface.elevated else theme.palette.text.secondary,
10
+ }
11
+ end
12
+ return {
13
+ skeletonTone = skeletonTone,
14
+ }
@@ -1,4 +1,5 @@
1
1
  import { ControlSize, CustomizedProps } from "../../../../theme/index";
2
+ import { SliderColor } from "./Slider.styles";
2
3
  export interface SliderProps {
3
4
  value: number;
4
5
  onChange: (value: number) => void;
@@ -8,6 +9,8 @@ export interface SliderProps {
8
9
  step?: number;
9
10
  disabled?: boolean;
10
11
  size?: ControlSize;
12
+ marks?: boolean | ReadonlyArray<number>;
13
+ color?: SliderColor;
11
14
  }
12
15
  declare function Slider(props: CustomizedProps<Frame, SliderProps>): JSX.Element;
13
16
  export default Slider;
@@ -8,6 +8,7 @@ local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
8
8
  local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
9
9
  local commitNumber = TS.import(script, script.Parent.Parent.Parent, "numberInput", "components", "numberValue").commitNumber
10
10
  local useSliderStyles = TS.import(script, script.Parent, "Slider.styles").default
11
+ local sliderMarkValues = TS.import(script, script.Parent, "sliderMarks").sliderMarkValues
11
12
  local _sliderNudge = TS.import(script, script.Parent, "sliderNudge")
12
13
  local isSliderDrag = _sliderNudge.isSliderDrag
13
14
  local isSliderMove = _sliderNudge.isSliderMove
@@ -23,12 +24,18 @@ local function Slider(props)
23
24
  local step = _binding.step
24
25
  local disabled = _binding.disabled
25
26
  local size = _binding.size
27
+ local marks = _binding.marks
28
+ local color = _binding.color
29
+ if color == nil then
30
+ color = "primary"
31
+ end
26
32
  local className = _binding.className
27
33
  local sx = _binding.sx
28
34
  local id = _binding.id
29
35
  local ref = _binding.ref
30
36
  local _binding_1 = useSliderStyles({
31
37
  size = size,
38
+ color = color,
32
39
  })
33
40
  local root = _binding_1.root
34
41
  local track = _binding_1.track
@@ -36,6 +43,7 @@ local function Slider(props)
36
43
  local knob = _binding_1.knob
37
44
  local corner = _binding_1.corner
38
45
  local stroke = _binding_1.stroke
46
+ local mark = _binding_1.mark
39
47
  local active = canActivate(disabled)
40
48
  local focused, setFocused = useState(false)
41
49
  local hovering, setHovering = useState(false)
@@ -45,6 +53,8 @@ local function Slider(props)
45
53
  local ratio = if max > min then (math.clamp(value, min, max) - min) / (max - min) else 0
46
54
  local faded = disabled == true
47
55
  local showFocus = focused and active
56
+ local markValues = sliderMarkValues(min, max, step, marks)
57
+ local span = max - min
48
58
  local update = function(rbx, x)
49
59
  local width = rbx.AbsoluteSize.X
50
60
  if width <= 0 then
@@ -165,6 +175,25 @@ local function Slider(props)
165
175
  setmetatable(_attributes_3, nil)
166
176
  _condition_1 = React.createElement("uistroke", _attributes_3)
167
177
  end
178
+ -- ▼ ReadonlyArray.map ▼
179
+ local _newValue = table.create(#markValues)
180
+ local _callback = function(markValue, index)
181
+ local markRatio = if span > 0 then (markValue - min) / span else 0
182
+ local _attributes_3 = {
183
+ key = `Mark-{index}`,
184
+ }
185
+ for _k, _v in mark do
186
+ _attributes_3[_k] = _v
187
+ end
188
+ _attributes_3.Position = UDim2.fromScale(markRatio, 0.5)
189
+ _attributes_3.BackgroundTransparency = if faded then 0.7 else 0.35
190
+ return React.createElement("frame", _attributes_3)
191
+ end
192
+ for _k, _v in markValues do
193
+ _newValue[_k] = _callback(_v, _k - 1, markValues)
194
+ end
195
+ -- ▲ ReadonlyArray.map ▲
196
+ local _exp_1 = React.createElement(React.Fragment, nil, _newValue)
168
197
  local _attributes_3 = {
169
198
  key = "Fill",
170
199
  }
@@ -176,7 +205,7 @@ local function Slider(props)
176
205
  _attributes_3.Size = UDim2.fromScale(ratio, 1)
177
206
  local _attributes_4 = table.clone(corner)
178
207
  setmetatable(_attributes_4, nil)
179
- local _exp_1 = React.createElement("frame", _attributes_3, React.createElement("uicorner", _attributes_4))
208
+ local _exp_2 = React.createElement("frame", _attributes_3, React.createElement("uicorner", _attributes_4))
180
209
  local _attributes_5 = {
181
210
  key = "Knob",
182
211
  }
@@ -188,7 +217,7 @@ local function Slider(props)
188
217
  _attributes_5.Position = UDim2.fromScale(ratio, 0.5)
189
218
  local _attributes_6 = table.clone(corner)
190
219
  setmetatable(_attributes_6, nil)
191
- local _exp_2 = React.createElement("uicorner", _attributes_6)
220
+ local _exp_3 = React.createElement("uicorner", _attributes_6)
192
221
  local _condition_2 = showFocus
193
222
  if _condition_2 then
194
223
  local _attributes_7 = table.clone(stroke)
@@ -196,7 +225,7 @@ local function Slider(props)
196
225
  _attributes_7.Thickness = 1
197
226
  _condition_2 = React.createElement("uistroke", _attributes_7)
198
227
  end
199
- return React.createElement("frame", _attributes, React.createElement("frame", _attributes_1, _exp, _condition_1, _exp_1, React.createElement("frame", _attributes_5, _exp_2, _condition_2)))
228
+ return React.createElement("frame", _attributes, React.createElement("frame", _attributes_1, _exp, _condition_1, _exp_1, _exp_2, React.createElement("frame", _attributes_5, _exp_3, _condition_2)))
200
229
  end
201
230
  local default = Slider
202
231
  return {
@@ -1,6 +1,8 @@
1
1
  import { ControlSize } from "../../../../theme/index";
2
+ export type SliderColor = "primary" | "accent";
2
3
  export interface SliderStyleProps {
3
4
  size?: ControlSize;
5
+ color?: SliderColor;
4
6
  }
5
7
  declare const useSliderStyles: (props: SliderStyleProps) => import("../../../../theme/index").ClassNameMap<string>;
6
8
  export default useSliderStyles;
@@ -6,7 +6,12 @@ local createStyles = _theme.createStyles
6
6
  local componentStyles = _theme.componentStyles
7
7
  local useSliderStyles = componentStyles("Slider", function(theme, _param)
8
8
  local size = _param.size
9
+ local color = _param.color
10
+ if color == nil then
11
+ color = "primary"
12
+ end
9
13
  local metrics = controlMetrics(theme.density, size)
14
+ local tone = if color == "accent" then theme.palette.accent.main else theme.palette.primary.main
10
15
  return createStyles({
11
16
  root = {
12
17
  Size = UDim2.new(1, 0, 0, metrics.sliderHeight),
@@ -21,7 +26,7 @@ local useSliderStyles = componentStyles("Slider", function(theme, _param)
21
26
  BorderSizePixel = 0,
22
27
  },
23
28
  fill = {
24
- BackgroundColor3 = theme.palette.primary.main,
29
+ BackgroundColor3 = tone,
25
30
  BorderSizePixel = 0,
26
31
  },
27
32
  knob = {
@@ -39,6 +44,14 @@ local useSliderStyles = componentStyles("Slider", function(theme, _param)
39
44
  Thickness = 2,
40
45
  ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
41
46
  },
47
+ mark = {
48
+ Size = UDim2.new(0, 2, 0, metrics.sliderTrack + 4),
49
+ AnchorPoint = Vector2.new(0.5, 0.5),
50
+ BackgroundColor3 = theme.palette.text.secondary,
51
+ BackgroundTransparency = 0.35,
52
+ BorderSizePixel = 0,
53
+ ZIndex = 1,
54
+ },
42
55
  })
43
56
  end)
44
57
  local default = useSliderStyles
@@ -0,0 +1 @@
1
+ export declare function sliderMarkValues(min: number, max: number, step: number | undefined, marks: boolean | ReadonlyArray<number> | undefined): number[];
@@ -0,0 +1,37 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local function sliderMarkValues(min, max, step, marks)
3
+ if marks == nil or marks == false then
4
+ return {}
5
+ end
6
+ if marks ~= true then
7
+ local out = {}
8
+ for _, value in marks do
9
+ if value >= min and value <= max then
10
+ table.insert(out, value)
11
+ end
12
+ end
13
+ return out
14
+ end
15
+ local span = max - min
16
+ if span <= 0 then
17
+ return { min }
18
+ end
19
+ local increment = if step ~= nil and step > 0 then step else span
20
+ local out = {}
21
+ local value = min
22
+ local guard = 0
23
+ while value <= max + increment * 1e-9 and guard < 64 do
24
+ local _arg0 = math.clamp(value, min, max)
25
+ table.insert(out, _arg0)
26
+ value += increment
27
+ guard += 1
28
+ end
29
+ if out[#out] ~= max then
30
+ local _max = max
31
+ table.insert(out, _max)
32
+ end
33
+ return out
34
+ end
35
+ return {
36
+ sliderMarkValues = sliderMarkValues,
37
+ }
@@ -6,6 +6,8 @@ export interface SnackbarProps {
6
6
  duration?: number;
7
7
  variant?: ToastVariants;
8
8
  open?: boolean;
9
+ action?: string;
10
+ onAction?: () => void;
9
11
  }
10
12
  declare function Snackbar(props: CustomizedProps<Frame, SnackbarProps>): JSX.Element | undefined;
11
13
  export default Snackbar;