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.14.0.pre.alpha1 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.15.1 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.15.0 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.14.0 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.13.0.pre.alpha1 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.13.0 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.12.1 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.12.0 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.11.1 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.11.0 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.11.0.pre.alpha1 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.10.0 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.9.0 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.8.4 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.8.3 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.8.2 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.8.1 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.8.0 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.7.0.pre.alpha1 app/pb_kits/playbook/pb_avatar/avatar.rb
playbook_ui-7.7.0 app/pb_kits/playbook/pb_avatar/avatar.rb