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.0.0 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-3.5.0 app/pb_kits/playbook/pb_legend/legend.rb
playbook_ui-3.4.0 app/pb_kits/playbook/pb_legend/legend.rb