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-4.9.0.pre.alpha1 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.9.0 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.8.2 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.8.1 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.7.1 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.7.0 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.6.1 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.6.0 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.5.2 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.5.1 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.5.0 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.4.1 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.4.0 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.3.1 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.3.0 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.2.0 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.1.2 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.1.1 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.1.0 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-4.0.1 app/pb_kits/playbook/pb_legend/legend.rb