defmodule DaisyUIComponents.Drawer do @moduledoc """ Drawer component https://daisyui.com/components/drawer """ use DaisyUIComponents, :component attr :selector_id, :string, required: true, doc: "identifier to toggle the modal" attr :class, :any, default: nil attr :open, :boolean, default: nil, doc: "Forces the drawer to be open" attr :end, :boolean, default: nil, doc: "Puts drawer to the right" attr :rest, :global slot :drawer_content do attr :class, :any end slot :drawer_side do attr :class, :any end slot :inner_block def drawer(assigns) do assigns = assigns |> assign( :class, classes([ "drawer", maybe_add_class(assigns[:open], "drawer-open"), maybe_add_class(assigns[:end], "drawer-end"), assigns.class ]) ) ~H"""