@rbxts/uiblox 0.2.0-alpha.1 → 0.2.0-alpha.10

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 (190) hide show
  1. package/README.md +11 -8
  2. package/out/theme/constants/NumberConstants.d.ts +3 -1
  3. package/out/theme/constants/NumberConstants.luau +3 -0
  4. package/out/theme/context/ThemeProvider.d.ts +1 -1
  5. package/out/theme/hooks/useTheme.d.ts +1 -1
  6. package/out/theme/interfaces/palette/colorTokens/ColorTokens.d.ts +1 -1
  7. package/out/theme/interfaces/spacing/Shape.d.ts +3 -0
  8. package/out/theme/interfaces/typography/FontSizes.d.ts +1 -1
  9. package/out/theme/interfaces/typography/FontSizes.luau +15 -8
  10. package/out/theme/interfaces/typography/ThemeTypography.d.ts +3 -0
  11. package/out/theme/interfaces/typography/Variants.d.ts +14 -15
  12. package/out/theme/interfaces/typography/Variants.luau +68 -18
  13. package/out/theme/themes/DarkTheme.luau +4 -0
  14. package/out/theme/themes/LightTheme.luau +4 -0
  15. package/out/theme/types/types.d.ts +1 -1
  16. package/out/ui/packages/accordion/components/Accordion.d.ts +1 -0
  17. package/out/ui/packages/accordion/components/Accordion.luau +5 -0
  18. package/out/ui/packages/accordion/components/Accordion.styles.d.ts +1 -0
  19. package/out/ui/packages/accordion/components/Accordion.styles.luau +4 -2
  20. package/out/ui/packages/alert/components/Alert.d.ts +10 -0
  21. package/out/ui/packages/alert/components/Alert.luau +98 -0
  22. package/out/ui/packages/alert/components/Alert.styles.d.ts +6 -0
  23. package/out/ui/packages/alert/components/Alert.styles.luau +93 -0
  24. package/out/ui/packages/alert/components/alertTone.d.ts +2 -0
  25. package/out/ui/packages/alert/components/alertTone.luau +7 -0
  26. package/out/ui/packages/alert/index.d.ts +3 -0
  27. package/out/ui/packages/alert/init.luau +6 -0
  28. package/out/ui/packages/autocomplete/components/Autocomplete.luau +8 -0
  29. package/out/ui/packages/backdrop/components/Backdrop.d.ts +10 -0
  30. package/out/ui/packages/backdrop/components/Backdrop.luau +58 -0
  31. package/out/ui/packages/backdrop/components/Backdrop.styles.d.ts +4 -0
  32. package/out/ui/packages/backdrop/components/Backdrop.styles.luau +24 -0
  33. package/out/ui/packages/backdrop/index.d.ts +2 -0
  34. package/out/ui/packages/backdrop/init.luau +5 -0
  35. package/out/ui/packages/badge/components/Badge.styles.luau +6 -3
  36. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +1 -0
  37. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +58 -24
  38. package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +9 -0
  39. package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +68 -0
  40. package/out/ui/packages/breadcrumbs/index.d.ts +1 -0
  41. package/out/ui/packages/breadcrumbs/init.luau +3 -0
  42. package/out/ui/packages/brickColorPicker/components/brickColorCatalog.luau +1 -1
  43. package/out/ui/packages/button/components/Button.luau +9 -5
  44. package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
  45. package/out/ui/packages/chip/components/Chip.d.ts +3 -1
  46. package/out/ui/packages/chip/components/Chip.luau +39 -2
  47. package/out/ui/packages/chip/components/Chip.styles.d.ts +3 -0
  48. package/out/ui/packages/chip/components/Chip.styles.luau +40 -6
  49. package/out/ui/packages/circularProgress/components/CircularProgress.luau +13 -2
  50. package/out/ui/packages/dialog/components/Dialog.d.ts +1 -1
  51. package/out/ui/packages/dialog/components/Dialog.luau +27 -18
  52. package/out/ui/packages/fab/components/Fab.d.ts +1 -0
  53. package/out/ui/packages/fab/components/Fab.luau +57 -25
  54. package/out/ui/packages/fab/components/Fab.styles.d.ts +1 -0
  55. package/out/ui/packages/fab/components/Fab.styles.luau +26 -1
  56. package/out/ui/packages/fab/components/fabSize.d.ts +1 -0
  57. package/out/ui/packages/fab/components/fabSize.luau +4 -0
  58. package/out/ui/packages/fab/index.d.ts +1 -1
  59. package/out/ui/packages/fab/init.luau +1 -0
  60. package/out/ui/packages/formText/components/FormHelperText.d.ts +8 -0
  61. package/out/ui/packages/formText/components/FormHelperText.luau +44 -0
  62. package/out/ui/packages/formText/components/FormLabel.d.ts +9 -0
  63. package/out/ui/packages/formText/components/FormLabel.luau +46 -0
  64. package/out/ui/packages/formText/components/FormText.styles.d.ts +5 -0
  65. package/out/ui/packages/formText/components/FormText.styles.luau +33 -0
  66. package/out/ui/packages/formText/index.d.ts +4 -0
  67. package/out/ui/packages/formText/init.luau +6 -0
  68. package/out/ui/packages/iconButton/components/IconButton.luau +7 -2
  69. package/out/ui/packages/iconButton/components/IconButton.styles.luau +3 -0
  70. package/out/ui/packages/imageList/components/ImageList.d.ts +14 -0
  71. package/out/ui/packages/imageList/components/ImageList.luau +84 -0
  72. package/out/ui/packages/imageList/components/ImageList.styles.d.ts +6 -0
  73. package/out/ui/packages/imageList/components/ImageList.styles.luau +54 -0
  74. package/out/ui/packages/imageList/components/imageListLayout.d.ts +3 -0
  75. package/out/ui/packages/imageList/components/imageListLayout.luau +24 -0
  76. package/out/ui/packages/imageList/index.d.ts +2 -0
  77. package/out/ui/packages/imageList/init.luau +5 -0
  78. package/out/ui/packages/index.d.ts +8 -0
  79. package/out/ui/packages/init.luau +24 -0
  80. package/out/ui/packages/input/components/Input.luau +1 -1
  81. package/out/ui/packages/layout/components/Box.d.ts +11 -0
  82. package/out/ui/packages/layout/components/Box.luau +49 -0
  83. package/out/ui/packages/layout/components/Box.styles.d.ts +7 -0
  84. package/out/ui/packages/layout/components/Box.styles.luau +34 -0
  85. package/out/ui/packages/layout/components/Container.d.ts +10 -0
  86. package/out/ui/packages/layout/components/Container.luau +54 -0
  87. package/out/ui/packages/layout/components/Container.styles.d.ts +6 -0
  88. package/out/ui/packages/layout/components/Container.styles.luau +41 -0
  89. package/out/ui/packages/layout/components/Grid.d.ts +1 -1
  90. package/out/ui/packages/layout/components/Stack.d.ts +12 -0
  91. package/out/ui/packages/layout/components/Stack.luau +49 -0
  92. package/out/ui/packages/layout/components/Stack.styles.d.ts +8 -0
  93. package/out/ui/packages/layout/components/Stack.styles.luau +72 -0
  94. package/out/ui/packages/layout/components/boxPad.d.ts +14 -0
  95. package/out/ui/packages/layout/components/boxPad.luau +59 -0
  96. package/out/ui/packages/layout/components/containerWidth.d.ts +2 -0
  97. package/out/ui/packages/layout/components/containerWidth.luau +17 -0
  98. package/out/ui/packages/layout/components/stackAlign.d.ts +8 -0
  99. package/out/ui/packages/layout/components/stackAlign.luau +29 -0
  100. package/out/ui/packages/layout/index.d.ts +10 -0
  101. package/out/ui/packages/layout/init.luau +4 -0
  102. package/out/ui/packages/link/components/Link.d.ts +11 -0
  103. package/out/ui/packages/link/components/Link.luau +83 -0
  104. package/out/ui/packages/link/components/Link.styles.d.ts +8 -0
  105. package/out/ui/packages/link/components/Link.styles.luau +59 -0
  106. package/out/ui/packages/link/index.d.ts +3 -0
  107. package/out/ui/packages/link/init.luau +5 -0
  108. package/out/ui/packages/listItem/components/ListItem.d.ts +1 -0
  109. package/out/ui/packages/listItem/components/ListItem.luau +5 -0
  110. package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
  111. package/out/ui/packages/listItem/components/ListItem.styles.luau +10 -5
  112. package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +2 -0
  113. package/out/ui/packages/loadingStroke/components/LoadingStroke.luau +23 -19
  114. package/out/ui/packages/menu/components/Menu.d.ts +3 -0
  115. package/out/ui/packages/menu/components/Menu.luau +48 -23
  116. package/out/ui/packages/menu/components/Menu.styles.luau +5 -1
  117. package/out/ui/packages/modal/components/Modal.d.ts +1 -1
  118. package/out/ui/packages/modal/components/Modal.luau +55 -37
  119. package/out/ui/packages/motion/index.d.ts +1 -1
  120. package/out/ui/packages/motion/init.luau +1 -0
  121. package/out/ui/packages/motion/unit.d.ts +5 -0
  122. package/out/ui/packages/motion/unit.luau +23 -0
  123. package/out/ui/packages/pagination/components/Pagination.d.ts +2 -0
  124. package/out/ui/packages/pagination/components/Pagination.luau +37 -21
  125. package/out/ui/packages/pagination/components/Pagination.styles.luau +9 -0
  126. package/out/ui/packages/pagination/components/pageRange.d.ts +2 -1
  127. package/out/ui/packages/pagination/components/pageRange.luau +91 -8
  128. package/out/ui/packages/pagination/index.d.ts +1 -0
  129. package/out/ui/packages/pagination/init.luau +1 -0
  130. package/out/ui/packages/paper/components/Paper.d.ts +1 -0
  131. package/out/ui/packages/paper/components/Paper.luau +8 -3
  132. package/out/ui/packages/popup/index.d.ts +1 -0
  133. package/out/ui/packages/popup/init.luau +1 -0
  134. package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +1 -0
  135. package/out/ui/packages/radioGroup/components/RadioGroup.luau +4 -2
  136. package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +1 -0
  137. package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +4 -1
  138. package/out/ui/packages/rating/components/Rating.d.ts +9 -0
  139. package/out/ui/packages/rating/components/Rating.luau +95 -0
  140. package/out/ui/packages/rating/components/Rating.styles.d.ts +4 -0
  141. package/out/ui/packages/rating/components/Rating.styles.luau +39 -0
  142. package/out/ui/packages/rating/index.d.ts +2 -0
  143. package/out/ui/packages/rating/init.luau +5 -0
  144. package/out/ui/packages/select/components/Select.d.ts +5 -0
  145. package/out/ui/packages/select/components/Select.luau +48 -24
  146. package/out/ui/packages/select/components/Select.styles.luau +1 -1
  147. package/out/ui/packages/skeleton/components/Skeleton.luau +3 -2
  148. package/out/ui/packages/skeleton/components/Skeleton.styles.luau +7 -2
  149. package/out/ui/packages/skeleton/components/skeletonMotion.luau +1 -1
  150. package/out/ui/packages/skeleton/components/skeletonTone.d.ts +20 -0
  151. package/out/ui/packages/skeleton/components/skeletonTone.luau +14 -0
  152. package/out/ui/packages/slider/components/Slider.d.ts +1 -0
  153. package/out/ui/packages/slider/components/Slider.luau +24 -1
  154. package/out/ui/packages/slider/components/Slider.styles.luau +8 -0
  155. package/out/ui/packages/slider/components/sliderMarks.d.ts +1 -0
  156. package/out/ui/packages/slider/components/sliderMarks.luau +37 -0
  157. package/out/ui/packages/speedDial/components/SpeedDial.d.ts +17 -0
  158. package/out/ui/packages/speedDial/components/SpeedDial.luau +92 -0
  159. package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +2 -0
  160. package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +26 -0
  161. package/out/ui/packages/speedDial/index.d.ts +2 -0
  162. package/out/ui/packages/speedDial/init.luau +5 -0
  163. package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
  164. package/out/ui/packages/stateMatrix.d.ts +2 -0
  165. package/out/ui/packages/stateMatrix.luau +1843 -1437
  166. package/out/ui/packages/switch/components/Switch.styles.luau +1 -1
  167. package/out/ui/packages/switch/components/switchLook.d.ts +3 -3
  168. package/out/ui/packages/tabs/components/Tabs.d.ts +2 -0
  169. package/out/ui/packages/tabs/components/Tabs.luau +10 -3
  170. package/out/ui/packages/tabs/components/Tabs.styles.d.ts +4 -1
  171. package/out/ui/packages/tabs/components/Tabs.styles.luau +24 -10
  172. package/out/ui/packages/tabs/components/tabsOrientation.d.ts +2 -0
  173. package/out/ui/packages/tabs/components/tabsOrientation.luau +7 -0
  174. package/out/ui/packages/tabs/index.d.ts +1 -0
  175. package/out/ui/packages/tabs/init.luau +1 -0
  176. package/out/ui/packages/toast/components/Toast.styles.luau +1 -1
  177. package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +17 -0
  178. package/out/ui/packages/toggleButton/components/ToggleButton.luau +126 -0
  179. package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +5 -0
  180. package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +58 -0
  181. package/out/ui/packages/toggleButton/index.d.ts +2 -0
  182. package/out/ui/packages/toggleButton/init.luau +7 -0
  183. package/out/ui/packages/typography/components/Typography.styles.luau +4 -5
  184. package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +6 -0
  185. package/out/ui/packages/virtualList/components/EmptyListHint.luau +32 -0
  186. package/out/ui/packages/virtualList/components/EmptyListHint.styles.d.ts +5 -0
  187. package/out/ui/packages/virtualList/components/EmptyListHint.styles.luau +26 -0
  188. package/out/ui/packages/virtualList/index.d.ts +2 -0
  189. package/out/ui/packages/virtualList/init.luau +1 -0
  190. package/package.json +2 -2
