playbook_ui 5.2.0.pre.alpha4 → 5.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -0
  3. data/app/assets/images/clark.jpg +0 -0
  4. data/app/assets/images/giant.jpg +0 -0
  5. data/app/assets/images/pb-caret.svg +1 -0
  6. data/app/assets/images/pb-check.svg +11 -0
  7. data/app/assets/images/pb.logo.svg +28 -0
  8. data/app/controllers/playbook/application_controller.rb +2 -0
  9. data/app/controllers/playbook/guides_controller.rb +11 -0
  10. data/app/controllers/playbook/pages_controller.rb +79 -0
  11. data/app/controllers/playbook/samples_controller.rb +40 -0
  12. data/app/pb_kits/playbook/_playbook.scss +1 -1
  13. data/app/pb_kits/playbook/data/menu.yml +1 -0
  14. data/app/pb_kits/playbook/index.js +0 -4
  15. data/app/pb_kits/playbook/packs/application.js +55 -0
  16. data/app/pb_kits/playbook/packs/examples.js +174 -0
  17. data/app/pb_kits/playbook/packs/main.scss +12 -0
  18. data/app/pb_kits/playbook/packs/samples.js +19 -0
  19. data/app/pb_kits/playbook/packs/site_styles/_samples.scss +72 -0
  20. data/app/pb_kits/playbook/packs/site_styles/_scaffold.scss +43 -0
  21. data/app/pb_kits/playbook/packs/site_styles/_site-style.scss +135 -0
  22. data/app/pb_kits/playbook/packs/site_styles/docs/_all.scss +10 -0
  23. data/app/pb_kits/playbook/packs/site_styles/docs/_bg_light_doc_example.scss +7 -0
  24. data/app/pb_kits/playbook/packs/site_styles/docs/_code_snippet.scss +531 -0
  25. data/app/pb_kits/playbook/packs/site_styles/docs/_color_utilities.scss +92 -0
  26. data/app/pb_kits/playbook/packs/site_styles/docs/_flex_examples.scss +15 -0
  27. data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +190 -0
  28. data/app/pb_kits/playbook/packs/site_styles/docs/_kits_examples.scss +18 -0
  29. data/app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss +82 -0
  30. data/app/pb_kits/playbook/packs/site_styles/docs/_spacing_tokens.scss +72 -0
  31. data/app/pb_kits/playbook/pb_badge/_badge.html.erb +1 -0
  32. data/app/pb_kits/playbook/pb_badge/_badge.jsx +17 -4
  33. data/app/pb_kits/playbook/pb_body/_body.html.erb +1 -0
  34. data/app/pb_kits/playbook/pb_body/_body.jsx +33 -24
  35. data/app/pb_kits/playbook/pb_body/docs/_body_dark.html.erb +1 -1
  36. data/app/pb_kits/playbook/pb_body/docs/_body_dark.jsx +0 -2
  37. data/app/pb_kits/playbook/pb_body/docs/_body_light.html.erb +1 -0
  38. data/app/pb_kits/playbook/pb_body/docs/_body_light.jsx +3 -7
  39. data/app/pb_kits/playbook/pb_card/_card.jsx +4 -1
  40. data/app/pb_kits/playbook/pb_card/_card.scss +4 -0
  41. data/app/pb_kits/playbook/pb_card/card.rb +8 -1
  42. data/app/pb_kits/playbook/pb_card/docs/_card_border_none.html.erb +7 -0
  43. data/app/pb_kits/playbook/pb_card/docs/_card_border_none.jsx +14 -0
  44. data/app/pb_kits/playbook/pb_card/docs/_card_border_none.md +1 -0
  45. data/app/pb_kits/playbook/pb_card/docs/example.yml +2 -0
  46. data/app/pb_kits/playbook/pb_card/docs/index.js +1 -0
  47. data/app/pb_kits/playbook/pb_checkbox/_checkbox.html.erb +2 -1
  48. data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +18 -5
  49. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_checked.jsx +17 -0
  50. data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +1 -0
  51. data/app/pb_kits/playbook/pb_checkbox/docs/index.js +1 -0
  52. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.html.erb +1 -0
  53. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +17 -1
  54. data/app/pb_kits/playbook/pb_filter/docs/_description.md +3 -0
  55. data/app/pb_kits/playbook/pb_filter/templates/_default.html.erb +1 -1
  56. data/app/pb_kits/playbook/pb_highlight/docs/_highlight_default.html.erb +1 -1
  57. data/app/pb_kits/playbook/pb_layout/_footer.html.erb +6 -0
  58. data/app/pb_kits/playbook/pb_layout/_header.html.erb +6 -0
  59. data/app/pb_kits/playbook/pb_layout/_layout.jsx +33 -1
  60. data/app/pb_kits/playbook/pb_layout/_layout.scss +48 -3
  61. data/app/pb_kits/playbook/pb_layout/docs/_layout_collection_detail.html.erb +19 -0
  62. data/app/pb_kits/playbook/pb_layout/docs/_layout_collection_detail.jsx +54 -0
  63. data/app/pb_kits/playbook/pb_layout/docs/_layout_collection_detail.md +1 -0
  64. data/app/pb_kits/playbook/pb_layout/docs/_layout_content.html.erb +28 -0
  65. data/app/pb_kits/playbook/pb_layout/docs/_layout_content.jsx +42 -0
  66. data/app/pb_kits/playbook/pb_layout/docs/example.yml +6 -0
  67. data/app/pb_kits/playbook/pb_layout/docs/index.js +3 -0
  68. data/app/pb_kits/playbook/pb_layout/footer.rb +19 -0
  69. data/app/pb_kits/playbook/pb_layout/header.rb +19 -0
  70. data/app/pb_kits/playbook/pb_layout/layout.rb +9 -4
  71. data/app/pb_kits/playbook/pb_nav/_item.jsx +20 -10
  72. data/app/pb_kits/playbook/pb_popover/_popover.html.erb +2 -2
  73. data/app/pb_kits/playbook/pb_popover/_popover.jsx +3 -3
  74. data/app/pb_kits/playbook/pb_popover/_popover.scss +25 -21
  75. data/app/pb_kits/playbook/pb_popover/index.js +6 -1
  76. data/app/pb_kits/playbook/pb_radio/_radio.scss +4 -0
  77. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb +1 -1
  78. data/app/views/layouts/playbook/_mobile_hamburger.html.erb +2 -0
  79. data/app/views/layouts/playbook/_nav.html.erb +13 -0
  80. data/app/views/layouts/playbook/_sidebar.html.erb +52 -0
  81. data/app/views/layouts/playbook/application.html.slim +22 -0
  82. data/app/views/layouts/playbook/fullscreen.html.slim +10 -0
  83. data/app/views/layouts/playbook/grid.html.slim +10 -0
  84. data/app/views/layouts/playbook/samples.html.erb +18 -0
  85. data/app/views/playbook/guides/create_kit.html.slim +16 -0
  86. data/app/views/playbook/guides/create_kit/_file_naming.html.md +2 -0
  87. data/app/views/playbook/guides/create_kit/_generator.html.md +6 -0
  88. data/app/views/playbook/guides/create_kit/_kit_examples.html.md +2 -0
  89. data/app/views/playbook/guides/create_kit/_kit_rails.html.md +2 -0
  90. data/app/views/playbook/guides/create_kit/_kit_react.html.md +2 -0
  91. data/app/views/playbook/guides/create_kit/_layout.html.md +2 -0
  92. data/app/views/playbook/guides/create_kit/_view_objects.html.md +2 -0
  93. data/app/views/playbook/guides/create_kit/_writing_sass.md +10 -0
  94. data/app/views/playbook/guides/use_nitro.html.slim +6 -0
  95. data/app/views/playbook/guides/use_nitro/_local.html.md +2 -0
  96. data/app/views/playbook/guides/use_nitro/_nitro_components.html.md +2 -0
  97. data/app/views/playbook/guides/use_nitro/_versions.html.md +2 -0
  98. data/app/views/playbook/pages/fullscreen.html.slim +10 -0
  99. data/app/views/playbook/pages/grid.html.slim +2 -0
  100. data/app/views/playbook/pages/home.html.slim +4 -0
  101. data/app/views/playbook/pages/kit_category_show.html.erb +14 -0
  102. data/app/views/playbook/pages/kit_show.html.erb +33 -0
  103. data/app/views/playbook/pages/kits.html.erb +12 -0
  104. data/app/views/playbook/pages/principals/_getting_started.html.md +30 -0
  105. data/app/views/playbook/pages/principles.html.slim +3 -0
  106. data/app/views/playbook/pages/tokens.html.slim +15 -0
  107. data/app/views/playbook/pages/tokens/_pb_doc_spacing.html.slim +17 -0
  108. data/app/views/playbook/pages/utilities.html.slim +116 -0
  109. data/app/views/playbook/pages/utilities/_pb_doc_color.html.slim +15 -0
  110. data/app/views/playbook/samples/dashboards/index.html.erb +81 -0
  111. data/app/views/playbook/samples/dashboards/index.jsx +130 -0
  112. data/app/views/playbook/samples/filter_table/index.html.erb +348 -0
  113. data/app/views/playbook/samples/filter_table/index.jsx +433 -0
  114. data/app/views/playbook/samples/registration/index.html.erb +316 -0
  115. data/app/views/playbook/samples/registration/index.jsx +476 -0
  116. data/app/views/playbook/samples/sample_show.html.erb +36 -0
  117. data/lib/generators/kit/kit_generator.rb +6 -3
  118. data/lib/generators/kit/templates/kit_html.erb.tt +3 -2
  119. data/lib/generators/kit/templates/kit_jsx.erb.tt +38 -10
  120. data/lib/playbook/engine.rb +0 -1
  121. data/lib/playbook/version.rb +1 -1
  122. data/lib/tasks/pb_release.rake +0 -3
  123. metadata +81 -5
  124. data/app/pb_kits/playbook/tokens/index.scss +0 -12
