@rbxts/uiblox 0.1.0

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 (251) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +263 -0
  3. package/out/index.d.ts +2 -0
  4. package/out/init.lua +10 -0
  5. package/out/theme/components/ThemeProvider.d.ts +7 -0
  6. package/out/theme/components/ThemeProvider.lua +37 -0
  7. package/out/theme/components/ThemeStore.d.ts +14 -0
  8. package/out/theme/components/ThemeStore.lua +29 -0
  9. package/out/theme/components/ThemeWrapper.d.ts +7 -0
  10. package/out/theme/components/ThemeWrapper.lua +52 -0
  11. package/out/theme/components/index.d.ts +8 -0
  12. package/out/theme/components/init.lua +10 -0
  13. package/out/theme/constants/NumberConstants.d.ts +6 -0
  14. package/out/theme/constants/NumberConstants.lua +18 -0
  15. package/out/theme/constants/ThemeConstants.d.ts +5 -0
  16. package/out/theme/constants/ThemeConstants.lua +104 -0
  17. package/out/theme/constants/index.d.ts +2 -0
  18. package/out/theme/constants/init.lua +10 -0
  19. package/out/theme/index.d.ts +20 -0
  20. package/out/theme/init.lua +27 -0
  21. package/out/theme/interfaces/IconSizes/IconSizes.d.ts +5 -0
  22. package/out/theme/interfaces/IconSizes/IconSizes.lua +2 -0
  23. package/out/theme/interfaces/IconSizes/index.d.ts +1 -0
  24. package/out/theme/interfaces/IconSizes/init.lua +2 -0
  25. package/out/theme/interfaces/Palette/ColorTokens/ColorTokens.d.ts +5 -0
  26. package/out/theme/interfaces/Palette/ColorTokens/ColorTokens.lua +2 -0
  27. package/out/theme/interfaces/Palette/ColorTokens/index.d.ts +1 -0
  28. package/out/theme/interfaces/Palette/ColorTokens/init.lua +2 -0
  29. package/out/theme/interfaces/Palette/Colors/Blue.d.ts +3 -0
  30. package/out/theme/interfaces/Palette/Colors/Blue.lua +21 -0
  31. package/out/theme/interfaces/Palette/Colors/Colors.d.ts +43 -0
  32. package/out/theme/interfaces/Palette/Colors/Colors.lua +2 -0
  33. package/out/theme/interfaces/Palette/Colors/Common.d.ts +7 -0
  34. package/out/theme/interfaces/Palette/Colors/Common.lua +9 -0
  35. package/out/theme/interfaces/Palette/Colors/Dark.d.ts +3 -0
  36. package/out/theme/interfaces/Palette/Colors/Dark.lua +24 -0
  37. package/out/theme/interfaces/Palette/Colors/Gray.d.ts +3 -0
  38. package/out/theme/interfaces/Palette/Colors/Gray.lua +21 -0
  39. package/out/theme/interfaces/Palette/Colors/Green.d.ts +3 -0
  40. package/out/theme/interfaces/Palette/Colors/Green.lua +21 -0
  41. package/out/theme/interfaces/Palette/Colors/Light.d.ts +3 -0
  42. package/out/theme/interfaces/Palette/Colors/Light.lua +8 -0
  43. package/out/theme/interfaces/Palette/Colors/Magenta.d.ts +3 -0
  44. package/out/theme/interfaces/Palette/Colors/Magenta.lua +21 -0
  45. package/out/theme/interfaces/Palette/Colors/Orange.d.ts +3 -0
  46. package/out/theme/interfaces/Palette/Colors/Orange.lua +21 -0
  47. package/out/theme/interfaces/Palette/Colors/Purple.d.ts +3 -0
  48. package/out/theme/interfaces/Palette/Colors/Purple.lua +21 -0
  49. package/out/theme/interfaces/Palette/Colors/Red.d.ts +3 -0
  50. package/out/theme/interfaces/Palette/Colors/Red.lua +21 -0
  51. package/out/theme/interfaces/Palette/Colors/Turquoise.d.ts +3 -0
  52. package/out/theme/interfaces/Palette/Colors/Turquoise.lua +21 -0
  53. package/out/theme/interfaces/Palette/Colors/Yellow.d.ts +3 -0
  54. package/out/theme/interfaces/Palette/Colors/Yellow.lua +21 -0
  55. package/out/theme/interfaces/Palette/Colors/index.d.ts +13 -0
  56. package/out/theme/interfaces/Palette/Colors/init.lua +16 -0
  57. package/out/theme/interfaces/Palette/Palette.d.ts +27 -0
  58. package/out/theme/interfaces/Palette/Palette.lua +2 -0
  59. package/out/theme/interfaces/Palette/index.d.ts +3 -0
  60. package/out/theme/interfaces/Palette/init.lua +7 -0
  61. package/out/theme/interfaces/Spacing/Borders.d.ts +4 -0
  62. package/out/theme/interfaces/Spacing/Borders.lua +2 -0
  63. package/out/theme/interfaces/Spacing/Padding.d.ts +4 -0
  64. package/out/theme/interfaces/Spacing/Padding.lua +2 -0
  65. package/out/theme/interfaces/Spacing/Shape.d.ts +3 -0
  66. package/out/theme/interfaces/Spacing/Shape.lua +2 -0
  67. package/out/theme/interfaces/Spacing/Spacing.d.ts +4 -0
  68. package/out/theme/interfaces/Spacing/Spacing.lua +2 -0
  69. package/out/theme/interfaces/Spacing/index.d.ts +4 -0
  70. package/out/theme/interfaces/Spacing/init.lua +2 -0
  71. package/out/theme/interfaces/Theme/Theme.d.ts +14 -0
  72. package/out/theme/interfaces/Theme/Theme.lua +2 -0
  73. package/out/theme/interfaces/Theme/ThemeConstants.d.ts +25 -0
  74. package/out/theme/interfaces/Theme/ThemeConstants.lua +2 -0
  75. package/out/theme/interfaces/Theme/ThemeOptions.d.ts +4 -0
  76. package/out/theme/interfaces/Theme/ThemeOptions.lua +2 -0
  77. package/out/theme/interfaces/Theme/index.d.ts +3 -0
  78. package/out/theme/interfaces/Theme/init.lua +2 -0
  79. package/out/theme/interfaces/Tokens/Tokens.d.ts +1 -0
  80. package/out/theme/interfaces/Tokens/Tokens.lua +2 -0
  81. package/out/theme/interfaces/Tokens/index.d.ts +1 -0
  82. package/out/theme/interfaces/Tokens/init.lua +2 -0
  83. package/out/theme/interfaces/index.d.ts +13 -0
  84. package/out/theme/interfaces/init.lua +16 -0
  85. package/out/theme/interfaces/typography/FontFamilies.d.ts +2 -0
  86. package/out/theme/interfaces/typography/FontFamilies.lua +11 -0
  87. package/out/theme/interfaces/typography/FontFamilyOptions.d.ts +5 -0
  88. package/out/theme/interfaces/typography/FontFamilyOptions.lua +2 -0
  89. package/out/theme/interfaces/typography/FontSizeOptions.d.ts +4 -0
  90. package/out/theme/interfaces/typography/FontSizeOptions.lua +2 -0
  91. package/out/theme/interfaces/typography/FontSizes.d.ts +3 -0
  92. package/out/theme/interfaces/typography/FontSizes.lua +15 -0
  93. package/out/theme/interfaces/typography/ThemeTypography.d.ts +7 -0
  94. package/out/theme/interfaces/typography/ThemeTypography.lua +2 -0
  95. package/out/theme/interfaces/typography/Variants.d.ts +18 -0
  96. package/out/theme/interfaces/typography/Variants.lua +24 -0
  97. package/out/theme/interfaces/typography/index.d.ts +8 -0
  98. package/out/theme/interfaces/typography/init.lua +13 -0
  99. package/out/theme/styles/index.d.ts +5 -0
  100. package/out/theme/styles/init.lua +7 -0
  101. package/out/theme/styles/types/WriteableStyle.d.ts +3 -0
  102. package/out/theme/styles/types/WriteableStyle.lua +2 -0
  103. package/out/theme/styles/types/index.d.ts +2 -0
  104. package/out/theme/styles/types/init.lua +2 -0
  105. package/out/theme/styles/types/styles.d.ts +4 -0
  106. package/out/theme/styles/types/styles.lua +2 -0
  107. package/out/theme/styles/utilities/classNames.d.ts +8 -0
  108. package/out/theme/styles/utilities/classNames.lua +31 -0
  109. package/out/theme/styles/utilities/createStyles.d.ts +3 -0
  110. package/out/theme/styles/utilities/createStyles.lua +8 -0
  111. package/out/theme/styles/utilities/index.d.ts +3 -0
  112. package/out/theme/styles/utilities/init.lua +7 -0
  113. package/out/theme/styles/utilities/makeStyles.d.ts +7 -0
  114. package/out/theme/styles/utilities/makeStyles.lua +32 -0
  115. package/out/theme/themes/DarkTheme.d.ts +3 -0
  116. package/out/theme/themes/DarkTheme.lua +99 -0
  117. package/out/theme/themes/LightTheme.d.ts +3 -0
  118. package/out/theme/themes/LightTheme.lua +99 -0
  119. package/out/theme/themes/index.d.ts +3 -0
  120. package/out/theme/themes/init.lua +7 -0
  121. package/out/theme/types/index.d.ts +7 -0
  122. package/out/theme/types/init.lua +2 -0
  123. package/out/theme/types/types.d.ts +16 -0
  124. package/out/theme/types/types.lua +3 -0
  125. package/out/theme/utilites/Color3FromHex.d.ts +2 -0
  126. package/out/theme/utilites/Color3FromHex.lua +14 -0
  127. package/out/theme/utilites/index.d.ts +1 -0
  128. package/out/theme/utilites/init.lua +5 -0
  129. package/out/ui/constants/ImageConstants.d.ts +2 -0
  130. package/out/ui/constants/ImageConstants.lua +7 -0
  131. package/out/ui/constants/LayoutConstants.d.ts +1 -0
  132. package/out/ui/constants/LayoutConstants.lua +7 -0
  133. package/out/ui/constants/index.d.ts +2 -0
  134. package/out/ui/constants/init.lua +10 -0
  135. package/out/ui/enums/Directions.d.ts +8 -0
  136. package/out/ui/enums/Directions.lua +23 -0
  137. package/out/ui/enums/Icons.d.ts +40 -0
  138. package/out/ui/enums/Icons.lua +87 -0
  139. package/out/ui/enums/Orientations.d.ts +4 -0
  140. package/out/ui/enums/Orientations.lua +15 -0
  141. package/out/ui/enums/index.d.ts +3 -0
  142. package/out/ui/enums/init.lua +7 -0
  143. package/out/ui/index.d.ts +34 -0
  144. package/out/ui/init.lua +24 -0
  145. package/out/ui/packages/button/components/Button.d.ts +26 -0
  146. package/out/ui/packages/button/components/Button.lua +175 -0
  147. package/out/ui/packages/button/components/Button.styles.d.ts +3 -0
  148. package/out/ui/packages/button/components/Button.styles.lua +149 -0
  149. package/out/ui/packages/button/index.d.ts +6 -0
  150. package/out/ui/packages/button/init.lua +8 -0
  151. package/out/ui/packages/button/types/ButtonColor.d.ts +1 -0
  152. package/out/ui/packages/button/types/ButtonColor.lua +2 -0
  153. package/out/ui/packages/button/types/ButtonSize.d.ts +1 -0
  154. package/out/ui/packages/button/types/ButtonSize.lua +2 -0
  155. package/out/ui/packages/button/types/ButtonVariant.d.ts +1 -0
  156. package/out/ui/packages/button/types/ButtonVariant.lua +2 -0
  157. package/out/ui/packages/button/types/index.d.ts +3 -0
  158. package/out/ui/packages/button/types/init.lua +2 -0
  159. package/out/ui/packages/divider/components/Divider.d.ts +18 -0
  160. package/out/ui/packages/divider/components/Divider.lua +27 -0
  161. package/out/ui/packages/divider/components/Divider.styles.d.ts +3 -0
  162. package/out/ui/packages/divider/components/Divider.styles.lua +42 -0
  163. package/out/ui/packages/divider/index.d.ts +3 -0
  164. package/out/ui/packages/divider/init.lua +8 -0
  165. package/out/ui/packages/icon/components/Icon.d.ts +11 -0
  166. package/out/ui/packages/icon/components/Icon.lua +31 -0
  167. package/out/ui/packages/icon/components/Icon.styles.d.ts +3 -0
  168. package/out/ui/packages/icon/components/Icon.styles.lua +47 -0
  169. package/out/ui/packages/icon/index.d.ts +3 -0
  170. package/out/ui/packages/icon/init.lua +8 -0
  171. package/out/ui/packages/iconButton/components/IconButton.d.ts +13 -0
  172. package/out/ui/packages/iconButton/components/IconButton.lua +48 -0
  173. package/out/ui/packages/iconButton/components/IconButton.styles.d.ts +3 -0
  174. package/out/ui/packages/iconButton/components/IconButton.styles.lua +47 -0
  175. package/out/ui/packages/iconButton/index.d.ts +3 -0
  176. package/out/ui/packages/iconButton/init.lua +8 -0
  177. package/out/ui/packages/index.d.ts +11 -0
  178. package/out/ui/packages/init.lua +37 -0
  179. package/out/ui/packages/input/components/Input.d.ts +26 -0
  180. package/out/ui/packages/input/components/Input.lua +165 -0
  181. package/out/ui/packages/input/components/Input.styles.d.ts +3 -0
  182. package/out/ui/packages/input/components/Input.styles.lua +156 -0
  183. package/out/ui/packages/input/index.d.ts +6 -0
  184. package/out/ui/packages/input/init.lua +8 -0
  185. package/out/ui/packages/input/types/InputColor.d.ts +1 -0
  186. package/out/ui/packages/input/types/InputColor.lua +2 -0
  187. package/out/ui/packages/input/types/InputMargin.d.ts +1 -0
  188. package/out/ui/packages/input/types/InputMargin.lua +2 -0
  189. package/out/ui/packages/input/types/InputVariant.d.ts +1 -0
  190. package/out/ui/packages/input/types/InputVariant.lua +2 -0
  191. package/out/ui/packages/input/types/index.d.ts +3 -0
  192. package/out/ui/packages/input/types/init.lua +2 -0
  193. package/out/ui/packages/progressBar/components/ProgressBar.d.ts +9 -0
  194. package/out/ui/packages/progressBar/components/ProgressBar.lua +76 -0
  195. package/out/ui/packages/progressBar/components/ProgressBar.styles.d.ts +2 -0
  196. package/out/ui/packages/progressBar/components/ProgressBar.styles.lua +47 -0
  197. package/out/ui/packages/progressBar/index.d.ts +3 -0
  198. package/out/ui/packages/progressBar/init.lua +8 -0
  199. package/out/ui/packages/shadow/components/Shadow.d.ts +3 -0
  200. package/out/ui/packages/shadow/components/Shadow.lua +72 -0
  201. package/out/ui/packages/shadow/components/Shadow.styles.d.ts +2 -0
  202. package/out/ui/packages/shadow/components/Shadow.styles.lua +20 -0
  203. package/out/ui/packages/shadow/index.d.ts +2 -0
  204. package/out/ui/packages/shadow/init.lua +8 -0
  205. package/out/ui/packages/sidebar/components/Sidebar.d.ts +11 -0
  206. package/out/ui/packages/sidebar/components/Sidebar.lua +46 -0
  207. package/out/ui/packages/sidebar/components/Sidebar.styles.d.ts +3 -0
  208. package/out/ui/packages/sidebar/components/Sidebar.styles.lua +38 -0
  209. package/out/ui/packages/sidebar/index.d.ts +4 -0
  210. package/out/ui/packages/sidebar/init.lua +8 -0
  211. package/out/ui/packages/sidebar/types/SidebarType.d.ts +1 -0
  212. package/out/ui/packages/sidebar/types/SidebarType.lua +2 -0
  213. package/out/ui/packages/sidebar/types/index.d.ts +1 -0
  214. package/out/ui/packages/sidebar/types/init.lua +2 -0
  215. package/out/ui/packages/toast/components/Toast.d.ts +11 -0
  216. package/out/ui/packages/toast/components/Toast.lua +94 -0
  217. package/out/ui/packages/toast/components/Toast.styles.d.ts +3 -0
  218. package/out/ui/packages/toast/components/Toast.styles.lua +74 -0
  219. package/out/ui/packages/toast/enums/ToastVariants.d.ts +7 -0
  220. package/out/ui/packages/toast/enums/ToastVariants.lua +20 -0
  221. package/out/ui/packages/toast/index.d.ts +5 -0
  222. package/out/ui/packages/toast/init.lua +9 -0
  223. package/out/ui/packages/toast/interfaces/ToastEvent.d.ts +5 -0
  224. package/out/ui/packages/toast/interfaces/ToastEvent.lua +2 -0
  225. package/out/ui/packages/treeView/components/TreeView.d.ts +11 -0
  226. package/out/ui/packages/treeView/components/TreeView.lua +339 -0
  227. package/out/ui/packages/treeView/components/TreeView.styles.d.ts +2 -0
  228. package/out/ui/packages/treeView/components/TreeView.styles.lua +91 -0
  229. package/out/ui/packages/treeView/index.d.ts +6 -0
  230. package/out/ui/packages/treeView/init.lua +8 -0
  231. package/out/ui/packages/treeView/interfaces/Branch.d.ts +6 -0
  232. package/out/ui/packages/treeView/interfaces/Branch.lua +2 -0
  233. package/out/ui/packages/treeView/interfaces/Leaf.d.ts +4 -0
  234. package/out/ui/packages/treeView/interfaces/Leaf.lua +2 -0
  235. package/out/ui/packages/treeView/interfaces/Tree.d.ts +5 -0
  236. package/out/ui/packages/treeView/interfaces/Tree.lua +2 -0
  237. package/out/ui/packages/typography/components/Typography.d.ts +21 -0
  238. package/out/ui/packages/typography/components/Typography.lua +47 -0
  239. package/out/ui/packages/typography/components/Typography.styles.d.ts +3 -0
  240. package/out/ui/packages/typography/components/Typography.styles.lua +97 -0
  241. package/out/ui/packages/typography/index.d.ts +6 -0
  242. package/out/ui/packages/typography/init.lua +8 -0
  243. package/out/ui/packages/typography/types/TypographyAlignment.d.ts +1 -0
  244. package/out/ui/packages/typography/types/TypographyAlignment.lua +2 -0
  245. package/out/ui/packages/typography/types/TypographyColor.d.ts +1 -0
  246. package/out/ui/packages/typography/types/TypographyColor.lua +2 -0
  247. package/out/ui/packages/typography/types/TypographyDisplay.d.ts +1 -0
  248. package/out/ui/packages/typography/types/TypographyDisplay.lua +2 -0
  249. package/out/ui/packages/typography/types/index.d.ts +3 -0
  250. package/out/ui/packages/typography/types/init.lua +2 -0
  251. package/package.json +68 -0
