Class: Maglev::Uikit::DeviceTogglerComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Maglev::Uikit::DeviceTogglerComponent
- Defined in:
- app/components/maglev/uikit/device_toggler_component.rb
Instance Method Summary collapse
Methods inherited from BaseComponent
Instance Method Details
#active_classes ⇒ Object
24 25 26 |
# File 'app/components/maglev/uikit/device_toggler_component.rb', line 24 def active_classes 'bg-gray-100' end |
#base_classes ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/components/maglev/uikit/device_toggler_component.rb', line 15 def base_classes [ 'cursor-pointer hover:bg-gray-100 h-10 w-10 flex items-center justify-center rounded', 'outline-none transition-colors duration-200', 'focus-visible:ring-2 focus-visible:ring-editor-primary/50', 'focus-visible:ring-offset-2 focus-visible:ring-offset-white' ].join(' ').freeze end |
#devices ⇒ Object
28 29 30 31 32 33 34 |
# File 'app/components/maglev/uikit/device_toggler_component.rb', line 28 def devices [ { icon: 'computer', device: 'desktop' }, { icon: 'tablet', device: 'tablet' }, { icon: 'smartphone', device: 'mobile' } ] end |
#toggler_classes ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'app/components/maglev/uikit/device_toggler_component.rb', line 6 def toggler_classes(...) class_variants( base: base_classes, variants: { active: active_classes } ).render(...) end |