From ba821fd8e196d4611d52963e737382f39158dd7e Mon Sep 17 00:00:00 2001 From: Nightcycle Studios <77173389+nightcycle@users.noreply.github.com> Date: Mon, 8 Jul 2024 18:45:52 -0600 Subject: [PATCH] theme patch --- src/Component/Slider/ColdFusion.luau | 4 +- src/Component/Slider/Fusion.luau | 12 ++--- src/Component/Slider/README.md | 6 +-- src/Component/Slider/Wrapper.luau | 2 +- src/Component/Slider/_Theme.story.luau | 64 +++++++++++++------------- src/Component/Slider/definition.json | 2 +- 6 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/Component/Slider/ColdFusion.luau b/src/Component/Slider/ColdFusion.luau index 39e0dd5a..4f7eabba 100644 --- a/src/Component/Slider/ColdFusion.luau +++ b/src/Component/Slider/ColdFusion.luau @@ -120,7 +120,7 @@ function Interface.onTertiary( _import(elevation, DEFAULTS.ON_TERTIARY.INITIAL_VALUE), _import(elevation, DEFAULTS.ON_TERTIARY.MINIMUM), _import(elevation, DEFAULTS.ON_TERTIARY.MAXIMUM), - _import(elevation, DEFAULTS.ON_TERTIARY.INCREMENT or 0), + _import(elevation, DEFAULTS.ON_TERTIARY.INCREMENT), _import(leftTextOrIcon, DEFAULTS.ON_TERTIARY.LEFT_TEXT_OR_ICON), _import(rightTextOrIcon, DEFAULTS.ON_TERTIARY.RIGHT_TEXT_OR_ICON), _Computed(function(s: Style): Color3 @@ -383,7 +383,7 @@ function Interface.secondary( _Computed(function(s: Style): Color3 return s:GetColor(Enums.ColorRoleType.SecondaryContainer) end, styleState), - _import(elevation, DEFAULTS.SECONDARY.ELEVATION or 0), + _import(elevation, DEFAULTS.SECONDARY.ELEVATION), _Computed(function(s: Style): any return s.SchemeType end, styleState), diff --git a/src/Component/Slider/Fusion.luau b/src/Component/Slider/Fusion.luau index 0664a15c..0a1179ca 100644 --- a/src/Component/Slider/Fusion.luau +++ b/src/Component/Slider/Fusion.luau @@ -87,7 +87,7 @@ function Interface.primary( increment: FusionCanBeState, leftTextOrIcon: FusionCanBeState<((string | ImageData)?)>, rightTextOrIcon: FusionCanBeState<((string | ImageData)?)>, - elevation: FusionCanBeState + elevation: FusionCanBeState ): GuiObject local maid = Maid.new() local _fuse = ColdFusion.fuse(maid) @@ -120,7 +120,7 @@ function Interface.secondary( increment: FusionCanBeState, leftTextOrIcon: FusionCanBeState<((string | ImageData)?)>, rightTextOrIcon: FusionCanBeState<((string | ImageData)?)>, - elevation: FusionCanBeState + elevation: FusionCanBeState ): GuiObject local maid = Maid.new() local _fuse = ColdFusion.fuse(maid) @@ -153,7 +153,7 @@ function Interface.tertiary( increment: FusionCanBeState, leftTextOrIcon: FusionCanBeState<((string | ImageData)?)>, rightTextOrIcon: FusionCanBeState<((string | ImageData)?)>, - elevation: FusionCanBeState + elevation: FusionCanBeState ): GuiObject local maid = Maid.new() local _fuse = ColdFusion.fuse(maid) @@ -186,7 +186,7 @@ function Interface.onPrimary( increment: FusionCanBeState, leftTextOrIcon: FusionCanBeState<((string | ImageData)?)>, rightTextOrIcon: FusionCanBeState<((string | ImageData)?)>, - elevation: FusionCanBeState + elevation: FusionCanBeState ): GuiObject local maid = Maid.new() local _fuse = ColdFusion.fuse(maid) @@ -219,7 +219,7 @@ function Interface.onSecondary( increment: FusionCanBeState, leftTextOrIcon: FusionCanBeState<((string | ImageData)?)>, rightTextOrIcon: FusionCanBeState<((string | ImageData)?)>, - elevation: FusionCanBeState + elevation: FusionCanBeState ): GuiObject local maid = Maid.new() local _fuse = ColdFusion.fuse(maid) @@ -252,7 +252,7 @@ function Interface.onTertiary( increment: FusionCanBeState, leftTextOrIcon: FusionCanBeState<((string | ImageData)?)>, rightTextOrIcon: FusionCanBeState<((string | ImageData)?)>, - elevation: FusionCanBeState + elevation: FusionCanBeState ): GuiObject local maid = Maid.new() local _fuse = ColdFusion.fuse(maid) diff --git a/src/Component/Slider/README.md b/src/Component/Slider/README.md index 51a04261..c65ce1b3 100644 --- a/src/Component/Slider/README.md +++ b/src/Component/Slider/README.md @@ -113,7 +113,7 @@ This function is a style constructor, utilizing the "Style" type to reduce the n - **increment**: number? - **leftTextOrIcon**: ((string | ImageData)?) - **rightTextOrIcon**: ((string | ImageData)?) -- **elevation**: number +- **elevation**: number? ### Usage @@ -128,7 +128,7 @@ local maximum: number? = 100 local increment: number? = 10 local leftTextOrIcon: ((string | ImageData)?) = nil local rightTextOrIcon: ((string | ImageData)?) = nil -local elevation: number = 0 +local elevation: number? = 0 local slider = Synthetic.Component.Slider.Fusion.primary() slider.Style = style @@ -152,7 +152,7 @@ local maximumState: Fusion.Value = Value(100) local increment: number? = 10 local leftTextOrIconState: Fusion.Value<((string | ImageData)?)> = Value(nil) local rightTextOrIcon: ((string | ImageData)?) = nil -local elevationState: Fusion.Value = Value(0) +local elevationState: Fusion.Value = Value(0) local slider: GuiObject = Synthetic.Component.Slider.Fusion.primary( styleState, diff --git a/src/Component/Slider/Wrapper.luau b/src/Component/Slider/Wrapper.luau index 66d21459..5c61ba1d 100644 --- a/src/Component/Slider/Wrapper.luau +++ b/src/Component/Slider/Wrapper.luau @@ -53,7 +53,7 @@ export type StyledSliderWrapperDefinition = { Increment: number?, LeftTextOrIcon: (string | ImageData)?, RightTextOrIcon: (string | ImageData)?, - Elevation: number, + Elevation: number?, } export type StyledSliderWrapper = Wrapper -- Constants diff --git a/src/Component/Slider/_Theme.story.luau b/src/Component/Slider/_Theme.story.luau index c1ab397d..d5f69676 100644 --- a/src/Component/Slider/_Theme.story.luau +++ b/src/Component/Slider/_Theme.story.luau @@ -18,7 +18,7 @@ return function(frame: Frame) task.spawn(function() local function makeHalfFrame(isDarkMode: boolean, color: Color3): Frame local style = Style.new( - 1, + 1.25, Enum.Font.SourceSans, if isDarkMode then Enums.SchemeType.Dark else Enums.SchemeType.Light, color @@ -40,39 +40,39 @@ return function(frame: Frame) do local button = maid:GiveTask(Module.ColdFusion.primary(style, function(val: number) print(`value={val}`) - end, 50, 0, 100, 25, nil, nil, 1)) - button.Parent = halfFrame - end - do - local button = maid:GiveTask(Module.ColdFusion.secondary(style, function(val: number) - print(`value={val}`) - end, 50, 0, 100, 25, nil, nil, 1)) - button.Parent = halfFrame - end - do - local button = maid:GiveTask(Module.ColdFusion.tertiary(style, function(val: number) - print(`value={val}`) - end, 50, 0, 100, 25, nil, nil, 1)) - button.Parent = halfFrame - end - do - local button = maid:GiveTask(Module.ColdFusion.onPrimary(style, function(val: number) - print(`value={val}`) - end, 50, 0, 100, 25, nil, nil, 1)) - button.Parent = halfFrame - end - do - local button = maid:GiveTask(Module.ColdFusion.onSecondary(style, function(val: number) - print(`value={val}`) - end, 50, 0, 100, 25, nil, nil, 1)) - button.Parent = halfFrame - end - do - local button = maid:GiveTask(Module.ColdFusion.onTertiary(style, function(val: number) - print(`value={val}`) - end, 50, 0, 100, 25, nil, nil, 1)) + end, 50, 0, 100, 25)) button.Parent = halfFrame end + -- do + -- local button = maid:GiveTask(Module.ColdFusion.secondary(style, function(val: number) + -- print(`value={val}`) + -- end, 50, 0, 100, 25, nil, nil, 1)) + -- button.Parent = halfFrame + -- end + -- do + -- local button = maid:GiveTask(Module.ColdFusion.tertiary(style, function(val: number) + -- print(`value={val}`) + -- end, 50, 0, 100, 25, nil, nil, 1)) + -- button.Parent = halfFrame + -- end + -- do + -- local button = maid:GiveTask(Module.ColdFusion.onPrimary(style, function(val: number) + -- print(`value={val}`) + -- end, 50, 0, 100, 25, nil, nil, 1)) + -- button.Parent = halfFrame + -- end + -- do + -- local button = maid:GiveTask(Module.ColdFusion.onSecondary(style, function(val: number) + -- print(`value={val}`) + -- end, 50, 0, 100, 25, nil, nil, 1)) + -- button.Parent = halfFrame + -- end + -- do + -- local button = maid:GiveTask(Module.ColdFusion.onTertiary(style, function(val: number) + -- print(`value={val}`) + -- end, 50, 0, 100, 25, nil, nil, 1)) + -- button.Parent = halfFrame + -- end return halfFrame end diff --git a/src/Component/Slider/definition.json b/src/Component/Slider/definition.json index c0812250..a7b4fa4f 100644 --- a/src/Component/Slider/definition.json +++ b/src/Component/Slider/definition.json @@ -138,7 +138,7 @@ }, { "name": "elevation", - "type": "number", + "type": "number?", "default": "0" } ]