playbook_ui 4.17.0.pre.alpha1 → 4.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -6
  3. data/app/pb_kits/playbook/_playbook.scss +3 -0
  4. data/app/pb_kits/playbook/data/menu.yml +1 -0
  5. data/app/pb_kits/playbook/index.js +1 -4
  6. data/app/pb_kits/playbook/packs/examples.js +2 -0
  7. data/app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss +1 -1
  8. data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +24 -15
  9. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_status.jsx +45 -0
  10. data/app/pb_kits/playbook/pb_avatar/docs/example.yml +6 -5
  11. data/app/pb_kits/playbook/pb_avatar/docs/index.js +1 -0
  12. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.html.erb +32 -0
  13. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.jsx +78 -0
  14. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +63 -0
  15. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.rb +44 -0
  16. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +15 -0
  17. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +19 -0
  18. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +8 -0
  19. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +13 -0
  20. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +15 -0
  21. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +14 -0
  22. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +27 -0
  23. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +29 -0
  24. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +11 -0
  25. data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +16 -0
  26. data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +4 -0
  27. data/app/pb_kits/playbook/pb_badge/_badge.jsx +20 -14
  28. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +3 -2
  29. data/app/pb_kits/playbook/pb_body/_body.jsx +2 -1
  30. data/app/pb_kits/playbook/pb_body/docs/_body_light.jsx +4 -0
  31. data/app/pb_kits/playbook/pb_button/_button.jsx +2 -1
  32. data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +6 -0
  33. data/app/pb_kits/playbook/pb_caption/_caption.jsx +19 -17
  34. data/app/pb_kits/playbook/pb_card/_card.html.erb +1 -1
  35. data/app/pb_kits/playbook/pb_card/_card.jsx +35 -38
  36. data/app/pb_kits/playbook/pb_card/_card.scss +0 -10
  37. data/app/pb_kits/playbook/pb_card/card.rb +9 -3
  38. data/app/pb_kits/playbook/pb_card/card_body.rb +1 -5
  39. data/app/pb_kits/playbook/pb_card/card_header.rb +0 -3
  40. data/app/pb_kits/playbook/pb_card/docs/_card_light.html.erb +2 -1
  41. data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +17 -18
  42. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +4 -1
  43. data/app/pb_kits/playbook/pb_contact/_contact.html.erb +16 -3
  44. data/app/pb_kits/playbook/pb_contact/_contact.jsx +58 -34
  45. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +1 -1
  46. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +1 -0
  47. data/app/pb_kits/playbook/pb_currency/_currency.html.erb +1 -0
  48. data/app/pb_kits/playbook/pb_currency/_currency.jsx +37 -21
  49. data/app/pb_kits/playbook/pb_currency/docs/_currency_dark.html.erb +3 -3
  50. data/app/pb_kits/playbook/pb_currency/docs/_currency_dark.jsx +2 -3
  51. data/app/pb_kits/playbook/pb_currency/docs/_currency_large.jsx +2 -3
  52. data/app/pb_kits/playbook/pb_currency/docs/_currency_medium.jsx +2 -2
  53. data/app/pb_kits/playbook/pb_currency/docs/_currency_small.html.erb +1 -1
  54. data/app/pb_kits/playbook/pb_currency/docs/_currency_small.jsx +5 -2
  55. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +2 -2
  56. data/app/pb_kits/playbook/pb_date/_date.jsx +39 -15
  57. data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +3 -1
  58. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.jsx +43 -37
  59. data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_default.jsx +2 -2
  60. data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.jsx +6 -16
  61. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.jsx +21 -18
  62. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.jsx +30 -33
  63. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx +10 -15
  64. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.jsx +8 -8
  65. data/app/pb_kits/playbook/pb_file_upload/_file_upload.jsx +13 -23
  66. data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.jsx +16 -14
  67. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx +13 -12
  68. data/app/pb_kits/playbook/pb_flex/_flex.jsx +35 -20
  69. data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +6 -9
  70. data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +14 -19
  71. data/app/pb_kits/playbook/pb_hashtag/_hashtag.jsx +26 -22
  72. data/app/pb_kits/playbook/pb_highlight/_highlight.jsx +13 -12
  73. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.jsx +85 -80
  74. data/app/pb_kits/playbook/pb_icon/_icon.jsx +54 -33
  75. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.jsx +13 -9
  76. data/app/pb_kits/playbook/pb_icon_value/_icon_value.jsx +16 -20
  77. data/app/pb_kits/playbook/pb_image/_image.jsx +12 -10
  78. data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +15 -25
  79. data/app/pb_kits/playbook/pb_label_value/_label_value.jsx +10 -17
  80. data/app/pb_kits/playbook/pb_layout/_layout.jsx +49 -45
  81. data/app/pb_kits/playbook/pb_layout/_layout.scss +76 -57
  82. data/app/pb_kits/playbook/pb_layout/docs/_layout_collection.html.erb +54 -0
  83. data/app/pb_kits/playbook/pb_layout/docs/_layout_collection.jsx +27 -0
  84. data/app/pb_kits/playbook/pb_layout/docs/example.yml +2 -0
  85. data/app/pb_kits/playbook/pb_layout/docs/index.js +1 -0
  86. data/app/pb_kits/playbook/pb_layout/layout.rb +10 -2
  87. data/app/pb_kits/playbook/pb_legend/_legend.jsx +17 -15
  88. data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +3 -2
  89. data/app/pb_kits/playbook/pb_list/_list.jsx +24 -21
  90. data/app/pb_kits/playbook/pb_list/docs/_description.md +7 -1
  91. data/app/pb_kits/playbook/pb_list/docs/_list_layout_left.html.erb +8 -0
  92. data/app/pb_kits/playbook/pb_list/docs/_list_layout_right.html.erb +8 -0
  93. data/app/pb_kits/playbook/pb_list/docs/example.yml +2 -0
  94. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.jsx +21 -19
  95. data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +4 -11
  96. data/app/pb_kits/playbook/pb_message/_message.jsx +15 -11
  97. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +10 -10
  98. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.jsx +7 -19
  99. data/app/pb_kits/playbook/pb_nav/_nav.jsx +17 -14
  100. data/app/pb_kits/playbook/pb_online_status/_online_status.jsx +5 -13
  101. data/app/pb_kits/playbook/pb_person/_person.jsx +5 -11
  102. data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +20 -20
  103. data/app/pb_kits/playbook/pb_pill/_pill.jsx +5 -10
  104. data/app/pb_kits/playbook/pb_popover/_popover.jsx +52 -41
  105. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.jsx +16 -12
  106. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +15 -12
  107. data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +17 -10
  108. data/app/pb_kits/playbook/pb_radio/_radio.jsx +3 -1
  109. data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +19 -13
  110. data/app/pb_kits/playbook/pb_select/_select.jsx +4 -2
  111. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.jsx +12 -7
  112. data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +14 -13
  113. data/app/pb_kits/playbook/pb_stat_value/_stat_value.jsx +2 -1
  114. data/app/pb_kits/playbook/pb_table/_table.jsx +29 -28
  115. data/app/pb_kits/playbook/pb_table/_table.scss +1 -1
  116. data/app/pb_kits/playbook/pb_table/_table_row.jsx +6 -7
  117. data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.html.erb +52 -8
  118. data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.jsx +52 -8
  119. data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.md +3 -1
  120. data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +3 -5
  121. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +1 -1
  122. data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +2 -1
  123. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx +38 -18
  124. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.jsx +12 -11
  125. data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +7 -14
  126. data/app/pb_kits/playbook/pb_title/_title.jsx +12 -13
  127. data/app/pb_kits/playbook/pb_title/docs/_title_light.html.erb +1 -1
  128. data/app/pb_kits/playbook/pb_title_count/_title_count.jsx +49 -28
  129. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_align.jsx +31 -0
  130. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_default.jsx +13 -2
  131. data/app/pb_kits/playbook/pb_title_count/docs/example.yml +4 -5
  132. data/app/pb_kits/playbook/pb_title_count/docs/index.js +1 -0
  133. data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +7 -18
  134. data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +9 -11
  135. data/app/pb_kits/playbook/pb_user/_user.jsx +37 -37
  136. data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +7 -7
  137. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.jsx +32 -30
  138. data/app/pb_kits/playbook/props.rb +48 -0
  139. data/app/pb_kits/playbook/tokens/_spacing.scss +1 -0
  140. data/app/pb_kits/playbook/utilities/_spacing.scss +42 -0
  141. data/app/pb_kits/playbook/utilities/spacing.js +33 -0
  142. data/app/views/playbook/samples/dashboards/index.html.erb +3 -1
  143. data/lib/playbook/version.rb +1 -1
  144. data/lib/tasks/pb_release.rake +0 -2
  145. metadata +28 -6
