Sha256: 5814eb6b4a3f3d646392e8012767998284761d1d4c0d210e4a9dffa4c7fb694d

Contents?: true

Size: 1010 Bytes

Versions: 91

Compression:

Stored size: 1010 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbMultipleUsersStacked
    class MultipleUsersStacked < Playbook::KitBase
      prop :users, type: Playbook::Props::HashArray, required: true

      prop :variant, type: Playbook::Props::Enum,
                     values: %w[default bubble],
                     default: "default"

      def more_than_two
        users.count > 2
      end

      def only_one
        users.count == 1
      end

      def display_count
        more_than_two ? 1 : users.count
      end

      def bubble
        variant == "bubble"
      end

      def triple_bubble
        bubble && users.count === 3
      end

      def quadruple_bubble
        bubble && users.count > 3
      end

      def classname
        generate_classname("pb_multiple_users_stacked_kit", single_class, bubble_class)
      end

    private

      def single_class
        only_one ? "single" : nil
      end

      def bubble_class
        bubble ? "bubble" : nil
      end
    end
  end
end

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
playbook_ui-14.5.0.pre.alpha.play1586datearea4115 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.6.0.pre.rc.16 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4098 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4097 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4094 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.6.0.pre.rc.15 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4077 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.6.0.pre.rc.14 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4073 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.PBNTR600reactfilterdisplayzeroresults4068 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.PLAY15814066 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.PBNTR568dropdowncleaning4044 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.PBNTR568dropdowncleaning4041 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.PLAY15814040 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.6.0.pre.rc.13 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4037 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.20241007playbookwebsiteaddrdbms4036 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.PBNTR606multilevelselectreset4035 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4032 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4028 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb