@rbxts/uiblox 0.1.13 → 0.1.15
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 +10 -10
- package/out/index.d.ts +2 -0
- package/out/theme/components/ThemeProducer.d.ts +7 -0
- package/out/theme/components/ThemeProvider.d.ts +7 -0
- package/out/theme/components/ThemeWrapper.d.ts +7 -0
- package/out/theme/components/index.d.ts +5 -0
- package/out/theme/constants/NumberConstants.d.ts +6 -0
- package/out/theme/constants/ThemeConstants.d.ts +5 -0
- package/out/theme/constants/index.d.ts +2 -0
- package/out/theme/index.d.ts +19 -0
- package/out/theme/interfaces/iconSizes/IconSizes.d.ts +5 -0
- package/out/theme/interfaces/iconSizes/index.d.ts +1 -0
- package/out/theme/interfaces/index.d.ts +13 -0
- package/out/theme/interfaces/palette/Palette.d.ts +26 -0
- package/out/theme/interfaces/palette/colorTokens/ColorTokens.d.ts +4 -0
- package/out/theme/interfaces/palette/colorTokens/index.d.ts +1 -0
- package/out/theme/interfaces/palette/colors/Blue.d.ts +3 -0
- package/out/theme/interfaces/palette/colors/Colors.d.ts +42 -0
- package/out/theme/interfaces/palette/colors/Common.d.ts +6 -0
- package/out/theme/interfaces/palette/colors/Dark.d.ts +3 -0
- package/out/theme/interfaces/palette/colors/Gray.d.ts +3 -0
- package/out/theme/interfaces/palette/colors/Green.d.ts +3 -0
- package/out/theme/interfaces/palette/colors/Light.d.ts +3 -0
- package/out/theme/interfaces/palette/colors/Magenta.d.ts +3 -0
- package/out/theme/interfaces/palette/colors/Orange.d.ts +3 -0
- package/out/theme/interfaces/palette/colors/Purple.d.ts +3 -0
- package/out/theme/interfaces/palette/colors/Red.d.ts +3 -0
- package/out/theme/interfaces/palette/colors/Turquoise.d.ts +3 -0
- package/out/theme/interfaces/palette/colors/Yellow.d.ts +3 -0
- package/out/theme/interfaces/palette/colors/index.d.ts +13 -0
- package/out/theme/interfaces/palette/index.d.ts +3 -0
- package/out/theme/interfaces/spacing/Borders.d.ts +4 -0
- package/out/theme/interfaces/spacing/Padding.d.ts +4 -0
- package/out/theme/interfaces/spacing/Shape.d.ts +3 -0
- package/out/theme/interfaces/spacing/Spacing.d.ts +4 -0
- package/out/theme/interfaces/spacing/index.d.ts +4 -0
- package/out/theme/interfaces/theme/Theme.d.ts +14 -0
- package/out/theme/interfaces/theme/ThemeConstants.d.ts +25 -0
- package/out/theme/interfaces/theme/ThemeOptions.d.ts +4 -0
- package/out/theme/interfaces/theme/index.d.ts +3 -0
- package/out/theme/interfaces/tokens/Tokens.d.ts +1 -0
- package/out/theme/interfaces/tokens/index.d.ts +1 -0
- package/out/theme/interfaces/typography/FontFamilies.d.ts +2 -0
- package/out/theme/interfaces/typography/FontFamilyOptions.d.ts +3 -0
- package/out/theme/interfaces/typography/FontSizeOptions.d.ts +3 -0
- package/out/theme/interfaces/typography/FontSizes.d.ts +3 -0
- package/out/theme/interfaces/typography/ThemeTypography.d.ts +7 -0
- package/out/theme/interfaces/typography/Variants.d.ts +18 -0
- package/out/theme/interfaces/typography/index.d.ts +8 -0
- package/out/theme/styles/index.d.ts +5 -0
- package/out/theme/styles/types/WriteableStyle.d.ts +1 -0
- package/out/theme/styles/types/index.d.ts +2 -0
- package/out/theme/styles/types/styles.d.ts +2 -0
- package/out/theme/styles/utilities/classNames.d.ts +7 -0
- package/out/theme/styles/utilities/classNames.luau +15 -1
- package/out/theme/styles/utilities/createStyles.d.ts +3 -0
- package/out/theme/styles/utilities/index.d.ts +3 -0
- package/out/theme/styles/utilities/makeStyles.d.ts +7 -0
- package/out/theme/themes/DarkTheme.d.ts +3 -0
- package/out/theme/themes/LightTheme.d.ts +3 -0
- package/out/theme/themes/index.d.ts +3 -0
- package/out/theme/types/index.d.ts +7 -0
- package/out/theme/types/types.d.ts +12 -0
- package/out/theme/utilites/Color3FromHex.d.ts +2 -0
- package/out/theme/utilites/index.d.ts +1 -0
- package/out/ui/constants/ImageConstants.d.ts +2 -0
- package/out/ui/constants/LayoutConstants.d.ts +1 -0
- package/out/ui/constants/index.d.ts +2 -0
- package/out/ui/enums/Directions.d.ts +8 -0
- package/out/ui/enums/Icons.d.ts +40 -0
- package/out/ui/enums/Orientations.d.ts +4 -0
- package/out/ui/enums/index.d.ts +3 -0
- package/out/ui/index.d.ts +34 -0
- package/out/ui/packages/button/components/Button.d.ts +24 -0
- package/out/ui/packages/button/components/Button.styles.d.ts +3 -0
- package/out/ui/packages/button/index.d.ts +6 -0
- package/out/ui/packages/button/types/ButtonColor.d.ts +1 -0
- package/out/ui/packages/button/types/ButtonSize.d.ts +1 -0
- package/out/ui/packages/button/types/ButtonVariant.d.ts +1 -0
- package/out/ui/packages/button/types/index.d.ts +3 -0
- package/out/ui/packages/divider/components/Divider.d.ts +13 -0
- package/out/ui/packages/divider/components/Divider.styles.d.ts +3 -0
- package/out/ui/packages/divider/index.d.ts +3 -0
- package/out/ui/packages/icon/components/Icon.d.ts +10 -0
- package/out/ui/packages/icon/components/Icon.styles.d.ts +3 -0
- package/out/ui/packages/icon/index.d.ts +3 -0
- package/out/ui/packages/iconButton/components/IconButton.d.ts +12 -0
- package/out/ui/packages/iconButton/components/IconButton.styles.d.ts +3 -0
- package/out/ui/packages/iconButton/index.d.ts +3 -0
- package/out/ui/packages/index.d.ts +11 -0
- package/out/ui/packages/input/components/Input.d.ts +22 -0
- package/out/ui/packages/input/components/Input.styles.d.ts +3 -0
- package/out/ui/packages/input/index.d.ts +6 -0
- package/out/ui/packages/input/types/InputColor.d.ts +1 -0
- package/out/ui/packages/input/types/InputMargin.d.ts +1 -0
- package/out/ui/packages/input/types/InputVariant.d.ts +1 -0
- package/out/ui/packages/input/types/index.d.ts +3 -0
- package/out/ui/packages/progressBar/components/ProgressBar.d.ts +7 -0
- package/out/ui/packages/progressBar/components/ProgressBar.styles.d.ts +2 -0
- package/out/ui/packages/progressBar/index.d.ts +3 -0
- package/out/ui/packages/shadow/components/Shadow.d.ts +2 -0
- package/out/ui/packages/shadow/components/Shadow.styles.d.ts +2 -0
- package/out/ui/packages/shadow/index.d.ts +2 -0
- package/out/ui/packages/sidebar/components/Sidebar.d.ts +8 -0
- package/out/ui/packages/sidebar/components/Sidebar.styles.d.ts +3 -0
- package/out/ui/packages/sidebar/index.d.ts +4 -0
- package/out/ui/packages/sidebar/types/SidebarType.d.ts +1 -0
- package/out/ui/packages/sidebar/types/index.d.ts +1 -0
- package/out/ui/packages/toast/components/Toast.d.ts +10 -0
- package/out/ui/packages/toast/components/Toast.styles.d.ts +3 -0
- package/out/ui/packages/toast/enums/ToastVariants.d.ts +7 -0
- package/out/ui/packages/toast/index.d.ts +5 -0
- package/out/ui/packages/toast/interfaces/ToastEvent.d.ts +5 -0
- package/out/ui/packages/treeView/components/TreeView.d.ts +11 -0
- package/out/ui/packages/treeView/components/TreeView.styles.d.ts +2 -0
- package/out/ui/packages/treeView/index.d.ts +6 -0
- package/out/ui/packages/treeView/interfaces/Branch.d.ts +6 -0
- package/out/ui/packages/treeView/interfaces/Leaf.d.ts +4 -0
- package/out/ui/packages/treeView/interfaces/Tree.d.ts +5 -0
- package/out/ui/packages/typography/components/Typography.d.ts +18 -0
- package/out/ui/packages/typography/components/Typography.styles.d.ts +3 -0
- package/out/ui/packages/typography/index.d.ts +6 -0
- package/out/ui/packages/typography/types/TypographyAlignment.d.ts +1 -0
- package/out/ui/packages/typography/types/TypographyColor.d.ts +1 -0
- package/out/ui/packages/typography/types/TypographyDisplay.d.ts +1 -0
- package/out/ui/packages/typography/types/index.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,12 +36,12 @@ How does it do this? Well, there are two main exports from this package:
|
|
|
36
36
|
- An extensible Theme type + default Dark (default) and Light themes
|
|
37
37
|
- ... Light theme palette is a WIP
|
|
38
38
|
- makeStyles/createStyles utilities to serve up Instance-extended property
|
|
39
|
-
tables that can be applied to your
|
|
40
|
-
- ThemeProvider which can wrap your application and uses
|
|
39
|
+
tables that can be applied to your React Components
|
|
40
|
+
- ThemeProvider which can wrap your application and uses Reflex to tell
|
|
41
41
|
sub-components which theme to style off of (via makeStyles)
|
|
42
|
-
- Uses
|
|
42
|
+
- Uses Reflex
|
|
43
43
|
- @rbxts/uiblox -> ui
|
|
44
|
-
- Packaged and reusable typed
|
|
44
|
+
- Packaged and reusable typed React components
|
|
45
45
|
|
|
46
46
|
# How to use
|
|
47
47
|
|
|
@@ -65,10 +65,10 @@ You can house all of your components within shared.
|
|
|
65
65
|
#### src/shared/ui/app/App.tsx
|
|
66
66
|
|
|
67
67
|
The top-level class for our UI. Loads the actual ApplLayout into ScreenGui. This
|
|
68
|
-
is what we later pass to `
|
|
68
|
+
is what we later pass to `React.mount()`.
|
|
69
69
|
|
|
70
70
|
```javascript
|
|
71
|
-
import
|
|
71
|
+
import React, { Component } from "@rbxts/react";
|
|
72
72
|
|
|
73
73
|
class App extends Component {
|
|
74
74
|
render() {
|
|
@@ -94,7 +94,7 @@ You can also choose to create your own theme with the `Theme` interface exported
|
|
|
94
94
|
from `@rbxts/uiblox`.
|
|
95
95
|
|
|
96
96
|
```javascript
|
|
97
|
-
import
|
|
97
|
+
import React, { Component } from "@rbxts/react";
|
|
98
98
|
import { Storyblox } from "shared/ui/storyblox";
|
|
99
99
|
import { DarkTheme, ThemeProvider } from "@rbxts/uiblox";
|
|
100
100
|
import usePageLayoutStyles from "./PageLayout.styles";
|
|
@@ -205,7 +205,7 @@ Some sample logic for mounting app when player spawns (on client).
|
|
|
205
205
|
Mount the App in the LocalPlayer's `PlayerGui`.
|
|
206
206
|
|
|
207
207
|
```javascript
|
|
208
|
-
import
|
|
208
|
+
import React, { Tree } from "@rbxts/react";
|
|
209
209
|
import { Players } from "@rbxts/services";
|
|
210
210
|
import { App } from "shared/ui/App";
|
|
211
211
|
|
|
@@ -216,13 +216,13 @@ class AppLoader {
|
|
|
216
216
|
const playerGui = Players.LocalPlayer.FindFirstChild("PlayerGui") as PlayerGui;
|
|
217
217
|
|
|
218
218
|
const appComponent = <App />;
|
|
219
|
-
this._tree =
|
|
219
|
+
this._tree = React.mount(appComponent, playerGui, "App");
|
|
220
220
|
print("App mounted");
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
Unmount() {
|
|
224
224
|
if (this._tree) {
|
|
225
|
-
|
|
225
|
+
React.unmount(this._tree);
|
|
226
226
|
print("App unmounted");
|
|
227
227
|
}
|
|
228
228
|
}
|
package/out/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Theme } from "../interfaces/theme/index";
|
|
2
|
+
import { InferState } from "@rbxts/reflex";
|
|
3
|
+
export declare const themeProducer: import("@rbxts/reflex").Producer<Theme, {
|
|
4
|
+
setTheme: (_state: Theme, theme: Theme) => Theme;
|
|
5
|
+
}>;
|
|
6
|
+
export type ThemeProducer = typeof themeProducer;
|
|
7
|
+
export type ThemeState = InferState<ThemeProducer>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Theme } from "../interfaces/theme/index";
|
|
2
|
+
import { CustomizedProps } from "../types/index";
|
|
3
|
+
export interface ThemeProviderProps {
|
|
4
|
+
theme?: Theme;
|
|
5
|
+
}
|
|
6
|
+
declare function ThemeProvider(props: CustomizedProps<Instance, ThemeProviderProps>): JSX.Element;
|
|
7
|
+
export default ThemeProvider;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Theme } from "../interfaces/theme/index";
|
|
2
|
+
import { CustomizedProps } from "../types/index";
|
|
3
|
+
export interface ThemeWrapperProps {
|
|
4
|
+
theme?: Theme;
|
|
5
|
+
}
|
|
6
|
+
declare function ThemeWrapper(props: CustomizedProps<Instance, ThemeWrapperProps>): JSX.Element;
|
|
7
|
+
export default ThemeWrapper;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { default as Theme } from "./interfaces/theme/Theme";
|
|
2
|
+
export { ThemeProvider } from "./components/index";
|
|
3
|
+
export { ThemeState } from "./components/index";
|
|
4
|
+
export * from "./components/index";
|
|
5
|
+
export * from "./constants/index";
|
|
6
|
+
export * from "./interfaces/index";
|
|
7
|
+
export * from "./styles/index";
|
|
8
|
+
export * from "./themes/index";
|
|
9
|
+
export { default as DefaultTheme } from "./themes/index";
|
|
10
|
+
export { default as DarkTheme } from "./themes/DarkTheme";
|
|
11
|
+
export { default as LightTheme } from "./themes/LightTheme";
|
|
12
|
+
export { CommonProps } from "./types/index";
|
|
13
|
+
export { BaseDefaultProps } from "./types/index";
|
|
14
|
+
export { BaseCustomizedProps } from "./types/index";
|
|
15
|
+
export { DefaultProps } from "./types/index";
|
|
16
|
+
export { CustomizedProps } from "./types/index";
|
|
17
|
+
export { CustomizedRef } from "./types/index";
|
|
18
|
+
export { CustomizedForwardRefComponent } from "./types/index";
|
|
19
|
+
export * from "./utilites/index";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as IconSizes } from "./IconSizes";
|
|
@@ -0,0 +1,13 @@
|
|
|
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";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default interface Palette {
|
|
2
|
+
primary: {
|
|
3
|
+
main: Color3;
|
|
4
|
+
};
|
|
5
|
+
secondary: {
|
|
6
|
+
main: Color3;
|
|
7
|
+
};
|
|
8
|
+
error: {
|
|
9
|
+
main: Color3;
|
|
10
|
+
};
|
|
11
|
+
warning: {
|
|
12
|
+
main: Color3;
|
|
13
|
+
};
|
|
14
|
+
success: {
|
|
15
|
+
main: Color3;
|
|
16
|
+
};
|
|
17
|
+
background: {
|
|
18
|
+
default: Color3;
|
|
19
|
+
paper: Color3;
|
|
20
|
+
};
|
|
21
|
+
divider: Color3;
|
|
22
|
+
text: {
|
|
23
|
+
primary: Color3;
|
|
24
|
+
secondary: Color3;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ColorTokens } from "./ColorTokens";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export default interface Colors {
|
|
2
|
+
backgroundDefault: Color3;
|
|
3
|
+
backgroundContrast: Color3;
|
|
4
|
+
backgroundMuted: Color3;
|
|
5
|
+
backgroundUIDefault: Color3;
|
|
6
|
+
backgroundUIMuted: Color3;
|
|
7
|
+
backgroundUIContrast: Color3;
|
|
8
|
+
UIDefault: Color3;
|
|
9
|
+
UIMuted: Color3;
|
|
10
|
+
UIEmphasis: Color3;
|
|
11
|
+
textDefault: Color3;
|
|
12
|
+
textMuted: Color3;
|
|
13
|
+
textEmphasis: Color3;
|
|
14
|
+
iconDefault: Color3;
|
|
15
|
+
iconEmphasis: Color3;
|
|
16
|
+
iconOnHover: Color3;
|
|
17
|
+
systemPrimaryDefault: Color3;
|
|
18
|
+
systemPrimaryOnHover: Color3;
|
|
19
|
+
systemPrimaryContent: Color3;
|
|
20
|
+
contextualPrimaryDefault: Color3;
|
|
21
|
+
contextualPrimaryOnHover: Color3;
|
|
22
|
+
contextualPrimaryContent: Color3;
|
|
23
|
+
secondaryDefault: Color3;
|
|
24
|
+
secondaryOnHover: Color3;
|
|
25
|
+
secondaryContent: Color3;
|
|
26
|
+
divider: Color3;
|
|
27
|
+
overlay: Color3;
|
|
28
|
+
dropShadow: Color3;
|
|
29
|
+
navigationBar: Color3;
|
|
30
|
+
badge: Color3;
|
|
31
|
+
badgeContent: Color3;
|
|
32
|
+
placeholder: Color3;
|
|
33
|
+
online: Color3;
|
|
34
|
+
offline: Color3;
|
|
35
|
+
alert: Color3;
|
|
36
|
+
success: Color3;
|
|
37
|
+
accent: Color3;
|
|
38
|
+
link: Color3;
|
|
39
|
+
caution: Color3;
|
|
40
|
+
text: Color3;
|
|
41
|
+
background: Color3;
|
|
42
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { default as Blue } from "./Blue";
|
|
2
|
+
export { default as Common } from "./Common";
|
|
3
|
+
export { default as Gray } from "./Gray";
|
|
4
|
+
export { default as Green } from "./Green";
|
|
5
|
+
export { default as Magenta } from "./Magenta";
|
|
6
|
+
export { default as Orange } from "./Orange";
|
|
7
|
+
export { default as Purple } from "./Purple";
|
|
8
|
+
export { default as Red } from "./Red";
|
|
9
|
+
export { default as Turquoise } from "./Turquoise";
|
|
10
|
+
export { default as Yellow } from "./Yellow";
|
|
11
|
+
export { default as Dark } from "./Dark";
|
|
12
|
+
export { default as Light } from "./Light";
|
|
13
|
+
export { default as Colors } from "./Colors";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Palette } from "../palette/index";
|
|
2
|
+
import { Padding, Shape, Spacing } from "../spacing/index";
|
|
3
|
+
import { ThemeTypography } from "../typography/index";
|
|
4
|
+
import ThemeOptions from "./ThemeOptions";
|
|
5
|
+
interface Theme {
|
|
6
|
+
type: string;
|
|
7
|
+
options: ThemeOptions;
|
|
8
|
+
palette: Palette;
|
|
9
|
+
padding: Padding;
|
|
10
|
+
shape: Shape;
|
|
11
|
+
spacing: Spacing;
|
|
12
|
+
typography: ThemeTypography;
|
|
13
|
+
}
|
|
14
|
+
export default Theme;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Borders } from "../spacing/index";
|
|
2
|
+
import { IconSizes } from "../iconSizes/index";
|
|
3
|
+
import { ColorTokens } from "../palette/colorTokens/index";
|
|
4
|
+
import { CommonColors } from "../palette/colors/Common";
|
|
5
|
+
import { Colors } from "../palette/colors/index";
|
|
6
|
+
export default interface ThemeConstants {
|
|
7
|
+
contentWidth: number;
|
|
8
|
+
iconSizes: IconSizes;
|
|
9
|
+
colors: Colors;
|
|
10
|
+
borders: Borders;
|
|
11
|
+
extendedPalette: {
|
|
12
|
+
Blue: ColorTokens;
|
|
13
|
+
Common: CommonColors;
|
|
14
|
+
Dark: ColorTokens;
|
|
15
|
+
Gray: ColorTokens;
|
|
16
|
+
Green: ColorTokens;
|
|
17
|
+
Light: ColorTokens;
|
|
18
|
+
Magenta: ColorTokens;
|
|
19
|
+
Orange: ColorTokens;
|
|
20
|
+
Purple: ColorTokens;
|
|
21
|
+
Red: ColorTokens;
|
|
22
|
+
Turquoise: ColorTokens;
|
|
23
|
+
Yellow: ColorTokens;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Tokens = "120" | "110" | "100" | "90" | "80" | "70" | "60" | "50" | "40" | "30" | "20" | "10";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tokens } from "./Tokens";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Tokens } from "../tokens/Tokens";
|
|
2
|
+
export type TypographyTokens = {
|
|
3
|
+
[key in Tokens]: string;
|
|
4
|
+
};
|
|
5
|
+
export interface TypographyWeights {
|
|
6
|
+
title: number;
|
|
7
|
+
heading: number;
|
|
8
|
+
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as ThemeTypography } from "./ThemeTypography";
|
|
2
|
+
export * from "./FontSizes";
|
|
3
|
+
export * from "./FontFamilies";
|
|
4
|
+
export { FontSizeVariant } from "./FontSizeOptions";
|
|
5
|
+
export { FontSizeOptions } from "./FontSizeOptions";
|
|
6
|
+
export { FontFamilyVariant } from "./FontFamilyOptions";
|
|
7
|
+
export { FontFamilyOptions } from "./FontFamilyOptions";
|
|
8
|
+
export * from "./Variants";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type WriteableStyle<T extends Instance> = Partial<WritableInstanceProperties<T>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WriteableStyle } from "../types/WriteableStyle";
|
|
2
|
+
export type GenericStyle = {
|
|
3
|
+
[property: string]: boolean;
|
|
4
|
+
};
|
|
5
|
+
export type ConditionalStyles<T extends Instance> = Map<WriteableStyle<T>, boolean>;
|
|
6
|
+
declare const classNames: <T extends Instance>(conditionalStyles?: ConditionalStyles<T>, ...styles: Array<WriteableStyle<T>>) => WriteableStyle<T>;
|
|
7
|
+
export default classNames;
|
|
@@ -22,9 +22,23 @@ local classNames = function(conditionalStyles, ...)
|
|
|
22
22
|
end
|
|
23
23
|
-- ▲ ReadonlyMap.forEach ▲
|
|
24
24
|
end
|
|
25
|
+
-- ▼ ReadonlyArray.forEach ▼
|
|
26
|
+
local _callback = function(value)
|
|
27
|
+
if value ~= 0 and value == value and value ~= "" and value then
|
|
28
|
+
local _object = table.clone(style)
|
|
29
|
+
setmetatable(_object, nil)
|
|
30
|
+
for _k, _v in value do
|
|
31
|
+
_object[_k] = _v
|
|
32
|
+
end
|
|
33
|
+
style = _object
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
for _k, _v in styles do
|
|
37
|
+
_callback(_v, _k - 1, styles)
|
|
38
|
+
end
|
|
39
|
+
-- ▲ ReadonlyArray.forEach ▲
|
|
25
40
|
local _object = table.clone(style)
|
|
26
41
|
setmetatable(_object, nil)
|
|
27
|
-
_object.styles = styles
|
|
28
42
|
return _object
|
|
29
43
|
end
|
|
30
44
|
local default = classNames
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Theme } from "../../interfaces/theme/index";
|
|
2
|
+
import { ClassNameMap } from "../types/styles";
|
|
3
|
+
type TMakeStyles<ClassKey extends string = string> = (theme: Theme) => ClassNameMap<ClassKey>;
|
|
4
|
+
type TMakeStylesWithProps<Props, ClassKey extends string = string> = (theme: Theme, props: Props) => ClassNameMap<ClassKey>;
|
|
5
|
+
type TVariantF<Props> = keyof Props extends never ? TMakeStyles : TMakeStylesWithProps<Props>;
|
|
6
|
+
declare const makeStyles: <Props = {}, ClassKey extends string = string>(f: TVariantF<Props>) => keyof Props extends never ? () => ClassNameMap<ClassKey> : (props: Props) => ClassNameMap<ClassKey>;
|
|
7
|
+
export default makeStyles;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { CommonProps } from "./types";
|
|
2
|
+
export { BaseDefaultProps } from "./types";
|
|
3
|
+
export { BaseCustomizedProps } from "./types";
|
|
4
|
+
export { DefaultProps } from "./types";
|
|
5
|
+
export { CustomizedProps } from "./types";
|
|
6
|
+
export { CustomizedRef } from "./types";
|
|
7
|
+
export { CustomizedForwardRefComponent } from "./types";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from "@rbxts/react";
|
|
2
|
+
import { WriteableStyle } from "../interfaces/index";
|
|
3
|
+
export interface CommonProps<T extends Instance> extends PropsWithChildren {
|
|
4
|
+
className?: WriteableStyle<T>;
|
|
5
|
+
component?: T;
|
|
6
|
+
}
|
|
7
|
+
export type BaseDefaultProps<T extends Instance, P> = CommonProps<T> & P;
|
|
8
|
+
export type BaseCustomizedProps<T extends Instance, P> = BaseDefaultProps<T, P>;
|
|
9
|
+
export type DefaultProps<T extends Instance, P = {}> = BaseDefaultProps<T, P>;
|
|
10
|
+
export type CustomizedProps<T extends Instance, P = {}> = BaseCustomizedProps<T, P>;
|
|
11
|
+
export type CustomizedRef<T extends Instance> = T extends Instance ? any : T extends keyof React.ReactElement<T> ? WritableInstanceProperties<T> : never;
|
|
12
|
+
export type CustomizedForwardRefComponent<D extends Instance, P = {}> = <T extends Instance = D>(props: CustomizedProps<T, P> & WritableInstanceProperties<CustomizedRef<T>>) => React.Element | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Color3FromHex } from "./Color3FromHex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ROBLOX_UI_OFFSET: number;
|