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
@@ -2,17 +2,14 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
-
6
5
  import { buildCss } from '../utilities/props'
7
6
  import DateTime from '../pb_kit/dateTime.js'
7
+ import { spacing } from '../utilities/spacing.js'
8
8
 
9
- import {
10
- Body,
11
- Title,
12
- } from '../'
9
+ import { Body, Title } from '../'
13
10
 
14
11
  type DateYearStackedProps = {
15
- align?: 'left' | 'center' | 'right',
12
+ align?: "left" | "center" | "right",
16
13
  className?: String | Array<String>,
17
14
  dark?: Boolean,
18
15
  data?: String,
@@ -20,23 +17,21 @@ type DateYearStackedProps = {
20
17
  id?: String,
21
18
  }
22
19
 
23
- const DateYearStacked = ({
24
- align = 'left',
25
- className,
26
- dark = false,
27
- date,
28
- }: DateYearStackedProps) => {
20
+ const DateYearStacked = (props: DateYearStackedProps) => {
21
+ const { align = 'left', className, dark = false, date } = props
29
22
  const dateTimestamp = new DateTime({ value: date })
30
- const css = classnames(className, buildCss('pb_date_year_stacked', align))
23
+ const css = classnames(className, buildCss('pb_date_year_stacked', align), spacing(props))
31
24
 
32
25
  return (
33
26
  <div className={css}>
34
27
  <Title
35
28
  dark={dark}
36
29
  size={4}
37
- text={`${dateTimestamp.toDay()} ${dateTimestamp.toMonth().toUpperCase()}`}
30
+ text={`${dateTimestamp.toDay()} ${dateTimestamp
31
+ .toMonth()
32
+ .toUpperCase()}`}
38
33
  />
39
- <Body color="light">{ dateTimestamp.toYear() }</Body>
34
+ <Body color="light">{dateTimestamp.toYear()}</Body>
40
35
  </div>
41
36
  )
42
37
  }
@@ -1,12 +1,14 @@
1
1
  /* @flow */
2
2
 
3
3
  import React from 'react'
4
+ import classnames from 'classnames'
5
+ import { spacing } from '../utilities/spacing.js'
4
6
 
5
7
  type DistributionBarProps = {
6
8
  className?: String,
7
9
  data?: String,
8
10
  id?: String,
9
- size?: 'lg' | 'sm',
11
+ size?: "lg" | "sm",
10
12
  widths?: Array<Number>,
11
13
  }
12
14
 
@@ -17,27 +19,25 @@ const normalizeCharacters = (widths) => {
17
19
  }
18
20
 
19
21
  const barValues = (normalizedValues) => {
20
- const arrSum = (value) => value.reduce((a, b) => (a + b), 0)
22
+ const arrSum = (value) => value.reduce((a, b) => a + b, 0)
21
23
  const widthSum = arrSum(normalizedValues)
22
24
  return normalizedValues.map((value, i) => {
23
25
  return (
24
26
  <div
25
27
  className="pb_distribution_width"
26
28
  key={i}
27
- style={{ width: `${value * 100 / widthSum}%` }}
29
+ style={{ width: `${(value * 100) / widthSum}%` }}
28
30
  />
29
31
  )
30
32
  })
31
33
  }
32
34
 
33
- const DistributionBar = ({
34
- size = 'lg',
35
- widths = [1],
36
- }: DistributionBarProps) => {
35
+ const DistributionBar = (props: DistributionBarProps) => {
36
+ const { size = 'lg', widths = [1] } = props
37
37
  const normalizedValues = normalizeCharacters(widths)
38
38
 
39
39
  return (
40
- <div className={`pb_distribution_bar_${size}`}>
40
+ <div className={classnames(`pb_distribution_bar_${size}`, spacing(props))}>
41
41
  {barValues(normalizedValues)}
42
42
  </div>
43
43
  )
@@ -2,18 +2,13 @@
2
2
 
3
3
  import React, { useCallback } from 'react'
4
4
  import { useDropzone } from 'react-dropzone'
5
-
6
- import {
7
- buildCss,
8
- noop,
9
- } from '../utilities/props'
5
+ import { buildCss, noop } from '../utilities/props'
6
+ import classnames from 'classnames'
7
+ import { spacing } from '../utilities/spacing.js'
10
8
 
11
9
  import type { Callback } from '../types.js'
12
10
 
13
- import {
14
- Body,
15
- Card,
16
- } from '..'
11
+ import { Body, Card } from '..'
17
12
 
18
13
  type FileUploadProps = {
19
14
  accept?: Array<String>,
@@ -21,34 +16,29 @@ type FileUploadProps = {
21
16
  onFilesAccepted: Callback,
22
17
  }
23
18
 
24
- const FileUpload = ({
25
- accept = ['image/png', 'image/jpg', 'image/jpeg', 'image/svg+xml'],
26
- className,
27
- onFilesAccepted = noop,
28
- }: FileUploadProps) => {
19
+ const FileUpload = (props: FileUploadProps) => {
20
+ const {
21
+ accept = ['image/png', 'image/jpg', 'image/jpeg', 'image/svg+xml'],
22
+ className,
23
+ onFilesAccepted = noop,
24
+ } = props
29
25
  const onDrop = useCallback((files) => {
30
26
  onFilesAccepted(files)
31
27
  })
32
28
 
33
- const {
34
- getRootProps,
35
- getInputProps,
36
- isDragActive,
37
- } = useDropzone({
29
+ const { getRootProps, getInputProps, isDragActive } = useDropzone({
38
30
  accept,
39
31
  onDrop,
40
32
  })
41
33
 
42
34
  return (
43
35
  <div
44
- className={buildCss('pb_file_upload_kit', className)}
36
+ className={classnames(buildCss('pb_file_upload_kit', className), spacing(props))}
45
37
  {...getRootProps()}
46
38
  >
47
39
  <Card>
48
40
  <input {...getInputProps()} />
49
- <Body
50
- color="light"
51
- >
41
+ <Body color="light">
52
42
  <If condition={isDragActive}>
53
43
  <p>{'Drop the files here ...'}</p>
54
44
  <Else />
@@ -2,25 +2,27 @@
2
2
 
3
3
  import React, { Node } from 'react'
4
4
  import { Card } from '../../'
5
+ import classnames from 'classnames'
6
+ import { spacing } from '../../utilities/spacing.js'
5
7
 
6
8
  type FilterBackgroundProps = {
7
9
  background: boolean,
8
10
  className: string,
9
11
  children: Node,
10
12
  }
11
- const FilterBackground = ({ background = true, className, children }: FilterBackgroundProps) => (
12
- <div className={`pb_filter_kit ${className}`}>
13
- <Choose>
14
- <When condition={background}>
15
- <Card padding="none">
16
- {children}
17
- </Card>
18
- </When>
19
- <Otherwise>
20
- {children}
21
- </Otherwise>
22
- </Choose>
23
- </div>
24
- )
13
+ const FilterBackground = (props: FilterBackgroundProps) => {
14
+ const { background = true, className, children } = props
15
+
16
+ return (
17
+ <div className={classnames(`pb_filter_kit ${className}`, spacing(props))}>
18
+ <Choose>
19
+ <When condition={background}>
20
+ <Card padding="none">{children}</Card>
21
+ </When>
22
+ <Otherwise>{children}</Otherwise>
23
+ </Choose>
24
+ </div>
25
+ )
26
+ }
25
27
 
26
28
  export default FilterBackground
@@ -2,30 +2,31 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
-
6
5
  import { Icon, Title } from '../'
6
+ import { spacing } from '../utilities/spacing.js'
7
7
 
8
8
  const iconMap = {
9
- 'success': 'check',
10
- 'error': 'exclamation-triangle',
11
- 'neutral': 'info-circle',
12
- 'tip': 'info-circle',
9
+ success: 'check',
10
+ error: 'exclamation-triangle',
11
+ neutral: 'info-circle',
12
+ tip: 'info-circle',
13
13
  }
14
14
 
15
15
  type FixedConfirmationToastProps = {
16
16
  className?: String,
17
17
  data?: String,
18
18
  id?: String,
19
- status?: 'success' | 'error' | 'neutral' | 'tip',
19
+ status?: "success" | "error" | "neutral" | "tip",
20
20
  text: String,
21
21
  }
22
22
 
23
- const FixedConfirmationToast = ({
24
- className,
25
- status = 'neutral',
26
- text,
27
- }: FixedConfirmationToastProps) => {
28
- const css = classnames(className, `pb_fixed_confirmation_toast_kit_${status}`)
23
+ const FixedConfirmationToast = (props: FixedConfirmationToastProps) => {
24
+ const { className, status = 'neutral', text } = props
25
+ const css = classnames(
26
+ className,
27
+ `pb_fixed_confirmation_toast_kit_${status}`,
28
+ spacing(props)
29
+ )
29
30
  const icon = iconMap[status]
30
31
 
31
32
  return (
@@ -3,33 +3,36 @@
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
5
  import { buildCss } from '../utilities/props'
6
-
6
+ import { spacing as spacingFunc } from '../utilities/spacing.js'
7
7
  type FlexProps = {
8
8
  children: Array<React.ReactNode> | React.ReactNode,
9
9
  className?: String,
10
- horizontal?: 'left' | 'center' | 'right' | 'stretch',
10
+ horizontal?: "left" | "center" | "right" | "stretch",
11
11
  id?: String,
12
12
  inline?: Boolean,
13
- orientation?: 'row' | 'column',
14
- spacing?: 'around' | 'between' | 'evenly' | 'none',
13
+ orientation?: "row" | "column",
14
+ spacing?: "around" | "between" | "evenly" | "none",
15
15
  reverse?: Boolean,
16
- vertical?: 'top' | 'center' | 'bottom' | 'stretch',
16
+ vertical?: "top" | "center" | "bottom" | "stretch",
17
17
  wrap?: Boolean,
18
18
  }
19
19
 
20
- const Flex = ({
21
- children,
22
- className,
23
- inline = false,
24
- horizontal = 'left',
25
- orientation = 'row',
26
- spacing = 'none',
27
- reverse = false,
28
- vertical = 'top',
29
- wrap = false,
30
- }: FlexProps) => {
31
- const orientationClass = orientation !== undefined ? `orientation_${orientation}` : ''
32
- const horizontalClass = horizontal !== undefined ? `justify_content_${horizontal}` : ''
20
+ const Flex = (props: FlexProps) => {
21
+ const {
22
+ children,
23
+ className,
24
+ inline = false,
25
+ horizontal = 'left',
26
+ orientation = 'row',
27
+ spacing = 'none',
28
+ reverse = false,
29
+ vertical = 'top',
30
+ wrap = false,
31
+ } = props
32
+ const orientationClass =
33
+ orientation !== undefined ? `orientation_${orientation}` : ''
34
+ const horizontalClass =
35
+ horizontal !== undefined ? `justify_content_${horizontal}` : ''
33
36
  const verticalClass = vertical !== undefined ? `align_items_${vertical}` : ''
34
37
  const inlineClass = inline === true ? 'inline' : ''
35
38
  const spacingClass = spacing !== undefined ? `spacing_${spacing}` : ''
@@ -37,8 +40,20 @@ const Flex = ({
37
40
  const reverseClass = reverse === true ? 'reverse' : ''
38
41
  return (
39
42
  <div
40
- className={classnames(buildCss('pb_flex_kit', orientationClass, horizontalClass, verticalClass, inlineClass, spacingClass, reverseClass, wrapClass
41
- ), className)}
43
+ className={classnames(
44
+ buildCss(
45
+ 'pb_flex_kit',
46
+ orientationClass,
47
+ horizontalClass,
48
+ verticalClass,
49
+ inlineClass,
50
+ spacingClass,
51
+ reverseClass,
52
+ wrapClass
53
+ ),
54
+ className,
55
+ spacingFunc(props)
56
+ )}
42
57
  >
43
58
  {children}
44
59
  </div>
@@ -2,7 +2,7 @@
2
2
  import React from 'react'
3
3
  import classnames from 'classnames'
4
4
  import { buildCss } from '../utilities/props'
5
-
5
+ import { spacing } from '../utilities/spacing.js'
6
6
  type FlexItemPropTypes = {
7
7
  children: Array<React.ReactNode> | React.ReactNode,
8
8
  fixedSize: String,
@@ -10,18 +10,15 @@ type FlexItemPropTypes = {
10
10
  className: String,
11
11
  }
12
12
 
13
- const FlexItem = ({
14
- children,
15
- className,
16
- fixedSize,
17
- grow,
18
- }: FlexItemPropTypes) => {
13
+ const FlexItem = (props: FlexItemPropTypes) => {
14
+ const { children, className, fixedSize, grow } = props
19
15
  const growClass = grow === true ? 'grow' : ''
20
- const fixedStyle = fixedSize !== undefined ? { flexBasis: `${fixedSize}` } : null
16
+ const fixedStyle =
17
+ fixedSize !== undefined ? { flexBasis: `${fixedSize}` } : null
21
18
 
22
19
  return (
23
20
  <div
24
- className={classnames(buildCss('pb_flex_item_kit', growClass), className)}
21
+ className={classnames(buildCss('pb_flex_item_kit', growClass), className, spacing(props))}
25
22
  style={fixedStyle}
26
23
  >
27
24
  {children}
@@ -4,28 +4,23 @@ import classnames from 'classnames'
4
4
  import Title from '../pb_title/_title.jsx'
5
5
  import Icon from '../pb_icon/_icon.jsx'
6
6
  import Avatar from '../pb_avatar/_avatar.jsx'
7
+ import { spacing } from '../utilities/spacing.js'
7
8
 
8
9
  type FormPillProps = {
9
-
10
- className?: String,
11
- id?: String,
12
- text: String,
13
- name: String,
14
- onClick?: EventHandler,
15
- avatar?: Boolean,
16
- avatarUrl?: String,
10
+ className?: String,
11
+ id?: String,
12
+ text: String,
13
+ name: String,
14
+ onClick?: EventHandler,
15
+ avatar?: Boolean,
16
+ avatarUrl?: String,
17
17
  }
18
- const FormPill = ({
19
- className,
20
- text,
21
- name,
22
- onClick = () => {},
23
- avatarUrl,
24
- }: FormPillProps) => {
25
- const css = classnames([
26
- `pb_form_pill_kit_${'primary'}`,
27
- className,
28
- ])
18
+ const FormPill = (props: FormPillProps) => {
19
+ const { className, text, name, onClick = () => {}, avatarUrl } = props
20
+ const css = classnames(
21
+ [`pb_form_pill_kit_${'primary'}`, className],
22
+ spacing(props)
23
+ )
29
24
  return (
30
25
  <div className={css}>
31
26
  <If condition={name}>
@@ -6,6 +6,7 @@ import classnames from 'classnames'
6
6
 
7
7
  import { Badge } from '../'
8
8
  import { buildCss } from '../utilities/props'
9
+ import { spacing } from '../utilities/spacing.js'
9
10
 
10
11
  type HashtagProps = {
11
12
  className?: String,
@@ -13,33 +14,36 @@ type HashtagProps = {
13
14
  dark?: Boolean,
14
15
  id?: String,
15
16
  text?: String,
16
- type: 'default' | 'home' | 'project' | 'appointment',
17
+ type: "default" | "home" | "project" | "appointment",
17
18
  url?: String,
18
19
  }
19
20
 
20
21
  const typeMap = {
21
- 'home': 'H#',
22
- 'project': 'P#',
23
- 'appointment': 'A#',
24
- 'default': '#',
22
+ home: 'H#',
23
+ project: 'P#',
24
+ appointment: 'A#',
25
+ default: '#',
25
26
  }
26
27
 
27
- const Hashtag = ({
28
- className,
29
- dark = false,
30
- text,
31
- type,
32
- url,
33
- }: HashtagProps) => (
34
- <span className={classnames(className, buildCss('pb_hashtag_kit', { 'dark': dark }))}>
35
- <a href={url}>
36
- <Badge
37
- dark={dark}
38
- text={typeMap[type] + text}
39
- variant="primary"
40
- />
41
- </a>
42
- </span>
43
- )
28
+ const Hashtag = (props: HashtagProps) => {
29
+ const { className, dark = false, text, type, url } = props
30
+ return (
31
+ <span
32
+ className={classnames(
33
+ className,
34
+ buildCss('pb_hashtag_kit', { dark: dark }),
35
+ spacing(props)
36
+ )}
37
+ >
38
+ <a href={url}>
39
+ <Badge
40
+ dark={dark}
41
+ text={typeMap[type] + text}
42
+ variant="primary"
43
+ />
44
+ </a>
45
+ </span>
46
+ )
47
+ }
44
48
 
45
49
  export default Hashtag