@@ -0,0 +1,6 @@
1
+ import Leaf from "./Leaf";
2
+ export default interface Branch {
3
+ title: string;
4
+ leaves: Leaf[];
5
+ onClick?: () => void;
6
+ }
@@ -0,0 +1,2 @@
1
+ -- Compiled with roblox-ts v2.2.0
2
+ return nil
@@ -0,0 +1,4 @@
1
+ export default interface Leaf {
2
+ title: string;
3
+ onClick?: () => void;
4
+ }
@@ -0,0 +1,2 @@
1
+ -- Compiled with roblox-ts v2.2.0
2
+ return nil
@@ -0,0 +1,5 @@
1
+ import Branch from "./Branch";
2
+ export default interface Tree {
3
+ title: string;
4
+ branches: Branch[];
5
+ }
@@ -0,0 +1,2 @@
1
+ -- Compiled with roblox-ts v2.2.0
2
+ return nil
@@ -0,0 +1,21 @@
1
+ /// <reference types="@rbxts/types" />
2
+ /// <reference types="roact" />
3
+ import Roact from "@rbxts/roact";
4
+ import { CustomizedProps } from "../../../../theme";
5
+ import { FontFamilyVariant, FontSizeVariant } from "../../../../theme/interfaces/typography";
6
+ import { TypographyAlignment } from "../types/TypographyAlignment";
7
+ import { TypographyColor } from "../types/TypographyColor";
8
+ import { TypographyDisplay } from "../types/TypographyDisplay";
9
+ type DefaultTypographyComponent = TextLabel;
10
+ export interface TypographyProps {
11
+ text?: string;
12
+ variant?: FontSizeVariant;
13
+ family?: FontFamilyVariant;
14
+ color?: TypographyColor;
15
+ display?: TypographyDisplay;
16
+ align?: TypographyAlignment;
17
+ noWrap?: boolean;
18
+ lineClamp?: boolean;
19
+ }
20
+ declare function Typography<T extends DefaultTypographyComponent>(props: CustomizedProps<T, TypographyProps>): Roact.Element;
21
+ export default Typography;
@@ -0,0 +1,47 @@
1
+ -- Compiled with roblox-ts v2.2.0
2
+ local TS = _G[script]
3
+ local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src)
4
+ local useTypographyStyles = TS.import(script, script.Parent, "Typography.styles").default
5
+ local function Typography(props)
6
+ local _binding = props
7
+ local text = _binding.text
8
+ if text == nil then
9
+ text = ""
10
+ end
11
+ local className = _binding.className
12
+ local children = _binding[Roact.Children]
13
+ local _binding_1 = useTypographyStyles(props)
14
+ local root = _binding_1.root
15
+ local variantToken = _binding_1.variantToken
16
+ local _attributes = {}
17
+ for _k, _v in root do
18
+ _attributes[_k] = _v
19
+ end
20
+ _attributes.Text = text
21
+ if className then
22
+ for _k, _v in className do
23
+ _attributes[_k] = _v
24
+ end
25
+ end
26
+ for _k, _v in variantToken do
27
+ _attributes[_k] = _v
28
+ end
29
+ local _children = {}
30
+ local _length = #_children
31
+ if children then
32
+ for _k, _v in children do
33
+ if type(_k) == "number" then
34
+ _children[_length + _k] = _v
35
+ else
36
+ _children[_k] = _v
37
+ end
38
+ end
39
+ end
40
+ return Roact.createFragment({
41
+ Typography = Roact.createElement("TextLabel", _attributes, _children),
42
+ })
43
+ end
44
+ local default = Typography
45
+ return {
46
+ default = default,
47
+ }
@@ -0,0 +1,3 @@
1
+ import { TypographyProps } from "./Typography";
2
+ declare const useTypographyStyles: (props: TypographyProps) => import("../../../../theme").ClassNameMap<string>;
3
+ export default useTypographyStyles;
@@ -0,0 +1,97 @@
1
+ -- Compiled with roblox-ts v2.2.0
2
+ local TS = _G[script]
3
+ local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
4
+ local createStyles = _theme.createStyles
5
+ local makeStyles = _theme.makeStyles
6
+ local useTypographyStyles = makeStyles(function(theme, _param)
7
+ local color = _param.color
8
+ if color == nil then
9
+ color = "initial"
10
+ end
11
+ local variant = _param.variant
12
+ if variant == nil then
13
+ variant = "body"
14
+ end
15
+ local family = _param.family
16
+ if family == nil then
17
+ family = "default"
18
+ end
19
+ local align = _param.align
20
+ if align == nil then
21
+ align = "left"
22
+ end
23
+ local noWrap = _param.noWrap
24
+ if noWrap == nil then
25
+ noWrap = false
26
+ end
27
+ local lineClamp = _param.lineClamp
28
+ if lineClamp == nil then
29
+ lineClamp = false
30
+ end
31
+ local DEFAULT_COLOR = theme.palette.text.primary
32
+ -- Map of room size to stud dimensions
33
+ local COLOR_TO_PALLETTE_MAP = {
34
+ initial = DEFAULT_COLOR,
35
+ primary = theme.palette.primary.main,
36
+ secondary = theme.palette.secondary.main,
37
+ textPrimary = theme.palette.text.primary,
38
+ textSecondary = theme.palette.text.secondary,
39
+ error = theme.palette.error.main,
40
+ warning = theme.palette.warning.main,
41
+ }
42
+ local COLOR_TO_PALETTE = function(color, parent)
43
+ if color == "inherit" and parent then
44
+ if parent:IsA("TextLabel") or parent:IsA("TextButton") then
45
+ return parent.TextColor3
46
+ end
47
+ return DEFAULT_COLOR
48
+ end
49
+ local _color = color
50
+ local lookup = COLOR_TO_PALLETTE_MAP[_color]
51
+ return lookup or DEFAULT_COLOR
52
+ end
53
+ local makeRootStyles = function()
54
+ local defaultStyles = {}
55
+ if color == "warning" then
56
+ defaultStyles.TextColor3 = theme.options.constants.colors.caution
57
+ elseif color then
58
+ defaultStyles.TextColor3 = COLOR_TO_PALETTE(color)
59
+ end
60
+ repeat
61
+ if align == "left" then
62
+ defaultStyles.TextXAlignment = Enum.TextXAlignment.Left
63
+ break
64
+ end
65
+ if align == "center" then
66
+ defaultStyles.TextXAlignment = Enum.TextXAlignment.Center
67
+ break
68
+ end
69
+ if align == "right" then
70
+ defaultStyles.TextXAlignment = Enum.TextXAlignment.Right
71
+ break
72
+ end
73
+ defaultStyles.TextXAlignment = Enum.TextXAlignment.Left
74
+ break
75
+ until true
76
+ defaultStyles.TextColor3 = color and COLOR_TO_PALETTE(color)
77
+ -- eslint-disable-next-line roblox-ts/lua-truthiness
78
+ defaultStyles.TextWrapped = not noWrap
79
+ defaultStyles.ClipsDescendants = lineClamp
80
+ defaultStyles.BackgroundTransparency = 1
81
+ defaultStyles.BorderSizePixel = 0
82
+ defaultStyles.Size = UDim2.new(1, 0, 1, 0)
83
+ defaultStyles.ZIndex = 10000
84
+ return defaultStyles
85
+ end
86
+ return createStyles({
87
+ root = makeRootStyles(),
88
+ variantToken = {
89
+ TextSize = variant and theme.typography.fontSizes[variant],
90
+ Font = family and theme.typography.fontFamilies[family],
91
+ },
92
+ })
93
+ end)
94
+ local default = useTypographyStyles
95
+ return {
96
+ default = default,
97
+ }
@@ -0,0 +1,6 @@
1
+ export { default as Typography } from "./components/Typography";
2
+ export { TypographyProps } from "./components/Typography";
3
+ export * from "./components/Typography";
4
+ export { TypographyAlignment } from "./types";
5
+ export { TypographyColor } from "./types";
6
+ export { TypographyDisplay } from "./types";
@@ -0,0 +1,8 @@
1
+ -- Compiled with roblox-ts v2.2.0
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ exports.Typography = TS.import(script, script, "components", "Typography").default
5
+ for _k, _v in TS.import(script, script, "components", "Typography") or {} do
6
+ exports[_k] = _v
7
+ end
8
+ return exports
@@ -0,0 +1 @@
1
+ export type TypographyAlignment = "left" | "center" | "right";
@@ -0,0 +1,2 @@
1
+ -- Compiled with roblox-ts v2.2.0
2
+ return nil
@@ -0,0 +1 @@
1
+ export type TypographyColor = "initial" | "inherit" | "primary" | "secondary" | "textPrimary" | "textSecondary" | "error" | "warning";
@@ -0,0 +1,2 @@
1
+ -- Compiled with roblox-ts v2.2.0
2
+ return nil
@@ -0,0 +1 @@
1
+ export type TypographyDisplay = "initial" | "block" | "inline";
@@ -0,0 +1,2 @@
1
+ -- Compiled with roblox-ts v2.2.0
2
+ return nil
@@ -0,0 +1,3 @@
1
+ export { TypographyAlignment } from "./TypographyAlignment";
2
+ export { TypographyColor } from "./TypographyColor";
3
+ export { TypographyDisplay } from "./TypographyDisplay";
@@ -0,0 +1,2 @@
1
+ -- Compiled with roblox-ts v2.2.0
2
+ return nil
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@rbxts/uiblox",
3
+ "version": "0.1.0",
4
+ "description": "UI Library and theming for roblox-ts projects",
5
+ "main": "out/init.lua",
6
+ "scripts": {
7
+ "build": "rbxtsc",
8
+ "watch": "rbxtsc -w",
9
+ "prepublishOnly": "npm run build"
10
+ },
11
+ "keywords": [
12
+ "roblox-ts",
13
+ "ui",
14
+ "uiblox",
15
+ "design",
16
+ "library",
17
+ "material",
18
+ "component",
19
+ "system"
20
+ ],
21
+ "author": "bjlarouche",
22
+ "license": "MIT",
23
+ "types": "out/index.d.ts",
24
+ "files": [
25
+ "out",
26
+ "!**/*.tsbuildinfo"
27
+ ],
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "devDependencies": {
32
+ "@rbxts/boat-tween": "^1.0.1",
33
+ "@rbxts/compiler-types": "^2.2.0-types.0",
34
+ "@rbxts/roact": "^1.4.4-ts.0",
35
+ "@rbxts/services": "^1.2.0",
36
+ "@rbxts/types": "^1.0.729",
37
+ "@typescript-eslint/eslint-plugin": "^6.9.0",
38
+ "@typescript-eslint/parser": "^6.9.0",
39
+ "eslint": "^8.52.0",
40
+ "eslint-config-prettier": "^9.0.0",
41
+ "eslint-plugin-prettier": "^5.0.1",
42
+ "eslint-plugin-roblox-ts": "^0.0.36",
43
+ "prettier": "^3.0.3",
44
+ "roblox-ts": "^2.2.0",
45
+ "typescript": "^5.2.2"
46
+ },
47
+ "dependencies": {
48
+ "@rbxts/roact": "^1.4.4-ts.0",
49
+ "@rbxts/roact-hooked": "^2.6.2",
50
+ "@rbxts/roact-rodux-hooked": "^1.1.3",
51
+ "@rbxts/rodux": "^3.0.0-ts.3",
52
+ "@rbxts/roselect": "^0.1.1"
53
+ },
54
+ "peerDependencies": {
55
+ "@rbxts/roact": "^1.4.4-ts.0"
56
+ },
57
+ "directories": {
58
+ "doc": "docs"
59
+ },
60
+ "repository": {
61
+ "type": "git",
62
+ "url": "git+https://github.com/bjlarouche/uiblox-rbxts.git"
63
+ },
64
+ "bugs": {
65
+ "url": "https://github.com/bjlarouche/uiblox-rbxts/issues"
66
+ },
67
+ "homepage": "https://github.com/bjlarouche/uiblox-rbxts#readme"
68
+ }