playbook_ui 4.17.0 → 5.0.1.pre.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/helpers/playbook/pb_sample_helper.rb +1 -1
  4. data/app/pb_kits/playbook/_playbook.scss +2 -1
  5. data/app/pb_kits/playbook/data/menu.yml +5 -2
  6. data/app/pb_kits/playbook/index.js +1 -0
  7. data/app/pb_kits/playbook/packs/examples.js +4 -0
  8. data/app/pb_kits/playbook/packs/samples.js +4 -0
  9. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.html.erb +1 -0
  10. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.jsx +3 -0
  11. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +5 -0
  12. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +3 -0
  13. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.html.erb +15 -0
  14. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.jsx +24 -0
  15. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +6 -4
  16. data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +1 -0
  17. data/app/pb_kits/playbook/pb_caption/_caption.jsx +21 -4
  18. data/app/pb_kits/playbook/pb_card/_card.scss +1 -72
  19. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +72 -0
  20. data/app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx +0 -1
  21. data/app/pb_kits/playbook/pb_filter/Filter/SortMenu.jsx +1 -1
  22. data/app/pb_kits/playbook/pb_filter/templates/_default.html.erb +1 -1
  23. data/app/pb_kits/playbook/pb_installer/_installer.html.erb +16 -0
  24. data/app/pb_kits/playbook/pb_installer/_installer.jsx +54 -0
  25. data/app/pb_kits/playbook/pb_installer/_installer.scss +7 -0
  26. data/app/pb_kits/playbook/pb_installer/docs/_installer_default.html.erb +8 -0
  27. data/app/pb_kits/playbook/pb_installer/docs/_installer_default.jsx +16 -0
  28. data/app/pb_kits/playbook/pb_installer/docs/example.yml +9 -0
  29. data/app/pb_kits/playbook/pb_installer/docs/index.js +1 -0
  30. data/app/pb_kits/playbook/pb_installer/installer.rb +18 -0
  31. data/app/pb_kits/playbook/pb_label_value/_label_value.html.erb +1 -0
  32. data/app/pb_kits/playbook/pb_label_value/_label_value.jsx +22 -3
  33. data/app/pb_kits/playbook/pb_layout/_body.html.erb +1 -1
  34. data/app/pb_kits/playbook/pb_layout/_column.html.erb +7 -0
  35. data/app/pb_kits/playbook/pb_layout/_layout.jsx +35 -15
  36. data/app/pb_kits/playbook/pb_layout/_layout.scss +54 -0
  37. data/app/pb_kits/playbook/pb_layout/body.rb +4 -0
  38. data/app/pb_kits/playbook/pb_layout/docs/_layout_kanban.html.erb +140 -0
  39. data/app/pb_kits/playbook/pb_layout/docs/_layout_kanban.jsx +1234 -0
  40. data/app/pb_kits/playbook/pb_layout/docs/_layout_kanban_responsive.html.erb +57 -0
  41. data/app/pb_kits/playbook/pb_layout/docs/_layout_kanban_responsive.jsx +46 -0
  42. data/app/pb_kits/playbook/pb_layout/docs/example.yml +3 -0
  43. data/app/pb_kits/playbook/pb_layout/docs/index.js +2 -0
  44. data/app/pb_kits/playbook/pb_layout/layout.rb +12 -4
  45. data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +5 -0
  46. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.html.erb +16 -0
  47. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.jsx +23 -0
  48. data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +5 -3
  49. data/app/pb_kits/playbook/pb_line_graph/docs/index.js +1 -0
  50. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +3 -0
  51. data/app/pb_kits/playbook/pb_list/_item.html.erb +3 -2
  52. data/app/pb_kits/playbook/pb_list/_list.html.erb +3 -3
  53. data/app/pb_kits/playbook/pb_list/_list.jsx +55 -10
  54. data/app/pb_kits/playbook/pb_list/_list_item.jsx +41 -18
  55. data/app/pb_kits/playbook/pb_list/docs/_list_borderless.jsx +21 -0
  56. data/app/pb_kits/playbook/pb_list/docs/_list_dark.jsx +0 -5
  57. data/app/pb_kits/playbook/pb_list/docs/_list_dark_borderless.jsx +22 -0
  58. data/app/pb_kits/playbook/pb_list/docs/_list_dark_lg.jsx +22 -0
  59. data/app/pb_kits/playbook/pb_list/docs/_list_dark_ordered.jsx +22 -0
  60. data/app/pb_kits/playbook/pb_list/docs/_list_dark_xpadding.jsx +22 -0
  61. data/app/pb_kits/playbook/pb_list/docs/_list_layout_left.jsx +75 -0
  62. data/app/pb_kits/playbook/pb_list/docs/_list_layout_right.jsx +75 -0
  63. data/app/pb_kits/playbook/pb_list/docs/_list_lg.jsx +21 -0
  64. data/app/pb_kits/playbook/pb_list/docs/_list_ordered.jsx +21 -0
  65. data/app/pb_kits/playbook/pb_list/docs/_list_xpadding.jsx +21 -0
  66. data/app/pb_kits/playbook/pb_list/docs/example.yml +12 -1
  67. data/app/pb_kits/playbook/pb_list/docs/index.js +11 -0
  68. data/app/pb_kits/playbook/pb_logistic/_logistic.html.erb +1 -0
  69. data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +26 -4
  70. data/app/pb_kits/playbook/pb_message/_message.html.erb +1 -0
  71. data/app/pb_kits/playbook/pb_message/_message.jsx +25 -7
  72. data/app/pb_kits/playbook/pb_message/docs/_message_default.jsx +1 -2
  73. data/app/pb_kits/playbook/pb_message/message.rb +1 -1
  74. data/app/pb_kits/playbook/pb_person/_person.html.erb +9 -2
  75. data/app/pb_kits/playbook/pb_person/_person.jsx +34 -10
  76. data/app/pb_kits/playbook/pb_person/docs/_person_default.html.erb +5 -1
  77. data/app/pb_kits/playbook/pb_person_contact/_person_contact.html.erb +1 -0
  78. data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +57 -5
  79. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_with_wrong_numbers.jsx +32 -0
  80. data/app/pb_kits/playbook/pb_person_contact/docs/example.yml +2 -0
  81. data/app/pb_kits/playbook/pb_person_contact/docs/index.js +1 -0
  82. data/app/pb_kits/playbook/pb_popover/_popover.html.erb +4 -4
  83. data/app/pb_kits/playbook/pb_popover/_popover.jsx +41 -8
  84. data/app/pb_kits/playbook/pb_popover/_popover.scss +44 -7
  85. data/app/pb_kits/playbook/pb_popover/docs/_popover_close.html.erb +42 -0
  86. data/app/pb_kits/playbook/pb_popover/docs/_popover_close.jsx +99 -0
  87. data/app/pb_kits/playbook/pb_popover/docs/_popover_default.html.erb +19 -7
  88. data/app/pb_kits/playbook/pb_popover/docs/_popover_default.jsx +22 -6
  89. data/app/pb_kits/playbook/pb_popover/docs/_popover_list.html.erb +11 -10
  90. data/app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx +22 -18
  91. data/app/pb_kits/playbook/pb_popover/docs/_popover_list.md +1 -0
  92. data/app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.html.erb +24 -0
  93. data/app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx +56 -0
  94. data/app/pb_kits/playbook/pb_popover/docs/_popover_z_index.html.erb +14 -0
  95. data/app/pb_kits/playbook/pb_popover/docs/_popover_z_index.jsx +50 -0
  96. data/app/pb_kits/playbook/pb_popover/docs/example.yml +12 -8
  97. data/app/pb_kits/playbook/pb_popover/docs/index.js +3 -3
  98. data/app/pb_kits/playbook/pb_popover/index.js +18 -9
  99. data/app/pb_kits/playbook/pb_popover/popover.rb +26 -2
  100. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.html.erb +1 -0
  101. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.jsx +29 -5
  102. data/app/pb_kits/playbook/pb_section_separator/_section_separator.html.erb +1 -0
  103. data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +22 -13
  104. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text.jsx +3 -1
  105. data/app/pb_kits/playbook/pb_timeline/_item.html.erb +28 -0
  106. data/app/pb_kits/playbook/pb_timeline/_item.jsx +54 -0
  107. data/app/pb_kits/playbook/pb_timeline/_timeline.html.erb +6 -0
  108. data/app/pb_kits/playbook/pb_timeline/_timeline.jsx +43 -0
  109. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +271 -0
  110. data/app/pb_kits/playbook/pb_timeline/docs/_description.md +3 -0
  111. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_default.html.erb +43 -0
  112. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_default.jsx +73 -0
  113. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_vertical.html.erb +43 -0
  114. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_vertical.jsx +73 -0
  115. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.html.erb +44 -0
  116. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.jsx +85 -0
  117. data/app/pb_kits/playbook/pb_timeline/docs/example.yml +13 -0
  118. data/app/pb_kits/playbook/pb_timeline/docs/index.js +3 -0
  119. data/app/pb_kits/playbook/pb_timeline/item.rb +25 -0
  120. data/app/pb_kits/playbook/pb_timeline/timeline.rb +27 -0
  121. data/app/pb_kits/playbook/pb_title/_title.html.erb +1 -0
  122. data/app/pb_kits/playbook/pb_title/_title.jsx +24 -17
  123. data/app/pb_kits/playbook/plugins/pb_chart.js +8 -2
  124. data/app/pb_kits/playbook/props.rb +7 -0
  125. data/app/views/layouts/playbook/application.html.slim +2 -3
  126. data/app/views/layouts/playbook/fullscreen.html.slim +2 -2
  127. data/app/views/layouts/playbook/grid.html.slim +2 -2
  128. data/app/views/layouts/playbook/samples.html.erb +2 -4
  129. data/app/views/playbook/samples/filter_table/index.html.erb +348 -0
  130. data/app/views/playbook/samples/filter_table/index.jsx +433 -0
  131. data/app/views/playbook/samples/registration/index.html.erb +316 -0
  132. data/app/views/playbook/samples/registration/index.jsx +476 -0
  133. data/lib/playbook/version.rb +1 -1
  134. metadata +62 -79
  135. data/app/pb_kits/playbook/packs/kits/pb_avatar.js +0 -1
  136. data/app/pb_kits/playbook/packs/kits/pb_badge.js +0 -1
  137. data/app/pb_kits/playbook/packs/kits/pb_bar_graph.js +0 -1
  138. data/app/pb_kits/playbook/packs/kits/pb_body.js +0 -1
  139. data/app/pb_kits/playbook/packs/kits/pb_button.js +0 -1
  140. data/app/pb_kits/playbook/packs/kits/pb_caption.js +0 -1
  141. data/app/pb_kits/playbook/packs/kits/pb_card.js +0 -1
  142. data/app/pb_kits/playbook/packs/kits/pb_checkbox.js +0 -1
  143. data/app/pb_kits/playbook/packs/kits/pb_circle_icon_button.js +0 -1
  144. data/app/pb_kits/playbook/packs/kits/pb_contact.js +0 -1
  145. data/app/pb_kits/playbook/packs/kits/pb_currency.js +0 -1
  146. data/app/pb_kits/playbook/packs/kits/pb_dashboard_value.js +0 -1
  147. data/app/pb_kits/playbook/packs/kits/pb_date.js +0 -2
  148. data/app/pb_kits/playbook/packs/kits/pb_date_range_inline.js +0 -1
  149. data/app/pb_kits/playbook/packs/kits/pb_date_range_stacked.js +0 -1
  150. data/app/pb_kits/playbook/packs/kits/pb_date_stacked.js +0 -1
  151. data/app/pb_kits/playbook/packs/kits/pb_date_year_stacked.js +0 -2
  152. data/app/pb_kits/playbook/packs/kits/pb_distribution_bar.js +0 -2
  153. data/app/pb_kits/playbook/packs/kits/pb_fixed_confirmation_toast.js +0 -2
  154. data/app/pb_kits/playbook/packs/kits/pb_flex.js +0 -1
  155. data/app/pb_kits/playbook/packs/kits/pb_form_pill.js +0 -1
  156. data/app/pb_kits/playbook/packs/kits/pb_hashtag.js +0 -2
  157. data/app/pb_kits/playbook/packs/kits/pb_highlight.js +0 -2
  158. data/app/pb_kits/playbook/packs/kits/pb_home_address_street.js +0 -2
  159. data/app/pb_kits/playbook/packs/kits/pb_icon.js +0 -2
  160. data/app/pb_kits/playbook/packs/kits/pb_icon_circle.js +0 -2
  161. data/app/pb_kits/playbook/packs/kits/pb_icon_value.js +0 -2
  162. data/app/pb_kits/playbook/packs/kits/pb_image.js +0 -1
  163. data/app/pb_kits/playbook/packs/kits/pb_label_pill.js +0 -2
  164. data/app/pb_kits/playbook/packs/kits/pb_label_value.js +0 -2
  165. data/app/pb_kits/playbook/packs/kits/pb_layout.js +0 -2
  166. data/app/pb_kits/playbook/packs/kits/pb_legend.js +0 -2
  167. data/app/pb_kits/playbook/packs/kits/pb_line_graph.js +0 -1
  168. data/app/pb_kits/playbook/packs/kits/pb_list.js +0 -2
  169. data/app/pb_kits/playbook/packs/kits/pb_loading_inline.js +0 -2
  170. data/app/pb_kits/playbook/packs/kits/pb_message.js +0 -2
  171. data/app/pb_kits/playbook/packs/kits/pb_multiple_users.js +0 -2
  172. data/app/pb_kits/playbook/packs/kits/pb_multiple_users_stacked.js +0 -2
  173. data/app/pb_kits/playbook/packs/kits/pb_nav.js +0 -1
  174. data/app/pb_kits/playbook/packs/kits/pb_online_status.js +0 -2
  175. data/app/pb_kits/playbook/packs/kits/pb_person.js +0 -2
  176. data/app/pb_kits/playbook/packs/kits/pb_person_contact.js +0 -2
  177. data/app/pb_kits/playbook/packs/kits/pb_pill.js +0 -2
  178. data/app/pb_kits/playbook/packs/kits/pb_popover.js +0 -1
  179. data/app/pb_kits/playbook/packs/kits/pb_progress_pills.js +0 -2
  180. data/app/pb_kits/playbook/packs/kits/pb_progress_simple.js +0 -2
  181. data/app/pb_kits/playbook/packs/kits/pb_progress_step.js +0 -2
  182. data/app/pb_kits/playbook/packs/kits/pb_radio.js +0 -2
  183. data/app/pb_kits/playbook/packs/kits/pb_section_separator.js +0 -2
  184. data/app/pb_kits/playbook/packs/kits/pb_select.js +0 -2
  185. data/app/pb_kits/playbook/packs/kits/pb_selectable_card.js +0 -2
  186. data/app/pb_kits/playbook/packs/kits/pb_source.js +0 -2
  187. data/app/pb_kits/playbook/packs/kits/pb_star_rating.js +0 -2
  188. data/app/pb_kits/playbook/packs/kits/pb_stat_change.js +0 -2
  189. data/app/pb_kits/playbook/packs/kits/pb_stat_value.js +0 -2
  190. data/app/pb_kits/playbook/packs/kits/pb_table.js +0 -1
  191. data/app/pb_kits/playbook/packs/kits/pb_text_input.js +0 -1
  192. data/app/pb_kits/playbook/packs/kits/pb_textarea.js +0 -2
  193. data/app/pb_kits/playbook/packs/kits/pb_time.js +0 -2
  194. data/app/pb_kits/playbook/packs/kits/pb_timestamp.js +0 -2
  195. data/app/pb_kits/playbook/packs/kits/pb_title.js +0 -1
  196. data/app/pb_kits/playbook/packs/kits/pb_title_count.js +0 -2
  197. data/app/pb_kits/playbook/packs/kits/pb_title_detail.js +0 -2
  198. data/app/pb_kits/playbook/packs/kits/pb_toggle.js +0 -2
  199. data/app/pb_kits/playbook/packs/kits/pb_user.js +0 -2
  200. data/app/pb_kits/playbook/packs/kits/pb_user_badge.js +0 -2
  201. data/app/pb_kits/playbook/pb_popover/docs/_popover_click_any.html.erb +0 -19
  202. data/app/pb_kits/playbook/pb_popover/docs/_popover_click_any.jsx +0 -40
  203. data/app/pb_kits/playbook/pb_popover/docs/_popover_click_inside.html.erb +0 -14
  204. data/app/pb_kits/playbook/pb_popover/docs/_popover_click_inside.jsx +0 -40
  205. data/app/pb_kits/playbook/pb_popover/docs/_popover_click_outside.html.erb +0 -14
  206. data/app/pb_kits/playbook/pb_popover/docs/_popover_click_outside.jsx +0 -40
  207. data/app/pb_kits/playbook/pb_popover/docs/_popover_with_button.jsx +0 -34
  208. data/app/pb_kits/playbook/pb_popover/docs/_popover_with_circle.html.erb +0 -5
