playbook_ui 4.15.0 → 4.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/app/pb_kits/playbook/_playbook.scss +7 -1
- data/app/pb_kits/playbook/data/menu.yml +5 -1
- data/app/pb_kits/playbook/index.js +5 -0
- data/app/pb_kits/playbook/packs/examples.js +8 -0
- data/app/pb_kits/playbook/packs/samples.js +2 -0
- data/app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss +1 -1
- data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +24 -15
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_status.jsx +45 -0
- data/app/pb_kits/playbook/pb_avatar/docs/example.yml +6 -5
- data/app/pb_kits/playbook/pb_avatar/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.html.erb +33 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.jsx +81 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +63 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.rb +44 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +15 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +19 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +8 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +13 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +15 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +14 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +27 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +29 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +11 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +16 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +4 -0
- data/app/pb_kits/playbook/pb_badge/_badge.jsx +20 -14
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +9 -2
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +5 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.html.erb +2 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +2 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.html.erb +26 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.jsx +36 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.html.erb +14 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.jsx +23 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_body/_body.jsx +2 -1
- data/app/pb_kits/playbook/pb_body/docs/_body_light.jsx +4 -0
- data/app/pb_kits/playbook/pb_button/_button.jsx +2 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +6 -0
- data/app/pb_kits/playbook/pb_caption/_caption.jsx +19 -17
- data/app/pb_kits/playbook/pb_card/_card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_card/_card.jsx +35 -38
- data/app/pb_kits/playbook/pb_card/_card.scss +0 -10
- data/app/pb_kits/playbook/pb_card/card.rb +9 -3
- data/app/pb_kits/playbook/pb_card/card_body.rb +1 -5
- data/app/pb_kits/playbook/pb_card/card_header.rb +0 -3
- data/app/pb_kits/playbook/pb_card/docs/_card_light.html.erb +2 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +17 -18
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +10 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +3 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.html.erb +11 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.jsx +25 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_contact/_contact.html.erb +16 -3
- data/app/pb_kits/playbook/pb_contact/_contact.jsx +58 -34
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +1 -0
- data/app/pb_kits/playbook/pb_currency/_currency.html.erb +7 -9
- data/app/pb_kits/playbook/pb_currency/_currency.jsx +37 -21
- data/app/pb_kits/playbook/pb_currency/currency.rb +22 -29
- data/app/pb_kits/playbook/pb_currency/docs/_currency_dark.html.erb +3 -3
- data/app/pb_kits/playbook/pb_currency/docs/_currency_dark.jsx +2 -3
- data/app/pb_kits/playbook/pb_currency/docs/_currency_large.jsx +2 -3
- data/app/pb_kits/playbook/pb_currency/docs/_currency_medium.jsx +2 -2
- data/app/pb_kits/playbook/pb_currency/docs/_currency_small.html.erb +1 -1
- data/app/pb_kits/playbook/pb_currency/docs/_currency_small.jsx +5 -2
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +2 -2
- data/app/pb_kits/playbook/pb_date/_date.jsx +39 -15
- data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +3 -1
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.jsx +43 -37
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_default.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.jsx +6 -16
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.jsx +21 -18
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.jsx +30 -33
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx +10 -15
- data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.jsx +8 -8
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.jsx +13 -23
- data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.jsx +16 -14
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx +13 -12
- data/app/pb_kits/playbook/pb_flex/_flex.jsx +35 -20
- data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +6 -9
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +14 -19
- data/app/pb_kits/playbook/pb_hashtag/_hashtag.jsx +26 -22
- data/app/pb_kits/playbook/pb_highlight/_highlight.jsx +13 -12
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.jsx +85 -80
- data/app/pb_kits/playbook/pb_icon/_icon.jsx +54 -33
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.jsx +13 -9
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.jsx +16 -20
- data/app/pb_kits/playbook/pb_image/_image.jsx +12 -10
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.html.erb +1 -0
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +49 -14
- data/app/pb_kits/playbook/pb_label_pill/docs/_label_pill_default.jsx +50 -0
- data/app/pb_kits/playbook/pb_label_pill/docs/example.yml +4 -3
- data/app/pb_kits/playbook/pb_label_pill/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_label_pill/label_pill.rb +1 -1
- data/app/pb_kits/playbook/pb_label_value/_label_value.html.erb +1 -0
- data/app/pb_kits/playbook/pb_label_value/_label_value.jsx +30 -18
- data/app/pb_kits/playbook/pb_layout/_layout.jsx +51 -45
- data/app/pb_kits/playbook/pb_layout/_layout.scss +76 -57
- data/app/pb_kits/playbook/pb_layout/docs/_layout_collection.html.erb +54 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_collection.jsx +27 -0
- data/app/pb_kits/playbook/pb_layout/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_layout/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_layout/layout.rb +10 -2
- data/app/pb_kits/playbook/pb_legend/_legend.jsx +17 -15
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +9 -2
- data/app/pb_kits/playbook/pb_line_graph/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.html.erb +8 -8
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.html.erb +26 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +35 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.html.erb +15 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.jsx +23 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +5 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +6 -0
- data/app/pb_kits/playbook/pb_list/_list.jsx +24 -21
- data/app/pb_kits/playbook/pb_list/docs/_description.md +7 -1
- data/app/pb_kits/playbook/pb_list/docs/_list_layout_left.html.erb +8 -0
- data/app/pb_kits/playbook/pb_list/docs/_list_layout_right.html.erb +8 -0
- data/app/pb_kits/playbook/pb_list/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.jsx +21 -19
- data/app/pb_kits/playbook/pb_logistic/_logistic.html.erb +1 -0
- data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +26 -11
- data/app/pb_kits/playbook/pb_message/_message.html.erb +1 -0
- data/app/pb_kits/playbook/pb_message/_message.jsx +33 -11
- data/app/pb_kits/playbook/pb_message/docs/_message_default.jsx +1 -2
- data/app/pb_kits/playbook/pb_message/message.rb +1 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +10 -10
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.jsx +7 -19
- data/app/pb_kits/playbook/pb_nav/_nav.jsx +17 -14
- data/app/pb_kits/playbook/pb_online_status/_online_status.jsx +5 -13
- data/app/pb_kits/playbook/pb_person/_person.html.erb +9 -2
- data/app/pb_kits/playbook/pb_person/_person.jsx +36 -18
- data/app/pb_kits/playbook/pb_person/docs/_person_default.html.erb +5 -1
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.html.erb +1 -0
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +73 -21
- data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_with_wrong_numbers.jsx +32 -0
- data/app/pb_kits/playbook/pb_person_contact/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_person_contact/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_pill/_pill.jsx +5 -10
- data/app/pb_kits/playbook/pb_popover/_popover.jsx +52 -41
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.html.erb +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.jsx +41 -13
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +15 -12
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +17 -10
- data/app/pb_kits/playbook/pb_radio/_radio.jsx +3 -1
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.html.erb +1 -0
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +30 -15
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text.jsx +3 -1
- data/app/pb_kits/playbook/pb_select/_select.jsx +4 -2
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.jsx +12 -7
- data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.html.erb +30 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.jsx +97 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.scss +74 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_checkmark.html.erb +29 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_checkmark.jsx +41 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_dark.html.erb +30 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_dark.jsx +40 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_default.html.erb +26 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_default.jsx +37 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_single_select.html.erb +27 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_single_select.jsx +40 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/example.yml +16 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/index.js +4 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.rb +50 -0
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.html.erb +24 -0
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.jsx +107 -0
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.scss +85 -0
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_dark.html.erb +26 -0
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_dark.jsx +43 -0
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.html.erb +23 -0
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.jsx +40 -0
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.html.erb +27 -0
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.jsx +46 -0
- data/app/pb_kits/playbook/pb_selectable_icon/docs/example.yml +12 -0
- data/app/pb_kits/playbook/pb_selectable_icon/docs/index.js +3 -0
- data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.rb +55 -0
- data/app/pb_kits/playbook/pb_source/_source.jsx +113 -13
- data/app/pb_kits/playbook/pb_source/docs/_source_default.html.erb +3 -1
- data/app/pb_kits/playbook/pb_source/docs/_source_default.jsx +37 -0
- data/app/pb_kits/playbook/pb_source/docs/_source_noicon.jsx +40 -0
- data/app/pb_kits/playbook/pb_source/docs/_source_types.jsx +85 -0
- data/app/pb_kits/playbook/pb_source/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_source/docs/index.js +5 -0
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.html.erb +6 -2
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.jsx +98 -13
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.jsx +28 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_hide.jsx +13 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_star_rating/docs/index.js +3 -0
- data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +2 -1
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +14 -13
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.jsx +2 -1
- data/app/pb_kits/playbook/pb_table/_table.jsx +29 -28
- data/app/pb_kits/playbook/pb_table/_table.scss +1 -1
- data/app/pb_kits/playbook/pb_table/_table_row.jsx +6 -7
- data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.html.erb +52 -8
- data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.jsx +52 -8
- data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.md +3 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.html.erb +5 -3
- data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +21 -5
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.html.erb +31 -5
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +3 -0
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +1 -1
- data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +2 -1
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx +38 -18
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.jsx +12 -11
- data/app/pb_kits/playbook/pb_timeline/_item.html.erb +28 -0
- data/app/pb_kits/playbook/pb_timeline/_item.jsx +54 -0
- data/app/pb_kits/playbook/pb_timeline/_timeline.html.erb +6 -0
- data/app/pb_kits/playbook/pb_timeline/_timeline.jsx +43 -0
- data/app/pb_kits/playbook/pb_timeline/_timeline.scss +271 -0
- data/app/pb_kits/playbook/pb_timeline/docs/_description.md +3 -0
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_default.html.erb +43 -0
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_default.jsx +73 -0
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_vertical.html.erb +43 -0
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_vertical.jsx +73 -0
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.html.erb +44 -0
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.jsx +85 -0
- data/app/pb_kits/playbook/pb_timeline/docs/example.yml +13 -0
- data/app/pb_kits/playbook/pb_timeline/docs/index.js +3 -0
- data/app/pb_kits/playbook/pb_timeline/item.rb +25 -0
- data/app/pb_kits/playbook/pb_timeline/timeline.rb +27 -0
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +7 -14
- data/app/pb_kits/playbook/pb_title/_title.jsx +12 -13
- data/app/pb_kits/playbook/pb_title/docs/_title_light.html.erb +1 -1
- data/app/pb_kits/playbook/pb_title_count/_title_count.jsx +49 -28
- data/app/pb_kits/playbook/pb_title_count/docs/_title_count_align.jsx +31 -0
- data/app/pb_kits/playbook/pb_title_count/docs/_title_count_default.jsx +13 -2
- data/app/pb_kits/playbook/pb_title_count/docs/example.yml +4 -5
- data/app/pb_kits/playbook/pb_title_count/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +7 -18
- data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +9 -11
- data/app/pb_kits/playbook/pb_user/_user.jsx +37 -37
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +7 -7
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.jsx +32 -30
- data/app/pb_kits/playbook/plugins/pb_chart.js +4 -0
- data/app/pb_kits/playbook/props.rb +48 -0
- data/app/pb_kits/playbook/tokens/_colors.scss +3 -3
- data/app/pb_kits/playbook/tokens/_spacing.scss +1 -0
- data/app/pb_kits/playbook/utilities/_spacing.scss +42 -0
- data/app/pb_kits/playbook/utilities/spacing.js +33 -0
- data/app/views/playbook/samples/dashboards/index.html.erb +3 -1
- data/app/views/playbook/samples/registration/index.html.erb +316 -0
- data/app/views/playbook/samples/registration/index.jsx +476 -0
- data/lib/playbook/version.rb +1 -1
- metadata +88 -4
@@ -3,17 +3,10 @@
|
|
3
3
|
|
4
4
|
import React from 'react'
|
5
5
|
import classnames from 'classnames'
|
6
|
+
import { spacing } from '../utilities/spacing.js'
|
7
|
+
import { Avatar, Badge } from '../'
|
6
8
|
|
7
|
-
import {
|
8
|
-
Avatar,
|
9
|
-
Badge,
|
10
|
-
} from '../'
|
11
|
-
|
12
|
-
import {
|
13
|
-
buildAriaProps,
|
14
|
-
buildCss,
|
15
|
-
buildDataProps,
|
16
|
-
} from '../utilities/props'
|
9
|
+
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
17
10
|
|
18
11
|
type MultipleUsersStackedProps = {
|
19
12
|
className?: String,
|
@@ -23,13 +16,8 @@ type MultipleUsersStackedProps = {
|
|
23
16
|
users: Array<Object>,
|
24
17
|
}
|
25
18
|
|
26
|
-
const MultipleUsersStacked = ({
|
27
|
-
className,
|
28
|
-
id,
|
29
|
-
aria = {},
|
30
|
-
data = {},
|
31
|
-
users,
|
32
|
-
}: MultipleUsersStackedProps) => {
|
19
|
+
const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
|
20
|
+
const { className, id, aria = {}, data = {}, users } = props
|
33
21
|
const moreThanTwo = users.length > 2
|
34
22
|
const onlyOne = users.length == 1
|
35
23
|
const displayCount = () => {
|
@@ -39,7 +27,7 @@ const MultipleUsersStacked = ({
|
|
39
27
|
const dataProps = buildDataProps(data)
|
40
28
|
const css = buildCss({
|
41
29
|
'pb_multiple_users_stacked_kit': true,
|
42
|
-
|
30
|
+
single: onlyOne,
|
43
31
|
})
|
44
32
|
|
45
33
|
const firstUser = () => {
|
@@ -87,7 +75,7 @@ const MultipleUsersStacked = ({
|
|
87
75
|
<div
|
88
76
|
{...ariaProps}
|
89
77
|
{...dataProps}
|
90
|
-
className={classnames(css, className)}
|
78
|
+
className={classnames(css, className, spacing(props))}
|
91
79
|
id={id}
|
92
80
|
>
|
93
81
|
{firstUser()}
|
@@ -1,34 +1,37 @@
|
|
1
1
|
/* @flow */
|
2
2
|
|
3
3
|
import React from 'react'
|
4
|
+
import classnames from 'classnames'
|
4
5
|
import { Caption } from '../'
|
5
6
|
import { buildCss } from '../utilities/props'
|
7
|
+
import { spacing } from '../utilities/spacing.js'
|
6
8
|
|
7
9
|
type NavProps = {
|
8
10
|
title: String,
|
9
|
-
orientation?:
|
11
|
+
orientation?: "vertical" | "horizontal",
|
10
12
|
link: String,
|
11
13
|
children?: React.Node,
|
12
14
|
className?: String | Array<String>,
|
13
15
|
highlight?: Boolean,
|
14
|
-
variant?:
|
16
|
+
variant?: "normal" | "subtle",
|
15
17
|
onClick?: EventHandler,
|
16
18
|
}
|
17
|
-
const Nav = ({
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
const Nav = (props: NavProps) => {
|
20
|
+
const {
|
21
|
+
title = '',
|
22
|
+
orientation = 'vertical',
|
23
|
+
link = '',
|
24
|
+
children,
|
25
|
+
className,
|
26
|
+
highlight = true,
|
27
|
+
variant = 'normal',
|
28
|
+
onClick = () => {},
|
29
|
+
} = props
|
27
30
|
const cardCss = buildCss('pb_nav_list', variant, orientation, className, {
|
28
|
-
|
31
|
+
highlight: highlight,
|
29
32
|
})
|
30
33
|
return (
|
31
|
-
<div className={cardCss}>
|
34
|
+
<div className={classnames(cardCss, spacing(props))}>
|
32
35
|
<If condition={title}>
|
33
36
|
<div className="pb_nav_list_title">
|
34
37
|
<a
|
@@ -2,10 +2,9 @@
|
|
2
2
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
|
+
import { spacing } from '../utilities/spacing.js'
|
5
6
|
|
6
|
-
import {
|
7
|
-
buildDataProps,
|
8
|
-
} from '../utilities/props'
|
7
|
+
import { buildDataProps } from '../utilities/props'
|
9
8
|
|
10
9
|
type OnlineStatusProps = {
|
11
10
|
className?: String,
|
@@ -14,17 +13,10 @@ type OnlineStatusProps = {
|
|
14
13
|
status?: "online" | "offline" | "away",
|
15
14
|
}
|
16
15
|
|
17
|
-
const OnlineStatus = ({
|
18
|
-
id,
|
19
|
-
data = {},
|
20
|
-
className,
|
21
|
-
status = 'offline',
|
22
|
-
}: OnlineStatusProps) => {
|
16
|
+
const OnlineStatus = (props: OnlineStatusProps) => {
|
17
|
+
const { id, data = {}, className, status = 'offline' } = props
|
23
18
|
const dataProps = buildDataProps(data)
|
24
|
-
const css = classnames([
|
25
|
-
`pb_online_status_kit_${status}`,
|
26
|
-
className,
|
27
|
-
])
|
19
|
+
const css = classnames([`pb_online_status_kit_${status}`, className], spacing(props))
|
28
20
|
|
29
21
|
return (
|
30
22
|
<div
|
@@ -1,7 +1,14 @@
|
|
1
1
|
<%= content_tag(:div,
|
2
|
+
aria: object.aria,
|
2
3
|
id: object.id,
|
3
4
|
data: object.data,
|
4
5
|
class: object.classname) do %>
|
5
|
-
<%= pb_rails("body", props: {
|
6
|
-
|
6
|
+
<%= pb_rails("body", props: {
|
7
|
+
tag: "span",
|
8
|
+
classname: "pb_person_first",
|
9
|
+
children: -> { object.first_name
|
10
|
+
} }) %>
|
11
|
+
<%= pb_rails("title", props: {
|
12
|
+
text: object.last_name,
|
13
|
+
size: 4 }) if object.last_name %>
|
7
14
|
<% end %>
|
@@ -2,40 +2,58 @@
|
|
2
2
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
|
+
import { spacing } from '../utilities/spacing.js'
|
5
6
|
|
6
7
|
import {
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
buildAriaProps,
|
9
|
+
buildCss,
|
10
|
+
buildDataProps,
|
11
|
+
} from '../utilities/props'
|
12
|
+
|
13
|
+
import { Body, Title } from '../'
|
10
14
|
|
11
15
|
type PersonProps = {
|
16
|
+
aria?: object,
|
12
17
|
className?: String | Array<String>,
|
13
|
-
|
18
|
+
data?: object,
|
14
19
|
firstName: String,
|
20
|
+
id?: String,
|
15
21
|
lastName: String,
|
16
22
|
}
|
17
23
|
|
18
|
-
const Person = ({
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
+
const Person = (props: PersonProps) => {
|
25
|
+
const {
|
26
|
+
aria = {},
|
27
|
+
className,
|
28
|
+
data = {},
|
29
|
+
firstName,
|
30
|
+
id,
|
31
|
+
lastName } = props
|
32
|
+
|
33
|
+
const ariaProps = buildAriaProps(aria)
|
34
|
+
const dataProps = buildDataProps(data)
|
35
|
+
const classes = classnames(buildCss('pb_person_kit'), className, spacing(props))
|
36
|
+
|
24
37
|
return (
|
25
|
-
<div
|
38
|
+
<div
|
39
|
+
{...ariaProps}
|
40
|
+
{...dataProps}
|
41
|
+
className={classes}
|
42
|
+
id={id}
|
43
|
+
>
|
26
44
|
<Body
|
27
45
|
className="pb_person_first"
|
28
|
-
dark={dark}
|
29
46
|
tag="span"
|
30
47
|
>
|
31
48
|
{firstName}
|
32
49
|
</Body>
|
33
|
-
<
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
50
|
+
<If condition={lastName}>
|
51
|
+
<Title
|
52
|
+
className="pb_person_first"
|
53
|
+
size={4}
|
54
|
+
text={` ${lastName}`}
|
55
|
+
/>
|
56
|
+
</If>
|
39
57
|
</div>
|
40
58
|
)
|
41
59
|
}
|
@@ -3,7 +3,15 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
|
6
|
-
import {
|
6
|
+
import {
|
7
|
+
buildAriaProps,
|
8
|
+
buildCss,
|
9
|
+
buildDataProps,
|
10
|
+
} from '../utilities/props'
|
11
|
+
|
12
|
+
import { spacing } from '../utilities/spacing.js'
|
13
|
+
|
14
|
+
import { Caption, Contact, Person } from '../'
|
7
15
|
|
8
16
|
type ContactItem = {
|
9
17
|
contactType: String,
|
@@ -12,33 +20,77 @@ type ContactItem = {
|
|
12
20
|
}
|
13
21
|
|
14
22
|
type PersonContactProps = {
|
23
|
+
aria?: object,
|
15
24
|
className?: String | Array<String>,
|
16
25
|
dark?: Boolean,
|
26
|
+
data?: object,
|
17
27
|
firstName: String,
|
28
|
+
id?: String,
|
18
29
|
lastName: String,
|
19
30
|
contacts?: Array<ContactItem>,
|
20
31
|
}
|
21
32
|
|
22
|
-
const PersonContact = ({
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
const PersonContact = (props: PersonContactProps) => {
|
34
|
+
const {
|
35
|
+
aria = {},
|
36
|
+
className,
|
37
|
+
contacts = [],
|
38
|
+
data = {},
|
39
|
+
firstName,
|
40
|
+
id,
|
41
|
+
lastName,
|
42
|
+
} = props
|
43
|
+
|
44
|
+
const ariaProps = buildAriaProps(aria)
|
45
|
+
const dataProps = buildDataProps(data)
|
46
|
+
const classes = classnames(buildCss('pb_person_contact_kit'), className, spacing(props))
|
47
|
+
|
48
|
+
const wrongContacts = () => (
|
49
|
+
contacts.filter((contactObject) => (
|
50
|
+
contactObject.contactType === 'wrong-phone'
|
51
|
+
))
|
52
|
+
)
|
53
|
+
|
54
|
+
const validContacts = () => (
|
55
|
+
contacts.filter((contactObject) => (
|
56
|
+
contactObject.contactType !== 'wrong-phone'
|
57
|
+
))
|
58
|
+
)
|
59
|
+
|
60
|
+
return (
|
61
|
+
<div
|
62
|
+
{...ariaProps}
|
63
|
+
{...dataProps}
|
64
|
+
className={classes}
|
65
|
+
id={id}
|
66
|
+
>
|
67
|
+
<Person
|
68
|
+
firstName={firstName}
|
69
|
+
lastName={lastName}
|
39
70
|
/>
|
40
|
-
|
41
|
-
|
42
|
-
|
71
|
+
{validContacts().map((contactObject, index) => (
|
72
|
+
<Contact
|
73
|
+
contactDetail={contactObject.contactDetail}
|
74
|
+
contactType={contactObject.contactType}
|
75
|
+
contactValue={contactObject.contactValue}
|
76
|
+
key={index}
|
77
|
+
/>
|
78
|
+
))}
|
79
|
+
{wrongContacts().map((contactObject, index) => (
|
80
|
+
<>
|
81
|
+
<Caption
|
82
|
+
className="wrong_numbers"
|
83
|
+
text="wrong number"
|
84
|
+
/>
|
85
|
+
<Contact
|
86
|
+
contactType={contactObject.contactType}
|
87
|
+
contactValue={contactObject.contactValue}
|
88
|
+
key={index}
|
89
|
+
/>
|
90
|
+
</>
|
91
|
+
))}
|
92
|
+
</div>
|
93
|
+
)
|
94
|
+
}
|
43
95
|
|
44
96
|
export default PersonContact
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { PersonContact } from '../../'
|
3
|
+
|
4
|
+
const PersonContactWithWrongNumbers = () => {
|
5
|
+
return (
|
6
|
+
<>
|
7
|
+
<PersonContact
|
8
|
+
contacts={[
|
9
|
+
{
|
10
|
+
contactType: 'email',
|
11
|
+
contactValue: 'email@example.com',
|
12
|
+
},
|
13
|
+
{
|
14
|
+
contactValue: '5555555555',
|
15
|
+
},
|
16
|
+
{
|
17
|
+
contactType: 'wrong-phone',
|
18
|
+
contactValue: '3245627482',
|
19
|
+
},
|
20
|
+
{
|
21
|
+
contactType: 'phone',
|
22
|
+
contactValue: '3048615385',
|
23
|
+
},
|
24
|
+
]}
|
25
|
+
firstName="Pauline"
|
26
|
+
lastName="Smith"
|
27
|
+
/>
|
28
|
+
</>
|
29
|
+
)
|
30
|
+
}
|
31
|
+
|
32
|
+
export default PersonContactWithWrongNumbers
|
@@ -1,3 +1,4 @@
|
|
1
1
|
export { default as PersonContactDefault } from './_person_contact_default.jsx'
|
2
2
|
export { default as PersonContactMultiple } from './_person_contact_multiple.jsx'
|
3
3
|
export { default as PersonContactWithDetail } from './_person_contact_with_detail.jsx'
|
4
|
+
export { default as PersonContactWithWrongNumbers } from './_person_contact_with_wrong_numbers.jsx'
|
@@ -4,23 +4,18 @@ import React from 'react'
|
|
4
4
|
|
5
5
|
import classnames from 'classnames'
|
6
6
|
import Title from '../pb_title/_title.jsx'
|
7
|
+
import { spacing } from '../utilities/spacing.js'
|
7
8
|
|
8
9
|
type PillProps = {
|
9
10
|
className?: String,
|
10
11
|
id?: String,
|
11
12
|
text: String,
|
12
|
-
variant?:
|
13
|
+
variant?: "success" | "warning" | "error" | "info" | "neutral",
|
13
14
|
}
|
14
15
|
|
15
|
-
const Pill = ({
|
16
|
-
className,
|
17
|
-
|
18
|
-
variant = 'neutral',
|
19
|
-
}: PillProps) => {
|
20
|
-
const css = classnames([
|
21
|
-
`pb_pill_kit_${variant}`,
|
22
|
-
className,
|
23
|
-
])
|
16
|
+
const Pill = (props: PillProps) => {
|
17
|
+
const { className, text, variant = 'neutral' } = props
|
18
|
+
const css = classnames([`pb_pill_kit_${variant}`, className], spacing(props))
|
24
19
|
|
25
20
|
return (
|
26
21
|
<div className={css}>
|
@@ -10,16 +10,16 @@ import {
|
|
10
10
|
Reference as PopperReference,
|
11
11
|
} from 'react-popper'
|
12
12
|
|
13
|
-
import {
|
14
|
-
|
15
|
-
|
16
|
-
} from '../utilities/
|
13
|
+
import { buildCss, noop } from '../utilities/props'
|
14
|
+
|
15
|
+
import classnames from 'classnames'
|
16
|
+
import { spacing } from '../utilities/spacing.js'
|
17
17
|
|
18
18
|
import { Card } from '../'
|
19
19
|
|
20
20
|
type PbPopoverProps = {
|
21
21
|
className?: String,
|
22
|
-
closeOnClick?:
|
22
|
+
closeOnClick?: "outside" | "inside",
|
23
23
|
offset?: Boolean,
|
24
24
|
reference: PopperReference,
|
25
25
|
show?: Boolean,
|
@@ -30,7 +30,8 @@ type PbPopoverProps = {
|
|
30
30
|
// https://popper.js.org/docs/v2/modifiers
|
31
31
|
|
32
32
|
const POPOVER_MODIFIERS = {
|
33
|
-
offset: {
|
33
|
+
offset: {
|
34
|
+
//https://popper.js.org/docs/v2/modifiers/offset/
|
34
35
|
enabled: true,
|
35
36
|
name: 'offset',
|
36
37
|
options: {
|
@@ -44,38 +45,47 @@ const popoverModifiers = ({ modifiers, offset }) => {
|
|
44
45
|
return offset ? modifiers.concat([POPOVER_MODIFIERS.offset]) : modifiers
|
45
46
|
}
|
46
47
|
|
47
|
-
const Popover = ({
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
48
|
+
const Popover = (props: PbPopoverProps) => {
|
49
|
+
const {
|
50
|
+
children,
|
51
|
+
className,
|
52
|
+
modifiers,
|
53
|
+
offset,
|
54
|
+
placement,
|
55
|
+
referenceElement,
|
56
|
+
} = props
|
57
|
+
return (
|
58
|
+
<Popper
|
59
|
+
modifiers={popoverModifiers({ modifiers, offset })}
|
60
|
+
placement={placement}
|
61
|
+
referenceElement={referenceElement}
|
62
|
+
>
|
63
|
+
{({ placement, ref, style }) => {
|
64
|
+
return (
|
65
|
+
<div
|
66
|
+
className={`${buildCss('pb_popover_kit')} ${className}`}
|
67
|
+
data-placement={placement}
|
68
|
+
ref={ref}
|
69
|
+
style={style}
|
70
|
+
>
|
71
|
+
<div
|
72
|
+
className={classnames(
|
73
|
+
`${buildCss('popover_tooltip')} show`
|
74
|
+
)}
|
75
|
+
>
|
76
|
+
<Card
|
77
|
+
className={spacing(props)}
|
78
|
+
shadow="deeper"
|
79
|
+
>
|
80
|
+
{children}
|
81
|
+
</Card>
|
82
|
+
</div>
|
72
83
|
</div>
|
73
|
-
</div>
|
74
84
|
)
|
75
|
-
}
|
76
|
-
|
77
|
-
|
78
|
-
|
85
|
+
}}
|
86
|
+
</Popper>
|
87
|
+
)
|
88
|
+
}
|
79
89
|
|
80
90
|
export default class PbReactPopover extends React.Component<PbPopoverProps> {
|
81
91
|
static defaultProps = {
|
@@ -94,8 +104,10 @@ export default class PbReactPopover extends React.Component
|
|
94
104
|
if (!closeOnClick) return
|
95
105
|
|
96
106
|
document.body.addEventListener('click', ({ target }) => {
|
97
|
-
const targetIsPopover =
|
98
|
-
|
107
|
+
const targetIsPopover =
|
108
|
+
target.closest('[class^=popover_tooltip]') !== null
|
109
|
+
const targetIsReference =
|
110
|
+
target.closest('.pb_popover_reference_wrapper') !== null
|
99
111
|
|
100
112
|
if (targetIsReference) return
|
101
113
|
|
@@ -135,6 +147,7 @@ export default class PbReactPopover extends React.Component
|
|
135
147
|
|
136
148
|
const popoverComponent = (
|
137
149
|
<Popover
|
150
|
+
{...this.props}
|
138
151
|
className={className}
|
139
152
|
modifiers={modifiers}
|
140
153
|
offset={offset}
|
@@ -154,9 +167,7 @@ export default class PbReactPopover extends React.Component
|
|
154
167
|
className="pb_popover_reference_wrapper"
|
155
168
|
ref={ref}
|
156
169
|
>
|
157
|
-
<reference.type
|
158
|
-
{...reference.props}
|
159
|
-
/>
|
170
|
+
<reference.type {...reference.props} />
|
160
171
|
</span>
|
161
172
|
)}
|
162
173
|
</PopperReference>
|