@rbxts/uiblox 0.1.0
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/LICENSE +21 -0
- package/README.md +263 -0
- package/out/index.d.ts +2 -0
- package/out/init.lua +10 -0
- package/out/theme/components/ThemeProvider.d.ts +7 -0
- package/out/theme/components/ThemeProvider.lua +37 -0
- package/out/theme/components/ThemeStore.d.ts +14 -0
- package/out/theme/components/ThemeStore.lua +29 -0
- package/out/theme/components/ThemeWrapper.d.ts +7 -0
- package/out/theme/components/ThemeWrapper.lua +52 -0
- package/out/theme/components/index.d.ts +8 -0
- package/out/theme/components/init.lua +10 -0
- package/out/theme/constants/NumberConstants.d.ts +6 -0
- package/out/theme/constants/NumberConstants.lua +18 -0
- package/out/theme/constants/ThemeConstants.d.ts +5 -0
- package/out/theme/constants/ThemeConstants.lua +104 -0
- package/out/theme/constants/index.d.ts +2 -0
- package/out/theme/constants/init.lua +10 -0
- package/out/theme/index.d.ts +20 -0
- package/out/theme/init.lua +27 -0
- package/out/theme/interfaces/IconSizes/IconSizes.d.ts +5 -0
- package/out/theme/interfaces/IconSizes/IconSizes.lua +2 -0
- package/out/theme/interfaces/IconSizes/index.d.ts +1 -0
- package/out/theme/interfaces/IconSizes/init.lua +2 -0
- package/out/theme/interfaces/Palette/ColorTokens/ColorTokens.d.ts +5 -0
- package/out/theme/interfaces/Palette/ColorTokens/ColorTokens.lua +2 -0
- package/out/theme/interfaces/Palette/ColorTokens/index.d.ts +1 -0
- package/out/theme/interfaces/Palette/ColorTokens/init.lua +2 -0
- package/out/theme/interfaces/Palette/Colors/Blue.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Blue.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Colors.d.ts +43 -0
- package/out/theme/interfaces/Palette/Colors/Colors.lua +2 -0
- package/out/theme/interfaces/Palette/Colors/Common.d.ts +7 -0
- package/out/theme/interfaces/Palette/Colors/Common.lua +9 -0
- package/out/theme/interfaces/Palette/Colors/Dark.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Dark.lua +24 -0
- package/out/theme/interfaces/Palette/Colors/Gray.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Gray.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Green.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Green.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Light.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Light.lua +8 -0
- package/out/theme/interfaces/Palette/Colors/Magenta.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Magenta.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Orange.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Orange.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Purple.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Purple.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Red.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Red.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Turquoise.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Turquoise.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/Yellow.d.ts +3 -0
- package/out/theme/interfaces/Palette/Colors/Yellow.lua +21 -0
- package/out/theme/interfaces/Palette/Colors/index.d.ts +13 -0
- package/out/theme/interfaces/Palette/Colors/init.lua +16 -0
- package/out/theme/interfaces/Palette/Palette.d.ts +27 -0
- package/out/theme/interfaces/Palette/Palette.lua +2 -0
- package/out/theme/interfaces/Palette/index.d.ts +3 -0
- package/out/theme/interfaces/Palette/init.lua +7 -0
- package/out/theme/interfaces/Spacing/Borders.d.ts +4 -0
- package/out/theme/interfaces/Spacing/Borders.lua +2 -0
- package/out/theme/interfaces/Spacing/Padding.d.ts +4 -0
- package/out/theme/interfaces/Spacing/Padding.lua +2 -0
- package/out/theme/interfaces/Spacing/Shape.d.ts +3 -0
- package/out/theme/interfaces/Spacing/Shape.lua +2 -0
- package/out/theme/interfaces/Spacing/Spacing.d.ts +4 -0
- package/out/theme/interfaces/Spacing/Spacing.lua +2 -0
- package/out/theme/interfaces/Spacing/index.d.ts +4 -0
- package/out/theme/interfaces/Spacing/init.lua +2 -0
- package/out/theme/interfaces/Theme/Theme.d.ts +14 -0
- package/out/theme/interfaces/Theme/Theme.lua +2 -0
- package/out/theme/interfaces/Theme/ThemeConstants.d.ts +25 -0
- package/out/theme/interfaces/Theme/ThemeConstants.lua +2 -0
- package/out/theme/interfaces/Theme/ThemeOptions.d.ts +4 -0
- package/out/theme/interfaces/Theme/ThemeOptions.lua +2 -0
- package/out/theme/interfaces/Theme/index.d.ts +3 -0
- package/out/theme/interfaces/Theme/init.lua +2 -0
- package/out/theme/interfaces/Tokens/Tokens.d.ts +1 -0
- package/out/theme/interfaces/Tokens/Tokens.lua +2 -0
- package/out/theme/interfaces/Tokens/index.d.ts +1 -0
- package/out/theme/interfaces/Tokens/init.lua +2 -0
- package/out/theme/interfaces/index.d.ts +13 -0
- package/out/theme/interfaces/init.lua +16 -0
- package/out/theme/interfaces/typography/FontFamilies.d.ts +2 -0
- package/out/theme/interfaces/typography/FontFamilies.lua +11 -0
- package/out/theme/interfaces/typography/FontFamilyOptions.d.ts +5 -0
- package/out/theme/interfaces/typography/FontFamilyOptions.lua +2 -0
- package/out/theme/interfaces/typography/FontSizeOptions.d.ts +4 -0
- package/out/theme/interfaces/typography/FontSizeOptions.lua +2 -0
- package/out/theme/interfaces/typography/FontSizes.d.ts +3 -0
- package/out/theme/interfaces/typography/FontSizes.lua +15 -0
- package/out/theme/interfaces/typography/ThemeTypography.d.ts +7 -0
- package/out/theme/interfaces/typography/ThemeTypography.lua +2 -0
- package/out/theme/interfaces/typography/Variants.d.ts +18 -0
- package/out/theme/interfaces/typography/Variants.lua +24 -0
- package/out/theme/interfaces/typography/index.d.ts +8 -0
- package/out/theme/interfaces/typography/init.lua +13 -0
- package/out/theme/styles/index.d.ts +5 -0
- package/out/theme/styles/init.lua +7 -0
- package/out/theme/styles/types/WriteableStyle.d.ts +3 -0
- package/out/theme/styles/types/WriteableStyle.lua +2 -0
- package/out/theme/styles/types/index.d.ts +2 -0
- package/out/theme/styles/types/init.lua +2 -0
- package/out/theme/styles/types/styles.d.ts +4 -0
- package/out/theme/styles/types/styles.lua +2 -0
- package/out/theme/styles/utilities/classNames.d.ts +8 -0
- package/out/theme/styles/utilities/classNames.lua +31 -0
- package/out/theme/styles/utilities/createStyles.d.ts +3 -0
- package/out/theme/styles/utilities/createStyles.lua +8 -0
- package/out/theme/styles/utilities/index.d.ts +3 -0
- package/out/theme/styles/utilities/init.lua +7 -0
- package/out/theme/styles/utilities/makeStyles.d.ts +7 -0
- package/out/theme/styles/utilities/makeStyles.lua +32 -0
- package/out/theme/themes/DarkTheme.d.ts +3 -0
- package/out/theme/themes/DarkTheme.lua +99 -0
- package/out/theme/themes/LightTheme.d.ts +3 -0
- package/out/theme/themes/LightTheme.lua +99 -0
- package/out/theme/themes/index.d.ts +3 -0
- package/out/theme/themes/init.lua +7 -0
- package/out/theme/types/index.d.ts +7 -0
- package/out/theme/types/init.lua +2 -0
- package/out/theme/types/types.d.ts +16 -0
- package/out/theme/types/types.lua +3 -0
- package/out/theme/utilites/Color3FromHex.d.ts +2 -0
- package/out/theme/utilites/Color3FromHex.lua +14 -0
- package/out/theme/utilites/index.d.ts +1 -0
- package/out/theme/utilites/init.lua +5 -0
- package/out/ui/constants/ImageConstants.d.ts +2 -0
- package/out/ui/constants/ImageConstants.lua +7 -0
- package/out/ui/constants/LayoutConstants.d.ts +1 -0
- package/out/ui/constants/LayoutConstants.lua +7 -0
- package/out/ui/constants/index.d.ts +2 -0
- package/out/ui/constants/init.lua +10 -0
- package/out/ui/enums/Directions.d.ts +8 -0
- package/out/ui/enums/Directions.lua +23 -0
- package/out/ui/enums/Icons.d.ts +40 -0
- package/out/ui/enums/Icons.lua +87 -0
- package/out/ui/enums/Orientations.d.ts +4 -0
- package/out/ui/enums/Orientations.lua +15 -0
- package/out/ui/enums/index.d.ts +3 -0
- package/out/ui/enums/init.lua +7 -0
- package/out/ui/index.d.ts +34 -0
- package/out/ui/init.lua +24 -0
- package/out/ui/packages/button/components/Button.d.ts +26 -0
- package/out/ui/packages/button/components/Button.lua +175 -0
- package/out/ui/packages/button/components/Button.styles.d.ts +3 -0
- package/out/ui/packages/button/components/Button.styles.lua +149 -0
- package/out/ui/packages/button/index.d.ts +6 -0
- package/out/ui/packages/button/init.lua +8 -0
- package/out/ui/packages/button/types/ButtonColor.d.ts +1 -0
- package/out/ui/packages/button/types/ButtonColor.lua +2 -0
- package/out/ui/packages/button/types/ButtonSize.d.ts +1 -0
- package/out/ui/packages/button/types/ButtonSize.lua +2 -0
- package/out/ui/packages/button/types/ButtonVariant.d.ts +1 -0
- package/out/ui/packages/button/types/ButtonVariant.lua +2 -0
- package/out/ui/packages/button/types/index.d.ts +3 -0
- package/out/ui/packages/button/types/init.lua +2 -0
- package/out/ui/packages/divider/components/Divider.d.ts +18 -0
- package/out/ui/packages/divider/components/Divider.lua +27 -0
- package/out/ui/packages/divider/components/Divider.styles.d.ts +3 -0
- package/out/ui/packages/divider/components/Divider.styles.lua +42 -0
- package/out/ui/packages/divider/index.d.ts +3 -0
- package/out/ui/packages/divider/init.lua +8 -0
- package/out/ui/packages/icon/components/Icon.d.ts +11 -0
- package/out/ui/packages/icon/components/Icon.lua +31 -0
- package/out/ui/packages/icon/components/Icon.styles.d.ts +3 -0
- package/out/ui/packages/icon/components/Icon.styles.lua +47 -0
- package/out/ui/packages/icon/index.d.ts +3 -0
- package/out/ui/packages/icon/init.lua +8 -0
- package/out/ui/packages/iconButton/components/IconButton.d.ts +13 -0
- package/out/ui/packages/iconButton/components/IconButton.lua +48 -0
- package/out/ui/packages/iconButton/components/IconButton.styles.d.ts +3 -0
- package/out/ui/packages/iconButton/components/IconButton.styles.lua +47 -0
- package/out/ui/packages/iconButton/index.d.ts +3 -0
- package/out/ui/packages/iconButton/init.lua +8 -0
- package/out/ui/packages/index.d.ts +11 -0
- package/out/ui/packages/init.lua +37 -0
- package/out/ui/packages/input/components/Input.d.ts +26 -0
- package/out/ui/packages/input/components/Input.lua +165 -0
- package/out/ui/packages/input/components/Input.styles.d.ts +3 -0
- package/out/ui/packages/input/components/Input.styles.lua +156 -0
- package/out/ui/packages/input/index.d.ts +6 -0
- package/out/ui/packages/input/init.lua +8 -0
- package/out/ui/packages/input/types/InputColor.d.ts +1 -0
- package/out/ui/packages/input/types/InputColor.lua +2 -0
- package/out/ui/packages/input/types/InputMargin.d.ts +1 -0
- package/out/ui/packages/input/types/InputMargin.lua +2 -0
- package/out/ui/packages/input/types/InputVariant.d.ts +1 -0
- package/out/ui/packages/input/types/InputVariant.lua +2 -0
- package/out/ui/packages/input/types/index.d.ts +3 -0
- package/out/ui/packages/input/types/init.lua +2 -0
- package/out/ui/packages/progressBar/components/ProgressBar.d.ts +9 -0
- package/out/ui/packages/progressBar/components/ProgressBar.lua +76 -0
- package/out/ui/packages/progressBar/components/ProgressBar.styles.d.ts +2 -0
- package/out/ui/packages/progressBar/components/ProgressBar.styles.lua +47 -0
- package/out/ui/packages/progressBar/index.d.ts +3 -0
- package/out/ui/packages/progressBar/init.lua +8 -0
- package/out/ui/packages/shadow/components/Shadow.d.ts +3 -0
- package/out/ui/packages/shadow/components/Shadow.lua +72 -0
- package/out/ui/packages/shadow/components/Shadow.styles.d.ts +2 -0
- package/out/ui/packages/shadow/components/Shadow.styles.lua +20 -0
- package/out/ui/packages/shadow/index.d.ts +2 -0
- package/out/ui/packages/shadow/init.lua +8 -0
- package/out/ui/packages/sidebar/components/Sidebar.d.ts +11 -0
- package/out/ui/packages/sidebar/components/Sidebar.lua +46 -0
- package/out/ui/packages/sidebar/components/Sidebar.styles.d.ts +3 -0
- package/out/ui/packages/sidebar/components/Sidebar.styles.lua +38 -0
- package/out/ui/packages/sidebar/index.d.ts +4 -0
- package/out/ui/packages/sidebar/init.lua +8 -0
- package/out/ui/packages/sidebar/types/SidebarType.d.ts +1 -0
- package/out/ui/packages/sidebar/types/SidebarType.lua +2 -0
- package/out/ui/packages/sidebar/types/index.d.ts +1 -0
- package/out/ui/packages/sidebar/types/init.lua +2 -0
- package/out/ui/packages/toast/components/Toast.d.ts +11 -0
- package/out/ui/packages/toast/components/Toast.lua +94 -0
- package/out/ui/packages/toast/components/Toast.styles.d.ts +3 -0
- package/out/ui/packages/toast/components/Toast.styles.lua +74 -0
- package/out/ui/packages/toast/enums/ToastVariants.d.ts +7 -0
- package/out/ui/packages/toast/enums/ToastVariants.lua +20 -0
- package/out/ui/packages/toast/index.d.ts +5 -0
- package/out/ui/packages/toast/init.lua +9 -0
- package/out/ui/packages/toast/interfaces/ToastEvent.d.ts +5 -0
- package/out/ui/packages/toast/interfaces/ToastEvent.lua +2 -0
- package/out/ui/packages/treeView/components/TreeView.d.ts +11 -0
- package/out/ui/packages/treeView/components/TreeView.lua +339 -0
- package/out/ui/packages/treeView/components/TreeView.styles.d.ts +2 -0
- package/out/ui/packages/treeView/components/TreeView.styles.lua +91 -0
- package/out/ui/packages/treeView/index.d.ts +6 -0
- package/out/ui/packages/treeView/init.lua +8 -0
- package/out/ui/packages/treeView/interfaces/Branch.d.ts +6 -0
- package/out/ui/packages/treeView/interfaces/Branch.lua +2 -0
- package/out/ui/packages/treeView/interfaces/Leaf.d.ts +4 -0
- package/out/ui/packages/treeView/interfaces/Leaf.lua +2 -0
- package/out/ui/packages/treeView/interfaces/Tree.d.ts +5 -0
- package/out/ui/packages/treeView/interfaces/Tree.lua +2 -0
- package/out/ui/packages/typography/components/Typography.d.ts +21 -0
- package/out/ui/packages/typography/components/Typography.lua +47 -0
- package/out/ui/packages/typography/components/Typography.styles.d.ts +3 -0
- package/out/ui/packages/typography/components/Typography.styles.lua +97 -0
- package/out/ui/packages/typography/index.d.ts +6 -0
- package/out/ui/packages/typography/init.lua +8 -0
- package/out/ui/packages/typography/types/TypographyAlignment.d.ts +1 -0
- package/out/ui/packages/typography/types/TypographyAlignment.lua +2 -0
- package/out/ui/packages/typography/types/TypographyColor.d.ts +1 -0
- package/out/ui/packages/typography/types/TypographyColor.lua +2 -0
- package/out/ui/packages/typography/types/TypographyDisplay.d.ts +1 -0
- package/out/ui/packages/typography/types/TypographyDisplay.lua +2 -0
- package/out/ui/packages/typography/types/index.d.ts +3 -0
- package/out/ui/packages/typography/types/init.lua +2 -0
- package/package.json +68 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.2.0
|
|
2
|
+
local TS = _G[script]
|
|
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)
|
|
5
|
+
local _roact_hooked = TS.import(script, TS.getModule(script, "@rbxts", "roact-hooked").src)
|
|
6
|
+
local withHooks = _roact_hooked.withHooks
|
|
7
|
+
local useEffect = _roact_hooked.useEffect
|
|
8
|
+
local useRef = _roact_hooked.useRef
|
|
9
|
+
local DefaultTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").DefaultTheme
|
|
10
|
+
local Directions = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Directions
|
|
11
|
+
local Shadow = TS.import(script, script.Parent.Parent.Parent, "shadow").Shadow
|
|
12
|
+
local useToastStyles = TS.import(script, script.Parent, "Toast.styles").default
|
|
13
|
+
local TWEEN_DURATION = 0.5
|
|
14
|
+
local Toast = withHooks(function(props)
|
|
15
|
+
local _binding = props
|
|
16
|
+
local text = _binding.text
|
|
17
|
+
local onDismiss = _binding.onDismiss
|
|
18
|
+
local duration = _binding.duration
|
|
19
|
+
if duration == nil then
|
|
20
|
+
duration = 4
|
|
21
|
+
end
|
|
22
|
+
local _binding_1 = useToastStyles(props)
|
|
23
|
+
local container = _binding_1.container
|
|
24
|
+
local label = _binding_1.label
|
|
25
|
+
local close = _binding_1.close
|
|
26
|
+
local activePosition = _binding_1.activePosition
|
|
27
|
+
local inActivePosition = _binding_1.inActivePosition
|
|
28
|
+
local frameRef = useRef()
|
|
29
|
+
local tween = function(direction)
|
|
30
|
+
local frame = frameRef:getValue()
|
|
31
|
+
if not frame then
|
|
32
|
+
return nil
|
|
33
|
+
end
|
|
34
|
+
local tween = BoatTween:Create(frame, {
|
|
35
|
+
Time = TWEEN_DURATION,
|
|
36
|
+
DelayTime = 0,
|
|
37
|
+
EasingStyle = "Linear",
|
|
38
|
+
EasingDirection = "InOut",
|
|
39
|
+
RepeatCount = 0,
|
|
40
|
+
Reverses = false,
|
|
41
|
+
StepType = "Stepped",
|
|
42
|
+
Goal = {
|
|
43
|
+
Position = if direction == Directions.In then activePosition.Position else inActivePosition.Position,
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
tween:Play()
|
|
47
|
+
wait(TWEEN_DURATION)
|
|
48
|
+
end
|
|
49
|
+
useEffect(function()
|
|
50
|
+
tween(Directions.In)
|
|
51
|
+
wait(duration)
|
|
52
|
+
tween(Directions.Out)
|
|
53
|
+
if onDismiss then
|
|
54
|
+
onDismiss()
|
|
55
|
+
end
|
|
56
|
+
end, {})
|
|
57
|
+
local _attributes = {
|
|
58
|
+
[Roact.Ref] = frameRef,
|
|
59
|
+
}
|
|
60
|
+
for _k, _v in container do
|
|
61
|
+
_attributes[_k] = _v
|
|
62
|
+
end
|
|
63
|
+
local _children = {
|
|
64
|
+
Corner = Roact.createElement("UICorner", {
|
|
65
|
+
CornerRadius = UDim.new(0, DefaultTheme.shape.borderRadius),
|
|
66
|
+
}),
|
|
67
|
+
Roact.createElement(Shadow),
|
|
68
|
+
}
|
|
69
|
+
local _length = #_children
|
|
70
|
+
local _attributes_1 = {}
|
|
71
|
+
for _k, _v in label do
|
|
72
|
+
_attributes_1[_k] = _v
|
|
73
|
+
end
|
|
74
|
+
_attributes_1.Text = text
|
|
75
|
+
_children.Label = Roact.createElement("TextLabel", _attributes_1)
|
|
76
|
+
local _attributes_2 = {}
|
|
77
|
+
for _k, _v in close do
|
|
78
|
+
_attributes_2[_k] = _v
|
|
79
|
+
end
|
|
80
|
+
_attributes_2[Roact.Event.MouseButton1Click] = function()
|
|
81
|
+
tween(Directions.Out)
|
|
82
|
+
if onDismiss then
|
|
83
|
+
onDismiss()
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
_children.Close = Roact.createElement("ImageButton", _attributes_2)
|
|
87
|
+
return Roact.createFragment({
|
|
88
|
+
Toast = Roact.createElement("Frame", _attributes, _children),
|
|
89
|
+
})
|
|
90
|
+
end)
|
|
91
|
+
local default = Toast
|
|
92
|
+
return {
|
|
93
|
+
default = default,
|
|
94
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.2.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
|
+
local createStyles = _theme.createStyles
|
|
5
|
+
local makeStyles = _theme.makeStyles
|
|
6
|
+
local DefaultTheme = _theme.DefaultTheme
|
|
7
|
+
local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
|
|
8
|
+
local ToastVariants = TS.import(script, script.Parent.Parent, "enums", "ToastVariants").default
|
|
9
|
+
local useToastStyles = makeStyles(function(theme, _param)
|
|
10
|
+
local variant = _param.variant
|
|
11
|
+
if variant == nil then
|
|
12
|
+
variant = ToastVariants.default
|
|
13
|
+
end
|
|
14
|
+
local getToastColor = function()
|
|
15
|
+
repeat
|
|
16
|
+
if variant == (ToastVariants.success) then
|
|
17
|
+
return DefaultTheme.palette.success.main
|
|
18
|
+
end
|
|
19
|
+
if variant == (ToastVariants.error) then
|
|
20
|
+
return DefaultTheme.palette.error.main
|
|
21
|
+
end
|
|
22
|
+
if variant == (ToastVariants.warning) then
|
|
23
|
+
return DefaultTheme.palette.warning.main
|
|
24
|
+
end
|
|
25
|
+
return DefaultTheme.options.constants.colors.backgroundUIContrast
|
|
26
|
+
until true
|
|
27
|
+
end
|
|
28
|
+
local ACTIVE_POSITION = UDim2.new(0.5, 0, 1, -DefaultTheme.padding.calc(2))
|
|
29
|
+
local INACTIVE_POSITION = UDim2.new(0.5, 0, 1, DefaultTheme.spacing.calc(20) + DefaultTheme.padding.calc(2))
|
|
30
|
+
return createStyles({
|
|
31
|
+
container = {
|
|
32
|
+
Size = UDim2.new(0, theme.spacing.calc(20), 0, theme.spacing.calc(4)),
|
|
33
|
+
Position = INACTIVE_POSITION,
|
|
34
|
+
BackgroundColor3 = getToastColor(),
|
|
35
|
+
AnchorPoint = Vector2.new(0.5, 1),
|
|
36
|
+
BorderSizePixel = 0,
|
|
37
|
+
ZIndex = 50000,
|
|
38
|
+
},
|
|
39
|
+
label = {
|
|
40
|
+
Size = UDim2.new(1, -theme.padding.calc(4), 1, -theme.padding.calc(4)),
|
|
41
|
+
Position = UDim2.new(0.5, 0, 0.5, 0),
|
|
42
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
43
|
+
BackgroundTransparency = 1,
|
|
44
|
+
BorderSizePixel = 0,
|
|
45
|
+
TextSize = theme.typography.fontSizes.body,
|
|
46
|
+
TextColor3 = theme.options.constants.extendedPalette.Common.White,
|
|
47
|
+
Font = theme.typography.fontFamilies.default,
|
|
48
|
+
TextScaled = false,
|
|
49
|
+
ZIndex = 50001,
|
|
50
|
+
},
|
|
51
|
+
close = {
|
|
52
|
+
Size = UDim2.new(0, theme.spacing.calc(1), 0, theme.spacing.calc(1)),
|
|
53
|
+
Position = UDim2.new(1, -theme.padding.calc(2), 0, theme.padding.calc(2)),
|
|
54
|
+
AnchorPoint = Vector2.new(1, 0),
|
|
55
|
+
ImageColor3 = theme.options.constants.colors.iconDefault,
|
|
56
|
+
Image = Icons.Close,
|
|
57
|
+
BackgroundTransparency = 1,
|
|
58
|
+
AutoButtonColor = false,
|
|
59
|
+
BorderSizePixel = 0,
|
|
60
|
+
Active = true,
|
|
61
|
+
ZIndex = 50001,
|
|
62
|
+
},
|
|
63
|
+
activePosition = {
|
|
64
|
+
Position = ACTIVE_POSITION,
|
|
65
|
+
},
|
|
66
|
+
inActivePosition = {
|
|
67
|
+
Position = INACTIVE_POSITION,
|
|
68
|
+
},
|
|
69
|
+
})
|
|
70
|
+
end)
|
|
71
|
+
local default = useToastStyles
|
|
72
|
+
return {
|
|
73
|
+
default = default,
|
|
74
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.2.0
|
|
2
|
+
local ToastVariants
|
|
3
|
+
do
|
|
4
|
+
local _inverse = {}
|
|
5
|
+
ToastVariants = setmetatable({}, {
|
|
6
|
+
__index = _inverse,
|
|
7
|
+
})
|
|
8
|
+
ToastVariants.default = "default"
|
|
9
|
+
_inverse.default = "default"
|
|
10
|
+
ToastVariants.success = "success"
|
|
11
|
+
_inverse.success = "success"
|
|
12
|
+
ToastVariants.error = "error"
|
|
13
|
+
_inverse.error = "error"
|
|
14
|
+
ToastVariants.warning = "warning"
|
|
15
|
+
_inverse.warning = "warning"
|
|
16
|
+
end
|
|
17
|
+
local default = ToastVariants
|
|
18
|
+
return {
|
|
19
|
+
default = default,
|
|
20
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Toast } from "./components/Toast";
|
|
2
|
+
export { ToastProps } from "./components/Toast";
|
|
3
|
+
export * from "./components/Toast";
|
|
4
|
+
export { default as ToastVariants } from "./enums/ToastVariants";
|
|
5
|
+
export { default as ToastEvent } from "./interfaces/ToastEvent";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.2.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
exports.Toast = TS.import(script, script, "components", "Toast").default
|
|
5
|
+
for _k, _v in TS.import(script, script, "components", "Toast") or {} do
|
|
6
|
+
exports[_k] = _v
|
|
7
|
+
end
|
|
8
|
+
exports.ToastVariants = TS.import(script, script, "enums", "ToastVariants").default
|
|
9
|
+
return exports
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Roact from "@rbxts/roact";
|
|
2
|
+
import { CustomizedProps } from "../../../../theme";
|
|
3
|
+
import { Icons } from "../../../enums";
|
|
4
|
+
import Tree from "../interfaces/Tree";
|
|
5
|
+
export interface TreeViewProps {
|
|
6
|
+
tree: Tree;
|
|
7
|
+
icon?: Icons;
|
|
8
|
+
filter?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const TreeView: (props: CustomizedProps<Frame, TreeViewProps>) => Roact.Element;
|
|
11
|
+
export default TreeView;
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.2.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src)
|
|
4
|
+
local _roact_hooked = TS.import(script, TS.getModule(script, "@rbxts", "roact-hooked").src)
|
|
5
|
+
local withHooks = _roact_hooked.withHooks
|
|
6
|
+
local useCallback = _roact_hooked.useCallback
|
|
7
|
+
local useEffect = _roact_hooked.useEffect
|
|
8
|
+
local useState = _roact_hooked.useState
|
|
9
|
+
local DefaultTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").DefaultTheme
|
|
10
|
+
local Icon = TS.import(script, script.Parent.Parent.Parent, "icon").Icon
|
|
11
|
+
local Typography = TS.import(script, script.Parent.Parent.Parent, "typography").Typography
|
|
12
|
+
local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
|
|
13
|
+
local useTreeViewStyles = TS.import(script, script.Parent, "TreeView.styles").default
|
|
14
|
+
local TreeView = withHooks(function(props)
|
|
15
|
+
local _binding = props
|
|
16
|
+
local tree = _binding.tree
|
|
17
|
+
local icon = _binding.icon
|
|
18
|
+
local filter = _binding.filter
|
|
19
|
+
local className = _binding.className
|
|
20
|
+
local _binding_1 = useTreeViewStyles()
|
|
21
|
+
local root = _binding_1.root
|
|
22
|
+
local header = _binding_1.header
|
|
23
|
+
local list = _binding_1.list
|
|
24
|
+
local gridLayout = _binding_1.gridLayout
|
|
25
|
+
local row = _binding_1.row
|
|
26
|
+
local branchIcon = _binding_1.branchIcon
|
|
27
|
+
local branchTypography = _binding_1.branchTypography
|
|
28
|
+
local leafIcon = _binding_1.leafIcon
|
|
29
|
+
local leafTypography = _binding_1.leafTypography
|
|
30
|
+
local selectedBranch, setSelectedBranch = useState()
|
|
31
|
+
local selectedLeaf, setSelectedLeaf = useState()
|
|
32
|
+
local expanded, setExpanded = useState({})
|
|
33
|
+
local canvasSize, setCanvasSize = useState(UDim2.new(0, 0, 0, 0))
|
|
34
|
+
local resizeScrollingFrame = function(rbx, child)
|
|
35
|
+
if child and not child:IsA("GuiObject") then
|
|
36
|
+
return nil
|
|
37
|
+
end
|
|
38
|
+
local height = 0
|
|
39
|
+
local _exp = rbx:GetChildren()
|
|
40
|
+
local _arg0 = function(c)
|
|
41
|
+
if c:IsA("GuiObject") then
|
|
42
|
+
height += c.AbsoluteSize.Y
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
for _k, _v in _exp do
|
|
46
|
+
_arg0(_v, _k - 1, _exp)
|
|
47
|
+
end
|
|
48
|
+
TS.try(function()
|
|
49
|
+
setCanvasSize(UDim2.new(0, 0, 0, height))
|
|
50
|
+
end, function()
|
|
51
|
+
-- Component is unmounting. Do nothing.
|
|
52
|
+
end)
|
|
53
|
+
end
|
|
54
|
+
local matchesFilter = useCallback(function(title)
|
|
55
|
+
local isMatch = false
|
|
56
|
+
local _condition = filter == nil
|
|
57
|
+
if not _condition then
|
|
58
|
+
local _result = filter
|
|
59
|
+
if _result ~= nil then
|
|
60
|
+
_result = #_result
|
|
61
|
+
end
|
|
62
|
+
_condition = _result == 0
|
|
63
|
+
end
|
|
64
|
+
if _condition then
|
|
65
|
+
return true
|
|
66
|
+
end
|
|
67
|
+
local parts = string.split(title, "/")
|
|
68
|
+
local _arg0 = function(part)
|
|
69
|
+
if #part >= #filter and string.sub(string.upper(part), 1, #filter) == string.upper(filter) then
|
|
70
|
+
isMatch = true
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
for _k, _v in parts do
|
|
74
|
+
_arg0(_v, _k - 1, parts)
|
|
75
|
+
end
|
|
76
|
+
return isMatch
|
|
77
|
+
end, { filter })
|
|
78
|
+
-- Automatically expand branches that match filter
|
|
79
|
+
useEffect(function()
|
|
80
|
+
local _condition = filter == nil
|
|
81
|
+
if not _condition then
|
|
82
|
+
local _result = filter
|
|
83
|
+
if _result ~= nil then
|
|
84
|
+
_result = #_result
|
|
85
|
+
end
|
|
86
|
+
_condition = _result == 0
|
|
87
|
+
end
|
|
88
|
+
if _condition then
|
|
89
|
+
setExpanded({})
|
|
90
|
+
return nil
|
|
91
|
+
end
|
|
92
|
+
local newExpanded = {}
|
|
93
|
+
-- Figure out which branches should be expanded
|
|
94
|
+
local _branches = tree.branches
|
|
95
|
+
local _arg0 = function(branch)
|
|
96
|
+
local matchesBranchFilter = matchesFilter(branch.title)
|
|
97
|
+
if matchesBranchFilter then
|
|
98
|
+
-- If branch is a match, whole branch should be expanded
|
|
99
|
+
local _branch = branch
|
|
100
|
+
if not (table.find(newExpanded, _branch) ~= nil) then
|
|
101
|
+
local _branch_1 = branch
|
|
102
|
+
table.insert(newExpanded, _branch_1)
|
|
103
|
+
end
|
|
104
|
+
else
|
|
105
|
+
-- If any of the leaves are a match, branch should be expanded
|
|
106
|
+
local _leaves = branch.leaves
|
|
107
|
+
local _arg0_1 = function(leaf)
|
|
108
|
+
local _branch = branch
|
|
109
|
+
if table.find(newExpanded, _branch) ~= nil then
|
|
110
|
+
return nil
|
|
111
|
+
end
|
|
112
|
+
local matchesLeafFilter = matchesFilter(leaf.title)
|
|
113
|
+
if matchesLeafFilter then
|
|
114
|
+
local _branch_1 = branch
|
|
115
|
+
table.insert(newExpanded, _branch_1)
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
for _k, _v in _leaves do
|
|
119
|
+
_arg0_1(_v, _k - 1, _leaves)
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
for _k, _v in _branches do
|
|
124
|
+
_arg0(_v, _k - 1, _branches)
|
|
125
|
+
end
|
|
126
|
+
-- Set expanded to new array
|
|
127
|
+
setExpanded(newExpanded)
|
|
128
|
+
end, { tree, filter })
|
|
129
|
+
local _attributes = {}
|
|
130
|
+
for _k, _v in root do
|
|
131
|
+
_attributes[_k] = _v
|
|
132
|
+
end
|
|
133
|
+
if className then
|
|
134
|
+
for _k, _v in className do
|
|
135
|
+
_attributes[_k] = _v
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
local _children = {}
|
|
139
|
+
local _length = #_children
|
|
140
|
+
local _attributes_1 = {}
|
|
141
|
+
local _object = {
|
|
142
|
+
Text = tree.title,
|
|
143
|
+
}
|
|
144
|
+
for _k, _v in header do
|
|
145
|
+
_object[_k] = _v
|
|
146
|
+
end
|
|
147
|
+
_attributes_1.className = _object
|
|
148
|
+
_attributes_1.color = "textSecondary"
|
|
149
|
+
_attributes_1.variant = "body"
|
|
150
|
+
_attributes_1.family = "bold"
|
|
151
|
+
_children[_length + 1] = Roact.createElement(Typography, _attributes_1)
|
|
152
|
+
local _attributes_2 = {}
|
|
153
|
+
for _k, _v in list do
|
|
154
|
+
_attributes_2[_k] = _v
|
|
155
|
+
end
|
|
156
|
+
_attributes_2.CanvasSize = canvasSize
|
|
157
|
+
_attributes_2[Roact.Event.AncestryChanged] = resizeScrollingFrame
|
|
158
|
+
_attributes_2[Roact.Event.ChildAdded] = resizeScrollingFrame
|
|
159
|
+
_attributes_2[Roact.Event.ChildRemoved] = resizeScrollingFrame
|
|
160
|
+
local _children_1 = {}
|
|
161
|
+
local _length_1 = #_children_1
|
|
162
|
+
local _attributes_3 = {}
|
|
163
|
+
for _k, _v in gridLayout do
|
|
164
|
+
_attributes_3[_k] = _v
|
|
165
|
+
end
|
|
166
|
+
_children_1[_length_1 + 1] = Roact.createElement("UIGridLayout", _attributes_3)
|
|
167
|
+
local _branches = tree.branches
|
|
168
|
+
local _arg0 = function(branch, branchIndex)
|
|
169
|
+
local matchesBranchFilter = matchesFilter(branch.title)
|
|
170
|
+
local hasMatchingLeaf = matchesBranchFilter
|
|
171
|
+
if not hasMatchingLeaf then
|
|
172
|
+
for _, leaf in branch.leaves do
|
|
173
|
+
if matchesFilter(leaf.title) then
|
|
174
|
+
hasMatchingLeaf = true
|
|
175
|
+
break
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
if matchesBranchFilter or hasMatchingLeaf then
|
|
180
|
+
local _children_2 = {}
|
|
181
|
+
local _length_2 = #_children_2
|
|
182
|
+
local _attributes_4 = {}
|
|
183
|
+
for _k, _v in row do
|
|
184
|
+
_attributes_4[_k] = _v
|
|
185
|
+
end
|
|
186
|
+
_attributes_4[Roact.Event.MouseButton1Click] = function()
|
|
187
|
+
if branch.onClick then
|
|
188
|
+
branch.onClick()
|
|
189
|
+
end
|
|
190
|
+
-- If there are leaves... Expand/Collapse
|
|
191
|
+
if #branch.leaves > 0 then
|
|
192
|
+
local _branch = branch
|
|
193
|
+
local isExpanded = table.find(expanded, _branch) ~= nil
|
|
194
|
+
if isExpanded then
|
|
195
|
+
setExpanded(function(oldExpanded)
|
|
196
|
+
local _oldExpanded = oldExpanded
|
|
197
|
+
local _arg0_1 = function(b)
|
|
198
|
+
return b ~= branch
|
|
199
|
+
end
|
|
200
|
+
-- ▼ ReadonlyArray.filter ▼
|
|
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
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
-- ▲ ReadonlyArray.filter ▲
|
|
210
|
+
return _newValue
|
|
211
|
+
end)
|
|
212
|
+
else
|
|
213
|
+
setExpanded(function(oldExpanded)
|
|
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)
|
|
222
|
+
end
|
|
223
|
+
else
|
|
224
|
+
setSelectedBranch(branch)
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
local _condition = #branch.leaves > 0
|
|
228
|
+
if _condition then
|
|
229
|
+
local _attributes_5 = {}
|
|
230
|
+
local _branch = branch
|
|
231
|
+
_attributes_5.icon = if table.find(expanded, _branch) ~= nil then Icons.Expanded else Icons.Collapsed
|
|
232
|
+
_attributes_5.size = "xxs"
|
|
233
|
+
_attributes_5.className = branchIcon
|
|
234
|
+
_attributes_5.tint = DefaultTheme.options.constants.extendedPalette.Gray[70]
|
|
235
|
+
_condition = (Roact.createElement(Icon, _attributes_5))
|
|
236
|
+
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
|
+
local _attributes_5 = {
|
|
244
|
+
text = branch.title,
|
|
245
|
+
}
|
|
246
|
+
local _object_1 = {}
|
|
247
|
+
for _k, _v in branchTypography do
|
|
248
|
+
_object_1[_k] = _v
|
|
249
|
+
end
|
|
250
|
+
_attributes_5.className = _object_1
|
|
251
|
+
_attributes_5.color = "textPrimary"
|
|
252
|
+
_attributes_5.variant = "body"
|
|
253
|
+
_attributes_5.family = if selectedBranch == branch then "bold" else "default"
|
|
254
|
+
_children_3[_length_3 + 1] = Roact.createElement(Typography, _attributes_5)
|
|
255
|
+
_children_2[branch.title .. ("-" .. tostring(branchIndex))] = Roact.createFragment({
|
|
256
|
+
[branch.title .. ("-" .. tostring(branchIndex))] = Roact.createElement("TextButton", _attributes_4, _children_3),
|
|
257
|
+
})
|
|
258
|
+
local _branch = branch
|
|
259
|
+
local _condition_1 = table.find(expanded, _branch) ~= nil
|
|
260
|
+
if _condition_1 then
|
|
261
|
+
local _leaves = branch.leaves
|
|
262
|
+
local _arg0_1 = function(leaf, leafIndex)
|
|
263
|
+
local matchesLeafFilter = matchesFilter(leaf.title)
|
|
264
|
+
if matchesBranchFilter or matchesLeafFilter then
|
|
265
|
+
local _attributes_6 = {}
|
|
266
|
+
for _k, _v in row do
|
|
267
|
+
_attributes_6[_k] = _v
|
|
268
|
+
end
|
|
269
|
+
_attributes_6[Roact.Event.MouseButton1Click] = function()
|
|
270
|
+
setSelectedLeaf(leaf)
|
|
271
|
+
setSelectedBranch(branch)
|
|
272
|
+
if leaf.onClick then
|
|
273
|
+
leaf.onClick()
|
|
274
|
+
end
|
|
275
|
+
end
|
|
276
|
+
local _children_4 = {
|
|
277
|
+
Roact.createElement(Icon, {
|
|
278
|
+
icon = icon or Icons.ListPrimary,
|
|
279
|
+
size = "xs",
|
|
280
|
+
className = leafIcon,
|
|
281
|
+
tint = DefaultTheme.palette.secondary.main,
|
|
282
|
+
}),
|
|
283
|
+
}
|
|
284
|
+
local _length_4 = #_children_4
|
|
285
|
+
local _attributes_7 = {
|
|
286
|
+
text = leaf.title,
|
|
287
|
+
}
|
|
288
|
+
local _object_2 = {}
|
|
289
|
+
for _k, _v in leafTypography do
|
|
290
|
+
_object_2[_k] = _v
|
|
291
|
+
end
|
|
292
|
+
_attributes_7.className = _object_2
|
|
293
|
+
_attributes_7.color = "textPrimary"
|
|
294
|
+
_attributes_7.variant = "body"
|
|
295
|
+
_attributes_7.family = if selectedLeaf == leaf then "bold" else "default"
|
|
296
|
+
_children_4[_length_4 + 1] = Roact.createElement(Typography, _attributes_7)
|
|
297
|
+
return Roact.createFragment({
|
|
298
|
+
[branch.title .. ("-" .. (tostring(branchIndex) .. ("-" .. (leaf.title .. ("-" .. tostring(leafIndex))))))] = Roact.createElement("TextButton", _attributes_6, _children_4),
|
|
299
|
+
})
|
|
300
|
+
else
|
|
301
|
+
return Roact.createFragment()
|
|
302
|
+
end
|
|
303
|
+
end
|
|
304
|
+
-- ▼ ReadonlyArray.map ▼
|
|
305
|
+
local _newValue = table.create(#_leaves)
|
|
306
|
+
for _k, _v in _leaves do
|
|
307
|
+
_newValue[_k] = _arg0_1(_v, _k - 1, _leaves)
|
|
308
|
+
end
|
|
309
|
+
-- ▲ ReadonlyArray.map ▲
|
|
310
|
+
_condition_1 = _newValue
|
|
311
|
+
end
|
|
312
|
+
if _condition_1 then
|
|
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)
|
|
318
|
+
else
|
|
319
|
+
return Roact.createFragment()
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
-- ▼ ReadonlyArray.map ▼
|
|
323
|
+
local _newValue = table.create(#_branches)
|
|
324
|
+
for _k, _v in _branches do
|
|
325
|
+
_newValue[_k] = _arg0(_v, _k - 1, _branches)
|
|
326
|
+
end
|
|
327
|
+
-- ▲ ReadonlyArray.map ▲
|
|
328
|
+
for _k, _v in _newValue do
|
|
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
|
+
})
|
|
335
|
+
end)
|
|
336
|
+
local default = TreeView
|
|
337
|
+
return {
|
|
338
|
+
default = default,
|
|
339
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.2.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
|
+
local createStyles = _theme.createStyles
|
|
5
|
+
local makeStyles = _theme.makeStyles
|
|
6
|
+
local useTreeViewStyles = makeStyles(function(theme)
|
|
7
|
+
return createStyles({
|
|
8
|
+
root = {
|
|
9
|
+
Size = UDim2.new(1, -theme.padding.calc(4), 1, -theme.padding.calc(4)),
|
|
10
|
+
Position = UDim2.new(0.5, 0, 0.5, 0),
|
|
11
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
12
|
+
BackgroundTransparency = 1,
|
|
13
|
+
ClipsDescendants = true,
|
|
14
|
+
ZIndex = 300,
|
|
15
|
+
},
|
|
16
|
+
header = {
|
|
17
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(1)),
|
|
18
|
+
Position = UDim2.new(0.5, 0, 0, 0),
|
|
19
|
+
AnchorPoint = Vector2.new(0.5, 0),
|
|
20
|
+
TextXAlignment = Enum.TextXAlignment.Left,
|
|
21
|
+
TextYAlignment = Enum.TextYAlignment.Center,
|
|
22
|
+
BackgroundTransparency = 1,
|
|
23
|
+
BorderSizePixel = 0,
|
|
24
|
+
ZIndex = 5300,
|
|
25
|
+
},
|
|
26
|
+
list = {
|
|
27
|
+
Size = UDim2.new(1, 0, 1, -(theme.spacing.calc(1) + theme.padding.calc(2))),
|
|
28
|
+
Position = UDim2.new(0.5, 0, 0, theme.spacing.calc(1) + theme.padding.calc(2)),
|
|
29
|
+
AnchorPoint = Vector2.new(0.5, 0),
|
|
30
|
+
BackgroundTransparency = 1,
|
|
31
|
+
AutomaticCanvasSize = Enum.AutomaticSize.XY,
|
|
32
|
+
ScrollBarThickness = theme.spacing.calc(0.5),
|
|
33
|
+
ScrollBarImageTransparency = 0.75,
|
|
34
|
+
ClipsDescendants = true,
|
|
35
|
+
ZIndex = 300,
|
|
36
|
+
},
|
|
37
|
+
gridLayout = {
|
|
38
|
+
CellPadding = UDim2.new(0, 0, 0, 0),
|
|
39
|
+
CellSize = UDim2.new(1, 0, 0, theme.spacing.calc(1) + theme.padding.calc(4)),
|
|
40
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
41
|
+
FillDirectionMaxCells = 1,
|
|
42
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Center,
|
|
43
|
+
VerticalAlignment = Enum.VerticalAlignment.Top,
|
|
44
|
+
SortOrder = Enum.SortOrder.Name,
|
|
45
|
+
},
|
|
46
|
+
row = {
|
|
47
|
+
Text = "",
|
|
48
|
+
BackgroundTransparency = 1,
|
|
49
|
+
BorderSizePixel = 0,
|
|
50
|
+
ZIndex = 5200,
|
|
51
|
+
},
|
|
52
|
+
branchIcon = {
|
|
53
|
+
Position = UDim2.new(0, 0, 0.5, 0),
|
|
54
|
+
AnchorPoint = Vector2.new(0, 0.5),
|
|
55
|
+
BackgroundTransparency = 1,
|
|
56
|
+
BorderSizePixel = 0,
|
|
57
|
+
ZIndex = 5300,
|
|
58
|
+
},
|
|
59
|
+
branchTypography = {
|
|
60
|
+
Size = UDim2.new(1, -(theme.spacing.calc(0.5) + theme.padding.calc(2)), 1, -theme.padding.calc(4)),
|
|
61
|
+
Position = UDim2.new(1, 0, 0.5, 0),
|
|
62
|
+
AnchorPoint = Vector2.new(1, 0.5),
|
|
63
|
+
TextXAlignment = Enum.TextXAlignment.Left,
|
|
64
|
+
TextYAlignment = Enum.TextYAlignment.Center,
|
|
65
|
+
BackgroundTransparency = 1,
|
|
66
|
+
BorderSizePixel = 0,
|
|
67
|
+
ZIndex = 5300,
|
|
68
|
+
},
|
|
69
|
+
leafIcon = {
|
|
70
|
+
Position = UDim2.new(0, theme.padding.calc(4), 0.5, 0),
|
|
71
|
+
AnchorPoint = Vector2.new(0, 0.5),
|
|
72
|
+
BackgroundTransparency = 1,
|
|
73
|
+
BorderSizePixel = 0,
|
|
74
|
+
ZIndex = 5300,
|
|
75
|
+
},
|
|
76
|
+
leafTypography = {
|
|
77
|
+
Size = UDim2.new(1, -(theme.spacing.calc(1) + theme.padding.calc(6)), 1, -theme.padding.calc(4)),
|
|
78
|
+
Position = UDim2.new(1, 0, 0.5, 0),
|
|
79
|
+
AnchorPoint = Vector2.new(1, 0.5),
|
|
80
|
+
TextXAlignment = Enum.TextXAlignment.Left,
|
|
81
|
+
TextYAlignment = Enum.TextYAlignment.Center,
|
|
82
|
+
BackgroundTransparency = 1,
|
|
83
|
+
BorderSizePixel = 0,
|
|
84
|
+
ZIndex = 5300,
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
end)
|
|
88
|
+
local default = useTreeViewStyles
|
|
89
|
+
return {
|
|
90
|
+
default = default,
|
|
91
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as TreeView } from "./components/TreeView";
|
|
2
|
+
export { TreeViewProps } from "./components/TreeView";
|
|
3
|
+
export * from "./components/TreeView";
|
|
4
|
+
export { default as Branch } from "./interfaces/Branch";
|
|
5
|
+
export { default as Leaf } from "./interfaces/Leaf";
|
|
6
|
+
export { default as Tree } from "./interfaces/Tree";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.2.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
exports.TreeView = TS.import(script, script, "components", "TreeView").default
|
|
5
|
+
for _k, _v in TS.import(script, script, "components", "TreeView") or {} do
|
|
6
|
+
exports[_k] = _v
|
|
7
|
+
end
|
|
8
|
+
return exports
|