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,6 +2,8 @@
2
2
  /* eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */
3
3
  import Highlighter from 'react-highlight-words'
4
4
  import React from 'react'
5
+ import classnames from 'classnames'
6
+ import { spacing } from '../utilities/spacing.js'
5
7
 
6
8
  type HighlightProps = {
7
9
  className?: String,
@@ -9,29 +11,28 @@ type HighlightProps = {
9
11
  id?: String,
10
12
  children?: React.Node,
11
13
  text?: String,
12
- highlightedText?: Array<String>
14
+ highlightedText?: Array<String>,
13
15
  }
14
16
 
15
- const Highlight = ({
16
- className = 'pb_highlight_kit',
17
- children,
18
- data,
19
- id,
20
- text,
21
- highlightedText = ['highlight'],
22
- }: HighlightProps) => {
17
+ const Highlight = (props: HighlightProps) => {
18
+ const {
19
+ className = 'pb_highlight_kit',
20
+ children,
21
+ data,
22
+ id,
23
+ text,
24
+ highlightedText = ['highlight'],
25
+ } = props
23
26
  return (
24
-
25
27
  <Highlighter
26
28
  autoEscape
27
29
  data={data}
28
- highlightClassName={className}
30
+ highlightClassName={classnames(className, spacing(props))}
29
31
  highlightTag="span"
30
32
  id={id}
31
33
  searchWords={highlightedText}
32
34
  textToHighlight={text || children}
33
35
  />
34
-
35
36
  )
36
37
  }
37
38
 
@@ -5,6 +5,7 @@ import classnames from 'classnames'
5
5
 
6
6
  import { joinPresent, titleize } from '../utilities/text'
7
7
  import { Body, Hashtag, Title } from '../'
8
+ import { spacing } from '../utilities/spacing.js'
8
9
 
9
10
  type HomeAddressStreetProps = {
10
11
  address: String,
@@ -12,7 +13,7 @@ type HomeAddressStreetProps = {
12
13
  city: String,
13
14
  className?: String,
14
15
  dark?: Boolean,
15
- emphasis: 'street' | 'city',
16
+ emphasis: "street" | "city",
16
17
  homeId: Number,
17
18
  houseStyle: String,
18
19
  homeUrl: String,
@@ -21,96 +22,100 @@ type HomeAddressStreetProps = {
21
22
  territory: String,
22
23
  }
23
24
 
24
- const classes = (className, dark) => (
25
- classnames(className, {
26
- 'pb_home_address_street': !dark,
27
- 'pb_home_address_street_dark': dark,
28
- })
29
- )
25
+ const HomeAddressStreet = (props: HomeAddressStreetProps) => {
26
+ const {
27
+ address,
28
+ addressCont,
29
+ city,
30
+ className,
31
+ dark = false,
32
+ emphasis = 'street',
33
+ homeId,
34
+ homeUrl,
35
+ houseStyle,
36
+ state,
37
+ zipcode,
38
+ territory,
39
+ } = props
30
40
 
31
- const HomeAddressStreet = ({
32
- address,
33
- addressCont,
34
- city,
35
- className,
36
- dark = false,
37
- emphasis = 'street',
38
- homeId,
39
- homeUrl,
40
- houseStyle,
41
- state,
42
- zipcode,
43
- territory,
44
- }: HomeAddressStreetProps) => (
45
- <div className={classes(className, dark)}>
46
- {
47
- <Choose>
48
- <When condition={emphasis == 'street'}>
49
- <div>
50
- <Title
51
- className="pb_home_address_street_address"
52
- dark={dark}
53
- size={4}
54
- >
55
- {joinPresent([titleize(address), houseStyle], ' · ')}
56
- </Title>
57
- <Title
58
- className="pb_home_address_street_address"
59
- dark={dark}
60
- size={4}
61
- >
62
- {titleize(addressCont)}
63
- </Title>
64
- <Body color="light">
65
- {`${titleize(city)}, ${state} ${zipcode}`}
66
- </Body>
67
- </div>
68
- </When>
69
- <When condition={emphasis == 'city'}>
70
- <div>
71
- <Body color="light">
72
- {joinPresent([titleize(address), houseStyle], ' · ')}
73
- </Body>
74
- <Body color="light">
75
- {titleize(addressCont)}
76
- </Body>
41
+ const classes = (className, dark) =>
42
+ classnames(
43
+ className,
44
+ {
45
+ 'pb_home_address_street': !dark,
46
+ 'pb_home_address_street_dark': dark,
47
+ },
48
+ spacing(props)
49
+ )
50
+ return (
51
+ <div className={classes(className, dark)}>
52
+ {
53
+ <Choose>
54
+ <When condition={emphasis == 'street'}>
77
55
  <div>
78
56
  <Title
79
57
  className="pb_home_address_street_address"
80
58
  dark={dark}
81
59
  size={4}
82
- tag="span"
83
60
  >
84
- {`${titleize(city)}, ${state}`}
61
+ {joinPresent([titleize(address), houseStyle], ' · ')}
85
62
  </Title>
86
- <Body
87
- color="light"
88
- tag="span"
63
+ <Title
64
+ className="pb_home_address_street_address"
65
+ dark={dark}
66
+ size={4}
89
67
  >
90
- {` ${zipcode}`}
68
+ {titleize(addressCont)}
69
+ </Title>
70
+ <Body color="light">
71
+ {`${titleize(city)}, ${state} ${zipcode}`}
91
72
  </Body>
92
73
  </div>
93
- </div>
94
- </When>
95
- </Choose>
96
- }
74
+ </When>
75
+ <When condition={emphasis == 'city'}>
76
+ <div>
77
+ <Body color="light">
78
+ {joinPresent([titleize(address), houseStyle], ' · ')}
79
+ </Body>
80
+ <Body color="light">{titleize(addressCont)}</Body>
81
+ <div>
82
+ <Title
83
+ className="pb_home_address_street_address"
84
+ dark={dark}
85
+ size={4}
86
+ tag="span"
87
+ >
88
+ {`${titleize(city)}, ${state}`}
89
+ </Title>
90
+ <Body
91
+ color="light"
92
+ tag="span"
93
+ >
94
+ {` ${zipcode}`}
95
+ </Body>
96
+ </div>
97
+ </div>
98
+ </When>
99
+ </Choose>
100
+ }
97
101
 
98
- <If condition={homeId}>
99
- <Hashtag
100
- classname="home-hashtag"
101
- dark={dark}
102
- text={homeId}
103
- type="home"
104
- url={homeUrl || '#'}
105
- />
106
- </If>
107
- <Body
108
- color="light"
109
- tag="span"
110
- >
111
- <small>{territory}</small>
112
- </Body>
113
- </div>
114
- )
102
+ <If condition={homeId}>
103
+ <Hashtag
104
+ classname="home-hashtag"
105
+ dark={dark}
106
+ text={homeId}
107
+ type="home"
108
+ url={homeUrl || '#'}
109
+ />
110
+ </If>
111
+ <Body
112
+ color="light"
113
+ tag="span"
114
+ >
115
+ <small>{territory}</small>
116
+ </Body>
117
+ </div>
118
+ )
119
+ }
115
120
 
116
121
  export default HomeAddressStreet
@@ -2,57 +2,78 @@
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
  type IconProps = {
7
8
  aria?: Object,
8
9
  border?: Boolean,
9
10
  className?: String,
10
11
  fixedWidth?: Boolean,
11
- flip?: 'horizontal' | 'vertical' | 'both' | 'none',
12
+ flip?: "horizontal" | "vertical" | "both" | "none",
12
13
  icon: String,
13
14
  id?: String,
14
15
  inverse?: Boolean,
15
16
  listItem?: Boolean,
16
- pull?: 'left' | 'right' | 'none',
17
+ pull?: "left" | "right" | "none",
17
18
  pulse?: Boolean,
18
19
  rotation?: 90 | 180 | 270,
19
- size?: 'lg' | 'xs' | 'sm' | '1x' | '2x' | '3x' | '4x' | '5x' | '6x' | '7x' | '8x' | '9x' | '10x',
20
+ size?: | "lg"
21
+ | "xs"
22
+ | "sm"
23
+ | "1x"
24
+ | "2x"
25
+ | "3x"
26
+ | "4x"
27
+ | "5x"
28
+ | "6x"
29
+ | "7x"
30
+ | "8x"
31
+ | "9x"
32
+ | "10x",
20
33
  spin?: Boolean,
21
34
  }
22
35
 
23
36
  const flipMap = {
24
- 'horizontal': 'fa-flip-horizontal',
25
- 'vertical': 'fa-flip-vertical',
26
- 'both': 'fa-flip-horizontal fa-flip-vertical',
37
+ horizontal: 'fa-flip-horizontal',
38
+ vertical: 'fa-flip-vertical',
39
+ both: 'fa-flip-horizontal fa-flip-vertical',
27
40
  }
28
41
 
29
- const Icon = ({
30
- border = false,
31
- className,
32
- fixedWidth = true,
33
- flip = false,
34
- icon,
35
- id,
36
- inverse = false,
37
- listItem = false,
38
- pull,
39
- pulse = false,
40
- rotation,
41
- size,
42
- spin = false,
43
- }: IconProps) => {
44
- const classes = classnames(className, flipMap[flip], 'pb_icon_kit', 'far', {
45
- 'fa-border': border,
46
- 'fa-fw': fixedWidth,
47
- 'fa-inverse': inverse,
48
- 'fa-li': listItem,
49
- 'fa-pulse': pulse,
50
- 'fa-spin': spin,
51
- [`fa-${icon}`]: icon,
52
- [`fa-${size}`]: size,
53
- [`fa-pull-${pull}`]: pull,
54
- [`fa-rotate-${rotation}`]: rotation,
55
- })
42
+ const Icon = (props: IconProps) => {
43
+ const {
44
+ border = false,
45
+ className,
46
+ fixedWidth = true,
47
+ flip = false,
48
+ icon,
49
+ id,
50
+ inverse = false,
51
+ listItem = false,
52
+ pull,
53
+ pulse = false,
54
+ rotation,
55
+ size,
56
+ spin = false,
57
+ } = props
58
+ const classes = classnames(
59
+ className,
60
+ flipMap[flip],
61
+ 'pb_icon_kit',
62
+ 'far',
63
+ {
64
+ 'fa-border': border,
65
+ 'fa-fw': fixedWidth,
66
+ 'fa-inverse': inverse,
67
+ 'fa-li': listItem,
68
+ 'fa-pulse': pulse,
69
+ 'fa-spin': spin,
70
+ [`fa-${icon}`]: icon,
71
+ [`fa-${size}`]: size,
72
+ [`fa-pull-${pull}`]: pull,
73
+ [`fa-rotate-${rotation}`]: rotation,
74
+ },
75
+ spacing(props)
76
+ )
56
77
 
57
78
  return (
58
79
  <i
@@ -6,24 +6,28 @@ import classnames from 'classnames'
6
6
 
7
7
  import { Icon } from '../'
8
8
  import { buildCss } from '../utilities/props'
9
+ import { spacing } from '../utilities/spacing.js'
9
10
 
10
11
  type IconCircleProps = {
11
12
  className?: string,
12
13
  icon: string,
13
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl',
14
- variant?: 'default' | 'royal' | 'blue' | 'purple' | 'teal' | 'red' | 'yellow' | 'green',
14
+ size?: "xs" | "sm" | "md" | "lg" | "xl",
15
+ variant?: | "default"
16
+ | "royal"
17
+ | "blue"
18
+ | "purple"
19
+ | "teal"
20
+ | "red"
21
+ | "yellow"
22
+ | "green",
15
23
  }
16
24
 
17
- const IconCircle = ({
18
- className,
19
- icon,
20
- size = 'md',
21
- variant = 'default',
22
- }: IconCircleProps) => {
25
+ const IconCircle = (props: IconCircleProps) => {
26
+ const { className, icon, size = 'md', variant = 'default' } = props
23
27
  const css = buildCss('pb_icon_circle_kit', size, variant)
24
28
 
25
29
  return (
26
- <div className={classnames(className, css)}>
30
+ <div className={classnames(className, css, spacing(props))}>
27
31
  <Icon icon={icon} />
28
32
  </div>
29
33
  )
@@ -2,19 +2,14 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
- import {
6
- Body,
7
- Icon,
8
- } from '../'
5
+ import { Body, Icon } from '../'
9
6
 
10
- import {
11
- buildAriaProps,
12
- buildCss,
13
- buildDataProps,
14
- } from '../utilities/props'
7
+ import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
8
+
9
+ import { spacing } from '../utilities/spacing.js'
15
10
 
16
11
  type IconValueProps = {
17
- align?: 'left' | 'center' | 'right',
12
+ align?: "left" | "center" | "right",
18
13
  aria?: object,
19
14
  className?: string,
20
15
  data?: object,
@@ -23,15 +18,16 @@ type IconValueProps = {
23
18
  text: string,
24
19
  }
25
20
 
26
- const IconValue = ({
27
- align = 'left',
28
- aria = {},
29
- className,
30
- data = {},
31
- icon,
32
- id,
33
- text,
34
- }: IconValueProps) => {
21
+ const IconValue = (props: IconValueProps) => {
22
+ const {
23
+ align = 'left',
24
+ aria = {},
25
+ className,
26
+ data = {},
27
+ icon,
28
+ id,
29
+ text,
30
+ } = props
35
31
  const ariaProps = buildAriaProps(aria)
36
32
  const dataProps = buildDataProps(data)
37
33
  const pbCss = buildCss('pb_icon_value_kit', align)
@@ -40,7 +36,7 @@ const IconValue = ({
40
36
  <div
41
37
  {...ariaProps}
42
38
  {...dataProps}
43
- className={classnames(className, pbCss)}
39
+ className={classnames(className, pbCss, spacing(props))}
44
40
  id={id}
45
41
  >
46
42
  <Body color="light">