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

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 (248) 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 +9 -3
  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 +59 -25
  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/cframeEditor/components/CFrameEditor.luau +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/colorPicker/components/ColorPicker.luau +1 -1
  62. package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +1 -1
  63. package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +1 -1
  64. package/out/ui/packages/dialog/components/Dialog.d.ts +1 -1
  65. package/out/ui/packages/dialog/components/Dialog.luau +27 -18
  66. package/out/ui/packages/divider/components/Divider.d.ts +1 -0
  67. package/out/ui/packages/divider/components/Divider.luau +48 -0
  68. package/out/ui/packages/divider/components/Divider.styles.luau +29 -0
  69. package/out/ui/packages/divider/components/dividerLabel.d.ts +1 -0
  70. package/out/ui/packages/divider/components/dividerLabel.luau +10 -0
  71. package/out/ui/packages/drawer/components/Drawer.d.ts +1 -0
  72. package/out/ui/packages/drawer/components/Drawer.luau +4 -1
  73. package/out/ui/packages/drawer/components/Drawer.styles.d.ts +3 -1
  74. package/out/ui/packages/drawer/components/Drawer.styles.luau +3 -2
  75. package/out/ui/packages/fab/components/Fab.d.ts +3 -0
  76. package/out/ui/packages/fab/components/Fab.luau +62 -25
  77. package/out/ui/packages/fab/components/Fab.styles.d.ts +3 -0
  78. package/out/ui/packages/fab/components/Fab.styles.luau +33 -3
  79. package/out/ui/packages/fab/components/fabSize.d.ts +1 -0
  80. package/out/ui/packages/fab/components/fabSize.luau +4 -0
  81. package/out/ui/packages/fab/index.d.ts +1 -1
  82. package/out/ui/packages/fab/init.luau +1 -0
  83. package/out/ui/packages/formText/components/FormHelperText.d.ts +8 -0
  84. package/out/ui/packages/formText/components/FormHelperText.luau +44 -0
  85. package/out/ui/packages/formText/components/FormLabel.d.ts +9 -0
  86. package/out/ui/packages/formText/components/FormLabel.luau +46 -0
  87. package/out/ui/packages/formText/components/FormText.styles.d.ts +5 -0
  88. package/out/ui/packages/formText/components/FormText.styles.luau +33 -0
  89. package/out/ui/packages/formText/index.d.ts +4 -0
  90. package/out/ui/packages/formText/init.luau +6 -0
  91. package/out/ui/packages/iconButton/components/IconButton.luau +7 -2
  92. package/out/ui/packages/iconButton/components/IconButton.styles.luau +3 -0
  93. package/out/ui/packages/imageList/components/ImageList.d.ts +14 -0
  94. package/out/ui/packages/imageList/components/ImageList.luau +100 -0
  95. package/out/ui/packages/imageList/components/ImageList.styles.d.ts +6 -0
  96. package/out/ui/packages/imageList/components/ImageList.styles.luau +73 -0
  97. package/out/ui/packages/imageList/components/imageListLayout.d.ts +4 -0
  98. package/out/ui/packages/imageList/components/imageListLayout.luau +31 -0
  99. package/out/ui/packages/imageList/index.d.ts +2 -0
  100. package/out/ui/packages/imageList/init.luau +5 -0
  101. package/out/ui/packages/index.d.ts +7 -0
  102. package/out/ui/packages/init.luau +21 -0
  103. package/out/ui/packages/input/components/Input.d.ts +1 -0
  104. package/out/ui/packages/input/components/Input.luau +8 -3
  105. package/out/ui/packages/layout/components/Box.d.ts +11 -0
  106. package/out/ui/packages/layout/components/Box.luau +49 -0
  107. package/out/ui/packages/layout/components/Box.styles.d.ts +7 -0
  108. package/out/ui/packages/layout/components/Box.styles.luau +34 -0
  109. package/out/ui/packages/layout/components/Container.d.ts +10 -0
  110. package/out/ui/packages/layout/components/Container.luau +54 -0
  111. package/out/ui/packages/layout/components/Container.styles.d.ts +6 -0
  112. package/out/ui/packages/layout/components/Container.styles.luau +41 -0
  113. package/out/ui/packages/layout/components/FlexItem.d.ts +12 -0
  114. package/out/ui/packages/layout/components/FlexItem.luau +49 -0
  115. package/out/ui/packages/layout/components/FlexItem.styles.d.ts +8 -0
  116. package/out/ui/packages/layout/components/FlexItem.styles.luau +66 -0
  117. package/out/ui/packages/layout/components/Grid.d.ts +5 -1
  118. package/out/ui/packages/layout/components/Grid.luau +35 -4
  119. package/out/ui/packages/layout/components/Stack.d.ts +14 -0
  120. package/out/ui/packages/layout/components/Stack.luau +53 -0
  121. package/out/ui/packages/layout/components/Stack.styles.d.ts +10 -0
  122. package/out/ui/packages/layout/components/Stack.styles.luau +101 -0
  123. package/out/ui/packages/layout/components/boxPad.d.ts +14 -0
  124. package/out/ui/packages/layout/components/boxPad.luau +59 -0
  125. package/out/ui/packages/layout/components/containerWidth.d.ts +2 -0
  126. package/out/ui/packages/layout/components/containerWidth.luau +17 -0
  127. package/out/ui/packages/layout/components/flexItemMode.d.ts +6 -0
  128. package/out/ui/packages/layout/components/flexItemMode.luau +36 -0
  129. package/out/ui/packages/layout/components/gridProps.d.ts +3 -0
  130. package/out/ui/packages/layout/components/gridProps.luau +20 -0
  131. package/out/ui/packages/layout/components/stackAlign.d.ts +10 -0
  132. package/out/ui/packages/layout/components/stackAlign.luau +43 -0
  133. package/out/ui/packages/layout/index.d.ts +14 -0
  134. package/out/ui/packages/layout/init.luau +5 -0
  135. package/out/ui/packages/link/components/Link.d.ts +11 -0
  136. package/out/ui/packages/link/components/Link.luau +83 -0
  137. package/out/ui/packages/link/components/Link.styles.d.ts +8 -0
  138. package/out/ui/packages/link/components/Link.styles.luau +59 -0
  139. package/out/ui/packages/link/index.d.ts +3 -0
  140. package/out/ui/packages/link/init.luau +5 -0
  141. package/out/ui/packages/listItem/components/ListItem.d.ts +2 -0
  142. package/out/ui/packages/listItem/components/ListItem.luau +22 -1
  143. package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
  144. package/out/ui/packages/listItem/components/ListItem.styles.luau +16 -5
  145. package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +2 -0
  146. package/out/ui/packages/loadingStroke/components/LoadingStroke.luau +23 -19
  147. package/out/ui/packages/menu/components/Menu.d.ts +5 -0
  148. package/out/ui/packages/menu/components/Menu.luau +54 -23
  149. package/out/ui/packages/menu/components/Menu.styles.luau +5 -1
  150. package/out/ui/packages/modal/components/Modal.d.ts +1 -1
  151. package/out/ui/packages/modal/components/Modal.luau +55 -37
  152. package/out/ui/packages/motion/index.d.ts +1 -1
  153. package/out/ui/packages/motion/init.luau +1 -0
  154. package/out/ui/packages/motion/unit.d.ts +5 -0
  155. package/out/ui/packages/motion/unit.luau +23 -0
  156. package/out/ui/packages/numberInput/components/NumberInput.d.ts +1 -0
  157. package/out/ui/packages/numberInput/components/NumberInput.luau +2 -0
  158. package/out/ui/packages/pagination/components/Pagination.d.ts +6 -1
  159. package/out/ui/packages/pagination/components/Pagination.luau +51 -23
  160. package/out/ui/packages/pagination/components/Pagination.styles.d.ts +6 -1
  161. package/out/ui/packages/pagination/components/Pagination.styles.luau +36 -4
  162. package/out/ui/packages/pagination/components/pageRange.d.ts +2 -1
  163. package/out/ui/packages/pagination/components/pageRange.luau +91 -8
  164. package/out/ui/packages/pagination/index.d.ts +1 -0
  165. package/out/ui/packages/pagination/init.luau +1 -0
  166. package/out/ui/packages/paper/components/Paper.d.ts +2 -1
  167. package/out/ui/packages/paper/components/Paper.luau +14 -3
  168. package/out/ui/packages/paper/components/Paper.styles.d.ts +1 -1
  169. package/out/ui/packages/paper/components/Paper.styles.luau +6 -0
  170. package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +1 -1
  171. package/out/ui/packages/popup/index.d.ts +1 -0
  172. package/out/ui/packages/popup/init.luau +1 -0
  173. package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +1 -0
  174. package/out/ui/packages/radioGroup/components/RadioGroup.luau +5 -3
  175. package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +1 -0
  176. package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +4 -1
  177. package/out/ui/packages/rating/components/Rating.d.ts +11 -0
  178. package/out/ui/packages/rating/components/Rating.luau +101 -0
  179. package/out/ui/packages/rating/components/Rating.styles.d.ts +6 -0
  180. package/out/ui/packages/rating/components/Rating.styles.luau +44 -0
  181. package/out/ui/packages/rating/index.d.ts +2 -0
  182. package/out/ui/packages/rating/init.luau +5 -0
  183. package/out/ui/packages/rectEditor/components/RectEditor.luau +1 -1
  184. package/out/ui/packages/select/components/Select.d.ts +5 -0
  185. package/out/ui/packages/select/components/Select.luau +48 -24
  186. package/out/ui/packages/select/components/Select.styles.luau +1 -1
  187. package/out/ui/packages/skeleton/components/Skeleton.luau +4 -3
  188. package/out/ui/packages/skeleton/components/Skeleton.styles.luau +7 -2
  189. package/out/ui/packages/skeleton/components/skeletonMotion.luau +1 -1
  190. package/out/ui/packages/skeleton/components/skeletonTone.d.ts +20 -0
  191. package/out/ui/packages/skeleton/components/skeletonTone.luau +14 -0
  192. package/out/ui/packages/slider/components/Slider.d.ts +3 -0
  193. package/out/ui/packages/slider/components/Slider.luau +32 -3
  194. package/out/ui/packages/slider/components/Slider.styles.d.ts +2 -0
  195. package/out/ui/packages/slider/components/Slider.styles.luau +14 -1
  196. package/out/ui/packages/slider/components/sliderMarks.d.ts +1 -0
  197. package/out/ui/packages/slider/components/sliderMarks.luau +37 -0
  198. package/out/ui/packages/snackbar/components/Snackbar.d.ts +2 -0
  199. package/out/ui/packages/snackbar/components/Snackbar.luau +5 -0
  200. package/out/ui/packages/snackbar/components/snackbarAction.d.ts +1 -0
  201. package/out/ui/packages/snackbar/components/snackbarAction.luau +10 -0
  202. package/out/ui/packages/speedDial/components/SpeedDial.d.ts +19 -0
  203. package/out/ui/packages/speedDial/components/SpeedDial.luau +101 -0
  204. package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +5 -0
  205. package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +31 -0
  206. package/out/ui/packages/speedDial/index.d.ts +3 -0
  207. package/out/ui/packages/speedDial/init.luau +5 -0
  208. package/out/ui/packages/splitPane/components/SplitPane.luau +1 -1
  209. package/out/ui/packages/stateMatrix.d.ts +2 -0
  210. package/out/ui/packages/stateMatrix.luau +881 -253
  211. package/out/ui/packages/stepper/components/Stepper.d.ts +1 -0
  212. package/out/ui/packages/stepper/components/Stepper.luau +8 -2
  213. package/out/ui/packages/stepper/components/Stepper.styles.d.ts +3 -1
  214. package/out/ui/packages/stepper/components/Stepper.styles.luau +6 -2
  215. package/out/ui/packages/switch/components/Switch.d.ts +2 -0
  216. package/out/ui/packages/switch/components/Switch.luau +5 -0
  217. package/out/ui/packages/switch/components/Switch.styles.d.ts +2 -0
  218. package/out/ui/packages/switch/components/Switch.styles.luau +7 -2
  219. package/out/ui/packages/table/components/Table.d.ts +1 -0
  220. package/out/ui/packages/table/components/Table.luau +7 -4
  221. package/out/ui/packages/table/components/Table.styles.d.ts +3 -1
  222. package/out/ui/packages/table/components/Table.styles.luau +10 -6
  223. package/out/ui/packages/tabs/components/Tabs.d.ts +3 -0
  224. package/out/ui/packages/tabs/components/Tabs.luau +13 -4
  225. package/out/ui/packages/tabs/components/Tabs.styles.d.ts +5 -1
  226. package/out/ui/packages/tabs/components/Tabs.styles.luau +26 -10
  227. package/out/ui/packages/tabs/components/tabsOrientation.d.ts +2 -0
  228. package/out/ui/packages/tabs/components/tabsOrientation.luau +7 -0
  229. package/out/ui/packages/tabs/index.d.ts +1 -0
  230. package/out/ui/packages/tabs/init.luau +1 -0
  231. package/out/ui/packages/toast/components/Toast.d.ts +2 -0
  232. package/out/ui/packages/toast/components/Toast.luau +26 -1
  233. package/out/ui/packages/toast/components/Toast.styles.luau +22 -4
  234. package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +21 -0
  235. package/out/ui/packages/toggleButton/components/ToggleButton.luau +137 -0
  236. package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +9 -0
  237. package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +69 -0
  238. package/out/ui/packages/toggleButton/index.d.ts +2 -0
  239. package/out/ui/packages/toggleButton/init.luau +7 -0
  240. package/out/ui/packages/typography/components/Typography.styles.luau +4 -5
  241. package/out/ui/packages/vectorEditor/components/VectorEditor.luau +1 -1
  242. package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +6 -0
  243. package/out/ui/packages/virtualList/components/EmptyListHint.luau +32 -0
  244. package/out/ui/packages/virtualList/components/EmptyListHint.styles.d.ts +5 -0
  245. package/out/ui/packages/virtualList/components/EmptyListHint.styles.luau +26 -0
  246. package/out/ui/packages/virtualList/index.d.ts +2 -0
  247. package/out/ui/packages/virtualList/init.luau +1 -0
  248. package/package.json +2 -2
