@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 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, { FunctionComponent } from "@rbxts/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
- const MyComponent: FunctionComponent<MyComponentProps> =
144
- (props) => {
145
- const { title, bolded = false } = props;
146
- const { root, button } = useMyComponentStyles(props);
147
-
148
- return (
149
- <frame Key="MyComponent" {...root}>
150
- <Button
151
- variant="outlined"
152
- text={title}
153
- size="small"
154
- color="secondary"
155
- family={bolded ? "bold" : "default"}
156
- className={button}
157
- ></Button>
158
- </frame>
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 const _default: Roact.FunctionComponent<ThemeProviderProps>;
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 = function(props)
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 const _default: Roact.FunctionComponent<ThemeWrapperProps>;
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 = function(props)
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 const _default: Roact.FunctionComponent<CustomizedProps<TextButton, ButtonProps>>;
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 = function(props)
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
- declare const _default: Roact.FunctionComponent<CustomizedProps<ImageLabel, IconProps>>;
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 = function(props)
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
- declare const _default: Roact.FunctionComponent<CustomizedProps<ImageButton, IconButtonProps>>;
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 = function(props)
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 const _default: Roact.FunctionComponent<CustomizedProps<Frame, InputProps>>;
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 = function(props)
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 const _default: Roact.FunctionComponent<ProgressBarProps>;
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 = function(_param)
6
+ local function ProgressBar(_param)
7
7
  local progress = _param.progress
8
8
  local className = _param.className
9
9
  local _binding = useProgressBarStyles()
@@ -1,4 +1,5 @@
1
1
  /// <reference types="roact" />
2
2
  import Roact from "@rbxts/roact";
3
- declare const _default: Roact.FunctionComponent;
3
+ declare function Shadow(): Roact.Element;
4
+ declare const _default: typeof Shadow;
4
5
  export default _default;
@@ -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 = function()
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 const _default: Roact.FunctionComponent<ToastProps>;
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 = function(props)
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 const _default: Roact.FunctionComponent<CustomizedProps<Frame, TreeViewProps>>;
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 = function(props)
14
+ local function TreeView(props)
15
15
  local _binding = props
16
16
  local tree = _binding.tree
17
17
  local icon = _binding.icon
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/uiblox",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "UI Library and theming for roblox-ts projects",
5
5
  "main": "out/init.lua",
6
6
  "scripts": {