playbook_ui 13.13.0.pre.alpha.play10821727 → 13.14.0.pre.alpha.PLAY1109bugdisplaypropblocksfontcolor1784
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/index.js +13 -1
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +5 -5
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +3 -3
- data/app/pb_kits/playbook/pb_background/_background.tsx +9 -9
- data/app/pb_kits/playbook/pb_badge/_badge.tsx +2 -2
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +3 -3
- data/app/pb_kits/playbook/pb_body/_body.tsx +5 -4
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.tsx +4 -3
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.tsx +3 -3
- data/app/pb_kits/playbook/pb_button/_button.tsx +37 -40
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.tsx +3 -3
- data/app/pb_kits/playbook/pb_caption/_caption.tsx +1 -1
- data/app/pb_kits/playbook/pb_card/_card.tsx +2 -2
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +0 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_background.jsx +4 -5
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +3 -3
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +9 -9
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +1 -1
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +7 -5
- data/app/pb_kits/playbook/pb_collapsible/_helper_functions.ts +2 -2
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +4 -5
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +12 -16
- data/app/pb_kits/playbook/pb_contact/_contact.tsx +3 -3
- data/app/pb_kits/playbook/pb_currency/_currency.tsx +2 -2
- data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +1 -1
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +57 -4
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +57 -4
- data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +16 -20
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_date/_date.tsx +7 -7
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +4 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +3 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +11 -10
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom.html.erb +29 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom.jsx +34 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom.md +7 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom_override.html.erb +28 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom_override.jsx +34 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom_override.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +69 -3
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +8 -8
- data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +1 -1
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js +3 -6
- data/app/pb_kits/playbook/pb_detail/_detail.scss +2 -2
- data/app/pb_kits/playbook/pb_detail/_detail.tsx +4 -4
- data/app/pb_kits/playbook/pb_detail/detail.rb +1 -1
- data/app/pb_kits/playbook/pb_detail/detail.test.jsx +2 -2
- data/app/pb_kits/playbook/pb_dialog/_close_icon.tsx +2 -2
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +34 -42
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.tsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +5 -4
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +4 -4
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.jsx +4 -8
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.jsx +4 -8
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_scrollable.jsx +2 -4
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.jsx +1 -1
- data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx +5 -5
- data/app/pb_kits/playbook/pb_enhanced_element/element_observer.ts +1 -1
- data/app/pb_kits/playbook/pb_enhanced_element/index.ts +1 -1
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +1 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex.tsx +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +1 -1
- data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +1 -1
- data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_image/_image.tsx +1 -1
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +1 -1
- data/app/pb_kits/playbook/pb_legend/_legend.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +1 -1
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -1
- data/app/pb_kits/playbook/pb_list/_list.tsx +1 -1
- data/app/pb_kits/playbook/pb_list/_list_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -1
- data/app/pb_kits/playbook/pb_map/_map.tsx +1 -1
- data/app/pb_kits/playbook/pb_message/_message.tsx +1 -1
- data/app/pb_kits/playbook/pb_message/_message_mention.tsx +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +1 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +1 -1
- data/app/pb_kits/playbook/pb_nav/_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_nav/_nav.tsx +1 -1
- data/app/pb_kits/playbook/pb_online_status/_online_status.tsx +1 -1
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +1 -1
- data/app/pb_kits/playbook/pb_person/_person.tsx +1 -1
- data/app/pb_kits/playbook/pb_person/docs/_person_default_swift.md +8 -0
- data/app/pb_kits/playbook/pb_person/docs/_person_props_swift.md +5 -0
- data/app/pb_kits/playbook/pb_person/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +1 -1
- data/app/pb_kits/playbook/pb_pill/_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +1 -1
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +1 -1
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +1 -1
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.tsx +1 -1
- data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_radio/_radio.tsx +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +1 -1
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +1 -1
- data/app/pb_kits/playbook/pb_select/_select.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +1 -1
- data/app/pb_kits/playbook/pb_source/_source.tsx +1 -1
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.scss +105 -53
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.tsx +185 -63
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_background_options.html.erb +2 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_background_options.jsx +25 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_color_options.html.erb +3 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_color_options.jsx +31 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.html.erb +6 -8
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.jsx +19 -6
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_hide.html.erb +4 -1
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_hide.jsx +30 -5
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_number_config.html.erb +6 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_number_config.jsx +58 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_size_options.html.erb +16 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_size_options.jsx +60 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +12 -5
- data/app/pb_kits/playbook/pb_star_rating/docs/index.js +8 -0
- data/app/pb_kits/playbook/pb_star_rating/star_rating.html.erb +54 -26
- data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +86 -6
- data/app/pb_kits/playbook/pb_star_rating/star_rating.test.js +34 -34
- data/app/pb_kits/playbook/pb_star_rating/stars/primary_star.svg +3 -0
- data/app/pb_kits/playbook/pb_star_rating/stars/star_outline.svg +3 -0
- data/app/pb_kits/playbook/pb_star_rating/stars/subtle_dark_star.svg +3 -0
- data/app/pb_kits/playbook/pb_star_rating/stars/subtle_star.svg +3 -0
- data/app/pb_kits/playbook/pb_star_rating/stars/yellow_star.svg +3 -0
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +1 -1
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/_table.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/_table_row.tsx +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +1 -1
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +1 -1
- data/app/pb_kits/playbook/pb_time/_time.tsx +1 -1
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +1 -1
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +1 -1
- data/app/pb_kits/playbook/pb_timeline/_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +1 -1
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +1 -1
- data/app/pb_kits/playbook/pb_title/_title.tsx +1 -1
- data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +1 -1
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +1 -1
- data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +1 -1
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +1 -1
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -1
- data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
- data/app/pb_kits/playbook/pb_user/docs/_user_horizontal_swift.md +37 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_props_table.md +10 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_size_swift.md +35 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_text_only_swift.md +27 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_vertical_size_swift.md +35 -0
- data/app/pb_kits/playbook/pb_user/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +1 -1
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +1 -1
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +1 -1
- data/app/pb_kits/playbook/utilities/props.ts +2 -2
- data/dist/playbook-rails.js +6 -6
- data/lib/playbook/version.rb +2 -2
- metadata +28 -3
- data/app/pb_kits/playbook/tokens/exports/exports.d.ts +0 -1
@@ -50,12 +50,12 @@ type ContactProps = {
|
|
50
50
|
contactDetail?: string,
|
51
51
|
contactType?: string,
|
52
52
|
contactValue: string,
|
53
|
-
data?:
|
54
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
53
|
+
data?: object,
|
54
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
55
55
|
id?: string,
|
56
56
|
}
|
57
57
|
|
58
|
-
const Contact = (props: ContactProps)
|
58
|
+
const Contact = (props: ContactProps) => {
|
59
59
|
const {
|
60
60
|
aria = {},
|
61
61
|
className,
|
@@ -18,7 +18,7 @@ type CurrencyProps = {
|
|
18
18
|
data?: {[key:string]:string},
|
19
19
|
decimals?: 'default' | 'matching',
|
20
20
|
emphasized?: boolean,
|
21
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
21
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
22
22
|
id?: string,
|
23
23
|
label?: string,
|
24
24
|
size?: 'sm' | 'md' | 'lg',
|
@@ -34,7 +34,7 @@ const sizes: {lg: 1, md: 3, sm: 4} = {
|
|
34
34
|
sm: 4,
|
35
35
|
}
|
36
36
|
|
37
|
-
const Currency = (props: CurrencyProps)
|
37
|
+
const Currency = (props: CurrencyProps) => {
|
38
38
|
const {
|
39
39
|
abbreviate = false,
|
40
40
|
align = 'left',
|
@@ -2,7 +2,7 @@ import colors from "../tokens/exports/_colors.scss";
|
|
2
2
|
|
3
3
|
|
4
4
|
// Map Data Color String Props to our SCSS Variables
|
5
|
-
const mapColors = (array: string[])
|
5
|
+
const mapColors = (array: string[]) => {
|
6
6
|
const regex = /(data)\-[1-8]/; //eslint-disable-line
|
7
7
|
|
8
8
|
const newArray = array.map((item) => {
|
@@ -3,6 +3,9 @@ import typography from '../tokens/exports/_typography.scss'
|
|
3
3
|
|
4
4
|
import { ThemeProps } from './themeTypes'
|
5
5
|
|
6
|
+
import Highcharts from 'highcharts'
|
7
|
+
|
8
|
+
const pbButtonHoverColor = '#004ebb'
|
6
9
|
const highchartsDarkTheme: ThemeProps = {
|
7
10
|
lang: {
|
8
11
|
thousandsSep: ',',
|
@@ -19,7 +22,7 @@ const highchartsDarkTheme: ThemeProps = {
|
|
19
22
|
chart: {
|
20
23
|
borderWidth: 0,
|
21
24
|
borderRadius: 0,
|
22
|
-
plotBackgroundColor:
|
25
|
+
plotBackgroundColor: null,
|
23
26
|
plotShadow: false,
|
24
27
|
plotBorderWidth: 0,
|
25
28
|
},
|
@@ -61,7 +64,7 @@ const highchartsDarkTheme: ThemeProps = {
|
|
61
64
|
},
|
62
65
|
},
|
63
66
|
yAxis: {
|
64
|
-
alternateGridColor:
|
67
|
+
alternateGridColor: null,
|
65
68
|
minorTickInterval: null,
|
66
69
|
gridLineColor: colors.border_dark,
|
67
70
|
minorGridLineColor: colors.border_dark,
|
@@ -101,6 +104,11 @@ const highchartsDarkTheme: ThemeProps = {
|
|
101
104
|
color: colors.text_dk_lighter,
|
102
105
|
},
|
103
106
|
},
|
107
|
+
labels: {
|
108
|
+
style: {
|
109
|
+
color: colors.primary,
|
110
|
+
},
|
111
|
+
},
|
104
112
|
tooltip: {
|
105
113
|
backgroundColor: {
|
106
114
|
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
@@ -122,15 +130,29 @@ const highchartsDarkTheme: ThemeProps = {
|
|
122
130
|
// specific to gauge
|
123
131
|
// unfilled gauge color
|
124
132
|
pane: {
|
125
|
-
background:
|
133
|
+
background: {
|
126
134
|
borderColor: colors.border_dark,
|
127
|
-
}
|
135
|
+
},
|
128
136
|
},
|
129
137
|
|
130
138
|
plotOptions: {
|
131
139
|
series: {
|
132
140
|
borderColor: colors.bg_dark_card,
|
133
141
|
borderWidth: 2,
|
142
|
+
type: 'area',
|
143
|
+
nullColor: colors.text_dk_lighter,
|
144
|
+
fillColor: {
|
145
|
+
linearGradient: {
|
146
|
+
x1: 0,
|
147
|
+
y1: 0,
|
148
|
+
x2: 0,
|
149
|
+
y2: 1,
|
150
|
+
},
|
151
|
+
stops: [
|
152
|
+
[0, Highcharts.getOptions().colors[0]],
|
153
|
+
[1, 'white'],
|
154
|
+
],
|
155
|
+
},
|
134
156
|
threshold: null,
|
135
157
|
},
|
136
158
|
// PIE STYLES
|
@@ -162,6 +184,15 @@ const highchartsDarkTheme: ThemeProps = {
|
|
162
184
|
marker: {
|
163
185
|
lineColor: colors.border_dark,
|
164
186
|
},
|
187
|
+
area: {
|
188
|
+
shadow: false,
|
189
|
+
states: {
|
190
|
+
hover: {
|
191
|
+
lineWidth: 1,
|
192
|
+
},
|
193
|
+
},
|
194
|
+
threshold: null,
|
195
|
+
},
|
165
196
|
},
|
166
197
|
|
167
198
|
//TREEMAP CHART STYLES
|
@@ -179,6 +210,7 @@ const highchartsDarkTheme: ThemeProps = {
|
|
179
210
|
colors.data_7,
|
180
211
|
colors.data_8,
|
181
212
|
],
|
213
|
+
colorByPoint: true,
|
182
214
|
dataLabels: {
|
183
215
|
enabled: true,
|
184
216
|
style: {
|
@@ -197,6 +229,27 @@ const highchartsDarkTheme: ThemeProps = {
|
|
197
229
|
],
|
198
230
|
traverseUpButton: {
|
199
231
|
position: { y: -50 },
|
232
|
+
text: '< Back',
|
233
|
+
theme: {
|
234
|
+
r: 4,
|
235
|
+
states: {
|
236
|
+
hover: {
|
237
|
+
style: {
|
238
|
+
fill: pbButtonHoverColor,
|
239
|
+
},
|
240
|
+
},
|
241
|
+
},
|
242
|
+
style: {
|
243
|
+
fill: colors.royal,
|
244
|
+
color: colors.white,
|
245
|
+
fontSize: `${typography.text_small}`,
|
246
|
+
fontWeight: typography.bold,
|
247
|
+
fontFamily: `${typography.font_family_base}`,
|
248
|
+
},
|
249
|
+
stroke: colors.royal,
|
250
|
+
height: 24,
|
251
|
+
width: 90,
|
252
|
+
},
|
200
253
|
},
|
201
254
|
},
|
202
255
|
},
|
@@ -3,6 +3,9 @@ import typography from '../tokens/exports/_typography.scss'
|
|
3
3
|
|
4
4
|
import { ThemeProps } from './themeTypes'
|
5
5
|
|
6
|
+
import Highcharts from 'highcharts'
|
7
|
+
|
8
|
+
const pbButtonHoverColor = '#004ebb'
|
6
9
|
const highchartsTheme: ThemeProps = {
|
7
10
|
lang: {
|
8
11
|
thousandsSep: ',',
|
@@ -19,7 +22,7 @@ const highchartsTheme: ThemeProps = {
|
|
19
22
|
chart: {
|
20
23
|
borderWidth: 0,
|
21
24
|
borderRadius: 0,
|
22
|
-
plotBackgroundColor:
|
25
|
+
plotBackgroundColor: null,
|
23
26
|
plotShadow: false,
|
24
27
|
plotBorderWidth: 0,
|
25
28
|
},
|
@@ -61,7 +64,7 @@ const highchartsTheme: ThemeProps = {
|
|
61
64
|
},
|
62
65
|
},
|
63
66
|
yAxis: {
|
64
|
-
alternateGridColor:
|
67
|
+
alternateGridColor: null,
|
65
68
|
minorTickInterval: null,
|
66
69
|
gridLineColor: colors.border_light,
|
67
70
|
minorGridLineColor: colors.border_light,
|
@@ -101,6 +104,11 @@ const highchartsTheme: ThemeProps = {
|
|
101
104
|
color: colors.text_lt_lighter,
|
102
105
|
},
|
103
106
|
},
|
107
|
+
labels: {
|
108
|
+
style: {
|
109
|
+
color: colors.primary,
|
110
|
+
},
|
111
|
+
},
|
104
112
|
tooltip: {
|
105
113
|
backgroundColor: {
|
106
114
|
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
@@ -122,13 +130,27 @@ const highchartsTheme: ThemeProps = {
|
|
122
130
|
// specific to gauge
|
123
131
|
// unfilled gauge color
|
124
132
|
pane: {
|
125
|
-
background:
|
133
|
+
background: {
|
126
134
|
borderColor: colors.border_light,
|
127
|
-
}
|
135
|
+
},
|
128
136
|
},
|
129
137
|
|
130
138
|
plotOptions: {
|
131
139
|
series: {
|
140
|
+
type: 'area',
|
141
|
+
nullColor: colors.text_lt_lighter,
|
142
|
+
fillColor: {
|
143
|
+
linearGradient: {
|
144
|
+
x1: 0,
|
145
|
+
y1: 0,
|
146
|
+
x2: 0,
|
147
|
+
y2: 1,
|
148
|
+
},
|
149
|
+
stops: [
|
150
|
+
[0, Highcharts.getOptions().colors[0]],
|
151
|
+
[1, 'white'],
|
152
|
+
],
|
153
|
+
},
|
132
154
|
threshold: null,
|
133
155
|
},
|
134
156
|
// PIE STYLES
|
@@ -160,6 +182,15 @@ const highchartsTheme: ThemeProps = {
|
|
160
182
|
marker: {
|
161
183
|
lineColor: '#333',
|
162
184
|
},
|
185
|
+
area: {
|
186
|
+
shadow: false,
|
187
|
+
states: {
|
188
|
+
hover: {
|
189
|
+
lineWidth: 1,
|
190
|
+
},
|
191
|
+
},
|
192
|
+
threshold: null,
|
193
|
+
},
|
163
194
|
},
|
164
195
|
|
165
196
|
//TREEMAP CHART STYLES
|
@@ -177,6 +208,7 @@ const highchartsTheme: ThemeProps = {
|
|
177
208
|
colors.data_7,
|
178
209
|
colors.data_8,
|
179
210
|
],
|
211
|
+
colorByPoint: true,
|
180
212
|
dataLabels: {
|
181
213
|
enabled: true,
|
182
214
|
style: {
|
@@ -195,6 +227,27 @@ const highchartsTheme: ThemeProps = {
|
|
195
227
|
],
|
196
228
|
traverseUpButton: {
|
197
229
|
position: { y: -50 },
|
230
|
+
text: '< Back',
|
231
|
+
theme: {
|
232
|
+
r: 4,
|
233
|
+
states: {
|
234
|
+
hover: {
|
235
|
+
style: {
|
236
|
+
fill: pbButtonHoverColor,
|
237
|
+
},
|
238
|
+
},
|
239
|
+
},
|
240
|
+
style: {
|
241
|
+
fill: colors.royal,
|
242
|
+
color: colors.white,
|
243
|
+
fontSize: `${typography.text_small}`,
|
244
|
+
fontWeight: typography.bold,
|
245
|
+
fontFamily: `${typography.font_family_base}`,
|
246
|
+
},
|
247
|
+
stroke: colors.royal,
|
248
|
+
height: 24,
|
249
|
+
width: 90,
|
250
|
+
},
|
198
251
|
},
|
199
252
|
},
|
200
253
|
},
|
@@ -1,20 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
9
|
-
|
10
|
-
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
> {
|
18
|
-
colorKey?: string;
|
19
|
-
legend?: LegendOptions;
|
20
|
-
}
|
1
|
+
export type ThemeProps = {
|
2
|
+
lang?: {[key: string]: string}
|
3
|
+
credits?: {[key: string]: boolean}
|
4
|
+
colors?: string[]
|
5
|
+
chart?: {[key: string]: any}
|
6
|
+
title?: {[key: string]: string | {}}
|
7
|
+
subtitle?: {[key: string]: string | {};}
|
8
|
+
xAxis?: {[key: string]: any;}
|
9
|
+
yAxis?: {[key: string]: any;}
|
10
|
+
legend?: {[key: string]: string | {};}
|
11
|
+
labels?: {[key: string]: {};}
|
12
|
+
tooltip?: {[key: string]: any;}
|
13
|
+
pane?: {[key: string]: {};}
|
14
|
+
plotOptions?: {[key: string]: any;}
|
15
|
+
colorKey?: string
|
16
|
+
}
|
@@ -12,7 +12,7 @@ type DashboardValueProps = {
|
|
12
12
|
aria?: { [key: string]: string },
|
13
13
|
className?: string,
|
14
14
|
data?: { [key: string]: string },
|
15
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
15
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
16
16
|
id?: string,
|
17
17
|
statChange?: {
|
18
18
|
change? : 'increase' | 'decrease' | 'neutral',
|
@@ -15,7 +15,7 @@ type PbDateProps = {
|
|
15
15
|
aria?: { [key: string]: string };
|
16
16
|
className?: string;
|
17
17
|
data?: { [key: string]: string };
|
18
|
-
htmlOptions?: { [key: string]: string | number | boolean |
|
18
|
+
htmlOptions?: { [key: string]: string | number | boolean | Function };
|
19
19
|
id?: string;
|
20
20
|
showDayOfWeek?: boolean;
|
21
21
|
showIcon?: boolean;
|
@@ -24,7 +24,7 @@ type PbDateProps = {
|
|
24
24
|
value: Date;
|
25
25
|
};
|
26
26
|
|
27
|
-
const PbDate = (props: PbDateProps)
|
27
|
+
const PbDate = (props: PbDateProps) => {
|
28
28
|
const {
|
29
29
|
aria = {},
|
30
30
|
alignment = "left",
|
@@ -57,11 +57,11 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
|
|
57
57
|
|
58
58
|
return (
|
59
59
|
<div
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
60
|
+
{...ariaProps}
|
61
|
+
{...dataProps}
|
62
|
+
{...htmlProps}
|
63
|
+
className={classes}
|
64
|
+
id={id}
|
65
65
|
>
|
66
66
|
{unstyled
|
67
67
|
? <>
|
@@ -13,6 +13,7 @@ type DatePickerProps = {
|
|
13
13
|
allowInput?: boolean,
|
14
14
|
aria?: { [key: string]: string },
|
15
15
|
className?: string,
|
16
|
+
customQuickPickDates: { override: boolean, dates: any[] },
|
16
17
|
dark?: boolean,
|
17
18
|
data?: { [key: string]: string },
|
18
19
|
defaultDate?: string,
|
@@ -25,7 +26,7 @@ type DatePickerProps = {
|
|
25
26
|
format?: string,
|
26
27
|
hideIcon?: boolean,
|
27
28
|
hideLabel?: boolean,
|
28
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
29
|
+
htmlOptions?: {[key: string]: string | number | boolean | Function},
|
29
30
|
id?: string,
|
30
31
|
inLine?: boolean,
|
31
32
|
inputAria?: { [key: string]: string },
|
@@ -56,6 +57,7 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
56
57
|
allowInput = false,
|
57
58
|
aria = {},
|
58
59
|
className,
|
60
|
+
customQuickPickDates,
|
59
61
|
dark = false,
|
60
62
|
data = {},
|
61
63
|
defaultDate = '',
|
@@ -104,6 +106,7 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
104
106
|
useEffect(() => {
|
105
107
|
datePickerHelper({
|
106
108
|
allowInput,
|
109
|
+
customQuickPickDates,
|
107
110
|
defaultDate,
|
108
111
|
disableDate,
|
109
112
|
disableRange,
|
@@ -5,6 +5,8 @@ module Playbook
|
|
5
5
|
class DatePicker < Playbook::KitBase
|
6
6
|
prop :allow_input, type: Playbook::Props::Boolean,
|
7
7
|
default: false
|
8
|
+
prop :custom_quick_pick_dates, type: Playbook::Props::HashProp,
|
9
|
+
default: {}
|
8
10
|
prop :dark, type: Playbook::Props::Boolean,
|
9
11
|
default: false
|
10
12
|
prop :default_date, type: Playbook::Props::String,
|
@@ -79,6 +81,7 @@ module Playbook
|
|
79
81
|
def date_picker_config
|
80
82
|
{
|
81
83
|
allowInput: allow_input,
|
84
|
+
customQuickPickDates: custom_quick_pick_dates,
|
82
85
|
defaultDate: default_date,
|
83
86
|
disableDate: disable_date,
|
84
87
|
disableRange: disable_range,
|
@@ -11,6 +11,7 @@ const getPositionElement = (element: string | Element) => {
|
|
11
11
|
|
12
12
|
type DatePickerConfig = {
|
13
13
|
closeOnSelect?: boolean,
|
14
|
+
customQuickPickDates: { override: boolean, dates: any[] },
|
14
15
|
disableDate?: number[],
|
15
16
|
disableRange?: number[],
|
16
17
|
disableWeekdays?: number[],
|
@@ -34,6 +35,7 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
34
35
|
const {
|
35
36
|
allowInput,
|
36
37
|
closeOnSelect = true,
|
38
|
+
customQuickPickDates = { override: true, dates: [] },
|
37
39
|
defaultDate,
|
38
40
|
disableDate,
|
39
41
|
disableRange,
|
@@ -121,27 +123,26 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
121
123
|
}
|
122
124
|
}
|
123
125
|
|
124
|
-
const setPlugins = (thisRangesEndToday: boolean) => {
|
126
|
+
const setPlugins = (thisRangesEndToday: boolean, customQuickPickDates: any) => {
|
125
127
|
const pluginList = []
|
126
|
-
|
128
|
+
|
127
129
|
// month and week selection
|
128
130
|
if (selectionType === "month" || plugins.length > 0) {
|
129
131
|
pluginList.push(monthSelectPlugin({ shorthand: true, dateFormat: 'F Y', altFormat: 'F Y' }))
|
130
132
|
} else if ( selectionType === "week") {
|
131
133
|
pluginList.push(weekSelect())
|
132
|
-
|
134
|
+
|
133
135
|
} else if (selectionType === "quickpick") {
|
134
|
-
|
135
|
-
|
136
|
+
//------- QUICKPICK VARIANT PLUGIN -------------//
|
137
|
+
pluginList.push(quickPickPlugin(thisRangesEndToday, customQuickPickDates))
|
136
138
|
}
|
137
|
-
|
139
|
+
|
138
140
|
// time selection
|
139
141
|
if (enableTime) pluginList.push(timeSelectPlugin({ caption: timeCaption, showTimezone: showTimezone}))
|
140
|
-
|
141
|
-
|
142
|
+
|
142
143
|
return pluginList
|
143
144
|
}
|
144
|
-
|
145
|
+
|
145
146
|
const getDateFormat = () => {
|
146
147
|
return enableTime ? `${format} ${timeFormat}` : format
|
147
148
|
}
|
@@ -181,7 +182,7 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
181
182
|
onYearChange: [() => {
|
182
183
|
yearChangeHook()
|
183
184
|
}],
|
184
|
-
plugins: setPlugins(thisRangesEndToday),
|
185
|
+
plugins: setPlugins(thisRangesEndToday, customQuickPickDates),
|
185
186
|
position,
|
186
187
|
positionElement: getPositionElement(positionElement),
|
187
188
|
prevArrow: '<i class="far fa-angle-left"></i>',
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<%= pb_rails("date_picker", props: {
|
2
|
+
allow_input: true,
|
3
|
+
custom_quick_pick_dates: {
|
4
|
+
dates: [
|
5
|
+
# Allow Playbook to handle the logic...
|
6
|
+
{
|
7
|
+
label: "Last 15 months",
|
8
|
+
value: {
|
9
|
+
timePeriod: "months",
|
10
|
+
amount: 15,
|
11
|
+
},
|
12
|
+
},
|
13
|
+
# Or, be explicit with an exact date range for more control...
|
14
|
+
{
|
15
|
+
label: "First Week of June 2022",
|
16
|
+
value: ["06/01/2022", "06/07/2022"],
|
17
|
+
},
|
18
|
+
],
|
19
|
+
},
|
20
|
+
end_date_id: "quick-pick-end-date",
|
21
|
+
end_date_name: "quick-pick-end-date",
|
22
|
+
mode: "range",
|
23
|
+
picker_id: "date-picker-quick-pick-custom",
|
24
|
+
placeholder: "mm/dd/yyyy to mm/dd/yyyy",
|
25
|
+
selection_type: "quickpick",
|
26
|
+
start_date_id: "quick-pick-start-date",
|
27
|
+
start_date_name: "quick-pick-start-date"
|
28
|
+
}) %>
|
29
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import DatePicker from "../_date_picker"
|
3
|
+
|
4
|
+
const DatePickerQuickPickCustom = (props) => (
|
5
|
+
<>
|
6
|
+
<DatePicker
|
7
|
+
allowInput
|
8
|
+
customQuickPickDates={{
|
9
|
+
dates: [
|
10
|
+
// Allow Playbook to handle the logic...
|
11
|
+
{
|
12
|
+
label: "Last 15 months",
|
13
|
+
value: {
|
14
|
+
timePeriod: "months",
|
15
|
+
amount: 15,
|
16
|
+
},
|
17
|
+
},
|
18
|
+
// Or, be explicit with an exact date range for more control...
|
19
|
+
{
|
20
|
+
label: "First Week of June 2022",
|
21
|
+
value: ["06/01/2022", "06/07/2022"],
|
22
|
+
},
|
23
|
+
],
|
24
|
+
}}
|
25
|
+
mode='range'
|
26
|
+
pickerId='date-picker-quick-pick-custom-override'
|
27
|
+
placeholder='mm/dd/yyyy to mm/dd/yyyy'
|
28
|
+
selectionType='quickpick'
|
29
|
+
{...props}
|
30
|
+
/>
|
31
|
+
</>
|
32
|
+
)
|
33
|
+
|
34
|
+
export default DatePickerQuickPickCustom
|
@@ -0,0 +1,7 @@
|
|
1
|
+
The customQuickPickDates/custom_quick_pick_dates prop allows for the user/dev to define their own quick pick dates.
|
2
|
+
The prop accepts an object with two key/value pairs: dates & override (separate doc example below).
|
3
|
+
|
4
|
+
The dates property accepts an array of objects. Each object in the array has label and value properties. The label is what will be displayed in the UI of the dropdown menu. The value property is just the date that is going to be passed to the datepicker. The value property can be an array of two strings that represent a range, allowing for the dev to be extremely specific. Additionally, the dates array allows for a clean, simple API under that automatically converts dates in a common vernacular.
|
5
|
+
|
6
|
+
The timePeriod property accepts "days", "weeks", "months", "quarters" or "years", representing past time periods.
|
7
|
+
The amount property accepts any number.
|
data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom_override.html.erb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
<%= pb_rails("date_picker", props: {
|
2
|
+
allow_input: true,
|
3
|
+
custom_quick_pick_dates: {
|
4
|
+
override: false,
|
5
|
+
dates: [
|
6
|
+
{
|
7
|
+
label: "Last 15 months",
|
8
|
+
value: {
|
9
|
+
timePeriod: "months",
|
10
|
+
amount: 15,
|
11
|
+
},
|
12
|
+
},
|
13
|
+
{
|
14
|
+
label: "First Week of June 2022",
|
15
|
+
value: ["06/01/2022", "06/07/2022"],
|
16
|
+
},
|
17
|
+
],
|
18
|
+
},
|
19
|
+
end_date_id: "quick-pick-end-date",
|
20
|
+
end_date_name: "quick-pick-end-date",
|
21
|
+
mode: "range",
|
22
|
+
picker_id: "date-picker-quick-pick-override",
|
23
|
+
placeholder: "mm/dd/yyyy to mm/dd/yyyy",
|
24
|
+
selection_type: "quickpick",
|
25
|
+
start_date_id: "quick-pick-start-date",
|
26
|
+
start_date_name: "quick-pick-start-date"
|
27
|
+
}) %>
|
28
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import DatePicker from "../_date_picker"
|
3
|
+
|
4
|
+
const DatePickerQuickPickCustomOverride = (props) => (
|
5
|
+
<>
|
6
|
+
<DatePicker
|
7
|
+
allowInput
|
8
|
+
customQuickPickDates={{
|
9
|
+
override: false,
|
10
|
+
dates: [
|
11
|
+
{
|
12
|
+
label: "Last 15 months",
|
13
|
+
value: {
|
14
|
+
timePeriod: "months",
|
15
|
+
amount: 15,
|
16
|
+
},
|
17
|
+
},
|
18
|
+
{
|
19
|
+
label: "First Week of June 2022",
|
20
|
+
value: ["06/01/2022", "06/07/2022"],
|
21
|
+
},
|
22
|
+
],
|
23
|
+
}}
|
24
|
+
marginTop='lg'
|
25
|
+
mode='range'
|
26
|
+
pickerId='date-picker-quick-pick-custom'
|
27
|
+
placeholder='mm/dd/yyyy to mm/dd/yyyy'
|
28
|
+
selectionType='quickpick'
|
29
|
+
{...props}
|
30
|
+
/>
|
31
|
+
</>
|
32
|
+
)
|
33
|
+
|
34
|
+
export default DatePickerQuickPickCustomOverride
|
@@ -0,0 +1 @@
|
|
1
|
+
The customQuickPickDates/custom_quick_pick_dates prop allows for an override boolean. The override allows for the user to completely override the quick pick dates that ship with the component. Default of `override` is set to true. If you would like to simply append your dates to the default quick pick dates, set this prop to false explicitly.
|
@@ -10,6 +10,8 @@ examples:
|
|
10
10
|
- date_picker_range: Range
|
11
11
|
- date_picker_quick_pick_rails: Range (Quick Pick)
|
12
12
|
- date_picker_quick_pick_range_limit: Range (Quick Pick w/ “This” Range limit)
|
13
|
+
- date_picker_quick_pick_custom: Custom Quick Pick Dates
|
14
|
+
- date_picker_quick_pick_custom_override: Custom Quick Pick Dates (append to defaults)
|
13
15
|
- date_picker_format: Format
|
14
16
|
- date_picker_disabled: Disabled Dates
|
15
17
|
- date_picker_min_max: Min Max
|
@@ -37,6 +39,8 @@ examples:
|
|
37
39
|
- date_picker_range: Range
|
38
40
|
- date_picker_quick_pick_react: Range (Quick Pick)
|
39
41
|
- date_picker_quick_pick_range_limit: Range (Quick Pick w/ “This” Range limit)
|
42
|
+
- date_picker_quick_pick_custom: Custom Quick Pick Dates
|
43
|
+
- date_picker_quick_pick_custom_override: Custom Quick Pick Dates (append to defaults)
|
40
44
|
- date_picker_format: Format
|
41
45
|
- date_picker_disabled: Disabled Dates
|
42
46
|
- date_picker_min_max: Min Max
|
@@ -22,3 +22,5 @@ export { default as DatePickerAllowInput } from './_date_picker_allow_input'
|
|
22
22
|
export { default as DatePickerQuickPickReact } from './_date_picker_quick_pick_react'
|
23
23
|
export { default as DatePickerQuickPickRangeLimit } from './_date_picker_quick_pick_range_limit'
|
24
24
|
export { default as DatePickerOnClose } from './_date_picker_on_close.jsx'
|
25
|
+
export { default as DatePickerQuickPickCustom } from './_date_picker_quick_pick_custom'
|
26
|
+
export { default as DatePickerQuickPickCustomOverride } from './_date_picker_quick_pick_custom_override'
|