playbook_ui 14.5.0.pre.alpha.PBNTR614advancedtablepoc4155 → 14.5.0.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4094
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +7 -26
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -2
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +4 -20
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -1
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +2 -2
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +65 -169
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.test.js +5 -5
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +9 -15
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +6 -28
- data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb +1 -31
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +3 -1
- data/dist/chunks/_weekday_stacked-B0Zid7Rv.js +45 -0
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +3 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx +0 -52
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.jsx +0 -45
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.md +0 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_size.html.erb +0 -336
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_size.jsx +0 -97
- data/dist/chunks/_weekday_stacked-leC2i6B3.js +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a687edbd714231627256d5016b1f8da9ec2876ba3c104dda60cf7174fa8c638b
|
4
|
+
data.tar.gz: 6ff5663b5613b7774d1c2091c54ccdc2b1664342bd95edbf1fb7f5114c8baf0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edc9fda753bf6fbc732f150ad060f0123f0ef4b3718b2cd7707d526ce4f48f15fe0b61d5a97fca767d65bdab6400bae9ab2f3a15ce4f5f4c66709a43b7d1b6ce
|
7
|
+
data.tar.gz: b0a623310a3381bbc3c9090a5aacf8f6fd766828082b116fdb977d9614a40edde660c0993e74d446a5d962f02596d41568c4349bcdd0e362677eda8a40e5aa0c
|
@@ -91,7 +91,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
91
91
|
const columnHelper = createColumnHelper()
|
92
92
|
|
93
93
|
//Create cells for first columns
|
94
|
-
const createCellFunction = (cellAccessors: string[]
|
94
|
+
const createCellFunction = (cellAccessors: string[]) => {
|
95
95
|
const columnCells = ({
|
96
96
|
row,
|
97
97
|
getValue,
|
@@ -101,12 +101,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
101
101
|
}) => {
|
102
102
|
const rowData = row.original
|
103
103
|
|
104
|
-
// Use customRenderer if provided, otherwise default rendering
|
105
|
-
if (customRenderer) {
|
106
|
-
// console.log(row.original, getValue())
|
107
|
-
return customRenderer(row, getValue())
|
108
|
-
}
|
109
|
-
|
110
104
|
switch (row.depth) {
|
111
105
|
case 0: {
|
112
106
|
return (
|
@@ -140,31 +134,18 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
140
134
|
//Create column array in format needed by Tanstack
|
141
135
|
const columns =
|
142
136
|
columnDefinitions &&
|
143
|
-
columnDefinitions.map((column
|
137
|
+
columnDefinitions.map((column) => {
|
144
138
|
// Define the base column structure
|
145
139
|
const columnStructure = {
|
146
140
|
...columnHelper.accessor(column.accessor, {
|
147
141
|
header: column.label,
|
148
142
|
}),
|
149
143
|
}
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
column.cellAccessors,
|
156
|
-
column.customRenderer
|
157
|
-
)
|
158
|
-
}
|
159
|
-
} else {
|
160
|
-
// For the first column, apply createCellFunction without customRenderer
|
161
|
-
if (column.cellAccessors) {
|
162
|
-
columnStructure.cell = createCellFunction(column.cellAccessors)
|
163
|
-
}
|
164
|
-
}
|
165
|
-
|
166
|
-
return columnStructure
|
167
|
-
})
|
144
|
+
if (column.cellAccessors) {
|
145
|
+
columnStructure.cell = createCellFunction(column.cellAccessors)
|
146
|
+
}
|
147
|
+
return columnStructure
|
148
|
+
})
|
168
149
|
|
169
150
|
//Syntax for sorting Array if we want to manage state ourselves
|
170
151
|
const sorting = [
|
@@ -3,7 +3,6 @@ examples:
|
|
3
3
|
- advanced_table_beta: Default (Required Props)
|
4
4
|
- advanced_table_beta_subrow_headers: SubRow Headers
|
5
5
|
- advanced_table_beta_sort: Enable Sorting
|
6
|
-
|
7
6
|
react:
|
8
7
|
- advanced_table_default: Default (Required Props)
|
9
8
|
- advanced_table_loading: Loading State
|
@@ -16,4 +15,3 @@ examples:
|
|
16
15
|
- advanced_table_table_props: Table Props
|
17
16
|
- advanced_table_inline_row_loading: Inline Row Loading
|
18
17
|
- advanced_table_responsive: Responsive Tables
|
19
|
-
- advanced_table_custom_cell: Custom Components for Cells
|
@@ -9,4 +9,3 @@ export { default as AdvancedTableTableOptions } from './_advanced_table_table_op
|
|
9
9
|
export { default as AdvancedTableTableProps } from './_advanced_table_table_props.jsx'
|
10
10
|
export { default as AdvancedTableInlineRowLoading } from './_advanced_table_inline_row_loading.jsx'
|
11
11
|
export { default as AdvancedTableResponsive } from './_advanced_table_responsive.jsx'
|
12
|
-
export { default as AdvancedTableCustomCell } from './_advanced_table_custom_cell.jsx'
|
@@ -28,8 +28,7 @@ $pb_card_header_colors: map-merge(map-merge($product_colors, $additional_colors)
|
|
28
28
|
|
29
29
|
@mixin pb_card_selected($border_color: $primary) {
|
30
30
|
border-color: $border_color;
|
31
|
-
border-width: $pb_card_border_width;
|
32
|
-
outline: 1px solid $border_color;
|
31
|
+
border-width: $pb_card_border_width * 2;
|
33
32
|
}
|
34
33
|
|
35
34
|
@mixin pb_card_selected_dark {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useState, useRef, useEffect
|
1
|
+
import React, { useState, useRef, useEffect } from "react";
|
2
2
|
import classnames from "classnames";
|
3
3
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
|
4
4
|
import { globalProps } from "../utilities/globalProps";
|
@@ -38,14 +38,7 @@ type DropdownProps = {
|
|
38
38
|
triggerRef?: any;
|
39
39
|
};
|
40
40
|
|
41
|
-
|
42
|
-
extends React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<unknown>> {
|
43
|
-
Option: typeof DropdownOption;
|
44
|
-
Trigger: typeof DropdownTrigger;
|
45
|
-
Container: typeof DropdownContainer;
|
46
|
-
}
|
47
|
-
|
48
|
-
const Dropdown = forwardRef((props: DropdownProps, ref: any) => {
|
41
|
+
const Dropdown = (props: DropdownProps) => {
|
49
42
|
const {
|
50
43
|
aria = {},
|
51
44
|
autocomplete = false,
|
@@ -132,7 +125,7 @@ const Dropdown = forwardRef((props: DropdownProps, ref: any) => {
|
|
132
125
|
const filteredOptions = optionsWithBlankSelection?.filter((option: GenericObject) => {
|
133
126
|
const label = typeof option.label === 'string' ? option.label.toLowerCase() : option.label;
|
134
127
|
return String(label).toLowerCase().includes(filterItem.toLowerCase());
|
135
|
-
});
|
128
|
+
});
|
136
129
|
|
137
130
|
// For keyboard accessibility: Set focus within dropdown to selected item if it exists
|
138
131
|
useEffect(() => {
|
@@ -182,14 +175,6 @@ const Dropdown = forwardRef((props: DropdownProps, ref: any) => {
|
|
182
175
|
dark
|
183
176
|
});
|
184
177
|
|
185
|
-
useImperativeHandle(ref, () => ({
|
186
|
-
clearSelected: () => {
|
187
|
-
setSelected({});
|
188
|
-
setFilterItem("");
|
189
|
-
setIsDropDownClosed(true);
|
190
|
-
onSelect && onSelect(null);
|
191
|
-
},
|
192
|
-
}));
|
193
178
|
|
194
179
|
return (
|
195
180
|
<div {...ariaProps}
|
@@ -273,9 +258,8 @@ const Dropdown = forwardRef((props: DropdownProps, ref: any) => {
|
|
273
258
|
</DropdownContext.Provider>
|
274
259
|
</div>
|
275
260
|
)
|
276
|
-
}
|
261
|
+
};
|
277
262
|
|
278
|
-
Dropdown.displayName = "Dropdown";
|
279
263
|
Dropdown.Option = DropdownOption;
|
280
264
|
Dropdown.Trigger = DropdownTrigger;
|
281
265
|
Dropdown.Container = DropdownContainer;
|
@@ -22,7 +22,6 @@ examples:
|
|
22
22
|
- dropdown_error: Dropdown with Error
|
23
23
|
- dropdown_default_value: Default Value
|
24
24
|
- dropdown_blank_selection: Blank Selection
|
25
|
-
- dropdown_clear_selection: Clear Selection
|
26
25
|
# - dropdown_with_autocomplete: Autocomplete
|
27
26
|
# - dropdown_with_autocomplete_and_custom_display: Autocomplete with Custom Display
|
28
27
|
# - dropdown_with_external_control: useDropdown Hook
|
@@ -12,4 +12,3 @@ export { default as DropdownSubcomponentStructure } from './_dropdown_subcompone
|
|
12
12
|
export { default as DropdownError } from './_dropdown_error.jsx'
|
13
13
|
export { default as DropdownDefaultValue } from './_dropdown_default_value.jsx'
|
14
14
|
export { default as DropdownBlankSelection } from './_dropdown_blank_selection.jsx'
|
15
|
-
export { default as DropdownClearSelection } from './_dropdown_clear_selection.jsx'
|
@@ -73,7 +73,7 @@ const DropdownTrigger = (props: DropdownTriggerProps) => {
|
|
73
73
|
!autocomplete && "select_only"
|
74
74
|
);
|
75
75
|
|
76
|
-
const customDisplayPlaceholder = selected
|
76
|
+
const customDisplayPlaceholder = selected.label ? (
|
77
77
|
<b>{selected.label}</b>
|
78
78
|
) : autocomplete ? (
|
79
79
|
""
|
@@ -83,7 +83,7 @@ const DropdownTrigger = (props: DropdownTriggerProps) => {
|
|
83
83
|
"Select..."
|
84
84
|
);
|
85
85
|
|
86
|
-
const defaultDisplayPlaceholder = selected
|
86
|
+
const defaultDisplayPlaceholder = selected.label
|
87
87
|
? selected.label
|
88
88
|
: autocomplete
|
89
89
|
? ""
|
@@ -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:
|
101
|
-
height:
|
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(
|
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
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
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
|
-
|
165
|
-
@include
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
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
|
-
|
179
|
-
|
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
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
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("
|
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("
|
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("
|
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("
|
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 },
|
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
|
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 ? "
|
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
|
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=
|
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
|
84
|
+
className={`pb_multiple_users_stacked_item third_item${quadrupleBubble ? " quadruple_bubble" : ""}`}
|
91
85
|
dark={dark}
|
92
86
|
key={index}
|
93
|
-
size="
|
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
|
100
|
+
className="pb_multiple_users_stacked_item fourth_item"
|
107
101
|
dark={dark}
|
108
102
|
key={index}
|
109
|
-
size="
|
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'
|