playbook_ui 13.16.0.pre.alpha.PLAY11642006 → 13.16.0.pre.alpha.nodejsupgrade2036
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 +17 -29
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.html.erb +11 -5
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.jsx +18 -44
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.md +12 -7
- data/app/pb_kits/playbook/pb_icon/icon.html.erb +4 -6
- 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 +2 -1
- data/app/pb_kits/playbook/pb_layout/layout.test.js +8 -4
- 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 +30 -22
- 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 +15 -7
- data/app/pb_kits/playbook/pb_map/_map_custom_button.tsx +4 -2
- 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 +46 -42
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +20 -20
- data/app/pb_kits/playbook/pb_nav/_item.tsx +56 -47
- 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 +4 -2
- data/dist/playbook-rails.js +14 -6
- data/dist/reset.css +1 -2
- 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: f937c16ec89f7321ee4dd0cee5ea44d006a51dffd38c7c51c779a47bc2b82a48
|
4
|
+
data.tar.gz: 2894e6b6bfee6d6cd9df09dd175dfb6a224ee16fa92968a4fef9b3198f9e76ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6986c123c083160f78a96ca26d1cd503b2666495faef6db4ede8b53238437ee0d8b80f4054506644d78971ab454c41cc87d49bf3d3918e52cb5290a81bc6947
|
7
|
+
data.tar.gz: 2a273bcd342ae5bdb733b65cf4c087a46550009e50e96e52d382ba3e3c71a78b8928e8ba35e937ade8ccdead815fa9b53eacbbd60a8d977fd45695639559cc33
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React
|
1
|
+
import React 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,
|
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,12 +69,9 @@ 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
|
-
|
75
72
|
const faClasses = {
|
76
73
|
'fa-border': border,
|
77
|
-
'fa-fw':
|
74
|
+
'fa-fw': fixedWidth,
|
78
75
|
'fa-inverse': inverse,
|
79
76
|
'fa-li': listItem,
|
80
77
|
'fa-pulse': pulse,
|
@@ -82,16 +79,19 @@ const Icon = (props: IconProps) => {
|
|
82
79
|
[`fa-${size}`]: size,
|
83
80
|
[`fa-pull-${pull}`]: pull,
|
84
81
|
[`fa-rotate-${rotation}`]: rotation,
|
85
|
-
}
|
86
82
|
|
87
|
-
|
88
|
-
|
89
|
-
if (isFA) faClasses[`fa-${icon}`] = icon as string
|
83
|
+
}
|
90
84
|
|
85
|
+
// Lets check and see if the icon prop is referring to a custom Power icon...
|
86
|
+
// If so, then set fa-icon to "custom"
|
87
|
+
// this ensures the JS will not do any further operations
|
88
|
+
// faClasses[`fa-${icon}`] = customIcon ? 'custom' : icon
|
89
|
+
if (!customIcon) faClasses[`fa-${icon}`] = icon
|
90
|
+
|
91
91
|
const classes = classnames(
|
92
92
|
flipMap[flip],
|
93
93
|
'pb_icon_kit',
|
94
|
-
|
94
|
+
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 (
|
113
|
+
if (customIcon)
|
114
114
|
return (
|
115
115
|
<>
|
116
116
|
{
|
117
|
-
React.cloneElement(
|
117
|
+
React.cloneElement(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))
|
127
127
|
return (
|
128
128
|
<>
|
129
129
|
<span
|
@@ -136,19 +136,7 @@ const Icon = (props: IconProps) => {
|
|
136
136
|
</span>
|
137
137
|
</>
|
138
138
|
)
|
139
|
-
|
140
|
-
return (
|
141
|
-
<>
|
142
|
-
<span
|
143
|
-
{...dataProps}
|
144
|
-
{...htmlProps}
|
145
|
-
className={classesEmoji}
|
146
|
-
id={id}
|
147
|
-
>
|
148
|
-
<img src={iconURL} />
|
149
|
-
</span>
|
150
|
-
</>
|
151
|
-
)
|
139
|
+
|
152
140
|
else
|
153
141
|
return (
|
154
142
|
<>
|
@@ -173,4 +161,4 @@ const Icon = (props: IconProps) => {
|
|
173
161
|
)
|
174
162
|
}
|
175
163
|
|
176
|
-
export default Icon
|
164
|
+
export default Icon
|
@@ -2,9 +2,15 @@
|
|
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",
|
5
|
+
<p><%= pb_rails("icon", props: { custom_icon: svg_url } ) %></p>
|
6
|
+
<p><%= pb_rails("icon", props: { rotation: 90, custom_icon: svg_url, size: "2x" } ) %></p>
|
7
|
+
<p><%= pb_rails("icon", props: { spin: true, custom_icon: svg_url, size: "3x" } ) %></p>
|
8
|
+
<p><%= pb_rails("icon", props: { size: "5x", custom_icon: svg_url } ) %></p>
|
9
|
+
<p><%= pb_rails("icon", props: { flip: "horizontal", size: "5x", custom_icon: svg_url } ) %></p>
|
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
|
+
} ) %>
|
10
16
|
</div>
|
@@ -1,59 +1,33 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { Icon } from '../../'
|
3
3
|
|
4
|
+
// import Icons as config from 'power-icons'
|
4
5
|
const config = {
|
5
|
-
|
6
|
-
<svg
|
6
|
+
moon: (
|
7
|
+
<svg
|
8
|
+
ariaHidden="true"
|
9
|
+
focusable="false"
|
10
|
+
role="img"
|
11
|
+
viewBox="0 0 512 512"
|
7
12
|
xmlns="http://www.w3.org/2000/svg"
|
8
13
|
>
|
9
|
-
<
|
10
|
-
|
11
|
-
|
14
|
+
<path
|
15
|
+
d="M448 0H64C28.7 0 0 28.7 0 64v288c0 35.3 28.7 64 64 64h96v84c0 7.1 5.8 12 12 12 2.4 0 4.9-.7 7.1-2.4L304 416h144c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64zm16 352c0 8.8-7.2 16-16 16H288l-12.8 9.6L208 428v-60H64c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16h384c8.8 0 16 7.2 16 16v288zM336 184h-56v-56c0-8.8-7.2-16-16-16h-16c-8.8 0-16 7.2-16 16v56h-56c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16h56v56c0 8.8 7.2 16 16 16h16c8.8 0 16-7.2 16-16v-56h56c8.8 0 16-7.2 16-16v-16c0-8.8-7.2-16-16-16z"
|
16
|
+
fill="currentColor"
|
17
|
+
/>
|
12
18
|
</svg>
|
13
19
|
),
|
14
20
|
}
|
15
21
|
|
16
22
|
const IconCustom = (props) => {
|
17
23
|
return (
|
18
|
-
<
|
19
|
-
<
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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>
|
24
|
+
<div>
|
25
|
+
<Icon
|
26
|
+
customIcon={config.moon}
|
27
|
+
size="7x"
|
28
|
+
{...props}
|
29
|
+
/>
|
30
|
+
</div>
|
57
31
|
)
|
58
32
|
}
|
59
33
|
|
@@ -1,14 +1,19 @@
|
|
1
1
|
# Tips for Custom Icons
|
2
2
|
|
3
|
-
|
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.
|
4
8
|
|
5
|
-
|
6
|
-
|
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
|
+
### React
|
7
14
|
|
8
|
-
|
9
|
-
<img src="host.com/my/path/to/icon.svg" />
|
10
|
-
```
|
15
|
+
So long as you have a valid React `<SVG>` node, you can send it as the `customIcon` prop and the kit will take care of the rest.
|
11
16
|
|
12
17
|
### Rails
|
13
18
|
|
14
|
-
|
19
|
+
Some Rails applications use only webpack(er) which means using `image_url` will be successful over `image_path` in most cases especially development where Webpack Dev Server is serving assets over HTTP. Rails applications still using Asset Pipeline may use `image_path` or `image_url`. Of course, YMMV depending on any custom configurations in your Rails application.
|
@@ -1,9 +1,7 @@
|
|
1
|
-
<% if object.
|
2
|
-
<%= object.render_svg %>
|
3
|
-
<% elsif object.valid_emoji
|
4
|
-
<span class="pb_icon_kit_emoji">
|
5
|
-
<%= object.icon.html_safe %>
|
6
|
-
</span>
|
1
|
+
<% if object.custom_icon %>
|
2
|
+
<%= object.render_svg(object.custom_icon) %>
|
3
|
+
<% elsif object.valid_emoji(object.icon) %>
|
4
|
+
<span class="pb_icon_kit_emoji"><%= object.icon.html_safe %></span>
|
7
5
|
<% else %>
|
8
6
|
<%= content_tag(:i, nil,
|
9
7
|
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(icon)
|
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(path)
|
83
|
+
if File.extname(path) == ".svg"
|
84
|
+
doc = Nokogiri::XML(URI.open(path)) # rubocop:disable Security/Open
|
85
|
+
svg = doc.at_css "svg"
|
86
|
+
svg["class"] = "pb_custom_icon " + object.custom_icon_classname
|
87
|
+
raw doc
|
88
|
+
else
|
89
|
+
raise("Custom icon must be an svg. Please check your path and file type.")
|
90
|
+
end
|
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?: Record<string, unknown>;
|
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?: Record<string, unknown>,
|
14
14
|
full?: boolean,
|
15
15
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
16
16
|
position?: "left" | "right",
|
@@ -168,6 +168,7 @@ const Layout = (props: LayoutPropTypes) => {
|
|
168
168
|
layoutCss,
|
169
169
|
layoutCollapseCss,
|
170
170
|
className,
|
171
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
171
172
|
//@ts-ignore
|
172
173
|
globalProps(filteredProps)
|
173
174
|
)}
|
@@ -16,7 +16,8 @@ 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}
|
19
|
+
variant={variant}
|
20
|
+
/>
|
20
21
|
)
|
21
22
|
expect(getByTestId(`test-${variant}`)).toHaveClass(
|
22
23
|
`pb_layout_kit_sidebar_size_md_left_${
|
@@ -33,7 +34,8 @@ test("render transparent class", () => {
|
|
33
34
|
|
34
35
|
const { getByTestId } = render(
|
35
36
|
<LayoutTest data={{ testid: `test-${id}` }}
|
36
|
-
variant={id}
|
37
|
+
variant={id}
|
38
|
+
/>
|
37
39
|
)
|
38
40
|
expect(getByTestId(`test-${id}`)).toHaveClass(
|
39
41
|
`pb_layout_kit_sidebar_size_md_left_${id}`
|
@@ -47,7 +49,8 @@ test("render all sizes variants", () => {
|
|
47
49
|
testValues.forEach((size) => {
|
48
50
|
const { getByTestId } = render(
|
49
51
|
<LayoutTest data={{ testid: `test-${size}` }}
|
50
|
-
size={size}
|
52
|
+
size={size}
|
53
|
+
/>
|
51
54
|
)
|
52
55
|
expect(getByTestId(`test-${size}`)).toHaveClass(
|
53
56
|
`pb_layout_kit_sidebar_size_${size}_left_light`
|
@@ -84,7 +87,8 @@ test("render all layout variants", () => {
|
|
84
87
|
testValues.forEach(({ layout, expected }) => {
|
85
88
|
const { getByTestId } = render(
|
86
89
|
<Layout data={{ testid: `test-${layout}` }}
|
87
|
-
layout={layout}
|
90
|
+
layout={layout}
|
91
|
+
>
|
88
92
|
<Layout.Body>
|
89
93
|
<Card>{"Card content"}</Card>
|
90
94
|
</Layout.Body>
|
@@ -12,7 +12,7 @@ type LegendProps = {
|
|
12
12
|
className?: string,
|
13
13
|
color?: string,
|
14
14
|
dark?: boolean,
|
15
|
-
data?:
|
15
|
+
data?: Record<string, unknown>,
|
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
|
+
onTouchEnd={onTouchEnd}
|
60
60
|
onTouchMove={onTouchMove}
|
61
|
-
|
61
|
+
onTouchStart={onTouchStart}
|
62
62
|
>
|
63
63
|
{
|
64
64
|
urls.length > 1 && (
|
65
65
|
<CircleIconButton
|
66
66
|
className='carousel-arrow-left'
|
67
|
-
dark
|
67
|
+
dark
|
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
|
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 = () => undefined,
|
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}
|
43
42
|
current={currentIndex}
|
44
43
|
onChange={handleChange}
|
45
44
|
onClick={onClick}
|
45
|
+
setIndex={setIndex}
|
46
46
|
urls={photos.map((photo) => photo.url)}
|
47
47
|
/>
|
48
48
|
{photos.length > 1 ? (
|
@@ -61,23 +61,31 @@ const LightboxHeader = (props: LightboxHeaderProps): React.ReactElement => {
|
|
61
61
|
|
62
62
|
const HeaderBody = () => (
|
63
63
|
<React.Fragment>
|
64
|
-
<FlexItem flex="1"
|
64
|
+
<FlexItem flex="1"
|
65
|
+
marginLeft="sm"
|
66
|
+
>
|
65
67
|
<CircleIconButton
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
68
|
+
dark
|
69
|
+
icon={icon}
|
70
|
+
onClick={handleOnLightboxClose}
|
71
|
+
variant="link"
|
70
72
|
/>
|
71
73
|
</FlexItem>
|
72
74
|
{title && text && (
|
73
75
|
<FlexItem flex="5">
|
74
76
|
<Flex justify="center">
|
75
|
-
<Flex align="center"
|
77
|
+
<Flex align="center"
|
78
|
+
orientation="column"
|
79
|
+
>
|
76
80
|
{typeof title === "string" ? (
|
77
|
-
<Title dark
|
81
|
+
<Title dark
|
82
|
+
paddingBottom="xxs"
|
83
|
+
size={4}
|
84
|
+
text={title}
|
85
|
+
/>
|
78
86
|
) : (
|
79
|
-
<Flex
|
80
|
-
|
87
|
+
<Flex className="custom-header"
|
88
|
+
justify="center"
|
81
89
|
>
|
82
90
|
{title}
|
83
91
|
</Flex>
|
@@ -86,8 +94,8 @@ const LightboxHeader = (props: LightboxHeaderProps): React.ReactElement => {
|
|
86
94
|
{typeof text === "string" ? (
|
87
95
|
<Caption dark>{text}</Caption>
|
88
96
|
) : (
|
89
|
-
<Flex
|
90
|
-
|
97
|
+
<Flex className="custom-header"
|
98
|
+
justify="center"
|
91
99
|
>
|
92
100
|
{text}
|
93
101
|
</Flex>
|
@@ -99,12 +107,12 @@ const LightboxHeader = (props: LightboxHeaderProps): React.ReactElement => {
|
|
99
107
|
<FlexItem flex="1">
|
100
108
|
<Flex justify="end">
|
101
109
|
<Button
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
110
|
+
className="nav-right-btn"
|
111
|
+
dark
|
112
|
+
htmlType="button"
|
113
|
+
onClick={onClickRight}
|
114
|
+
text={navRight}
|
115
|
+
variant="link"
|
108
116
|
/>
|
109
117
|
</Flex>
|
110
118
|
</FlexItem>
|
@@ -114,11 +122,11 @@ const LightboxHeader = (props: LightboxHeaderProps): React.ReactElement => {
|
|
114
122
|
return (
|
115
123
|
<div className="carousel-header">
|
116
124
|
<Flex
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
125
|
+
{...ariaProps}
|
126
|
+
{...dataProps}
|
127
|
+
{...htmlProps}
|
128
|
+
className={classnames(headerCSS, headerSpacing, className)}
|
129
|
+
spacing={spacing}
|
122
130
|
>
|
123
131
|
{closeable && <HeaderBody />}
|
124
132
|
{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)=> void,
|
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 = () => undefined,
|
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
|
-
|
110
|
+
navRight={navRight}
|
111
111
|
onClickRight={onClickRight}
|
112
|
+
onClose={onClose}
|
112
113
|
text={description}
|
113
|
-
navRight={navRight}
|
114
114
|
title={title}
|
115
115
|
/>
|
116
116
|
{children}
|
117
117
|
<Carousel
|
118
|
-
setIndex={setActivePhoto}
|
119
118
|
currentIndex={activePhoto}
|
120
119
|
onChange={handleOnSlide}
|
121
120
|
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
|
};
|