Sha256: 2c8207a67a0f8472cc8d9cb4e8d11aa8b6c787266483ee82b897d5f87dc0ccaa

Contents?: true

Size: 1.09 KB

Versions: 990

Compression:

Stored size: 1.09 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 :subtitle
      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

990 entries across 990 versions & 1 rubygems

Version Path
playbook_ui-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5437 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.11.1.pre.alpha.PBNTR719listdraggablesimple5432 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.11.1.pre.alpha.PBNTR768stickyrightcolumn5431 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.12.0.pre.rc.6 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5415 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5413 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.12.0.pre.rc.5 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5409 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5400 app/pb_kits/playbook/pb_user/user.rb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5392 app/pb_kits/playbook/pb_user/user.rb