@rbxts/uiblox 0.1.7 → 0.1.9
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/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} +7 -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} +64 -85
- 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} +7 -7
- 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} +6 -6
- 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} +19 -17
- 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} +42 -57
- 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 +66 -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} +16 -21
- 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 +34 -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} +24 -22
- 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} +120 -137
- 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} +8 -19
- 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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src.ts)
|
|
4
|
+
local useSidebarStyles = TS.import(script, script.Parent, "Sidebar.styles").default
|
|
5
|
+
local function Sidebar(props)
|
|
6
|
+
local _binding = props
|
|
7
|
+
local className = _binding.className
|
|
8
|
+
local children = _binding.children
|
|
9
|
+
local _binding_1 = useSidebarStyles(props)
|
|
10
|
+
local root = _binding_1.root
|
|
11
|
+
local container = _binding_1.container
|
|
12
|
+
local _attributes = {
|
|
13
|
+
Key = "Sidebar",
|
|
14
|
+
}
|
|
15
|
+
for _k, _v in root do
|
|
16
|
+
_attributes[_k] = _v
|
|
17
|
+
end
|
|
18
|
+
if className ~= 0 and className == className and className ~= "" and className then
|
|
19
|
+
for _k, _v in className do
|
|
20
|
+
_attributes[_k] = _v
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
local _attributes_1 = {
|
|
24
|
+
Key = "Container",
|
|
25
|
+
}
|
|
26
|
+
for _k, _v in container do
|
|
27
|
+
_attributes_1[_k] = _v
|
|
28
|
+
end
|
|
29
|
+
return Roact.jsx("frame", _attributes, Roact.jsx("frame", _attributes_1, children))
|
|
30
|
+
end
|
|
31
|
+
local default = Sidebar
|
|
32
|
+
return {
|
|
33
|
+
default = default,
|
|
34
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SidebarProps } from "./Sidebar";
|
|
2
|
-
declare const useSidebarStyles: (props: SidebarProps) => import("../../../../theme").ClassNameMap<string>;
|
|
2
|
+
declare const useSidebarStyles: (props: SidebarProps) => import("../../../../theme/index").ClassNameMap<string>;
|
|
3
3
|
export default useSidebarStyles;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
-- Compiled with roblox-ts
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local BoatTween = TS.import(script, TS.getModule(script, "@rbxts", "boat-tween").src).BoatTween
|
|
4
|
-
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src)
|
|
4
|
+
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src.ts)
|
|
5
5
|
local _roact_hooked = TS.import(script, TS.getModule(script, "@rbxts", "roact-hooked").src)
|
|
6
6
|
local markPureComponent = _roact_hooked.markPureComponent
|
|
7
7
|
local useEffect = _roact_hooked.useEffect
|
|
@@ -55,38 +55,40 @@ local function Toast(props)
|
|
|
55
55
|
end
|
|
56
56
|
end, {})
|
|
57
57
|
local _attributes = {
|
|
58
|
-
|
|
58
|
+
Key = "Toast",
|
|
59
|
+
Ref = frameRef,
|
|
59
60
|
}
|
|
60
61
|
for _k, _v in container do
|
|
61
62
|
_attributes[_k] = _v
|
|
62
63
|
end
|
|
63
|
-
local
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
local _exp = Roact.jsx("uicorner", {
|
|
65
|
+
Key = "Corner",
|
|
66
|
+
CornerRadius = UDim.new(0, DefaultTheme.shape.borderRadius),
|
|
67
|
+
})
|
|
68
|
+
local _exp_1 = Roact.jsx(Shadow)
|
|
69
|
+
local _attributes_1 = {
|
|
70
|
+
Key = "Label",
|
|
68
71
|
}
|
|
69
|
-
local _length = #_children
|
|
70
|
-
local _attributes_1 = {}
|
|
71
72
|
for _k, _v in label do
|
|
72
73
|
_attributes_1[_k] = _v
|
|
73
74
|
end
|
|
74
75
|
_attributes_1.Text = text
|
|
75
|
-
|
|
76
|
-
local _attributes_2 = {
|
|
76
|
+
local _exp_2 = Roact.jsx("textlabel", _attributes_1)
|
|
77
|
+
local _attributes_2 = {
|
|
78
|
+
Key = "Close",
|
|
79
|
+
}
|
|
77
80
|
for _k, _v in close do
|
|
78
81
|
_attributes_2[_k] = _v
|
|
79
82
|
end
|
|
80
|
-
_attributes_2
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
onDismiss
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
})
|
|
83
|
+
_attributes_2.Event = {
|
|
84
|
+
MouseButton1Click = function()
|
|
85
|
+
tween(Directions.Out)
|
|
86
|
+
if onDismiss then
|
|
87
|
+
onDismiss()
|
|
88
|
+
end
|
|
89
|
+
end,
|
|
90
|
+
}
|
|
91
|
+
return Roact.jsx("frame", _attributes, _exp, _exp_1, _exp_2, Roact.jsx("imagebutton", _attributes_2))
|
|
90
92
|
end
|
|
91
93
|
local default = markPureComponent(Toast)
|
|
92
94
|
return {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ToastProps } from "./Toast";
|
|
2
|
-
declare const useToastStyles: (props: ToastProps) => import("../../../../theme").ClassNameMap<string>;
|
|
2
|
+
declare const useToastStyles: (props: ToastProps) => import("../../../../theme/index").ClassNameMap<string>;
|
|
3
3
|
export default useToastStyles;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/// <reference types="@rbxts/types" />
|
|
2
|
-
/// <reference types="roact" />
|
|
3
1
|
import Roact from "@rbxts/roact";
|
|
4
|
-
import { CustomizedProps } from "../../../../theme";
|
|
5
|
-
import { Icons } from "../../../enums";
|
|
2
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
+
import { Icons } from "../../../enums/index";
|
|
6
4
|
import Tree from "../interfaces/Tree";
|
|
7
5
|
type DefaultTreeViewComponent = Frame;
|
|
8
6
|
export interface TreeViewProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
-- Compiled with roblox-ts
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
|
-
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src)
|
|
3
|
+
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src.ts)
|
|
4
4
|
local _roact_hooked = TS.import(script, TS.getModule(script, "@rbxts", "roact-hooked").src)
|
|
5
5
|
local markPureComponent = _roact_hooked.markPureComponent
|
|
6
6
|
local useCallback = _roact_hooked.useCallback
|
|
@@ -37,14 +37,16 @@ local function TreeView(props)
|
|
|
37
37
|
end
|
|
38
38
|
local height = 0
|
|
39
39
|
local _exp = rbx:GetChildren()
|
|
40
|
-
|
|
40
|
+
-- ▼ ReadonlyArray.forEach ▼
|
|
41
|
+
local _callback = function(c)
|
|
41
42
|
if c:IsA("GuiObject") then
|
|
42
43
|
height += c.AbsoluteSize.Y
|
|
43
44
|
end
|
|
44
45
|
end
|
|
45
46
|
for _k, _v in _exp do
|
|
46
|
-
|
|
47
|
+
_callback(_v, _k - 1, _exp)
|
|
47
48
|
end
|
|
49
|
+
-- ▲ ReadonlyArray.forEach ▲
|
|
48
50
|
TS.try(function()
|
|
49
51
|
setCanvasSize(UDim2.new(0, 0, 0, height))
|
|
50
52
|
end, function()
|
|
@@ -65,14 +67,16 @@ local function TreeView(props)
|
|
|
65
67
|
return true
|
|
66
68
|
end
|
|
67
69
|
local parts = string.split(title, "/")
|
|
68
|
-
|
|
70
|
+
-- ▼ ReadonlyArray.forEach ▼
|
|
71
|
+
local _callback = function(part)
|
|
69
72
|
if #part >= #filter and string.sub(string.upper(part), 1, #filter) == string.upper(filter) then
|
|
70
73
|
isMatch = true
|
|
71
74
|
end
|
|
72
75
|
end
|
|
73
76
|
for _k, _v in parts do
|
|
74
|
-
|
|
77
|
+
_callback(_v, _k - 1, parts)
|
|
75
78
|
end
|
|
79
|
+
-- ▲ ReadonlyArray.forEach ▲
|
|
76
80
|
return isMatch
|
|
77
81
|
end, { filter })
|
|
78
82
|
-- Automatically expand branches that match filter
|
|
@@ -91,8 +95,9 @@ local function TreeView(props)
|
|
|
91
95
|
end
|
|
92
96
|
local newExpanded = {}
|
|
93
97
|
-- Figure out which branches should be expanded
|
|
94
|
-
local
|
|
95
|
-
|
|
98
|
+
local _exp = tree.branches
|
|
99
|
+
-- ▼ ReadonlyArray.forEach ▼
|
|
100
|
+
local _callback = function(branch)
|
|
96
101
|
local matchesBranchFilter = matchesFilter(branch.title)
|
|
97
102
|
if matchesBranchFilter then
|
|
98
103
|
-- If branch is a match, whole branch should be expanded
|
|
@@ -103,8 +108,9 @@ local function TreeView(props)
|
|
|
103
108
|
end
|
|
104
109
|
else
|
|
105
110
|
-- If any of the leaves are a match, branch should be expanded
|
|
106
|
-
local
|
|
107
|
-
|
|
111
|
+
local _exp_1 = branch.leaves
|
|
112
|
+
-- ▼ ReadonlyArray.forEach ▼
|
|
113
|
+
local _callback_1 = function(leaf)
|
|
108
114
|
local _branch = branch
|
|
109
115
|
if table.find(newExpanded, _branch) ~= nil then
|
|
110
116
|
return nil
|
|
@@ -115,18 +121,22 @@ local function TreeView(props)
|
|
|
115
121
|
table.insert(newExpanded, _branch_1)
|
|
116
122
|
end
|
|
117
123
|
end
|
|
118
|
-
for _k, _v in
|
|
119
|
-
|
|
124
|
+
for _k, _v in _exp_1 do
|
|
125
|
+
_callback_1(_v, _k - 1, _exp_1)
|
|
120
126
|
end
|
|
127
|
+
-- ▲ ReadonlyArray.forEach ▲
|
|
121
128
|
end
|
|
122
129
|
end
|
|
123
|
-
for _k, _v in
|
|
124
|
-
|
|
130
|
+
for _k, _v in _exp do
|
|
131
|
+
_callback(_v, _k - 1, _exp)
|
|
125
132
|
end
|
|
133
|
+
-- ▲ ReadonlyArray.forEach ▲
|
|
126
134
|
-- Set expanded to new array
|
|
127
135
|
setExpanded(newExpanded)
|
|
128
136
|
end, { tree, filter })
|
|
129
|
-
local _attributes = {
|
|
137
|
+
local _attributes = {
|
|
138
|
+
Key = "TreeView",
|
|
139
|
+
}
|
|
130
140
|
for _k, _v in root do
|
|
131
141
|
_attributes[_k] = _v
|
|
132
142
|
end
|
|
@@ -135,8 +145,6 @@ local function TreeView(props)
|
|
|
135
145
|
_attributes[_k] = _v
|
|
136
146
|
end
|
|
137
147
|
end
|
|
138
|
-
local _children = {}
|
|
139
|
-
local _length = #_children
|
|
140
148
|
local _attributes_1 = {}
|
|
141
149
|
local _object = {
|
|
142
150
|
Text = tree.title,
|
|
@@ -148,24 +156,26 @@ local function TreeView(props)
|
|
|
148
156
|
_attributes_1.color = "textSecondary"
|
|
149
157
|
_attributes_1.variant = "body"
|
|
150
158
|
_attributes_1.family = "bold"
|
|
151
|
-
|
|
152
|
-
local _attributes_2 = {
|
|
159
|
+
local _exp = Roact.jsx(Typography, _attributes_1)
|
|
160
|
+
local _attributes_2 = {
|
|
161
|
+
Key = "List",
|
|
162
|
+
}
|
|
153
163
|
for _k, _v in list do
|
|
154
164
|
_attributes_2[_k] = _v
|
|
155
165
|
end
|
|
156
166
|
_attributes_2.CanvasSize = canvasSize
|
|
157
|
-
_attributes_2
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
local _attributes_3 =
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
local
|
|
168
|
-
local
|
|
167
|
+
_attributes_2.Event = {
|
|
168
|
+
AncestryChanged = resizeScrollingFrame,
|
|
169
|
+
ChildAdded = resizeScrollingFrame,
|
|
170
|
+
ChildRemoved = resizeScrollingFrame,
|
|
171
|
+
}
|
|
172
|
+
local _attributes_3 = table.clone(gridLayout)
|
|
173
|
+
setmetatable(_attributes_3, nil)
|
|
174
|
+
local _exp_1 = Roact.jsx("uigridlayout", _attributes_3)
|
|
175
|
+
local _exp_2 = tree.branches
|
|
176
|
+
-- ▼ ReadonlyArray.map ▼
|
|
177
|
+
local _newValue = table.create(#_exp_2)
|
|
178
|
+
local _callback = function(branch, branchIndex)
|
|
169
179
|
local matchesBranchFilter = matchesFilter(branch.title)
|
|
170
180
|
local hasMatchingLeaf = matchesBranchFilter
|
|
171
181
|
if not hasMatchingLeaf then
|
|
@@ -177,53 +187,54 @@ local function TreeView(props)
|
|
|
177
187
|
end
|
|
178
188
|
end
|
|
179
189
|
if matchesBranchFilter or hasMatchingLeaf then
|
|
180
|
-
local
|
|
181
|
-
|
|
182
|
-
|
|
190
|
+
local _attributes_4 = {
|
|
191
|
+
Key = `{branch.title}-{branchIndex}`,
|
|
192
|
+
}
|
|
183
193
|
for _k, _v in row do
|
|
184
194
|
_attributes_4[_k] = _v
|
|
185
195
|
end
|
|
186
|
-
_attributes_4
|
|
187
|
-
|
|
188
|
-
branch.onClick
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
local _newValue = {}
|
|
202
|
-
local _length_3 = 0
|
|
203
|
-
for _k, _v in _oldExpanded do
|
|
204
|
-
if _arg0_1(_v, _k - 1, _oldExpanded) == true then
|
|
205
|
-
_length_3 += 1
|
|
206
|
-
_newValue[_length_3] = _v
|
|
196
|
+
_attributes_4.Event = {
|
|
197
|
+
MouseButton1Click = function()
|
|
198
|
+
if branch.onClick then
|
|
199
|
+
branch.onClick()
|
|
200
|
+
end
|
|
201
|
+
-- If there are leaves... Expand/Collapse
|
|
202
|
+
if #branch.leaves > 0 then
|
|
203
|
+
local _branch = branch
|
|
204
|
+
local isExpanded = table.find(expanded, _branch) ~= nil
|
|
205
|
+
if isExpanded then
|
|
206
|
+
setExpanded(function(oldExpanded)
|
|
207
|
+
-- ▼ ReadonlyArray.filter ▼
|
|
208
|
+
local _newValue_1 = {}
|
|
209
|
+
local _callback_1 = function(b)
|
|
210
|
+
return b ~= branch
|
|
207
211
|
end
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
+
local _length = 0
|
|
213
|
+
for _k, _v in oldExpanded do
|
|
214
|
+
if _callback_1(_v, _k - 1, oldExpanded) == true then
|
|
215
|
+
_length += 1
|
|
216
|
+
_newValue_1[_length] = _v
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
-- ▲ ReadonlyArray.filter ▲
|
|
220
|
+
return _newValue_1
|
|
221
|
+
end)
|
|
222
|
+
else
|
|
223
|
+
setExpanded(function(oldExpanded)
|
|
224
|
+
local _array = {}
|
|
225
|
+
local _length = #_array
|
|
226
|
+
local _oldExpandedLength = #oldExpanded
|
|
227
|
+
table.move(oldExpanded, 1, _oldExpandedLength, _length + 1, _array)
|
|
228
|
+
_length += _oldExpandedLength
|
|
229
|
+
_array[_length + 1] = branch
|
|
230
|
+
return _array
|
|
231
|
+
end)
|
|
232
|
+
end
|
|
212
233
|
else
|
|
213
|
-
|
|
214
|
-
local _array = {}
|
|
215
|
-
local _length_3 = #_array
|
|
216
|
-
local _oldExpandedLength = #oldExpanded
|
|
217
|
-
table.move(oldExpanded, 1, _oldExpandedLength, _length_3 + 1, _array)
|
|
218
|
-
_length_3 += _oldExpandedLength
|
|
219
|
-
_array[_length_3 + 1] = branch
|
|
220
|
-
return _array
|
|
221
|
-
end)
|
|
234
|
+
setSelectedBranch(branch)
|
|
222
235
|
end
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
end
|
|
226
|
-
end
|
|
236
|
+
end,
|
|
237
|
+
}
|
|
227
238
|
local _condition = #branch.leaves > 0
|
|
228
239
|
if _condition then
|
|
229
240
|
local _attributes_5 = {}
|
|
@@ -232,106 +243,78 @@ local function TreeView(props)
|
|
|
232
243
|
_attributes_5.size = "xxs"
|
|
233
244
|
_attributes_5.className = branchIcon
|
|
234
245
|
_attributes_5.tint = DefaultTheme.options.constants.extendedPalette.Gray[70]
|
|
235
|
-
_condition = (Roact.
|
|
246
|
+
_condition = (Roact.jsx(Icon, _attributes_5))
|
|
236
247
|
end
|
|
237
|
-
local _children_3 = {}
|
|
238
|
-
local _length_3 = #_children_3
|
|
239
|
-
if _condition then
|
|
240
|
-
_children_3[_length_3 + 1] = _condition
|
|
241
|
-
end
|
|
242
|
-
_length_3 = #_children_3
|
|
243
248
|
local _attributes_5 = {
|
|
244
249
|
text = branch.title,
|
|
245
250
|
}
|
|
246
|
-
local _object_1 =
|
|
247
|
-
|
|
248
|
-
_object_1[_k] = _v
|
|
249
|
-
end
|
|
251
|
+
local _object_1 = table.clone(branchTypography)
|
|
252
|
+
setmetatable(_object_1, nil)
|
|
250
253
|
_attributes_5.className = _object_1
|
|
251
254
|
_attributes_5.color = "textPrimary"
|
|
252
255
|
_attributes_5.variant = "body"
|
|
253
256
|
_attributes_5.family = if selectedBranch == branch then "bold" else "default"
|
|
254
|
-
|
|
255
|
-
_children_2[branch.title .. ("-" .. tostring(branchIndex))] = Roact.createFragment({
|
|
256
|
-
[branch.title .. ("-" .. tostring(branchIndex))] = Roact.createElement("TextButton", _attributes_4, _children_3),
|
|
257
|
-
})
|
|
257
|
+
local _exp_3 = Roact.jsx("textbutton", _attributes_4, _condition, Roact.jsx(Typography, _attributes_5))
|
|
258
258
|
local _branch = branch
|
|
259
259
|
local _condition_1 = table.find(expanded, _branch) ~= nil
|
|
260
260
|
if _condition_1 then
|
|
261
|
-
local
|
|
262
|
-
|
|
261
|
+
local _exp_4 = branch.leaves
|
|
262
|
+
-- ▼ ReadonlyArray.map ▼
|
|
263
|
+
local _newValue_1 = table.create(#_exp_4)
|
|
264
|
+
local _callback_1 = function(leaf, leafIndex)
|
|
263
265
|
local matchesLeafFilter = matchesFilter(leaf.title)
|
|
264
266
|
if matchesBranchFilter or matchesLeafFilter then
|
|
265
|
-
local _attributes_6 = {
|
|
267
|
+
local _attributes_6 = {
|
|
268
|
+
Key = `{branch.title}-{branchIndex}-{leaf.title}-{leafIndex}`,
|
|
269
|
+
}
|
|
266
270
|
for _k, _v in row do
|
|
267
271
|
_attributes_6[_k] = _v
|
|
268
272
|
end
|
|
269
|
-
_attributes_6
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
leaf.onClick
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
Roact.createElement(Icon, {
|
|
278
|
-
icon = icon or Icons.ListPrimary,
|
|
279
|
-
size = "xs",
|
|
280
|
-
className = leafIcon,
|
|
281
|
-
tint = DefaultTheme.palette.secondary.main,
|
|
282
|
-
}),
|
|
273
|
+
_attributes_6.Event = {
|
|
274
|
+
MouseButton1Click = function()
|
|
275
|
+
setSelectedLeaf(leaf)
|
|
276
|
+
setSelectedBranch(branch)
|
|
277
|
+
if leaf.onClick then
|
|
278
|
+
leaf.onClick()
|
|
279
|
+
end
|
|
280
|
+
end,
|
|
283
281
|
}
|
|
284
|
-
local
|
|
282
|
+
local _exp_5 = Roact.jsx(Icon, {
|
|
283
|
+
icon = icon or Icons.ListPrimary,
|
|
284
|
+
size = "xs",
|
|
285
|
+
className = leafIcon,
|
|
286
|
+
tint = DefaultTheme.palette.secondary.main,
|
|
287
|
+
})
|
|
285
288
|
local _attributes_7 = {
|
|
286
289
|
text = leaf.title,
|
|
287
290
|
}
|
|
288
|
-
local _object_2 =
|
|
289
|
-
|
|
290
|
-
_object_2[_k] = _v
|
|
291
|
-
end
|
|
291
|
+
local _object_2 = table.clone(leafTypography)
|
|
292
|
+
setmetatable(_object_2, nil)
|
|
292
293
|
_attributes_7.className = _object_2
|
|
293
294
|
_attributes_7.color = "textPrimary"
|
|
294
295
|
_attributes_7.variant = "body"
|
|
295
296
|
_attributes_7.family = if selectedLeaf == leaf then "bold" else "default"
|
|
296
|
-
|
|
297
|
-
return Roact.createFragment({
|
|
298
|
-
[branch.title .. ("-" .. (tostring(branchIndex) .. ("-" .. (leaf.title .. ("-" .. tostring(leafIndex))))))] = Roact.createElement("TextButton", _attributes_6, _children_4),
|
|
299
|
-
})
|
|
297
|
+
return Roact.jsx("textbutton", _attributes_6, _exp_5, Roact.jsx(Typography, _attributes_7))
|
|
300
298
|
else
|
|
301
|
-
return Roact.
|
|
299
|
+
return Roact.jsx(Roact.Fragment)
|
|
302
300
|
end
|
|
303
301
|
end
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
for _k, _v in _leaves do
|
|
307
|
-
_newValue[_k] = _arg0_1(_v, _k - 1, _leaves)
|
|
302
|
+
for _k, _v in _exp_4 do
|
|
303
|
+
_newValue_1[_k] = _callback_1(_v, _k - 1, _exp_4)
|
|
308
304
|
end
|
|
309
305
|
-- ▲ ReadonlyArray.map ▲
|
|
310
|
-
_condition_1 =
|
|
306
|
+
_condition_1 = _newValue_1
|
|
311
307
|
end
|
|
312
|
-
|
|
313
|
-
for _k, _v in _condition_1 do
|
|
314
|
-
_children_2[_length_2 + _k] = _v
|
|
315
|
-
end
|
|
316
|
-
end
|
|
317
|
-
return Roact.createFragment(_children_2)
|
|
308
|
+
return Roact.jsx(Roact.Fragment, nil, _exp_3, _condition_1)
|
|
318
309
|
else
|
|
319
|
-
return Roact.
|
|
310
|
+
return Roact.jsx(Roact.Fragment)
|
|
320
311
|
end
|
|
321
312
|
end
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
for _k, _v in _branches do
|
|
325
|
-
_newValue[_k] = _arg0(_v, _k - 1, _branches)
|
|
313
|
+
for _k, _v in _exp_2 do
|
|
314
|
+
_newValue[_k] = _callback(_v, _k - 1, _exp_2)
|
|
326
315
|
end
|
|
327
316
|
-- ▲ ReadonlyArray.map ▲
|
|
328
|
-
|
|
329
|
-
_children_1[_length_1 + 1 + _k] = _v
|
|
330
|
-
end
|
|
331
|
-
_children.List = Roact.createElement("ScrollingFrame", _attributes_2, _children_1)
|
|
332
|
-
return Roact.createFragment({
|
|
333
|
-
TreeView = Roact.createElement("Frame", _attributes, _children),
|
|
334
|
-
})
|
|
317
|
+
return Roact.jsx("frame", _attributes, _exp, Roact.jsx("scrollingframe", _attributes_2, _exp_1, _newValue))
|
|
335
318
|
end
|
|
336
319
|
local default = markPureComponent(TreeView)
|
|
337
320
|
return {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useTreeViewStyles: () => import("../../../../theme").ClassNameMap<string>;
|
|
1
|
+
declare const useTreeViewStyles: () => import("../../../../theme/index").ClassNameMap<string>;
|
|
2
2
|
export default useTreeViewStyles;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/// <reference types="@rbxts/types" />
|
|
2
|
-
/// <reference types="roact" />
|
|
3
1
|
import Roact from "@rbxts/roact";
|
|
4
|
-
import { CustomizedProps } from "../../../../theme";
|
|
5
|
-
import { FontFamilyVariant, FontSizeVariant } from "../../../../theme/interfaces/typography";
|
|
2
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
+
import { FontFamilyVariant, FontSizeVariant } from "../../../../theme/interfaces/typography/index";
|
|
6
4
|
import { TypographyAlignment } from "../types/TypographyAlignment";
|
|
7
5
|
import { TypographyColor } from "../types/TypographyColor";
|
|
8
6
|
import { TypographyDisplay } from "../types/TypographyDisplay";
|