playbook_ui 14.6.0.pre.alpha.play1586datearea4218 → 14.6.0.pre.rc.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +7 -25
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -2
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/index.js +0 -60
  6. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +9 -1
  7. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +9 -1
  8. data/app/pb_kits/playbook/pb_card/_card.tsx +1 -5
  9. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +1 -5
  10. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.html.erb +7 -30
  11. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.md +2 -0
  12. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +3 -84
  13. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +5 -28
  14. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -5
  15. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +0 -3
  16. data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +1 -10
  17. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -1
  18. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +2 -2
  19. data/app/pb_kits/playbook/pb_filter/Filter/FilterDouble.tsx +0 -2
  20. data/app/pb_kits/playbook/pb_filter/Filter/FilterSingle.tsx +0 -2
  21. data/app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.tsx +1 -4
  22. data/app/pb_kits/playbook/pb_filter/Filter/ResultsCount.tsx +2 -4
  23. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx +1 -1
  24. data/app/pb_kits/playbook/pb_filter/docs/example.yml +0 -3
  25. data/app/pb_kits/playbook/pb_filter/docs/index.js +0 -1
  26. data/app/pb_kits/playbook/pb_filter/filter.html.erb +2 -2
  27. data/app/pb_kits/playbook/pb_filter/filter.rb +0 -2
  28. data/app/pb_kits/playbook/pb_flex/_flex.tsx +1 -3
  29. data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +2 -8
  30. data/app/pb_kits/playbook/pb_flex/flex_item.html.erb +6 -3
  31. data/app/pb_kits/playbook/pb_flex/flex_item.rb +2 -7
  32. data/app/pb_kits/playbook/pb_form/docs/example.yml +0 -1
  33. data/app/pb_kits/playbook/pb_form/form.rb +0 -2
  34. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -9
  35. data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +0 -2
  36. data/app/pb_kits/playbook/pb_form_pill/docs/index.js +0 -1
  37. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +227 -211
  38. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.jsx +1 -1
  39. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +0 -4
  40. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -2
  41. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +65 -169
  42. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.test.js +5 -5
  43. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +9 -15
  44. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +0 -2
  45. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/index.js +0 -1
  46. data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +6 -28
  47. data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb +1 -31
  48. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +18 -86
  49. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +6 -15
  50. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_preferred_countries.md +1 -1
  51. data/app/pb_kits/playbook/pb_phone_number_input/intlTelInput.scss +931 -849
  52. data/app/pb_kits/playbook/pb_phone_number_input/types.d.ts +1 -4
  53. data/app/pb_kits/playbook/pb_popover/_popover.tsx +2 -6
  54. data/app/pb_kits/playbook/pb_popover/docs/_popover_default.html.erb +1 -1
  55. data/app/pb_kits/playbook/pb_popover/popover.rb +1 -3
  56. data/app/pb_kits/playbook/pb_timeline/_item.tsx +23 -59
  57. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +0 -8
  58. data/app/pb_kits/playbook/pb_timeline/docs/example.yml +1 -2
  59. data/app/pb_kits/playbook/pb_timeline/docs/index.js +0 -1
  60. data/app/pb_kits/playbook/pb_timeline/item.html.erb +21 -17
  61. data/app/pb_kits/playbook/pb_timeline/item.rb +0 -4
  62. data/app/pb_kits/playbook/pb_timeline/timeline.test.js +0 -84
  63. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -4
  64. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -3
  65. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -3
  66. data/app/pb_kits/playbook/utilities/globalPropNames.mjs +0 -3
  67. data/app/pb_kits/playbook/utilities/globalProps.ts +2 -39
  68. data/dist/chunks/_typeahead-BYw0HEgO.js +22 -0
  69. data/dist/chunks/_weekday_stacked-DumiyWjh.js +45 -0
  70. data/dist/chunks/{lib-D-mTv-kp.js → lib-CEpcaI8y.js} +1 -1
  71. data/dist/chunks/{pb_form_validation-BkWGwJsl.js → pb_form_validation-D9zkwt2b.js} +1 -1
  72. data/dist/chunks/vendor.js +1 -1
  73. data/dist/playbook-doc.js +1 -1
  74. data/dist/playbook-rails-react-bindings.js +1 -1
  75. data/dist/playbook-rails.js +1 -1
  76. data/dist/playbook.css +1 -1
  77. data/lib/playbook/kit_base.rb +1 -21
  78. data/lib/playbook/pb_doc_helper.rb +5 -5
  79. data/lib/playbook/pb_forms_helper.rb +1 -3
  80. data/lib/playbook/version.rb +2 -2
  81. metadata +6 -48
  82. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx +0 -72
  83. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.md +0 -5
  84. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.jsx +0 -45
  85. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.md +0 -1
  86. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.html.erb +0 -9
  87. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.jsx +0 -33
  88. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.html.erb +0 -10
  89. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.jsx +0 -34
  90. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +0 -1
  91. data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props.html.erb +0 -41
  92. data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props.jsx +0 -71
  93. data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props_rails.md +0 -1
  94. data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props_react.md +0 -1
  95. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.html.erb +0 -39
  96. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.md +0 -1
  97. data/app/pb_kits/playbook/pb_form/formHelper.js +0 -27
  98. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +0 -19
  99. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +0 -27
  100. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.md +0 -1
  101. data/app/pb_kits/playbook/pb_multi_level_select/context/index.tsx +0 -5
  102. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_reset.html.erb +0 -93
  103. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_reset.md +0 -1
  104. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.jsx +0 -105
  105. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.md +0 -1
  106. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.jsx +0 -106
  107. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.md +0 -1
  108. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx +0 -149
  109. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_size.html.erb +0 -336
  110. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_size.jsx +0 -97
  111. data/app/pb_kits/playbook/pb_timeline/date_area.html.erb +0 -12
  112. data/app/pb_kits/playbook/pb_timeline/date_area.rb +0 -13
  113. data/app/pb_kits/playbook/pb_timeline/detail_area.html.erb +0 -3
  114. data/app/pb_kits/playbook/pb_timeline/detail_area.rb +0 -11
  115. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.html.erb +0 -43
  116. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.jsx +0 -68
  117. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.md +0 -4
  118. data/app/pb_kits/playbook/pb_timeline/node_area.html.erb +0 -14
  119. data/app/pb_kits/playbook/pb_timeline/node_area.rb +0 -16
  120. data/app/pb_kits/playbook/pb_timeline/subcomponents/Detail.tsx +0 -29
  121. data/app/pb_kits/playbook/pb_timeline/subcomponents/Label.tsx +0 -38
  122. data/app/pb_kits/playbook/pb_timeline/subcomponents/Step.tsx +0 -42
  123. data/app/pb_kits/playbook/pb_timeline/subcomponents/index.tsx +0 -3
  124. data/dist/chunks/_typeahead-BhHnXJjy.js +0 -22
  125. data/dist/chunks/_weekday_stacked-C-VEa5Ar.js +0 -45
