@rbxts/uiblox 0.2.0-alpha.0 → 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 (218) hide show
  1. package/README.md +51 -34
  2. package/out/theme/constants/NumberConstants.d.ts +4 -2
  3. package/out/theme/constants/NumberConstants.luau +6 -4
  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/styles/utilities/index.d.ts +1 -1
  14. package/out/theme/styles/utilities/init.luau +3 -1
  15. package/out/theme/styles/utilities/resolveStyle.d.ts +32 -0
  16. package/out/theme/styles/utilities/resolveStyle.luau +66 -0
  17. package/out/theme/themes/DarkTheme.luau +4 -0
  18. package/out/theme/themes/LightTheme.luau +4 -0
  19. package/out/theme/types/types.d.ts +1 -1
  20. package/out/ui/packages/accordion/components/Accordion.d.ts +1 -0
  21. package/out/ui/packages/accordion/components/Accordion.luau +5 -0
  22. package/out/ui/packages/accordion/components/Accordion.styles.d.ts +1 -0
  23. package/out/ui/packages/accordion/components/Accordion.styles.luau +4 -2
  24. package/out/ui/packages/alert/components/Alert.d.ts +10 -0
  25. package/out/ui/packages/alert/components/Alert.luau +98 -0
  26. package/out/ui/packages/alert/components/Alert.styles.d.ts +6 -0
  27. package/out/ui/packages/alert/components/Alert.styles.luau +93 -0
  28. package/out/ui/packages/alert/components/alertTone.d.ts +2 -0
  29. package/out/ui/packages/alert/components/alertTone.luau +7 -0
  30. package/out/ui/packages/alert/index.d.ts +3 -0
  31. package/out/ui/packages/alert/init.luau +6 -0
  32. package/out/ui/packages/appBar/components/AppBar.d.ts +10 -0
  33. package/out/ui/packages/appBar/components/AppBar.luau +77 -0
  34. package/out/ui/packages/appBar/components/AppBar.styles.d.ts +6 -0
  35. package/out/ui/packages/appBar/components/AppBar.styles.luau +66 -0
  36. package/out/ui/packages/appBar/index.d.ts +3 -0
  37. package/out/ui/packages/appBar/init.luau +5 -0
  38. package/out/ui/packages/autocomplete/components/Autocomplete.luau +10 -0
  39. package/out/ui/packages/backdrop/components/Backdrop.d.ts +10 -0
  40. package/out/ui/packages/backdrop/components/Backdrop.luau +58 -0
  41. package/out/ui/packages/backdrop/components/Backdrop.styles.d.ts +4 -0
  42. package/out/ui/packages/backdrop/components/Backdrop.styles.luau +24 -0
  43. package/out/ui/packages/backdrop/index.d.ts +2 -0
  44. package/out/ui/packages/backdrop/init.luau +5 -0
  45. package/out/ui/packages/badge/components/Badge.styles.luau +6 -3
  46. package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +10 -0
  47. package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +86 -0
  48. package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.d.ts +2 -0
  49. package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +58 -0
  50. package/out/ui/packages/bottomNavigation/index.d.ts +2 -0
  51. package/out/ui/packages/bottomNavigation/init.luau +5 -0
  52. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +1 -0
  53. package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +58 -24
  54. package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +9 -0
  55. package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +68 -0
  56. package/out/ui/packages/breadcrumbs/index.d.ts +1 -0
  57. package/out/ui/packages/breadcrumbs/init.luau +3 -0
  58. package/out/ui/packages/brickColorPicker/components/brickColorCatalog.luau +1 -1
  59. package/out/ui/packages/button/components/Button.luau +9 -5
  60. package/out/ui/packages/button/components/Button.styles.luau +0 -6
  61. package/out/ui/packages/button/components/buttonLook.d.ts +2 -2
  62. package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
  63. package/out/ui/packages/chip/components/Chip.d.ts +3 -1
  64. package/out/ui/packages/chip/components/Chip.luau +39 -2
  65. package/out/ui/packages/chip/components/Chip.styles.d.ts +3 -0
  66. package/out/ui/packages/chip/components/Chip.styles.luau +40 -6
  67. package/out/ui/packages/circularProgress/components/CircularProgress.luau +13 -2
  68. package/out/ui/packages/dialog/components/Dialog.d.ts +1 -1
  69. package/out/ui/packages/dialog/components/Dialog.luau +27 -18
  70. package/out/ui/packages/fab/components/Fab.d.ts +14 -0
  71. package/out/ui/packages/fab/components/Fab.luau +160 -0
  72. package/out/ui/packages/fab/components/Fab.styles.d.ts +8 -0
  73. package/out/ui/packages/fab/components/Fab.styles.luau +65 -0
  74. package/out/ui/packages/fab/components/fabSize.d.ts +4 -0
  75. package/out/ui/packages/fab/components/fabSize.luau +33 -0
  76. package/out/ui/packages/fab/index.d.ts +3 -0
  77. package/out/ui/packages/fab/init.luau +9 -0
  78. package/out/ui/packages/formText/components/FormHelperText.d.ts +8 -0
  79. package/out/ui/packages/formText/components/FormHelperText.luau +44 -0
  80. package/out/ui/packages/formText/components/FormLabel.d.ts +9 -0
  81. package/out/ui/packages/formText/components/FormLabel.luau +46 -0
  82. package/out/ui/packages/formText/components/FormText.styles.d.ts +5 -0
  83. package/out/ui/packages/formText/components/FormText.styles.luau +33 -0
  84. package/out/ui/packages/formText/index.d.ts +4 -0
  85. package/out/ui/packages/formText/init.luau +6 -0
  86. package/out/ui/packages/icon/components/Icon.styles.luau +4 -4
  87. package/out/ui/packages/iconButton/components/IconButton.luau +7 -2
  88. package/out/ui/packages/iconButton/components/IconButton.styles.luau +7 -4
  89. package/out/ui/packages/imageList/components/ImageList.d.ts +14 -0
  90. package/out/ui/packages/imageList/components/ImageList.luau +84 -0
  91. package/out/ui/packages/imageList/components/ImageList.styles.d.ts +6 -0
  92. package/out/ui/packages/imageList/components/ImageList.styles.luau +54 -0
  93. package/out/ui/packages/imageList/components/imageListLayout.d.ts +3 -0
  94. package/out/ui/packages/imageList/components/imageListLayout.luau +24 -0
  95. package/out/ui/packages/imageList/index.d.ts +2 -0
  96. package/out/ui/packages/imageList/init.luau +5 -0
  97. package/out/ui/packages/index.d.ts +11 -0
  98. package/out/ui/packages/init.luau +33 -0
  99. package/out/ui/packages/input/components/Input.d.ts +2 -0
  100. package/out/ui/packages/input/components/Input.luau +64 -27
  101. package/out/ui/packages/input/components/Input.styles.luau +6 -2
  102. package/out/ui/packages/layout/components/Box.d.ts +11 -0
  103. package/out/ui/packages/layout/components/Box.luau +49 -0
  104. package/out/ui/packages/layout/components/Box.styles.d.ts +7 -0
  105. package/out/ui/packages/layout/components/Box.styles.luau +34 -0
  106. package/out/ui/packages/layout/components/Container.d.ts +10 -0
  107. package/out/ui/packages/layout/components/Container.luau +54 -0
  108. package/out/ui/packages/layout/components/Container.styles.d.ts +6 -0
  109. package/out/ui/packages/layout/components/Container.styles.luau +41 -0
  110. package/out/ui/packages/layout/components/Grid.d.ts +1 -1
  111. package/out/ui/packages/layout/components/Stack.d.ts +12 -0
  112. package/out/ui/packages/layout/components/Stack.luau +49 -0
  113. package/out/ui/packages/layout/components/Stack.styles.d.ts +8 -0
  114. package/out/ui/packages/layout/components/Stack.styles.luau +72 -0
  115. package/out/ui/packages/layout/components/boxPad.d.ts +14 -0
  116. package/out/ui/packages/layout/components/boxPad.luau +59 -0
  117. package/out/ui/packages/layout/components/containerWidth.d.ts +2 -0
  118. package/out/ui/packages/layout/components/containerWidth.luau +17 -0
  119. package/out/ui/packages/layout/components/stackAlign.d.ts +8 -0
  120. package/out/ui/packages/layout/components/stackAlign.luau +29 -0
  121. package/out/ui/packages/layout/index.d.ts +10 -0
  122. package/out/ui/packages/layout/init.luau +4 -0
  123. package/out/ui/packages/link/components/Link.d.ts +11 -0
  124. package/out/ui/packages/link/components/Link.luau +83 -0
  125. package/out/ui/packages/link/components/Link.styles.d.ts +8 -0
  126. package/out/ui/packages/link/components/Link.styles.luau +59 -0
  127. package/out/ui/packages/link/index.d.ts +3 -0
  128. package/out/ui/packages/link/init.luau +5 -0
  129. package/out/ui/packages/listItem/components/ListItem.d.ts +1 -0
  130. package/out/ui/packages/listItem/components/ListItem.luau +5 -0
  131. package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
  132. package/out/ui/packages/listItem/components/ListItem.styles.luau +10 -5
  133. package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +2 -0
  134. package/out/ui/packages/loadingStroke/components/LoadingStroke.luau +23 -19
  135. package/out/ui/packages/menu/components/Menu.d.ts +3 -0
  136. package/out/ui/packages/menu/components/Menu.luau +48 -23
  137. package/out/ui/packages/menu/components/Menu.styles.luau +5 -1
  138. package/out/ui/packages/modal/components/Modal.d.ts +1 -1
  139. package/out/ui/packages/modal/components/Modal.luau +55 -37
  140. package/out/ui/packages/motion/index.d.ts +1 -1
  141. package/out/ui/packages/motion/init.luau +1 -0
  142. package/out/ui/packages/motion/unit.d.ts +5 -0
  143. package/out/ui/packages/motion/unit.luau +23 -0
  144. package/out/ui/packages/numberInput/components/NumberInput.d.ts +2 -0
  145. package/out/ui/packages/numberInput/components/NumberInput.luau +4 -0
  146. package/out/ui/packages/pagination/components/Pagination.d.ts +2 -0
  147. package/out/ui/packages/pagination/components/Pagination.luau +37 -21
  148. package/out/ui/packages/pagination/components/Pagination.styles.luau +9 -0
  149. package/out/ui/packages/pagination/components/pageRange.d.ts +2 -1
  150. package/out/ui/packages/pagination/components/pageRange.luau +91 -8
  151. package/out/ui/packages/pagination/index.d.ts +1 -0
  152. package/out/ui/packages/pagination/init.luau +1 -0
  153. package/out/ui/packages/paper/components/Paper.d.ts +1 -0
  154. package/out/ui/packages/paper/components/Paper.luau +8 -3
  155. package/out/ui/packages/popup/index.d.ts +1 -0
  156. package/out/ui/packages/popup/init.luau +1 -0
  157. package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +1 -0
  158. package/out/ui/packages/radioGroup/components/RadioGroup.luau +4 -2
  159. package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +1 -0
  160. package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +4 -1
  161. package/out/ui/packages/rating/components/Rating.d.ts +9 -0
  162. package/out/ui/packages/rating/components/Rating.luau +95 -0
  163. package/out/ui/packages/rating/components/Rating.styles.d.ts +4 -0
  164. package/out/ui/packages/rating/components/Rating.styles.luau +39 -0
  165. package/out/ui/packages/rating/index.d.ts +2 -0
  166. package/out/ui/packages/rating/init.luau +5 -0
  167. package/out/ui/packages/select/components/Select.d.ts +6 -0
  168. package/out/ui/packages/select/components/Select.luau +74 -27
  169. package/out/ui/packages/select/components/Select.styles.luau +3 -3
  170. package/out/ui/packages/sidebar/components/Sidebar.styles.luau +2 -2
  171. package/out/ui/packages/skeleton/components/Skeleton.luau +3 -2
  172. package/out/ui/packages/skeleton/components/Skeleton.styles.luau +7 -2
  173. package/out/ui/packages/skeleton/components/skeletonMotion.luau +1 -1
  174. package/out/ui/packages/skeleton/components/skeletonTone.d.ts +20 -0
  175. package/out/ui/packages/skeleton/components/skeletonTone.luau +14 -0
  176. package/out/ui/packages/slider/components/Slider.d.ts +1 -0
  177. package/out/ui/packages/slider/components/Slider.luau +24 -1
  178. package/out/ui/packages/slider/components/Slider.styles.luau +8 -0
  179. package/out/ui/packages/slider/components/sliderMarks.d.ts +1 -0
  180. package/out/ui/packages/slider/components/sliderMarks.luau +37 -0
  181. package/out/ui/packages/speedDial/components/SpeedDial.d.ts +17 -0
  182. package/out/ui/packages/speedDial/components/SpeedDial.luau +92 -0
  183. package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +2 -0
  184. package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +26 -0
  185. package/out/ui/packages/speedDial/index.d.ts +2 -0
  186. package/out/ui/packages/speedDial/init.luau +5 -0
  187. package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
  188. package/out/ui/packages/stateMatrix.d.ts +2 -0
  189. package/out/ui/packages/stateMatrix.luau +1843 -1335
  190. package/out/ui/packages/switch/components/Switch.styles.luau +1 -1
  191. package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
  192. package/out/ui/packages/tabs/components/Tabs.d.ts +2 -0
  193. package/out/ui/packages/tabs/components/Tabs.luau +10 -3
  194. package/out/ui/packages/tabs/components/Tabs.styles.d.ts +4 -1
  195. package/out/ui/packages/tabs/components/Tabs.styles.luau +24 -10
  196. package/out/ui/packages/tabs/components/tabsOrientation.d.ts +2 -0
  197. package/out/ui/packages/tabs/components/tabsOrientation.luau +7 -0
  198. package/out/ui/packages/tabs/index.d.ts +1 -0
  199. package/out/ui/packages/tabs/init.luau +1 -0
  200. package/out/ui/packages/toast/components/Toast.styles.luau +1 -1
  201. package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +17 -0
  202. package/out/ui/packages/toggleButton/components/ToggleButton.luau +126 -0
  203. package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +5 -0
  204. package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +58 -0
  205. package/out/ui/packages/toggleButton/index.d.ts +2 -0
  206. package/out/ui/packages/toggleButton/init.luau +7 -0
  207. package/out/ui/packages/treeView/components/TreeView.luau +3 -3
  208. package/out/ui/packages/treeView/components/TreeView.styles.luau +3 -3
  209. package/out/ui/packages/typography/components/Typography.styles.luau +4 -5
  210. package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +6 -0
  211. package/out/ui/packages/virtualList/components/EmptyListHint.luau +32 -0
  212. package/out/ui/packages/virtualList/components/EmptyListHint.styles.d.ts +5 -0
  213. package/out/ui/packages/virtualList/components/EmptyListHint.styles.luau +26 -0
  214. package/out/ui/packages/virtualList/index.d.ts +2 -0
  215. package/out/ui/packages/virtualList/init.luau +1 -0
  216. package/package.json +2 -2
  217. package/out/theme/styles/utilities/interaction.d.ts +0 -13
  218. package/out/theme/styles/utilities/interaction.luau +0 -68
package/README.md CHANGED
@@ -2,35 +2,13 @@
2
2
 
3
3
  # uiblox-rbxts
4
4
 
5
- > This package is a work in progress.
6
-
7
5
  UI library and theming for roblox-ts projects.
8
6
 
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
7
  ## Overview
25
8
 
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.
9
+ Uiblox is a roblox-ts UI kit: semantic themes, `makeStyles` / `createStyles`, and typed React components for Studio and games. Public APIs aim for familiar Material UI–style capability (props and behavior), implemented independently for Roblox Instances, input modes, and performance.
28
10
 
29
- UIBlox-rbxts aims to provide extensible components that can be reusable by
30
- anyone who installs this npm package. It also offers a theme and styling system
31
- that aids UI/UX consistentency.
32
-
33
- How does it do this? Well, there are two main exports from this package:
11
+ Main exports from `@rbxts/uiblox`:
34
12
 
35
13
  - @rbxts/uiblox -> theme
36
14
  - An extensible Theme type + default Dark (default) and Light themes
@@ -46,9 +24,47 @@ How does it do this? Well, there are two main exports from this package:
46
24
 
47
25
  ### Installation
48
26
 
49
- Install the package to get started.
27
+ ```
28
+ npm install @rbxts/uiblox
29
+ ```
30
+
31
+ ## Quickstart
32
+
33
+ 1. Wrap your app (or a subtree) in `ThemeProvider` with `DarkTheme` or `LightTheme`.
34
+ 2. Build styles with `makeStyles` / `createStyles` (or `componentStyles`) and spread them onto Instances.
35
+ 3. For hover/press/focus/disabled (and list `_first` / `_last`), put `_hover`-style keys on the style table and call `resolveStyle(style, state)` before spreading.
36
+ 4. Use packaged components from `@rbxts/uiblox` (`Button`, `Input`, `Select`, …).
37
+ 5. Preview components in [Storyblox](https://github.com/bjlarouche/storyblox) with `*.stories` modules.
38
+
39
+ Token reference (spacing, density, typography, shape, palette, `resolveStyle`): [docs/STYLING.md](docs/STYLING.md).
40
+
41
+ ```tsx
42
+ import React from "@rbxts/react";
43
+ import { Button, DarkTheme, ThemeProvider } from "@rbxts/uiblox";
44
+
45
+ export function App() {
46
+ return (
47
+ <ThemeProvider theme={DarkTheme}>
48
+ <Button text="Continue" onLeftClick={() => {}} />
49
+ </ThemeProvider>
50
+ );
51
+ }
52
+ ```
53
+
54
+ ## Parity checklist
55
+
56
+ Capability parity, not pixel parity. For each public component, expect:
57
+
58
+ - [ ] Typed controlled props where interaction needs state
59
+ - [ ] Theme tokens (light/dark) via `ThemeProvider`
60
+ - [ ] Style slots / variants through the styling helpers
61
+ - [ ] Disabled / loading / error when the control type warrants it
62
+ - [ ] Mouse, touch, and gamepad-friendly activation where interactive
63
+ - [ ] Cleanup and focused unit checks in-repo
64
+ - [ ] `stateMatrix` rows for visual capture planning
65
+ - [ ] A Storyblox story (dev fixtures OK)
50
66
 
51
- `npm install @rbxts/uiblox`
67
+ Skipped on purpose: browser-only addons (MDX, iframes, hosted visual-review clouds).
52
68
 
53
69
  ## Example
54
70
 
@@ -253,14 +269,15 @@ keeps the spinner still.
253
269
 
254
270
  `stateMatrix` is the gallery list for Storyblox. Each row is one shot: `theme`
255
271
  (`Dark` or `Light`), `width`, and `pointer` (`rest`, `hover`, `press`, or
256
- `focus`). `open` means the Select list is showing. `options` and `disabledOption`
257
- build RadioGroup, Select, and Tabs. `selected` and `filter` are TreeView.
258
- `value`, `text`, `disabled`, `loading`, `mixed`, `hasError`, and `placeholder`
259
- are that control's props. `variant`, `animation` (`pulse`, `shimmer`, or
260
- `false`), `reducedMotion`, and `indeterminate` cover skeleton and progress
261
- shots. Those shots stay still when `animation` is `false` or `reducedMotion`
262
- is set. Hover, press, and focus rows are only there when the
263
- control actually changes.
272
+ `focus`). Rows are built in small helper functions and concatenated so the
273
+ compiled Luau chunk stays under the 200-local register limit. `open` means the
274
+ Select list is showing. `options` and `disabledOption` build RadioGroup, Select,
275
+ and Tabs. `selected` and `filter` are TreeView. `value`, `text`, `disabled`,
276
+ `loading`, `mixed`, `hasError`, and `placeholder` are that control's props.
277
+ `variant`, `animation` (`pulse`, `shimmer`, or `false`), `reducedMotion`, and
278
+ `indeterminate` cover skeleton and progress shots. Those shots stay still when
279
+ `animation` is `false` or `reducedMotion` is set. Hover, press, and focus rows
280
+ are only there when the control actually changes.
264
281
 
