playbook_ui 5.3.0 → 5.5.1.pre.alpha2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +2 -1
  3. data/app/pb_kits/playbook/data/menu.yml +2 -0
  4. data/app/pb_kits/playbook/index.js +2 -0
  5. data/app/pb_kits/playbook/packs/examples.js +2 -0
  6. data/app/pb_kits/playbook/packs/samples.js +2 -0
  7. data/app/pb_kits/playbook/pb_body/_body.html.erb +1 -0
  8. data/app/pb_kits/playbook/pb_body/_body.jsx +33 -24
  9. data/app/pb_kits/playbook/pb_body/docs/_body_dark.html.erb +1 -1
  10. data/app/pb_kits/playbook/pb_body/docs/_body_dark.jsx +0 -2
  11. data/app/pb_kits/playbook/pb_body/docs/_body_light.html.erb +1 -0
  12. data/app/pb_kits/playbook/pb_body/docs/_body_light.jsx +3 -7
  13. data/app/pb_kits/playbook/pb_button/_button.jsx +2 -0
  14. data/app/pb_kits/playbook/pb_caption/_caption.scss +2 -2
  15. data/app/pb_kits/playbook/pb_checkbox/_checkbox.html.erb +2 -1
  16. data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +18 -5
  17. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_checked.jsx +17 -0
  18. data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +1 -0
  19. data/app/pb_kits/playbook/pb_checkbox/docs/index.js +1 -0
  20. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.html.erb +1 -0
  21. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +17 -1
  22. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.html.erb +3 -2
  23. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +15 -12
  24. data/app/pb_kits/playbook/pb_date_picker/_date_picker.html.erb +36 -0
  25. data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +98 -0
  26. data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +59 -0
  27. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +38 -0
  28. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +91 -0
  29. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.html.erb +1 -0
  30. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.jsx +12 -0
  31. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.html.erb +24 -0
  32. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.jsx +30 -0
  33. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_disabled.html.erb +43 -0
  34. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_disabled.jsx +48 -0
  35. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.html.erb +4 -0
  36. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.jsx +13 -0
  37. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_format.html.erb +19 -0
  38. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_format.jsx +25 -0
  39. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_label.html.erb +4 -0
  40. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_label.jsx +13 -0
  41. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_min_max.html.erb +14 -0
  42. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_min_max.jsx +22 -0
  43. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range.html.erb +4 -0
  44. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range.jsx +13 -0
  45. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +23 -0
  46. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +8 -0
  47. data/app/pb_kits/playbook/pb_date_picker/index.js +11 -0
  48. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +1 -0
  49. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -0
  50. data/app/pb_kits/playbook/pb_form/docs/_form_simple_form.html.erb +3 -1
  51. data/app/pb_kits/playbook/pb_form/form_builder.rb +1 -0
  52. data/app/pb_kits/playbook/pb_form/form_builder/date_picker_field.rb +15 -0
  53. data/app/pb_kits/playbook/pb_highlight/docs/_highlight_default.html.erb +1 -1
  54. data/app/pb_kits/playbook/pb_image/_image.jsx +1 -1
  55. data/app/pb_kits/playbook/pb_layout/_layout.scss +16 -0
  56. data/app/pb_kits/playbook/pb_legend/_legend.html.erb +1 -0
  57. data/app/pb_kits/playbook/pb_legend/_legend.jsx +25 -4
  58. data/app/pb_kits/playbook/pb_nav/_item.jsx +20 -10
  59. data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +3 -0
  60. data/app/pb_kits/playbook/pb_popover/_popover.html.erb +1 -1
  61. data/app/pb_kits/playbook/pb_popover/_popover.jsx +3 -1
  62. data/app/pb_kits/playbook/pb_popover/_popover.scss +4 -0
  63. data/app/pb_kits/playbook/pb_popover/popover.rb +4 -0
  64. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.html.erb +2 -2
  65. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx +24 -10
  66. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +3 -1
  67. data/app/pb_kits/playbook/pb_time_range_inline/time_range_inline.rb +6 -0
  68. data/app/pb_kits/playbook/pb_title/_title.jsx +7 -4
  69. data/app/pb_kits/playbook/pb_title/_title.scss +7 -0
  70. data/app/pb_kits/playbook/pb_title/_title_mixin.scss +2 -0
  71. data/app/pb_kits/playbook/pb_title/title.rb +4 -1
  72. data/app/pb_kits/playbook/vendor.js +4 -0
  73. data/app/views/layouts/playbook/samples.html.erb +1 -0
  74. data/app/views/playbook/samples/collection_detail/index.html.erb +169 -0
  75. data/app/views/playbook/samples/collection_detail/index.jsx +372 -0
  76. data/lib/generators/kit/kit_generator.rb +6 -3
  77. data/lib/generators/kit/templates/kit_html.erb.tt +3 -2
  78. data/lib/generators/kit/templates/kit_jsx.erb.tt +38 -10
  79. data/lib/playbook/version.rb +1 -1
  80. metadata +32 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd87d19dffeb68dba4372b1282cf12fcb1cace3acda84f7119a902fc205e7e1f