@@ -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
- 'single': onlyOne,
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?: 'vertical' | 'horizontal',
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?: 'normal' | 'subtle',
16
+ variant?: "normal" | "subtle",
15
17
  onClick?: EventHandler,
16
18
  }
17
- const Nav = ({
18
- title = '',
19
- orientation = 'vertical',
20
- link = '',
21
- children,
22
- className,
23
- highlight = true,
24
- variant = 'normal',
25
- onClick = () => {},
26
- }: NavProps) => {
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
- 'highlight': highlight,
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
@@ -2,11 +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
- Body,
8
- Title,
9
- } from '../'
7
+ import { Body, Title } from '../'
10
8
 
11
9
  type PersonProps = {
12
10
  className?: String | Array<String>,
@@ -15,14 +13,10 @@ type PersonProps = {
15
13
  lastName: String,
16
14
  }
17
15
 
18
- const Person = ({
19
- className,
20
- dark = false,
21
- firstName,
22
- lastName,
23
- }: PersonProps) => {
16
+ const Person = (props: PersonProps) => {
17
+ const { className, dark = false, firstName, lastName } = props
24
18
  return (
25
- <div className={classnames('pb_person_kit', className)}>
19
+ <div className={classnames('pb_person_kit', className, spacing(props))}>
26
20
  <Body
27
21
  className="pb_person_first"
28
22
  dark={dark}
@@ -2,6 +2,7 @@
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 { Contact, Person } from '../'
7
8
 
@@ -19,26 +20,25 @@ type PersonContactProps = {
19
20
  contacts?: Array<ContactItem>,
20
21
  }
21
22
 
22
- const PersonContact = ({
23
- className,
24
- firstName,
25
- lastName,
26
- contacts,
27
- }: PersonContactProps) => (
28
- <div className={classnames('pb_person_contact_kit', className)}>
29
- <Person
30
- firstName={firstName}
31
- lastName={lastName}
32
- />
33
- {contacts.map((contactObject, index) => (
34
- <Contact
35
- contactDetail={contactObject.contactDetail}
36
- contactType={contactObject.contactType}
37
- contactValue={contactObject.contactValue}
38
- key={index}
23
+ const PersonContact = (props: PersonContactProps) => {
24
+ const { className, firstName, lastName, contacts } = props
25
+
26
+ return (
27
+ <div className={classnames('pb_person_contact_kit', className, spacing(props))}>
28
+ <Person
29
+ firstName={firstName}
30
+ lastName={lastName}
39
31
  />
40
- ))}
41
- </div>
42
- )
32
+ {contacts.map((contactObject, index) => (
33
+ <Contact
34
+ contactDetail={contactObject.contactDetail}
35
+ contactType={contactObject.contactType}
36
+ contactValue={contactObject.contactValue}
37
+ key={index}
38
+ />
39
+ ))}
40
+ </div>
41
+ )
42
+ }
43
43
 
44
44
  export default PersonContact
@@ -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?: 'success' | 'warning' | 'error' | 'info' | 'neutral',
13
+ variant?: "success" | "warning" | "error" | "info" | "neutral",
13
14
  }
14
15
 
15
- const Pill = ({
16
- className,
17
- text,
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
- buildCss,
15
- noop,
16
- } from '../utilities/props'
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?: 'outside' | 'inside',
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: { //https://popper.js.org/docs/v2/modifiers/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
- children,
49
- className,
50
- modifiers,
51
- offset,
52
- placement,
53
- referenceElement,
54
- }: PbPopoverProps) => (
55
- <Popper
56
- modifiers={popoverModifiers({ modifiers, offset })}
57
- placement={placement}
58
- referenceElement={referenceElement}
59
- >
60
- {({ placement, ref, style }) => {
61
- return (
62
- <div
63
- className={`${buildCss('pb_popover_kit')} ${className}`}
64
- data-placement={placement}
65
- ref={ref}
66
- style={style}
67
- >
68
- <div className={`${buildCss('popover_tooltip')} show`}>
69
- <Card shadow="deeper">
70
- { children }
71
- </Card>
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
- </Popper>
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 = target.closest('[class^=popover_tooltip]') !== null
98
- const targetIsReference = target.closest('.pb_popover_reference_wrapper') !== null
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>
@@ -2,6 +2,8 @@
2
2
 
3
3
  import React from 'react'
4
4
  import { Body, Title } from '../'
5
+ import classnames from 'classnames'
6
+ import { spacing } from '../utilities/spacing.js'
5
7
 
6
8
  type ProgressPillsProps = {
7
9
  active?: Number,
@@ -9,7 +11,6 @@ type ProgressPillsProps = {
9
11
  title?: String,
10
12
  value?: String,
11
13
  dark?: Boolean,
12
-
13
14
  }
14
15
 
15
16
  const showSteps = (steps, active, dark) => {
@@ -22,22 +23,27 @@ const showSteps = (steps, active, dark) => {
22
23
  return items
23
24
  }
24
25
 
25
- const ProgressPill = ({
26
- active,
27
- dark,
28
- step,
29
- }: ProgressPillProps) => (
26
+ const ProgressPill = ({ active, dark, step }: ProgressPillProps) => (
30
27
  <div
31
- className={`pb_progress_pill${step <= active ? '_active' : '_inactive'}${dark ? '_dark' : null}`}
28
+ className={`pb_progress_pill${step <= active ? '_active' : '_inactive'}${
29
+ dark ? '_dark' : null
30
+ }`}
32
31
  key={step}
33
32
  />
34
33
  )
35
34
 
36
- const ProgressPills = ({ active = 0, steps = 3, title = null, value = null, dark = false }: ProgressPillsProps) => {
35
+ const ProgressPills = (props: ProgressPillsProps) => {
36
+ const {
37
+ active = 0,
38
+ steps = 3,
39
+ title = null,
40
+ value = null,
41
+ dark = false,
42
+ } = props
37
43
  const darkClass = dark ? '_dark' : ''
38
44
 
39
45
  return (
40
- <div className={`pb_progress_pills_kit${darkClass}`}>
46
+ <div className={classnames(`pb_progress_pills_kit${darkClass}`, spacing(props))}>
41
47
  <If condition={title}>
42
48
  <div className="progress_pills_status">
43
49
  <Title
@@ -54,9 +60,7 @@ const ProgressPills = ({ active = 0, steps = 3, title = null, value = null, dark
54
60
  </div>
55
61
  </If>
56
62
 
57
- <div className="progress_pills">
58
- {showSteps(steps, active, dark)}
59
- </div>
63
+ <div className="progress_pills">{showSteps(steps, active, dark)}</div>
60
64
  </div>
61
65
  )
62
66
  }