local C=script.Parent.Parent.Parent local U=C.Parent local Z=require(C.Theme)local b=Z.WithTheme local p=C.Validators local w=require(p.StyleValidator)local m=require(U.Sift)local O=require(U.t)local M=require(U.Roact)local r=M.createElement local W=M.PureComponent:extend(script.Name)W.defaultProps={CornerRadius=UDim.new(0,8)}W.validateProps=O.strictInterface({AnchorPoint=O.optional(O.Vector2);BackgroundColor=O.optional(w),CornerRadius=O.optional(O.UDim),AutomaticSize=O.optional(O.EnumItem);Position=O.optional(O.UDim2),Size=O.union(O.UDim2,O.table),[M.Children]=O.optional(O.table);Native=O.optional(O.table)})function W.render(C)local U=C.props or{}return b(function(C)return r("\073\109\097\103\101\076\097\098\101\108",m.Dictionary.join({BackgroundTransparency=1,AnchorPoint=U.AnchorPoint,Position=U.Position;Image="\114\098\120\097\115\115\101\116\105\100\058\047\047\049\056\054\052\057\049\050\055\056";ImageTransparency=.25;ScaleType=Enum.ScaleType.Slice,SliceCenter=Rect.new(20,15,76,71),SliceScale=U.CornerRadius.Offset/4,Size=U.Size},U.Native),U[M.Children])end)end return W
-- DropShadow: A component that is the base structure for a UI DropShadow

local Winro = script.Parent.Parent.Parent
local Packages = Winro.Parent

local Theme = require(Winro.Theme)
local WithTheme = Theme.WithTheme

local Validators = Winro.Validators
local StyleValidator = require(Validators.StyleValidator)

local Sift = require(Packages.Sift)
local t = require(Packages.t)
local Roact = require(Packages.Roact)
local new = Roact.createElement

local DropShadow = Roact.PureComponent:extend(script.Name)

DropShadow.defaultProps = {
	CornerRadius = UDim.new(0, 8), --- @defaultProp
}

DropShadow.validateProps = t.strictInterface({

	--- @prop @optional AnchorPoint Vector2 The DropShadow's anchor point
	AnchorPoint = t.optional(t.Vector2),

	--- @prop @optional @style BackgroundColor string|table The DropShadow's background color
	BackgroundColor = t.optional(StyleValidator),

	--- @prop @optional CornerRadius UDim Corner radius
	CornerRadius = t.optional(t.UDim),

	--- @prop @optional AutomaticSize Enum.AutomaticSize Auto sizing
	AutomaticSize = t.optional(t.EnumItem),

	--- @prop @optional Position UDim2 The DropShadow's position
	Position = t.optional(t.UDim2),

	--- @prop @optional Size UDim2 The DropShadow's size
	Size = t.union(t.UDim2, t.table),

	--- @prop @optional [Roact.Children] table The contents to display in the DropShadow area
	[Roact.Children] = t.optional(t.table),

	--- @prop @optional Native table Native props
	Native = t.optional(t.table),
})

function DropShadow:render()
	local props = self.props or {}

	return WithTheme(function(Theme)

		-- ////////// DropShadow
		return new('ImageLabel', Sift.Dictionary.join({
			BackgroundTransparency = 1,
			AnchorPoint = props.AnchorPoint,
			Position = props.Position,
			Image = 'rbxassetid://186491278',
			ImageTransparency = 0.25,
			ScaleType = Enum.ScaleType.Slice,
			SliceCenter = Rect.new(20, 15, 76, 71),
			SliceScale = props.CornerRadius.Offset / 4, -- This works kinda?

			Size = props.Size,
		}, props.Native), props[Roact.Children])
	end)
end

return DropShadow