@@ -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,26 +2,37 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
- import { buildCss } from '../utilities/props'
6
5
  import { spacing } from '../utilities/spacing.js'
7
6
 
7
+ import {
8
+ buildAriaProps,
9
+ buildCss,
10
+ buildDataProps,
11
+ } from '../utilities/props'
12
+
8
13
  type BadgeProps = {
14
+ aria?: object,
9
15
  className?: String,
10
16
  dark?: Boolean,
17
+ data?: object,
11
18
  id?: String,
12
- text?: String,
13
- variant?: "success" | "warning" | "error" | "info" | "neutral",
14
19
  rounded?: Boolean,
20
+ text?: String,
21
+ variant?: "error" | "info" | "neutral" | "primary" | "success" | "warning",
15
22
  }
16
23
  const Badge = (props: BadgeProps) => {
17
24
  const {
25
+ aria = {},
18
26
  className,
19
27
  dark = false,
28
+ data = {},
20
29
  id,
30
+ rounded = false,
21
31
  text,
22
32
  variant = 'neutral',
23
- rounded = false,
24
33
  } = props
34
+ const ariaProps = buildAriaProps(aria)
35
+ const dataProps = buildDataProps(data)
25
36
  const css = classnames(
26
37
  className,
27
38
  buildCss('pb_badge_kit', variant, {
@@ -33,6 +44,8 @@ const Badge = (props: BadgeProps) => {
33
44
 
34
45
  return (
35
46
  <div
47
+ {...ariaProps}
48
+ {...dataProps}
36
49
  className={css}
37
50
  id={id}
38
51
  >
@@ -1,4 +1,5 @@
1
1
  <%= content_tag(object.tag,
2
+ aria: object.aria,
2
3
  id: object.id,
3
4
  data: object.data,
4
5
  class: object.classname) do %>
@@ -2,50 +2,59 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
+ import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
5
6
  import { Highlight } from '../'
6
7
  import { spacing } from '../utilities/spacing.js'
7
8
 
8
9
  type BodyProps = {
10
+ aria?: object,
9
11
  className?: String,
10
12
  children?: Array<React.ReactChild>,
11
- color: 'light' | 'lighter',
13
+ color: 'dark' | 'default' | 'light' | 'lighter' | 'light_dark' | 'lighter_dark',
12
14
  dark?: Boolean,
13
- status?: 'negative' | 'positive',
14
- tag: String,
15
- text?: String,
15
+ data?: object,
16
+ highlightedText?: Array<String>,
16
17
  highlighting?: Boolean,
17
- highlightedText?: Array<String>
18
- }
19
-
20
- const bodyCSS = ({
21
- color = '',
22
- dark = false,
23
- status = '',
24
-
25
- }: BodyProps) => {
26
- const colorStyle = color !== '' ? `_${color}` : ''
27
-
28
- const themeStyle = dark === true ? '_dark' : ''
29
-
30
- const statusStyle = status !== '' ? `_${status}` : ''
31
-
32
- return 'pb_body_kit' + colorStyle + themeStyle + statusStyle
18
+ id?: String,
19
+ status?: 'negative' | 'neutral' | 'positive',
20
+ tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div',
21
+ text?: String,
33
22
  }
34
23
 
35
24
  const Body = (props: BodyProps) => {
36
25
  const {
26
+ aria = {},
37
27
  className,
38
28
  children,
39
- text,
40
- tag = 'div',
41
- highlightedText,
29
+ color = '',
30
+ dark = false,
31
+ data = {},
32
+ highlightedText = [],
42
33
  highlighting = false,
34
+ id,
35
+ status = '',
36
+ tag = 'div',
37
+ text,
43
38
  } = props
44
39
 
40
+ const ariaProps = buildAriaProps(aria)
41
+ const dataProps = buildDataProps(data)
42
+ const classes = classnames(
43
+ className,
44
+ buildCss('pb_body_kit', color, status, {
45
+ dark: dark,
46
+ }),
47
+ spacing(props)
48
+ )
45
49
  const Tag = `${tag}`
46
50
 
47
51
  return (
48
- <Tag className={classnames(bodyCSS(props), className, spacing(props))}>
52
+ <Tag
53
+ {...ariaProps}
54
+ {...dataProps}
55
+ className={classes}
56
+ id={id}
57
+ >
49
58
  <If condition={highlighting}>
50
59
  <Highlight highlightedText={highlightedText}>{text || children}</Highlight>
51
60
  <Else />
@@ -1,6 +1,6 @@
1
1
  <%= pb_rails("body", props: {
2
2
  text: "I am a body kit",
3
- dark: true
3
+ dark: true,
4
4
  }) %>
5
5
 
6
6
  <%= pb_rails("body", props: {
@@ -18,8 +18,6 @@ const BodyDark = () => {
18
18
  dark
19
19
  text="I am a body kit (Lighter)"
20
20
  />
21
- <br />
22
- <br />
23
21
  <Body
24
22
  dark
25
23
  status="negative"
@@ -2,6 +2,7 @@
2
2
  text: "I am a body kit"
3
3
  }) %>
4
4
 
5
+
5
6
  <%= pb_rails("body", props: {
6
7
  text: "I am a body kit (Light)",
7
8
  color: "light"
@@ -4,7 +4,9 @@ import { Body } from '../../'
4
4
  const BodyLight = () => {
5
5
  return (
6
6
  <div>
7
- <Body text="I am a body kit (Default)" />
7
+ <Body
8
+ text="I am a body kit (Default)"
9
+ />
8
10
  <Body
9
11
  color="light"
10
12
  text="I am a body kit (Light)"
@@ -13,8 +15,6 @@ const BodyLight = () => {
13
15
  color="lighter"
14
16
  text="I am a body kit (Lighter)"
15
17
  />
16
- <br />
17
- <br />
18
18
  <Body
19
19
  status="negative"
20
20
  text="I am a body kit (Status: negative)"
@@ -23,10 +23,6 @@ const BodyLight = () => {
23
23
  status="positive"
24
24
  text="I am a body kit (Status: positive)"
25
25
  />
26
- <Body
27
- status="positive"
28
- text="I am a body kit (Status: positive)"
29
- />
30
26
  </div>
31
27
  )
32
28
  }
@@ -16,6 +16,7 @@ type CardPropTypes = {
16
16
  selected?: Boolean,
17
17
  shadow?: "none" | "deep" | "deeper" | "deepest",
18
18
  dark?: Boolean,
19
+ borderNone?: Boolean,
19
20
  }
20
21
 
21
22
  type CardHeaderProps = {
@@ -62,9 +63,11 @@ const Card = (props: CardPropTypes) => {
62
63
  highlight = {},
63
64
  selected = false,
64
65
  shadow = 'none',
66
+ borderNone = false,
65
67
  } = props
66
68
  const bodyCSS = buildCss('pb_card_body_kit')
67
- const cardCss = buildCss('pb_card_kit', `shadow_${shadow}`, {
69
+ const borderCSS = borderNone == true ? 'border_none' : ''
70
+ const cardCss = buildCss('pb_card_kit', `shadow_${shadow}`, `${borderCSS}`, {
68
71
  dark: dark,
69
72
  selected,
70
73
  deselected: !selected,
@@ -16,6 +16,10 @@
16
16
  }
17
17
  }
18
18
 
19
+ &[class*=_border_none] {
20
+ border-width: 0px;
21
+ }
22
+
19
23
  [class^=pb_card_header_kit] {
20
24
  flex-grow: 0;
21
25
  flex-shrink: 0;
@@ -15,6 +15,8 @@ module Playbook
15
15
  default: {}
16
16
  prop :dark, type: Playbook::Props::Boolean,
17
17
  default: false
18
+ prop :border_none, type: Playbook::Props::Boolean,
19
+ default: false
18
20
 
19
21
  def classname
20
22
  generate_classname("pb_card_kit",
@@ -22,7 +24,8 @@ module Playbook
22
24
  shadow_class,
23
25
  highlight_position_class,
24
26
  highlight_color_class,
25
- dark_class)
27
+ dark_class,
28
+ border_class)
26
29
  end
27
30
 
28
31
  def body_padding
@@ -55,6 +58,10 @@ module Playbook
55
58
  def dark_class
56
59
  dark ? "dark" : nil
57
60
  end
61
+
62
+ def border_class
63
+ border_none == true ? "border_none" : nil
64
+ end
58
65
  end
59
66
  end
60
67
  end
@@ -0,0 +1,7 @@
1
+ <div class="bg-light-doc-example">
2
+
3
+ <%= pb_rails("card", props: { border_none: true }) do %>
4
+ Card content
5
+ <% end %>
6
+
7
+ </div>
@@ -0,0 +1,14 @@
1
+ import React from 'react'
2
+ import Card from '../_card.jsx'
3
+
4
+ const CardBorderNone = () => {
5
+ return (
6
+ <div className="bg-light-doc-example">
7
+
8
+ <Card borderNone>{'Card content'}</Card>
9
+
10
+ </div>
11
+ )
12
+ }
13
+
14
+ export default CardBorderNone
@@ -0,0 +1 @@
1
+ Remove card border <b>only</b> for dashboard cards.
@@ -9,6 +9,7 @@ examples:
9
9
  - card_shadow: Shadow Size
10
10
  - card_content: Content Size
11
11
  - card_separator: Separator Card
12
+ - card_border_none: No Border
12
13
  react:
13
14
  - card_light: Default
14
15
  - card_dark: Dark Cards
@@ -19,3 +20,4 @@ examples:
19
20
  - card_shadow: Shadow Size
20
21
  - card_content: Content Size
21
22
  - card_separator: Separator Card
23
+ - card_border_none: No Border
@@ -7,3 +7,4 @@ export { default as CardShadow } from './_card_shadow.jsx'
7
7
  export { default as CardContent } from './_card_content.jsx'
8
8
  export { default as CardSeparator } from './_card_separator.jsx'
9
9
  export { default as CardDark } from './_card_dark.jsx'
10
+ export { default as CardBorderNone } from './_card_border_none.jsx'
@@ -1,4 +1,5 @@
1
- <%= content_tag(:label, id: object.id,
1
+ <%= content_tag(:label, aria: object.aria,
2
+ id: object.id,
2
3
  data: object.data,
3
4
  class: object.classname) do %>
4
5
  <% if object.children %>
@@ -3,13 +3,18 @@
3
3
  import React from 'react'
4
4
  import Body from '../pb_body/_body.jsx'
5
5
  import Icon from '../pb_icon/_icon.jsx'
6
+ import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
7
  import classnames from 'classnames'
7
8
  import { spacing } from '../utilities/spacing.js'
8
9
 
9
10
  type CheckboxProps = {
11
+ aria?: object,
10
12
  checked?: Boolean,
13
+ className?: String,
11
14
  dark?: Boolean,
15
+ data?: object,
12
16
  error?: Boolean,
17
+ id?: String,
13
18
  name: String,
14
19
  text: String,
15
20
  value: String,
@@ -19,9 +24,13 @@ type CheckboxProps = {
19
24
 
20
25
  const Checkbox = (props: CheckboxProps) => {
21
26
  const {
27
+ aria = {},
22
28
  checked = false,
29
+ className,
23
30
  dark = false,
31
+ data = {},
24
32
  error = false,
33
+ id,
25
34
  name = '',
26
35
  text = '',
27
36
  value = '',
@@ -29,13 +38,17 @@ const Checkbox = (props: CheckboxProps) => {
29
38
  onChange = () => {},
30
39
  } = props
31
40
 
41
+ const dataProps = buildDataProps(data)
42
+ const ariaProps = buildAriaProps(aria)
43
+ const classes = classnames(buildCss('pb_checkbox_kit',
44
+ { dark: dark, checked: checked, error: error }), className, spacing(props))
45
+
32
46
  return (
33
47
  <label
34
- className={classnames('pb_checkbox_kit' +
35
- (dark === true ? '_dark' : '') +
36
- (error === true ? ' error' : ''), spacing(props))
37
-
38
- }
48
+ {...ariaProps}
49
+ {...dataProps}
50
+ className={classes}
51
+ id={id}
39
52
  >
40
53
  <If condition={children}>
41
54
  {children}
@@ -0,0 +1,17 @@
1
+ import React from 'react'
2
+ import { Checkbox } from '../../'
3
+
4
+ const CheckboxChecked = () => {
5
+ return (
6
+ <div>
7
+ <Checkbox
8
+ checked
9
+ name="checkbox-name"
10
+ text="Checked Checkbox"
11
+ value="check-box value"
12
+ />
13
+ </div>
14
+ )
15
+ }
16
+
17
+ export default CheckboxChecked
@@ -9,6 +9,7 @@ examples:
9
9
 
10
10
  react:
11
11
  - checkbox_default: Default
12
+ - checkbox_checked: Load as checked
12
13
  - checkbox_dark: Dark
13
14
  - checkbox_custom: Custom Checkbox
14
15
  - checkbox_error: Default w/ Error
@@ -3,3 +3,4 @@ export { default as CheckboxDark } from './_checkbox_dark.jsx'
3
3
  export { default as CheckboxCustom } from './_checkbox_custom.jsx'
4
4
  export { default as CheckboxError } from './_checkbox_error.jsx'
5
5
  export { default as CheckboxDarkError } from './_checkbox_dark_error.jsx'
6
+ export { default as CheckboxChecked } from './_checkbox_checked.jsx'
@@ -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,6 +2,7 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
+ import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
5
6
  import { Button, Icon } from '../'
6
7
 
7
8
  import type { Callback } from '../types'
@@ -13,8 +14,10 @@ import {
13
14
  import { spacing } from '../utilities/spacing.js'
14
15
 
15
16
  type CircleIconButtonProps = {
17
+ aria?: object,
16
18
  className?: String,
17
19
  dark?: Boolean,
20
+ data?: object,
18
21
  disabled?: Boolean,
19
22
  icon: String,
20
23
  id?: String,
@@ -27,9 +30,13 @@ type CircleIconButtonProps = {
27
30
 
28
31
  const CircleIconButton = (props: CircleIconButtonProps) => {
29
32
  const {
33
+ aria = {},
34
+ className,
30
35
  dark,
36
+ data = {},
31
37
  disabled,
32
38
  icon,
39
+ id,
33
40
  onClick = noop,
34
41
  type,
35
42
  link,
@@ -37,8 +44,17 @@ const CircleIconButton = (props: CircleIconButtonProps) => {
37
44
  variant,
38
45
  } = props
39
46
 
47
+ const ariaProps = buildAriaProps(aria)
48
+ const dataProps = buildDataProps(data)
49
+ const classes = classnames(buildCss('pb_circle_icon_button_kit'), className, spacing(props))
50
+
40
51
  return (
41
- <div className={classnames('pb_circle_icon_button_kit', spacing(props))}>
52
+ <div
53
+ {...ariaProps}
54
+ {...dataProps}
55
+ className={classes}
56
+ id={id}
57
+ >
42
58
  <Button
43
59
  dark={dark}
44
60
  disabled={disabled}