playbook_ui 12.30.1.pre.alpha.play846responsivespacingglobalpropsneedsdefault924 → 12.31.0.pre.alpha.customiconsfa928
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/_playbook.scss +2 -0
- data/app/pb_kits/playbook/custom-icons.js +355 -0
- data/app/pb_kits/playbook/index.js +2 -1
- data/app/pb_kits/playbook/pb_badge/_badge.scss +5 -0
- data/app/pb_kits/playbook/pb_badge/_badge.tsx +1 -1
- data/app/pb_kits/playbook/pb_badge/badge.rb +1 -1
- data/app/pb_kits/playbook/pb_badge/badge.test.js +13 -0
- data/app/pb_kits/playbook/pb_badge/docs/_badge_notification.html.erb +12 -0
- data/app/pb_kits/playbook/pb_badge/docs/_badge_notification.jsx +25 -0
- data/app/pb_kits/playbook/pb_badge/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_badge/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_hover.jsx +40 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_button/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_card/_card.scss +0 -3
- data/app/pb_kits/playbook/pb_card/_card.tsx +6 -5
- data/app/pb_kits/playbook/pb_card/card.html.erb +3 -1
- data/app/pb_kits/playbook/pb_card/card.rb +96 -0
- data/app/pb_kits/playbook/pb_card/card_body.rb +1 -93
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.scss +0 -11
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +3 -1
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +3 -1
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +3 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/_dialog.scss +0 -12
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.tsx +2 -2
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +4 -1
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +2 -1
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +9 -3
- data/app/pb_kits/playbook/pb_icon/icon.rb +8 -2
- data/app/pb_kits/playbook/pb_message/docs/_message_default.jsx +33 -45
- data/app/pb_kits/playbook/pb_message/docs/_message_hover.jsx +41 -0
- data/app/pb_kits/playbook/pb_message/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_message/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_helper_functions.tsx +4 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +8 -3
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_selected_ids.html.erb +76 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_selected_ids.jsx +88 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_selected_ids.md +5 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +3 -0
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +7 -0
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +12 -7
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.html.erb +14 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.jsx +30 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.md +3 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_dashed.html.erb +1 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_dashed.jsx +13 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text.html.erb +1 -1
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text.jsx +1 -1
- data/app/pb_kits/playbook/pb_section_separator/docs/example.yml +6 -3
- data/app/pb_kits/playbook/pb_section_separator/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +4 -2
- data/app/pb_kits/playbook/pb_section_separator/section_separator.rb +4 -1
- data/app/pb_kits/playbook/pb_title/_title.scss +18 -0
- data/app/pb_kits/playbook/pb_title/_title.tsx +20 -2
- data/app/pb_kits/playbook/pb_title/docs/_title_responsive.html.erb +1 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_responsive.jsx +16 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_responsive.md +1 -0
- data/app/pb_kits/playbook/pb_title/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_title/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_title/title.rb +21 -4
- data/app/pb_kits/playbook/pb_title/title.test.js +42 -29
- data/app/pb_kits/playbook/tokens/_scale.scss +9 -0
- data/app/pb_kits/playbook/tokens/exports/_scale.scss +13 -0
- data/app/pb_kits/playbook/utilities/_border_radius.scss +31 -0
- data/app/pb_kits/playbook/utilities/_colors.scss +3 -0
- data/app/pb_kits/playbook/utilities/_hover.scss +47 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +22 -2
- data/dist/playbook-rails.js +7 -7
- data/lib/playbook/version.rb +2 -2
- metadata +22 -2
@@ -28,6 +28,102 @@ module Playbook
|
|
28
28
|
highlight_color_class)
|
29
29
|
end
|
30
30
|
|
31
|
+
def body_padding
|
32
|
+
if padding.present?
|
33
|
+
""
|
34
|
+
else
|
35
|
+
"p_md"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def body_flex_direction
|
40
|
+
if flex_direction.present?
|
41
|
+
"flex_direction_#{flex_direction}"
|
42
|
+
else
|
43
|
+
""
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def body_flex_wrap
|
48
|
+
if flex_wrap.present?
|
49
|
+
"flex_wrap_#{flex_wrap}"
|
50
|
+
else
|
51
|
+
""
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def body_justify_content
|
56
|
+
if justify_content.present?
|
57
|
+
"justify_content_#{justify_content}"
|
58
|
+
else
|
59
|
+
""
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def body_justify_self
|
64
|
+
if justify_self.present?
|
65
|
+
"justify_self_#{justify_self}"
|
66
|
+
else
|
67
|
+
""
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def body_align_items
|
72
|
+
if align_items.present?
|
73
|
+
"align_items_#{align_items}"
|
74
|
+
else
|
75
|
+
""
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def body_align_content
|
80
|
+
if align_content.present?
|
81
|
+
"align_content_#{align_content}"
|
82
|
+
else
|
83
|
+
""
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def body_align_self
|
88
|
+
if align_self.present?
|
89
|
+
"align_self_#{align_self}"
|
90
|
+
else
|
91
|
+
""
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def body_flex
|
96
|
+
if flex.present?
|
97
|
+
"flex_#{flex}"
|
98
|
+
else
|
99
|
+
""
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def body_flex_grow
|
104
|
+
if flex_grow.present?
|
105
|
+
"flex_grow_#{flex_grow}"
|
106
|
+
else
|
107
|
+
""
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
def body_flex_shrink
|
112
|
+
if flex_shrink.present?
|
113
|
+
"flex_shrink_#{flex_shrink}"
|
114
|
+
else
|
115
|
+
""
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
def body_order
|
120
|
+
if order.present?
|
121
|
+
"order_#{order}"
|
122
|
+
else
|
123
|
+
""
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
31
127
|
private
|
32
128
|
|
33
129
|
def selected_class
|
@@ -4,99 +4,7 @@ module Playbook
|
|
4
4
|
module PbCard
|
5
5
|
class CardBody < Playbook::KitBase
|
6
6
|
def classname
|
7
|
-
generate_classname("pb_card_body_kit", flex_direction, justify_content, flex_wrap, justify_self, align_items, align_content, align_self, flex, flex_grow, flex_shrink, order, separator: " ")
|
8
|
-
end
|
9
|
-
|
10
|
-
def body_padding
|
11
|
-
"" if padding.present?
|
12
|
-
end
|
13
|
-
|
14
|
-
def body_flex_direction
|
15
|
-
if flex_direction.present?
|
16
|
-
"flex_direction_#{flex_direction}"
|
17
|
-
else
|
18
|
-
""
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def body_flex_wrap
|
23
|
-
if flex_wrap.present?
|
24
|
-
"flex_wrap_#{flex_wrap}"
|
25
|
-
else
|
26
|
-
""
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def body_justify_content
|
31
|
-
if justify_content.present?
|
32
|
-
"justify_content_#{justify_content}"
|
33
|
-
else
|
34
|
-
""
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def body_justify_self
|
39
|
-
if justify_self.present?
|
40
|
-
"justify_self_#{justify_self}"
|
41
|
-
else
|
42
|
-
""
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def body_align_items
|
47
|
-
if align_items.present?
|
48
|
-
"align_items_#{align_items}"
|
49
|
-
else
|
50
|
-
""
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def body_align_content
|
55
|
-
if align_content.present?
|
56
|
-
"align_content_#{align_content}"
|
57
|
-
else
|
58
|
-
""
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def body_align_self
|
63
|
-
if align_self.present?
|
64
|
-
"align_self_#{align_self}"
|
65
|
-
else
|
66
|
-
""
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
def body_flex
|
71
|
-
if flex.present?
|
72
|
-
"flex_#{flex}"
|
73
|
-
else
|
74
|
-
""
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
def body_flex_grow
|
79
|
-
if flex_grow.present?
|
80
|
-
"flex_grow_#{flex_grow}"
|
81
|
-
else
|
82
|
-
""
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
def body_flex_shrink
|
87
|
-
if flex_shrink.present?
|
88
|
-
"flex_shrink_#{flex_shrink}"
|
89
|
-
else
|
90
|
-
""
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
def body_order
|
95
|
-
if order.present?
|
96
|
-
"order_#{order}"
|
97
|
-
else
|
98
|
-
""
|
99
|
-
end
|
7
|
+
generate_classname("pb_card_body_kit", padding, flex_direction, justify_content, flex_wrap, justify_self, align_items, align_content, align_self, flex, flex_grow, flex_shrink, order, separator: " ")
|
100
8
|
end
|
101
9
|
end
|
102
10
|
end
|
@@ -1,9 +1,6 @@
|
|
1
1
|
@import "./tokens/colors";
|
2
|
-
@import "./tokens/spacing";
|
3
2
|
|
4
3
|
[class^=pb_collapsible_kit] {
|
5
|
-
padding: $space_md;
|
6
|
-
|
7
4
|
.toggle-content {
|
8
5
|
display: none;
|
9
6
|
height: 0;
|
@@ -21,11 +18,3 @@
|
|
21
18
|
color: $primary
|
22
19
|
}
|
23
20
|
}
|
24
|
-
|
25
|
-
[class^=pb_collapsible_main_kit] {
|
26
|
-
padding: $space_md;
|
27
|
-
}
|
28
|
-
|
29
|
-
[class^=pb_collapsible_content_kit] {
|
30
|
-
padding: $space_md;
|
31
|
-
}
|
@@ -19,6 +19,7 @@ type CollapsibleProps = {
|
|
19
19
|
iconColor?: 'default' | 'light' | 'lighter' | 'link' | 'error' | 'success',
|
20
20
|
iconSize?: typeof IconSizes
|
21
21
|
id?: string,
|
22
|
+
padding?: string,
|
22
23
|
}
|
23
24
|
|
24
25
|
const useCollapsible = (initial = false) => {
|
@@ -39,6 +40,7 @@ const Collapsible = ({
|
|
39
40
|
iconColor = 'default',
|
40
41
|
iconSize,
|
41
42
|
id,
|
43
|
+
padding = 'md',
|
42
44
|
...props
|
43
45
|
}: CollapsibleProps) => {
|
44
46
|
const [isCollapsed, collapse] = useCollapsible(collapsed)
|
@@ -57,7 +59,7 @@ const Collapsible = ({
|
|
57
59
|
const dataProps = buildDataProps(data)
|
58
60
|
const classes = classnames(
|
59
61
|
buildCss('pb_collapsible_kit'),
|
60
|
-
globalProps(props),
|
62
|
+
globalProps(props, { padding }),
|
61
63
|
className
|
62
64
|
)
|
63
65
|
|
@@ -9,16 +9,18 @@ import CollapsibleContext from '../context'
|
|
9
9
|
export type CollapsibleContentProps = {
|
10
10
|
children?: React.ReactNode[] | React.ReactNode | string,
|
11
11
|
className?: string,
|
12
|
+
padding?: string,
|
12
13
|
}
|
13
14
|
|
14
15
|
const CollapsibleContent = ({
|
15
16
|
children,
|
16
17
|
className,
|
18
|
+
padding = 'md',
|
17
19
|
...props
|
18
20
|
}: CollapsibleContentProps) => {
|
19
21
|
const context: {[key: string]: boolean | string} = useContext(CollapsibleContext)
|
20
22
|
const contentCSS = buildCss('pb_collapsible_content_kit')
|
21
|
-
const contentSpacing = globalProps(props)
|
23
|
+
const contentSpacing = globalProps(props, { padding })
|
22
24
|
|
23
25
|
return (
|
24
26
|
<AnimateHeight
|
@@ -31,6 +31,7 @@ const colorMap = {
|
|
31
31
|
type CollapsibleMainProps = {
|
32
32
|
children: React.ReactNode[] | React.ReactNode,
|
33
33
|
className?: string,
|
34
|
+
padding?: string,
|
34
35
|
cursor?: string,
|
35
36
|
|
36
37
|
}
|
@@ -62,11 +63,12 @@ const CollapsibleMain = ({
|
|
62
63
|
children,
|
63
64
|
className,
|
64
65
|
cursor = 'pointer',
|
66
|
+
padding = 'md',
|
65
67
|
...props
|
66
68
|
}: CollapsibleMainProps): React.ReactElement=> {
|
67
69
|
const context: {[key: string]: IconColors | (() => void)} | boolean = useContext(CollapsibleContext)
|
68
70
|
const mainCSS = buildCss('pb_collapsible_main_kit')
|
69
|
-
const mainSpacing = globalProps(props, { cursor })
|
71
|
+
const mainSpacing = globalProps(props, { cursor, padding })
|
70
72
|
|
71
73
|
return (
|
72
74
|
<div className={classnames(mainCSS, className, mainSpacing)}>
|
@@ -263,18 +263,6 @@
|
|
263
263
|
}
|
264
264
|
}
|
265
265
|
|
266
|
-
[class*="dialog_body"] {
|
267
|
-
padding: $space_sm;
|
268
|
-
}
|
269
|
-
|
270
|
-
[class*="dialog_header"] {
|
271
|
-
padding: $space_sm;
|
272
|
-
}
|
273
|
-
|
274
|
-
[class*="dialog_footer"] {
|
275
|
-
padding: $space_sm;
|
276
|
-
}
|
277
|
-
|
278
266
|
//styles specific to rails version of kit
|
279
267
|
// rails version has own wrapper because of the way the overlay functions for the HTML dialog used to create this
|
280
268
|
.pb_dialog_wrapper_rails {
|
@@ -11,9 +11,9 @@ type DialogBodyProps = {
|
|
11
11
|
|
12
12
|
// Body component
|
13
13
|
const DialogBody = (props: DialogBodyProps) => {
|
14
|
-
const { children, className } = props
|
14
|
+
const { children, padding = "sm", className } = props
|
15
15
|
const bodyCSS = buildCss("dialog_body")
|
16
|
-
const bodySpacing = globalProps(props)
|
16
|
+
const bodySpacing = globalProps(props, { padding })
|
17
17
|
|
18
18
|
return (
|
19
19
|
<div className={classnames(bodyCSS, bodySpacing, className)}>
|
@@ -25,13 +25,16 @@ type DialogFooterProps = {
|
|
25
25
|
const DialogFooter = (props: DialogFooterProps) => {
|
26
26
|
const {
|
27
27
|
children,
|
28
|
+
padding = "sm",
|
29
|
+
paddingBottom = "sm",
|
30
|
+
paddingX = "sm",
|
28
31
|
className,
|
29
32
|
spacing = "between",
|
30
33
|
separator = false,
|
31
34
|
} = props
|
32
35
|
|
33
36
|
const footerCSS = buildCss("dialog_footer")
|
34
|
-
const footerSpacing = globalProps(props)
|
37
|
+
const footerSpacing = globalProps(props, { padding, paddingBottom, paddingX })
|
35
38
|
|
36
39
|
return (
|
37
40
|
<>
|
@@ -28,6 +28,7 @@ const DialogHeader = (props: DialogHeaderProps) => {
|
|
28
28
|
children,
|
29
29
|
className,
|
30
30
|
data = {},
|
31
|
+
padding = "sm",
|
31
32
|
spacing = "between",
|
32
33
|
closeable = true,
|
33
34
|
separator = true,
|
@@ -37,7 +38,7 @@ const DialogHeader = (props: DialogHeaderProps) => {
|
|
37
38
|
const dataProps = buildDataProps(data)
|
38
39
|
const api = useContext(DialogContext)
|
39
40
|
const headerCSS = buildCss("dialog_header")
|
40
|
-
const headerSpacing = globalProps(props)
|
41
|
+
const headerSpacing = globalProps(props, { padding })
|
41
42
|
|
42
43
|
/* eslint-disable react/jsx-handler-names */
|
43
44
|
|
@@ -34,7 +34,7 @@ type IconProps = {
|
|
34
34
|
pulse?: boolean,
|
35
35
|
rotation?: 90 | 180 | 270,
|
36
36
|
size?: IconSizes,
|
37
|
-
fontStyle?: 'far' | 'fas' | 'fab',
|
37
|
+
fontStyle?: 'far' | 'fas' | 'fab' | 'fak',
|
38
38
|
spin?: boolean,
|
39
39
|
} & GlobalProps
|
40
40
|
|
@@ -76,6 +76,7 @@ const Icon = (props: IconProps) => {
|
|
76
76
|
[`fa-${size}`]: size,
|
77
77
|
[`fa-pull-${pull}`]: pull,
|
78
78
|
[`fa-rotate-${rotation}`]: rotation,
|
79
|
+
|
79
80
|
}
|
80
81
|
|
81
82
|
// Lets check and see if the icon prop is referring to a custom Power icon...
|
@@ -83,11 +84,15 @@ const Icon = (props: IconProps) => {
|
|
83
84
|
// this ensures the JS will not do any further operations
|
84
85
|
// faClasses[`fa-${icon}`] = customIcon ? 'custom' : icon
|
85
86
|
if (!customIcon) faClasses[`fa-${icon}`] = icon
|
86
|
-
|
87
|
+
|
88
|
+
const whiteList = [
|
89
|
+
'greensky', 'powergon'
|
90
|
+
]
|
91
|
+
|
87
92
|
const classes = classnames(
|
88
93
|
flipMap[flip],
|
89
94
|
'pb_icon_kit',
|
90
|
-
customIcon ? '' : fontStyle,
|
95
|
+
customIcon ? '' : whiteList.includes(icon) ? `fak` : fontStyle,
|
91
96
|
faClasses,
|
92
97
|
globalProps(props),
|
93
98
|
className
|
@@ -110,6 +115,7 @@ const Icon = (props: IconProps) => {
|
|
110
115
|
return emojiRegex.test(emoji);
|
111
116
|
};
|
112
117
|
|
118
|
+
|
113
119
|
// Add a conditional here to show only the SVG if custom
|
114
120
|
const displaySVG = (customIcon: any) => {
|
115
121
|
if (customIcon)
|
@@ -33,7 +33,7 @@ module Playbook
|
|
33
33
|
values: ["lg", "xs", "sm", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x", nil],
|
34
34
|
default: nil
|
35
35
|
prop :font_style, type: Playbook::Props::Enum,
|
36
|
-
values: %w[far fas fab],
|
36
|
+
values: %w[far fas fab fak],
|
37
37
|
default: "far"
|
38
38
|
prop :spin, type: Playbook::Props::Boolean,
|
39
39
|
default: false
|
@@ -140,7 +140,13 @@ module Playbook
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def font_style_class
|
143
|
-
|
143
|
+
white_list = %w[powergon greensky]
|
144
|
+
|
145
|
+
if white_list.include?(icon)
|
146
|
+
"fak"
|
147
|
+
elsif font_style
|
148
|
+
font_style.to_s
|
149
|
+
end
|
144
150
|
end
|
145
151
|
|
146
152
|
def spin_class
|
@@ -1,43 +1,33 @@
|
|
1
|
-
import React from
|
1
|
+
import React from "react"
|
2
2
|
|
3
|
-
import Message from
|
4
|
-
import Image from
|
3
|
+
import Message from "../_message"
|
4
|
+
import Image from "../../pb_image/_image"
|
5
5
|
|
6
6
|
const MessageDefault = (props) => {
|
7
7
|
return (
|
8
8
|
<div>
|
9
9
|
<Message
|
10
|
-
avatarName=
|
11
|
-
avatarStatus=
|
12
|
-
avatarUrl=
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
avatarName='Mike Bishop'
|
11
|
+
avatarStatus='online'
|
12
|
+
avatarUrl='https://randomuser.me/api/portraits/men/50.jpg'
|
13
|
+
borderRadius='rounded'
|
14
|
+
label='Anna Black'
|
15
|
+
message='How can we assist you today?'
|
16
|
+
timestamp='20 seconds ago'
|
16
17
|
{...props}
|
17
18
|
/>
|
18
19
|
|
19
20
|
<br />
|
20
21
|
<br />
|
21
|
-
|
22
|
-
<Message
|
23
|
-
alignTimestamp="left"
|
24
|
-
avatarName="Wade Winningham"
|
25
|
-
avatarUrl="https://randomuser.me/api/portraits/men/14.jpg"
|
26
|
-
label="Patrick Welch"
|
27
|
-
message="We will escalate this issue to a Senior Support agent."
|
28
|
-
timestamp="9 minutes ago"
|
29
|
-
{...props}
|
30
|
-
/>
|
31
|
-
|
32
22
|
<br />
|
33
23
|
<br />
|
34
24
|
|
35
25
|
<Message
|
36
|
-
avatarName=
|
37
|
-
avatarUrl=
|
38
|
-
label=
|
39
|
-
message=
|
40
|
-
timestamp=
|
26
|
+
avatarName='Becca Jacobs'
|
27
|
+
avatarUrl='https://randomuser.me/api/portraits/women/50.jpg'
|
28
|
+
label='Lucille Sanchez'
|
29
|
+
message='Application for Kate Smith is waiting for your approval'
|
30
|
+
timestamp='2 days ago'
|
41
31
|
{...props}
|
42
32
|
/>
|
43
33
|
|
@@ -45,10 +35,10 @@ const MessageDefault = (props) => {
|
|
45
35
|
<br />
|
46
36
|
|
47
37
|
<Message
|
48
|
-
avatarName=
|
49
|
-
label=
|
50
|
-
message=
|
51
|
-
timestamp=
|
38
|
+
avatarName='Timothy Wenhold'
|
39
|
+
label='Beverly Reyes'
|
40
|
+
message='We are so sorry you had a bad experience!'
|
41
|
+
timestamp='2 days ago'
|
52
42
|
{...props}
|
53
43
|
/>
|
54
44
|
|
@@ -56,24 +46,23 @@ const MessageDefault = (props) => {
|
|
56
46
|
<br />
|
57
47
|
|
58
48
|
<Message
|
59
|
-
label=
|
60
|
-
message=
|
61
|
-
timestamp=
|
49
|
+
label='Keith Craig'
|
50
|
+
message='Please hold for one moment, I will check with my manager.'
|
51
|
+
timestamp='2 days ago'
|
62
52
|
{...props}
|
63
53
|
/>
|
64
54
|
|
65
55
|
<br />
|
66
56
|
<br />
|
67
57
|
|
68
|
-
<Message
|
69
|
-
|
70
|
-
timestamp="2 days ago"
|
58
|
+
<Message label='Keith Craig'
|
59
|
+
timestamp='2 days ago'
|
71
60
|
{...props}
|
72
61
|
>
|
73
62
|
<Image
|
74
|
-
alt=
|
75
|
-
size=
|
76
|
-
url=
|
63
|
+
alt='picture of a misty forest'
|
64
|
+
size='md'
|
65
|
+
url='https://unsplash.it/500/400/?image=634'
|
77
66
|
/>
|
78
67
|
</Message>
|
79
68
|
|
@@ -81,18 +70,17 @@ const MessageDefault = (props) => {
|
|
81
70
|
<br />
|
82
71
|
|
83
72
|
<Message
|
84
|
-
label=
|
85
|
-
message=
|
86
|
-
timestamp=
|
73
|
+
label='Keith Craig'
|
74
|
+
message='Please hold for one moment, I will check with my manager.'
|
75
|
+
timestamp='2 days ago'
|
87
76
|
{...props}
|
88
77
|
>
|
89
78
|
<Image
|
90
|
-
alt=
|
91
|
-
size=
|
92
|
-
url=
|
79
|
+
alt='picture of a misty forest'
|
80
|
+
size='md'
|
81
|
+
url='https://unsplash.it/500/400/?image=634'
|
93
82
|
/>
|
94
83
|
</Message>
|
95
|
-
|
96
84
|
</div>
|
97
85
|
)
|
98
86
|
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import React from "react"
|
2
|
+
|
3
|
+
import Message from "../_message"
|
4
|
+
|
5
|
+
const MessageHover = (props) => {
|
6
|
+
return (
|
7
|
+
<div>
|
8
|
+
<Message
|
9
|
+
avatarName='Mike Bishop'
|
10
|
+
avatarStatus='online'
|
11
|
+
avatarUrl='https://randomuser.me/api/portraits/men/50.jpg'
|
12
|
+
borderRadius='rounded'
|
13
|
+
hover={{ background: "success_subtle" }}
|
14
|
+
label='Anna Black'
|
15
|
+
message='How can we assist you today?'
|
16
|
+
padding="xs"
|
17
|
+
{...props}
|
18
|
+
/>
|
19
|
+
|
20
|
+
<br />
|
21
|
+
<br />
|
22
|
+
<br />
|
23
|
+
|
24
|
+
<Message
|
25
|
+
avatarName='Becca Jacobs'
|
26
|
+
avatarUrl='https://randomuser.me/api/portraits/women/50.jpg'
|
27
|
+
borderRadius='rounded'
|
28
|
+
hover={{ shadow: "deepest" }}
|
29
|
+
label='Lucille Sanchez'
|
30
|
+
message='Application for Kate Smith is waiting for your approval'
|
31
|
+
padding="xs"
|
32
|
+
{...props}
|
33
|
+
/>
|
34
|
+
|
35
|
+
<br />
|
36
|
+
|
37
|
+
</div>
|
38
|
+
)
|
39
|
+
}
|
40
|
+
|
41
|
+
export default MessageHover
|
@@ -135,7 +135,7 @@ export const recursiveCheckParent = (
|
|
135
135
|
return data;
|
136
136
|
};
|
137
137
|
|
138
|
-
export const getExpandedItems = (treeData: { [key: string]: string }[]) => {
|
138
|
+
export const getExpandedItems = (treeData: { [key: string]: string }[], selectedIds: string[]) => {
|
139
139
|
let expandedItems: any[] = [];
|
140
140
|
|
141
141
|
const traverse = (items: string | any[], ancestors: any[] = []) => {
|
@@ -146,6 +146,9 @@ export const getExpandedItems = (treeData: { [key: string]: string }[]) => {
|
|
146
146
|
if (item.expanded) {
|
147
147
|
expandedItems.push(item.id);
|
148
148
|
}
|
149
|
+
if (selectedIds && selectedIds.length && selectedIds.includes(item.id)) {
|
150
|
+
expandedItems.push(...itemAncestors.map((ancestor) => ancestor.id));
|
151
|
+
}
|
149
152
|
if (Array.isArray(item.children)) {
|
150
153
|
const hasCheckedChildren = item.children.some(
|
151
154
|
(child: { [key: string]: string }) => child.checked
|