Sha256: 2132bbac7f5d8187d7763d78ec12be2b4a57876f830e4ff23c3227660588636b

Contents?: true

Size: 618 Bytes

Versions: 201

Compression:

Stored size: 618 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbAvatar
    class Avatar
      include Playbook::Props

      partial "pb_avatar/avatar"

      prop :image_url
      prop :name, default: ""
      prop :size, type: Playbook::Props::Enum,
                  values: %w[xs sm md base lg xl],
                  default: "md"
      prop :status

      def initials
        name.split.map(&:first).join.downcase
      end

      def classname
        generate_classname("pb_avatar_kit", size)
      end

      def online_status_props
        { status: status, classname: "size_#{size}" }
      end
    end
  end
end

Version data entries

201 entries across 201 versions & 1 rubygems

Version Path
playbook_ui-7.0.0.pre.alpha3 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.0.0.pre.alpha2 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-6.3.0 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-6.2.1 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-6.2.0 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.0.0.pre.alpha1 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-6.1.0.pre.alpha5 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-6.1.0.pre.alpha4 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-6.1.0.pre.alpha3 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-6.1.0.pre.alpha2 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-6.1.0.pre.alpha1 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-6.1.0 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-6.0.1.pre.alpha6 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-6.0.1.pre.alpha5 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-6.0.1.pre.alpha4 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-6.0.1.pre.alpha3 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-6.0.1.pre.alpha2 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-5.2.0.pre.alpha15 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-5.2.0.pre.alpha14 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-5.2.0.pre.alpha13 app/pb_kits/playbook/pb_avatar/avatar.rb