@rbxts/uiblox 0.1.7 → 0.1.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.
- package/README.md +33 -37
- package/out/index.d.ts +2 -2
- package/out/{init.lua → init.luau} +1 -1
- package/out/theme/components/ThemeProvider.d.ts +3 -3
- package/out/theme/components/{ThemeProvider.lua → ThemeProvider.luau} +6 -22
- package/out/theme/components/ThemeStore.d.ts +1 -2
- package/out/theme/components/{ThemeStore.lua → ThemeStore.luau} +1 -1
- package/out/theme/components/ThemeWrapper.d.ts +3 -3
- package/out/theme/components/{ThemeWrapper.lua → ThemeWrapper.luau} +6 -21
- package/out/theme/components/{init.lua → init.luau} +1 -1
- package/out/theme/constants/NumberConstants.d.ts +1 -1
- package/out/theme/constants/{NumberConstants.lua → NumberConstants.luau} +1 -1
- package/out/theme/constants/ThemeConstants.d.ts +2 -2
- package/out/theme/constants/{ThemeConstants.lua → ThemeConstants.luau} +1 -1
- package/out/theme/constants/{init.lua → init.luau} +1 -1
- package/out/theme/index.d.ts +17 -17
- package/out/theme/{init.lua → init.luau} +1 -1
- package/out/theme/interfaces/iconSizes/IconSizes.luau +2 -0
- package/out/theme/interfaces/iconSizes/init.luau +2 -0
- package/out/theme/interfaces/index.d.ts +13 -13
- package/out/theme/interfaces/{init.lua → init.luau} +1 -1
- package/out/theme/interfaces/palette/Palette.d.ts +0 -1
- package/out/theme/interfaces/palette/Palette.luau +2 -0
- package/out/theme/interfaces/palette/colorTokens/ColorTokens.d.ts +1 -2
- package/out/theme/interfaces/palette/colorTokens/ColorTokens.luau +2 -0
- package/out/theme/interfaces/palette/colorTokens/init.luau +2 -0
- package/out/theme/interfaces/palette/colors/{Blue.lua → Blue.luau} +1 -1
- package/out/theme/interfaces/palette/colors/Colors.d.ts +0 -1
- package/out/theme/interfaces/palette/colors/Colors.luau +2 -0
- package/out/theme/interfaces/palette/colors/Common.d.ts +0 -1
- package/out/theme/interfaces/palette/colors/{Common.lua → Common.luau} +1 -1
- package/out/theme/interfaces/palette/colors/{Dark.lua → Dark.luau} +1 -1
- package/out/theme/interfaces/palette/colors/{Gray.lua → Gray.luau} +1 -1
- package/out/theme/interfaces/palette/colors/{Green.lua → Green.luau} +1 -1
- package/out/theme/interfaces/palette/colors/{Light.lua → Light.luau} +1 -1
- package/out/theme/interfaces/palette/colors/{Magenta.lua → Magenta.luau} +1 -1
- package/out/theme/interfaces/palette/colors/{Orange.lua → Orange.luau} +1 -1
- package/out/theme/interfaces/palette/colors/{Purple.lua → Purple.luau} +1 -1
- package/out/theme/interfaces/palette/colors/{Red.lua → Red.luau} +1 -1
- package/out/theme/interfaces/palette/colors/{Turquoise.lua → Turquoise.luau} +1 -1
- package/out/theme/interfaces/palette/colors/{Yellow.lua → Yellow.luau} +1 -1
- package/out/theme/interfaces/palette/colors/{init.lua → init.luau} +1 -1
- package/out/theme/interfaces/palette/index.d.ts +2 -2
- package/out/theme/interfaces/palette/{init.lua → init.luau} +1 -1
- package/out/theme/interfaces/spacing/Borders.luau +2 -0
- package/out/theme/interfaces/spacing/Padding.luau +2 -0
- package/out/theme/interfaces/spacing/Shape.luau +2 -0
- package/out/theme/interfaces/spacing/Spacing.luau +2 -0
- package/out/theme/interfaces/spacing/init.luau +2 -0
- package/out/theme/interfaces/theme/Theme.d.ts +3 -3
- package/out/theme/interfaces/theme/Theme.luau +2 -0
- package/out/theme/interfaces/theme/ThemeConstants.d.ts +4 -4
- package/out/theme/interfaces/theme/ThemeConstants.luau +2 -0
- package/out/theme/interfaces/theme/ThemeOptions.luau +2 -0
- package/out/theme/interfaces/theme/init.luau +2 -0
- package/out/theme/interfaces/tokens/Tokens.luau +2 -0
- package/out/theme/interfaces/tokens/init.luau +2 -0
- package/out/theme/interfaces/typography/{FontFamilies.lua → FontFamilies.luau} +1 -1
- package/out/theme/interfaces/typography/FontFamilyOptions.d.ts +0 -2
- package/out/theme/interfaces/typography/FontFamilyOptions.luau +2 -0
- package/out/theme/interfaces/typography/FontSizeOptions.d.ts +0 -1
- package/out/theme/interfaces/typography/FontSizeOptions.luau +2 -0
- package/out/theme/interfaces/typography/{FontSizes.lua → FontSizes.luau} +1 -1
- package/out/theme/interfaces/typography/ThemeTypography.luau +2 -0
- package/out/theme/interfaces/typography/{Variants.lua → Variants.luau} +1 -1
- package/out/theme/interfaces/typography/{init.lua → init.luau} +1 -1
- package/out/theme/styles/index.d.ts +5 -5
- package/out/theme/styles/{init.lua → init.luau} +1 -1
- package/out/theme/styles/types/WriteableStyle.d.ts +0 -2
- package/out/theme/styles/types/WriteableStyle.luau +2 -0
- package/out/theme/styles/types/init.luau +2 -0
- package/out/theme/styles/types/styles.d.ts +0 -2
- package/out/theme/styles/types/styles.luau +2 -0
- package/out/theme/styles/utilities/classNames.d.ts +2 -3
- package/out/theme/styles/utilities/classNames.luau +33 -0
- package/out/theme/styles/utilities/{createStyles.lua → createStyles.luau} +1 -1
- package/out/theme/styles/utilities/{init.lua → init.luau} +1 -1
- package/out/theme/styles/utilities/makeStyles.d.ts +1 -1
- package/out/theme/styles/utilities/{makeStyles.lua → makeStyles.luau} +1 -1
- package/out/theme/themes/DarkTheme.d.ts +1 -1
- package/out/theme/themes/{DarkTheme.lua → DarkTheme.luau} +1 -1
- package/out/theme/themes/LightTheme.d.ts +1 -1
- package/out/theme/themes/{LightTheme.lua → LightTheme.luau} +1 -1
- package/out/theme/themes/{init.lua → init.luau} +1 -1
- package/out/theme/types/init.luau +2 -0
- package/out/theme/types/types.d.ts +5 -8
- package/out/theme/types/{types.lua → types.luau} +1 -1
- package/out/theme/utilites/{Color3FromHex.lua → Color3FromHex.luau} +2 -2
- package/out/theme/utilites/{init.lua → init.luau} +1 -1
- package/out/ui/constants/{ImageConstants.lua → ImageConstants.luau} +1 -1
- package/out/ui/constants/{LayoutConstants.lua → LayoutConstants.luau} +1 -1
- package/out/ui/constants/{init.lua → init.luau} +1 -1
- package/out/ui/enums/Directions.luau +12 -0
- package/out/ui/enums/Icons.luau +44 -0
- package/out/ui/enums/Orientations.luau +8 -0
- package/out/ui/enums/{init.lua → init.luau} +1 -1
- package/out/ui/index.d.ts +34 -34
- package/out/ui/{init.lua → init.luau} +1 -1
- package/out/ui/packages/button/components/Button.d.ts +3 -5
- package/out/ui/packages/button/components/{Button.lua → Button.luau} +63 -88
- package/out/ui/packages/button/components/Button.styles.d.ts +1 -1
- package/out/ui/packages/button/components/{Button.styles.lua → Button.styles.luau} +1 -1
- package/out/ui/packages/button/index.d.ts +3 -3
- package/out/ui/packages/button/{init.lua → init.luau} +1 -1
- package/out/ui/packages/button/types/ButtonColor.luau +2 -0
- package/out/ui/packages/button/types/ButtonSize.luau +2 -0
- package/out/ui/packages/button/types/ButtonVariant.luau +2 -0
- package/out/ui/packages/button/types/init.luau +2 -0
- package/out/ui/packages/divider/components/Divider.d.ts +2 -6
- package/out/ui/packages/divider/components/{Divider.lua → Divider.luau} +6 -10
- package/out/ui/packages/divider/components/Divider.styles.d.ts +1 -1
- package/out/ui/packages/divider/components/{Divider.styles.lua → Divider.styles.luau} +1 -1
- package/out/ui/packages/divider/{init.lua → init.luau} +1 -1
- package/out/ui/packages/icon/components/Icon.d.ts +2 -5
- package/out/ui/packages/icon/components/{Icon.lua → Icon.luau} +5 -9
- package/out/ui/packages/icon/components/Icon.styles.d.ts +1 -1
- package/out/ui/packages/icon/components/{Icon.styles.lua → Icon.styles.luau} +1 -1
- package/out/ui/packages/icon/{init.lua → init.luau} +1 -1
- package/out/ui/packages/iconButton/components/IconButton.d.ts +2 -5
- package/out/ui/packages/iconButton/components/{IconButton.lua → IconButton.luau} +18 -20
- package/out/ui/packages/iconButton/components/IconButton.styles.d.ts +1 -1
- package/out/ui/packages/iconButton/components/{IconButton.styles.lua → IconButton.styles.luau} +1 -1
- package/out/ui/packages/iconButton/{init.lua → init.luau} +1 -1
- package/out/ui/packages/index.d.ts +11 -11
- package/out/ui/packages/{init.lua → init.luau} +1 -1
- package/out/ui/packages/input/components/Input.d.ts +2 -6
- package/out/ui/packages/input/components/{Input.lua → Input.luau} +38 -69
- package/out/ui/packages/input/components/Input.styles.d.ts +1 -1
- package/out/ui/packages/input/components/{Input.styles.lua → Input.styles.luau} +1 -1
- package/out/ui/packages/input/index.d.ts +3 -3
- package/out/ui/packages/input/{init.lua → init.luau} +1 -1
- package/out/ui/packages/input/types/InputColor.luau +2 -0
- package/out/ui/packages/input/types/InputMargin.luau +2 -0
- package/out/ui/packages/input/types/InputVariant.luau +2 -0
- package/out/ui/packages/input/types/init.luau +2 -0
- package/out/ui/packages/progressBar/components/ProgressBar.d.ts +1 -3
- package/out/ui/packages/progressBar/components/ProgressBar.luau +46 -0
- package/out/ui/packages/progressBar/components/ProgressBar.styles.d.ts +1 -1
- package/out/ui/packages/progressBar/components/{ProgressBar.styles.lua → ProgressBar.styles.luau} +1 -1
- package/out/ui/packages/progressBar/{init.lua → init.luau} +1 -1
- package/out/ui/packages/shadow/components/Shadow.d.ts +0 -1
- package/out/ui/packages/shadow/components/{Shadow.lua → Shadow.luau} +14 -24
- package/out/ui/packages/shadow/components/Shadow.styles.d.ts +1 -1
- package/out/ui/packages/shadow/components/{Shadow.styles.lua → Shadow.styles.luau} +1 -1
- package/out/ui/packages/shadow/{init.lua → init.luau} +1 -1
- package/out/ui/packages/sidebar/components/Sidebar.d.ts +1 -3
- package/out/ui/packages/sidebar/components/Sidebar.luau +26 -0
- package/out/ui/packages/sidebar/components/Sidebar.styles.d.ts +1 -1
- package/out/ui/packages/sidebar/components/{Sidebar.styles.lua → Sidebar.styles.luau} +1 -1
- package/out/ui/packages/sidebar/index.d.ts +1 -1
- package/out/ui/packages/sidebar/{init.lua → init.luau} +1 -1
- package/out/ui/packages/sidebar/types/SidebarType.luau +2 -0
- package/out/ui/packages/sidebar/types/init.luau +2 -0
- package/out/ui/packages/toast/components/Toast.d.ts +0 -1
- package/out/ui/packages/toast/components/{Toast.lua → Toast.luau} +21 -29
- package/out/ui/packages/toast/components/Toast.styles.d.ts +1 -1
- package/out/ui/packages/toast/components/{Toast.styles.lua → Toast.styles.luau} +1 -1
- package/out/ui/packages/toast/enums/ToastVariants.luau +11 -0
- package/out/ui/packages/toast/{init.lua → init.luau} +1 -1
- package/out/ui/packages/toast/interfaces/ToastEvent.luau +2 -0
- package/out/ui/packages/treeView/components/TreeView.d.ts +2 -4
- package/out/ui/packages/treeView/components/{TreeView.lua → TreeView.luau} +116 -149
- package/out/ui/packages/treeView/components/TreeView.styles.d.ts +1 -1
- package/out/ui/packages/treeView/components/{TreeView.styles.lua → TreeView.styles.luau} +1 -1
- package/out/ui/packages/treeView/{init.lua → init.luau} +1 -1
- package/out/ui/packages/treeView/interfaces/Branch.luau +2 -0
- package/out/ui/packages/treeView/interfaces/Leaf.luau +2 -0
- package/out/ui/packages/treeView/interfaces/Tree.luau +2 -0
- package/out/ui/packages/typography/components/Typography.d.ts +2 -4
- package/out/ui/packages/typography/components/{Typography.lua → Typography.luau} +7 -22
- package/out/ui/packages/typography/components/Typography.styles.d.ts +1 -1
- package/out/ui/packages/typography/components/{Typography.styles.lua → Typography.styles.luau} +1 -1
- package/out/ui/packages/typography/index.d.ts +3 -3
- package/out/ui/packages/typography/{init.lua → init.luau} +1 -1
- package/out/ui/packages/typography/types/TypographyAlignment.luau +2 -0
- package/out/ui/packages/typography/types/TypographyColor.luau +2 -0
- package/out/ui/packages/typography/types/TypographyDisplay.luau +2 -0
- package/out/ui/packages/typography/types/init.luau +2 -0
- package/package.json +16 -19
- package/out/theme/interfaces/iconSizes/IconSizes.lua +0 -2
- package/out/theme/interfaces/iconSizes/init.lua +0 -2
- package/out/theme/interfaces/palette/Palette.lua +0 -2
- package/out/theme/interfaces/palette/colorTokens/ColorTokens.lua +0 -2
- package/out/theme/interfaces/palette/colorTokens/init.lua +0 -2
- package/out/theme/interfaces/palette/colors/Colors.lua +0 -2
- package/out/theme/interfaces/spacing/Borders.lua +0 -2
- package/out/theme/interfaces/spacing/Padding.lua +0 -2
- package/out/theme/interfaces/spacing/Shape.lua +0 -2
- package/out/theme/interfaces/spacing/Spacing.lua +0 -2
- package/out/theme/interfaces/spacing/init.lua +0 -2
- package/out/theme/interfaces/theme/Theme.lua +0 -2
- package/out/theme/interfaces/theme/ThemeConstants.lua +0 -2
- package/out/theme/interfaces/theme/ThemeOptions.lua +0 -2
- package/out/theme/interfaces/theme/init.lua +0 -2
- package/out/theme/interfaces/tokens/Tokens.lua +0 -2
- package/out/theme/interfaces/tokens/init.lua +0 -2
- package/out/theme/interfaces/typography/FontFamilyOptions.lua +0 -2
- package/out/theme/interfaces/typography/FontSizeOptions.lua +0 -2
- package/out/theme/interfaces/typography/ThemeTypography.lua +0 -2
- package/out/theme/styles/types/WriteableStyle.lua +0 -2
- package/out/theme/styles/types/init.lua +0 -2
- package/out/theme/styles/types/styles.lua +0 -2
- package/out/theme/styles/utilities/classNames.lua +0 -31
- package/out/theme/types/init.lua +0 -2
- package/out/ui/enums/Directions.lua +0 -23
- package/out/ui/enums/Icons.lua +0 -87
- package/out/ui/enums/Orientations.lua +0 -15
- package/out/ui/packages/button/types/ButtonColor.lua +0 -2
- package/out/ui/packages/button/types/ButtonSize.lua +0 -2
- package/out/ui/packages/button/types/ButtonVariant.lua +0 -2
- package/out/ui/packages/button/types/init.lua +0 -2
- package/out/ui/packages/input/types/InputColor.lua +0 -2
- package/out/ui/packages/input/types/InputMargin.lua +0 -2
- package/out/ui/packages/input/types/InputVariant.lua +0 -2
- package/out/ui/packages/input/types/init.lua +0 -2
- package/out/ui/packages/progressBar/components/ProgressBar.lua +0 -76
- package/out/ui/packages/sidebar/components/Sidebar.lua +0 -46
- package/out/ui/packages/sidebar/types/SidebarType.lua +0 -2
- package/out/ui/packages/sidebar/types/init.lua +0 -2
- package/out/ui/packages/toast/enums/ToastVariants.lua +0 -20
- package/out/ui/packages/toast/interfaces/ToastEvent.lua +0 -2
- package/out/ui/packages/treeView/interfaces/Branch.lua +0 -2
- package/out/ui/packages/treeView/interfaces/Leaf.lua +0 -2
- package/out/ui/packages/treeView/interfaces/Tree.lua +0 -2
- package/out/ui/packages/typography/types/TypographyAlignment.lua +0 -2
- package/out/ui/packages/typography/types/TypographyColor.lua +0 -2
- package/out/ui/packages/typography/types/TypographyDisplay.lua +0 -2
- package/out/ui/packages/typography/types/init.lua +0 -2
package/README.md
CHANGED
|
@@ -32,16 +32,16 @@ that aids UI/UX consistentency.
|
|
|
32
32
|
|
|
33
33
|
How does it do this? Well, there are two main exports from this package:
|
|
34
34
|
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
|
|
35
|
+
- @rbxts/uiblox -> theme
|
|
36
|
+
- An extensible Theme type + default Dark (default) and Light themes
|
|
37
|
+
- ... Light theme palette is a WIP
|
|
38
|
+
- makeStyles/createStyles utilities to serve up Instance-extended property
|
|
39
|
+
tables that can be applied to your Roact Components
|
|
40
|
+
- ThemeProvider which can wrap your application and uses Rodux to tell
|
|
41
|
+
sub-components which theme to style off of (via makeStyles)
|
|
42
|
+
- Uses Rodux
|
|
43
|
+
- @rbxts/uiblox -> ui
|
|
44
|
+
- Packaged and reusable typed Roact components
|
|
45
45
|
|
|
46
46
|
# How to use
|
|
47
47
|
|
|
@@ -71,13 +71,13 @@ is what we later pass to `Roact.mount()`.
|
|
|
71
71
|
import Roact, { Component } from "@rbxts/roact";
|
|
72
72
|
|
|
73
73
|
class App extends Component {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
render() {
|
|
75
|
+
return (
|
|
76
|
+
<screengui IgnoreGuiInset ZIndexBehavior={Enum.ZIndexBehavior.Global}>
|
|
77
|
+
<AppLayout />
|
|
78
|
+
</screengui>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
export default App;
|
|
@@ -100,19 +100,15 @@ import { DarkTheme, ThemeProvider } from "@rbxts/uiblox";
|
|
|
100
100
|
import usePageLayoutStyles from "./PageLayout.styles";
|
|
101
101
|
|
|
102
102
|
class AppLayout extends Component {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
</frame>
|
|
113
|
-
</ThemeProvider>
|
|
114
|
-
);
|
|
115
|
-
}
|
|
103
|
+
render() {
|
|
104
|
+
return (
|
|
105
|
+
<ThemeProvider theme={DarkTheme}>
|
|
106
|
+
<frame Size={new UDim2(1, 0, 1, 0)} BackgroundTransparency={1}>
|
|
107
|
+
<MyComponent />
|
|
108
|
+
</frame>
|
|
109
|
+
</ThemeProvider>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
116
112
|
}
|
|
117
113
|
|
|
118
114
|
export default AppLayout;
|
|
@@ -145,7 +141,7 @@ function MyComponent(props: MyComponentProps) {
|
|
|
145
141
|
const { root, button } = useMyComponentStyles(props);
|
|
146
142
|
|
|
147
143
|
return (
|
|
148
|
-
<frame
|
|
144
|
+
<frame {...root}>
|
|
149
145
|
<Button
|
|
150
146
|
variant="outlined"
|
|
151
147
|
text={title}
|
|
@@ -249,12 +245,12 @@ new AppLoader().Mount();
|
|
|
249
245
|
|
|
250
246
|
# Future work
|
|
251
247
|
|
|
252
|
-
-
|
|
253
|
-
-
|
|
248
|
+
- More UI packages
|
|
249
|
+
- Finish palette for LightTheme
|
|
254
250
|
|
|
255
251
|
# See Also
|
|
256
252
|
|
|
257
|
-
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
253
|
+
- [Storyblox](https://github.com/bjlarouche/storyblox) a UI component explorer for roblox-ts developers
|
|
254
|
+
- <img src=docs/storyblox-preview.png width=40%>
|
|
255
|
+
- Test it out here [Storyblox Pre-Release Experience](https://www.roblox.com/games/9159382473)
|
|
256
|
+
- Similar to [hoarcekat](https://github.com/Kampfkarren/hoarcekat) by Kampfkarren
|
package/out/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./theme";
|
|
2
|
-
export * from "./ui";
|
|
1
|
+
export * from "./theme/index";
|
|
2
|
+
export * from "./ui/index";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="roact" />
|
|
2
1
|
import Roact from "@rbxts/roact";
|
|
3
|
-
import { Theme } from "../interfaces/theme";
|
|
2
|
+
import { Theme } from "../interfaces/theme/index";
|
|
3
|
+
import { CustomizedProps } from "../types/index";
|
|
4
4
|
export interface ThemeProviderProps {
|
|
5
5
|
theme?: Theme;
|
|
6
6
|
}
|
|
7
|
-
declare function ThemeProvider(props:
|
|
7
|
+
declare function ThemeProvider(props: CustomizedProps<Instance, ThemeProviderProps>): Roact.Element;
|
|
8
8
|
declare const _default: typeof ThemeProvider;
|
|
9
9
|
export default _default;
|
|
@@ -1,35 +1,19 @@
|
|
|
1
|
-
-- Compiled with roblox-ts
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local markPureComponent = TS.import(script, TS.getModule(script, "@rbxts", "roact-hooked").src).markPureComponent
|
|
4
4
|
local StoreProvider = TS.import(script, TS.getModule(script, "@rbxts", "roact-rodux-hooked").src).StoreProvider
|
|
5
|
-
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src)
|
|
5
|
+
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src.ts)
|
|
6
6
|
local themeStore = TS.import(script, script.Parent, "ThemeStore").themeStore
|
|
7
7
|
local ThemeWrapper = TS.import(script, script.Parent, "ThemeWrapper").default
|
|
8
8
|
local function ThemeProvider(props)
|
|
9
9
|
local _binding = props
|
|
10
10
|
local theme = _binding.theme
|
|
11
|
-
local children = _binding
|
|
12
|
-
|
|
11
|
+
local children = _binding.children
|
|
12
|
+
return Roact.jsx(StoreProvider, {
|
|
13
13
|
store = themeStore,
|
|
14
|
-
}
|
|
15
|
-
local _children = {}
|
|
16
|
-
local _length = #_children
|
|
17
|
-
local _attributes_1 = {
|
|
14
|
+
}, Roact.jsx(ThemeWrapper, {
|
|
18
15
|
theme = theme,
|
|
19
|
-
}
|
|
20
|
-
local _children_1 = {}
|
|
21
|
-
local _length_1 = #_children_1
|
|
22
|
-
if children then
|
|
23
|
-
for _k, _v in children do
|
|
24
|
-
if type(_k) == "number" then
|
|
25
|
-
_children_1[_length_1 + _k] = _v
|
|
26
|
-
else
|
|
27
|
-
_children_1[_k] = _v
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
_children[_length + 1] = Roact.createElement(ThemeWrapper, _attributes_1, _children_1)
|
|
32
|
-
return Roact.createElement(StoreProvider, _attributes, _children)
|
|
16
|
+
}, children))
|
|
33
17
|
end
|
|
34
18
|
local default = markPureComponent(ThemeProvider)
|
|
35
19
|
return {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="roact" />
|
|
2
1
|
import Roact from "@rbxts/roact";
|
|
3
|
-
import { Theme } from "../interfaces/theme";
|
|
2
|
+
import { Theme } from "../interfaces/theme/index";
|
|
3
|
+
import { CustomizedProps } from "../types/index";
|
|
4
4
|
export interface ThemeWrapperProps {
|
|
5
5
|
theme?: Theme;
|
|
6
6
|
}
|
|
7
|
-
declare function ThemeWrapper(props:
|
|
7
|
+
declare function ThemeWrapper(props: CustomizedProps<Instance, ThemeWrapperProps>): Roact.Element;
|
|
8
8
|
declare const _default: typeof ThemeWrapper;
|
|
9
9
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
-- Compiled with roblox-ts
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local _roact_hooked = TS.import(script, TS.getModule(script, "@rbxts", "roact-hooked").src)
|
|
4
4
|
local markPureComponent = _roact_hooked.markPureComponent
|
|
@@ -7,13 +7,13 @@ local useRef = _roact_hooked.useRef
|
|
|
7
7
|
local _roact_rodux_hooked = TS.import(script, TS.getModule(script, "@rbxts", "roact-rodux-hooked").src)
|
|
8
8
|
local useDispatch = _roact_rodux_hooked.useDispatch
|
|
9
9
|
local useSelector = _roact_rodux_hooked.useSelector
|
|
10
|
-
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src)
|
|
10
|
+
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src.ts)
|
|
11
11
|
local selectTheme = TS.import(script, script.Parent, "ThemeStore").selectTheme
|
|
12
12
|
local DefaultTheme = TS.import(script, script.Parent.Parent, "themes").default
|
|
13
13
|
local function ThemeWrapper(props)
|
|
14
14
|
local _binding = props
|
|
15
15
|
local theme = _binding.theme
|
|
16
|
-
local children = _binding
|
|
16
|
+
local children = _binding.children
|
|
17
17
|
local dispatch = useDispatch()
|
|
18
18
|
local ref = useRef()
|
|
19
19
|
local currentTheme = useSelector(selectTheme)
|
|
@@ -24,27 +24,12 @@ local function ThemeWrapper(props)
|
|
|
24
24
|
newTheme = theme or DefaultTheme,
|
|
25
25
|
})
|
|
26
26
|
end, { theme })
|
|
27
|
-
|
|
27
|
+
return Roact.jsx("frame", {
|
|
28
28
|
BackgroundTransparency = 1,
|
|
29
29
|
Size = UDim2.new(1, 0, 1, 0),
|
|
30
30
|
ZIndex = 500000,
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
local _children = {}
|
|
34
|
-
local _length = #_children
|
|
35
|
-
local _child = currentTheme and children
|
|
36
|
-
if _child then
|
|
37
|
-
for _k, _v in _child do
|
|
38
|
-
if type(_k) == "number" then
|
|
39
|
-
_children[_length + _k] = _v
|
|
40
|
-
else
|
|
41
|
-
_children[_k] = _v
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
return Roact.createFragment({
|
|
46
|
-
["ThemeWrapper-" .. currentTheme.type] = Roact.createElement("Frame", _attributes, _children),
|
|
47
|
-
})
|
|
31
|
+
Ref = ref,
|
|
32
|
+
}, currentTheme and children)
|
|
48
33
|
end
|
|
49
34
|
local default = markPureComponent(ThemeWrapper)
|
|
50
35
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Colors } from "../interfaces/palette/colors";
|
|
2
|
-
import { Borders } from "../interfaces/spacing";
|
|
1
|
+
import { Colors } from "../interfaces/palette/colors/index";
|
|
2
|
+
import { Borders } from "../interfaces/spacing/index";
|
|
3
3
|
export declare const DARK_THEME_COLORS: Colors;
|
|
4
4
|
export declare const LIGHT_THEME_COLORS: Colors;
|
|
5
5
|
export declare const DEFAULT_BORDERS: Borders;
|
package/out/theme/index.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
export { default as Theme } from "./interfaces/theme/Theme";
|
|
2
|
-
export { ThemeProvider } from "./components";
|
|
3
|
-
export { themeStore } from "./components";
|
|
4
|
-
export { ThemeState } from "./components";
|
|
5
|
-
export * from "./components";
|
|
6
|
-
export * from "./constants";
|
|
7
|
-
export * from "./interfaces";
|
|
8
|
-
export * from "./styles";
|
|
9
|
-
export * from "./themes";
|
|
10
|
-
export { default as DefaultTheme } from "./themes";
|
|
2
|
+
export { ThemeProvider } from "./components/index";
|
|
3
|
+
export { themeStore } from "./components/index";
|
|
4
|
+
export { ThemeState } from "./components/index";
|
|
5
|
+
export * from "./components/index";
|
|
6
|
+
export * from "./constants/index";
|
|
7
|
+
export * from "./interfaces/index";
|
|
8
|
+
export * from "./styles/index";
|
|
9
|
+
export * from "./themes/index";
|
|
10
|
+
export { default as DefaultTheme } from "./themes/index";
|
|
11
11
|
export { default as DarkTheme } from "./themes/DarkTheme";
|
|
12
12
|
export { default as LightTheme } from "./themes/LightTheme";
|
|
13
|
-
export { CommonProps } from "./types";
|
|
14
|
-
export { BaseDefaultProps } from "./types";
|
|
15
|
-
export { BaseCustomizedProps } from "./types";
|
|
16
|
-
export { DefaultProps } from "./types";
|
|
17
|
-
export { CustomizedProps } from "./types";
|
|
18
|
-
export { CustomizedRef } from "./types";
|
|
19
|
-
export { CustomizedForwardRefComponent } from "./types";
|
|
20
|
-
export * from "./utilites";
|
|
13
|
+
export { CommonProps } from "./types/index";
|
|
14
|
+
export { BaseDefaultProps } from "./types/index";
|
|
15
|
+
export { BaseCustomizedProps } from "./types/index";
|
|
16
|
+
export { DefaultProps } from "./types/index";
|
|
17
|
+
export { CustomizedProps } from "./types/index";
|
|
18
|
+
export { CustomizedRef } from "./types/index";
|
|
19
|
+
export { CustomizedForwardRefComponent } from "./types/index";
|
|
20
|
+
export * from "./utilites/index";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { IconSizes } from "./iconSizes";
|
|
2
|
-
export * from "./palette";
|
|
3
|
-
export { Borders } from "./spacing";
|
|
4
|
-
export { Padding } from "./spacing";
|
|
5
|
-
export { Shape } from "./spacing";
|
|
6
|
-
export { Spacing } from "./spacing";
|
|
7
|
-
export * from "../styles";
|
|
8
|
-
export { Theme } from "./theme";
|
|
9
|
-
export { ThemeConstants } from "./theme";
|
|
10
|
-
export { ThemeOptions } from "./theme";
|
|
11
|
-
export * from "../themes";
|
|
12
|
-
export { Tokens } from "./tokens";
|
|
13
|
-
export * from "./typography";
|
|
1
|
+
export { IconSizes } from "./iconSizes/index";
|
|
2
|
+
export * from "./palette/index";
|
|
3
|
+
export { Borders } from "./spacing/index";
|
|
4
|
+
export { Padding } from "./spacing/index";
|
|
5
|
+
export { Shape } from "./spacing/index";
|
|
6
|
+
export { Spacing } from "./spacing/index";
|
|
7
|
+
export * from "../styles/index";
|
|
8
|
+
export { Theme } from "./theme/index";
|
|
9
|
+
export { ThemeConstants } from "./theme/index";
|
|
10
|
+
export { ThemeOptions } from "./theme/index";
|
|
11
|
+
export * from "../themes/index";
|
|
12
|
+
export { Tokens } from "./tokens/index";
|
|
13
|
+
export * from "./typography/index";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./colors";
|
|
2
|
-
export { ColorTokens } from "./colorTokens";
|
|
1
|
+
export * from "./colors/index";
|
|
2
|
+
export { ColorTokens } from "./colorTokens/index";
|
|
3
3
|
export { default as Palette } from "./Palette";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Palette } from "../palette";
|
|
2
|
-
import { Padding, Shape, Spacing } from "../spacing";
|
|
3
|
-
import { ThemeTypography } from "../typography";
|
|
1
|
+
import { Palette } from "../palette/index";
|
|
2
|
+
import { Padding, Shape, Spacing } from "../spacing/index";
|
|
3
|
+
import { ThemeTypography } from "../typography/index";
|
|
4
4
|
import ThemeOptions from "./ThemeOptions";
|
|
5
5
|
interface Theme {
|
|
6
6
|
type: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Borders } from "../spacing";
|
|
2
|
-
import { IconSizes } from "../iconSizes";
|
|
3
|
-
import { ColorTokens } from "../palette/colorTokens";
|
|
1
|
+
import { Borders } from "../spacing/index";
|
|
2
|
+
import { IconSizes } from "../iconSizes/index";
|
|
3
|
+
import { ColorTokens } from "../palette/colorTokens/index";
|
|
4
4
|
import { CommonColors } from "../palette/colors/Common";
|
|
5
|
-
import { Colors } from "../palette/colors";
|
|
5
|
+
import { Colors } from "../palette/colors/index";
|
|
6
6
|
export default interface ThemeConstants {
|
|
7
7
|
contentWidth: number;
|
|
8
8
|
iconSizes: IconSizes;
|