@@ -7,7 +7,6 @@ examples:
7
7
  - multi_level_select_selected_ids: Selected Ids
8
8
  - multi_level_select_with_form: With Form
9
9
  - multi_level_select_color: With Pills (Custom Color)
10
- - multi_level_select_reset: Reset Selection
11
10
 
12
11
  react:
13
12
  - multi_level_select_default: Default
@@ -16,6 +15,3 @@ examples:
16
15
  - multi_level_select_return_all_selected: Return All Selected
17
16
  - multi_level_select_selected_ids_react: Selected Ids
18
17
  - multi_level_select_color: With Pills (Custom Color)
19
- - multi_level_select_with_children: Checkboxes With Children
20
- - multi_level_select_with_children_with_radios: Single Select With Children
21
-
@@ -4,5 +4,3 @@ export { default as MultiLevelSelectSingleChildrenOnly } from './_multi_level_se
4
4
  export { default as MultiLevelSelectReturnAllSelected } from './_multi_level_select_return_all_selected.jsx'
5
5
  export { default as MultiLevelSelectSelectedIdsReact } from "./_multi_level_select_selected_ids_react.jsx"
6
6
  export { default as MultiLevelSelectColor } from './_multi_level_select_color.jsx'
7
- export { default as MultiLevelSelectWithChildren } from './_multi_level_select_with_children.jsx'
8
- export { default as MultiLevelSelectWithChildrenWithRadios } from './_multi_level_select_with_children_with_radios.jsx'
@@ -3,76 +3,6 @@
3
3
  @import "../tokens/opacity";
