Class: Maglev::Uikit::PageLayoutComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/maglev/uikit/page_layout_component.rb

Defined Under Namespace

Classes: BackLinkComponent

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseComponent

#button_class_names

Constructor Details

#initialize(back_path: nil, expanded: false) ⇒ PageLayoutComponent

Returns a new instance of PageLayoutComponent.



15
16
17
18
# File 'app/components/maglev/uikit/page_layout_component.rb', line 15

def initialize(back_path: nil, expanded: false)
  @back_path = back_path
  @expanded = expanded
end

Instance Attribute Details

#back_pathObject (readonly)

Returns the value of attribute back_path.



13
14
15
# File 'app/components/maglev/uikit/page_layout_component.rb', line 13

def back_path
  @back_path
end

#expandedObject (readonly)

Returns the value of attribute expanded.



13
14
15
# File 'app/components/maglev/uikit/page_layout_component.rb', line 13

def expanded
  @expanded
end

Instance Method Details

#wrapper_classesObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/components/maglev/uikit/page_layout_component.rb', line 20

def wrapper_classes
  class_variants(
    base: %(
      slide-pane absolute inset-y-0 h-[100dvh-(--spacing(16))] bg-white
      border-r border-gray-200 origin-top-left flex flex-col top-16 w-104
    ),
    variants: {
      expanded: 'left-0 z-40',
      '!expanded': 'left-16 z-10'
    }
  ).render(expanded: expanded)
end