@rbxts/uiblox 0.1.3 → 0.1.5
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 +21 -22
- package/out/theme/components/ThemeProvider.d.ts +2 -1
- package/out/theme/components/ThemeProvider.lua +1 -1
- package/out/theme/components/ThemeWrapper.d.ts +2 -1
- package/out/theme/components/ThemeWrapper.lua +1 -1
- package/out/ui/packages/button/components/Button.d.ts +2 -1
- package/out/ui/packages/button/components/Button.lua +1 -1
- package/out/ui/packages/icon/components/Icon.d.ts +3 -1
- package/out/ui/packages/icon/components/Icon.lua +1 -1
- package/out/ui/packages/iconButton/components/IconButton.d.ts +3 -1
- package/out/ui/packages/iconButton/components/IconButton.lua +1 -1
- package/out/ui/packages/input/components/Input.d.ts +2 -1
- package/out/ui/packages/input/components/Input.lua +1 -1
- package/out/ui/packages/progressBar/components/ProgressBar.d.ts +2 -1
- package/out/ui/packages/progressBar/components/ProgressBar.lua +1 -1
- package/out/ui/packages/shadow/components/Shadow.d.ts +2 -1
- package/out/ui/packages/shadow/components/Shadow.lua +1 -1
- package/out/ui/packages/toast/components/Toast.d.ts +2 -1
- package/out/ui/packages/toast/components/Toast.lua +1 -1
- package/out/ui/packages/treeView/components/TreeView.d.ts +3 -1
- package/out/ui/packages/treeView/components/TreeView.lua +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -128,8 +128,8 @@ then you can omit props without a type warning (i.e. `makeStyles(theme => {})`
|
|
|
128
128
|
instead of `makeStyles<MyComponentProps>((theme, props) => {})`).
|
|
129
129
|
|
|
130
130
|
```javascript
|
|
131
|
-
import Roact
|
|
132
|
-
import { useState } from "@rbxts/roact-hooked";
|
|
131
|
+
import Roact from "@rbxts/roact";
|
|
132
|
+
import { useState, markPureComponent } from "@rbxts/roact-hooked";
|
|
133
133
|
import useMyComponentStyles from "./MyComponent.styles";
|
|
134
134
|
import { Button } from "@rbxts/uiblox";
|
|
135
135
|
|
|
@@ -140,26 +140,25 @@ export interface MyComponentProps {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
// Hooked components are very handy
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
export default MyComponent;
|
|
143
|
+
function MyComponent(props: MyComponentProps) {
|
|
144
|
+
const { title, bolded = false } = props;
|
|
145
|
+
const { root, button } = useMyComponentStyles(props);
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<frame Key="MyComponent" {...root}>
|
|
149
|
+
<Button
|
|
150
|
+
variant="outlined"
|
|
151
|
+
text={title}
|
|
152
|
+
size="small"
|
|
153
|
+
color="secondary"
|
|
154
|
+
family={bolded ? "bold" : "default"}
|
|
155
|
+
className={button}
|
|
156
|
+
></Button>
|
|
157
|
+
</frame>
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export default markPureComponent(MyComponent);
|
|
163
162
|
```
|
|
164
163
|
|
|
165
164
|
#### src/shared/ui/myComponent/MyComponent.styles.ts
|
|
@@ -4,5 +4,6 @@ import { Theme } from "../interfaces/theme";
|
|
|
4
4
|
export interface ThemeProviderProps {
|
|
5
5
|
theme?: Theme;
|
|
6
6
|
}
|
|
7
|
-
declare
|
|
7
|
+
declare function ThemeProvider(props: Roact.PropsWithChildren<ThemeProviderProps>): Roact.Element;
|
|
8
|
+
declare const _default: typeof ThemeProvider;
|
|
8
9
|
export default _default;
|
|
@@ -5,7 +5,7 @@ local StoreProvider = TS.import(script, TS.getModule(script, "@rbxts", "roact-ro
|
|
|
5
5
|
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src)
|
|
6
6
|
local themeStore = TS.import(script, script.Parent, "ThemeStore").themeStore
|
|
7
7
|
local ThemeWrapper = TS.import(script, script.Parent, "ThemeWrapper").default
|
|
8
|
-
local ThemeProvider
|
|
8
|
+
local function ThemeProvider(props)
|
|
9
9
|
local _binding = props
|
|
10
10
|
local theme = _binding.theme
|
|
11
11
|
local children = _binding[Roact.Children]
|
|
@@ -4,5 +4,6 @@ import { Theme } from "../interfaces/theme";
|
|
|
4
4
|
export interface ThemeWrapperProps {
|
|
5
5
|
theme?: Theme;
|
|
6
6
|
}
|
|
7
|
-
declare
|
|
7
|
+
declare function ThemeWrapper(props: Roact.PropsWithChildren<ThemeWrapperProps>): Roact.Element;
|
|
8
|
+
declare const _default: typeof ThemeWrapper;
|
|
8
9
|
export default _default;
|
|
@@ -10,7 +10,7 @@ local useSelector = _roact_rodux_hooked.useSelector
|
|
|
10
10
|
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src)
|
|
11
11
|
local selectTheme = TS.import(script, script.Parent, "ThemeStore").selectTheme
|
|
12
12
|
local DefaultTheme = TS.import(script, script.Parent.Parent, "themes").default
|
|
13
|
-
local ThemeWrapper
|
|
13
|
+
local function ThemeWrapper(props)
|
|
14
14
|
local _binding = props
|
|
15
15
|
local theme = _binding.theme
|
|
16
16
|
local children = _binding[Roact.Children]
|
|
@@ -23,5 +23,6 @@ export interface ButtonProps {
|
|
|
23
23
|
mouseEnter?: () => void;
|
|
24
24
|
mouseLeave?: () => void;
|
|
25
25
|
}
|
|
26
|
-
declare
|
|
26
|
+
declare function Button(props: Roact.PropsWithChildren<CustomizedProps<DefaultButtonComponent, ButtonProps>>): Roact.Element;
|
|
27
|
+
declare const _default: typeof Button;
|
|
27
28
|
export default _default;
|
|
@@ -5,7 +5,7 @@ local _roact_hooked = TS.import(script, TS.getModule(script, "@rbxts", "roact-ho
|
|
|
5
5
|
local markPureComponent = _roact_hooked.markPureComponent
|
|
6
6
|
local useState = _roact_hooked.useState
|
|
7
7
|
local useButtonStyles = TS.import(script, script.Parent, "Button.styles").default
|
|
8
|
-
local Button
|
|
8
|
+
local function Button(props)
|
|
9
9
|
local _binding = props
|
|
10
10
|
local text = _binding.text
|
|
11
11
|
if text == nil then
|
|
@@ -9,5 +9,7 @@ export interface IconProps {
|
|
|
9
9
|
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
10
10
|
tint?: Color3;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
type DefaultIconComponent = ImageLabel;
|
|
13
|
+
declare function Icon(props: CustomizedProps<DefaultIconComponent, IconProps>): Roact.Element;
|
|
14
|
+
declare const _default: typeof Icon;
|
|
13
15
|
export default _default;
|
|
@@ -3,7 +3,7 @@ local TS = _G[script]
|
|
|
3
3
|
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src)
|
|
4
4
|
local markPureComponent = TS.import(script, TS.getModule(script, "@rbxts", "roact-hooked").src).markPureComponent
|
|
5
5
|
local useIconStyles = TS.import(script, script.Parent, "Icon.styles").default
|
|
6
|
-
local Icon
|
|
6
|
+
local function Icon(props)
|
|
7
7
|
local _binding = props
|
|
8
8
|
local icon = _binding.icon
|
|
9
9
|
local tint = _binding.tint
|
|
@@ -11,5 +11,7 @@ export interface IconButtonProps {
|
|
|
11
11
|
selected?: boolean;
|
|
12
12
|
onClick?: () => void;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
type DefaultIconButtonComponent = ImageButton;
|
|
15
|
+
declare function IconButton(props: CustomizedProps<DefaultIconButtonComponent, IconButtonProps>): Roact.Element;
|
|
16
|
+
declare const _default: typeof IconButton;
|
|
15
17
|
export default _default;
|
|
@@ -5,7 +5,7 @@ local _roact_hooked = TS.import(script, TS.getModule(script, "@rbxts", "roact-ho
|
|
|
5
5
|
local markPureComponent = _roact_hooked.markPureComponent
|
|
6
6
|
local useState = _roact_hooked.useState
|
|
7
7
|
local useIconButtonStyles = TS.import(script, script.Parent, "IconButton.styles").default
|
|
8
|
-
local IconButton
|
|
8
|
+
local function IconButton(props)
|
|
9
9
|
local _binding = props
|
|
10
10
|
local icon = _binding.icon
|
|
11
11
|
local selected = _binding.selected
|
|
@@ -23,5 +23,6 @@ export interface InputProps {
|
|
|
23
23
|
onBlur?: () => void;
|
|
24
24
|
onEnterPressed?: (text: string) => void;
|
|
25
25
|
}
|
|
26
|
-
declare
|
|
26
|
+
declare function Input(props: CustomizedProps<DefaultInputComponent, InputProps>): Roact.Element;
|
|
27
|
+
declare const _default: typeof Input;
|
|
27
28
|
export default _default;
|
|
@@ -8,7 +8,7 @@ local classNames = TS.import(script, script.Parent.Parent.Parent.Parent.Parent,
|
|
|
8
8
|
local Divider = TS.import(script, script.Parent.Parent.Parent, "divider").Divider
|
|
9
9
|
local Orientations = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Orientations
|
|
10
10
|
local useInputStyles = TS.import(script, script.Parent, "Input.styles").default
|
|
11
|
-
local Input
|
|
11
|
+
local function Input(props)
|
|
12
12
|
local _binding = props
|
|
13
13
|
local text = _binding.text
|
|
14
14
|
local placeholder = _binding.placeholder
|
|
@@ -6,5 +6,6 @@ export interface ProgressBarProps {
|
|
|
6
6
|
progress: number;
|
|
7
7
|
className?: WriteableStyle<Frame>;
|
|
8
8
|
}
|
|
9
|
-
declare
|
|
9
|
+
declare function ProgressBar({ progress, className }: ProgressBarProps): Roact.Element;
|
|
10
|
+
declare const _default: typeof ProgressBar;
|
|
10
11
|
export default _default;
|
|
@@ -3,7 +3,7 @@ local TS = _G[script]
|
|
|
3
3
|
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src)
|
|
4
4
|
local markPureComponent = TS.import(script, TS.getModule(script, "@rbxts", "roact-hooked").src).markPureComponent
|
|
5
5
|
local useProgressBarStyles = TS.import(script, script.Parent, "ProgressBar.styles").default
|
|
6
|
-
local ProgressBar
|
|
6
|
+
local function ProgressBar(_param)
|
|
7
7
|
local progress = _param.progress
|
|
8
8
|
local className = _param.className
|
|
9
9
|
local _binding = useProgressBarStyles()
|
|
@@ -6,7 +6,7 @@ local markPureComponent = _roact_hooked.markPureComponent
|
|
|
6
6
|
local useEffect = _roact_hooked.useEffect
|
|
7
7
|
local useState = _roact_hooked.useState
|
|
8
8
|
local useShadowStyles = TS.import(script, script.Parent, "Shadow.styles").default
|
|
9
|
-
local Shadow
|
|
9
|
+
local function Shadow()
|
|
10
10
|
local _binding = useShadowStyles()
|
|
11
11
|
local container = _binding.container
|
|
12
12
|
local parent, setParent = useState(nil)
|
|
@@ -8,5 +8,6 @@ export interface ToastProps {
|
|
|
8
8
|
variant?: ToastVariants;
|
|
9
9
|
toggledAt?: number;
|
|
10
10
|
}
|
|
11
|
-
declare
|
|
11
|
+
declare function Toast(props: ToastProps): Roact.Element;
|
|
12
|
+
declare const _default: typeof Toast;
|
|
12
13
|
export default _default;
|
|
@@ -11,7 +11,7 @@ local Directions = TS.import(script, script.Parent.Parent.Parent.Parent, "enums"
|
|
|
11
11
|
local Shadow = TS.import(script, script.Parent.Parent.Parent, "shadow").Shadow
|
|
12
12
|
local useToastStyles = TS.import(script, script.Parent, "Toast.styles").default
|
|
13
13
|
local TWEEN_DURATION = 0.5
|
|
14
|
-
local Toast
|
|
14
|
+
local function Toast(props)
|
|
15
15
|
local _binding = props
|
|
16
16
|
local text = _binding.text
|
|
17
17
|
local onDismiss = _binding.onDismiss
|
|
@@ -4,10 +4,12 @@ import Roact from "@rbxts/roact";
|
|
|
4
4
|
import { CustomizedProps } from "../../../../theme";
|
|
5
5
|
import { Icons } from "../../../enums";
|
|
6
6
|
import Tree from "../interfaces/Tree";
|
|
7
|
+
type DefaultTreeViewComponent = Frame;
|
|
7
8
|
export interface TreeViewProps {
|
|
8
9
|
tree: Tree;
|
|
9
10
|
icon?: Icons;
|
|
10
11
|
filter?: string;
|
|
11
12
|
}
|
|
12
|
-
declare
|
|
13
|
+
declare function TreeView(props: CustomizedProps<DefaultTreeViewComponent, TreeViewProps>): Roact.Element;
|
|
14
|
+
declare const _default: typeof TreeView;
|
|
13
15
|
export default _default;
|
|
@@ -11,7 +11,7 @@ local Icon = TS.import(script, script.Parent.Parent.Parent, "icon").Icon
|
|
|
11
11
|
local Typography = TS.import(script, script.Parent.Parent.Parent, "typography").Typography
|
|
12
12
|
local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
|
|
13
13
|
local useTreeViewStyles = TS.import(script, script.Parent, "TreeView.styles").default
|
|
14
|
-
local TreeView
|
|
14
|
+
local function TreeView(props)
|
|
15
15
|
local _binding = props
|
|
16
16
|
local tree = _binding.tree
|
|
17
17
|
local icon = _binding.icon
|