playbook_ui 13.16.0.pre.alpha.nodejsupgrade2036 → 13.16.0.pre.alpha.play1141iconkitusinglibrary1993
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/_reset.scss +2 -2
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.scss +2 -2
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_flatpickr_styles.scss +1 -1
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +29 -17
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.html.erb +5 -11
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.jsx +44 -18
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.md +7 -12
- data/app/pb_kits/playbook/pb_icon/icon.html.erb +6 -4
- data/app/pb_kits/playbook/pb_icon/icon.rb +10 -10
- data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +1 -2
- data/app/pb_kits/playbook/pb_layout/layout.test.js +4 -8
- data/app/pb_kits/playbook/pb_legend/_legend.tsx +6 -6
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Slides.tsx +4 -4
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnail.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/Carousel/index.tsx +3 -3
- data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +22 -30
- data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +5 -5
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +4 -4
- data/app/pb_kits/playbook/pb_list/_list.tsx +15 -15
- data/app/pb_kits/playbook/pb_list/_list_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +9 -9
- data/app/pb_kits/playbook/pb_map/_map.tsx +8 -8
- data/app/pb_kits/playbook/pb_map/_map_controls.tsx +7 -15
- data/app/pb_kits/playbook/pb_map/_map_custom_button.tsx +2 -4
- data/app/pb_kits/playbook/pb_message/_message.tsx +1 -1
- data/app/pb_kits/playbook/pb_message/_message_mention.tsx +6 -6
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +42 -46
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +20 -20
- data/app/pb_kits/playbook/pb_nav/_item.tsx +47 -56
- data/app/pb_kits/playbook/pb_nav/_nav.tsx +15 -15
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +1 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +2 -4
- data/dist/playbook-rails.js +6 -14
- data/dist/reset.css +2 -1
- data/lib/playbook/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bc3dd349d844e27e7f58519da152f82f91f5e3bff1127a68334b50ca0cc4ce6
|
4
|
+
data.tar.gz: 492f133650dfbe9d1a6bd971f3dc2d70df83d65d93e3c23ffdbf5efb2f58d0df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f21ae991fb51fe768b44ff0f743473e7e1ceed79aed2bf3a5d191ed5cbfc60e04a32dc8ea49ee203f953e7b197646d054d72bd6e1641ea7eeb0ce69c4de14f1
|
7
|
+
data.tar.gz: 921c84a3cb9c9a50db38257f481ff0a7ccd6bbb88753a0ba384a82b8e3d079debb7d540cd816d549f1ea028c64ed13bb031faf2cde8a95495e8bec45ebba8881
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from 'react'
|
1
|
+
import React, { ReactSVGElement } from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
3
|
import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
|
4
4
|
import { GlobalProps, globalProps } from '../utilities/globalProps'
|
@@ -27,7 +27,7 @@ type IconProps = {
|
|
27
27
|
data?: {[key: string]: string},
|
28
28
|
fixedWidth?: boolean,
|
29
29
|
flip?: "horizontal" | "vertical" | "both" | "none",
|
30
|
-
icon: string,
|
30
|
+
icon: string | ReactSVGElement,
|
31
31
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
32
32
|
id?: string,
|
33
33
|
inverse?: boolean,
|
@@ -57,7 +57,7 @@ const Icon = (props: IconProps) => {
|
|
57
57
|
fixedWidth = true,
|
58
58
|
flip = "none",
|
59
59
|
htmlOptions = {},
|
60
|
-
icon,
|
60
|
+
icon = "",
|
61
61
|
id,
|
62
62
|
inverse = false,
|
63
63
|
listItem = false,
|
@@ -69,9 +69,12 @@ const Icon = (props: IconProps) => {
|
|
69
69
|
spin = false,
|
70
70
|
} = props
|
71
71
|
|
72
|
+
const iconURL = typeof(icon) === 'string' && icon.includes('.svg') ? icon : null
|
73
|
+
const iconElement: ReactSVGElement | null = typeof(icon) === "object" ? icon : null
|
74
|
+
|
72
75
|
const faClasses = {
|
73
76
|
'fa-border': border,
|
74
|
-
'fa-fw': fixedWidth,
|
77
|
+
'fa-fw': (iconElement) ? false : fixedWidth,
|
75
78
|
'fa-inverse': inverse,
|
76
79
|
'fa-li': listItem,
|
77
80
|
'fa-pulse': pulse,
|
@@ -79,19 +82,16 @@ const Icon = (props: IconProps) => {
|
|
79
82
|
[`fa-${size}`]: size,
|
80
83
|
[`fa-pull-${pull}`]: pull,
|
81
84
|
[`fa-rotate-${rotation}`]: rotation,
|
82
|
-
|
83
85
|
}
|
84
86
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
if (!customIcon) faClasses[`fa-${icon}`] = icon
|
90
|
-
|
87
|
+
const isFA = !iconElement && !customIcon && !iconURL
|
88
|
+
|
89
|
+
if (isFA) faClasses[`fa-${icon}`] = icon as string
|
90
|
+
|
91
91
|
const classes = classnames(
|
92
92
|
flipMap[flip],
|
93
93
|
'pb_icon_kit',
|
94
|
-
customIcon ? '' : fontStyle,
|
94
|
+
(iconElement || customIcon) ? '' : fontStyle,
|
95
95
|
faClasses,
|
96
96
|
globalProps(props),
|
97
97
|
className
|
@@ -110,11 +110,11 @@ const Icon = (props: IconProps) => {
|
|
110
110
|
|
111
111
|
// Add a conditional here to show only the SVG if custom
|
112
112
|
const displaySVG = (customIcon: any) => {
|
113
|
-
if (customIcon)
|
113
|
+
if (iconElement || customIcon)
|
114
114
|
return (
|
115
115
|
<>
|
116
116
|
{
|
117
|
-
React.cloneElement(customIcon, {
|
117
|
+
React.cloneElement(iconElement || customIcon, {
|
118
118
|
...dataProps,
|
119
119
|
...htmlProps,
|
120
120
|
className: classes,
|
@@ -123,7 +123,7 @@ const Icon = (props: IconProps) => {
|
|
123
123
|
}
|
124
124
|
</>
|
125
125
|
)
|
126
|
-
else if (isValidEmoji(icon))
|
126
|
+
else if (isValidEmoji(icon as string))
|
127
127
|
return (
|
128
128
|
<>
|
129
129
|
<span
|
@@ -136,7 +136,19 @@ const Icon = (props: IconProps) => {
|
|
136
136
|
</span>
|
137
137
|
</>
|
138
138
|
)
|
139
|
-
|
139
|
+
else if (iconURL)
|
140
|
+
return (
|
141
|
+
<>
|
142
|
+
<span
|
143
|
+
{...dataProps}
|
144
|
+
{...htmlProps}
|
145
|
+
className={classesEmoji}
|
146
|
+
id={id}
|
147
|
+
>
|
148
|
+
<img src={iconURL} />
|
149
|
+
</span>
|
150
|
+
</>
|
151
|
+
)
|
140
152
|
else
|
141
153
|
return (
|
142
154
|
<>
|
@@ -161,4 +173,4 @@ const Icon = (props: IconProps) => {
|
|
161
173
|
)
|
162
174
|
}
|
163
175
|
|
164
|
-
export default Icon
|
176
|
+
export default Icon
|
@@ -2,15 +2,9 @@
|
|
2
2
|
<div class="icon-wrapper">
|
3
3
|
|
4
4
|
<% svg_url = "https://upload.wikimedia.org/wikipedia/commons/3/3b/Wrench_font_awesome.svg" %>
|
5
|
-
<p><%= pb_rails("icon", props: {
|
6
|
-
<p><%= pb_rails("icon", props: { rotation: 90,
|
7
|
-
<p><%= pb_rails("icon", props: { spin: true,
|
8
|
-
<p><%= pb_rails("icon", props: { size: "5x",
|
9
|
-
<p><%= pb_rails("icon", props: { flip: "horizontal", size: "5x",
|
10
|
-
|
11
|
-
<%= pb_rails("body", props: {
|
12
|
-
text: "Custom icons are compatible with other icon props (size, rotation,
|
13
|
-
spin, flip, etc). Their SVG fill colors will be inherited from
|
14
|
-
parent element's css color properties."
|
15
|
-
} ) %>
|
5
|
+
<p><%= pb_rails("icon", props: { icon: svg_url } ) %></p>
|
6
|
+
<p><%= pb_rails("icon", props: { rotation: 90, icon: svg_url, size: "2x" } ) %></p>
|
7
|
+
<p><%= pb_rails("icon", props: { spin: true, icon: svg_url, size: "3x" } ) %></p>
|
8
|
+
<p><%= pb_rails("icon", props: { size: "5x", icon: svg_url } ) %></p>
|
9
|
+
<p><%= pb_rails("icon", props: { flip: "horizontal", size: "5x", icon: svg_url } ) %></p>
|
16
10
|
</div>
|
@@ -1,33 +1,59 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { Icon } from '../../'
|
3
3
|
|
4
|
-
// import Icons as config from 'power-icons'
|
5
4
|
const config = {
|
6
|
-
|
7
|
-
<svg
|
8
|
-
ariaHidden="true"
|
9
|
-
focusable="false"
|
10
|
-
role="img"
|
11
|
-
viewBox="0 0 512 512"
|
5
|
+
icon: (
|
6
|
+
<svg viewBox="0 -256 1792 1792"
|
12
7
|
xmlns="http://www.w3.org/2000/svg"
|
13
8
|
>
|
14
|
-
<
|
15
|
-
d="
|
16
|
-
|
17
|
-
/>
|
9
|
+
<g transform="matrix(1,0,0,-1,53.152542,1217.0847)">
|
10
|
+
<path d="m 384,64 q 0,26 -19,45 -19,19 -45,19 -26,0 -45,-19 -19,-19 -19,-45 0,-26 19,-45 19,-19 45,-19 26,0 45,19 19,19 19,45 z m 644,420 -682,-682 q -37,-37 -90,-37 -52,0 -91,37 L 59,-90 Q 21,-54 21,0 21,53 59,91 L 740,772 Q 779,674 854.5,598.5 930,523 1028,484 z m 634,435 q 0,-39 -23,-106 Q 1592,679 1474.5,595.5 1357,512 1216,512 1031,512 899.5,643.5 768,775 768,960 q 0,185 131.5,316.5 131.5,131.5 316.5,131.5 58,0 121.5,-16.5 63.5,-16.5 107.5,-46.5 16,-11 16,-28 0,-17 -16,-28 L 1152,1120 V 896 l 193,-107 q 5,3 79,48.5 74,45.5 135.5,81 61.5,35.5 70.5,35.5 15,0 23.5,-10 8.5,-10 8.5,-25 z" />
|
11
|
+
</g>
|
18
12
|
</svg>
|
19
13
|
),
|
20
14
|
}
|
21
15
|
|
22
16
|
const IconCustom = (props) => {
|
23
17
|
return (
|
24
|
-
<
|
25
|
-
<
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
18
|
+
<React.Fragment>
|
19
|
+
<p>
|
20
|
+
<Icon
|
21
|
+
icon={config.icon}
|
22
|
+
{...props}
|
23
|
+
/>
|
24
|
+
</p>
|
25
|
+
<p>
|
26
|
+
<Icon
|
27
|
+
icon={config.icon}
|
28
|
+
rotation={90}
|
29
|
+
size="2x"
|
30
|
+
{...props}
|
31
|
+
/>
|
32
|
+
</p>
|
33
|
+
<p>
|
34
|
+
<Icon
|
35
|
+
icon={config.icon}
|
36
|
+
size="3x"
|
37
|
+
spin
|
38
|
+
{...props}
|
39
|
+
/>
|
40
|
+
</p>
|
41
|
+
<p>
|
42
|
+
<Icon
|
43
|
+
icon={config.icon}
|
44
|
+
size="5x"
|
45
|
+
{...props}
|
46
|
+
/>
|
47
|
+
</p>
|
48
|
+
<p>
|
49
|
+
<Icon
|
50
|
+
flip="horizontal"
|
51
|
+
icon={config.icon}
|
52
|
+
size="5x"
|
53
|
+
{...props}
|
54
|
+
/>
|
55
|
+
</p>
|
56
|
+
</React.Fragment>
|
31
57
|
)
|
32
58
|
}
|
33
59
|
|
@@ -1,19 +1,14 @@
|
|
1
1
|
# Tips for Custom Icons
|
2
2
|
|
3
|
-
When using custom icons it is important to introduce a "clean" SVG. In order to ensure these custom icons perform as intended within your kit(s), ensure these things have been modified from the original SVG markup:
|
4
|
-
|
5
|
-
Attributes must be React compatible e.g. <code>xmlns:xlink</code> should be <code>xmlnsXlink</code> and so on. <strong>There should be no hyphenated attributes and no semi-colons!.</strong>
|
6
|
-
|
7
|
-
Fill colors with regards to <code>g</code> or <code>path</code> nodes, e.g. <code>fill="black"</code>, should be replaced with <code>currentColor</code> ala <code>fill="currentColor"</code>. Your mileage may vary depending on the complexity of your SVG.
|
8
|
-
|
9
|
-
Pay attention to your custom icon's dimensions and `viewBox` attribute. It is best to use a `viewBox="0 0 512 512"` starting point __when designing instead of trying to retrofit the viewbox afterwards__!
|
10
|
-
|
11
|
-
You must source *your own SVG into component/view* you are working on. This can easily be done in programmatic and maintainable ways.
|
12
|
-
|
13
3
|
### React
|
14
4
|
|
15
|
-
|
5
|
+
- Providing a valid React `<SVG>` element to the `icon` prop results in an `<SVG>` node within the working view.
|
6
|
+
- Sending the absolute path to your SVG (e.g. `/my/path/to/icon.svg`) results in an `img` node with the `src` attribute set to the provided path:
|
7
|
+
|
8
|
+
```html
|
9
|
+
<img src="host.com/my/path/to/icon.svg" />
|
10
|
+
```
|
16
11
|
|
17
12
|
### Rails
|
18
13
|
|
19
|
-
|
14
|
+
Sending the absolute path to the `icon` prop results in an `<SVG>` tag within the working view.
|
@@ -1,7 +1,9 @@
|
|
1
|
-
<% if object.
|
2
|
-
<%= object.render_svg
|
3
|
-
<% elsif object.valid_emoji
|
4
|
-
<span class="pb_icon_kit_emoji"
|
1
|
+
<% if object.is_svg? %>
|
2
|
+
<%= object.render_svg %>
|
3
|
+
<% elsif object.valid_emoji? %>
|
4
|
+
<span class="pb_icon_kit_emoji">
|
5
|
+
<%= object.icon.html_safe %>
|
6
|
+
</span>
|
5
7
|
<% else %>
|
6
8
|
<%= content_tag(:i, nil,
|
7
9
|
id: object.id,
|
@@ -38,7 +38,7 @@ module Playbook
|
|
38
38
|
prop :spin, type: Playbook::Props::Boolean,
|
39
39
|
default: false
|
40
40
|
|
41
|
-
def valid_emoji
|
41
|
+
def valid_emoji?
|
42
42
|
emoji_regex = /\p{Emoji}/
|
43
43
|
emoji_regex.match?(icon)
|
44
44
|
end
|
@@ -79,15 +79,15 @@ module Playbook
|
|
79
79
|
)
|
80
80
|
end
|
81
81
|
|
82
|
-
def render_svg
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
82
|
+
def render_svg
|
83
|
+
doc = Nokogiri::XML(URI.open(icon || custom_icon)) # rubocop:disable Security/Open
|
84
|
+
svg = doc.at_css "svg"
|
85
|
+
svg["class"] = "pb_custom_icon " + object.custom_icon_classname
|
86
|
+
raw doc
|
87
|
+
end
|
88
|
+
|
89
|
+
def is_svg?
|
90
|
+
(icon || custom_icon).include?(".svg")
|
91
91
|
end
|
92
92
|
|
93
93
|
private
|
@@ -15,7 +15,7 @@ type LabelValueProps = {
|
|
15
15
|
aria?: { [key: string]: string };
|
16
16
|
className?: string;
|
17
17
|
dark?: boolean;
|
18
|
-
data?:
|
18
|
+
data?: object;
|
19
19
|
date?: Date;
|
20
20
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
21
21
|
id?: string;
|
@@ -10,7 +10,7 @@ type LayoutPropTypes = {
|
|
10
10
|
className?: string,
|
11
11
|
collapse?: "xs" | "sm" | "md" | "lg" | "xl",
|
12
12
|
dark?: boolean,
|
13
|
-
data?:
|
13
|
+
data?: object,
|
14
14
|
full?: boolean,
|
15
15
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
16
16
|
position?: "left" | "right",
|
@@ -168,7 +168,6 @@ const Layout = (props: LayoutPropTypes) => {
|
|
168
168
|
layoutCss,
|
169
169
|
layoutCollapseCss,
|
170
170
|
className,
|
171
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
172
171
|
//@ts-ignore
|
173
172
|
globalProps(filteredProps)
|
174
173
|
)}
|
@@ -16,8 +16,7 @@ test("render all color variants", () => {
|
|
16
16
|
testValues.forEach((variant) => {
|
17
17
|
const { getByTestId } = render(
|
18
18
|
<LayoutTest data={{ testid: `test-${variant}` }}
|
19
|
-
variant={variant}
|
20
|
-
/>
|
19
|
+
variant={variant} />
|
21
20
|
)
|
22
21
|
expect(getByTestId(`test-${variant}`)).toHaveClass(
|
23
22
|
`pb_layout_kit_sidebar_size_md_left_${
|
@@ -34,8 +33,7 @@ test("render transparent class", () => {
|
|
34
33
|
|
35
34
|
const { getByTestId } = render(
|
36
35
|
<LayoutTest data={{ testid: `test-${id}` }}
|
37
|
-
variant={id}
|
38
|
-
/>
|
36
|
+
variant={id} />
|
39
37
|
)
|
40
38
|
expect(getByTestId(`test-${id}`)).toHaveClass(
|
41
39
|
`pb_layout_kit_sidebar_size_md_left_${id}`
|
@@ -49,8 +47,7 @@ test("render all sizes variants", () => {
|
|
49
47
|
testValues.forEach((size) => {
|
50
48
|
const { getByTestId } = render(
|
51
49
|
<LayoutTest data={{ testid: `test-${size}` }}
|
52
|
-
size={size}
|
53
|
-
/>
|
50
|
+
size={size} />
|
54
51
|
)
|
55
52
|
expect(getByTestId(`test-${size}`)).toHaveClass(
|
56
53
|
`pb_layout_kit_sidebar_size_${size}_left_light`
|
@@ -87,8 +84,7 @@ test("render all layout variants", () => {
|
|
87
84
|
testValues.forEach(({ layout, expected }) => {
|
88
85
|
const { getByTestId } = render(
|
89
86
|
<Layout data={{ testid: `test-${layout}` }}
|
90
|
-
layout={layout}
|
91
|
-
>
|
87
|
+
layout={layout}>
|
92
88
|
<Layout.Body>
|
93
89
|
<Card>{"Card content"}</Card>
|
94
90
|
</Layout.Body>
|
@@ -12,7 +12,7 @@ type LegendProps = {
|
|
12
12
|
className?: string,
|
13
13
|
color?: string,
|
14
14
|
dark?: boolean,
|
15
|
-
data?:
|
15
|
+
data?: object,
|
16
16
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
17
17
|
id?: string,
|
18
18
|
prefixText?: string,
|
@@ -64,11 +64,11 @@ const Legend = (props: LegendProps) => {
|
|
64
64
|
{
|
65
65
|
prefixText && (
|
66
66
|
<Title
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
67
|
+
dark={dark}
|
68
|
+
size={4}
|
69
|
+
tag="span"
|
70
|
+
text={` ${prefixText} `}
|
71
|
+
/>
|
72
72
|
)
|
73
73
|
}
|
74
74
|
{` ${text} `}
|
@@ -56,15 +56,15 @@ const arrowRight = () => setIndex(current < urls.length - 1 ? current + 1 : urls
|
|
56
56
|
return (
|
57
57
|
<div
|
58
58
|
className="Slides"
|
59
|
-
|
59
|
+
onTouchStart={onTouchStart}
|
60
60
|
onTouchMove={onTouchMove}
|
61
|
-
|
61
|
+
onTouchEnd={onTouchEnd}
|
62
62
|
>
|
63
63
|
{
|
64
64
|
urls.length > 1 && (
|
65
65
|
<CircleIconButton
|
66
66
|
className='carousel-arrow-left'
|
67
|
-
dark
|
67
|
+
dark={true}
|
68
68
|
icon="chevron-left"
|
69
69
|
onClick={arrowLeft}
|
70
70
|
variant="link"
|
@@ -81,7 +81,7 @@ const arrowRight = () => setIndex(current < urls.length - 1 ? current + 1 : urls
|
|
81
81
|
urls.length > 1 && (
|
82
82
|
<CircleIconButton
|
83
83
|
className='carousel-arrow-right'
|
84
|
-
dark
|
84
|
+
dark={true}
|
85
85
|
icon="chevron-right"
|
86
86
|
onClick={arrowRight}
|
87
87
|
variant="link"
|
@@ -20,8 +20,8 @@ type CarouselType = {
|
|
20
20
|
export default function Carousel({
|
21
21
|
currentIndex,
|
22
22
|
photos,
|
23
|
-
onClick,
|
24
|
-
onChange = ()
|
23
|
+
onClick = ()=>{},
|
24
|
+
onChange = ()=>{},
|
25
25
|
setIndex,
|
26
26
|
}: CarouselType): React.ReactElement {
|
27
27
|
useEffect(() => {
|
@@ -39,10 +39,10 @@ export default function Carousel({
|
|
39
39
|
return (
|
40
40
|
<div className="Lightbox">
|
41
41
|
<Slides
|
42
|
+
setIndex={setIndex}
|
42
43
|
current={currentIndex}
|
43
44
|
onChange={handleChange}
|
44
45
|
onClick={onClick}
|
45
|
-
setIndex={setIndex}
|
46
46
|
urls={photos.map((photo) => photo.url)}
|
47
47
|
/>
|
48
48
|
{photos.length > 1 ? (
|
@@ -61,31 +61,23 @@ const LightboxHeader = (props: LightboxHeaderProps): React.ReactElement => {
|
|
61
61
|
|
62
62
|
const HeaderBody = () => (
|
63
63
|
<React.Fragment>
|
64
|
-
<FlexItem flex="1"
|
65
|
-
marginLeft="sm"
|
66
|
-
>
|
64
|
+
<FlexItem flex="1" marginLeft="sm">
|
67
65
|
<CircleIconButton
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
66
|
+
onClick={handleOnLightboxClose}
|
67
|
+
dark={true}
|
68
|
+
variant="link"
|
69
|
+
icon={icon}
|
72
70
|
/>
|
73
71
|
</FlexItem>
|
74
72
|
{title && text && (
|
75
73
|
<FlexItem flex="5">
|
76
74
|
<Flex justify="center">
|
77
|
-
<Flex align="center"
|
78
|
-
orientation="column"
|
79
|
-
>
|
75
|
+
<Flex align="center" orientation="column">
|
80
76
|
{typeof title === "string" ? (
|
81
|
-
<Title dark
|
82
|
-
paddingBottom="xxs"
|
83
|
-
size={4}
|
84
|
-
text={title}
|
85
|
-
/>
|
77
|
+
<Title dark paddingBottom="xxs" size={4} text={title} />
|
86
78
|
) : (
|
87
|
-
<Flex
|
88
|
-
|
79
|
+
<Flex justify="center"
|
80
|
+
className="custom-header"
|
89
81
|
>
|
90
82
|
{title}
|
91
83
|
</Flex>
|
@@ -94,8 +86,8 @@ const LightboxHeader = (props: LightboxHeaderProps): React.ReactElement => {
|
|
94
86
|
{typeof text === "string" ? (
|
95
87
|
<Caption dark>{text}</Caption>
|
96
88
|
) : (
|
97
|
-
<Flex
|
98
|
-
|
89
|
+
<Flex justify="center"
|
90
|
+
className="custom-header"
|
99
91
|
>
|
100
92
|
{text}
|
101
93
|
</Flex>
|
@@ -107,12 +99,12 @@ const LightboxHeader = (props: LightboxHeaderProps): React.ReactElement => {
|
|
107
99
|
<FlexItem flex="1">
|
108
100
|
<Flex justify="end">
|
109
101
|
<Button
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
102
|
+
className="nav-right-btn"
|
103
|
+
htmlType="button"
|
104
|
+
onClick={onClickRight}
|
105
|
+
dark
|
106
|
+
variant="link"
|
107
|
+
text={navRight}
|
116
108
|
/>
|
117
109
|
</Flex>
|
118
110
|
</FlexItem>
|
@@ -122,11 +114,11 @@ const LightboxHeader = (props: LightboxHeaderProps): React.ReactElement => {
|
|
122
114
|
return (
|
123
115
|
<div className="carousel-header">
|
124
116
|
<Flex
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
117
|
+
{...ariaProps}
|
118
|
+
{...dataProps}
|
119
|
+
{...htmlProps}
|
120
|
+
className={classnames(headerCSS, headerSpacing, className)}
|
121
|
+
spacing={spacing}
|
130
122
|
>
|
131
123
|
{closeable && <HeaderBody />}
|
132
124
|
{children}
|
@@ -19,7 +19,7 @@ type LightboxType = {
|
|
19
19
|
id?: string,
|
20
20
|
photos: [],
|
21
21
|
initialPhoto?: number,
|
22
|
-
onChange?: (index: number)=>
|
22
|
+
onChange?: (index: number)=> {},
|
23
23
|
onClickRight?: () => void,
|
24
24
|
onClose?: () => void,
|
25
25
|
icon: string,
|
@@ -40,7 +40,7 @@ const Lightbox = (props: LightboxType): React.ReactNode => {
|
|
40
40
|
id = '',
|
41
41
|
initialPhoto = 0,
|
42
42
|
photos,
|
43
|
-
onChange = ()
|
43
|
+
onChange = ()=>{},
|
44
44
|
onClose,
|
45
45
|
onClickRight,
|
46
46
|
icon = 'times',
|
@@ -107,18 +107,18 @@ const Lightbox = (props: LightboxType): React.ReactNode => {
|
|
107
107
|
<div className="carousel">
|
108
108
|
<Lightbox.Header
|
109
109
|
icon={icon}
|
110
|
-
navRight={navRight}
|
111
|
-
onClickRight={onClickRight}
|
112
110
|
onClose={onClose}
|
111
|
+
onClickRight={onClickRight}
|
113
112
|
text={description}
|
113
|
+
navRight={navRight}
|
114
114
|
title={title}
|
115
115
|
/>
|
116
116
|
{children}
|
117
117
|
<Carousel
|
118
|
+
setIndex={setActivePhoto}
|
118
119
|
currentIndex={activePhoto}
|
119
120
|
onChange={handleOnSlide}
|
120
121
|
photos={photosMap}
|
121
|
-
setIndex={setActivePhoto}
|
122
122
|
/>
|
123
123
|
</div>
|
124
124
|
</div>
|
@@ -12,7 +12,7 @@ import mapColors from "../pb_dashboard/pbChartsColorsHelper";
|
|
12
12
|
type LineGraphProps = {
|
13
13
|
align?: "left" | "right" | "center";
|
14
14
|
axisTitle?: string;
|
15
|
-
dark?:
|
15
|
+
dark?: Boolean;
|
16
16
|
xAxisCategories: [];
|
17
17
|
yAxisMin: number;
|
18
18
|
yAxisMax: number;
|
@@ -138,15 +138,15 @@ const LineGraph = ({
|
|
138
138
|
|
139
139
|
return (
|
140
140
|
<HighchartsReact
|
141
|
-
|
141
|
+
containerProps={{
|
142
142
|
className: classnames(globalProps(props), className),
|
143
143
|
id: id,
|
144
144
|
...ariaProps,
|
145
145
|
...dataProps,
|
146
146
|
...htmlProps
|
147
147
|
}}
|
148
|
-
|
149
|
-
|
148
|
+
highcharts={Highcharts}
|
149
|
+
options={options}
|
150
150
|
/>
|
151
151
|
);
|
152
152
|
};
|