@@ -0,0 +1,58 @@
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 useBackdropStyles = TS.import(script, script.Parent, "Backdrop.styles").default
5
+ local function Backdrop(props)
6
+ local _binding = props
7
+ local open = _binding.open
8
+ if open == nil then
9
+ open = true
10
+ end
11
+ local invisible = _binding.invisible
12
+ local onClick = _binding.onClick
13
+ local children = _binding.children
14
+ local className = _binding.className
15
+ local sx = _binding.sx
16
+ local id = _binding.id
17
+ local ref = _binding.ref
18
+ local styles = useBackdropStyles({
19
+ invisible = invisible,
20
+ })
21
+ if open ~= true then
22
+ return nil
23
+ end
24
+ local _attributes = {}
25
+ local _condition = id
26
+ if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
27
+ _condition = "Backdrop"
28
+ end
29
+ _attributes.key = _condition
30
+ _attributes.ref = ref
31
+ for _k, _v in styles.root do
32
+ _attributes[_k] = _v
33
+ end
34
+ if className then
35
+ for _k, _v in className do
36
+ _attributes[_k] = _v
37
+ end
38
+ end
39
+ if sx then
40
+ for _k, _v in sx do
41
+ _attributes[_k] = _v
42
+ end
43
+ end
44
+ _attributes.Event = {
45
+ Activated = function()
46
+ local _result = onClick
47
+ if _result ~= nil then
48
+ _result = _result()
49
+ end
50
+ return _result
51
+ end,
52
+ }
53
+ return React.createElement("textbutton", _attributes, children)
54
+ end
55
+ local default = Backdrop
56
+ return {
57
+ default = default,
58
+ }
@@ -0,0 +1,4 @@
1
+ declare const useBackdropStyles: (props: {
2
+ invisible?: boolean;
3
+ }) => import("../../../../theme/index").ClassNameMap<string>;
4
+ export default useBackdropStyles;
@@ -0,0 +1,24 @@
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 useBackdropStyles = componentStyles("Backdrop", function(theme, _param)
7
+ local invisible = _param.invisible
8
+ return createStyles({
9
+ root = {
10
+ Size = UDim2.fromScale(1, 1),
11
+ BackgroundColor3 = theme.palette.backdrop,
12
+ BackgroundTransparency = if invisible == true then 1 else 0.45,
13
+ BorderSizePixel = 0,
14
+ Text = "",
15
+ AutoButtonColor = false,
16
+ Selectable = false,
17
+ ZIndex = 30000,
18
+ },
19
+ })
20
+ end)
21
+ local default = useBackdropStyles
22
+ return {
23
+ default = default,
24
+ }
@@ -0,0 +1,2 @@
1
+ export { default as Backdrop } from "./components/Backdrop";
2
+ export { BackdropProps } from "./components/Backdrop";
@@ -0,0 +1,5 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ exports.Backdrop = TS.import(script, script, "components", "Backdrop").default
5
+ return exports
@@ -4,6 +4,7 @@ local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "the
4
4
  local componentStyles = _theme.componentStyles
