playbook_ui 14.3.2.pre.alpha.pbntr523enablekitsforradiofix3809 → 14.3.2.pre.alpha.play1472newicons3773
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/Components/SortIconButton.tsx +23 -4
- data/app/pb_kits/playbook/pb_contact/_contact.tsx +17 -5
- data/app/pb_kits/playbook/pb_contact/contact.html.erb +14 -6
- data/app/pb_kits/playbook/pb_contact/contact.rb +4 -0
- data/app/pb_kits/playbook/pb_contact/contact.test.js +1 -1
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +4 -3
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +1 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +4 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +6 -3
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb +1 -1
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_flatpickr_styles.scss +3 -2
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_header_styles.scss +6 -2
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +23 -245
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_form_pill/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +1 -1
- data/app/pb_kits/playbook/pb_map/_map_controls.tsx +7 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -5
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +0 -4
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +21 -97
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.test.js +0 -166
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +6 -45
- 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 +2 -6
- data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb +1 -21
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +10 -2
- data/app/pb_kits/playbook/pb_radio/_radio.tsx +33 -92
- data/app/pb_kits/playbook/pb_radio/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_radio/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_radio/radio.html.erb +13 -35
- data/app/pb_kits/playbook/pb_radio/radio.rb +1 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +12 -5
- data/app/pb_kits/playbook/pb_select/_select.tsx +5 -2
- data/app/pb_kits/playbook/pb_select/select.html.erb +1 -1
- data/app/pb_kits/playbook/pb_select/select.rb +4 -0
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +0 -16
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +0 -4
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +18 -26
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +0 -4
- data/app/pb_kits/playbook/tokens/_colors.scss +0 -2
- data/app/pb_kits/playbook/utilities/icons/allicons.tsx +123 -0
- data/app/pb_kits/playbook/utilities/icons/angle-down.svg +3 -0
- data/app/pb_kits/playbook/utilities/icons/envelope.svg +3 -0
- data/dist/chunks/_typeahead-C7opsM-6.js +22 -0
- data/dist/chunks/_weekday_stacked-Bhq2bj8p.js +45 -0
- data/dist/chunks/lib-ACUFk6Hu.js +29 -0
- data/dist/chunks/{pb_form_validation-zV9OpdSt.js → pb_form_validation-CA0nEXlG.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +8 -23
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.html.erb +0 -117
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.jsx +0 -227
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color.html.erb +0 -72
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color.jsx +0 -91
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color_rails.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color_react.md +0 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_bubble.html.erb +0 -73
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_bubble.jsx +0 -86
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.html.erb +0 -48
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +0 -59
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.md +0 -1
- data/app/pb_kits/playbook/pb_radio/index.js +0 -17
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color.html.erb +0 -31
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color.jsx +0 -26
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color_rails.md +0 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color_react.md +0 -1
- data/dist/chunks/_typeahead-468tQVei.js +0 -22
- data/dist/chunks/_weekday_stacked-CODev76A.js +0 -45
- data/dist/chunks/lib-D2U4I1U6.js +0 -16
@@ -2,6 +2,7 @@ import React from "react";
|
|
2
2
|
import Button from "../pb_button/_button";
|
3
3
|
import Icon from "../pb_icon/_icon";
|
4
4
|
import Flex from "../pb_flex/_flex";
|
5
|
+
import { getAllIcons } from "../utilities/icons/allicons"
|
5
6
|
|
6
7
|
type MapControlTypes = {
|
7
8
|
zoomBtns?: boolean,
|
@@ -12,6 +13,8 @@ type MapControlTypes = {
|
|
12
13
|
children?: React.ReactNode | React.ReactNode[]
|
13
14
|
}
|
14
15
|
|
16
|
+
const eyeIcon = getAllIcons()["eye"]
|
17
|
+
|
15
18
|
const MapControls = ({
|
16
19
|
zoomBtns,
|
17
20
|
zoomInClick,
|
@@ -42,7 +45,10 @@ const MapControls = ({
|
|
42
45
|
<Button className="map-flyto-button"
|
43
46
|
onClick={flyToClick}
|
44
47
|
>
|
45
|
-
<Icon
|
48
|
+
<Icon
|
49
|
+
className="svg-inline--fa"
|
50
|
+
customIcon={eyeIcon.icon as unknown as { [key: string]: SVGElement }}
|
51
|
+
/>
|
46
52
|
</Button>
|
47
53
|
) : null}
|
48
54
|
</>
|
@@ -34,7 +34,6 @@ type MultiLevelSelectProps = {
|
|
34
34
|
onSelect?: (prop: { [key: string]: any }) => void
|
35
35
|
selectedIds?: string[]
|
36
36
|
variant?: "multi" | "single"
|
37
|
-
pillColor?: "primary" | "neutral" | "success" | "warning" | "error" | "info" | "data_1" | "data_2" | "data_3" | "data_4" | "data_5" | "data_6" | "data_7" | "data_8" | "windows" | "siding" | "roofing" | "doors" | "gutters" | "solar" | "insulation" | "accessories",
|
38
37
|
} & GlobalProps
|
39
38
|
|
40
39
|
const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
@@ -51,8 +50,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
51
50
|
treeData,
|
52
51
|
onSelect = () => null,
|
53
52
|
selectedIds,
|
54
|
-
variant = "multi"
|
55
|
-
pillColor = "primary"
|
53
|
+
variant = "multi"
|
56
54
|
} = props
|
57
55
|
|
58
56
|
const ariaProps = buildAriaProps(aria)
|
@@ -469,7 +467,6 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
469
467
|
inputDisplay === "pills"
|
470
468
|
? returnedArray.map((item, index) => (
|
471
469
|
<FormPill
|
472
|
-
color={pillColor}
|
473
470
|
key={index}
|
474
471
|
onClick={(event: any) => handlePillClose(event, item)}
|
475
472
|
text={item.label}
|
@@ -482,7 +479,6 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
482
479
|
inputDisplay === "pills"
|
483
480
|
? defaultReturn.map((item, index) => (
|
484
481
|
<FormPill
|
485
|
-
color={pillColor}
|
486
482
|
key={index}
|
487
483
|
onClick={(event: any) => handlePillClose(event, item)}
|
488
484
|
text={item.label}
|
@@ -6,7 +6,6 @@ examples:
|
|
6
6
|
- multi_level_select_return_all_selected: Return All Selected
|
7
7
|
- multi_level_select_selected_ids: Selected Ids
|
8
8
|
- multi_level_select_with_form: With Form
|
9
|
-
- multi_level_select_color: With Pills (Custom Color)
|
10
9
|
|
11
10
|
react:
|
12
11
|
- multi_level_select_default: Default
|
@@ -14,4 +13,3 @@ examples:
|
|
14
13
|
- multi_level_select_single_children_only: Single Select w/ Hidden Radios
|
15
14
|
- multi_level_select_return_all_selected: Return All Selected
|
16
15
|
- multi_level_select_selected_ids_react: Selected Ids
|
17
|
-
- multi_level_select_color: With Pills (Custom Color)
|
@@ -3,4 +3,3 @@ export { default as MultiLevelSelectSingle } from './_multi_level_select_single.
|
|
3
3
|
export { default as MultiLevelSelectSingleChildrenOnly } from './_multi_level_select_single_children_only.jsx'
|
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
|
-
export { default as MultiLevelSelectColor } from './_multi_level_select_color.jsx'
|
@@ -19,9 +19,6 @@ module Playbook
|
|
19
19
|
prop :variant, type: Playbook::Props::Enum,
|
20
20
|
values: %w[multi single],
|
21
21
|
default: "multi"
|
22
|
-
prop :pill_color, type: Playbook::Props::Enum,
|
23
|
-
values: %w[primary neutral success warning error info data_1 data_2 data_3 data_4 data_5 data_6 data_7 data_8 windows siding roofing doors gutters solar insulation accessories],
|
24
|
-
default: "primary"
|
25
22
|
|
26
23
|
def classname
|
27
24
|
generate_classname("pb_multi_level_select")
|
@@ -37,7 +34,6 @@ module Playbook
|
|
37
34
|
selectedIds: selected_ids,
|
38
35
|
input_name: input_name,
|
39
36
|
variant: variant,
|
40
|
-
pillColor: pill_color,
|
41
37
|
}
|
42
38
|
end
|
43
39
|
end
|
@@ -3,25 +3,8 @@
|
|
3
3
|
@import "../tokens/opacity";
|
4
4
|
@import "../pb_avatar/avatar";
|
5
5
|
|
6
|
-
@mixin avatar-size($size) {
|
7
|
-
height: $size;
|
8
|
-
width: $size;
|
9
|
-
.avatar_wrapper {
|
10
|
-
width: $size;
|
11
|
-
height: $size;
|
12
|
-
}
|
13
|
-
}
|
14
|
-
|
15
|
-
@mixin position($position) {
|
16
|
-
position: absolute;
|
17
|
-
@each $pos, $val in $position {
|
18
|
-
#{$pos}: $val;
|
19
|
-
}
|
20
|
-
}
|
21
|
-
|
22
6
|
[class^=pb_multiple_users_stacked_kit] {
|
23
7
|
$container_size: map-get($avatar-sizes, "xs");
|
24
|
-
$bubble_container_size: map-get($avatar-sizes, "sm");
|
25
8
|
$overlap: -15px;
|
26
9
|
$border_size: 1px;
|
27
10
|
$stacked_size: 18px;
|
@@ -34,24 +17,34 @@
|
|
34
17
|
flex-shrink: 0;
|
35
18
|
flex-grow: 0;
|
36
19
|
[class^=pb_avatar_kit].pb_multiple_users_stacked_item {
|
37
|
-
|
38
|
-
|
20
|
+
height: $stacked_size;
|
21
|
+
width: $stacked_size;
|
22
|
+
&.dark {
|
23
|
+
.avatar_wrapper {
|
24
|
+
border: $pb_multiple_users_border_size solid $bg_dark;
|
25
|
+
}
|
26
|
+
}
|
39
27
|
.avatar_wrapper {
|
40
|
-
border: $border_size solid $
|
28
|
+
border: $border_size solid $white;
|
29
|
+
height: $stacked_size;
|
30
|
+
width: $stacked_size;
|
31
|
+
img {
|
32
|
+
z-index: 0;
|
33
|
+
}
|
41
34
|
}
|
42
35
|
}
|
36
|
+
&[class*=_single] .pb_multiple_users_stacked_item {
|
37
|
+
width: $container_size;
|
38
|
+
height: $container_size;
|
43
39
|
.avatar_wrapper {
|
44
|
-
|
45
|
-
|
46
|
-
z-index: 0;
|
47
|
-
}
|
40
|
+
width: $container_size;
|
41
|
+
height: $container_size;
|
48
42
|
}
|
49
43
|
}
|
50
|
-
&[class*=_single] .pb_multiple_users_stacked_item {
|
51
|
-
@include avatar-size($container_size);
|
52
|
-
}
|
53
44
|
[class^=pb_avatar_kit].second_item, [class^=pb_badge_kit].second_item {
|
54
|
-
|
45
|
+
position: absolute;
|
46
|
+
bottom: 0;
|
47
|
+
right: 0;
|
55
48
|
z-index: 2;
|
56
49
|
background: tint($primary, 90%);
|
57
50
|
border-radius: $border_rad_mega;
|
@@ -70,73 +63,4 @@
|
|
70
63
|
font-size: 0;
|
71
64
|
color: transparent;
|
72
65
|
}
|
73
|
-
|
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);
|
99
|
-
}
|
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));
|
113
|
-
}
|
114
|
-
|
115
|
-
&.quadruple_bubble {
|
116
|
-
@include position((bottom: 9px, right: 4px));
|
117
|
-
}
|
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));
|
126
|
-
}
|
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);
|
140
|
-
}
|
141
|
-
}
|
142
66
|
}
|
@@ -58,170 +58,4 @@ test('should pass aria prop', () => {
|
|
58
58
|
render(<MultipleUsersStackedDefault />)
|
59
59
|
const kit = screen.getByTestId(testId)
|
60
60
|
expect(kit).toHaveAttribute('aria-label', testId)
|
61
|
-
})
|
62
|
-
|
63
|
-
const MultipleUsersStackedSingleBubble = () => {
|
64
|
-
return (
|
65
|
-
<MultipleUsersStacked
|
66
|
-
aria={{ label: testId }}
|
67
|
-
className={className}
|
68
|
-
data={{ testid: testId }}
|
69
|
-
users={[
|
70
|
-
{
|
71
|
-
name: "user1",
|
72
|
-
imageUrl: "imageUser1",
|
73
|
-
imageAlt: "nameUser1",
|
74
|
-
}
|
75
|
-
]}
|
76
|
-
variant="bubble"
|
77
|
-
/>
|
78
|
-
)
|
79
|
-
}
|
80
|
-
|
81
|
-
test('should have a single bubble', () => {
|
82
|
-
render(<MultipleUsersStackedSingleBubble />)
|
83
|
-
const kit = screen.getByTestId(testId)
|
84
|
-
expect(kit).toHaveClass("pb_multiple_users_stacked_kit_single_bubble")
|
85
|
-
|
86
|
-
const firstItem = kit.querySelector('.first_item');
|
87
|
-
expect(firstItem).toBeInTheDocument();
|
88
|
-
})
|
89
|
-
|
90
|
-
const MultipleUsersStackedDoubleBubble = () => {
|
91
|
-
return (
|
92
|
-
<MultipleUsersStacked
|
93
|
-
aria={{ label: testId }}
|
94
|
-
className={className}
|
95
|
-
data={{ testid: testId }}
|
96
|
-
users={[
|
97
|
-
{
|
98
|
-
name: "user1",
|
99
|
-
imageUrl: "imageUser1",
|
100
|
-
imageAlt: "nameUser1",
|
101
|
-
},
|
102
|
-
{
|
103
|
-
name: "user2",
|
104
|
-
imageUrl: "imageUser2",
|
105
|
-
imageAlt: "nameUser2",
|
106
|
-
},
|
107
|
-
]}
|
108
|
-
variant="bubble"
|
109
|
-
/>
|
110
|
-
)
|
111
|
-
}
|
112
|
-
|
113
|
-
test('should have a double bubble', () => {
|
114
|
-
render(<MultipleUsersStackedDoubleBubble />)
|
115
|
-
const kit = screen.getByTestId(testId)
|
116
|
-
expect(kit).toHaveClass("pb_multiple_users_stacked_kit_bubble")
|
117
|
-
|
118
|
-
const firstItem = kit.querySelector('.first_item');
|
119
|
-
expect(firstItem).toBeInTheDocument();
|
120
|
-
|
121
|
-
const secondItem = kit.querySelector('.second_item');
|
122
|
-
expect(secondItem).toBeInTheDocument();
|
123
|
-
})
|
124
|
-
|
125
|
-
const MultipleUsersStackedTripleBubble = () => {
|
126
|
-
return (
|
127
|
-
<MultipleUsersStacked
|
128
|
-
aria={{ label: testId }}
|
129
|
-
className={className}
|
130
|
-
data={{ testid: testId }}
|
131
|
-
users={[
|
132
|
-
{
|
133
|
-
name: "user1",
|
134
|
-
imageUrl: "imageUser1",
|
135
|
-
imageAlt: "nameUser1",
|
136
|
-
},
|
137
|
-
{
|
138
|
-
name: "user2",
|
139
|
-
imageUrl: "imageUser2",
|
140
|
-
imageAlt: "nameUser2",
|
141
|
-
},
|
142
|
-
{
|
143
|
-
name: "user3",
|
144
|
-
imageUrl: "imageUser3",
|
145
|
-
imageAlt: "nameUser3",
|
146
|
-
},
|
147
|
-
]}
|
148
|
-
variant="bubble"
|
149
|
-
/>
|
150
|
-
)
|
151
|
-
}
|
152
|
-
|
153
|
-
test('should have a triple bubble', () => {
|
154
|
-
render(<MultipleUsersStackedTripleBubble />)
|
155
|
-
const kit = screen.getByTestId(testId)
|
156
|
-
expect(kit).toHaveClass("pb_multiple_users_stacked_kit_bubble")
|
157
|
-
|
158
|
-
const firstItem = kit.querySelector('.first_item');
|
159
|
-
expect(firstItem).toBeInTheDocument();
|
160
|
-
expect(firstItem).toHaveClass("triple_bubble")
|
161
|
-
|
162
|
-
const secondItem = kit.querySelector('.second_item');
|
163
|
-
expect(secondItem).toBeInTheDocument();
|
164
|
-
expect(secondItem).toHaveClass("triple_bubble")
|
165
|
-
|
166
|
-
const thirdItem = kit.querySelector('.third_item');
|
167
|
-
expect(thirdItem).toBeInTheDocument();
|
168
|
-
})
|
169
|
-
|
170
|
-
const MultipleUsersStackedQuadrupleBubble = () => {
|
171
|
-
return (
|
172
|
-
<MultipleUsersStacked
|
173
|
-
aria={{ label: testId }}
|
174
|
-
className={className}
|
175
|
-
data={{ testid: testId }}
|
176
|
-
users={[
|
177
|
-
{
|
178
|
-
name: "user1",
|
179
|
-
imageUrl: "imageUser1",
|
180
|
-
imageAlt: "nameUser1",
|
181
|
-
},
|
182
|
-
{
|
183
|
-
name: "user2",
|
184
|
-
imageUrl: "imageUser2",
|
185
|
-
imageAlt: "nameUser2",
|
186
|
-
},
|
187
|
-
{
|
188
|
-
name: "user3",
|
189
|
-
imageUrl: "imageUser3",
|
190
|
-
imageAlt: "nameUser3",
|
191
|
-
},
|
192
|
-
{
|
193
|
-
name: "user4",
|
194
|
-
imageUrl: "imageUser4",
|
195
|
-
imageAlt: "nameUser4",
|
196
|
-
},
|
197
|
-
{
|
198
|
-
name: "user5",
|
199
|
-
imageUrl: "imageUser5",
|
200
|
-
imageAlt: "nameUser5",
|
201
|
-
},
|
202
|
-
]}
|
203
|
-
variant="bubble"
|
204
|
-
/>
|
205
|
-
)
|
206
|
-
}
|
207
|
-
|
208
|
-
test('should have a quadruple bubble', () => {
|
209
|
-
render(<MultipleUsersStackedQuadrupleBubble />)
|
210
|
-
const kit = screen.getByTestId(testId)
|
211
|
-
expect(kit).toHaveClass("pb_multiple_users_stacked_kit_bubble")
|
212
|
-
|
213
|
-
const firstItem = kit.querySelector('.first_item');
|
214
|
-
expect(firstItem).toBeInTheDocument();
|
215
|
-
expect(firstItem).toHaveClass("quadruple_bubble")
|
216
|
-
|
217
|
-
const secondItem = kit.querySelector('.second_item');
|
218
|
-
expect(secondItem).toBeInTheDocument();
|
219
|
-
expect(secondItem).toHaveClass("quadruple_bubble")
|
220
|
-
|
221
|
-
const thirdItem = kit.querySelector('.third_item');
|
222
|
-
expect(thirdItem).toBeInTheDocument();
|
223
|
-
expect(thirdItem).toHaveClass("quadruple_bubble")
|
224
|
-
|
225
|
-
const fourthItem = kit.querySelector('.fourth_item');
|
226
|
-
expect(fourthItem).toBeInTheDocument();
|
227
61
|
})
|
@@ -15,7 +15,6 @@ type MultipleUsersStackedProps = {
|
|
15
15
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
16
16
|
id?: string,
|
17
17
|
users: Array<{ [key: string]: string }>,
|
18
|
-
variant: "default" | "bubble",
|
19
18
|
}
|
20
19
|
|
21
20
|
const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
|
@@ -27,14 +26,10 @@ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
|
|
27
26
|
htmlOptions = {},
|
28
27
|
id,
|
29
28
|
users,
|
30
|
-
variant = "default",
|
31
29
|
} = props
|
32
30
|
|
33
31
|
const moreThanTwo = users.length > 2
|
34
32
|
const onlyOne = users.length == 1
|
35
|
-
const isBubble = variant === "bubble"
|
36
|
-
const tripleBubble = isBubble && users.length === 3
|
37
|
-
const quadrupleBubble = isBubble && users.length > 3
|
38
33
|
const displayCount = () => {
|
39
34
|
return moreThanTwo ? 1 : users.length
|
40
35
|
}
|
@@ -43,61 +38,29 @@ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
|
|
43
38
|
const htmlProps = buildHtmlProps(htmlOptions)
|
44
39
|
const classes = classnames(buildCss(
|
45
40
|
'pb_multiple_users_stacked_kit',
|
46
|
-
{ single: onlyOne
|
41
|
+
{ single: onlyOne }), globalProps(props), className)
|
47
42
|
|
48
43
|
const firstUser = () => {
|
49
44
|
return users.slice(0, 1).map((userObject, index) => {
|
50
45
|
return (
|
51
46
|
<Avatar
|
52
47
|
{...userObject}
|
53
|
-
className=
|
48
|
+
className="pb_multiple_users_stacked_item"
|
54
49
|
dark={dark}
|
55
50
|
key={index}
|
56
|
-
size=
|
51
|
+
size="xs"
|
57
52
|
/>
|
58
53
|
)
|
59
54
|
})
|
60
55
|
}
|
61
56
|
|
62
57
|
const secondUser = () => {
|
63
|
-
if (
|
58
|
+
if (moreThanTwo === false) {
|
64
59
|
return users.slice(1, 2).map((userObject, index) => {
|
65
60
|
return (
|
66
61
|
<Avatar
|
67
62
|
{...userObject}
|
68
|
-
className=
|
69
|
-
dark={dark}
|
70
|
-
key={index}
|
71
|
-
size="xs"
|
72
|
-
/>
|
73
|
-
)
|
74
|
-
})
|
75
|
-
}
|
76
|
-
}
|
77
|
-
|
78
|
-
const thirdUser = () => {
|
79
|
-
if (isBubble && users.length > 2) {
|
80
|
-
return users.slice(2, 3).map((userObject, index) => {
|
81
|
-
return (
|
82
|
-
<Avatar
|
83
|
-
{...userObject}
|
84
|
-
className={`pb_multiple_users_stacked_item third_item${quadrupleBubble ? " quadruple_bubble" : ""}`}
|
85
|
-
dark={dark}
|
86
|
-
key={index}
|
87
|
-
size="xs"
|
88
|
-
/>
|
89
|
-
)
|
90
|
-
})
|
91
|
-
}
|
92
|
-
}
|
93
|
-
|
94
|
-
const fourthUser = () => {
|
95
|
-
if (isBubble && users.length > 3) {
|
96
|
-
return users.slice(3, 4).map((userObject, index) => {
|
97
|
-
return (
|
98
|
-
<Avatar
|
99
|
-
{...userObject}
|
100
|
-
className="pb_multiple_users_stacked_item fourth_item"
|
63
|
+
className="pb_multiple_users_stacked_item second_item"
|
101
64
|
dark={dark}
|
102
65
|
key={index}
|
103
66
|
size="xs"
|
@@ -108,7 +71,7 @@ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
|
|
108
71
|
}
|
109
72
|
|
110
73
|
const plusUsers = () => {
|
111
|
-
if (moreThanTwo
|
74
|
+
if (moreThanTwo === true) {
|
112
75
|
return (
|
113
76
|
<Badge
|
114
77
|
className="pb_multiple_users_stacked_item second_item"
|
@@ -131,8 +94,6 @@ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
|
|
131
94
|
>
|
132
95
|
{firstUser()}
|
133
96
|
{secondUser()}
|
134
|
-
{thirdUser()}
|
135
|
-
{fourthUser()}
|
136
97
|
{plusUsers()}
|
137
98
|
</div>
|
138
99
|
)
|
@@ -2,12 +2,10 @@ examples:
|
|
2
2
|
|
3
3
|
rails:
|
4
4
|
- multiple_users_stacked_default: Default
|
5
|
-
- multiple_users_stacked_bubble: Bubble
|
6
5
|
|
7
6
|
|
8
7
|
react:
|
9
8
|
- multiple_users_stacked_default: Default
|
10
|
-
- multiple_users_stacked_bubble: Bubble
|
11
9
|
|
12
10
|
swift:
|
13
11
|
- multiple_users_stacked_default_swift: Default
|
@@ -1,18 +1,14 @@
|
|
1
1
|
<%= pb_content_tag do %>
|
2
|
-
<%= pb_rails("avatar", props: object.users[0].merge({size:
|
2
|
+
<%= pb_rails("avatar", props: object.users[0].merge({size: "xs", classname: "pb_multiple_users_stacked_item", dark: object.dark}) ) %>
|
3
3
|
|
4
4
|
<% unless object.only_one %>
|
5
|
-
<% if object.more_than_two
|
5
|
+
<% if object.more_than_two %>
|
6
6
|
<%= pb_rails("badge", props: {
|
7
7
|
dark: object.dark,
|
8
8
|
text: "+#{object.users.count - object.display_count}",
|
9
9
|
variant: "primary",
|
10
10
|
rounded: true,
|
11
11
|
classname: "pb_multiple_users_stacked_item second_item" }) %>
|
12
|
-
<% elsif object.bubble %>
|
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}) ) %>
|
15
|
-
<% end %>
|
16
12
|
<% else %>
|
17
13
|
<%= pb_rails("avatar", props: object.users[1].merge({size: "xs", classname: "pb_multiple_users_stacked_item second_item", dark: object.dark}) ) %>
|
18
14
|
<% end %>
|
@@ -5,10 +5,6 @@ module Playbook
|
|
5
5
|
class MultipleUsersStacked < Playbook::KitBase
|
6
6
|
prop :users, type: Playbook::Props::HashArray, required: true
|
7
7
|
|
8
|
-
prop :variant, type: Playbook::Props::Enum,
|
9
|
-
values: %w[default bubble],
|
10
|
-
default: "default"
|
11
|
-
|
12
8
|
def more_than_two
|
13
9
|
users.count > 2
|
14
10
|
end
|
@@ -21,20 +17,8 @@ module Playbook
|
|
21
17
|
more_than_two ? 1 : users.count
|
22
18
|
end
|
23
19
|
|
24
|
-
def bubble
|
25
|
-
variant == "bubble"
|
26
|
-
end
|
27
|
-
|
28
|
-
def triple_bubble
|
29
|
-
bubble && users.count === 3
|
30
|
-
end
|
31
|
-
|
32
|
-
def quadruple_bubble
|
33
|
-
bubble && users.count > 3
|
34
|
-
end
|
35
|
-
|
36
20
|
def classname
|
37
|
-
generate_classname("pb_multiple_users_stacked_kit", single_class
|
21
|
+
generate_classname("pb_multiple_users_stacked_kit", single_class)
|
38
22
|
end
|
39
23
|
|
40
24
|
private
|
@@ -42,10 +26,6 @@ module Playbook
|
|
42
26
|
def single_class
|
43
27
|
only_one ? "single" : nil
|
44
28
|
end
|
45
|
-
|
46
|
-
def bubble_class
|
47
|
-
bubble ? "bubble" : nil
|
48
|
-
end
|
49
29
|
end
|
50
30
|
end
|
51
31
|
end
|
@@ -12,6 +12,7 @@ import Icon from '../pb_icon/_icon'
|
|
12
12
|
import PbReactPopover from '../pb_popover/_popover'
|
13
13
|
import TextInput from '../pb_text_input/_text_input'
|
14
14
|
import { GenericObject } from "../types"
|
15
|
+
import { getAllIcons } from "../utilities/icons/allicons"
|
15
16
|
|
16
17
|
type PassphraseProps = {
|
17
18
|
aria?: { [key: string]: string },
|
@@ -96,6 +97,9 @@ const Passphrase = (props: PassphraseProps): React.ReactElement => {
|
|
96
97
|
/>
|
97
98
|
)
|
98
99
|
|
100
|
+
const shieldIcon = getAllIcons()["shieldCheck"]
|
101
|
+
const eyeIcon = getAllIcons()["eye"]
|
102
|
+
|
99
103
|
return (
|
100
104
|
<div
|
101
105
|
{...ariaProps}
|
@@ -135,7 +139,8 @@ const Passphrase = (props: PassphraseProps): React.ReactElement => {
|
|
135
139
|
size="xs"
|
136
140
|
>
|
137
141
|
<Icon
|
138
|
-
|
142
|
+
className="svg-inline--fa"
|
143
|
+
customIcon={shieldIcon.icon as unknown as { [key: string]: SVGElement }}
|
139
144
|
marginRight="xs"
|
140
145
|
/>
|
141
146
|
{tip}
|
@@ -173,7 +178,10 @@ const Passphrase = (props: PassphraseProps): React.ReactElement => {
|
|
173
178
|
color="light"
|
174
179
|
dark={dark}
|
175
180
|
>
|
176
|
-
|
181
|
+
<Icon
|
182
|
+
className="svg-inline--fa"
|
183
|
+
customIcon={eyeIcon.icon as unknown as { [key: string]: SVGElement }}
|
184
|
+
/>
|
177
185
|
</Body>
|
178
186
|
</span>
|
179
187
|
</div>
|