@rbxts/uiblox 0.2.0-alpha.37 → 0.2.0-alpha.38

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 (212) hide show
  1. package/README.md +1 -18
  2. package/out/theme/constants/NumberConstants.d.ts +10 -0
  3. package/out/theme/constants/NumberConstants.luau +12 -0
  4. package/out/theme/interfaces/density/controlMetrics.luau +2 -2
  5. package/out/theme/interfaces/palette/Palette.d.ts +7 -0
  6. package/out/theme/interfaces/spacing/Shape.d.ts +6 -0
  7. package/out/theme/interfaces/theme/Theme.d.ts +6 -0
  8. package/out/theme/interfaces/typography/FontFamilies.luau +1 -0
  9. package/out/theme/interfaces/typography/FontFamilyOptions.d.ts +1 -1
  10. package/out/theme/interfaces/typography/FontSizeOptions.d.ts +1 -1
  11. package/out/theme/interfaces/typography/FontSizes.luau +2 -0
  12. package/out/theme/interfaces/typography/Variants.d.ts +3 -1
  13. package/out/theme/interfaces/typography/Variants.luau +25 -1
  14. package/out/theme/styles/utilities/focusRing.d.ts +2 -0
  15. package/out/theme/styles/utilities/focusRing.luau +3 -0
  16. package/out/theme/styles/utilities/index.d.ts +1 -1
  17. package/out/theme/styles/utilities/init.luau +3 -1
  18. package/out/theme/themes/DarkTheme.luau +4 -0
  19. package/out/theme/themes/LightTheme.luau +4 -0
  20. package/out/theme/themes/createPalette.luau +15 -0
  21. package/out/ui/packages/accordion/components/Accordion.luau +84 -40
  22. package/out/ui/packages/accordion/components/Accordion.styles.luau +35 -17
  23. package/out/ui/packages/alert/components/Alert.luau +15 -11
  24. package/out/ui/packages/alert/components/Alert.styles.luau +37 -26
  25. package/out/ui/packages/appBar/components/AppBar.luau +35 -13
  26. package/out/ui/packages/appBar/components/AppBar.styles.luau +41 -35
  27. package/out/ui/packages/autocomplete/components/Autocomplete.luau +4 -0
  28. package/out/ui/packages/avatar/components/Avatar.d.ts +2 -0
  29. package/out/ui/packages/avatar/components/Avatar.luau +9 -2
  30. package/out/ui/packages/avatar/components/Avatar.styles.luau +7 -0
  31. package/out/ui/packages/avatarGroup/components/AvatarGroup.luau +9 -4
  32. package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.luau +6 -1
  33. package/out/ui/packages/badge/components/Badge.luau +14 -11
  34. package/out/ui/packages/badge/components/Badge.styles.luau +5 -1
  35. package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +4 -3
  36. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +6 -2
  37. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.styles.luau +4 -0
  38. package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +20 -2
  39. package/out/ui/packages/brickColorPicker/components/BrickColorPicker.styles.luau +72 -66
  40. package/out/ui/packages/button/components/Button.luau +61 -34
  41. package/out/ui/packages/button/components/buttonPaint.d.ts +16 -0
  42. package/out/ui/packages/button/components/buttonPaint.luau +70 -0
  43. package/out/ui/packages/buttonGroup/components/ButtonGroup.d.ts +1 -0
  44. package/out/ui/packages/buttonGroup/components/ButtonGroup.luau +17 -2
  45. package/out/ui/packages/card/components/Card.styles.luau +4 -2
  46. package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +9 -1
  47. package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +50 -41
  48. package/out/ui/packages/checkbox/components/Checkbox.luau +5 -4
  49. package/out/ui/packages/checkbox/components/checkboxLook.d.ts +2 -2
  50. package/out/ui/packages/checkbox/components/checkboxLook.luau +2 -2
  51. package/out/ui/packages/chip/components/Chip.luau +16 -14
  52. package/out/ui/packages/chip/components/Chip.styles.luau +7 -4
  53. package/out/ui/packages/circularProgress/components/CircularProgress.luau +10 -3
  54. package/out/ui/packages/codeEditor/components/CodeEditor.d.ts +12 -0
  55. package/out/ui/packages/codeEditor/components/CodeEditor.luau +262 -0
  56. package/out/ui/packages/codeEditor/components/CodeEditor.styles.d.ts +6 -0
  57. package/out/ui/packages/codeEditor/components/CodeEditor.styles.luau +124 -0
  58. package/out/ui/packages/codeEditor/highlightCode.d.ts +11 -0
  59. package/out/ui/packages/codeEditor/highlightCode.luau +503 -0
  60. package/out/ui/packages/codeEditor/index.d.ts +2 -0
  61. package/out/ui/packages/codeEditor/init.luau +5 -0
  62. package/out/ui/packages/colorPicker/components/ColorPicker.luau +9 -1
  63. package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +74 -67
  64. package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +12 -4
  65. package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +12 -4
  66. package/out/ui/packages/dateRange/components/DateRangePicker.luau +31 -19
  67. package/out/ui/packages/dialog/components/Dialog.styles.luau +4 -2
  68. package/out/ui/packages/divider/components/Divider.luau +3 -1
  69. package/out/ui/packages/divider/components/Divider.styles.luau +1 -0
  70. package/out/ui/packages/drawer/components/Drawer.d.ts +1 -0
  71. package/out/ui/packages/drawer/components/Drawer.luau +43 -14
  72. package/out/ui/packages/drawer/components/Drawer.styles.luau +13 -5
  73. package/out/ui/packages/drawer/components/drawerPlacement.d.ts +2 -0
  74. package/out/ui/packages/drawer/components/drawerPlacement.luau +18 -0
  75. package/out/ui/packages/editorFace.d.ts +22 -0
  76. package/out/ui/packages/editorFace.luau +49 -0
  77. package/out/ui/packages/fab/components/Fab.luau +19 -6
  78. package/out/ui/packages/fab/components/Fab.styles.luau +4 -3
  79. package/out/ui/packages/fab/components/fabSize.d.ts +1 -1
  80. package/out/ui/packages/fontEditor/components/FontEditor.luau +13 -3
  81. package/out/ui/packages/fontEditor/components/FontEditor.styles.luau +36 -27
  82. package/out/ui/packages/gradientEditor/components/GradientEditor.luau +21 -13
  83. package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +52 -44
  84. package/out/ui/packages/icon/components/DrawnGlyph.d.ts +11 -0
  85. package/out/ui/packages/icon/components/DrawnGlyph.luau +87 -0
  86. package/out/ui/packages/icon/components/Icon.d.ts +6 -2
  87. package/out/ui/packages/icon/components/Icon.luau +23 -3
  88. package/out/ui/packages/icon/components/Icon.styles.luau +3 -0
  89. package/out/ui/packages/icon/components/glyphs.d.ts +28 -0
  90. package/out/ui/packages/icon/components/glyphs.luau +64 -0
  91. package/out/ui/packages/icon/index.d.ts +1 -0
  92. package/out/ui/packages/iconButton/components/IconButton.d.ts +5 -2
  93. package/out/ui/packages/iconButton/components/IconButton.luau +83 -16
  94. package/out/ui/packages/iconButton/components/IconButton.styles.luau +4 -27
  95. package/out/ui/packages/iconButton/components/iconButtonBox.d.ts +11 -0
  96. package/out/ui/packages/iconButton/components/iconButtonBox.luau +48 -0
  97. package/out/ui/packages/iconButton/components/transportGlyph.d.ts +1 -0
  98. package/out/ui/packages/iconButton/components/transportGlyph.luau +4 -0
  99. package/out/ui/packages/imageList/components/ImageList.luau +11 -36
  100. package/out/ui/packages/imageList/components/ImageList.styles.luau +1 -0
  101. package/out/ui/packages/imageList/components/imageListLayout.d.ts +0 -2
  102. package/out/ui/packages/imageList/components/imageListLayout.luau +0 -8
  103. package/out/ui/packages/index.d.ts +1 -0
  104. package/out/ui/packages/init.luau +3 -0
  105. package/out/ui/packages/input/components/Input.luau +46 -29
  106. package/out/ui/packages/input/components/Input.styles.luau +8 -11
  107. package/out/ui/packages/input/components/fieldChrome.d.ts +5 -0
  108. package/out/ui/packages/input/components/fieldChrome.luau +11 -0
  109. package/out/ui/packages/layout/components/Box.luau +92 -13
  110. package/out/ui/packages/layout/components/Box.styles.d.ts +0 -2
  111. package/out/ui/packages/layout/components/Box.styles.luau +0 -9
  112. package/out/ui/packages/layout/components/Grid.luau +81 -16
  113. package/out/ui/packages/layout/components/Pad.d.ts +24 -0
  114. package/out/ui/packages/layout/components/Pad.luau +88 -0
  115. package/out/ui/packages/layout/components/Stack.luau +79 -13
  116. package/out/ui/packages/link/components/Link.luau +19 -13
  117. package/out/ui/packages/link/components/Link.styles.luau +10 -1
  118. package/out/ui/packages/listItem/components/ListItem.luau +61 -4
  119. package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
  120. package/out/ui/packages/listItem/components/ListItem.styles.luau +28 -11
  121. package/out/ui/packages/listItem/components/listItemInk.d.ts +1 -1
  122. package/out/ui/packages/listItem/components/listItemLayout.d.ts +12 -2
  123. package/out/ui/packages/listItem/components/listItemLayout.luau +29 -2
  124. package/out/ui/packages/markdown/components/Markdown.luau +163 -50
  125. package/out/ui/packages/markdown/components/Markdown.styles.luau +125 -76
  126. package/out/ui/packages/markdown/components/MarkdownEditor.luau +215 -146
  127. package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +1 -0
  128. package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +153 -83
  129. package/out/ui/packages/markdown/index.d.ts +1 -1
  130. package/out/ui/packages/markdown/parseMarkdown.d.ts +9 -1
  131. package/out/ui/packages/markdown/parseMarkdown.luau +350 -29
  132. package/out/ui/packages/menu/components/Menu.d.ts +1 -1
  133. package/out/ui/packages/menu/components/Menu.luau +12 -11
  134. package/out/ui/packages/menu/components/Menu.styles.luau +6 -1
  135. package/out/ui/packages/menu/components/menuIcon.d.ts +1 -1
  136. package/out/ui/packages/numberInput/components/NumberInput.luau +19 -4
  137. package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +9 -1
  138. package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.styles.luau +23 -16
  139. package/out/ui/packages/pager/components/Pager.luau +15 -13
  140. package/out/ui/packages/pager/components/Pager.styles.luau +5 -0
  141. package/out/ui/packages/pagination/components/Pagination.styles.luau +4 -1
  142. package/out/ui/packages/paper/components/Paper.luau +17 -11
  143. package/out/ui/packages/paper/components/Paper.styles.luau +12 -5
  144. package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +9 -1
  145. package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +24 -19
  146. package/out/ui/packages/popover/components/Popover.d.ts +1 -1
  147. package/out/ui/packages/popover/components/Popover.luau +6 -4
  148. package/out/ui/packages/popover/components/Popover.styles.luau +6 -0
  149. package/out/ui/packages/popup/components/Popup.d.ts +2 -0
  150. package/out/ui/packages/popup/components/Popup.luau +64 -2
  151. package/out/ui/packages/popup/components/placement.luau +6 -4
  152. package/out/ui/packages/progressBar/components/ProgressBar.luau +1 -1
  153. package/out/ui/packages/progressBar/components/ProgressBar.styles.luau +3 -2
  154. package/out/ui/packages/radioGroup/components/RadioGroup.luau +2 -1
  155. package/out/ui/packages/rating/components/Rating.luau +45 -3
  156. package/out/ui/packages/rating/components/Rating.styles.luau +1 -1
  157. package/out/ui/packages/rayEditor/components/RayEditor.luau +9 -1
  158. package/out/ui/packages/rayEditor/components/RayEditor.styles.luau +17 -11
  159. package/out/ui/packages/rectEditor/components/RectEditor.luau +9 -1
  160. package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +49 -42
  161. package/out/ui/packages/select/components/Select.d.ts +2 -0
  162. package/out/ui/packages/select/components/Select.luau +148 -106
  163. package/out/ui/packages/select/components/Select.styles.d.ts +2 -0
  164. package/out/ui/packages/select/components/Select.styles.luau +29 -5
  165. package/out/ui/packages/shadow/components/Shadow.luau +188 -19
  166. package/out/ui/packages/sidebar/components/Sidebar.styles.luau +1 -0
  167. package/out/ui/packages/skeleton/components/Skeleton.luau +4 -0
  168. package/out/ui/packages/slider/components/RangeSlider.luau +6 -5
  169. package/out/ui/packages/slider/components/Slider.luau +11 -16
  170. package/out/ui/packages/sparkline/components/Sparkline.luau +7 -5
  171. package/out/ui/packages/speedDial/components/SpeedDial.luau +4 -1
  172. package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +5 -0
  173. package/out/ui/packages/speedDial/components/speedDialLabel.d.ts +1 -1
  174. package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
  175. package/out/ui/packages/stepper/components/Stepper.styles.luau +9 -6
  176. package/out/ui/packages/switch/components/Switch.luau +2 -2
  177. package/out/ui/packages/switch/components/switchLook.d.ts +3 -3
  178. package/out/ui/packages/switch/components/switchLook.luau +4 -10
  179. package/out/ui/packages/table/components/Table.d.ts +1 -0
  180. package/out/ui/packages/table/components/Table.luau +92 -53
  181. package/out/ui/packages/table/components/Table.styles.luau +23 -6
  182. package/out/ui/packages/table/components/tableColumns.d.ts +2 -0
  183. package/out/ui/packages/table/components/tableColumns.luau +2 -0
  184. package/out/ui/packages/tabs/components/Tabs.luau +7 -4
  185. package/out/ui/packages/tabs/components/Tabs.styles.luau +12 -11
  186. package/out/ui/packages/tabs/components/tabIndicator.d.ts +7 -0
  187. package/out/ui/packages/tabs/components/tabIndicator.luau +21 -0
  188. package/out/ui/packages/text/components/Text.d.ts +2 -0
  189. package/out/ui/packages/text/components/Text.luau +12 -2
  190. package/out/ui/packages/timeField/components/TimeField.luau +11 -7
  191. package/out/ui/packages/timeline/components/Timeline.luau +35 -32
  192. package/out/ui/packages/timeline/components/Timeline.styles.luau +19 -10
  193. package/out/ui/packages/toast/components/Toast.luau +168 -72
  194. package/out/ui/packages/toast/components/Toast.styles.luau +36 -19
  195. package/out/ui/packages/toast/components/toastPlace.d.ts +4 -0
  196. package/out/ui/packages/toast/components/toastPlace.luau +13 -0
  197. package/out/ui/packages/toast/enums/ToastVariants.d.ts +2 -1
  198. package/out/ui/packages/toast/enums/ToastVariants.luau +1 -0
  199. package/out/ui/packages/toggleButton/components/ToggleButton.luau +43 -4
  200. package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +1 -1
  201. package/out/ui/packages/tooltip/components/Tooltip.styles.luau +2 -2
  202. package/out/ui/packages/treeView/components/TreeView.luau +12 -13
  203. package/out/ui/packages/treeView/components/TreeView.styles.luau +6 -0
  204. package/out/ui/packages/typography/components/Typography.d.ts +2 -0
  205. package/out/ui/packages/typography/components/Typography.luau +8 -0
  206. package/out/ui/packages/typography/components/Typography.styles.luau +3 -1
  207. package/out/ui/packages/udimEditor/components/UDimEditor.luau +9 -1
  208. package/out/ui/packages/udimEditor/components/UDimEditor.styles.luau +25 -18
  209. package/out/ui/packages/vectorEditor/components/VectorEditor.luau +17 -3
  210. package/out/ui/packages/vectorEditor/components/VectorEditor.styles.luau +30 -16
  211. package/out/ui/packages/virtualList/components/VirtualList.styles.luau +1 -0
  212. package/package.json +69 -67
