Sha256: b6497418ed87a71c65ebf53f58aa75148982d3648654c37ce8f32a485c9a9782

Contents?: true

Size: 1.31 KB

Versions: 10

Compression:

Stored size: 1.31 KB

Contents

# frozen_string_literal: true

module Primer
  module Alpha
    # @label Toggle Switch
    class ToggleSwitchPreview < ViewComponent::Preview
      include ActionView::Helpers::FormTagHelper

      def playground
        render(ToggleSwitch.new(src: "/toggle_switch"))
      end

      def default
        render(ToggleSwitch.new(src: "/toggle_switch"))
      end

      def checked
        render(ToggleSwitch.new(src: "/toggle_switch", checked: true))
      end

      def disabled
        render(ToggleSwitch.new(src: "/toggle_switch", enabled: false))
      end

      def checked_disabled
        render(ToggleSwitch.new(src: "/toggle_switch", checked: true, enabled: false))
      end

      def small
        render(ToggleSwitch.new(src: "/toggle_switch", size: :small))
      end

      def with_status_label_position_end
        render(ToggleSwitch.new(src: "/toggle_switch", status_label_position: :end))
      end

      def with_a_bad_src
        render(ToggleSwitch.new(src: "/foo"))
      end

      def with_no_src
        render(ToggleSwitch.new)
      end

      def with_csrf_token
        render(ToggleSwitch.new(src: "/toggle_switch", csrf_token: "let_me_in"))
      end

      def with_bad_csrf_token
        render(ToggleSwitch.new(src: "/toggle_switch", csrf_token: "i_am_a_criminal"))
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
primer_view_components-0.0.114 previews/primer/alpha/toggle_switch_preview.rb
primer_view_components-0.0.113 previews/primer/alpha/toggle_switch_preview.rb
primer_view_components-0.0.112 previews/primer/alpha/toggle_switch_preview.rb
primer_view_components-0.0.111 previews/primer/alpha/toggle_switch_preview.rb
primer_view_components-0.0.110 previews/primer/alpha/toggle_switch_preview.rb
primer_view_components-0.0.109 previews/primer/alpha/toggle_switch_preview.rb
primer_view_components-0.0.108 previews/primer/alpha/toggle_switch_preview.rb
primer_view_components-0.0.107 previews/primer/alpha/toggle_switch_preview.rb
primer_view_components-0.0.106 previews/primer/alpha/toggle_switch_preview.rb
primer_view_components-0.0.105 previews/primer/alpha/toggle_switch_preview.rb