4
4
  @import "../pb_avatar/avatar";
5
5
 
6
- $sizes: (
7
- "avatar": ("sm": 38px, "md": 60px, "lg": 80px, "xl": 100px),
8
- "first-item-double": ("sm": 20px, "md": 32px, "lg": 44px, "xl": 56px),
9
- "first-item-triple": ("sm": 16px, "md": 24px, "lg": 32px, "xl": 44px),
10
- "first-item-quadruple": ("sm": 16px, "md": 28px, "lg": 36px, "xl": 44px),
11
- "second-item-double": ("sm": 12px, "md": 16px, "lg": 20px, "xl": 24px),
12
- "second-item-triple": ("sm": 12px, "md": 20px, "lg": 24px, "xl": 32px),
13
- "second-item-quadruple": ("sm": 12px, "md": 20px, "lg": 28px, "xl": 32px),
14
- "third-item-triple": ("sm": 10px, "md": 16px, "lg": 20px, "xl": 24px),
15
- "third-item-quadruple": ("sm": 10px, "md": 16px, "lg": 24px, "xl": 24px),
16
- "fourth-item": ("sm": 8px, "md": 12px, "lg": 16px, "xl": 16px)
17
- );
18
-
19
- $positions: (
20
- "second-item-double": (
21
- "sm": ("top": null, "bottom": 5px, "right": 4px, "left": null),
22
- "md": ("top": null, "bottom": 10px, "right": 8px, "left": null),
23
- "lg": ("top": 46px, "bottom": null, "right": 12px, "left": null),
24
- "xl": ("top": 58px, "bottom": null, "right": 14px, "left": null)
25
- ),
26
- "second-item-triple": (
27
- "sm": ("top": 12px, "bottom": null, "right": 2px, "left": null),
28
- "md": ("top": 24px, "bottom": null, "right": 5px, "left": null),
29
- "lg": ("top": 32px, "bottom": null, "right": 9px, "left": null),
30
- "xl": ("top": 41px, "bottom": null, "right": 11px, "left": null)
31
- ),
32
- "second-item-quadruple": (
33
- "sm": ("top": null, "bottom": 9px, "right": 4px, "left": null),
34
- "md": ("top": 24px, "bottom": null, "right": 5px, "left": null),
35
- "lg": ("top": 31px, "bottom": null, "right": 6px, "left": null),
36
- "xl": ("top": 43px, "bottom": null, "right": 9px, "left": null)
37
- ),
38
- "third-item-triple": (
39
- "sm": ("top": null, "bottom": 3px, "right": null, "left": 11px),
40
- "md": ("top": null, "bottom": 6px, "right": null, "left": 16px),
41
- "lg": ("top": null, "bottom": 10px, "right": null, "left": 23px),
42
- "xl": ("top": null, "bottom": 13px, "right": null, "left": 27px)
43
- ),
44
- "third-item-quadruple": (
45
- "sm": ("top": null, "bottom": 3px, "right": null, "left": 9px),
46
- "md": ("top": null, "bottom": 5px, "right": null, "left": 15px),
47
- "lg": ("top": null, "bottom": 7px, "right": null, "left": 20px),
48
- "xl": ("top": null, "bottom": 11px, "right": null, "left": 27px)
49
- ),
50
- "fourth-item": (
51
- "sm": ("top": 5px, "bottom": null, "right": 6px, "left": null),
52
- "md": ("top": 7px, "bottom": null, "right": 12px, "left": null),
53
- "lg": ("top": 9px, "bottom": null, "right": 16px, "left": null),
54
- "xl": ("top": 16px, "bottom": null, "right": 24px, "left": null)
55
- ),
56
- "first-item-double": (
57
- "sm": ("top": 4px, "bottom": null, "right": null, "left": 3px),
58
- "md": ("top": 6px, "bottom": null, "right": null, "left": 8px),
59
- "lg": ("top": 8px, "bottom": null, "right": null, "left": 8px),
60
- "xl": ("top": 10px, "bottom": null, "right": null, "left": 10px)
61
- ),
62
- "first-item-triple": (
63
- "sm": ("top": 4px, "bottom": null, "right": null, "left": 4px),
64
- "md": ("top": 7px, "bottom": null, "right": null, "left": 7px),
65
- "lg": ("top": 10px, "bottom": null, "right": null, "left": 10px),
66
- "xl": ("top": 12px, "bottom": null, "right": null, "left": 12px)
67
- ),
68
- "first-item-quadruple": (
69
- "sm": ("top": 5px, "bottom": null, "right": null, "left": 3px),
70
- "md": ("top": 7px, "bottom": null, "right": null, "left": 5px),
71
- "lg": ("top": 9px, "bottom": null, "right": null, "left": 7px),
72
- "xl": ("top": 16px, "bottom": null, "right": null, "left": 10px)
73
- )
74
- );
75
-
76
6
  @mixin avatar-size($size) {
77
7
  height: $size;
78
8
  width: $size;
@@ -97,8 +27,8 @@ $positions: (
97
27
  $stacked_size: 18px;
98
28
  $max_to_display: 1, 2;
99
29
  display: inline-flex;
100
- width: 28px;
101
- height: 28px;
30
+ width: $container_size;
31
+ height: $container_size;
102
32
  flex-basis: $container_size;
103
33
  position: relative;
104
34
  flex-shrink: 0;
@@ -118,7 +48,7 @@ $positions: (
118
48
  }
119
49
  }
120
50
  &[class*=_single] .pb_multiple_users_stacked_item {
121
- @include avatar-size(28px);
51
+ @include avatar-size($container_size);
122
52
  }
123
53
  [class^=pb_avatar_kit].second_item, [class^=pb_badge_kit].second_item {
124
54
  @include position((bottom: 0, right: 0));
@@ -141,106 +71,72 @@ $positions: (
141
71
  color: transparent;
142
72
  }
143
73
 
144
- // Iterate over each size to adjust the bubble container only when class contains "_bubble_"
145
- @each $size_name, $size_value in $avatar-sizes {
146
- &[class*=_bubble_][class*=_size_#{$size_name}] {
147
- // Set bubble container size based on the class
148
- $bubble_container_size: $size_value;
149
- $container_size: $size_value;
150
-
151
- // Apply the bubble container size
152
- @include avatar-size($bubble_container_size);
153
- width: $bubble_container_size;
154
- height: $bubble_container_size;
155
- flex-basis: $bubble_container_size;
156
-
157
- background-color: $bg_light;
158
- border-radius: 50%;
159
-
160
- &.dark {
161
- background-color: $card_dark;
74
+ &[class*=_bubble] {
75
+ @include avatar-size($bubble_container_size);
76
+ background-color: $bg_light;
77
+ border-radius: 50%;
78
+
79
+ &.dark {
80
+ background-color: $card_dark;
81
+ }
82
+
83
+ [class^=pb_avatar_kit].pb_multiple_users_stacked_item {
84
+ &.dark {
85
+ .avatar_wrapper {
86
+ border: $border_size solid $border_dark;
87
+ }
88
+ }
89
+ }
90
+
91
+ [class^=pb_avatar_kit] {
92
+ &.first_item {
93
+ @include position((top: 4px, left: 3px));
94
+ @include avatar-size(20px);
95
+
96
+ &.triple_bubble {
97
+ @include position((top: 4px, left: 4px));
98
+ @include avatar-size(16px);
162
99
  }
163
-
164
- [class^=pb_avatar_kit].pb_multiple_users_stacked_item {
165
- @include avatar-size($bubble_container_size * 0.45); // Adjust the size of stacked avatars
166
-
167
- &.dark {
168
- .avatar_wrapper {
169
- border: $border_size solid $border_dark;
170
- }
171
- }
172
-
173
- .avatar_wrapper {
174
- border: $border_size solid $white;
175
- }
100
+
101
+ &.quadruple_bubble {
102
+ @include position((top: 5px, left: 3px));
103
+ @include avatar-size(16px);
104
+ }
105
+ }
106
+
107
+ &.second_item {
108
+ @include position((bottom: 5px, right: 4px));
109
+ @include avatar-size(12px);
110
+
111
+ &.triple_bubble {
112
+ @include position((top: 13px, right: 2px));
176
113
  }
177
-
178
- [class^=pb_avatar_kit] {
179
- // First Item
180
- &.first_item {
181
- @include position(map-get(map-get($positions, 'first-item-double'), $size_name));
182
- @include avatar-size(map-get(map-get($sizes, 'first-item-double'), $size_name));
183
-
184
- &.double_bubble {
185
- @include position(map-get(map-get($positions, 'first-item-double'), $size_name));
186
- @include avatar-size(map-get(map-get($sizes, 'first-item-double'), $size_name));
187
- }
188
-
189
- &.triple_bubble {
190
- @include position(map-get(map-get($positions, 'first-item-triple'), $size_name));
191
- @include avatar-size(map-get(map-get($sizes, 'first-item-triple'), $size_name));
192
- }
193
-
194
- &.quadruple_bubble {
195
- @include position(map-get(map-get($positions, 'first-item-quadruple'), $size_name));
196
- @include avatar-size(map-get(map-get($sizes, 'first-item-quadruple'), $size_name));
197
- }
198
- }
199
-
200
- // Second Item
201
- &.second_item {
202
- @include position(map-get(map-get($positions, 'second-item-double'), $size_name));
203
-
204
- &.double_bubble {
205
- @include position(map-get(map-get($positions, 'second-item-double'), $size_name));
206
- @include avatar-size(map-get(map-get($sizes, 'second-item-double'), $size_name));
207
- }
208
-
209
- &.triple_bubble {
210
- @include position(map-get(map-get($positions, 'second-item-triple'), $size_name));
211
- @include avatar-size(map-get(map-get($sizes, 'second-item-triple'), $size_name));
212
- }
213
-
214
- &.quadruple_bubble {
215
- @include position(map-get(map-get($positions, 'second-item-quadruple'), $size_name));
216
- @include avatar-size(map-get(map-get($sizes, 'second-item-quadruple'), $size_name));
217
- }
218
- }
219
-
220
- // Third Item
221
- &.third_item {
222
- @include position(map-get(map-get($positions, 'third-item-triple'), $size_name));
223
- @include avatar-size(map-get(map-get($sizes, 'third-item-triple'), $size_name));
224
-
225
- &.quadruple_bubble {
226
- @include position(map-get(map-get($positions, 'third-item-quadruple'), $size_name));
227
- @include avatar-size(map-get(map-get($sizes, 'third-item-quadruple'), $size_name));
228
- }
229
- }
230
-
231
- // Fourth Item
232
- &.fourth_item {
233
- @include position(map-get(map-get($positions, 'fourth-item'), $size_name));
234
- @include avatar-size(map-get(map-get($sizes, 'fourth-item'), $size_name));
235
- }
114
+
115
+ &.quadruple_bubble {
116
+ @include position((bottom: 9px, right: 4px));
236
117
  }
237
-
238
- &[class*=_single_bubble] {
239
- [class^=pb_avatar_kit].first_item {
240
- @include position((top: 0, left: 0));
241
- @include avatar-size($bubble_container_size);
242
- }
118
+ }
119
+
120
+ &.third_item {
121
+ @include position((bottom: 3px, left: 11px));
122
+ @include avatar-size(10px);
123
+
124
+ &.quadruple_bubble {
125
+ @include position((bottom: 3px, left: 9px));
243
126
  }
244
127
  }
128
+
129
+ &.fourth_item {
130
+ @include position((top: 5px, right: 6px));
131
+ @include avatar-size(8px);
132
+ }
133
+ }
134
+ }
135
+
136
+ &[class*=_single_bubble] {
137
+ [class^=pb_avatar_kit].first_item {
138
+ @include position((top: 0, left: 0));
139
+ @include avatar-size($bubble_container_size);
245
140
  }
246
141
  }
142
+ }
@@ -81,7 +81,7 @@ const MultipleUsersStackedSingleBubble = () => {
81
81
  test('should have a single bubble', () => {
82
82
  render(<MultipleUsersStackedSingleBubble />)
83
83
  const kit = screen.getByTestId(testId)
84
- expect(kit).toHaveClass("pb_multiple_users_stacked_kit_single_bubble_size_sm")
84
+ expect(kit).toHaveClass("pb_multiple_users_stacked_kit_single_bubble")
85
85
 
86
86
  const firstItem = kit.querySelector('.first_item');
87
87
  expect(firstItem).toBeInTheDocument();
@@ -113,7 +113,7 @@ const MultipleUsersStackedDoubleBubble = () => {
113
113
  test('should have a double bubble', () => {
114
114
  render(<MultipleUsersStackedDoubleBubble />)
115
115
  const kit = screen.getByTestId(testId)
116
- expect(kit).toHaveClass("pb_multiple_users_stacked_kit_bubble_size_sm")
116
+ expect(kit).toHaveClass("pb_multiple_users_stacked_kit_bubble")
117
117
 
118
118
  const firstItem = kit.querySelector('.first_item');
119
119
  expect(firstItem).toBeInTheDocument();
@@ -153,7 +153,7 @@ const MultipleUsersStackedTripleBubble = () => {
153
153
  test('should have a triple bubble', () => {
154
154
  render(<MultipleUsersStackedTripleBubble />)
155
155
  const kit = screen.getByTestId(testId)
156
- expect(kit).toHaveClass("pb_multiple_users_stacked_kit_bubble_size_sm")
156
+ expect(kit).toHaveClass("pb_multiple_users_stacked_kit_bubble")
157
157
 
158
158
  const firstItem = kit.querySelector('.first_item');
159
159
  expect(firstItem).toBeInTheDocument();
@@ -208,7 +208,7 @@ const MultipleUsersStackedQuadrupleBubble = () => {
208
208
  test('should have a quadruple bubble', () => {
209
209
  render(<MultipleUsersStackedQuadrupleBubble />)
210
210
  const kit = screen.getByTestId(testId)
211
- expect(kit).toHaveClass("pb_multiple_users_stacked_kit_bubble_size_sm")
211
+ expect(kit).toHaveClass("pb_multiple_users_stacked_kit_bubble")
212
212
 
213
213
  const firstItem = kit.querySelector('.first_item');
214
214
  expect(firstItem).toBeInTheDocument();
@@ -224,4 +224,4 @@ test('should have a quadruple bubble', () => {
224
224
 
225
225
  const fourthItem = kit.querySelector('.fourth_item');
226
226
  expect(fourthItem).toBeInTheDocument();
227
- })
227
+ })
@@ -14,7 +14,6 @@ type MultipleUsersStackedProps = {
14
14
  data?: { [key: string]: string },
15
15
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
16
16
  id?: string,
17
- size?: "md" | "lg" | "sm" | "xl"
18
17
  users: Array<{ [key: string]: string }>,
19
18
  variant: "default" | "bubble",
20
19
  }
@@ -28,17 +27,14 @@ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
28
27
  htmlOptions = {},
29
28
  id,
30
29
  users,
31
- size = "sm",
32
30
  variant = "default",
33
31
  } = props
34
32
 
35
33
  const moreThanTwo = users.length > 2
36
34
  const onlyOne = users.length == 1
37
35
  const isBubble = variant === "bubble"
38
- const doubleBubble = isBubble && users.length === 2
39
36
  const tripleBubble = isBubble && users.length === 3
40
37
  const quadrupleBubble = isBubble && users.length > 3
41
- const sizeClass = isBubble ? `size_${size}` : ""
42
38
  const displayCount = () => {
43
39
  return moreThanTwo ? 1 : users.length
44
40
  }
@@ -47,19 +43,17 @@ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
47
43
  const htmlProps = buildHtmlProps(htmlOptions)
48
44
  const classes = classnames(buildCss(
49
45
  'pb_multiple_users_stacked_kit',
50
- { single: onlyOne, bubble: isBubble }, sizeClass),
51
- globalProps(props),
52
- className)
46
+ { single: onlyOne, bubble: isBubble }), globalProps(props), className)
53
47
 
54
48
  const firstUser = () => {
55
49
  return users.slice(0, 1).map((userObject, index) => {
56
50
  return (
57
51
  <Avatar
58
52
  {...userObject}
59
- className={`pb_multiple_users_stacked_item first_item ${doubleBubble ? "double_bubble" : ""}${tripleBubble ? " triple_bubble" : ""}${quadrupleBubble ? " quadruple_bubble" : ""}`}
53
+ className={`pb_multiple_users_stacked_item first_item${tripleBubble ? " triple_bubble" : ""}${quadrupleBubble ? " quadruple_bubble" : ""}`}
60
54
  dark={dark}
61
55
  key={index}
62
- size={isBubble ? "md" : "xs"}
56
+ size={isBubble ? "sm" : "xs"}
63
57
  />
64
58
  )
65
59
  })
@@ -71,10 +65,10 @@ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
71
65
  return (
72
66
  <Avatar
73
67
  {...userObject}
74
- className={`pb_multiple_users_stacked_item second_item ${doubleBubble ? "double_bubble" : ""}${tripleBubble ? " triple_bubble" : ""}${quadrupleBubble ? " quadruple_bubble" : ""}`}
68
+ className={`pb_multiple_users_stacked_item second_item${tripleBubble ? " triple_bubble" : ""}${quadrupleBubble ? " quadruple_bubble" : ""}`}
75
69
  dark={dark}
76
70
  key={index}
77
- size={isBubble ? "md" : "xs"}
71
+ size="xs"
78
72
  />
79
73
  )
80
74
  })
@@ -87,10 +81,10 @@ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
87
81
  return (
88
82
  <Avatar
89
83
  {...userObject}
90
- className={`pb_multiple_users_stacked_item third_item ${doubleBubble ? "double_bubble" : ""}${tripleBubble ? " triple_bubble" : ""}${quadrupleBubble ? " quadruple_bubble" : ""}`}
84
+ className={`pb_multiple_users_stacked_item third_item${quadrupleBubble ? " quadruple_bubble" : ""}`}
91
85
  dark={dark}
92
86
  key={index}
93
- size="md"
87
+ size="xs"
94
88
  />
95
89
  )
96
90
  })
@@ -103,10 +97,10 @@ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
103
97
  return (
104
98
  <Avatar
105
99
  {...userObject}
106
- className="pb_multiple_users_stacked_item fourth_item quadruple_bubble"
100
+ className="pb_multiple_users_stacked_item fourth_item"
107
101
  dark={dark}
108
102
  key={index}
109
- size="md"
103
+ size="xs"
110
104
  />
111
105
  )
112
106
  })
@@ -3,13 +3,11 @@ examples:
3
3
  rails:
4
4
  - multiple_users_stacked_default: Default
5
5
  - multiple_users_stacked_bubble: Bubble
6
- - multiple_users_stacked_size: Sizes
7
6
 
8
7
 
9
8
  react:
10
9
  - multiple_users_stacked_default: Default
11
10
  - multiple_users_stacked_bubble: Bubble
12
- - multiple_users_stacked_size: Sizes
13
11
 
14
12
  swift:
15
13
  - multiple_users_stacked_default_swift: Default
@@ -1,3 +1,2 @@
1
1
  export { default as MultipleUsersStackedDefault } from './_multiple_users_stacked_default.jsx'
2
2
  export { default as MultipleUsersStackedBubble } from './_multiple_users_stacked_bubble.jsx'
3
- export { default as MultipleUsersStackedSize } from './_multiple_users_stacked_size.jsx'
@@ -1,15 +1,5 @@
1
1
  <%= pb_content_tag do %>
2
- <%= pb_rails(
3
- "avatar",
4
- props: object.users[0].merge({
5
- classname: "pb_multiple_users_stacked_item first_item" +
6
- (object.double_bubble ? " double_bubble" : "") +
7
- (object.triple_bubble ? " triple_bubble" : "") +
8
- (object.quadruple_bubble ? " quadruple_bubble" : ""),
9
- dark: object.dark,
10
- size: 'xs'
11
- })
12
- ) %>
2
+ <%= pb_rails("avatar", props: object.users[0].merge({size: object.bubble ? "sm" : "xs", classname: "pb_multiple_users_stacked_item first_item#{object.triple_bubble ? " triple_bubble" : ""}#{object.quadruple_bubble ? " quadruple_bubble" : ""}", dark: object.dark}) ) %>
13
3
 
14
4
  <% unless object.only_one %>
15
5
  <% if object.more_than_two && !object.bubble %>
@@ -18,26 +8,14 @@
18
8
  text: "+#{object.users.count - object.display_count}",
19
9
  variant: "primary",
20
10
  rounded: true,
21
- classname: "pb_multiple_users_stacked_item second_item"
22
- }) %>
11
+ classname: "pb_multiple_users_stacked_item second_item" }) %>
23
12
  <% elsif object.bubble %>
24
- <% object.users.slice(1, 3).each_with_index do |item, idx| %>
25
- <%= pb_rails(
26
- "avatar",
27
- props: item.merge({
28
- classname: object.bubble_classname(idx),
29
- dark: object.dark
30
- })
31
- ) %>
13
+ <% object.users.slice(1,3).each_with_index do |item, idx| %>
14
+ <%= pb_rails("avatar", props: item.merge({size: "xs", classname: "pb_multiple_users_stacked_item #{idx == 0 ? "second_item#{object.triple_bubble ? " triple_bubble" : ""}#{object.quadruple_bubble ? " quadruple_bubble" : ""}" : idx == 1 ? "third_item#{object.quadruple_bubble ? " quadruple_bubble" : ""}" : "fourth_item"}", dark: object.dark}) ) %>
32
15
  <% end %>
33
16
  <% else %>
34
- <%= pb_rails(
35
- "avatar",
36
- props: object.users[1].merge({
37
- classname: "pb_multiple_users_stacked_item second_item",
38
- dark: object.dark
39
- })
40
- ) %>
17
+ <%= pb_rails("avatar", props: object.users[1].merge({size: "xs", classname: "pb_multiple_users_stacked_item second_item", dark: object.dark}) ) %>
41
18
  <% end %>
42
19
  <% end %>
20
+
43
21
  <% end %>
@@ -4,9 +4,6 @@ module Playbook
4
4
  module PbMultipleUsersStacked
5
5
  class MultipleUsersStacked < Playbook::KitBase
6
6
  prop :users, type: Playbook::Props::HashArray, required: true
7
- prop :size, type: Playbook::Props::Enum,
8
- values: %w[sm md lg xl],
9
- default: "sm"
10
7
 
11
8
  prop :variant, type: Playbook::Props::Enum,
12
9
  values: %w[default bubble],
@@ -28,10 +25,6 @@ module Playbook
28
25
  variant == "bubble"
29
26
  end
30
27
 
31
- def double_bubble
32
- bubble && users.count === 2
33
- end
34
-
35
28
  def triple_bubble
36
29
  bubble && users.count === 3
37
30
  end
@@ -40,31 +33,8 @@ module Playbook
40
33
  bubble && users.count > 3
41
34
  end
42
35
 
43
- def size_class
44
- "size_#{size}" if bubble
45
- end
46
-
47
36
  def classname
48
- generate_classname("pb_multiple_users_stacked_kit", single_class, bubble_class, size_class)
49
- end
50
-
51
- def bubble_classname(index)
52
- base_classname = "pb_multiple_users_stacked_item "
53
-
54
- case index
55
- when 0
56
- base_classname += "second_item"
57
- base_classname += " double_bubble" if double_bubble
58
- base_classname += " triple_bubble" if triple_bubble
59
- base_classname += " quadruple_bubble" if quadruple_bubble
60
- when 1
61
- base_classname += "third_item"
62
- base_classname += " quadruple_bubble" if quadruple_bubble
63
- else
64
- base_classname += "fourth_item"
65
- end
66
-
67
- base_classname
37
+ generate_classname("pb_multiple_users_stacked_kit", single_class, bubble_class)
68
38
  end
69
39
 
70
40
  private