Sha256: a864d3b1f61831d804672b99f0c0093aa6405fc99a2b5072a68c2a7690ef0669

Contents?: true

Size: 1.07 KB

Versions: 204

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbUser
    class User < Playbook::KitBase
      prop :align, type: Playbook::Props::Enum,
                   values: %w[left center right],
                   default: "left"
      prop :avatar, type: Playbook::Props::Boolean,
                    default: false
      prop :avatar_url
      prop :name
      prop :orientation, type: Playbook::Props::Enum,
                         values: %w[vertical horizontal],
                         default: "horizontal"
      prop :size, type: Playbook::Props::Enum,
                  values: %w[lg md sm],
                  default: "sm"
      prop :title
      prop :territory

      def classname
        generate_classname("pb_user_kit", align, orientation, size)
      end

      def avatar_size
        case size
        when "lg"
          "xl"
        when "md"
          "md"
        else
          "sm"
        end
      end

      def title_size
        size == "lg" ? 3 : 4
      end

      def details
        [territory, title].reject(&:blank?).join(" • ")
      end
    end
  end
end

Version data entries

204 entries across 204 versions & 1 rubygems

Version Path
playbook_ui-11.10.0.pre.alpha.pre.bold1 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.10.0.pre.alpha.pagination1 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.10.0 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.9.0 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.9.0.pre.alpha.fileupload1 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.8.1 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.8.0 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.7.0.pre.alpha.table1 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.7.0 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.6.0.pre.alpha.fontawesome app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.5.0.pre.alpha.fontawesome app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.7.0.pre.alpha.pre.guagechart1 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.6.0 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.5.0.pre.alpha.datepicker1 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.6.0.pre.alpha.rubocopperf1 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.6.1.pre.alpha.rubocop.pre.performance1 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.5.0.pre.alpha.pre.rubocop app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.6.0.pre.alpha.momenttz1 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.5.0 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-11.4.0.pre.alpha.rubytheme2 app/pb_kits/playbook/pb_user/user.rb