playbook_ui 13.12.0.pre.alpha.play1051testhighcharts1581 → 13.12.0.pre.alpha.play10281596
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +5 -1
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +6 -2
- data/app/pb_kits/playbook/pb_background/_background.tsx +9 -5
- data/app/pb_kits/playbook/pb_badge/_badge.tsx +5 -1
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +39 -39
- data/app/pb_kits/playbook/pb_body/_body.tsx +5 -1
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.tsx +5 -1
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.tsx +5 -2
- data/app/pb_kits/playbook/pb_button/_button.tsx +8 -1
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.tsx +5 -1
- data/app/pb_kits/playbook/pb_caption/_caption.tsx +6 -1
- data/app/pb_kits/playbook/pb_card/_card.tsx +5 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +7 -2
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +71 -71
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +5 -3
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +5 -1
- data/app/pb_kits/playbook/pb_contact/_contact.tsx +5 -1
- data/app/pb_kits/playbook/pb_currency/_currency.tsx +5 -1
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +208 -210
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +207 -209
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +5 -1
- data/app/pb_kits/playbook/pb_date/_date.tsx +12 -7
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +5 -1
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +5 -1
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +15 -4
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +12 -5
- data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +5 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +5 -1
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +15 -4
- data/app/pb_kits/playbook/pb_detail/_detail.tsx +5 -1
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +11 -3
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +8 -3
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +5 -1
- data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx +8 -1
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +6 -2
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +6 -1
- data/app/pb_kits/playbook/pb_flex/_flex.tsx +6 -1
- data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +6 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +5 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +7 -1
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +54 -62
- data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +5 -1
- data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +5 -0
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +10 -3
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +7 -1
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +5 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +5 -1
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +5 -1
- data/app/pb_kits/playbook/pb_image/_image.tsx +6 -1
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.tsx +5 -1
- data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +6 -2
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +6 -1
- data/app/pb_kits/playbook/pb_legend/_legend.tsx +5 -1
- data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +6 -1
- data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +5 -1
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +44 -44
- data/app/pb_kits/playbook/pb_list/_list.tsx +7 -2
- data/app/pb_kits/playbook/pb_list/_list_item.tsx +5 -1
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +5 -1
- data/app/pb_kits/playbook/pb_map/_map.tsx +6 -1
- data/app/pb_kits/playbook/pb_message/_message.tsx +5 -1
- data/app/pb_kits/playbook/pb_message/_message_mention.tsx +5 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +5 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +5 -1
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_default_swift.md +11 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_props_swift.md +7 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_reverse_swift.md +13 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size_swift.md +11 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +5 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_default_swift.md +15 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_props_swift.md +5 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_small_swift.md +15 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_xsmall_swift.md +15 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_nav/_item.tsx +7 -2
- data/app/pb_kits/playbook/pb_nav/_nav.tsx +5 -1
- data/app/pb_kits/playbook/pb_online_status/_online_status.tsx +5 -1
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +6 -2
- data/app/pb_kits/playbook/pb_person/_person.tsx +5 -0
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +5 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +8 -2
- data/app/pb_kits/playbook/pb_pill/_pill.tsx +5 -1
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +6 -1
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +5 -1
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +9 -3
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.tsx +5 -1
- data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.tsx +6 -2
- data/app/pb_kits/playbook/pb_radio/_radio.tsx +5 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +7 -1
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +5 -1
- data/app/pb_kits/playbook/pb_select/_select.tsx +6 -1
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +6 -2
- data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx +5 -0
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +5 -0
- data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +11 -3
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +5 -1
- data/app/pb_kits/playbook/pb_source/_source.tsx +5 -1
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.tsx +5 -1
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +14 -2
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +6 -0
- data/app/pb_kits/playbook/pb_table/_table.tsx +5 -1
- data/app/pb_kits/playbook/pb_table/_table_row.tsx +5 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +5 -1
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_add_on_swift.md +35 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default_swift.md +29 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_disabled_swift.md +13 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error_swift.md +24 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_props_swift.md +13 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +5 -2
- data/app/pb_kits/playbook/pb_time/_time.tsx +9 -2
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +5 -1
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +6 -2
- data/app/pb_kits/playbook/pb_timeline/_item.tsx +9 -2
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +5 -1
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +5 -1
- data/app/pb_kits/playbook/pb_title/_title.tsx +5 -1
- data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +5 -1
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +16 -3
- data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +5 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default_swift.md +11 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_name_swift.md +10 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_props_swift.md +6 -0
- data/app/pb_kits/playbook/pb_toggle/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +5 -1
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +38 -38
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +7 -2
- data/app/pb_kits/playbook/pb_user/_user.tsx +5 -1
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +5 -1
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +5 -1
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +5 -1
- data/app/pb_kits/playbook/utilities/props.ts +16 -0
- data/dist/playbook-rails.js +7 -7
- data/lib/playbook/version.rb +1 -1
- metadata +18 -2
@@ -1,7 +1,7 @@
|
|
1
|
-
/* eslint-disable */
|
2
1
|
import React, { useState, useEffect } from "react";
|
3
2
|
import classnames from "classnames";
|
4
3
|
import HighchartsReact from "highcharts-react-official";
|
4
|
+
import Highcharts from "highcharts";
|
5
5
|
import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
|
6
6
|
import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
|
7
7
|
import mapColors from "../pb_dashboard/pbChartsColorsHelper";
|
@@ -10,30 +10,31 @@ import solidGauge from "highcharts/modules/solid-gauge";
|
|
10
10
|
import defaultColors from "../tokens/exports/_colors.scss";
|
11
11
|
import typography from "../tokens/exports/_typography.scss";
|
12
12
|
|
13
|
-
import { buildAriaProps, buildCss, buildDataProps } from "../utilities/props";
|
13
|
+
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
|
14
14
|
import { globalProps } from "../utilities/globalProps";
|
15
15
|
|
16
16
|
type GaugeProps = {
|
17
|
-
aria: { [key: string]: string }
|
18
|
-
className?: string
|
19
|
-
chartData?: { name: string
|
20
|
-
dark?: Boolean
|
21
|
-
data?: { [key: string]: string }
|
22
|
-
disableAnimation?: boolean
|
23
|
-
fullCircle?: boolean
|
24
|
-
height?: string
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
17
|
+
aria: { [key: string]: string };
|
18
|
+
className?: string;
|
19
|
+
chartData?: { name: string; value: number[] | number }[];
|
20
|
+
dark?: Boolean;
|
21
|
+
data?: { [key: string]: string };
|
22
|
+
disableAnimation?: boolean;
|
23
|
+
fullCircle?: boolean;
|
24
|
+
height?: string;
|
25
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
26
|
+
id?: string;
|
27
|
+
max?: number;
|
28
|
+
min?: number;
|
29
|
+
prefix?: string;
|
30
|
+
showLabels?: boolean;
|
31
|
+
style?: string;
|
32
|
+
suffix?: string;
|
33
|
+
title?: string;
|
34
|
+
tooltipHtml?: string;
|
35
|
+
colors: string[];
|
36
|
+
minorTickInterval: any;
|
37
|
+
circumference: number[];
|
37
38
|
};
|
38
39
|
|
39
40
|
const Gauge = ({
|
@@ -45,6 +46,7 @@ const Gauge = ({
|
|
45
46
|
disableAnimation = false,
|
46
47
|
fullCircle = false,
|
47
48
|
height = null,
|
49
|
+
htmlOptions = {},
|
48
50
|
id,
|
49
51
|
max = 100,
|
50
52
|
min = 0,
|
@@ -61,14 +63,30 @@ const Gauge = ({
|
|
61
63
|
...props
|
62
64
|
}: GaugeProps) => {
|
63
65
|
const ariaProps = buildAriaProps(aria);
|
64
|
-
|
66
|
+
const dataProps = buildDataProps(data)
|
67
|
+
const htmlProps = buildHtmlProps(htmlOptions);
|
68
|
+
highchartsMore(Highcharts);
|
69
|
+
solidGauge(Highcharts);
|
70
|
+
const setupTheme = () => {
|
71
|
+
dark
|
72
|
+
? Highcharts.setOptions(highchartsDarkTheme)
|
73
|
+
: Highcharts.setOptions(highchartsTheme);
|
74
|
+
};
|
75
|
+
setupTheme();
|
76
|
+
|
77
|
+
//set tooltip directly to prevent being overriden by Highcharts defaults
|
78
|
+
Highcharts.setOptions({
|
79
|
+
tooltip: {
|
80
|
+
pointFormat: tooltipHtml,
|
81
|
+
followPointer: true,
|
82
|
+
},
|
83
|
+
});
|
65
84
|
|
66
85
|
const css = buildCss({
|
67
86
|
pb_gauge_kit: true,
|
68
87
|
});
|
69
88
|
|
70
89
|
const [options, setOptions] = useState({});
|
71
|
-
const [isHighchartsLoaded, setIsHighchartsLoaded] = useState(false);
|
72
90
|
|
73
91
|
useEffect(() => {
|
74
92
|
const formattedChartData = chartData.map((obj: any) => {
|
@@ -125,7 +143,7 @@ const Gauge = ({
|
|
125
143
|
colors:
|
126
144
|
colors !== undefined && colors.length > 0
|
127
145
|
? mapColors(colors)
|
128
|
-
: highchartsTheme
|
146
|
+
: highchartsTheme.colors,
|
129
147
|
plotOptions: {
|
130
148
|
series: {
|
131
149
|
animation: !disableAnimation,
|
@@ -134,7 +152,7 @@ const Gauge = ({
|
|
134
152
|
borderColor:
|
135
153
|
colors !== undefined && colors.length === 1
|
136
154
|
? mapColors(colors).join()
|
137
|
-
: highchartsTheme
|
155
|
+
: highchartsTheme.colors[0],
|
138
156
|
borderWidth: 20,
|
139
157
|
radius: 90,
|
140
158
|
innerRadius: "90%",
|
@@ -159,53 +177,27 @@ const Gauge = ({
|
|
159
177
|
|
160
178
|
setOptions({ ...staticOptions });
|
161
179
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
prefix.setAttribute("y", "28");
|
171
|
-
});
|
172
|
-
document
|
173
|
-
.querySelectorAll(".fix")
|
174
|
-
.forEach((fix) => fix.setAttribute("y", "38"));
|
175
|
-
}
|
176
|
-
}, 0)
|
177
|
-
|
178
|
-
dark
|
179
|
-
? window.Highcharts.setOptions(highchartsDarkTheme(window.Highcharts))
|
180
|
-
: window.Highcharts.setOptions(highchartsTheme(window.Highcharts))
|
181
|
-
|
182
|
-
highchartsMore(window.Highcharts);
|
183
|
-
solidGauge(window.Highcharts);
|
184
|
-
|
185
|
-
//set tooltip directly to prevent being overriden by window.Highcharts defaults
|
186
|
-
window.Highcharts.setOptions({
|
187
|
-
tooltip: {
|
188
|
-
pointFormat: tooltipHtml,
|
189
|
-
followPointer: true,
|
190
|
-
},
|
191
|
-
});
|
192
|
-
|
193
|
-
setIsHighchartsLoaded(true)
|
194
|
-
}
|
195
|
-
}, 0)
|
180
|
+
if (document.querySelector(".prefix")) {
|
181
|
+
document.querySelectorAll(".prefix").forEach((prefix) => {
|
182
|
+
prefix.setAttribute("y", "28");
|
183
|
+
});
|
184
|
+
document
|
185
|
+
.querySelectorAll(".fix")
|
186
|
+
.forEach((fix) => fix.setAttribute("y", "38"));
|
187
|
+
}
|
196
188
|
|
197
189
|
}, [chartData]);
|
198
190
|
|
199
191
|
return (
|
200
|
-
isHighchartsLoaded &&
|
201
192
|
<HighchartsReact
|
202
193
|
containerProps={{
|
203
194
|
className: classnames(css, globalProps(props)),
|
204
195
|
id: id,
|
205
196
|
...ariaProps,
|
206
197
|
...dataProps,
|
198
|
+
...htmlProps,
|
207
199
|
}}
|
208
|
-
highcharts={
|
200
|
+
highcharts={Highcharts}
|
209
201
|
options={options}
|
210
202
|
/>
|
211
203
|
);
|
@@ -4,7 +4,7 @@
|
|
4
4
|
import React from 'react'
|
5
5
|
import classnames from 'classnames'
|
6
6
|
|
7
|
-
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
7
|
+
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
8
8
|
import { globalProps, GlobalProps } from '../utilities/globalProps'
|
9
9
|
|
10
10
|
import Badge from '../pb_badge/_badge'
|
@@ -14,6 +14,7 @@ type HashtagProps = {
|
|
14
14
|
className?: string,
|
15
15
|
dark?: boolean,
|
16
16
|
data?: string,
|
17
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
17
18
|
id?: string,
|
18
19
|
newWindow?: boolean,
|
19
20
|
rel?: string,
|
@@ -35,6 +36,7 @@ const Hashtag = (props: HashtagProps) => {
|
|
35
36
|
className,
|
36
37
|
dark = false,
|
37
38
|
data = {},
|
39
|
+
htmlOptions = {},
|
38
40
|
id,
|
39
41
|
newWindow,
|
40
42
|
rel,
|
@@ -45,12 +47,14 @@ const Hashtag = (props: HashtagProps) => {
|
|
45
47
|
|
46
48
|
const ariaProps = buildAriaProps(aria)
|
47
49
|
const dataProps = buildDataProps(data)
|
50
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
48
51
|
const classes = classnames(buildCss('pb_hashtag_kit'), globalProps(props), className)
|
49
52
|
|
50
53
|
return (
|
51
54
|
<span
|
52
55
|
{...ariaProps}
|
53
56
|
{...dataProps}
|
57
|
+
{...htmlProps}
|
54
58
|
className={classes}
|
55
59
|
id={id}
|
56
60
|
>
|
@@ -3,10 +3,12 @@ import Highlighter from 'react-highlight-words'
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { globalProps, GlobalProps } from '../utilities/globalProps'
|
6
|
+
import { buildHtmlProps } from '../utilities/props'
|
6
7
|
|
7
8
|
type HighlightProps = {
|
8
9
|
className?: string,
|
9
10
|
data?: {[key: string]: string},
|
11
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
10
12
|
id?: string,
|
11
13
|
children?: React.ReactChild[] | React.ReactChild | string,
|
12
14
|
text?: string,
|
@@ -19,10 +21,12 @@ const Highlight = (props: HighlightProps): React.ReactElement => {
|
|
19
21
|
className = 'pb_highlight_kit',
|
20
22
|
data = {},
|
21
23
|
highlightedText = ['highlight'],
|
24
|
+
htmlOptions = {},
|
22
25
|
id = '',
|
23
26
|
text = '',
|
24
27
|
} = props
|
25
28
|
|
29
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
26
30
|
const highlightContent: any = text || children;
|
27
31
|
|
28
32
|
return (
|
@@ -34,6 +38,7 @@ const Highlight = (props: HighlightProps): React.ReactElement => {
|
|
34
38
|
id={id}
|
35
39
|
searchWords={highlightedText}
|
36
40
|
textToHighlight={highlightContent}
|
41
|
+
{...htmlProps}
|
37
42
|
/>
|
38
43
|
)
|
39
44
|
}
|
@@ -7,7 +7,7 @@ import { globalProps } from '../utilities/globalProps'
|
|
7
7
|
import Body from '../pb_body/_body'
|
8
8
|
import Hashtag from '../pb_hashtag/_hashtag'
|
9
9
|
import Title from '../pb_title/_title'
|
10
|
-
import { buildAriaProps, buildDataProps } from '../utilities/props'
|
10
|
+
import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
|
11
11
|
|
12
12
|
type HomeAddressStreetProps = {
|
13
13
|
aria?: { [key: string]: string },
|
@@ -18,6 +18,7 @@ type HomeAddressStreetProps = {
|
|
18
18
|
data?: { [key: string]: string },
|
19
19
|
dark?: boolean,
|
20
20
|
emphasis: "street" | "city",
|
21
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
21
22
|
homeId: string,
|
22
23
|
houseStyle: string,
|
23
24
|
homeUrl: string,
|
@@ -37,6 +38,7 @@ const HomeAddressStreet = (props: HomeAddressStreetProps) => {
|
|
37
38
|
data = {},
|
38
39
|
dark = false,
|
39
40
|
emphasis = 'street',
|
41
|
+
htmlOptions = {},
|
40
42
|
homeId,
|
41
43
|
homeUrl,
|
42
44
|
newWindow,
|
@@ -58,9 +60,14 @@ const HomeAddressStreet = (props: HomeAddressStreetProps) => {
|
|
58
60
|
|
59
61
|
const dataProps: { [key: string]: any } = buildDataProps(data)
|
60
62
|
const ariaProps: { [key: string]: any } = buildAriaProps(aria)
|
61
|
-
|
63
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
62
64
|
return (
|
63
|
-
<div
|
65
|
+
<div
|
66
|
+
className={classes(className, dark)}
|
67
|
+
{...ariaProps}
|
68
|
+
{...dataProps}
|
69
|
+
{...htmlProps}
|
70
|
+
>
|
64
71
|
{emphasis == 'street' &&
|
65
72
|
<div>
|
66
73
|
<Title
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
|
-
import { buildAriaProps, buildDataProps } from '../utilities/props'
|
3
|
+
import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
|
4
4
|
import { GlobalProps, globalProps } from '../utilities/globalProps'
|
5
5
|
import { isValidEmoji } from '../utilities/validEmojiChecker'
|
6
6
|
|
@@ -28,6 +28,7 @@ type IconProps = {
|
|
28
28
|
fixedWidth?: boolean,
|
29
29
|
flip?: "horizontal" | "vertical" | "both" | "none",
|
30
30
|
icon: string,
|
31
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
31
32
|
id?: string,
|
32
33
|
inverse?: boolean,
|
33
34
|
listItem?: boolean,
|
@@ -55,6 +56,7 @@ const Icon = (props: IconProps) => {
|
|
55
56
|
data = {},
|
56
57
|
fixedWidth = true,
|
57
58
|
flip = "none",
|
59
|
+
htmlOptions = {},
|
58
60
|
icon,
|
59
61
|
id,
|
60
62
|
inverse = false,
|
@@ -104,6 +106,7 @@ const Icon = (props: IconProps) => {
|
|
104
106
|
aria.label ? null : aria.label = `${icon} icon`
|
105
107
|
const ariaProps: {[key: string]: any} = buildAriaProps(aria)
|
106
108
|
const dataProps: {[key: string]: any} = buildDataProps(data)
|
109
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
107
110
|
|
108
111
|
// Add a conditional here to show only the SVG if custom
|
109
112
|
const displaySVG = (customIcon: any) => {
|
@@ -113,6 +116,7 @@ const Icon = (props: IconProps) => {
|
|
113
116
|
{
|
114
117
|
React.cloneElement(customIcon, {
|
115
118
|
...dataProps,
|
119
|
+
...htmlProps,
|
116
120
|
className: classes,
|
117
121
|
id,
|
118
122
|
})
|
@@ -124,6 +128,7 @@ const Icon = (props: IconProps) => {
|
|
124
128
|
<>
|
125
129
|
<span
|
126
130
|
{...dataProps}
|
131
|
+
{...htmlProps}
|
127
132
|
className={classesEmoji}
|
128
133
|
id={id}
|
129
134
|
>
|
@@ -137,6 +142,7 @@ const Icon = (props: IconProps) => {
|
|
137
142
|
<>
|
138
143
|
<i
|
139
144
|
{...dataProps}
|
145
|
+
{...htmlProps}
|
140
146
|
className={classes}
|
141
147
|
id={id}
|
142
148
|
/>
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
2
2
|
|
3
3
|
import classnames from 'classnames'
|
4
4
|
|
5
|
-
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
5
|
+
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
6
6
|
import { globalProps } from '../utilities/globalProps'
|
7
7
|
|
8
8
|
import Icon from '../pb_icon/_icon'
|
@@ -13,6 +13,7 @@ type IconCircleProps = {
|
|
13
13
|
dark?: boolean,
|
14
14
|
data?: {[key:string]: string},
|
15
15
|
icon: string,
|
16
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
16
17
|
id?: string,
|
17
18
|
size?: "base" | "xs" | "sm" | "md" | "lg" | "xl",
|
18
19
|
variant?: | "default"
|
@@ -32,6 +33,7 @@ const IconCircle = (props: IconCircleProps) => {
|
|
32
33
|
className,
|
33
34
|
dark = false,
|
34
35
|
data = {},
|
36
|
+
htmlOptions = {},
|
35
37
|
icon,
|
36
38
|
id,
|
37
39
|
size = 'md',
|
@@ -40,6 +42,7 @@ const IconCircle = (props: IconCircleProps) => {
|
|
40
42
|
|
41
43
|
const ariaProps = buildAriaProps(aria)
|
42
44
|
const dataProps = buildDataProps(data)
|
45
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
43
46
|
const classes = classnames(buildCss('pb_icon_circle_kit', size, variant), globalProps(props), className)
|
44
47
|
|
45
48
|
|
@@ -47,6 +50,7 @@ const IconCircle = (props: IconCircleProps) => {
|
|
47
50
|
<div
|
48
51
|
{...ariaProps}
|
49
52
|
{...dataProps}
|
53
|
+
{...htmlProps}
|
50
54
|
className={classes}
|
51
55
|
id={id}
|
52
56
|
>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
3
|
|
4
|
-
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
4
|
+
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
5
5
|
import { globalProps } from '../utilities/globalProps'
|
6
6
|
|
7
7
|
import Body from '../pb_body/_body'
|
@@ -16,6 +16,7 @@ type IconStatValueProps = {
|
|
16
16
|
data?: object,
|
17
17
|
dark?: boolean,
|
18
18
|
icon: string,
|
19
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
19
20
|
id?: string,
|
20
21
|
orientation?: "vertical" | "horizontal",
|
21
22
|
size?: "sm" | "md" | "lg",
|
@@ -39,6 +40,7 @@ const IconStatValue = (props: IconStatValueProps) => {
|
|
39
40
|
className,
|
40
41
|
data = {},
|
41
42
|
dark = false,
|
43
|
+
htmlOptions = {},
|
42
44
|
icon,
|
43
45
|
id,
|
44
46
|
orientation = 'horizontal',
|
@@ -50,6 +52,7 @@ const IconStatValue = (props: IconStatValueProps) => {
|
|
50
52
|
} = props
|
51
53
|
const ariaProps = buildAriaProps(aria)
|
52
54
|
const dataProps = buildDataProps(data)
|
55
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
53
56
|
const classes = classnames(
|
54
57
|
buildCss('pb_icon_stat_value_kit', orientation, size, variant), globalProps(props),
|
55
58
|
className
|
@@ -89,6 +92,7 @@ const IconStatValue = (props: IconStatValueProps) => {
|
|
89
92
|
<div
|
90
93
|
{...ariaProps}
|
91
94
|
{...dataProps}
|
95
|
+
{...htmlProps}
|
92
96
|
className={classes}
|
93
97
|
id={id}
|
94
98
|
>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
3
|
|
4
|
-
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
4
|
+
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
5
5
|
import { globalProps } from '../utilities/globalProps'
|
6
6
|
|
7
7
|
import Body from '../pb_body/_body'
|
@@ -14,6 +14,7 @@ type IconValueProps = {
|
|
14
14
|
dark?: boolean,
|
15
15
|
data?: object,
|
16
16
|
icon: string,
|
17
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
17
18
|
id?: string,
|
18
19
|
text: string,
|
19
20
|
}
|
@@ -25,12 +26,14 @@ const IconValue = (props: IconValueProps) => {
|
|
25
26
|
className,
|
26
27
|
dark,
|
27
28
|
data = {},
|
29
|
+
htmlOptions = {},
|
28
30
|
icon,
|
29
31
|
id,
|
30
32
|
text,
|
31
33
|
} = props
|
32
34
|
const ariaProps = buildAriaProps(aria)
|
33
35
|
const dataProps = buildDataProps(data)
|
36
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
34
37
|
const classes = classnames(
|
35
38
|
buildCss('pb_icon_value_kit', align),
|
36
39
|
globalProps(props),
|
@@ -41,6 +44,7 @@ const IconValue = (props: IconValueProps) => {
|
|
41
44
|
<div
|
42
45
|
{...ariaProps}
|
43
46
|
{...dataProps}
|
47
|
+
{...htmlProps}
|
44
48
|
className={classes}
|
45
49
|
id={id}
|
46
50
|
>
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
3
|
import { GlobalProps, globalProps } from '../utilities/globalProps'
|
4
|
-
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
4
|
+
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
5
5
|
|
6
6
|
type ImageType = {
|
7
7
|
alt?: string,
|
8
8
|
aria?: {[key: string]: string},
|
9
9
|
className?: string,
|
10
10
|
data?: {[key: string]: string},
|
11
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
11
12
|
id?: string,
|
12
13
|
onError?: () => void,
|
13
14
|
size?: "xs" | "sm" | "md" | "lg" | "xl",
|
@@ -22,6 +23,7 @@ const Image = (props: ImageType): React.ReactElement => {
|
|
22
23
|
aria = {},
|
23
24
|
className,
|
24
25
|
data = {},
|
26
|
+
htmlOptions = {},
|
25
27
|
id,
|
26
28
|
onError = null,
|
27
29
|
rounded = false,
|
@@ -40,11 +42,14 @@ const Image = (props: ImageType): React.ReactElement => {
|
|
40
42
|
className
|
41
43
|
)
|
42
44
|
const dataProps = buildDataProps(data)
|
45
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
46
|
+
|
43
47
|
|
44
48
|
return (
|
45
49
|
<img
|
46
50
|
{...ariaProps}
|
47
51
|
{...dataProps}
|
52
|
+
{...htmlProps}
|
48
53
|
alt={alt}
|
49
54
|
className={classes}
|
50
55
|
data-src={url}
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
2
2
|
import classnames from 'classnames'
|
3
3
|
import { globalProps } from '../utilities/globalProps'
|
4
4
|
|
5
|
-
import { buildAriaProps, buildDataProps } from '../utilities/props'
|
5
|
+
import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
|
6
6
|
|
7
7
|
import Pill from '../pb_pill/_pill'
|
8
8
|
import Caption from '../pb_caption/_caption'
|
@@ -11,6 +11,7 @@ type LabelPillProps = {
|
|
11
11
|
aria?: {[key: string]:string},
|
12
12
|
className?: string,
|
13
13
|
data?: {[key: string]:string},
|
14
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
14
15
|
id?: string,
|
15
16
|
label?: string,
|
16
17
|
pillValue?: string,
|
@@ -22,6 +23,7 @@ const LabelPill = (props: LabelPillProps) => {
|
|
22
23
|
aria = {},
|
23
24
|
className,
|
24
25
|
data = {},
|
26
|
+
htmlOptions = {},
|
25
27
|
id,
|
26
28
|
label,
|
27
29
|
pillValue,
|
@@ -29,6 +31,7 @@ const LabelPill = (props: LabelPillProps) => {
|
|
29
31
|
} = props
|
30
32
|
const ariaProps = buildAriaProps(aria)
|
31
33
|
const dataProps = buildDataProps(data)
|
34
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
32
35
|
const css = classnames(
|
33
36
|
'pb_label_pill_kit',
|
34
37
|
globalProps(props),
|
@@ -39,6 +42,7 @@ const LabelPill = (props: LabelPillProps) => {
|
|
39
42
|
<div
|
40
43
|
{...ariaProps}
|
41
44
|
{...dataProps}
|
45
|
+
{...htmlProps}
|
42
46
|
className={css}
|
43
47
|
id={id}
|
44
48
|
>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import classnames from "classnames";
|
3
|
-
import { buildAriaProps, buildCss, buildDataProps } from "../utilities/props";
|
3
|
+
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
|
4
4
|
import { globalProps } from "../utilities/globalProps";
|
5
5
|
import DateTime from '../pb_kit/dateTime';
|
6
6
|
|
@@ -17,6 +17,7 @@ type LabelValueProps = {
|
|
17
17
|
dark?: boolean;
|
18
18
|
data?: object;
|
19
19
|
date?: Date;
|
20
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function};
|
20
21
|
id?: string;
|
21
22
|
label: string;
|
22
23
|
value?: string;
|
@@ -42,6 +43,7 @@ const LabelValue = (props: LabelValueProps) => {
|
|
42
43
|
data = {},
|
43
44
|
date,
|
44
45
|
description,
|
46
|
+
htmlOptions = {},
|
45
47
|
icon,
|
46
48
|
id,
|
47
49
|
label,
|
@@ -51,7 +53,8 @@ const LabelValue = (props: LabelValueProps) => {
|
|
51
53
|
} = props;
|
52
54
|
|
53
55
|
const ariaProps = buildAriaProps(aria);
|
54
|
-
const dataProps = buildDataProps(data)
|
56
|
+
const dataProps = buildDataProps(data)
|
57
|
+
const htmlProps = buildHtmlProps(htmlOptions);
|
55
58
|
const variantClass = variant === "details" ? "details" : "";
|
56
59
|
const classes = classnames(
|
57
60
|
buildCss("pb_label_value_kit", variantClass),
|
@@ -63,6 +66,7 @@ const LabelValue = (props: LabelValueProps) => {
|
|
63
66
|
<div
|
64
67
|
{...ariaProps}
|
65
68
|
{...dataProps}
|
69
|
+
{...htmlProps}
|
66
70
|
className={classes}
|
67
71
|
id={id}
|
68
72
|
title={title}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
|
-
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
3
|
+
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
4
4
|
|
5
5
|
import { globalProps } from '../utilities/globalProps'
|
6
6
|
|
@@ -12,6 +12,7 @@ type LayoutPropTypes = {
|
|
12
12
|
dark?: boolean,
|
13
13
|
data?: object,
|
14
14
|
full?: boolean,
|
15
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
15
16
|
position?: "left" | "right",
|
16
17
|
responsive?: boolean,
|
17
18
|
size?: "xs" | "sm" | "md" | "base" | "lg" | "xl",
|
@@ -106,6 +107,7 @@ const Layout = (props: LayoutPropTypes) => {
|
|
106
107
|
dark = false,
|
107
108
|
data = {},
|
108
109
|
full = false,
|
110
|
+
htmlOptions = {},
|
109
111
|
position = 'left',
|
110
112
|
responsive = false,
|
111
113
|
size = 'md',
|
@@ -116,6 +118,8 @@ const Layout = (props: LayoutPropTypes) => {
|
|
116
118
|
const responsiveClass = responsive ? '_responsive' : ''
|
117
119
|
const ariaProps = buildAriaProps(aria)
|
118
120
|
const dataProps = buildDataProps(data)
|
121
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
122
|
+
|
119
123
|
const layoutCss =
|
120
124
|
layout == 'collection'
|
121
125
|
? `pb_layout_kit_${layout}`
|
@@ -159,6 +163,7 @@ const Layout = (props: LayoutPropTypes) => {
|
|
159
163
|
<div
|
160
164
|
{...ariaProps}
|
161
165
|
{...dataProps}
|
166
|
+
{...htmlProps}
|
162
167
|
className={classnames(
|
163
168
|
layoutCss,
|
164
169
|
layoutCollapseCss,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
3
|
|
4
|
-
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
4
|
+
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
5
5
|
import { globalProps } from '../utilities/globalProps'
|
6
6
|
|
7
7
|
import Body from '../pb_body/_body'
|
@@ -13,6 +13,7 @@ type LegendProps = {
|
|
13
13
|
color?: string,
|
14
14
|
dark?: boolean,
|
15
15
|
data?: object,
|
16
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
16
17
|
id?: string,
|
17
18
|
prefixText?: string,
|
18
19
|
text: string,
|
@@ -25,6 +26,7 @@ const Legend = (props: LegendProps) => {
|
|
25
26
|
color = 'data_1',
|
26
27
|
dark = false,
|
27
28
|
data = {},
|
29
|
+
htmlOptions = {},
|
28
30
|
id,
|
29
31
|
prefixText,
|
30
32
|
text,
|
@@ -32,6 +34,7 @@ const Legend = (props: LegendProps) => {
|
|
32
34
|
|
33
35
|
const ariaProps = buildAriaProps(aria)
|
34
36
|
const dataProps = buildDataProps(data)
|
37
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
35
38
|
|
36
39
|
const customColor = color.charAt(0) === '#' && color
|
37
40
|
|
@@ -50,6 +53,7 @@ const Legend = (props: LegendProps) => {
|
|
50
53
|
<div
|
51
54
|
{...ariaProps}
|
52
55
|
{...dataProps}
|
56
|
+
{...htmlProps}
|
53
57
|
className={bodyCss}
|
54
58
|
id={id}
|
55
59
|
>
|