package/README.md CHANGED
@@ -6,25 +6,9 @@
6
6
 
7
7
  UI library and theming for roblox-ts projects.
8
8
 
9
- ## Background
10
-
11
- Roblox has their own internal design system, coined "uiblox-web", that it uses for its new
12
- web-facing products. This system offers reusable components, implemented in
13
- React Typescript, that are derived from material UI (MUI). As well, it offers a
14
- common theme/pallete for consistent UI/UX.
15
-
16
- Anyone is able to view their design system as
17
- [UIBlox-Web](https://uiblox.roblox.com). You can see that they leverage
18
- [Storybook](https://storybook.js.org), a UI component explorer for frontend
19
- developers, to render component previews.
20
-
21
- Design systems all help engineers cut down on implementation time and ensure
22
- consitent UX across products.
23
-
24
9
  ## Overview
25
10
 
26
- So what is uiblox-rbxts? Simply put, its my stab at a design system that mimics
27
- uiblox-web for games written using roblox-ts.
11
+ uiblox-rbxts is a design system for games written using roblox-ts.
28
12
 
29
13
  UIBlox-rbxts aims to provide extensible components that can be reusable by
30
14
  anyone who installs this npm package. It also offers a theme and styling system
@@ -254,4 +238,3 @@ new AppLoader().Mount();
254
238
  - [Storyblox](https://github.com/bjlarouche/storyblox) a UI component explorer for roblox-ts developers
255
239
  - <img src=docs/storyblox-preview.png width=40%>
256
240
  - Test it out here [Storyblox Pre-Release Experience](https://www.roblox.com/games/9159382473)
257
- - Similar to [hoarcekat](https://github.com/Kampfkarren/hoarcekat) by Kampfkarren
@@ -2,6 +2,16 @@ import { IconSizes } from "../interfaces/iconSizes/index";
2
2
  export declare const SPACING_BASE = 8;
3
3
  export declare const PADDING_BASE = 4;
4
4
  export declare const BORDER_RADIUS = 4;
5
+ export declare const RADIUS: {
6
+ small: number;
7
+ default: number;
8
+ large: number;
9
+ };
10
+ export declare const MOTION: {
11
+ fast: number;
12
+ default: number;
13
+ slow: number;
14
+ };
5
15
  /** UICorner scale for pill/capsule controls (1 = fully round). */
6
16
  export declare const PILL_SCALE = 1;
7
17
  export declare const CONTENT_WIDTH = 1024;
@@ -2,6 +2,16 @@
2
2
  local SPACING_BASE = 8
3
3
  local PADDING_BASE = 4
4
4
  local BORDER_RADIUS = 4
5
+ local RADIUS = {
6
+ small = 2,
7
+ default = BORDER_RADIUS,
8
+ large = 8,
9
+ }
10
+ local MOTION = {
11
+ fast = 0.1,
12
+ default = 0.14,
13
+ slow = 0.24,
14
+ }
5
15
  --* UICorner scale for pill/capsule controls (1 = fully round).
6
16
  local PILL_SCALE = 1
7
17
  local CONTENT_WIDTH = 1024
@@ -14,6 +24,8 @@ return {
14
24
  SPACING_BASE = SPACING_BASE,
15
25
  PADDING_BASE = PADDING_BASE,
16
26
  BORDER_RADIUS = BORDER_RADIUS,
27
+ RADIUS = RADIUS,
28
+ MOTION = MOTION,
17
29
  PILL_SCALE = PILL_SCALE,
18
30
  CONTENT_WIDTH = CONTENT_WIDTH,
19
31
  ICON_SIZES = ICON_SIZES,
@@ -28,7 +28,7 @@ local METRICS = {
28
28
  sliderTrack = 6,
29
29
  sliderKnob = 14,
30
30
  radio = 18,
31
- icon = 18,
31
+ icon = 16,
32
32
  font = 14,
33
33
  markFont = 12,
34
34
  buttonHeight = 36,
@@ -45,7 +45,7 @@ local METRICS = {
45
45
  sliderTrack = 8,
46
46
  sliderKnob = 18,
47
47
  radio = 22,
48
- icon = 18,
48
+ icon = 20,
49
49
  font = 16,
50
50
  markFont = 12,
51
51
  buttonHeight = 48,
@@ -44,4 +44,11 @@ export default interface Palette {
44
44
  };
45
45
  backdrop: Color3;
46
46
  shadow: Color3;
47
+ code: {
48
+ keyword: Color3;
49
+ string: Color3;
50
+ number: Color3;
51
+ comment: Color3;
52
+ func: Color3;
53
+ };
47
54
  }
@@ -3,4 +3,10 @@ export default interface Shape {
3
3
  borderRadius: number;
4
4
  /** UICorner scale for capsules (Switch, Chip). Use `new UDim(pillScale, 0)`. */
5
5
  pillScale: number;
6
+ /** Pixel radii: tight internals, controls and surfaces, dialogs and cards. `default` matches `borderRadius`. */
7
+ radius: {
8
+ small: number;
9
+ default: number;
10
+ large: number;
11
+ };
6
12
  }
@@ -7,6 +7,12 @@ interface Theme {
7
7
  type: string;
8
8
  density: ThemeDensity;
9
9
  reducedMotion?: boolean;
10
+ /** Tween seconds: focus and hover, menus and disclosure, sheets and snackbars. */
11
+ motion: {
12
+ fast: number;
13
+ default: number;
14
+ slow: number;
15
+ };
10
16
  options: ThemeOptions;
11
17
  palette: Palette;
12
18
  padding: Padding;
@@ -5,6 +5,7 @@ local allFontFamilies = {
5
5
  semibold = Enum.Font.SourceSansSemibold,
6
6
  light = Enum.Font.SourceSansLight,
7
7
  italics = Enum.Font.SourceSansItalic,
8
+ mono = Enum.Font.RobotoMono,
8
9
  }
9
10
  return {
10
11
  allFontFamilies = allFontFamilies,
@@ -1,3 +1,3 @@
1
- export type FontFamilyVariant = "default" | "bold" | "semibold" | "light" | "italics";
1
+ export type FontFamilyVariant = "default" | "bold" | "semibold" | "light" | "italics" | "mono";
2
2
  export interface FontFamilyOptions extends Partial<Record<FontFamilyVariant, Required<Enum.Font>>> {
3
3
  }
@@ -1,3 +1,3 @@
1
- export type FontSizeVariant = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body" | "caption" | "button" | "overline";
1
+ export type FontSizeVariant = "display" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body" | "bodySmall" | "caption" | "button" | "overline";
2
2
  export interface FontSizeOptions extends Partial<Record<FontSizeVariant, Required<number>>> {
3
3
  }
@@ -3,6 +3,7 @@ local TS = _G[script]
3
3
  local allTypographyVariants = TS.import(script, script.Parent, "Variants").allTypographyVariants
4
4
  local baseFontSize = allTypographyVariants.body.size
5
5
  local allFontSizes = {
6
+ display = allTypographyVariants.display.size,
6
7
  h1 = allTypographyVariants.h1.size,
7
8
  h2 = allTypographyVariants.h2.size,
8
9
  h3 = allTypographyVariants.h3.size,
@@ -12,6 +13,7 @@ local allFontSizes = {
12
13
  subtitle1 = allTypographyVariants.subtitle1.size,
13
14
  subtitle2 = allTypographyVariants.subtitle2.size,
14
15
  body = allTypographyVariants.body.size,
16
+ bodySmall = allTypographyVariants.bodySmall.size,
15
17
  caption = allTypographyVariants.caption.size,
16
18
  overline = allTypographyVariants.overline.size,
17
19
  button = allTypographyVariants.button.size,
@@ -5,9 +5,11 @@ export interface TypographyVariantSpec {
5
5
  family: FontFamilyVariant;
6
6
  /** Approx CSS weight; Roblox TextLabel uses `family` / FontFace */
7
7
  weight: number;
8
+ /** TextLabel.LineHeight multiplier */
9
+ leading: number;
8
10
  }
9
11
  export type TypographyVariants = FontSizeVariant;
10
- /** Size + family + weight per typography variant. */
12
+ /** Size, family, weight, and line height per typography variant. */
11
13
  export declare const allTypographyVariants: Record<FontSizeVariant, TypographyVariantSpec>;
12
14
  /** @deprecated prefer allTypographyVariants[*].weight */
13
15
  export declare const TypographyWeights: {
@@ -1,65 +1,89 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
- --* Size + family + weight per typography variant.
2
+ --* Size, family, weight, and line height per typography variant.
3
3
  local allTypographyVariants = {
4
+ display = {
5
+ size = 36,
6
+ family = "bold",
7
+ weight = 700,
8
+ leading = 1.15,
9
+ },
4
10
  h1 = {
5
11
  size = 28,
6
12
  family = "bold",
7
13
  weight = 700,
14
+ leading = 1.2,
8
15
  },
9
16
  h2 = {
10
17
  size = 22,
11
18
  family = "bold",
12
19
  weight = 700,
20
+ leading = 1.2,
13
21
  },
14
22
  h3 = {
15
23
  size = 18,
16
24
  family = "semibold",
17
25
  weight = 600,
26
+ leading = 1.3,
18
27
  },
19
28
  h4 = {
20
29
  size = 16,
21
30
  family = "semibold",
22
31
  weight = 600,
32
+ leading = 1.3,
23
33
  },
24
34
  h5 = {
25
35
  size = 14,
26
36
  family = "semibold",
27
37
  weight = 600,
38
+ leading = 1.3,
28
39
  },
29
40
  h6 = {
30
41
  size = 14,
31
42
  family = "semibold",
32
43
  weight = 600,
44
+ leading = 1.3,
33
45
  },
34
46
  subtitle1 = {
35
47
  size = 16,
36
48
  family = "default",
37
49
  weight = 400,
50
+ leading = 1.4,
38
51
  },
39
52
  subtitle2 = {
40
53
  size = 14,
41
54
  family = "semibold",
42
55
  weight = 600,
56
+ leading = 1.4,
43
57
  },
44
58
  body = {
45
59
  size = 14,
46
60
  family = "default",
47
61
  weight = 400,
62
+ leading = 1.4,
63
+ },
64
+ bodySmall = {
65
+ size = 13,
66
+ family = "default",
67
+ weight = 400,
68
+ leading = 1.4,
48
69
  },
49
70
  button = {
50
71
  size = 13,
51
72
  family = "semibold",
52
73
  weight = 600,
74
+ leading = 1.15,
53
75
  },
54
76
  caption = {
55
77
  size = 12,
56
78
  family = "default",
57
79
  weight = 400,
80
+ leading = 1.4,
58
81
  },
59
82
  overline = {
60
83
  size = 10,
61
84
  family = "default",
62
85
  weight = 400,
86
+ leading = 1.4,
63
87
  },
64
88
  }
65
89
  --* @deprecated prefer allTypographyVariants[*].weight
@@ -3,3 +3,5 @@ export declare function focusRing(color: Color3): {
3
3
  Thickness: number;
4
4
  ApplyStrokeMode: Enum.ApplyStrokeMode.Border;
5
5
  };
6
+ /** One disabled fade for checkbox, switch, radio, and slider. */
7
+ export declare const controlFade = 0.5;
@@ -6,6 +6,9 @@ local function focusRing(color)
6
6
  ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
7
7
  }
8
8
  end
9
+ --* One disabled fade for checkbox, switch, radio, and slider.
10
+ local controlFade = 0.5
9
11
  return {
10
12
  focusRing = focusRing,
13
+ controlFade = controlFade,
11
14
  }
@@ -3,7 +3,7 @@ export { default as makeStyles } from "./makeStyles";
3
3
  export { default as classNames, cx } from "./classNames";
4
4
  export { applyVariants, CompoundVariant } from "./variants";
5
5
  export { default as componentStyles } from "./componentStyles";
6
- export { focusRing } from "./focusRing";
6
+ export { controlFade, focusRing } from "./focusRing";
7
7
  export { resolveResponsive, Responsive } from "../../../hooks/breakpoints";
8
8
  export { clearStyleCaches, createStyleCache, styleDepsKey } from "./styleCache";
9
9
  export { resolveSx, resolvePaletteToken, PaletteToken, ResolvedSx, SxColor, SxGradient, SxInput } from "./resolveSx";
@@ -8,7 +8,9 @@ exports.classNames = _classNames.default
8
8
  exports.cx = _classNames.cx
9
9
  exports.applyVariants = TS.import(script, script, "variants").applyVariants
10
10
  exports.componentStyles = TS.import(script, script, "componentStyles").default
11
- exports.focusRing = TS.import(script, script, "focusRing").focusRing
11
+ local _focusRing = TS.import(script, script, "focusRing")
12
+ exports.controlFade = _focusRing.controlFade
13
+ exports.focusRing = _focusRing.focusRing
12
14
  exports.resolveResponsive = TS.import(script, script.Parent.Parent.Parent, "hooks", "breakpoints").resolveResponsive
13
15
  local _styleCache = TS.import(script, script, "styleCache")
14
16
  exports.clearStyleCaches = _styleCache.clearStyleCaches
@@ -5,8 +5,10 @@ local _NumberConstants = TS.import(script, script.Parent.Parent, "constants", "N
5
5
  local BORDER_RADIUS = _NumberConstants.BORDER_RADIUS
6
6
  local CONTENT_WIDTH = _NumberConstants.CONTENT_WIDTH
7
7
  local ICON_SIZES = _NumberConstants.ICON_SIZES
8
+ local MOTION = _NumberConstants.MOTION
8
9
  local PADDING_BASE = _NumberConstants.PADDING_BASE
9
10
  local PILL_SCALE = _NumberConstants.PILL_SCALE
11
+ local RADIUS = _NumberConstants.RADIUS
10
12
  local SPACING_BASE = _NumberConstants.SPACING_BASE
11
13
  local DEFAULT_BORDERS = TS.import(script, script.Parent.Parent, "constants", "ColorConstants").DEFAULT_BORDERS
12
14
  local allFontFamilies = TS.import(script, script.Parent.Parent, "interfaces", "typography", "FontFamilies").allFontFamilies
@@ -15,6 +17,7 @@ local createDarkPalette = TS.import(script, script.Parent, "createPalette").crea
15
17
  local DarkTheme = {
16
18
  type = "Dark",
17
19
  density = "comfortable",
20
+ motion = MOTION,
18
21
  palette = createDarkPalette(),
19
22
  spacing = {
20
23
  default = SPACING_BASE,
@@ -31,6 +34,7 @@ local DarkTheme = {
31
34
  shape = {
32
35
  borderRadius = BORDER_RADIUS,
33
36
  pillScale = PILL_SCALE,
37
+ radius = RADIUS,
34
38
  },
35
39
  typography = {
36
40
  fontSizes = allFontSizes,
@@ -5,8 +5,10 @@ local _NumberConstants = TS.import(script, script.Parent.Parent, "constants", "N
5
5
  local BORDER_RADIUS = _NumberConstants.BORDER_RADIUS
6
6
  local CONTENT_WIDTH = _NumberConstants.CONTENT_WIDTH
7
7
  local ICON_SIZES = _NumberConstants.ICON_SIZES
8
+ local MOTION = _NumberConstants.MOTION
8
9
  local PADDING_BASE = _NumberConstants.PADDING_BASE
9
10
  local PILL_SCALE = _NumberConstants.PILL_SCALE
11
+ local RADIUS = _NumberConstants.RADIUS
10
12
  local SPACING_BASE = _NumberConstants.SPACING_BASE
11
13
  local DEFAULT_BORDERS = TS.import(script, script.Parent.Parent, "constants", "ColorConstants").DEFAULT_BORDERS
12
14
  local allFontFamilies = TS.import(script, script.Parent.Parent, "interfaces", "typography", "FontFamilies").allFontFamilies
@@ -15,6 +17,7 @@ local createLightPalette = TS.import(script, script.Parent, "createPalette").cre
15
17
  local LightTheme = {
16
18
  type = "Light",
17
19
  density = "comfortable",
20
+ motion = MOTION,
18
21
  palette = createLightPalette(),
19
22
  spacing = {
20
23
  default = SPACING_BASE,
@@ -31,6 +34,7 @@ local LightTheme = {
31
34
  shape = {
32
35
  borderRadius = BORDER_RADIUS,
33
36
  pillScale = PILL_SCALE,
37
+ radius = RADIUS,
34
38
  },
35
39
  typography = {
36
40
  fontSizes = allFontSizes,
@@ -5,6 +5,7 @@ local Blue = _colors.Blue
5
5
  local Common = _colors.Common
6
6
  local Gray = _colors.Gray
7
7
  local Green = _colors.Green
8
+ local Orange = _colors.Orange
8
9
  local Purple = _colors.Purple
9
10
  local Red = _colors.Red
10
11
  local Yellow = _colors.Yellow
@@ -64,6 +65,13 @@ local createLightPalette = function()
64
65
  },
65
66
  backdrop = Common.Black,
66
67
  shadow = Common.Black,
68
+ code = {
69
+ keyword = Purple[80],
70
+ string = Green[90],
71
+ number = Orange[80],
72
+ comment = Gray[70],
73
+ func = Blue[90],
74
+ },
67
75
  }
68
76
  end
69
77
  local createDarkPalette = function()
@@ -103,6 +111,13 @@ local createDarkPalette = function()
103
111
  },
104
112
  backdrop = Common.Black,
105
113
  shadow = Common.Black,
114
+ code = {
115
+ keyword = Purple[30],
116
+ string = Green[50],
117
+ number = Orange[40],
118
+ comment = Gray[50],
119
+ func = Blue[40],
120
+ },
106
121
  }
107
122
  end
108
123
  return {
@@ -2,14 +2,20 @@
2
2
  local TS = _G[script]
3
3
  local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
4
  local React = _react
5
+ local useEffect = _react.useEffect
6
+ local useRef = _react.useRef
5
7
  local useState = _react.useState
6
- local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
8
+ local useReducedMotion = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "hooks").useReducedMotion
9
+ local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
10
+ local controlMetrics = _theme.controlMetrics
11
+ local cx = _theme.cx
12
+ local useTheme = _theme.useTheme
13
+ local playProperty = TS.import(script, script.Parent.Parent.Parent, "motion", "play").playProperty
7
14
  local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
8
15
  local Collapse = TS.import(script, script.Parent.Parent.Parent, "collapse").Collapse
16
+ local Icon = TS.import(script, script.Parent.Parent.Parent, "icon").Icon
9
17
  local accordionNote = TS.import(script, script.Parent, "accordionNote").accordionNote
10
- local _accordionOpen = TS.import(script, script.Parent, "accordionOpen")
11
- local accordionGlyph = _accordionOpen.accordionGlyph
12
- local accordionOpen = _accordionOpen.accordionOpen
18
+ local accordionOpen = TS.import(script, script.Parent, "accordionOpen").accordionOpen
13
19
  local useAccordionStyles = TS.import(script, script.Parent, "Accordion.styles").default
14
20
  local function Accordion(props)
15
21
  local _binding = props
@@ -26,12 +32,27 @@ local function Accordion(props)
26
32
  local id = _binding.id
27
33
  local ref = _binding.ref
28
34
  local localOpen, setLocalOpen = useState(defaultOpen == true)
35
+ local hovering, setHovering = useState(false)
29
36
  local open = accordionOpen(localOpen, controlled)
30
37
  local summary = accordionNote(note)
31
38
  local styles = useAccordionStyles({
32
39
  open = open,
33
40
  disabled = disabled,
34
41
  })
42
+ local _binding_1 = useTheme()
43
+ local theme = _binding_1.theme
44
+ local reduced = useReducedMotion()
45
+ local iconRef = useRef()
46
+ local icon = controlMetrics(theme.density).icon
47
+ useEffect(function()
48
+ local icon = iconRef.current
49
+ if not icon then
50
+ return nil
51
+ end
52
+ return playProperty(icon, {
53
+ Rotation = if open then 90 else 0,
54
+ }, theme.motion.default, reduced)
55
+ end, { open, reduced, theme })
35
56
  local toggle = function()
36
57
  if disabled == true then
37
58
  return nil
@@ -66,78 +87,101 @@ local function Accordion(props)
66
87
  setmetatable(_attributes_1, nil)
67
88
  _condition_1 = React.createElement("uicorner", _attributes_1)
68
89
  end
69
- local _attributes_1 = table.clone(styles.list)
90
+ local _attributes_1 = table.clone(styles.stroke)
70
91
  setmetatable(_attributes_1, nil)
71
- local _exp = React.createElement("uilistlayout", _attributes_1)
72
- local _attributes_2 = {
92
+ local _exp = React.createElement("uistroke", _attributes_1)
93
+ local _attributes_2 = table.clone(styles.list)
94
+ setmetatable(_attributes_2, nil)
95
+ local _exp_1 = React.createElement("uilistlayout", _attributes_2)
96
+ local _attributes_3 = {
73
97
  key = "Header",
74
98
  }
75
- for _k, _v in styles.header do
76
- _attributes_2[_k] = _v
99
+ for _k, _v in cx(styles.header, hovering and disabled ~= true and styles.hover) do
100
+ _attributes_3[_k] = _v
77
101
  end
78
- _attributes_2.Event = {
102
+ _attributes_3.Event = {
79
103
  Activated = toggle,
104
+ MouseEnter = function()
105
+ return setHovering(true)
106
+ end,
107
+ MouseLeave = function()
108
+ return setHovering(false)
109
+ end,
80
110
  }
81
- local _attributes_3 = table.clone(styles.padding)
82
- setmetatable(_attributes_3, nil)
83
- local _exp_1 = React.createElement("uipadding", _attributes_3)
111
+ local _attributes_4 = table.clone(styles.tail)
112
+ setmetatable(_attributes_4, nil)
113
+ local _exp_2 = React.createElement("uipadding", _attributes_4)
84
114
  local _result
85
115
  if summary == nil then
86
- local _attributes_4 = {
116
+ local _attributes_5 = {
87
117
  key = "Title",
88
118
  }
89
119
  for _k, _v in styles.title do
90
- _attributes_4[_k] = _v
120
+ _attributes_5[_k] = _v
91
121
  end
92
- _attributes_4.Text = title
93
- _result = (React.createElement("textlabel", _attributes_4))
122
+ _attributes_5.Text = title
123
+ _result = (React.createElement("textlabel", _attributes_5))
94
124
  else
95
- local _attributes_4 = {
125
+ local _attributes_5 = {
96
126
  key = "Copy",
97
127
  }
98
128
  for _k, _v in styles.copy do
99
- _attributes_4[_k] = _v
129
+ _attributes_5[_k] = _v
100
130
  end
101
- local _exp_2 = React.createElement("uilistlayout", {
131
+ local _exp_3 = React.createElement("uilistlayout", {
102
132
  FillDirection = Enum.FillDirection.Vertical,
103
133
  SortOrder = Enum.SortOrder.LayoutOrder,
104
134
  Padding = UDim.new(0, 0),
105
135
  })
106
- local _attributes_5 = {
136
+ local _attributes_6 = {
107
137
  key = "Title",
108
138
  }
109
139
  for _k, _v in styles.title do
110
- _attributes_5[_k] = _v
140
+ _attributes_6[_k] = _v
111
141
  end
112
- _attributes_5.Size = UDim2.new(1, 0, 0, 0)
113
- _attributes_5.Text = title
114
- _attributes_5.LayoutOrder = 1
115
- local _exp_3 = React.createElement("textlabel", _attributes_5)
116
- local _attributes_6 = {
142
+ _attributes_6.Position = UDim2.new(0, 0, 0, 0)
143
+ _attributes_6.Size = UDim2.new(1, 0, 0, 0)
144
+ _attributes_6.Text = title
145
+ _attributes_6.LayoutOrder = 1
146
+ local _exp_4 = React.createElement("textlabel", _attributes_6)
147
+ local _attributes_7 = {
117
148
  key = "Note",
118
149
  }
119
150
  for _k, _v in styles.note do
120
- _attributes_6[_k] = _v
151
+ _attributes_7[_k] = _v
121
152
  end
122
- _attributes_6.Text = summary
123
- _attributes_6.LayoutOrder = 2
124
- _result = (React.createElement("frame", _attributes_4, _exp_2, _exp_3, React.createElement("textlabel", _attributes_6)))
153
+ _attributes_7.Text = summary
154
+ _attributes_7.LayoutOrder = 2
155
+ _result = (React.createElement("frame", _attributes_5, _exp_3, _exp_4, React.createElement("textlabel", _attributes_7)))
125
156
  end
126
- local _attributes_4 = {
157
+ local _exp_3 = React.createElement("textbutton", _attributes_3, _exp_2, _result, React.createElement(SxHost, {
158
+ tag = "frame",
127
159
  key = "Icon",
160
+ hostRef = iconRef,
161
+ base = {
162
+ BackgroundTransparency = 1,
163
+ BorderSizePixel = 0,
164
+ Size = UDim2.new(0, icon, 0, icon),
165
+ },
166
+ className = styles.icon,
167
+ }, React.createElement(Icon, {
168
+ glyph = "chevronRight",
169
+ size = icon,
170
+ tint = if disabled == true then theme.palette.text.disabled else theme.palette.text.primary,
171
+ })))
172
+ local _attributes_5 = {
173
+ key = "Inset",
128
174
  }
129
- for _k, _v in styles.icon do
130
- _attributes_4[_k] = _v
175
+ for _k, _v in styles.band do
176
+ _attributes_5[_k] = _v
131
177
  end
132
- _attributes_4.Image = if accordionGlyph(open) == "expanded" then Icons.Expanded else Icons.Collapsed
133
- local _exp_2 = React.createElement("textbutton", _attributes_2, _exp_1, _result, React.createElement("imagelabel", _attributes_4))
134
- local _attributes_5 = table.clone(styles.padding)
135
- setmetatable(_attributes_5, nil)
136
- return React.createElement(SxHost, _attributes, _condition_1, _exp, _exp_2, React.createElement(Collapse, {
178
+ local _attributes_6 = table.clone(styles.tail)
179
+ setmetatable(_attributes_6, nil)
180
+ return React.createElement(SxHost, _attributes, _condition_1, _exp, _exp_1, _exp_3, React.createElement(Collapse, {
137
181
  key = "Body",
138
182
  open = open,
139
183
  className = styles.body,
140
- }, React.createElement("uipadding", _attributes_5), children))
184
+ }, React.createElement("frame", _attributes_5, React.createElement("uipadding", _attributes_6), children)))
141
185
  end
142
186
  local default = Accordion
143
187
  return {