@@ -3,12 +3,17 @@
3
3
  import React from 'react'
4
4
  import { Avatar, Body, Caption } from '../'
5
5
  import classnames from 'classnames'
6
+ import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
7
  import { spacing } from '../utilities/spacing.js'
7
8
 
8
9
  type MessageProps = {
10
+ aria: object,
9
11
  avatarName?: String,
10
12
  avatarStatus?: String,
11
13
  avatarUrl?: String,
14
+ className?: String,
15
+ data?: object,
16
+ id?: String,
12
17
  label?: String,
13
18
  message: String,
14
19
  timestamp?: String,
@@ -16,20 +21,33 @@ type MessageProps = {
16
21
 
17
22
  const Message = (props: MessageProps) => {
18
23
  const {
19
- avatarName = '',
20
- avatarUrl = '',
21
- label = '',
22
- message = '',
23
- timestamp = '',
24
+ aria = {},
25
+ avatarName,
24
26
  avatarStatus = null,
27
+ avatarUrl,
28
+ className,
29
+ data = {},
30
+ id,
31
+ label,
32
+ message,
33
+ timestamp,
25
34
  } = props
35
+ const ariaProps = buildAriaProps(aria)
36
+ const dataProps = buildDataProps(data)
26
37
  const shouldDisplayAvatar = avatarUrl || avatarName
27
- const classes = shouldDisplayAvatar
38
+ const baseClassName = shouldDisplayAvatar
28
39
  ? 'pb_message_kit_avatar'
29
40
  : 'pb_message_kit'
30
41
 
42
+ const classes = classnames(buildCss(baseClassName), className, spacing(props))
43
+
31
44
  return (
32
- <div className={classnames(classes, spacing(props))}>
45
+ <div
46
+ {...ariaProps}
47
+ {...dataProps}
48
+ className={classes}
49
+ id={id}
50
+ >
33
51
  <If condition={shouldDisplayAvatar}>
34
52
  <Avatar
35
53
  imageUrl={avatarUrl}
@@ -4,7 +4,6 @@ import { Message } from '../../'
4
4
  const MessageDefault = () => {
5
5
  return (
6
6
  <div>
7
-
8
7
  <Message
9
8
  avatarName="Mike Bishop"
10
9
  avatarStatus="online"
@@ -31,7 +30,7 @@ const MessageDefault = () => {
31
30
  <Message
32
31
  avatarName="Lisa Thompson"
33
32
  avatarUrl="https://randomuser.me/api/portraits/women/39.jpg"
34
- message="To processs your order, I will need your full name."
33
+ message="To process your order, I will need your full name."
35
34
  timestamp="4 hours ago"
36
35
  />
37
36
 
@@ -25,7 +25,7 @@ module Playbook
25
25
  private
26
26
 
27
27
  def avatar_class
28
- avatar_name ? "avatar" : nil
28
+ valid? ? "avatar" : nil
29
29
  end
30
30
  end
31
31
  end
@@ -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: { tag: "span", classname: "pb_person_first", children: -> { object.first_name } }) %>
6
- <%= pb_rails("title", props: { text: object.last_name, size: 4 }) if object.last_name %>
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 %>
@@ -4,32 +4,56 @@ import React from 'react'
4
4
  import classnames from 'classnames'
5
5
  import { spacing } from '../utilities/spacing.js'
6
6
 
7
+ import {
8
+ buildAriaProps,
9
+ buildCss,
10
+ buildDataProps,
11
+ } from '../utilities/props'
12
+
7
13
  import { Body, Title } from '../'
8
14
 
9
15
  type PersonProps = {
16
+ aria?: object,
10
17
  className?: String | Array<String>,
11
- dark?: Boolean,
18
+ data?: object,
12
19
  firstName: String,
20
+ id?: String,
13
21
  lastName: String,
14
22
  }
15
23
 
16
24
  const Person = (props: PersonProps) => {
17
- const { className, dark = false, firstName, lastName } = props
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
+
18
37
  return (
19
- <div className={classnames('pb_person_kit', className, spacing(props))}>
38
+ <div
39
+ {...ariaProps}
40
+ {...dataProps}
41
+ className={classes}
42
+ id={id}
43
+ >
20
44
  <Body
21
45
  className="pb_person_first"
22
- dark={dark}
23
46
  tag="span"
24
47
  >
25
48
  {firstName}
26
49
  </Body>
27
- <Title
28
- className="pb_person_first"
29
- dark={dark}
30
- size={4}
31
- text={` ${lastName}`}
32
- />
50
+ <If condition={lastName}>
51
+ <Title
52
+ className="pb_person_first"
53
+ size={4}
54
+ text={` ${lastName}`}
55
+ />
56
+ </If>
33
57
  </div>
34
58
  )
35
59
  }
@@ -1 +1,5 @@
1
- <%= pb_rails("person", props: { first_name: "Kyle", last_name: "Fadigan" }) %>
1
+ <%= pb_rails("person",
2
+ props: {
3
+ first_name: "Kyle",
4
+ last_name: "Fadigan"
5
+ }) %>
@@ -1,4 +1,5 @@
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 %>
@@ -2,9 +2,16 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
+
6
+ import {
7
+ buildAriaProps,
8
+ buildCss,
9
+ buildDataProps,
10
+ } from '../utilities/props'
11
+
5
12
  import { spacing } from '../utilities/spacing.js'
6
13
 
7
- import { Contact, Person } from '../'
14
+ import { Caption, Contact, Person } from '../'
8
15
 
9
16
  type ContactItem = {
10
17
  contactType: String,
@@ -13,30 +20,75 @@ type ContactItem = {
13
20
  }
14
21
 
15
22
  type PersonContactProps = {
23
+ aria?: object,
16
24
  className?: String | Array<String>,
17
25
  dark?: Boolean,
26
+ data?: object,
18
27
  firstName: String,
28
+ id?: String,
19
29
  lastName: String,
20
30
  contacts?: Array<ContactItem>,
21
31
  }
22
32
 
23
33
  const PersonContact = (props: PersonContactProps) => {
24
- const { className, firstName, lastName, contacts } = props
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
+ )
25
59
 
26
60
  return (
27
- <div className={classnames('pb_person_contact_kit', className, spacing(props))}>
61
+ <div
62
+ {...ariaProps}
63
+ {...dataProps}
64
+ className={classes}
65
+ id={id}
66
+ >
28
67
  <Person
29
68
  firstName={firstName}
30
69
  lastName={lastName}
31
70
  />
32
- {contacts.map((contactObject, index) => (
71
+ {validContacts().map((contactObject, index) => (
33
72
  <Contact
34
73
  contactDetail={contactObject.contactDetail}
35
74
  contactType={contactObject.contactType}
36
75
  contactValue={contactObject.contactValue}
37
76
  key={index}
38
77
  />
39
- ))}
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
+ ))}
40
92
  </div>
41
93
  )
42
94
  }
@@ -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
@@ -10,3 +10,5 @@ examples:
10
10
  - person_contact_default: Default
11
11
  - person_contact_multiple: Multiple People
12
12
  - person_contact_with_detail: With Detail
13
+ - person_contact_with_wrong_numbers: With Wrong Numbers
14
+
@@ -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'
@@ -2,9 +2,9 @@
2
2
  id: object.id,
3
3
  data: object.data,
4
4
  class: object.classname) do %>
5
- <div class="popover_tooltip" id="<%= object.tooltip_id %>" role="tooltip">
6
- <%= pb_rails("card", props: {shadow: "deeper"}) do %>
5
+ <div class="pb_popover_tooltip" id="<%= object.tooltip_id %>" role="tooltip" style="<%= object.z_index_helper %>">
6
+ <div class="pb_popover_body <%= object.popover_spacing_helper %>" style="<%= object.width_height_helper %>">
7
7
  <%= capture(&object.children) %>
8
- <% end %>
8
+ </div>
9
9
  </div>
10
- <% end %>
10
+ <% end %>
@@ -15,8 +15,6 @@ import { buildCss, noop } from '../utilities/props'
15
15
  import classnames from 'classnames'
16
16
  import { spacing } from '../utilities/spacing.js'
17
17
 
18
- import { Card } from '../'
19
-
20
18
  type PbPopoverProps = {
21
19
  className?: String,
22
20
  closeOnClick?: "outside" | "inside",
@@ -35,7 +33,7 @@ const POPOVER_MODIFIERS = {
35
33
  enabled: true,
36
34
  name: 'offset',
37
35
  options: {
38
- offset: [0, 8],
36
+ offset: [0, 20],
39
37
  },
40
38
  phase: 'main',
41
39
  },
@@ -53,7 +51,25 @@ const Popover = (props: PbPopoverProps) => {
53
51
  offset,
54
52
  placement,
55
53
  referenceElement,
54
+ zIndex,
55
+ maxHeight,
56
+ maxWidth,
57
+ minHeight,
58
+ minWidth,
56
59
  } = props
60
+
61
+ const popoverSpacing = spacing(props) ? spacing(props) : 'p_sm'
62
+ const zIndexStyle = zIndex ? { zIndex: zIndex } : {}
63
+ const widthHeightStyles = () => {
64
+ return Object.assign(
65
+ {},
66
+ maxHeight ? { maxHeight: maxHeight } : {},
67
+ maxWidth ? { maxWidth: maxWidth } : {},
68
+ minHeight ? { minHeight: minHeight } : {},
69
+ minWidth ? { minWidth: minWidth } : {}
70
+ )
71
+ }
72
+
57
73
  return (
58
74
  <Popper
59
75
  modifiers={popoverModifiers({ modifiers, offset })}
@@ -66,19 +82,26 @@ const Popover = (props: PbPopoverProps) => {
66
82
  className={`${buildCss('pb_popover_kit')} ${className}`}
67
83
  data-placement={placement}
68
84
  ref={ref}
69
- style={style}
85
+ style={Object.assign(
86
+ {},
87
+ style,
88
+ zIndexStyle
89
+ )}
70
90
  >
71
91
  <div
72
92
  className={classnames(
73
93
  `${buildCss('popover_tooltip')} show`
74
94
  )}
75
95
  >
76
- <Card
77
- className={spacing(props)}
78
- shadow="deeper"
96
+ <div
97
+ className={classnames(
98
+ 'popover_body',
99
+ popoverSpacing
100
+ )}
101
+ style={widthHeightStyles()}
79
102
  >
80
103
  {children}
81
- </Card>
104
+ </div>
82
105
  </div>
83
106
  </div>
84
107
  )
@@ -143,16 +166,26 @@ export default class PbReactPopover extends React.Component {
143
166
  referenceElement,
144
167
  show,
145
168
  usePortal,
169
+ zIndex,
170
+ maxHeight,
171
+ maxWidth,
172
+ minHeight,
173
+ minWidth,
146
174
  } = this.props
147
175
 
148
176
  const popoverComponent = (
149
177
  <Popover
150
178
  {...this.props}
151
179
  className={className}
180
+ maxHeight={maxHeight}
181
+ maxWidth={maxWidth}
182
+ minHeight={minHeight}
183
+ minWidth={minWidth}
152
184
  modifiers={modifiers}
153
185
  offset={offset}
154
186
  placement={placement}
155
187
  referenceElement={referenceElement}
188
+ zIndex={zIndex}
156
189
  >
157
190
  {children}
158
191
  </Popover>
@@ -1,15 +1,52 @@
1
1
  @import "../tokens/positioning";
2
+ @import "../pb_card/card_mixin";
3
+ @import "../tokens/shadows";
2
4
 
3
- [class^="pb_popover_kit"] {
4
- .popover_tooltip {
5
- display: none;
6
- &.show {
7
- display: block;
8
- z-index: $z_9;
9
- }
5
+ @keyframes fadeIn {
6
+ from {
7
+ opacity: 0;
8
+ }
9
+
10
+ to {
11
+ opacity: 1;
12
+ }
13
+ }
14
+ @keyframes fadeOut {
15
+ from {
16
+ opacity: 1;
17
+ }
18
+
19
+ to {
20
+ opacity: 0;
10
21
  }
11
22
  }
12
23
 
24
+ .pb_popover_tooltip {
25
+ opacity: 0;
26
+ animation-name: fadeOut;
27
+ animation-duration: 150ms;
28
+ animation-timing-function: linear;
29
+ animation-fill-mode: forwards;
30
+ visibility: hidden;
31
+ pointer-events: none;
32
+ &.show {
33
+ animation-name: fadeIn;
34
+ animation-duration: 150ms;
35
+ animation-timing-function: linear;
36
+ animation-fill-mode: forwards;
37
+ visibility: visible;
38
+ pointer-events: initial;
39
+ z-index: $z_9;
40
+ }
41
+ }
42
+ .pb_popover_body {
43
+ @include pb_card;
44
+ border: 0;
45
+ box-shadow: $shadow_deeper;
46
+ overflow: auto;
47
+ }
48
+
49
+
13
50
  .pb_popover_reference_wrapper {
14
51
  display: inline-block;
15
52
  }