playbook_ui 10.25.0.pre.alpha3 → 10.26.0.pre.alpha1
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/data/menu.yml +1 -0
- data/app/pb_kits/playbook/index.js +2 -1
- data/app/pb_kits/playbook/pb_body/{_body.jsx → _body.tsx} +24 -19
- data/app/pb_kits/playbook/pb_button/docs/_button_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_caption/{_caption.jsx → _caption.tsx} +7 -8
- data/app/pb_kits/playbook/pb_card/_card.jsx +4 -2
- data/app/pb_kits/playbook/pb_card/_card.scss +3 -1
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +30 -4
- data/app/pb_kits/playbook/pb_card/docs/_card_header.jsx +52 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +2 -2
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.js +37 -0
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +37 -0
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx +38 -0
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.md +1 -0
- data/app/pb_kits/playbook/pb_file_upload/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_file_upload/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +1 -1
- data/app/pb_kits/playbook/pb_highlight/{_highlight.jsx → _highlight.tsx} +14 -12
- data/app/pb_kits/playbook/pb_highlight/docs/_highlight_default.jsx +2 -2
- data/app/pb_kits/playbook/pb_kit/dateTime.js +1 -2
- data/app/pb_kits/playbook/pb_pill/_pill.jsx +1 -1
- data/app/pb_kits/playbook/pb_radio/_radio.jsx +1 -1
- data/app/pb_kits/playbook/pb_title/{_title.jsx → _title.tsx} +10 -12
- data/app/pb_kits/playbook/pb_title/title.test.js +2 -2
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx +79 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_description.md +5 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx +48 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.md +2 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.jsx +47 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.html.erb +79 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.jsx +90 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.md +1 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.html.erb +54 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.jsx +65 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx +48 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/example.yml +15 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/index.js +5 -0
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.html.erb +1 -0
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +43 -0
- data/app/pb_kits/playbook/playbook-doc.js +2 -0
- data/app/pb_kits/playbook/playbook-rails-react-bindings.js +2 -0
- data/app/pb_kits/playbook/plugins/pb_chart.js +34 -0
- data/app/pb_kits/playbook/utilities/_background_colors.scss +1 -1
- data/app/pb_kits/playbook/utilities/_colors.scss +8 -0
- data/app/pb_kits/playbook/utilities/_flex_direction.scss +28 -15
- data/app/pb_kits/playbook/utilities/globalProps.ts +94 -110
- data/app/pb_kits/playbook/utilities/text.ts +22 -0
- data/dist/reset.css +60 -1
- data/lib/playbook/flex_direction.rb +7 -1
- data/lib/playbook/version.rb +2 -2
- metadata +32 -9
- data/app/pb_kits/playbook/utilities/text.js +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2189d1ada1c39446fecca8e67776e0e5b086e79d842fbfaf5ed800313c81f5df
|
4
|
+
data.tar.gz: 4640c10e464c670714c67a3875412fcda9c79f06edbbea2a50cdd5ab330889ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d133f2ab6121d7f7a3895fe907a51f3713c48d1463a80cba165ae6c5fc6e1f64d6bf9ccb2b368f7f17304eee8e8a36a40c02a00b456044f4199e15c698e9d80
|
7
|
+
data.tar.gz: 9515dbe37dab4c9d0a5a6e90c7074a3641ec9e31669b4fdd502e3b12e5ca6bf541ecf36eea0ec711c52710f3bd1cec017b3be76d68cb36b6e15aeb690c7185f9
|
@@ -4,7 +4,6 @@ import 'lazysizes/plugins/attrchange/ls.attrchange'
|
|
4
4
|
import 'lazysizes'
|
5
5
|
|
6
6
|
// vvv React Component JSX Imports from the React Kits vvv
|
7
|
-
export { default as Walkthrough } from './pb_walkthrough/_walkthrough'
|
8
7
|
export { default as Avatar } from './pb_avatar/_avatar'
|
9
8
|
export { default as AvatarActionButton } from './pb_avatar_action_button/_avatar_action_button'
|
10
9
|
export { default as Background } from './pb_background/_background'
|
@@ -98,9 +97,11 @@ export { default as Title } from './pb_title/_title'
|
|
98
97
|
export { default as TitleCount } from './pb_title_count/_title_count'
|
99
98
|
export { default as TitleDetail } from './pb_title_detail/_title_detail'
|
100
99
|
export { default as Toggle } from './pb_toggle/_toggle'
|
100
|
+
export { default as TreemapChart } from './pb_treemap_chart/_treemap_chart'
|
101
101
|
export { default as Typeahead } from './pb_typeahead/_typeahead'
|
102
102
|
export { default as User } from './pb_user/_user'
|
103
103
|
export { default as UserBadge } from './pb_user_badge/_user_badge'
|
104
|
+
export { default as Walkthrough } from './pb_walkthrough/_walkthrough'
|
104
105
|
export { default as WeekdayStacked } from './pb_weekday_stacked/_weekday_stacked'
|
105
106
|
// ^^^ React Component JSX Imports from the React Kits ^^^
|
106
107
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
1
|
import React from 'react'
|
4
2
|
import classnames from 'classnames'
|
5
3
|
|
@@ -9,13 +7,13 @@ import { globalProps } from '../utilities/globalProps'
|
|
9
7
|
import Highlight from '../pb_highlight/_highlight'
|
10
8
|
|
11
9
|
type BodyProps = {
|
12
|
-
aria?:
|
10
|
+
aria?: {[key: string]: string},
|
13
11
|
className?: string,
|
14
|
-
children?:
|
12
|
+
children?: React.ReactChild[],
|
15
13
|
color?: 'default' | 'light' | 'lighter' | 'link',
|
16
14
|
dark?: boolean,
|
17
|
-
data?:
|
18
|
-
highlightedText?:
|
15
|
+
data?: {[key: string]: string},
|
16
|
+
highlightedText?: string[],
|
19
17
|
highlighting?: boolean,
|
20
18
|
id?: string,
|
21
19
|
status?: 'negative' | 'neutral' | 'positive',
|
@@ -24,30 +22,31 @@ type BodyProps = {
|
|
24
22
|
variant: null | 'link',
|
25
23
|
}
|
26
24
|
|
27
|
-
const Body = (props: BodyProps) => {
|
25
|
+
const Body = (props: BodyProps): React.ReactElement => {
|
28
26
|
const {
|
29
27
|
aria = {},
|
30
|
-
className,
|
31
28
|
children,
|
29
|
+
className,
|
32
30
|
color = '',
|
33
31
|
data = {},
|
34
32
|
highlightedText = [],
|
35
33
|
highlighting = false,
|
36
|
-
id,
|
37
|
-
status,
|
34
|
+
id = '',
|
35
|
+
status = null,
|
38
36
|
tag = 'div',
|
39
|
-
text,
|
37
|
+
text = '',
|
40
38
|
variant = null,
|
41
39
|
} = props
|
42
40
|
|
43
|
-
const ariaProps = buildAriaProps(aria)
|
44
|
-
const dataProps = buildDataProps(data)
|
41
|
+
const ariaProps: {[key: string]: any} = buildAriaProps(aria)
|
42
|
+
const dataProps: {[key: string]: any} = buildDataProps(data)
|
45
43
|
const classes = classnames(
|
46
44
|
buildCss('pb_body_kit', color, variant, status),
|
47
45
|
globalProps(props),
|
48
46
|
className
|
49
47
|
)
|
50
|
-
const Tag = `${tag}`
|
48
|
+
const Tag: React.ReactElement | any = `${tag}`
|
49
|
+
|
51
50
|
|
52
51
|
return (
|
53
52
|
<Tag
|
@@ -56,11 +55,17 @@ const Body = (props: BodyProps) => {
|
|
56
55
|
className={classes}
|
57
56
|
id={id}
|
58
57
|
>
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
58
|
+
{ highlighting && (
|
59
|
+
<Highlight
|
60
|
+
highlightedText={highlightedText}
|
61
|
+
text={text}
|
62
|
+
>
|
63
|
+
{children}
|
64
|
+
</Highlight>
|
65
|
+
) }
|
66
|
+
{ !highlighting && (
|
67
|
+
text || children
|
68
|
+
) }
|
64
69
|
</Tag>
|
65
70
|
)
|
66
71
|
}
|
@@ -1,24 +1,22 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
1
|
import React from 'react'
|
4
2
|
import classnames from 'classnames'
|
5
3
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
6
|
-
import { deprecatedProps, globalProps } from '../utilities/globalProps'
|
4
|
+
import { deprecatedProps, globalProps, GlobalProps } from '../utilities/globalProps'
|
7
5
|
|
8
6
|
type CaptionProps = {
|
9
|
-
aria?:
|
10
|
-
children:
|
7
|
+
aria?: {[key: string]: string},
|
8
|
+
children: React.ReactChild[],
|
11
9
|
className?: string,
|
12
10
|
color?: "default" | "light" | "lighter" | "success" | "error" | "link",
|
13
|
-
data?:
|
11
|
+
data?: {[key: string]: string},
|
14
12
|
id?: string,
|
15
13
|
size?: "xs" | "sm" | "md" | "lg" | "xl",
|
16
14
|
tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div" | "caption",
|
17
15
|
text?: string,
|
18
16
|
variant?: null | "link",
|
19
|
-
};
|
17
|
+
} & GlobalProps;
|
20
18
|
|
21
|
-
const Caption = (props: CaptionProps) => {
|
19
|
+
const Caption = (props: CaptionProps): React.ReactElement => {
|
22
20
|
if (props.variant) deprecatedProps('Title', ['variant']) //variant prop is deprecated, use color instead
|
23
21
|
const {
|
24
22
|
aria = {},
|
@@ -32,6 +30,7 @@ const Caption = (props: CaptionProps) => {
|
|
32
30
|
text,
|
33
31
|
variant = null,
|
34
32
|
} = props
|
33
|
+
|
35
34
|
const tagOptions = [
|
36
35
|
'h1',
|
37
36
|
'h2',
|
@@ -3,12 +3,14 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import { get } from 'lodash'
|
5
5
|
import classnames from 'classnames'
|
6
|
+
|
6
7
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
7
8
|
import { globalProps } from '../utilities/globalProps'
|
9
|
+
import { ProductColors, CategoryColors, BackgroundColors } from '../types'
|
8
10
|
|
9
11
|
type CardPropTypes = {
|
10
12
|
aria?: object,
|
11
|
-
background?:
|
13
|
+
background?: BackgroundColors | ProductColors | "none",
|
12
14
|
borderNone?: boolean,
|
13
15
|
borderRadius?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | "rounded",
|
14
16
|
children: array<React.ReactNode> | React.ReactNode,
|
@@ -24,7 +26,7 @@ type CardPropTypes = {
|
|
24
26
|
}
|
25
27
|
|
26
28
|
type CardHeaderProps = {
|
27
|
-
headerColor?:
|
29
|
+
headerColor?: BackgroundColors | ProductColors | CategoryColors | "none",
|
28
30
|
children: array<React.ReactNode> | React.ReactNode,
|
29
31
|
className?: string,
|
30
32
|
padding?: string,
|
@@ -1,6 +1,5 @@
|
|
1
1
|
@import "card_mixin";
|
2
2
|
|
3
|
-
|
4
3
|
[class^=pb_card_kit] {
|
5
4
|
@include pb_card;
|
6
5
|
|
@@ -30,6 +29,9 @@
|
|
30
29
|
@each $color_name, $color_value in $pb_card_header_colors {
|
31
30
|
&[class*=_#{$color_name}] {
|
32
31
|
@include pb_card_header_color($color_value);
|
32
|
+
[class^=pb_body_kit] {
|
33
|
+
color: lightenText($color_value);
|
34
|
+
}
|
33
35
|
}
|
34
36
|
}
|
35
37
|
&[class*=_white] {
|
@@ -9,7 +9,6 @@ $pb_card_border_width: 1px;
|
|
9
9
|
$pb_card_border_radius: $border_rad_heavier;
|
10
10
|
$pb_card_highlight_colors: map-merge(map-merge($status_colors, $product_colors), $category_colors);
|
11
11
|
$pb_card_highlight_size: 4px;
|
12
|
-
$pb_card_header_colors: map-merge($category_colors, $product_colors);
|
13
12
|
$pb_card_header_border_radius: $border_rad_heavy;
|
14
13
|
|
15
14
|
$additional_colors: (
|
@@ -19,6 +18,7 @@ $additional_colors: (
|
|
19
18
|
"none": none,
|
20
19
|
);
|
21
20
|
$background_colors: map-merge($product_colors, $additional_colors);
|
21
|
+
$pb_card_header_colors: map-merge(map-merge($product_colors, $additional_colors), $category_colors);
|
22
22
|
|
23
23
|
@mixin pb_card_selected($border_color: $primary) {
|
24
24
|
border-color: $border_color;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= pb_rails("title", props: { text: "Category Colors", tag: "h4", size: 4 }) %>
|
2
|
-
|
3
|
-
<br>
|
2
|
+
|
3
|
+
<br>
|
4
4
|
|
5
5
|
<%= pb_rails("card", props: { padding: "none", header: true}) do %>
|
6
6
|
<%= pb_rails("card/card_header", props: { padding: "sm" }) do %>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<% end %>
|
12
12
|
<% end %>
|
13
13
|
|
14
|
-
<br>
|
14
|
+
<br>
|
15
15
|
|
16
16
|
<%= pb_rails("card", props: { padding: "none", header: true}) do %>
|
17
17
|
<%= pb_rails("card/card_header", props: { padding: "sm", header_color: "category_2" }) do %>
|
@@ -25,7 +25,7 @@
|
|
25
25
|
|
26
26
|
<br>
|
27
27
|
|
28
|
-
<%= pb_rails("title", props: { text: "Product Colors", tag: "h4", size: 4 }) %>
|
28
|
+
<%= pb_rails("title", props: { text: "Product Colors", tag: "h4", size: 4 }) %>
|
29
29
|
|
30
30
|
<br>
|
31
31
|
|
@@ -48,3 +48,29 @@
|
|
48
48
|
Body
|
49
49
|
<% end %>
|
50
50
|
<% end %>
|
51
|
+
|
52
|
+
<br>
|
53
|
+
|
54
|
+
<%= pb_rails("title", props: { text: "Background Colors", tag: "h4", size: 4 }) %>
|
55
|
+
|
56
|
+
<br>
|
57
|
+
|
58
|
+
<%= pb_rails("card", props: { padding: "none", header: true}) do %>
|
59
|
+
<%= pb_rails("card/card_header", props: { padding: "sm", header_color: "white" }) do %>
|
60
|
+
<%= pb_rails("body", props: { text: "White" }) %>
|
61
|
+
<% end %>
|
62
|
+
<%= pb_rails("card/card_body", props: { padding: "md" }) do %>
|
63
|
+
Body
|
64
|
+
<% end %>
|
65
|
+
<% end %>
|
66
|
+
|
67
|
+
<br>
|
68
|
+
|
69
|
+
<%= pb_rails("card", props: { padding: "none", header: true}) do %>
|
70
|
+
<%= pb_rails("card/card_header", props: { padding: "sm", header_color: "bg_dark" }) do %>
|
71
|
+
<%= pb_rails("body", props: { text: "Dark" }) %>
|
72
|
+
<% end %>
|
73
|
+
<%= pb_rails("card/card_body", props: { padding: "md" }) do %>
|
74
|
+
Body
|
75
|
+
<% end %>
|
76
|
+
<% end %>
|
@@ -111,6 +111,58 @@ const CardHeader = (props) => {
|
|
111
111
|
</Card.Body>
|
112
112
|
</Card>
|
113
113
|
|
114
|
+
<br />
|
115
|
+
|
116
|
+
<Title
|
117
|
+
{...props}
|
118
|
+
size={4}
|
119
|
+
tag="h4"
|
120
|
+
text="Background Colors"
|
121
|
+
/>
|
122
|
+
|
123
|
+
<br />
|
124
|
+
|
125
|
+
<Card
|
126
|
+
{...props}
|
127
|
+
padding="none"
|
128
|
+
>
|
129
|
+
<Card.Header
|
130
|
+
headerColor="white"
|
131
|
+
>
|
132
|
+
<Body
|
133
|
+
{...props}
|
134
|
+
text="White"
|
135
|
+
/>
|
136
|
+
</Card.Header>
|
137
|
+
<Card.Body>
|
138
|
+
<Body
|
139
|
+
{...props}
|
140
|
+
text="Body"
|
141
|
+
/>
|
142
|
+
</Card.Body>
|
143
|
+
</Card>
|
144
|
+
|
145
|
+
<br />
|
146
|
+
|
147
|
+
<Card
|
148
|
+
{...props}
|
149
|
+
padding="none"
|
150
|
+
>
|
151
|
+
<Card.Header
|
152
|
+
headerColor="dark"
|
153
|
+
>
|
154
|
+
<Body
|
155
|
+
{...props}
|
156
|
+
text="Dark"
|
157
|
+
/>
|
158
|
+
</Card.Header>
|
159
|
+
<Card.Body>
|
160
|
+
<Body
|
161
|
+
{...props}
|
162
|
+
text="Body"
|
163
|
+
/>
|
164
|
+
</Card.Body>
|
165
|
+
</Card>
|
114
166
|
</div>
|
115
167
|
)
|
116
168
|
}
|
@@ -1 +1 @@
|
|
1
|
-
Card headers
|
1
|
+
Card headers pass category, product, and background colors only. List of all category, product, and background colors can be viewed <a href="https://playbook.powerapp.cloud/utilities" target="_blank">here</a>.
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/* @flow */
|
2
2
|
|
3
3
|
import React, { useEffect, useRef } from 'react'
|
4
|
-
import Body from '../pb_body/_body
|
5
|
-
import Icon from '../pb_icon/_icon
|
4
|
+
import Body from '../pb_body/_body'
|
5
|
+
import Icon from '../pb_icon/_icon'
|
6
6
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
7
7
|
import classnames from 'classnames'
|
8
8
|
import { globalProps } from '../utilities/globalProps'
|
@@ -209,6 +209,43 @@ const highchartsDarkTheme = {
|
|
209
209
|
threshold: null,
|
210
210
|
},
|
211
211
|
},
|
212
|
+
|
213
|
+
//TREEMAP CHART STYLES
|
214
|
+
treemap: {
|
215
|
+
layoutAlgorithm: "squarified",
|
216
|
+
allowTraversingTree: false,
|
217
|
+
animationLimit: 1000,
|
218
|
+
colors: [
|
219
|
+
colors.data_1,
|
220
|
+
colors.data_2,
|
221
|
+
colors.data_3,
|
222
|
+
colors.data_4,
|
223
|
+
colors.data_5,
|
224
|
+
colors.data_6,
|
225
|
+
colors.data_7,
|
226
|
+
colors.data_8,
|
227
|
+
],
|
228
|
+
colorByPoint: true,
|
229
|
+
dataLabels: {
|
230
|
+
enabled: true,
|
231
|
+
style: {
|
232
|
+
fontFamily: typography.font_family_base,
|
233
|
+
fontWeight: typography.bold,
|
234
|
+
fontSize: typography.heading_4,
|
235
|
+
},
|
236
|
+
},
|
237
|
+
levels: [
|
238
|
+
{
|
239
|
+
level: 1,
|
240
|
+
dataLabels: {
|
241
|
+
enabled: false,
|
242
|
+
},
|
243
|
+
},
|
244
|
+
],
|
245
|
+
traverseUpButton: {
|
246
|
+
position: { y: -40 },
|
247
|
+
}
|
248
|
+
},
|
212
249
|
},
|
213
250
|
}
|
214
251
|
|
@@ -209,6 +209,43 @@ const highchartsTheme = {
|
|
209
209
|
threshold: null,
|
210
210
|
},
|
211
211
|
},
|
212
|
+
|
213
|
+
//TREEMAP CHART STYLES
|
214
|
+
treemap: {
|
215
|
+
layoutAlgorithm: "squarified",
|
216
|
+
allowTraversingTree: false,
|
217
|
+
animationLimit: 1000,
|
218
|
+
colors: [
|
219
|
+
colors.data_1,
|
220
|
+
colors.data_2,
|
221
|
+
colors.data_3,
|
222
|
+
colors.data_4,
|
223
|
+
colors.data_5,
|
224
|
+
colors.data_6,
|
225
|
+
colors.data_7,
|
226
|
+
colors.data_8,
|
227
|
+
],
|
228
|
+
colorByPoint: true,
|
229
|
+
dataLabels: {
|
230
|
+
enabled: true,
|
231
|
+
style: {
|
232
|
+
fontFamily: typography.font_family_base,
|
233
|
+
fontWeight: typography.bold,
|
234
|
+
fontSize: typography.heading_4,
|
235
|
+
},
|
236
|
+
},
|
237
|
+
levels: [
|
238
|
+
{
|
239
|
+
level: 1,
|
240
|
+
dataLabels: {
|
241
|
+
enabled: false,
|
242
|
+
},
|
243
|
+
},
|
244
|
+
],
|
245
|
+
traverseUpButton: {
|
246
|
+
position: { y: -40 },
|
247
|
+
}
|
248
|
+
},
|
212
249
|
},
|
213
250
|
}
|
214
251
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
/* eslint-disable react/no-multi-comp */
|
2
|
+
/* @flow */
|
3
|
+
|
4
|
+
import React, { useState } from "react";
|
5
|
+
import { FileUpload, List, ListItem } from "../..";
|
6
|
+
|
7
|
+
const AcceptedFilesList = ({ files }: FileList) => (
|
8
|
+
<List>
|
9
|
+
{files.map((file) => (
|
10
|
+
<ListItem key={file.name}>{file.name}</ListItem>
|
11
|
+
))}
|
12
|
+
</List>
|
13
|
+
);
|
14
|
+
|
15
|
+
const FileUploadCustomDescription = (props) => {
|
16
|
+
const [filesToUpload, setFilesToUpload] = useState([]);
|
17
|
+
|
18
|
+
const handleOnFilesAccepted = (files) => {
|
19
|
+
setFilesToUpload([...filesToUpload, ...files]);
|
20
|
+
};
|
21
|
+
|
22
|
+
return (
|
23
|
+
<div>
|
24
|
+
<AcceptedFilesList
|
25
|
+
files={filesToUpload}
|
26
|
+
{...props}
|
27
|
+
/>
|
28
|
+
<FileUpload
|
29
|
+
accept={['application/pdf','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']}
|
30
|
+
acceptedFilesDescription="Adobe (.pdf) and Microsoft (.xslx)"
|
31
|
+
onFilesAccepted={handleOnFilesAccepted}
|
32
|
+
{...props}
|
33
|
+
/>
|
34
|
+
</div>
|
35
|
+
);
|
36
|
+
};
|
37
|
+
|
38
|
+
export default FileUploadCustomDescription;
|
@@ -0,0 +1 @@
|
|
1
|
+
Sometimes you may want to create a custom description that is easier for users to read. In this case, you can use the `acceptedFilesDescription` prop.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/* @flow */
|
2
2
|
import React from 'react'
|
3
3
|
import classnames from 'classnames'
|
4
|
-
import Title from '../pb_title/_title
|
4
|
+
import Title from '../pb_title/_title'
|
5
5
|
import Icon from '../pb_icon/_icon.jsx'
|
6
6
|
import Avatar from '../pb_avatar/_avatar'
|
7
7
|
import { globalProps } from '../utilities/globalProps'
|
@@ -1,28 +1,30 @@
|
|
1
|
-
/* @flow */
|
2
1
|
/* eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */
|
3
2
|
import Highlighter from 'react-highlight-words'
|
4
3
|
import React from 'react'
|
5
4
|
import classnames from 'classnames'
|
6
|
-
import { globalProps } from '../utilities/globalProps'
|
5
|
+
import { globalProps, GlobalProps } from '../utilities/globalProps'
|
7
6
|
|
8
7
|
type HighlightProps = {
|
9
8
|
className?: string,
|
10
|
-
data?: string,
|
9
|
+
data?: {[key: string]: string},
|
11
10
|
id?: string,
|
12
|
-
children?: React.
|
11
|
+
children?: React.ReactChild[] | string,
|
13
12
|
text?: string,
|
14
|
-
highlightedText?:
|
15
|
-
}
|
13
|
+
highlightedText?: string[],
|
14
|
+
} & GlobalProps
|
16
15
|
|
17
|
-
const Highlight = (props: HighlightProps) => {
|
16
|
+
const Highlight = (props: HighlightProps): React.ReactElement => {
|
18
17
|
const {
|
19
|
-
className = 'pb_highlight_kit',
|
20
18
|
children,
|
21
|
-
|
22
|
-
|
23
|
-
text,
|
19
|
+
className = 'pb_highlight_kit',
|
20
|
+
data = {},
|
24
21
|
highlightedText = ['highlight'],
|
22
|
+
id = '',
|
23
|
+
text = '',
|
25
24
|
} = props
|
25
|
+
|
26
|
+
const highlightContent: any = text || children;
|
27
|
+
|
26
28
|
return (
|
27
29
|
<Highlighter
|
28
30
|
autoEscape
|
@@ -31,7 +33,7 @@ const Highlight = (props: HighlightProps) => {
|
|
31
33
|
highlightTag="mark"
|
32
34
|
id={id}
|
33
35
|
searchWords={highlightedText}
|
34
|
-
textToHighlight={
|
36
|
+
textToHighlight={highlightContent}
|
35
37
|
/>
|
36
38
|
)
|
37
39
|
}
|
@@ -15,11 +15,11 @@ const HighlightDefault = (props) => (
|
|
15
15
|
{' '}
|
16
16
|
{'Hello this is a'}
|
17
17
|
{' '}
|
18
|
-
<Highlight
|
18
|
+
<Highlight text=" highlight wrapped"/>
|
19
19
|
</Body>
|
20
20
|
<br />
|
21
21
|
<Body
|
22
|
-
highlightedText={['highlighted
|
22
|
+
highlightedText={['highlighted', 'Body Kit ']}
|
23
23
|
highlighting
|
24
24
|
text="This is text highlighted in the Body Kit using the text prop."
|
25
25
|
{...props}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
|
5
5
|
import classnames from 'classnames'
|
6
|
-
import Title from '../pb_title/_title
|
6
|
+
import Title from '../pb_title/_title'
|
7
7
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
8
8
|
import { globalProps } from '../utilities/globalProps'
|
9
9
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/*eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */
|
3
3
|
|
4
4
|
import React, { forwardRef } from 'react'
|
5
|
-
import Body from '../pb_body/_body
|
5
|
+
import Body from '../pb_body/_body'
|
6
6
|
import classnames from 'classnames'
|
7
7
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
8
8
|
import { globalProps } from '../utilities/globalProps'
|
@@ -1,24 +1,22 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
1
|
import React from 'react'
|
4
2
|
import classnames from 'classnames'
|
5
3
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
6
|
-
import { deprecatedProps, globalProps } from '../utilities/globalProps'
|
4
|
+
import { deprecatedProps, GlobalProps, globalProps } from '../utilities/globalProps'
|
7
5
|
|
8
6
|
type TitleProps = {
|
9
|
-
aria?:
|
10
|
-
children?:
|
7
|
+
aria?: {[key: string]: string},
|
8
|
+
children?: React.ReactChild[],
|
11
9
|
className?: string,
|
12
10
|
color?: "default" | "light" | "lighter" | "success" | "error" | "link",
|
13
|
-
data?:
|
11
|
+
data?: {[key: string]: string},
|
14
12
|
id?: string,
|
15
13
|
size?: 1 | 2 | 3 | 4,
|
16
14
|
tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span",
|
17
15
|
text?: string,
|
18
16
|
variant?: null | "link",
|
19
|
-
}
|
17
|
+
} & GlobalProps
|
20
18
|
|
21
|
-
const Title = (props: TitleProps) => {
|
19
|
+
const Title = (props: TitleProps): React.ReactElement => {
|
22
20
|
if (props.variant) deprecatedProps('Title', ['variant']) //variant prop is deprecated, use color instead
|
23
21
|
const {
|
24
22
|
aria = {},
|
@@ -33,14 +31,14 @@ const Title = (props: TitleProps) => {
|
|
33
31
|
variant = null,
|
34
32
|
} = props
|
35
33
|
|
36
|
-
const ariaProps = buildAriaProps(aria)
|
37
|
-
const dataProps = buildDataProps(data)
|
34
|
+
const ariaProps: {[key: string]: string | number} = buildAriaProps(aria)
|
35
|
+
const dataProps: {[key: string]: string | number} = buildDataProps(data)
|
38
36
|
const classes = classnames(
|
39
|
-
buildCss('pb_title_kit', size
|
37
|
+
buildCss('pb_title_kit', `size_${size}`, variant, color),
|
40
38
|
globalProps(props),
|
41
39
|
className,
|
42
40
|
)
|
43
|
-
const Tag = `${tag}`
|
41
|
+
const Tag: React.ReactElement | any = `${tag}`
|
44
42
|
|
45
43
|
return (
|
46
44
|
<Tag
|