Skip to content

Commit

Permalink
Restructure samples
Browse files Browse the repository at this point in the history
  • Loading branch information
ImAvafe committed Sep 5, 2024
1 parent f15e446 commit 19ac004
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 43 deletions.
6 changes: 6 additions & 0 deletions samples/Samples.storybook.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
return {
name = "OnyxUI Samples",
storyRoots = {
script.Parent,
},
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local OnyxUI = script.Parent.Parent
local OnyxUI = script.Parent.Parent.Parent.OnyxUI.Packages.OnyxUI
local Themer = require(OnyxUI.Themer)
local Fusion = require(OnyxUI.Packages.Fusion)
local Util = require(OnyxUI.Util)
Expand Down
33 changes: 33 additions & 0 deletions samples/SettingsMenu/SettingsMenu.story.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
local OnyxUI = script.Parent.Parent.Parent.OnyxUI.Packages.OnyxUI
local Fusion = require(OnyxUI.Packages.Fusion)
local Themer = require(OnyxUI.Themer)

local Children = Fusion.Children
local Scoped = Fusion.scoped

local Frame = require(OnyxUI.Components.Frame)
local SettingsMenu = require(script.Parent)
local Components = {
Frame = Frame,
SettingsMenu = SettingsMenu,
}

return function(Parent: GuiObject)
local Scope: Fusion.Scope<typeof(Fusion) & typeof(Components)> = Scoped(Fusion, Components)
local Theme: Themer.ThemeObject = Themer.Theme:now()

Scope:Frame {
Parent = Parent,
Padding = Scope:Computed(function(use)
return UDim.new(0, use(Theme.StrokeThickness["1"]))
end),

[Children] = {
Scope:SettingsMenu {},
},
}

return function()
Scope:doCleanup()
end
end
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
local OnyxUI = script.Parent.Parent

local OnyxUI = script.Parent.Parent.OnyxUI.Packages.OnyxUI
local Fusion = require(OnyxUI.Packages.Fusion)
local Themer = require(OnyxUI.Themer)
local Util = require(OnyxUI.Util)
Expand All @@ -10,7 +9,7 @@ local MenuFrame = require(OnyxUI.Components.MenuFrame)
local Button = require(OnyxUI.Components.Button)
local TitleBar = require(OnyxUI.Components.TitleBar)
local Scroller = require(OnyxUI.Components.Scroller)
local SettingToggle = require(OnyxUI.Examples.SettingToggle)
local SettingToggle = require(script.SettingToggle)
local TextInput = require(OnyxUI.Components.TextInput)
local Components = {
MenuFrame = MenuFrame,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local OnyxUI = script.Parent.Parent
local OnyxUI = script.Parent.Parent.Parent.OnyxUI.Packages.OnyxUI
local Util = require(OnyxUI.Util)
local Fusion = require(OnyxUI.Packages.Fusion)
local Themer = require(OnyxUI.Themer)
Expand Down Expand Up @@ -56,7 +56,7 @@ return function(Parent: GuiObject)
},
})

local Object = Scope:Base {
Scope:Base {
Parent = Parent,
ListEnabled = true,
ListFillDirection = Enum.FillDirection.Horizontal,
Expand Down
36 changes: 0 additions & 36 deletions src/Examples/SettingsMenu.story.lua

This file was deleted.

2 changes: 1 addition & 1 deletion src/OnyxUI.storybook.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
return {
name = "OnyxUI",
storyRoots = {
script.Parent,
script.Parent.Components,
},
}
3 changes: 3 additions & 0 deletions testing.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"$path": "src"
}
}
},
"Samples": {
"$path": "samples"
}
}
}
Expand Down

0 comments on commit 19ac004

Please sign in to comment.