5
5
  local createStyles = _theme.createStyles
6
6
  local useBadgeStyles = componentStyles("Badge", function(theme)
7
+ local diameter = theme.spacing.calc(2) + theme.padding.calc(1)
7
8
  return createStyles({
8
9
  root = {
9
10
  AutomaticSize = Enum.AutomaticSize.XY,
@@ -14,13 +15,15 @@ local useBadgeStyles = componentStyles("Badge", function(theme)
14
15
  badge = {
15
16
  AnchorPoint = Vector2.new(0.5, 0.5),
16
17
  Position = UDim2.fromScale(1, 0),
17
- AutomaticSize = Enum.AutomaticSize.XY,
18
- Size = UDim2.fromOffset(theme.padding.calc(2), theme.padding.calc(2)),
18
+ AutomaticSize = Enum.AutomaticSize.X,
19
+ Size = UDim2.fromOffset(diameter, diameter),
19
20
  BackgroundColor3 = theme.palette.status.error.main,
20
21
  BorderSizePixel = 0,
21
22
  Font = theme.typography.fontFamilies.default,
22
23
  TextSize = theme.typography.fontSizes.caption,
23
24
  TextColor3 = theme.palette.text.inverse,
25
+ TextXAlignment = Enum.TextXAlignment.Center,
26
+ TextYAlignment = Enum.TextYAlignment.Center,
24
27
  ZIndex = 2,
25
28
  },
26
29
  padding = {
@@ -28,7 +31,7 @@ local useBadgeStyles = componentStyles("Badge", function(theme)
28
31
  PaddingRight = UDim.new(0, theme.padding.calc(0.5)),
29
32
  },
30
33
  corner = {
31
- CornerRadius = UDim.new(1, 0),
34
+ CornerRadius = UDim.new(0.5, 0),
32
35
  },
33
36
  })
34
37
  end)
@@ -6,6 +6,7 @@ export interface BreadcrumbItem {
6
6
  export interface BreadcrumbsProps {
7
7
  items: BreadcrumbItem[];
8
8
  separator?: string;
9
+ maxItems?: number;
9
10
  }
10
11
  declare function Breadcrumbs(props: CustomizedProps<Frame, BreadcrumbsProps>): JSX.Element;
11
12
  export default Breadcrumbs;
@@ -2,7 +2,9 @@
2
2
  local TS = _G[script]
3
3
  local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
4
  local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
5
- local breadcrumbCurrent = TS.import(script, script.Parent, "breadcrumbItems").breadcrumbCurrent
5
+ local _breadcrumbItems = TS.import(script, script.Parent, "breadcrumbItems")
6
+ local breadcrumbCurrent = _breadcrumbItems.breadcrumbCurrent
7
+ local breadcrumbVisible = _breadcrumbItems.breadcrumbVisible
6
8
  local useBreadcrumbStyles = TS.import(script, script.Parent, "Breadcrumbs.styles").default
7
9
  local function Breadcrumbs(props)
8
10
  local _binding = props
@@ -11,11 +13,13 @@ local function Breadcrumbs(props)
11
13
  if separator == nil then
12
14
  separator = "/"
13
15
  end
16
+ local maxItems = _binding.maxItems
14
17
  local className = _binding.className
15
18
  local sx = _binding.sx
16
19
  local id = _binding.id
17
20
  local ref = _binding.ref
18
21
  local styles = useBreadcrumbStyles()
22
+ local visible = breadcrumbVisible(items, maxItems)
19
23
  local _attributes = {}
20
24
  local _condition = id
21
25
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
@@ -40,38 +44,68 @@ local function Breadcrumbs(props)
40
44
  setmetatable(_attributes_1, nil)
41
45
  local _exp = React.createElement("uilistlayout", _attributes_1)
42
46
  -- ▼ ReadonlyArray.map ▼
43
- local _newValue = table.create(#items)
44
- local _callback = function(item, index)
45
- local current = breadcrumbCurrent(index, #items)
46
- local _condition_1 = index > 0
47
+ local _newValue = table.create(#visible)
48
+ local _callback = function(entry, order)
49
+ local current = not entry.ellipsis and breadcrumbCurrent(entry.index, #items)
50
+ local item = if entry.ellipsis then nil else items[entry.index + 1]
51
+ local _condition_1 = order > 0
47
52
  if _condition_1 then
48
53
  local _attributes_2 = table.clone(styles.separator)
49
54
  setmetatable(_attributes_2, nil)
50
55
  _attributes_2.Text = separator
51
- _attributes_2.LayoutOrder = index * 2
56
+ _attributes_2.LayoutOrder = order * 2
52
57
  _condition_1 = React.createElement("textlabel", _attributes_2)
53
58
  end
54
- local _attributes_2 = table.clone(cx(styles.item, current and styles.current))
55
- setmetatable(_attributes_2, nil)
56
- _attributes_2.Text = item.label
57
- _attributes_2.LayoutOrder = index * 2 + 1
58
- _attributes_2.Active = not current and item.onActivated ~= nil
59
- _attributes_2.Selectable = not current and item.onActivated ~= nil
60
- _attributes_2.Event = {
61
- Activated = function()
62
- local _result = item.onActivated
63
- if _result ~= nil then
64
- _result = _result()
59
+ local _result
60
+ if entry.ellipsis then
61
+ local _attributes_2 = table.clone(styles.separator)
62
+ setmetatable(_attributes_2, nil)
63
+ _attributes_2.Text = "…"
64
+ _attributes_2.LayoutOrder = order * 2 + 1
65
+ _result = (React.createElement("textlabel", _attributes_2))
66
+ else
67
+ local _attributes_2 = table.clone(cx(styles.item, current and styles.current))
68
+ setmetatable(_attributes_2, nil)
69
+ _attributes_2.Text = entry.label
70
+ _attributes_2.LayoutOrder = order * 2 + 1
71
+ local _condition_2 = not current
72
+ if _condition_2 then
73
+ local _result_1 = item
74
+ if _result_1 ~= nil then
75
+ _result_1 = _result_1.onActivated
65
76
  end
66
- return _result
67
- end,
68
- }
77
+ _condition_2 = _result_1 ~= nil
78
+ end
79
+ _attributes_2.Active = _condition_2
80
+ local _condition_3 = not current
81
+ if _condition_3 then
82
+ local _result_1 = item
83
+ if _result_1 ~= nil then
84
+ _result_1 = _result_1.onActivated
85
+ end
86
+ _condition_3 = _result_1 ~= nil
87
+ end
88
+ _attributes_2.Selectable = _condition_3
89
+ _attributes_2.Event = {
90
+ Activated = function()
91
+ local _result_1 = item
92
+ if _result_1 ~= nil then
93
+ _result_1 = _result_1.onActivated
94
+ if _result_1 ~= nil then
95
+ _result_1 = _result_1()
96
+ end
97
+ end
98
+ return _result_1
99
+ end,
100
+ }
101
+ _result = (React.createElement("textbutton", _attributes_2))
102
+ end
69
103
  return React.createElement(React.Fragment, {
70
- key = `{item.label}-{index}`,
71
- }, _condition_1, React.createElement("textbutton", _attributes_2))
104
+ key = `{entry.label}-{order}`,
105
+ }, _condition_1, _result)
72
106
  end
73
- for _k, _v in items do
74
- _newValue[_k] = _callback(_v, _k - 1, items)
107
+ for _k, _v in visible do
108
+ _newValue[_k] = _callback(_v, _k - 1, visible)
75
109
  end
76
110
  -- ▲ ReadonlyArray.map ▲
77
111
  return React.createElement("frame", _attributes, _exp, _newValue)
@@ -1 +1,10 @@
1
1
  export declare function breadcrumbCurrent(index: number, count: number): boolean;
2
+ export interface BreadcrumbSlice {
3
+ label: string;
4
+ index: number;
5
+ ellipsis?: boolean;
6
+ }
7
+ /** Collapse middle items when over maxItems (keep ends). */
8
+ export declare function breadcrumbVisible<T extends {
9
+ label: string;
10
+ }>(items: T[], maxItems?: number): BreadcrumbSlice[];
@@ -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
@@ -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.45 | 0 | 0.25 | 0.55 | 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,11 @@
1
- import { CustomizedProps } from "../../../../theme/index";
1
+ import { ControlSize, CustomizedProps } from "../../../../theme/index";
2
2
  export interface ChipProps {
3
3
  label: string;
4
4
  selected?: boolean;
5
5
  disabled?: boolean;
6
+ size?: ControlSize;
6
7
  onActivated?: () => void;
8
+ onDelete?: () => void;
7
9
  }
8
10
  declare function Chip(props: CustomizedProps<TextButton, ChipProps>): JSX.Element;
9
11
  export default Chip;
@@ -1,20 +1,26 @@
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
10
12
  local onActivated = _binding.onActivated
13
+ local onDelete = _binding.onDelete
11
14
  local className = _binding.className
12
15
  local sx = _binding.sx
13
16
  local id = _binding.id
14
17
  local ref = _binding.ref
18
+ local deletable = onDelete ~= nil
15
19
  local styles = useChipStyles({
16
20
  selected = selected,
17
21
  disabled = disabled,
22
+ deletable = deletable,
23
+ size = size,
18
24
  })
19
25
  local _attributes = {}
20
26
  local _condition = id
@@ -36,7 +42,7 @@ local function Chip(props)
36
42
  _attributes[_k] = _v
37
43
  end
38
44
  end
39
- _attributes.Text = label
45
+ _attributes.Text = if deletable then "" else label
40
46
  _attributes.Event = {
41
47
  Activated = function()
42
48
  if disabled ~= true then
@@ -55,7 +61,38 @@ local function Chip(props)
55
61
  local _exp_1 = React.createElement("uicorner", _attributes_2)
56
62
  local _attributes_3 = table.clone(styles.stroke)
57
63
  setmetatable(_attributes_3, nil)
58
- return React.createElement("textbutton", _attributes, _exp, _exp_1, React.createElement("uistroke", _attributes_3))
64
+ local _exp_2 = React.createElement("uistroke", _attributes_3)
65
+ local _condition_1 = deletable
66
+ if _condition_1 then
67
+ local _attributes_4 = table.clone(styles.row)
68
+ setmetatable(_attributes_4, nil)
69
+ local _exp_3 = React.createElement("uilistlayout", _attributes_4)
70
+ local _attributes_5 = {
71
+ key = "Label",
72
+ }
73
+ for _k, _v in styles.label do
74
+ _attributes_5[_k] = _v
75
+ end
76
+ _attributes_5.Text = label
77
+ local _exp_4 = React.createElement("textlabel", _attributes_5)
78
+ local _attributes_6 = {
79
+ key = "Delete",
80
+ }
81
+ for _k, _v in styles.delete do
82
+ _attributes_6[_k] = _v
83
+ end
84
+ _attributes_6.Image = tostring(Icons.Close)
85
+ _attributes_6.Active = disabled ~= true
86
+ _attributes_6.Event = {
87
+ Activated = function()
88
+ if disabled ~= true then
89
+ onDelete()
90
+ end
91
+ end,
92
+ }
93
+ _condition_1 = (React.createElement(React.Fragment, nil, _exp_3, _exp_4, React.createElement("imagebutton", _attributes_6)))
94
+ end
95
+ return React.createElement("textbutton", _attributes, _exp, _exp_1, _exp_2, _condition_1)
59
96
  end
60
97
  local default = Chip
61
98
  return {
@@ -1,5 +1,8 @@
1
+ import { ControlSize } from "../../../../theme/index";
1
2
  declare const useChipStyles: (props: {
2
3
  selected?: boolean;
3
4
  disabled?: boolean;
5
+ deletable?: boolean;
6
+ size?: ControlSize;
4
7
  }) => import("../../../../theme/index").ClassNameMap<string>;
5
8
  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,6 +13,15 @@ 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 metrics = controlMetrics(theme.density, size)
22
+ local padY = if size == "small" then 0.25 elseif size == "large" then 0.75 else 0.5
23
+ local padX = if size == "small" then 1 elseif size == "large" then 2 else 1.5
24
+ local deletePx = metrics.icon
15
25
  return createStyles({
16
26
  root = {
17
27
  AutomaticSize = Enum.AutomaticSize.XY,
@@ -23,22 +33,46 @@ local useChipStyles = componentStyles("Chip", function(theme, _param)
23
33
  Selectable = not disabled,
24
34
  TextColor3 = if disabled then theme.palette.text.disabled else theme.palette.text.primary,
25
35
  Font = theme.typography.fontFamilies.default,
26
- TextSize = theme.typography.fontSizes.body,
36
+ TextSize = metrics.font,
27
37
  },
28
38
  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)),
39
+ PaddingTop = UDim.new(0, theme.padding.calc(padY)),
40
+ PaddingBottom = UDim.new(0, theme.padding.calc(padY)),
41
+ PaddingLeft = UDim.new(0, theme.padding.calc(padX)),
42
+ PaddingRight = UDim.new(0, theme.padding.calc(if deletable then 0.5 else padX)),
33
43
  },
34
44
  corner = {
35
- CornerRadius = UDim.new(1, 0),
45
+ CornerRadius = UDim.new(theme.shape.pillScale, 0),
36
46
  },
37
47
  stroke = {
38
48
  Color = theme.palette.border,
39
49
  ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
40
50
  Transparency = if selected then 1 else 0,
41
51
  },
52
+ row = {
53
+ FillDirection = Enum.FillDirection.Horizontal,
54
+ VerticalAlignment = Enum.VerticalAlignment.Center,
55
+ SortOrder = Enum.SortOrder.LayoutOrder,
56
+ Padding = UDim.new(0, theme.padding.calc(0.5)),
57
+ },
58
+ label = {
59
+ AutomaticSize = Enum.AutomaticSize.XY,
60
+ Size = UDim2.fromScale(0, 0),
61
+ BackgroundTransparency = 1,
62
+ BorderSizePixel = 0,
63
+ TextColor3 = if disabled then theme.palette.text.disabled else theme.palette.text.primary,
64
+ Font = theme.typography.fontFamilies.default,
65
+ TextSize = metrics.font,
66
+ LayoutOrder = 1,
67
+ },
68
+ delete = {
69
+ Size = UDim2.fromOffset(deletePx, deletePx),
70
+ BackgroundTransparency = 1,
71
+ BorderSizePixel = 0,
72
+ AutoButtonColor = false,
73
+ ImageColor3 = if disabled then theme.palette.text.disabled else theme.palette.text.secondary,
74
+ LayoutOrder = 2,
75
+ },
42
76
  })
43
77
  end)
44
78
  local default = useChipStyles
@@ -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;