4
- data.tar.gz: e5f41cf298f15483eb5299b27837c83cac6e74e265b446fe6ff819742ff18b48
3
+ metadata.gz: ab2f9ac761918632d1eedb6ade068e921d1101cde598e9eeab081b4a1a799610
4
+ data.tar.gz: f7563ad2b7269b8c813488c00b0b1eb62cd33097a4d4573ab3af9d4c1c7e896a
5
5
  SHA512:
6
- metadata.gz: e7a8e97e476695635a7ca42bbbd831a20b9ff5e48665a7246b723ef2eacdd418864ba2dcec08b602e7fa35362fccf15685e56d91371442a3149ae2eef6d30615
7
- data.tar.gz: 6d58ee0d87a24bdf4912e774c4f0ea33480be6007ba5ffd8cd6f2145bd4b27bbbf233a5288f691a3635f445944eccd0f4196c098cfd6e24e7396ed0580999ecc
6
+ metadata.gz: 83301ae9311c77e7e83eb9ab7e536915735bcb86ff4299d89c236de0e75c66ef868e5e920720f994e61627645a0124fd87ba6355c8a6430e0defe28a83b36708
7
+ data.tar.gz: a937ba549dcc01ef95cb94b0166c19ae5b1c6bdeae34a80ea6f17cfd8d37a0783e8e57bf1221f5b09fce1ceea7d13f17da177c25d431a31101d80701296c8219
@@ -14,6 +14,7 @@
14
14
  @import 'pb_currency/currency';
15
15
  @import 'pb_dashboard_value/dashboard_value';
16
16
  @import 'pb_date/date';
17
+ @import 'pb_date_picker/date_picker';
17
18
  @import 'pb_date_range_inline/date_range_inline';
18
19
  @import 'pb_date_range_stacked/date_range_stacked';
19
20
  @import 'pb_date_stacked/date_stacked';
@@ -80,4 +81,4 @@
80
81
  @import 'pb_user_badge/user_badge';
81
82
  @import 'pb_time_stacked/time_stacked';
82
83
  @import 'pb_weekday_stacked/weekday_stacked';
83
- @import './utilities/spacing';
84
+ @import './utilities/spacing';
@@ -2,6 +2,7 @@ samples:
2
2
  - dashboards
3
3
  - registration
4
4
  - filter_table
5
+ - collection_detail
5
6
 
6
7
  kits:
7
8
  - avatar
@@ -23,6 +24,7 @@ kits:
23
24
  - fixed_confirmation_toast
24
25
  - flex
25
26
  - forms:
27
+ - date_picker
26
28
  - file_upload
27
29
  - form
28
30
  - form_pill
@@ -13,6 +13,7 @@ export Contact from './pb_contact/_contact.jsx'
13
13
  export Currency from './pb_currency/_currency.jsx'
14
14
  export DashboardValue from './pb_dashboard_value/_dashboard_value.jsx'
15
15
  export Date from './pb_date/_date.jsx'
16
+ export DatePicker from './pb_date_picker/_date_picker.jsx'
16
17
  export DateRangeInline from './pb_date_range_inline/_date_range_inline.jsx'
17
18
  export DateRangeStacked from './pb_date_range_stacked/_date_range_stacked.jsx'
18
19
  export DateStacked from './pb_date_stacked/_date_stacked.jsx'
@@ -90,6 +91,7 @@ export dashboardValueSettings from './pb_dashboard_value/dashboardValueSettings'
90
91
 
91
92
  // Other JS/Plugins
92
93
  export pbChart from './plugins/pb_chart.js'
94
+ export datePickerHelper from './pb_date_picker/date_picker_helper.js'
93
95
  export PbTypeahead from './pb_typeahead'
94
96
  export PbPopover from './pb_popover'
95
97
  export PbTable from './pb_table'
@@ -27,6 +27,7 @@ import * as Contact from 'pb_contact/docs'
27
27
  import * as Currency from 'pb_currency/docs'
28
28
  import * as DashboardValue from 'pb_dashboard_value/docs'
29
29
  import * as Date from 'pb_date/docs'
