diff --git a/src/Components/Button.luau b/src/Components/Button.luau index 87fcab2..28de4e9 100644 --- a/src/Components/Button.luau +++ b/src/Components/Button.luau @@ -66,8 +66,8 @@ return function(Scope: Fusion.Scope, Props: Props) local ContentSize = Util.Fallback(Props.ContentSize, Theme.TextSize["1"]) local ContentWrapped = Util.Fallback(Props.ContentWrapped, false) - local IsHolding = Scope:Value(false) - local IsHovering = Scope:Value(false) + local IsHovering = Scope:EnsureValue(Util.Fallback(Props.IsHovering, false)) + local IsHolding = Scope:EnsureValue(Util.Fallback(Props.IsHolding, false)) local EffectiveColor = Scope:Computed(function(Use) if Use(Disabled) then return Use(Theme.Colors.BaseContent.Main) diff --git a/src/Components/Checkbox.luau b/src/Components/Checkbox.luau index 9a54b87..72f9459 100644 --- a/src/Components/Checkbox.luau +++ b/src/Components/Checkbox.luau @@ -48,8 +48,8 @@ return function(Scope: Fusion.Scope, Props: Props) local Color = Util.Fallback(Props.Color, Theme.Colors.Primary.Main) local IconId = Util.Fallback(Props.Icon, "rbxassetid://13858821963") - local IsHovering = Scope:Value(false) - local IsHolding = Scope:Value(false) + local IsHovering = Scope:EnsureValue(Util.Fallback(Props.IsHovering, false)) + local IsHolding = Scope:EnsureValue(Util.Fallback(Props.IsHolding, false)) local EffectiveColor = Scope:Computed(function(Use) if Use(Disabled) then return Use(Theme.Colors.BaseContent.Main) diff --git a/src/Components/Dropdown.luau b/src/Components/Dropdown.luau index 45d813c..a97ed59 100644 --- a/src/Components/Dropdown.luau +++ b/src/Components/Dropdown.luau @@ -4,7 +4,6 @@ local Util = require(OnyxUI.Util) local Themer = require(OnyxUI.Themer) local OnEvent = Fusion.OnEvent -local Peek = Fusion.peek local Children = Fusion.Children local Base = require(OnyxUI.Components.Base) @@ -13,13 +12,15 @@ local Components = { Frame = require(OnyxUI.Components.Frame), } -export type Props = Base.Props & {} +export type Props = Base.Props & { + Open: Fusion.UsedAs?, +} return function(Scope: Fusion.Scope, Props: Props) local Scope = Fusion.innerScope(Scope, Fusion, Components, Util) local Theme = Themer.Theme:now() - local Open = Scope:Value(false) + local Open = Scope:EnsureValue(Util.Fallback(Props.Open, false)) return Scope:Hydrate(Scope:TextInput(Util.CombineProps(Props, { Name = script.Name, diff --git a/src/Components/MenuFrame.luau b/src/Components/MenuFrame.luau index 7176480..cf13ce6 100644 --- a/src/Components/MenuFrame.luau +++ b/src/Components/MenuFrame.luau @@ -30,7 +30,7 @@ return function(Scope: Fusion.Scope, Props: Props) local Scope = InnerScope(Scope, Fusion, Util, Components) local Theme = Themer.Theme:now() - local AutomaticSize = Scope:Value(Enum.AutomaticSize.None) + local AutomaticSize = Scope:EnsureValue(Util.Fallback(Props.AutomaticSize, Enum.AutomaticSize.None)) return Scope:Group(Util.CombineProps(Props, { Name = "MenuFrame", diff --git a/src/Components/SwitchInput.luau b/src/Components/SwitchInput.luau index 66b638e..7b18a19 100644 --- a/src/Components/SwitchInput.luau +++ b/src/Components/SwitchInput.luau @@ -22,9 +22,8 @@ local Components = { BaseButton = BaseButton, } -export type Props = Frame.Props & { +export type Props = BaseButton.Props & { Switched: Fusion.UsedAs?, - Disabled: Fusion.UsedAs?, Color: Fusion.UsedAs?, } @@ -32,7 +31,7 @@ export type Props = Frame.Props & { @within SwitchInput @interface SwitchInputProps - @field ... FrameProps + @field ... BaseButtonProps @field Switched Fusion.UsedAs? @field Disabled Fusion.UsedAs? @field Color Fusion.UsedAs? @@ -42,7 +41,7 @@ return function(Scope: Fusion.Scope, Props: Props) local Theme = Themer.Theme:now() local Switched = Scope:EnsureValue(Util.Fallback(Props.Switched, false)) - local Disabled = Util.Fallback(Props.Disabled, false) + local Disabled = Scope:EnsureValue(Util.Fallback(Props.Disabled, false)) local Color = Util.Fallback(Props.Color, Theme.Colors.Primary.Main) local Size = Util.Fallback( Props.Size, @@ -52,8 +51,8 @@ return function(Scope: Fusion.Scope, Props: Props) ) local AutomaticSize = Util.Fallback(Props.AutomaticSize, Enum.AutomaticSize.None) - local IsHolding = Scope:Value(false) - local IsHovering = Scope:Value(false) + local IsHovering = Scope:EnsureValue(Util.Fallback(Props.IsHovering, false)) + local IsHolding = Scope:EnsureValue(Util.Fallback(Props.IsHolding, false)) local EffectiveColor = Scope:Computed(function(Use) local ActiveColor if Use(Switched) then