265
282
  ### Client
266
283
 
@@ -1,6 +1,8 @@
1
- import { IconSizes } from "../interfaces/index";
2
- export declare const SPACING_BASE = 12;
1
+ import { IconSizes } from "../interfaces/iconSizes/index";
2
+ export declare const SPACING_BASE = 8;
3
3
  export declare const PADDING_BASE = 4;
4
4
  export declare const BORDER_RADIUS = 4;
5
+ /** UICorner scale for pill/capsule controls (1 = fully round). */
6
+ export declare const PILL_SCALE = 1;
5
7
  export declare const CONTENT_WIDTH = 1024;
6
8
  export declare const ICON_SIZES: IconSizes;
@@ -1,18 +1,20 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
- local SPACING_BASE = 12
2
+ local SPACING_BASE = 8
3
3
  local PADDING_BASE = 4
4
- -- align with UIBlox design
5
4
  local BORDER_RADIUS = 4
5
+ --* UICorner scale for pill/capsule controls (1 = fully round).
6
+ local PILL_SCALE = 1
6
7
  local CONTENT_WIDTH = 1024
7
8
  local ICON_SIZES = {
8
9
  small = 16,
9
- medium = 36,
10
- large = 48,
10
+ medium = 24,
11
+ large = 32,
11
12
  }
