local S=require(script.Parent.Parent.Runtime)local k=require(script.Parent.Parent.automaticSize)return S.widget(function(F,w)if type(F)=="\102\117\110\099\116\105\111\110"and w==nil then w=F F={}end if F.padding then if type(F.padding)=="\110\117\109\098\101\114"then F.padding=UDim.new(0,F.padding)end else F.padding=UDim.new(0,10)end local W=S.useInstance(function(S)local w=Instance.new("\070\114\097\109\101")w.BackgroundTransparency=1 local W=Instance.new("\085\073\076\105\115\116\076\097\121\111\117\116")W.SortOrder=Enum.SortOrder.LayoutOrder W.FillDirection=Enum.FillDirection.Horizontal W.Padding=F.padding W.Parent=w S.frame=w k(w)return w end)local p=W.frame p.UIListLayout.HorizontalAlignment=F.alignment or Enum.HorizontalAlignment.Left S.scope(w)end)
--[=[
	@within Plasma
	@function row
	@tag widgets
	@param options {padding: Vector2}
	@param children () -> () -- Children

	Lays out children horizontally
]=]

local Runtime = require(script.Parent.Parent.Runtime)
local automaticSize = require(script.Parent.Parent.automaticSize)

return Runtime.widget(function(options, fn)
	if type(options) == "function" and fn == nil then
		fn = options
		options = {}
	end

	if options.padding then
		if type(options.padding) == "number" then
			options.padding = UDim.new(0, options.padding)
		end
	else
		options.padding = UDim.new(0, 10)
	end

	local refs = Runtime.useInstance(function(ref)
		local Frame = Instance.new("Frame")
		Frame.BackgroundTransparency = 1

		local UIListLayout = Instance.new("UIListLayout")
		UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
		UIListLayout.FillDirection = Enum.FillDirection.Horizontal
		UIListLayout.Padding = options.padding
		UIListLayout.Parent = Frame

		ref.frame = Frame

		automaticSize(Frame)

		return Frame
	end)

	local frame = refs.frame

	frame.UIListLayout.HorizontalAlignment = options.alignment or Enum.HorizontalAlignment.Left

	Runtime.scope(fn)
end)
