@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.
- package/LICENSE +21 -0
- package/README.md +263 -0
- package/out/index.d.ts +2 -0
- package/out/init.lua +10 -0
- package/out/theme/components/ThemeProvider.d.ts +7 -0
- package/out/theme/components/ThemeProvider.lua +37 -0
- package/out/theme/components/ThemeStore.d.ts +14 -0
- package/out/theme/components/ThemeStore.lua +29 -0
- package/out/theme/components/ThemeWrapper.d.ts +7 -0
- package/out/theme/components/ThemeWrapper.lua +52 -0
- package/out/theme/components/index.d.ts +8 -0
- package/out/theme/components/init.lua +10 -0
- package/out/theme/constants/NumberConstants.d.ts +6 -0
- package/out/theme/constants/NumberConstants.lua +18 -0
- package/out/theme/constants/ThemeConstants.d.ts +5 -0
- package/out/theme/constants/ThemeConstants.lua +104 -0
- package/out/theme/constants/index.d.ts +2 -0
- package/out/theme/constants/init.lua +10 -0
- package/out/theme/index.d.ts +20 -0
- package/out/theme/init.lua +27 -0
- package/out/theme/interfaces/IconSizes/IconSizes.d.ts +5 -0
- package/out/theme/interfaces/IconSizes/IconSizes.lua +2 -0
- package/out/theme/interfaces/IconSizes/index.d.ts +1 -0
- package/out/theme/interfaces/IconSizes/init.lua +2 -0
- package/out/theme/interfaces/Palette/ColorTokens/ColorTokens.d.ts +5 -0
- package/out/theme/interfaces/Palette/ColorTokens/ColorTokens.lua +2 -0
- package/out/theme/interfaces/Palette/ColorTokens/index.d.ts +1 -0
- package/out/theme/interfaces/Palette/ColorTokens/init.lua +2 -0
- package/out/theme/interfaces/Palette/Colors/Blue.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Blue.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Colors.d.ts +43 -0
- package/out/theme/interfaces/Palette/Colors/Colors.lua +2 -0
- package/out/theme/interfaces/Palette/Colors/Common.d.ts +7 -0
- package/out/theme/interfaces/Palette/Colors/Common.lua +9 -0
- package/out/theme/interfaces/Palette/Colors/Dark.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Dark.lua +24 -0
- package/out/theme/interfaces/Palette/Colors/Gray.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Gray.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Green.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Green.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Light.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Light.lua +8 -0
- package/out/theme/interfaces/Palette/Colors/Magenta.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Magenta.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Orange.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Orange.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Purple.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Purple.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Red.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Red.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Turquoise.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Turquoise.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Yellow.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Yellow.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/index.d.ts +13 -0
- package/out/theme/interfaces/Palette/Colors/init.lua +16 -0
- package/out/theme/interfaces/Palette/Palette.d.ts +27 -0
- package/out/theme/interfaces/Palette/Palette.lua +2 -0
- package/out/theme/interfaces/Palette/index.d.ts +3 -0
- package/out/theme/interfaces/Palette/init.lua +7 -0
- package/out/theme/interfaces/Spacing/Borders.d.ts +4 -0
- package/out/theme/interfaces/Spacing/Borders.lua +2 -0
- package/out/theme/interfaces/Spacing/Padding.d.ts +4 -0
- package/out/theme/interfaces/Spacing/Padding.lua +2 -0
- package/out/theme/interfaces/Spacing/Shape.d.ts +3 -0
- package/out/theme/interfaces/Spacing/Shape.lua +2 -0
- package/out/theme/interfaces/Spacing/Spacing.d.ts +4 -0
- package/out/theme/interfaces/Spacing/Spacing.lua +2 -0
- package/out/theme/interfaces/Spacing/index.d.ts +4 -0
- package/out/theme/interfaces/Spacing/init.lua +2 -0
- package/out/theme/interfaces/Theme/Theme.d.ts +14 -0
- package/out/theme/interfaces/Theme/Theme.lua +2 -0
- package/out/theme/interfaces/Theme/ThemeConstants.d.ts +25 -0
- package/out/theme/interfaces/Theme/ThemeConstants.lua +2 -0
- package/out/theme/interfaces/Theme/ThemeOptions.d.ts +4 -0
- package/out/theme/interfaces/Theme/ThemeOptions.lua +2 -0
- package/out/theme/interfaces/Theme/index.d.ts +3 -0
- package/out/theme/interfaces/Theme/init.lua +2 -0
- package/out/theme/interfaces/Tokens/Tokens.d.ts +1 -0
- package/out/theme/interfaces/Tokens/Tokens.lua +2 -0
- package/out/theme/interfaces/Tokens/index.d.ts +1 -0
- package/out/theme/interfaces/Tokens/init.lua +2 -0
- package/out/theme/interfaces/index.d.ts +13 -0
- package/out/theme/interfaces/init.lua +16 -0
- package/out/theme/interfaces/typography/FontFamilies.d.ts +2 -0
- package/out/theme/interfaces/typography/FontFamilies.lua +11 -0
- package/out/theme/interfaces/typography/FontFamilyOptions.d.ts +5 -0
- package/out/theme/interfaces/typography/FontFamilyOptions.lua +2 -0
- package/out/theme/interfaces/typography/FontSizeOptions.d.ts +4 -0
- package/out/theme/interfaces/typography/FontSizeOptions.lua +2 -0
- package/out/theme/interfaces/typography/FontSizes.d.ts +3 -0
- package/out/theme/interfaces/typography/FontSizes.lua +15 -0
- package/out/theme/interfaces/typography/ThemeTypography.d.ts +7 -0
- package/out/theme/interfaces/typography/ThemeTypography.lua +2 -0
- package/out/theme/interfaces/typography/Variants.d.ts +18 -0
- package/out/theme/interfaces/typography/Variants.lua +24 -0
- package/out/theme/interfaces/typography/index.d.ts +8 -0
- package/out/theme/interfaces/typography/init.lua +13 -0
- package/out/theme/styles/index.d.ts +5 -0
- package/out/theme/styles/init.lua +7 -0
- package/out/theme/styles/types/WriteableStyle.d.ts +3 -0
- package/out/theme/styles/types/WriteableStyle.lua +2 -0
- package/out/theme/styles/types/index.d.ts +2 -0
- package/out/theme/styles/types/init.lua +2 -0
- package/out/theme/styles/types/styles.d.ts +4 -0
- package/out/theme/styles/types/styles.lua +2 -0
- package/out/theme/styles/utilities/classNames.d.ts +8 -0
- package/out/theme/styles/utilities/classNames.lua +31 -0
- package/out/theme/styles/utilities/createStyles.d.ts +3 -0
- package/out/theme/styles/utilities/createStyles.lua +8 -0
- package/out/theme/styles/utilities/index.d.ts +3 -0
- package/out/theme/styles/utilities/init.lua +7 -0
- package/out/theme/styles/utilities/makeStyles.d.ts +7 -0
- package/out/theme/styles/utilities/makeStyles.lua +32 -0
- package/out/theme/themes/DarkTheme.d.ts +3 -0
- package/out/theme/themes/DarkTheme.lua +99 -0
- package/out/theme/themes/LightTheme.d.ts +3 -0
- package/out/theme/themes/LightTheme.lua +99 -0
- package/out/theme/themes/index.d.ts +3 -0
- package/out/theme/themes/init.lua +7 -0
- package/out/theme/types/index.d.ts +7 -0
- package/out/theme/types/init.lua +2 -0
- package/out/theme/types/types.d.ts +16 -0
- package/out/theme/types/types.lua +3 -0
- package/out/theme/utilites/Color3FromHex.d.ts +2 -0
- package/out/theme/utilites/Color3FromHex.lua +14 -0
- package/out/theme/utilites/index.d.ts +1 -0
- package/out/theme/utilites/init.lua +5 -0
- package/out/ui/constants/ImageConstants.d.ts +2 -0
- package/out/ui/constants/ImageConstants.lua +7 -0
- package/out/ui/constants/LayoutConstants.d.ts +1 -0
- package/out/ui/constants/LayoutConstants.lua +7 -0
- package/out/ui/constants/index.d.ts +2 -0
- package/out/ui/constants/init.lua +10 -0
- package/out/ui/enums/Directions.d.ts +8 -0
- package/out/ui/enums/Directions.lua +23 -0
- package/out/ui/enums/Icons.d.ts +40 -0
- package/out/ui/enums/Icons.lua +87 -0
- package/out/ui/enums/Orientations.d.ts +4 -0
- package/out/ui/enums/Orientations.lua +15 -0
- package/out/ui/enums/index.d.ts +3 -0
- package/out/ui/enums/init.lua +7 -0
- package/out/ui/index.d.ts +34 -0
- package/out/ui/init.lua +24 -0
- package/out/ui/packages/button/components/Button.d.ts +26 -0
- package/out/ui/packages/button/components/Button.lua +175 -0
- package/out/ui/packages/button/components/Button.styles.d.ts +3 -0
- package/out/ui/packages/button/components/Button.styles.lua +149 -0
- package/out/ui/packages/button/index.d.ts +6 -0
- package/out/ui/packages/button/init.lua +8 -0
- package/out/ui/packages/button/types/ButtonColor.d.ts +1 -0
- package/out/ui/packages/button/types/ButtonColor.lua +2 -0
- package/out/ui/packages/button/types/ButtonSize.d.ts +1 -0
- package/out/ui/packages/button/types/ButtonSize.lua +2 -0
- package/out/ui/packages/button/types/ButtonVariant.d.ts +1 -0
- package/out/ui/packages/button/types/ButtonVariant.lua +2 -0
- package/out/ui/packages/button/types/index.d.ts +3 -0
- package/out/ui/packages/button/types/init.lua +2 -0
- package/out/ui/packages/divider/components/Divider.d.ts +18 -0
- package/out/ui/packages/divider/components/Divider.lua +27 -0
- package/out/ui/packages/divider/components/Divider.styles.d.ts +3 -0
- package/out/ui/packages/divider/components/Divider.styles.lua +42 -0
- package/out/ui/packages/divider/index.d.ts +3 -0
- package/out/ui/packages/divider/init.lua +8 -0
- package/out/ui/packages/icon/components/Icon.d.ts +11 -0
- package/out/ui/packages/icon/components/Icon.lua +31 -0
- package/out/ui/packages/icon/components/Icon.styles.d.ts +3 -0
- package/out/ui/packages/icon/components/Icon.styles.lua +47 -0
- package/out/ui/packages/icon/index.d.ts +3 -0
- package/out/ui/packages/icon/init.lua +8 -0
- package/out/ui/packages/iconButton/components/IconButton.d.ts +13 -0
- package/out/ui/packages/iconButton/components/IconButton.lua +48 -0
- package/out/ui/packages/iconButton/components/IconButton.styles.d.ts +3 -0
- package/out/ui/packages/iconButton/components/IconButton.styles.lua +47 -0
- package/out/ui/packages/iconButton/index.d.ts +3 -0
- package/out/ui/packages/iconButton/init.lua +8 -0
- package/out/ui/packages/index.d.ts +11 -0
- package/out/ui/packages/init.lua +37 -0
- package/out/ui/packages/input/components/Input.d.ts +26 -0
- package/out/ui/packages/input/components/Input.lua +165 -0
- package/out/ui/packages/input/components/Input.styles.d.ts +3 -0
- package/out/ui/packages/input/components/Input.styles.lua +156 -0
- package/out/ui/packages/input/index.d.ts +6 -0
- package/out/ui/packages/input/init.lua +8 -0
- package/out/ui/packages/input/types/InputColor.d.ts +1 -0
- package/out/ui/packages/input/types/InputColor.lua +2 -0
- package/out/ui/packages/input/types/InputMargin.d.ts +1 -0
- package/out/ui/packages/input/types/InputMargin.lua +2 -0
- package/out/ui/packages/input/types/InputVariant.d.ts +1 -0
- package/out/ui/packages/input/types/InputVariant.lua +2 -0
- package/out/ui/packages/input/types/index.d.ts +3 -0
- package/out/ui/packages/input/types/init.lua +2 -0
- package/out/ui/packages/progressBar/components/ProgressBar.d.ts +9 -0
- package/out/ui/packages/progressBar/components/ProgressBar.lua +76 -0
- package/out/ui/packages/progressBar/components/ProgressBar.styles.d.ts +2 -0
- package/out/ui/packages/progressBar/components/ProgressBar.styles.lua +47 -0
- package/out/ui/packages/progressBar/index.d.ts +3 -0
- package/out/ui/packages/progressBar/init.lua +8 -0
- package/out/ui/packages/shadow/components/Shadow.d.ts +3 -0
- package/out/ui/packages/shadow/components/Shadow.lua +72 -0
- package/out/ui/packages/shadow/components/Shadow.styles.d.ts +2 -0
- package/out/ui/packages/shadow/components/Shadow.styles.lua +20 -0
- package/out/ui/packages/shadow/index.d.ts +2 -0
- package/out/ui/packages/shadow/init.lua +8 -0
- package/out/ui/packages/sidebar/components/Sidebar.d.ts +11 -0
- package/out/ui/packages/sidebar/components/Sidebar.lua +46 -0
- package/out/ui/packages/sidebar/components/Sidebar.styles.d.ts +3 -0
- package/out/ui/packages/sidebar/components/Sidebar.styles.lua +38 -0
- package/out/ui/packages/sidebar/index.d.ts +4 -0
- package/out/ui/packages/sidebar/init.lua +8 -0
- package/out/ui/packages/sidebar/types/SidebarType.d.ts +1 -0
- package/out/ui/packages/sidebar/types/SidebarType.lua +2 -0
- package/out/ui/packages/sidebar/types/index.d.ts +1 -0
- package/out/ui/packages/sidebar/types/init.lua +2 -0
- package/out/ui/packages/toast/components/Toast.d.ts +11 -0
- package/out/ui/packages/toast/components/Toast.lua +94 -0
- package/out/ui/packages/toast/components/Toast.styles.d.ts +3 -0
- package/out/ui/packages/toast/components/Toast.styles.lua +74 -0
- package/out/ui/packages/toast/enums/ToastVariants.d.ts +7 -0
- package/out/ui/packages/toast/enums/ToastVariants.lua +20 -0
- package/out/ui/packages/toast/index.d.ts +5 -0
- package/out/ui/packages/toast/init.lua +9 -0
- package/out/ui/packages/toast/interfaces/ToastEvent.d.ts +5 -0
- package/out/ui/packages/toast/interfaces/ToastEvent.lua +2 -0
- package/out/ui/packages/treeView/components/TreeView.d.ts +11 -0
- package/out/ui/packages/treeView/components/TreeView.lua +339 -0
- package/out/ui/packages/treeView/components/TreeView.styles.d.ts +2 -0
- package/out/ui/packages/treeView/components/TreeView.styles.lua +91 -0
- package/out/ui/packages/treeView/index.d.ts +6 -0
- package/out/ui/packages/treeView/init.lua +8 -0
- package/out/ui/packages/treeView/interfaces/Branch.d.ts +6 -0
- package/out/ui/packages/treeView/interfaces/Branch.lua +2 -0
- package/out/ui/packages/treeView/interfaces/Leaf.d.ts +4 -0
- package/out/ui/packages/treeView/interfaces/Leaf.lua +2 -0
- package/out/ui/packages/treeView/interfaces/Tree.d.ts +5 -0
- package/out/ui/packages/treeView/interfaces/Tree.lua +2 -0
- package/out/ui/packages/typography/components/Typography.d.ts +21 -0
- package/out/ui/packages/typography/components/Typography.lua +47 -0
- package/out/ui/packages/typography/components/Typography.styles.d.ts +3 -0
- package/out/ui/packages/typography/components/Typography.styles.lua +97 -0
- package/out/ui/packages/typography/index.d.ts +6 -0
- package/out/ui/packages/typography/init.lua +8 -0
- package/out/ui/packages/typography/types/TypographyAlignment.d.ts +1 -0
- package/out/ui/packages/typography/types/TypographyAlignment.lua +2 -0
- package/out/ui/packages/typography/types/TypographyColor.d.ts +1 -0
- package/out/ui/packages/typography/types/TypographyColor.lua +2 -0
- package/out/ui/packages/typography/types/TypographyDisplay.d.ts +1 -0
- package/out/ui/packages/typography/types/TypographyDisplay.lua +2 -0
- package/out/ui/packages/typography/types/index.d.ts +3 -0
- package/out/ui/packages/typography/types/init.lua +2 -0
- package/package.json +68 -0
|
@@ -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,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 @@
|
|
|
1
|
+
export type TypographyColor = "initial" | "inherit" | "primary" | "secondary" | "textPrimary" | "textSecondary" | "error" | "warning";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TypographyDisplay = "initial" | "block" | "inline";
|
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
|
+
}
|