12
13
  return {
13
14
  SPACING_BASE = SPACING_BASE,
14
15
  PADDING_BASE = PADDING_BASE,
15
16
  BORDER_RADIUS = BORDER_RADIUS,
17
+ PILL_SCALE = PILL_SCALE,
16
18
  CONTENT_WIDTH = CONTENT_WIDTH,
17
19
  ICON_SIZES = ICON_SIZES,
18
20
  }
@@ -1,5 +1,5 @@
1
1
  import React from "@rbxts/react";
2
- import { Theme } from "../interfaces/index";
2
+ import { Theme } from "../interfaces/theme/index";
3
3
  import { CustomizedProps } from "../types/index";
4
4
  import { ThemeScope } from "./themeScope";
5
5
  export declare const ThemeContext: React.Context<ThemeScope<Theme> | undefined>;
@@ -1,4 +1,4 @@
1
- import { Theme } from "../interfaces/index";
1
+ import { Theme } from "../interfaces/theme/index";
2
2
  declare const useTheme: () => {
3
3
  theme: Theme;
4
4
  setTheme: (theme: Theme) => void;
@@ -1,4 +1,4 @@
1
- import { Tokens } from "../../../index";
1
+ import { Tokens } from "../../tokens/index";
2
2
  export type ColorTokens = {
3
3
  [key in Tokens]: Color3;
4
4
  };
@@ -1,3 +1,6 @@
1
1
  export default interface Shape {
2
+ /** Pixel radius for squared controls (Button, Input, Paper). */
2
3
  borderRadius: number;
4
+ /** UICorner scale for capsules (Switch, Chip). Use `new UDim(pillScale, 0)`. */
5
+ pillScale: number;
3
6
  }
@@ -1,3 +1,3 @@
1
1
  import { FontSizeOptions } from "./FontSizeOptions";
2
- export declare const baseFontSize = 16;
2
+ export declare const baseFontSize: number;
3
3
  export declare const allFontSizes: FontSizeOptions;
@@ -1,13 +1,20 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
- local baseFontSize = 16
2
+ local TS = _G[script]
3
+ local allTypographyVariants = TS.import(script, script.Parent, "Variants").allTypographyVariants
4
+ local baseFontSize = allTypographyVariants.body.size
3
5
  local allFontSizes = {
4
- h1 = baseFontSize * 2,
5
- h2 = baseFontSize * 1.5,
6
- h3 = baseFontSize * 1.25,
7
- body = baseFontSize,
8
- caption = baseFontSize * 0.75,
9
- overline = baseFontSize * 0.625,
10
- button = baseFontSize * 0.875,
6
+ h1 = allTypographyVariants.h1.size,
7
+ h2 = allTypographyVariants.h2.size,
8
+ h3 = allTypographyVariants.h3.size,
9
+ h4 = allTypographyVariants.h4.size,
10
+ h5 = allTypographyVariants.h5.size,
11
+ h6 = allTypographyVariants.h6.size,
12
+ subtitle1 = allTypographyVariants.subtitle1.size,
13
+ subtitle2 = allTypographyVariants.subtitle2.size,
14
+ body = allTypographyVariants.body.size,
15
+ caption = allTypographyVariants.caption.size,
16
+ overline = allTypographyVariants.overline.size,
17
+ button = allTypographyVariants.button.size,
11
18
  }
12
19
  return {
13
20
  baseFontSize = baseFontSize,
@@ -1,7 +1,10 @@
1
1
  import { FontFamilyOptions } from "./FontFamilyOptions";
2
2
  import { FontSizeOptions } from "./FontSizeOptions";
3
+ import { FontSizeVariant } from "./FontSizeOptions";
4
+ import { TypographyVariantSpec } from "./Variants";
3
5
  interface ThemeTypography {
4
6
  fontSizes: FontSizeOptions;
5
7
  fontFamilies: FontFamilyOptions;
8
+ variants: Record<FontSizeVariant, TypographyVariantSpec>;
6
9
  }
7
10
  export default ThemeTypography;
@@ -1,18 +1,17 @@
1
- import { Tokens } from "../tokens/Tokens";
2
- export type TypographyTokens = {
3
- [key in Tokens]: string;
4
- };
5
- export interface TypographyWeights {
1
+ import { FontFamilyVariant } from "./FontFamilyOptions";
2
+ import { FontSizeVariant } from "./FontSizeOptions";
3
+ export interface TypographyVariantSpec {
4
+ size: number;
5
+ family: FontFamilyVariant;
6
+ /** Approx CSS weight; Roblox TextLabel uses `family` / FontFace */
7
+ weight: number;
8
+ }
9
+ export type TypographyVariants = FontSizeVariant;
10
+ /** Size + family + weight per typography variant. */
11
+ export declare const allTypographyVariants: Record<FontSizeVariant, TypographyVariantSpec>;
12
+ /** @deprecated prefer allTypographyVariants[*].weight */
13
+ export declare const TypographyWeights: {
6
14
  title: number;
7
15
  heading: number;
8
16
  body: number;
9
- xl?: number;
10
- lg?: number;
11
- md?: number;
12
- sm?: number;
13
- xs?: number;
14
- default?: number;
15
- }
16
- export type TypographyVariants = keyof TypographyWeights;
17
- export declare const TypographyWeights: TypographyWeights;
18
- export declare const TypographyTokens: TypographyTokens;
17
+ };
@@ -1,24 +1,74 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
- local TypographyWeights = {
3
- title = 800,
4
- heading = 500,
5
- body = 300,
2
+ --* Size + family + weight per typography variant.
3
+ local allTypographyVariants = {
4
+ h1 = {
5
+ size = 28,
6
+ family = "bold",
7
+ weight = 700,
8
+ },
9
+ h2 = {
10
+ size = 22,
11
+ family = "bold",
12
+ weight = 700,
13
+ },
14
+ h3 = {
15
+ size = 18,
16
+ family = "semibold",
17
+ weight = 600,
18
+ },
19
+ h4 = {
20
+ size = 16,
21
+ family = "semibold",
22
+ weight = 600,
23
+ },
24
+ h5 = {
25
+ size = 14,
26
+ family = "semibold",
27
+ weight = 600,
28
+ },
29
+ h6 = {
30
+ size = 14,
31
+ family = "semibold",
32
+ weight = 600,
33
+ },
34
+ subtitle1 = {
35
+ size = 16,
36
+ family = "default",
37
+ weight = 400,
38
+ },
39
+ subtitle2 = {
40
+ size = 14,
41
+ family = "semibold",
42
+ weight = 600,
43
+ },
44
+ body = {
45
+ size = 14,
46
+ family = "default",
47
+ weight = 400,
48
+ },
49
+ button = {
50
+ size = 13,
51
+ family = "semibold",
52
+ weight = 600,
53
+ },
54
+ caption = {
55
+ size = 12,
56
+ family = "default",
57
+ weight = 400,
58
+ },
59
+ overline = {
60
+ size = 10,
61
+ family = "default",
62
+ weight = 400,
63
+ },
6
64
  }
7
- local TypographyTokens = {
8
- [120] = "64px",
9
- [110] = "48px",
10
- [100] = "40px",
11
- [90] = "32px",
12
- [80] = "28px",
13
- [70] = "24px",
14
- [60] = "20px",
15
- [50] = "18px",
16
- [40] = "16px",
17
- [30] = "14px",
18
- [20] = "12px",
19
- [10] = "10px",
65
+ --* @deprecated prefer allTypographyVariants[*].weight
66
+ local TypographyWeights = {
67
+ title = 700,
68
+ heading = 600,
69
+ body = 400,
20
70
  }
21
71
  return {
22
- TypographyTokens = TypographyTokens,
72
+ allTypographyVariants = allTypographyVariants,
23
73
  TypographyWeights = TypographyWeights,
24
74
  }
@@ -4,4 +4,4 @@ export { default as classNames, cx } from "./classNames";
4
4
  export { applyVariants, CompoundVariant } from "./variants";
5
5
  export { default as componentStyles } from "./componentStyles";
6
6
  export { resolveResponsive, Responsive } from "../../../hooks/breakpoints";
7
- export { interactionStyle, InteractionSlots, InteractionState } from "./interaction";
7
+ export { interactionStyle, InteractionSlots, InteractionState, resolveStyle, StyleSelectorKey, StyleState, StyleWithSelectors, } from "./resolveStyle";
@@ -9,5 +9,7 @@ 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
11
  exports.resolveResponsive = TS.import(script, script.Parent.Parent.Parent, "hooks", "breakpoints").resolveResponsive
12
- exports.interactionStyle = TS.import(script, script, "interaction").interactionStyle
12
+ local _resolveStyle = TS.import(script, script, "resolveStyle")
13
+ exports.interactionStyle = _resolveStyle.interactionStyle
14
+ exports.resolveStyle = _resolveStyle.resolveStyle
13
15
  return exports
@@ -0,0 +1,32 @@
1
+ export type StyleSelectorKey = "_hover" | "_pressed" | "_focus" | "_disabled" | "_selected" | "_checked" | "_first" | "_last";
2
+ export interface StyleState {
3
+ hover?: boolean;
4
+ pressed?: boolean;
5
+ focused?: boolean;
6
+ disabled?: boolean;
7
+ selected?: boolean;
8
+ checked?: boolean;
9
+ first?: boolean;
10
+ last?: boolean;
11
+ }
12
+ export type StyleWithSelectors<T extends object = object> = T & {
13
+ _hover?: Partial<T>;
14
+ _pressed?: Partial<T>;
15
+ _focus?: Partial<T>;
16
+ _disabled?: Partial<T>;
17
+ _selected?: Partial<T>;
18
+ _checked?: Partial<T>;
19
+ _first?: Partial<T>;
20
+ _last?: Partial<T>;
21
+ };
22
+ export interface InteractionSlots<T extends object = object> {
23
+ hover?: T;
24
+ pressed?: T;
25
+ focused?: T;
26
+ disabled?: T;
27
+ }
28
+ export type InteractionState = Pick<StyleState, "hover" | "pressed" | "focused" | "disabled">;
29
+ /** Peels `_hover` / `_pressed` / `_focus` / … and merges active ones onto the Instance props. */
30
+ export declare function resolveStyle<T extends object>(style: StyleWithSelectors<T>, state?: StyleState): T;
31
+ /** Prefer `resolveStyle` with `_hover` keys. Kept for existing call sites. */
32
+ export declare function interactionStyle<T extends object>(base: T, slots: InteractionSlots<T>, state: InteractionState): T;
@@ -0,0 +1,66 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ --* Order matters: later keys win. Structural first, then interaction; `_disabled` last.
3
+ local SELECTORS = { { "_first", "first" }, { "_last", "last" }, { "_selected", "selected" }, { "_checked", "checked" }, { "_hover", "hover" }, { "_pressed", "pressed" }, { "_focus", "focused" }, { "_disabled", "disabled" } }
4
+ local SELECTOR_FLAGS = {
5
+ _hover = true,
6
+ _pressed = true,
7
+ _focus = true,
8
+ _selected = true,
9
+ _checked = true,
10
+ _first = true,
11
+ _last = true,
12
+ _disabled = true,
13
+ }
14
+ --* Peels `_hover` / `_pressed` / `_focus` / … and merges active ones onto the Instance props.
15
+ local function resolveStyle(style, state)
16
+ if state == nil then
17
+ state = {}
18
+ end
19
+ local base = {}
20
+ local patches = {}
21
+ for key, value in pairs(style) do
22
+ local name = key
23
+ if SELECTOR_FLAGS[name] == true then
24
+ patches[name] = value
25
+ else
26
+ base[name] = value
27
+ end
28
+ end
29
+ local painted = base
30
+ for _, _binding in SELECTORS do
31
+ local selector = _binding[1]
32
+ local flag = _binding[2]
33
+ local patch = patches[selector]
34
+ if state[flag] == true and patch ~= nil then
35
+ local _object = {}
36
+ if painted then
37
+ for _k, _v in painted do
38
+ _object[_k] = _v
39
+ end
40
+ end
41
+ for _k, _v in patch do
42
+ _object[_k] = _v
43
+ end
44
+ painted = _object
45
+ end
46
+ end
47
+ return painted
48
+ end
49
+ --* Prefer `resolveStyle` with `_hover` keys. Kept for existing call sites.
50
+ local function interactionStyle(base, slots, state)
51
+ local _object = {}
52
+ if base then
53
+ for _k, _v in base do
54
+ _object[_k] = _v
55
+ end
56
+ end
57
+ _object._hover = slots.hover
58
+ _object._pressed = slots.pressed
59
+ _object._focus = slots.focused
60
+ _object._disabled = slots.disabled
61
+ return resolveStyle(_object, state)
62
+ end
63
+ return {
64
+ resolveStyle = resolveStyle,
65
+ interactionStyle = interactionStyle,
66
+ }
@@ -6,9 +6,11 @@ local BORDER_RADIUS = _NumberConstants.BORDER_RADIUS
6
6
  local CONTENT_WIDTH = _NumberConstants.CONTENT_WIDTH
7
7
  local ICON_SIZES = _NumberConstants.ICON_SIZES
8
8
  local PADDING_BASE = _NumberConstants.PADDING_BASE
9
+ local PILL_SCALE = _NumberConstants.PILL_SCALE
9
10
  local SPACING_BASE = _NumberConstants.SPACING_BASE
10
11
  local DEFAULT_BORDERS = TS.import(script, script.Parent.Parent, "constants", "ColorConstants").DEFAULT_BORDERS
11
12
  local allFontFamilies = TS.import(script, script.Parent.Parent, "interfaces", "typography", "FontFamilies").allFontFamilies
13
+ local allTypographyVariants = TS.import(script, script.Parent.Parent, "interfaces", "typography", "Variants").allTypographyVariants
12
14
  local createDarkPalette = TS.import(script, script.Parent, "createPalette").createDarkPalette
13
15
  local DarkTheme = {
14
16
  type = "Dark",
@@ -28,10 +30,12 @@ local DarkTheme = {
28
30
  },
29
31
  shape = {
30
32
  borderRadius = BORDER_RADIUS,
33
+ pillScale = PILL_SCALE,
31
34
  },
32
35
  typography = {
33
36
  fontSizes = allFontSizes,
34
37
  fontFamilies = allFontFamilies,
38
+ variants = allTypographyVariants,
35
39
  },
36
40
  options = {
37
41
  constants = {
@@ -6,9 +6,11 @@ local BORDER_RADIUS = _NumberConstants.BORDER_RADIUS
6
6
  local CONTENT_WIDTH = _NumberConstants.CONTENT_WIDTH
7
7
  local ICON_SIZES = _NumberConstants.ICON_SIZES
8
8
  local PADDING_BASE = _NumberConstants.PADDING_BASE
9
+ local PILL_SCALE = _NumberConstants.PILL_SCALE
9
10
  local SPACING_BASE = _NumberConstants.SPACING_BASE
10
11
  local DEFAULT_BORDERS = TS.import(script, script.Parent.Parent, "constants", "ColorConstants").DEFAULT_BORDERS
11
12
  local allFontFamilies = TS.import(script, script.Parent.Parent, "interfaces", "typography", "FontFamilies").allFontFamilies
13
+ local allTypographyVariants = TS.import(script, script.Parent.Parent, "interfaces", "typography", "Variants").allTypographyVariants
12
14
  local createLightPalette = TS.import(script, script.Parent, "createPalette").createLightPalette
13
15
  local LightTheme = {
14
16
  type = "Light",
@@ -28,10 +30,12 @@ local LightTheme = {
28
30
  },
29
31
  shape = {
30
32
  borderRadius = BORDER_RADIUS,
33
+ pillScale = PILL_SCALE,
31
34
  },
32
35
  typography = {
33
36
  fontSizes = allFontSizes,
34
37
  fontFamilies = allFontFamilies,
38
+ variants = allTypographyVariants,
35
39
  },
36
40
  options = {
37
41
  constants = {
@@ -1,5 +1,5 @@
1
1
  import React, { PropsWithChildren } from "@rbxts/react";
2
- import { WriteableStyle } from "../interfaces/index";
2
+ import { WriteableStyle } from "../styles/index";
3
3
  export interface CommonProps<T extends Instance> extends PropsWithChildren {
4
4
  className?: WriteableStyle<T>;
5
5
  sx?: WriteableStyle<T>;
@@ -4,6 +4,7 @@ export interface AccordionProps {
4
4
  title: string;
5
5
  open?: boolean;
6
6
  defaultOpen?: boolean;
7
+ disabled?: boolean;
7
8
  onChange?: (open: boolean) => void;
8
9
  children?: React.ReactNode;
9
10
  }
@@ -10,6 +10,7 @@ local function Accordion(props)
10
10
  local title = _binding.title
11
11
  local controlled = _binding.open
12
12
  local defaultOpen = _binding.defaultOpen
13
+ local disabled = _binding.disabled
13
14
  local onChange = _binding.onChange
14
15
  local children = _binding.children
15
16
  local className = _binding.className
@@ -20,8 +21,12 @@ local function Accordion(props)
20
21
  local open = accordionOpen(localOpen, controlled)
21
22
  local styles = useAccordionStyles({
22
23
  open = open,
24
+ disabled = disabled,
23
25
  })
24
26
  local toggle = function()
27
+ if disabled == true then
28
+ return nil
29
+ end
25
30
  local nextOpen = not open
26
31
  if controlled == nil then
27
32
  setLocalOpen(nextOpen)
@@ -1,4 +1,5 @@
1
1
  declare const useAccordionStyles: (props: {
2
2
  open?: boolean;
3
+ disabled?: boolean;
3
4
  }) => import("../../../../theme/index").ClassNameMap<string>;
4
5
  export default useAccordionStyles;
@@ -8,6 +8,7 @@ local useAccordionStyles = componentStyles("Accordion", function(theme, _param)
8
8
  if open == nil then
9
9
  open = false
10
10
  end
11
+ local disabled = _param.disabled
11
12
  return createStyles({
12
13
  root = {
13
14
  AutomaticSize = Enum.AutomaticSize.Y,
@@ -27,8 +28,8 @@ local useAccordionStyles = componentStyles("Accordion", function(theme, _param)
27
28
  BorderSizePixel = 0,
28
29
  AutoButtonColor = false,
29
30
  Text = "",
30
- Active = true,
31
- Selectable = true,
31
+ Active = disabled ~= true,
32
+ Selectable = disabled ~= true,
32
33
  },
33
34
  title = {
34
35
  AutomaticSize = Enum.AutomaticSize.XY,
@@ -38,6 +39,7 @@ local useAccordionStyles = componentStyles("Accordion", function(theme, _param)
38
39
  Font = theme.typography.fontFamilies.default,
39
40
  TextSize = theme.typography.fontSizes.body,
40
41
  TextColor3 = theme.palette.text.primary,
42
+ TextTransparency = if disabled == true then 0.5 else 0,
41
43
  TextXAlignment = Enum.TextXAlignment.Left,
42
44
  },
43
45
  padding = {
@@ -0,0 +1,10 @@
1
+ import { CustomizedProps } from "../../../../theme/index";
2
+ import { AlertSeverity } from "./alertTone";
3
+ export interface AlertProps {
4
+ severity?: AlertSeverity;
5
+ title?: string;
6
+ message: string;
7
+ onClose?: () => void;
8
+ }
9
+ declare function Alert(props: CustomizedProps<Frame, AlertProps>): JSX.Element;
10
+ export default Alert;