Sha256: 29c9bb568c9f170956c8ccf386f9e6074a6c3cd6e760a0201cf691e5cacd086c

Contents?: true

Size: 626 Bytes

Versions: 83

Compression:

Stored size: 626 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbLegend
    class Legend
      include Playbook::Props

      partial "pb_legend/legend"

      prop :color, type: Playbook::Props::Enum,
                   values: (1..7).map { |n| "data_#{n}" },
                   default: "data_1"

      prop :dark, type: Playbook::Props::Boolean,
                  default: false

      prop :prefix_text

      prop :text, required: true

      def body_color
        dark ? "lighter" : "light"
      end

      def classname
        generate_classname("pb_legend_kit", color, dark ? "dark" : "light")
      end
    end
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
playbook_ui-6.2.1 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-6.2.0 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-6.1.0.pre.alpha5 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-6.1.0.pre.alpha4 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-6.1.0.pre.alpha3 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-6.1.0.pre.alpha2 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-6.1.0.pre.alpha1 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-6.1.0 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-6.0.1.pre.alpha6 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-6.0.1.pre.alpha5 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-6.0.1.pre.alpha4 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-6.0.1.pre.alpha3 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-6.0.1.pre.alpha2 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-6.0.1 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-6.0.0 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-5.5.1.pre.alpha4 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-5.5.1.pre.alpha3 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-5.5.1.pre.alpha2 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-5.5.1.pre.alpha1 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-5.5.1 app/pb_kits/playbook/pb_legend/legend.rb