@@ -1,2 +1,7 @@
1
- declare const usePaginationStyles: () => import("../../../../theme/index").ClassNameMap<string>;
1
+ import { ControlSize } from "../../../../theme/index";
2
+ export type PaginationVariant = "text" | "outlined";
3
+ declare const usePaginationStyles: (props: {
4
+ size?: ControlSize;
5
+ variant?: PaginationVariant;
6
+ }) => import("../../../../theme/index").ClassNameMap<string>;
2
7
  export default usePaginationStyles;
@@ -3,7 +3,18 @@ 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
5
  local createStyles = _theme.createStyles
6
- local usePaginationStyles = componentStyles("Pagination", function(theme)
6
+ local usePaginationStyles = componentStyles("Pagination", function(theme, _param)
7
+ local size = _param.size
8
+ if size == nil then
9
+ size = "medium"
10
+ end
11
+ local variant = _param.variant
12
+ if variant == nil then
13
+ variant = "text"
14
+ end
15
+ local outlined = variant == "outlined"
16
+ local box = if size == "small" then theme.spacing.calc(2.5) elseif size == "large" then theme.spacing.calc(4) else theme.spacing.calc(3)
17
+ local text = if size == "small" then theme.typography.fontSizes.caption elseif size == "large" then theme.typography.fontSizes.h6 else theme.typography.fontSizes.body
7
18
  return createStyles({
8
19
  root = {
9
20
  AutomaticSize = Enum.AutomaticSize.XY,
@@ -13,20 +24,41 @@ local usePaginationStyles = componentStyles("Pagination", function(theme)
13
24
  },
14
25
  list = {
15
26
  FillDirection = Enum.FillDirection.Horizontal,
16
- Padding = UDim.new(0, theme.padding.calc(0.5)),
27
+ Padding = UDim.new(0, theme.padding.calc(if size == "small" then 0.25 else 0.5)),
17
28
  SortOrder = Enum.SortOrder.LayoutOrder,
18
29
  },
19
30
  page = {
20
- Size = UDim2.fromOffset(theme.spacing.calc(3), theme.spacing.calc(3)),
31
+ Size = UDim2.fromOffset(box, box),
21
32
  BackgroundColor3 = theme.palette.surface.input,
33
+ BackgroundTransparency = if outlined then 1 else 0,
22
34
  BorderSizePixel = 0,
23
35
  AutoButtonColor = false,
24
36
  Font = theme.typography.fontFamilies.default,
25
- TextSize = theme.typography.fontSizes.body,
37
+ TextSize = text,
26
38
  TextColor3 = theme.palette.text.primary,
27
39
  },
28
40
  selected = {
29
41
  BackgroundColor3 = theme.palette.action.selected,
42
+ BackgroundTransparency = 0,
43
+ },
44
+ stroke = {
45
+ Color = theme.palette.border,
46
+ Thickness = 1,
47
+ ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
48
+ },
49
+ selectedStroke = {
50
+ Color = theme.palette.primary.main,
51
+ Thickness = 1,
52
+ ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
53
+ },
54
+ ellipsis = {
55
+ Size = UDim2.fromOffset(box, box),
56
+ BackgroundTransparency = 1,
57
+ BorderSizePixel = 0,
58
+ Font = theme.typography.fontFamilies.default,
59
+ TextSize = text,
60
+ TextColor3 = theme.palette.text.secondary,
61
+ Text = "…",
30
62
  },
31
63
  corner = {
32
64
  CornerRadius = UDim.new(1, 0),
@@ -1 +1,2 @@
1
- export declare function pageRange(count: number): number[];
1
+ export type PageToken = number | "ellipsis";
2
+ export declare function pageRange(count: number, page?: number, siblingCount?: number, boundaryCount?: number): PageToken[];
@@ -1,23 +1,106 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
- local function pageRange(count)
3
- local pages = {}
2
+ local function pageRange(count, page, siblingCount, boundaryCount)
3
+ if page == nil then
4
+ page = 1
5
+ end
6
+ if siblingCount == nil then
7
+ siblingCount = 1
8
+ end
9
+ if boundaryCount == nil then
10
+ boundaryCount = 1
11
+ end
12
+ local total = math.max(0, math.floor(count))
13
+ if total == 0 then
14
+ return {}
15
+ end
16
+ local current = math.clamp(math.floor(page), 1, total)
17
+ local siblings = math.max(0, math.floor(siblingCount))
18
+ local boundaries = math.max(0, math.floor(boundaryCount))
19
+ local rangeLength = boundaries * 2 + siblings * 2 + 3
20
+ if total <= rangeLength then
21
+ local all = {}
22
+ do
23
+ local i = 1
24
+ local _shouldIncrement = false
25
+ while true do
26
+ if _shouldIncrement then
27
+ i += 1
28
+ else
29
+ _shouldIncrement = true
30
+ end
31
+ if not (i <= total) then
32
+ break
33
+ end
34
+ local _i = i
35
+ table.insert(all, _i)
36
+ end
37
+ end
38
+ return all
39
+ end
40
+ local startFrom = math.max(current - siblings, boundaries + 2)
41
+ local endAt = math.min(current + siblings, total - (boundaries + 1))
42
+ local tokens = {}
43
+ do
44
+ local i = 1
45
+ local _shouldIncrement = false
46
+ while true do
47
+ if _shouldIncrement then
48
+ i += 1
49
+ else
50
+ _shouldIncrement = true
51
+ end
52
+ if not (i <= boundaries) then
53
+ break
54
+ end
55
+ local _i = i
56
+ table.insert(tokens, _i)
57
+ end
58
+ end
59
+ if startFrom > boundaries + 2 then
60
+ table.insert(tokens, "ellipsis")
61
+ elseif boundaries + 1 < startFrom then
62
+ local _arg0 = boundaries + 1
63
+ table.insert(tokens, _arg0)
64
+ end
65
+ do
66
+ local i = startFrom
67
+ local _shouldIncrement = false
68
+ while true do
69
+ if _shouldIncrement then
70
+ i += 1
71
+ else
72
+ _shouldIncrement = true
73
+ end
74
+ if not (i <= endAt) then
75
+ break
76
+ end
77
+ local _i = i
78
+ table.insert(tokens, _i)
79
+ end
80
+ end
81
+ if endAt < total - (boundaries + 1) then
82
+ table.insert(tokens, "ellipsis")
83
+ elseif endAt + 1 < total - boundaries + 1 then
84
+ local _arg0 = endAt + 1
85
+ table.insert(tokens, _arg0)
86
+ end
4
87
  do
5
- local page = 1
88
+ local i = total - boundaries + 1
6
89
  local _shouldIncrement = false
7
90
  while true do
8
91
  if _shouldIncrement then
9
- page += 1
92
+ i += 1
10
93
  else
11
94
  _shouldIncrement = true
12
95
  end
13
- if not (page <= math.max(0, math.floor(count))) then
96
+ if not (i <= total) then
14
97
  break
15
98
  end
16
- local _page = page
17
- table.insert(pages, _page)
99
+ local _i = i
100
+ table.insert(tokens, _i)
18
101
  end
19
102
  end
20
- return pages
103
+ return tokens
21
104
  end
22
105
  return {
23
106
  pageRange = pageRange,
@@ -1,2 +1,3 @@
1
1
  export { default as Pagination } from "./components/Pagination";
2
2
  export { PaginationProps } from "./components/Pagination";
3
+ export { pageRange, PageToken } from "./components/pageRange";
@@ -2,4 +2,5 @@
2
2
  local TS = _G[script]
3
3
  local exports = {}
4
4
  exports.Pagination = TS.import(script, script, "components", "Pagination").default
5
+ exports.pageRange = TS.import(script, script, "components", "pageRange").pageRange
5
6
  return exports
@@ -1,7 +1,8 @@
1
1
  import React from "@rbxts/react";
2
- export type PaperElevation = "flat" | "raised";
2
+ export type PaperElevation = "flat" | "raised" | "outlined";
3
3
  export interface PaperProps {
4
4
  elevation?: PaperElevation;
5
+ square?: boolean;
5
6
  children?: React.ReactNode;
6
7
  }
7
8
  declare function Paper(props: PaperProps): JSX.Element;
@@ -8,6 +8,7 @@ local function Paper(props)
8
8
  if elevation == nil then
9
9
  elevation = "flat"
10
10
  end
11
+ local square = _binding.square
11
12
  local children = _binding.children
12
13
  local styles = usePaperStyles({
13
14
  elevation = elevation,
@@ -21,9 +22,19 @@ local function Paper(props)
21
22
  local _attributes_1 = table.clone(styles.padding)
22
23
  setmetatable(_attributes_1, nil)
23
24
  local _exp = React.createElement("uipadding", _attributes_1)
24
- local _attributes_2 = table.clone(styles.corner)
25
- setmetatable(_attributes_2, nil)
26
- return React.createElement("frame", _attributes, _exp, React.createElement("uicorner", _attributes_2), children)
25
+ local _condition = square ~= true
26
+ if _condition then
27
+ local _attributes_2 = table.clone(styles.corner)
28
+ setmetatable(_attributes_2, nil)
29
+ _condition = React.createElement("uicorner", _attributes_2)
30
+ end
31
+ local _condition_1 = elevation == "outlined"
32
+ if _condition_1 then
33
+ local _attributes_2 = table.clone(styles.stroke)
34
+ setmetatable(_attributes_2, nil)
35
+ _condition_1 = React.createElement("uistroke", _attributes_2)
36
+ end
37
+ return React.createElement("frame", _attributes, _exp, _condition, _condition_1, children)
27
38
  end
28
39
  local default = Paper
29
40
  return {
@@ -1,4 +1,4 @@
1
1
  declare const usePaperStyles: (props: {
2
- elevation?: "flat" | "raised";
2
+ elevation?: "flat" | "raised" | "outlined";
3
3
  }) => import("../../../../theme/index").ClassNameMap<string>;
4
4
  export default usePaperStyles;
@@ -15,6 +15,12 @@ local usePaperStyles = componentStyles("Paper", function(theme, _param)
15
15
  BackgroundColor3 = if elevation == "raised" then theme.palette.surface.elevated else theme.palette.surface.paper,
16
16
  BorderSizePixel = 0,
17
17
  },
18
+ stroke = {
19
+ Color = theme.palette.border,
20
+ ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
21
+ Thickness = 1,
22
+ Transparency = 0,
23
+ },
18
24
  padding = {
19
25
  PaddingTop = UDim.new(0, theme.padding.calc(2)),
20
26
  PaddingBottom = UDim.new(0, theme.padding.calc(2)),
@@ -77,7 +77,7 @@ local function PhysicalPropertiesEditor(props)
77
77
  _newValue[_k] = _callback(_v, _k - 1, _exp_1)
78
78
  end
79
79
  -- ▲ ReadonlyArray.map ▲
80
- return React.createElement("frame", _attributes, _exp, _newValue)
80
+ return React.createElement("frame", _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
81
81
  end
82
82
  local default = PhysicalPropertiesEditor
83
83
  return {
@@ -2,3 +2,4 @@ export { default as Popup } from "./components/Popup";
2
2
  export { PopupProps } from "./components/Popup";
3
3
  export { default as Portal } from "./components/Portal";
4
4
  export { PortalProps } from "./components/Portal";
5
+ export { portalTarget } from "./components/portalTarget";
@@ -3,4 +3,5 @@ local TS = _G[script]
3
3
  local exports = {}
4
4
  exports.Popup = TS.import(script, script, "components", "Popup").default
5
5
  exports.Portal = TS.import(script, script, "components", "Portal").default
6
+ exports.portalTarget = TS.import(script, script, "components", "portalTarget").portalTarget
6
7
  return exports
@@ -11,6 +11,7 @@ export interface RadioGroupProps<T> {
11
11
  onChange: (value: T) => void;
12
12
  disabled?: boolean;
13
13
  size?: ControlSize;
14
+ row?: boolean;
14
15
  }
15
16
  declare function RadioGroup<T>(props: CustomizedProps<Frame, RadioGroupProps<T>>): JSX.Element;
16
17
  export default RadioGroup;
@@ -10,17 +10,19 @@ local function RadioGroup(props)
10
10
  local onChange = _binding.onChange
11
11
  local disabled = _binding.disabled
12
12
  local size = _binding.size
13
+ local row = _binding.row
13
14
  local className = _binding.className
14
15
  local sx = _binding.sx
15
16
  local id = _binding.id
16
17
  local ref = _binding.ref
17
18
  local _binding_1 = useRadioGroupStyles({
18
19
  size = size,
20
+ row = row,
19
21
  })
20
22
  local root = _binding_1.root
21
23
  local list = _binding_1.list
22
24
  local option = _binding_1.option
23
- local row = _binding_1.row
25
+ local optionRow = _binding_1.optionRow
24
26
  local ring = _binding_1.ring
25
27
  local dot = _binding_1.dot
26
28
  local stroke = _binding_1.stroke
@@ -70,7 +72,7 @@ local function RadioGroup(props)
70
72
  end
71
73
  end,
72
74
  }
73
- local _attributes_3 = table.clone(row)
75
+ local _attributes_3 = table.clone(optionRow)
74
76
  setmetatable(_attributes_3, nil)
75
77
  local _exp_1 = React.createElement("uilistlayout", _attributes_3)
76
78
  local _attributes_4 = table.clone(ring)
@@ -104,7 +106,7 @@ local function RadioGroup(props)
104
106
  _newValue[_k] = _callback(_v, _k - 1, options)
105
107
  end
106
108
  -- ▲ ReadonlyArray.map ▲
107
- return React.createElement("frame", _attributes, _exp, _newValue)
109
+ return React.createElement("frame", _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
108
110
  end
109
111
  local default = RadioGroup
110
112
  return {
@@ -1,6 +1,7 @@
1
1
  import { ControlSize } from "../../../../theme/index";
2
2
  export interface RadioGroupStyleProps {
3
3
  size?: ControlSize;
4
+ row?: boolean;
4
5
  }
5
6
  declare const useRadioGroupStyles: (props: RadioGroupStyleProps) => import("../../../../theme/index").ClassNameMap<string>;
6
7
  export default useRadioGroupStyles;
@@ -6,6 +6,7 @@ local createStyles = _theme.createStyles
6
6
  local componentStyles = _theme.componentStyles
7
7
  local useRadioGroupStyles = componentStyles("RadioGroup", function(theme, _param)
8
8
  local size = _param.size
9
+ local row = _param.row
9
10
  local metrics = controlMetrics(theme.density, size)
10
11
  return createStyles({
11
12
  root = {
@@ -15,8 +16,10 @@ local useRadioGroupStyles = componentStyles("RadioGroup", function(theme, _param
15
16
  BorderSizePixel = 0,
16
17
  },
17
18
  list = {
19
+ FillDirection = if row == true then Enum.FillDirection.Horizontal else Enum.FillDirection.Vertical,
18
20
  Padding = UDim.new(0, theme.padding.default),
19
21
  SortOrder = Enum.SortOrder.LayoutOrder,
22
+ VerticalAlignment = Enum.VerticalAlignment.Center,
20
23
  },
21
24
  option = {
22
25
  AutomaticSize = Enum.AutomaticSize.XY,
@@ -25,7 +28,7 @@ local useRadioGroupStyles = componentStyles("RadioGroup", function(theme, _param
25
28
  BorderSizePixel = 0,
26
29
  Text = "",
27
30
  },
28
- row = {
31
+ optionRow = {
29
32
  FillDirection = Enum.FillDirection.Horizontal,
30
33
  Padding = UDim.new(0, theme.padding.default),
31
34
  VerticalAlignment = Enum.VerticalAlignment.Center,
@@ -0,0 +1,11 @@
1
+ import { ControlSize, CustomizedProps } from "../../../../theme/index";
2
+ export interface RatingProps {
3
+ value: number;
4
+ max?: number;
5
+ size?: ControlSize;
6
+ disabled?: boolean;
7
+ readOnly?: boolean;
8
+ onChange: (value: number) => void;
9
+ }
10
+ declare function Rating(props: CustomizedProps<Frame, RatingProps>): JSX.Element;
11
+ export default Rating;
@@ -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, React.createElement(React.Fragment, nil, _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
@@ -77,7 +77,7 @@ local function RectEditor(props)
77
77
  _newValue[_k] = _callback(_v, _k - 1, _exp_1)
78
78
  end
79
79
  -- ▲ ReadonlyArray.map ▲
80
- return React.createElement("frame", _attributes, _exp, _newValue)
80
+ return React.createElement("frame", _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
81
81
  end
82
82
  local default = RectEditor
83
83
  return {
@@ -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
  }