30
+ import * as DatePicker from 'pb_date_picker/docs'
30
31
  import * as DateRangeInline from 'pb_date_range_inline/docs'
31
32
  import * as DateRangeStacked from 'pb_date_range_stacked/docs'
32
33
  import * as DateStacked from 'pb_date_stacked/docs'
@@ -107,6 +108,7 @@ WebpackerReact.setup({
107
108
  ...Currency,
108
109
  ...DashboardValue,
109
110
  ...Date,
111
+ ...DatePicker,
110
112
  ...DateRangeInline,
111
113
  ...DateRangeStacked,
112
114
  ...DateStacked,
@@ -13,7 +13,9 @@ import WebpackerReact from 'webpacker-react'
13
13
  import Dashboards from '../../../views/playbook/samples/dashboards/index.jsx'
14
14
  import FilterTable from '../../../views/playbook/samples/filter_table/index.jsx'
15
15
  import Registration from '../../../views/playbook/samples/registration/index.jsx'
16
+ import CollectionDetail from '../../../views/playbook/samples/collection_detail/index.jsx'
16
17
 
17
18
  WebpackerReact.setup({ Dashboards })
18
19
  WebpackerReact.setup({ FilterTable })
19
20
  WebpackerReact.setup({ Registration })
21
+ WebpackerReact.setup({ CollectionDetail })
@@ -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
+ buildCss('pb_body_kit', color, status, {
44
+ dark: dark,
45
+ }),
46
+ spacing(props),
47
+ className
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
  }
@@ -72,6 +72,7 @@ const Button = (props: ButtonPropTypes) => {
72
72
  const {
73
73
  children,
74
74
  className,
75
+ disabled,
75
76
  icon = null,
76
77
  id,
77
78
  loading = false,
@@ -120,6 +121,7 @@ const Button = (props: ButtonPropTypes) => {
120
121
  <button
121
122
  {...buttonAria}
122
123
  className={css}
124
+ disabled={disabled}
123
125
  id={id}
124
126
  onClick={onClick}
125
127
  type={htmlType}
@@ -3,11 +3,11 @@
3
3
  [class^=pb_caption_kit] {
4
4
  @include caption;
5
5
 
6
- &[class*=_lg] {
6
+ &[class^=pb_caption_kit_lg] {
7
7
  @include caption_lg;
8
8
  }
9
9
 
10
- &[class*=_xs] {
10
+ &[class^=pb_caption_kit_xs] {
11
11
  @include caption_xs;
12
12
  }
13
13
 
@@ -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}
@@ -1,7 +1,8 @@
1
1
  <%= content_tag(:div,
2
- id: object.id,
2
+ aria: object.aria,
3
+ class: object.classname,
3
4
  data: object.data,
4
- class: object.classname) do %>
5
+ id: object.id) do %>
5
6
  <% if object.stat_label.present? %>
6
7
  <%= pb_rails("body", props: { color: "light", text: object.stat_label } ) %>
7
8
  <% end %>
@@ -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 { spacing } from '../utilities/spacing.js'
6
7
  import {
7
8
  Body,
@@ -11,7 +12,9 @@ import {
11
12
 
12
13
  type DashboardValueProps = {
13
14
  align?: 'left' | 'center' | 'right',
15
+ aria?: object,
14
16
  className?: String,
17
+ data?: object,
15
18
  id?: String,
16
19
  statChange?: {
17
20
  change?: String,
@@ -24,27 +27,27 @@ type DashboardValueProps = {
24
27
  }
25
28
  }
26
29
 
27
- const dashboardValueCSS = ({
28
- align = 'left',
29
-
30
- }: DashboardValueProps) => {
31
- const alignStyle = align !== '' ? `_${align}` : ''
32
-
33
- return 'pb_dashboard_value_kit' + alignStyle
34
- }
35
-
36
30
  const DashboardValue = (props: DashboardValueProps) => {
37
31
  const {
32
+ align = 'left',
33
+ aria = {},
38
34
  className,
35
+ data = {},
39
36
  id,
40
- statChange,
37
+ statChange = {},
41
38
  statLabel,
42
- statValue,
39
+ statValue = {},
43
40
  } = props
44
41
 
42
+ const ariaProps = buildAriaProps(aria)
43
+ const dataProps = buildDataProps(data)
44
+ const classes = classnames(buildCss('pb_dashboard_value_kit', align), className, spacing(props))
45
+
45
46
  return (
46
47
  <div
47
- className={classnames(dashboardValueCSS(props), className, spacing(props))}
48
+ {...ariaProps}
49
+ {...dataProps}
50
+ className={classes}
48
51
  id={id}
49
52
  >
50
53
  <If condition={statLabel}>