-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
176 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,6 @@ | ||
{ | ||
"name": "podkit", | ||
"tree": { | ||
"$className": "DataModel", | ||
|
||
"ReplicatedStorage": { | ||
"Packages": { | ||
"$path": "Packages", | ||
"PodKit": { | ||
"$path": "modules" | ||
} | ||
} | ||
}, | ||
|
||
"StarterPlayer": { | ||
"StarterPlayerScripts": { | ||
"PodKitTest": { | ||
"$path": "test" | ||
} | ||
} | ||
} | ||
"$path": "modules" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
local Packages = script.Parent.Parent.Parent | ||
local Fusion = require(Packages.Fusion) | ||
|
||
local New = Fusion.New | ||
local Children = Fusion.Children | ||
local Value = Fusion.Value | ||
local OnEvent = Fusion.OnEvent | ||
local Computed = Fusion.Computed | ||
local Spring = Fusion.Spring | ||
|
||
local Utils = require(script.Parent.Parent.Utils) | ||
|
||
local checkTheme = require(script.Parent.Parent.Core.themeManager).checkTheme | ||
|
||
local Basics = Utils.Basics | ||
local Constants = Utils.Constants | ||
|
||
local Types = script.Parent.Parent.Types | ||
|
||
function Icon(props: Types.IconProps): Child | ||
local anchorPoint = props.AnchorPoint | ||
|
||
local position = Basics.Positions[props.PrePosition] or { | ||
x = 0, | ||
y = 0, | ||
} | ||
local size = Basics.Icon.Sizes[props.PreSize] or UDim2.fromScale(0.2, 0.15) | ||
|
||
local paddingTop = props.PaddingTop or props.PaddingY or props.Padding or UDim.new(0.5, 0) | ||
local paddingBottom = props.PaddingBottom or props.PaddingY or props.Padding or UDim.new(0.5, 0) | ||
local paddingLeft = props.PaddingLeft or props.PaddingX or props.Padding or UDim.new(0.5, 0) | ||
local paddingRight = props.PaddingRight or props.PaddingX or props.Padding or UDim.new(0.5, 0) | ||
|
||
if props.PrePosition ~= nil and props.AnchorPoint == nil then | ||
anchorPoint = Vector2.new(position.x, position.y) | ||
end | ||
|
||
return New("ImageLabel")({ | ||
Name = props.Name or "Icon", | ||
Position = props.Position or UDim2.fromScale(position.x, position.y), | ||
Size = props.Size or size, | ||
AnchorPoint = anchorPoint, | ||
BackgroundTransparency = 1, | ||
Image = props.Icon or Constants.NO_ICON_URL, | ||
ImageColor3 = checkTheme(props.Color) or checkTheme(props.Colour) or Basics.Icon.IconColor, | ||
ImageTransparency = props.Transparency, | ||
[Children] = { | ||
New("UIPadding")({ | ||
PaddingTop = paddingTop, | ||
PaddingBottom = paddingBottom, | ||
PaddingLeft = paddingLeft, | ||
PaddingRight = paddingRight, | ||
}), | ||
props[Children], | ||
}, | ||
}) | ||
end | ||
|
||
return Icon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,66 @@ | ||
-- TODO: Toast component | ||
|
||
local Packages = script.Parent.Parent.Parent | ||
local Fusion = require(Packages.Fusion) | ||
|
||
local New = Fusion.New | ||
local Children = Fusion.Children | ||
local Spring = Fusion.Spring | ||
|
||
local Box = require(script.Parent.Box) | ||
local HStack = require(script.Parent.Stack).Stack | ||
local Text = require(script.Parent.Text) | ||
local Icon = require(script.Parent.Icon) | ||
local IconButton = require(script.Parent.IconButton) | ||
|
||
local Types = script.Parent.Parent.Types | ||
|
||
local Basics = require(script.Parent.Parent.Utils.Basics) | ||
local checkTheme = require(script.Parent.Parent.Core.themeManager).checkTheme | ||
|
||
function Toast(props: Types.ToastProps): Child | ||
return Box({ | ||
Name = props.Id or "Toast", | ||
Position = UDim2.fromScale(0.5, 0.95), | ||
AnchorPoint = Vector2.new(0.5, 1), | ||
-- Bg = Color3.fromHex("#90cdf4"), | ||
Bg = "Destino", | ||
Size = UDim2.fromScale(0.16, 0.05), | ||
[Children] = { | ||
New("UICorner")({ | ||
CornerRadius = UDim.new(0.2, 0), | ||
}), | ||
HStack({ | ||
PreSize = "full", | ||
BackgroundTransparency = 1, | ||
[Children] = { | ||
Icon({ | ||
Icon = "rbxassetid://12970546311", | ||
IconColor = Color3.fromHex("#000000"), | ||
Size = UDim2.fromScale(0.15, 0.8), | ||
}), | ||
Text({ | ||
Size = UDim2.fromScale(0.8, 0.8), | ||
Text = "Card Added to Dock", | ||
Font = Font.fromName("SourceSansBold"), | ||
TextColor = Color3.fromHex("#000000"), | ||
PrePosition = "center", | ||
}), | ||
}, | ||
}), | ||
IconButton({ | ||
Icon = "rbxassetid://12324498733", | ||
IconColor = Color3.fromHex("#000000"), | ||
Size = UDim2.fromScale(0.7, 0.5), | ||
Position = UDim2.fromScale(1.03, -0.13), | ||
AnchorPoint = Vector2.new(1, 0), | ||
Bg = Color3.fromRGB(255, 0, 0), | ||
PaddingLeft = UDim.new(0.8, 0), | ||
}), | ||
}, | ||
}) | ||
end | ||
|
||
function useToast() end | ||
|
||
return Toast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "podkit", | ||
"tree": { | ||
"$className": "DataModel", | ||
|
||
"ReplicatedStorage": { | ||
"Packages": { | ||
"$path": "Packages", | ||
"PodKit": { | ||
"$path": "modules" | ||
} | ||
} | ||
}, | ||
|
||
"StarterPlayer": { | ||
"StarterPlayerScripts": { | ||
"PodKitTest": { | ||
"$path": "test" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters