@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
package/README.md CHANGED
@@ -36,6 +36,8 @@ npm install @rbxts/uiblox
36
36
  4. Use packaged components from `@rbxts/uiblox` (`Button`, `Input`, `Select`, …).
37
37
  5. Preview components in [Storyblox](https://github.com/bjlarouche/storyblox) with `*.stories` modules.
38
38
 
39
+ Token reference (spacing, density, typography, shape, palette, `resolveStyle`): [docs/STYLING.md](docs/STYLING.md).
40
+
39
41
  ```tsx
40
42
  import React from "@rbxts/react";
41
43
  import { Button, DarkTheme, ThemeProvider } from "@rbxts/uiblox";
@@ -267,14 +269,15 @@ keeps the spinner still.
267
269
 
268
270
  `stateMatrix` is the gallery list for Storyblox. Each row is one shot: `theme`
269
271
  (`Dark` or `Light`), `width`, and `pointer` (`rest`, `hover`, `press`, or
270
- `focus`). `open` means the Select list is showing. `options` and `disabledOption`
271
- build RadioGroup, Select, and Tabs. `selected` and `filter` are TreeView.
272
- `value`, `text`, `disabled`, `loading`, `mixed`, `hasError`, and `placeholder`
273
- are that control's props. `variant`, `animation` (`pulse`, `shimmer`, or
274
- `false`), `reducedMotion`, and `indeterminate` cover skeleton and progress
275
- shots. Those shots stay still when `animation` is `false` or `reducedMotion`
276
- is set. Hover, press, and focus rows are only there when the
277
- 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.
278
281
 
279
282
  ### Client
280
283
 
@@ -1,6 +1,8 @@
1
- import { IconSizes } from "../interfaces/index";
1
+ 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
+ /** 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;
@@ -2,6 +2,8 @@
2
2
  local SPACING_BASE = 8
3
3
  local PADDING_BASE = 4
4
4
  local BORDER_RADIUS = 4
5
+ --* UICorner scale for pill/capsule controls (1 = fully round).
6
+ local PILL_SCALE = 1
5
7
  local CONTENT_WIDTH = 1024
6
8
  local ICON_SIZES = {
7
9
  small = 16,
@@ -12,6 +14,7 @@ return {
12
14
  SPACING_BASE = SPACING_BASE,
13
15
  PADDING_BASE = PADDING_BASE,
14
16
  BORDER_RADIUS = BORDER_RADIUS,
17
+ PILL_SCALE = PILL_SCALE,
15
18
  CONTENT_WIDTH = CONTENT_WIDTH,
16
19
  ICON_SIZES = ICON_SIZES,
17
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 = 14;
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 = 14
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 = 28,
5
- h2 = 22,
6
- h3 = 18,
7
- body = baseFontSize,
8
- caption = 12,
9
- overline = 10,
10
- button = 13,
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
  }
@@ -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;
@@ -0,0 +1,98 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
5
+ local useAlertStyles = TS.import(script, script.Parent, "Alert.styles").default
6
+ local function Alert(props)
7
+ local _binding = props
8
+ local severity = _binding.severity
9
+ local title = _binding.title
10
+ local message = _binding.message
11
+ local onClose = _binding.onClose
12
+ local className = _binding.className
13
+ local sx = _binding.sx
14
+ local id = _binding.id
15
+ local ref = _binding.ref
16
+ local dismissible = onClose ~= nil
17
+ local styles = useAlertStyles({
18
+ severity = severity,
19
+ dismissible = dismissible,
20
+ })
21
+ local _attributes = {}
22
+ local _condition = id
23
+ if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
24
+ _condition = "Alert"
25
+ end
26
+ _attributes.key = _condition
27
+ _attributes.ref = ref
28
+ for _k, _v in styles.root do
29
+ _attributes[_k] = _v
30
+ end
31
+ if className then
32
+ for _k, _v in className do
33
+ _attributes[_k] = _v
34
+ end
35
+ end
36
+ if sx then
37
+ for _k, _v in sx do
38
+ _attributes[_k] = _v
39
+ end
40
+ end
41
+ local _attributes_1 = table.clone(styles.padding)
42
+ setmetatable(_attributes_1, nil)
43
+ local _exp = React.createElement("uipadding", _attributes_1)
44
+ local _attributes_2 = table.clone(styles.corner)
45
+ setmetatable(_attributes_2, nil)
46
+ local _exp_1 = React.createElement("uicorner", _attributes_2)
47
+ local _attributes_3 = table.clone(styles.stroke)
48
+ setmetatable(_attributes_3, nil)
49
+ local _exp_2 = React.createElement("uistroke", _attributes_3)
50
+ local _condition_1 = dismissible
51
+ if _condition_1 then
52
+ local _attributes_4 = {
53
+ key = "Close",
54
+ }
55
+ for _k, _v in styles.close do
56
+ _attributes_4[_k] = _v
57
+ end
58
+ _attributes_4.Image = tostring(Icons.Close)
59
+ _attributes_4.Event = {
60
+ Activated = function()
61
+ return onClose()
62
+ end,
63
+ }
64
+ _condition_1 = (React.createElement("imagebutton", _attributes_4))
65
+ end
66
+ local _attributes_4 = {
67
+ key = "Body",
68
+ }
69
+ for _k, _v in styles.body do
70
+ _attributes_4[_k] = _v
71
+ end
72
+ local _attributes_5 = table.clone(styles.layout)
73
+ setmetatable(_attributes_5, nil)
74
+ local _exp_3 = React.createElement("uilistlayout", _attributes_5)
75
+ local _condition_2 = title ~= nil and title ~= ""
76
+ if _condition_2 then
77
+ local _attributes_6 = {
78
+ key = "Title",
79
+ }
80
+ for _k, _v in styles.title do
81
+ _attributes_6[_k] = _v
82
+ end
83
+ _attributes_6.Text = title
84
+ _condition_2 = React.createElement("textlabel", _attributes_6)
85
+ end
86
+ local _attributes_6 = {
87
+ key = "Message",
88
+ }
89
+ for _k, _v in styles.message do
90
+ _attributes_6[_k] = _v
91
+ end
92
+ _attributes_6.Text = message
93
+ return React.createElement("frame", _attributes, _exp, _exp_1, _exp_2, _condition_1, React.createElement("frame", _attributes_4, _exp_3, _condition_2, React.createElement("textlabel", _attributes_6)))
94
+ end
95
+ local default = Alert
96
+ return {
97
+ default = default,
98
+ }
@@ -0,0 +1,6 @@
1
+ import { AlertSeverity } from "./alertTone";
2
+ declare const useAlertStyles: (props: {
3
+ severity?: AlertSeverity;
4
+ dismissible?: boolean;
5
+ }) => import("../../../../theme/index").ClassNameMap<string>;
6
+ export default useAlertStyles;
@@ -0,0 +1,93 @@
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 alertSeverity = TS.import(script, script.Parent, "alertTone").alertSeverity
7
+ local useAlertStyles = componentStyles("Alert", function(theme, _param)
8
+ local severity = _param.severity
9
+ local dismissible = _param.dismissible
10
+ local tone = theme.palette.status[alertSeverity(severity)]
11
+ local closeSize = theme.spacing.calc(2)
12
+ local _object = {
13
+ root = {
14
+ AutomaticSize = Enum.AutomaticSize.Y,
15
+ Size = UDim2.new(1, 0, 0, 0),
16
+ BackgroundColor3 = tone.surface,
17
+ BorderSizePixel = 0,
18
+ },
19
+ padding = {
20
+ PaddingTop = UDim.new(0, theme.padding.calc(1.5)),
21
+ PaddingBottom = UDim.new(0, theme.padding.calc(1.5)),
22
+ PaddingLeft = UDim.new(0, theme.padding.calc(2)),
23
+ PaddingRight = UDim.new(0, theme.padding.calc(2)),
24
+ },
25
+ corner = {
26
+ CornerRadius = UDim.new(0, theme.shape.borderRadius),
27
+ },
28
+ stroke = {
29
+ Color = tone.border,
30
+ Thickness = 1,
31
+ Transparency = 0,
32
+ ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
33
+ },
34
+ body = {
35
+ AutomaticSize = Enum.AutomaticSize.Y,
36
+ Size = UDim2.new(1, if dismissible == true then -(closeSize + theme.padding.calc(1)) else 0, 0, 0),
37
+ BackgroundTransparency = 1,
38
+ BorderSizePixel = 0,
39
+ },
40
+ layout = {
41
+ FillDirection = Enum.FillDirection.Vertical,
42
+ HorizontalAlignment = Enum.HorizontalAlignment.Left,
43
+ VerticalAlignment = Enum.VerticalAlignment.Center,
44
+ SortOrder = Enum.SortOrder.LayoutOrder,
45
+ Padding = UDim.new(0, theme.padding.calc(0.5)),
46
+ },
47
+ title = {
48
+ AutomaticSize = Enum.AutomaticSize.XY,
49
+ Size = UDim2.fromScale(0, 0),
50
+ BackgroundTransparency = 1,
51
+ BorderSizePixel = 0,
52
+ Font = theme.typography.fontFamilies.default,
53
+ TextSize = theme.typography.fontSizes.body,
54
+ TextColor3 = tone.main,
55
+ TextXAlignment = Enum.TextXAlignment.Left,
56
+ LayoutOrder = 1,
57
+ },
58
+ }
59
+ local _left = "message"
60
+ local _object_1 = {
61
+ AutomaticSize = Enum.AutomaticSize.XY,
62
+ Size = UDim2.fromScale(0, 0),
63
+ BackgroundTransparency = 1,
64
+ BorderSizePixel = 0,
65
+ Font = theme.typography.fontFamilies.default,
66
+ }
67
+ local _left_1 = "TextSize"
68
+ local _condition = theme.typography.fontSizes.caption
69
+ if _condition == nil then
70
+ _condition = theme.typography.fontSizes.body
71
+ end
72
+ _object_1[_left_1] = _condition
73
+ _object_1.TextColor3 = theme.palette.text.primary
74
+ _object_1.TextXAlignment = Enum.TextXAlignment.Left
75
+ _object_1.TextWrapped = true
76
+ _object_1.LayoutOrder = 2
77
+ _object[_left] = _object_1
78
+ _object.close = {
79
+ Size = UDim2.fromOffset(closeSize, closeSize),
80
+ Position = UDim2.new(1, 0, 0, 0),
81
+ AnchorPoint = Vector2.new(1, 0),
82
+ BackgroundTransparency = 1,
83
+ BorderSizePixel = 0,
84
+ ImageColor3 = theme.palette.text.secondary,
85
+ ScaleType = Enum.ScaleType.Fit,
86
+ ZIndex = 2,
87
+ }
88
+ return createStyles(_object)
89
+ end)
90
+ local default = useAlertStyles
91
+ return {
92
+ default = default,
93
+ }
@@ -0,0 +1,2 @@
1
+ export type AlertSeverity = "info" | "success" | "warning" | "error";
2
+ export declare function alertSeverity(severity?: AlertSeverity): AlertSeverity;
@@ -0,0 +1,7 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local function alertSeverity(severity)
3
+ return severity or "info"
4
+ end
5
+ return {
6
+ alertSeverity = alertSeverity,
7
+ }
@@ -0,0 +1,3 @@
1
+ export { default as Alert } from "./components/Alert";
2
+ export { AlertProps } from "./components/Alert";
3
+ export { AlertSeverity, alertSeverity } from "./components/alertTone";
@@ -0,0 +1,6 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ exports.Alert = TS.import(script, script, "components", "Alert").default
5
+ exports.alertSeverity = TS.import(script, script, "components", "alertTone").alertSeverity
6
+ return exports
@@ -13,6 +13,10 @@ local function Autocomplete(props)
13
13
  local loading = _binding.loading
14
14
  local placeholder = _binding.placeholder
15
15
  local searchable = _binding.searchable
16
+ local defaultOpen = _binding.defaultOpen
17
+ local defaultQuery = _binding.defaultQuery
18
+ local emptyText = _binding.emptyText
19
+ local empty = _binding.empty
16
20
  local reducedMotion = _binding.reducedMotion
17
21
  local size = _binding.size
18
22
  local className = _binding.className
@@ -28,6 +32,10 @@ local function Autocomplete(props)
28
32
  loading = loading,
29
33
  placeholder = placeholder,
30
34
  searchable = autocompleteSearchable(searchable),
35
+ defaultOpen = defaultOpen,
36
+ defaultQuery = defaultQuery,
37
+ emptyText = emptyText,
38
+ empty = empty,
31
39
  reducedMotion = reducedMotion,
32
40
  size = size,
33
41
  className = className,
@@ -0,0 +1,10 @@
1
+ import React from "@rbxts/react";
2
+ import { CustomizedProps } from "../../../../theme/index";
3
+ export interface BackdropProps {
4
+ open?: boolean;
5
+ invisible?: boolean;
6
+ onClick?: () => void;
7
+ children?: React.ReactNode;
8
+ }
9
+ declare function Backdrop(props: CustomizedProps<TextButton, BackdropProps>): JSX.Element | undefined;
10
+ export default Backdrop;