playbook_ui 10.21.0.pre.alpha.jg1 → 10.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_avatar/_avatar.scss +2 -2
  3. data/app/pb_kits/playbook/pb_avatar/{_avatar.jsx → _avatar.tsx} +13 -14
  4. data/app/pb_kits/playbook/pb_avatar/avatar.rb +1 -1
  5. data/app/pb_kits/playbook/pb_avatar/avatar.test.js +1 -1
  6. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.jsx +1 -1
  7. data/app/pb_kits/playbook/pb_background/_background.jsx +1 -1
  8. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +5 -1
  9. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +1 -0
  10. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.jsx +1 -1
  11. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.jsx +1 -1
  12. data/app/pb_kits/playbook/pb_button/_button.jsx +5 -4
  13. data/app/pb_kits/playbook/pb_button/_button.scss +18 -1
  14. data/app/pb_kits/playbook/pb_button/button.rb +11 -3
  15. data/app/pb_kits/playbook/pb_button/button.test.js +13 -0
  16. data/app/pb_kits/playbook/pb_button/docs/_button_size.html.erb +3 -0
  17. data/app/pb_kits/playbook/pb_button/docs/_button_size.jsx +26 -0
  18. data/app/pb_kits/playbook/pb_button/docs/_button_size.md +1 -0
  19. data/app/pb_kits/playbook/pb_button/docs/example.yml +2 -0
  20. data/app/pb_kits/playbook/pb_button/docs/index.js +1 -0
  21. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx +1 -1
  22. data/app/pb_kits/playbook/pb_caption/_caption.jsx +1 -1
  23. data/app/pb_kits/playbook/pb_card/_card.jsx +1 -1
  24. data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +1 -1
  25. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx +3 -0
  26. data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +1 -0
  27. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +1 -1
  28. data/app/pb_kits/playbook/pb_collapsible/_collapsible.jsx +1 -1
  29. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.jsx +1 -1
  30. data/app/pb_kits/playbook/pb_currency/_currency.jsx +24 -3
  31. data/app/pb_kits/playbook/pb_currency/currency.rb +12 -3
  32. data/app/pb_kits/playbook/pb_currency/currency.test.js +35 -0
  33. data/app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.html.erb +27 -0
  34. data/app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.jsx +44 -0
  35. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +1 -1
  36. data/app/pb_kits/playbook/pb_currency/docs/example.yml +2 -0
  37. data/app/pb_kits/playbook/pb_currency/docs/index.js +1 -0
  38. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.js +215 -0
  39. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +1 -1
  40. data/app/pb_kits/playbook/pb_dialog/_dialog.jsx +1 -1
  41. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.jsx +1 -1
  42. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.jsx +1 -1
  43. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.jsx +1 -1
  44. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.jsx +1 -1
  45. data/app/pb_kits/playbook/pb_file_upload/_file_upload.jsx +17 -10
  46. data/app/pb_kits/playbook/pb_file_upload/fileupload.test.js +40 -0
  47. data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.jsx +1 -1
  48. data/app/pb_kits/playbook/pb_flex/_flex.jsx +1 -1
  49. data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +1 -1
  50. data/app/pb_kits/playbook/pb_form_group/_form_group.jsx +1 -1
  51. data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +2 -2
  52. data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +3 -0
  53. data/app/pb_kits/playbook/pb_gauge/gauge.rb +1 -0
  54. data/app/pb_kits/playbook/pb_highlight/_highlight.jsx +1 -1
  55. data/app/pb_kits/playbook/pb_icon/_icon.jsx +1 -1
  56. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.jsx +1 -1
  57. data/app/pb_kits/playbook/pb_image/_image.scss +3 -3
  58. data/app/pb_kits/playbook/pb_image/{_image.jsx → _image.tsx} +11 -15
  59. data/app/pb_kits/playbook/pb_image/image.rb +1 -1
  60. data/app/pb_kits/playbook/pb_image/image.test.js +1 -1
  61. data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +1 -1
  62. data/app/pb_kits/playbook/pb_layout/_layout.jsx +1 -1
  63. data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +5 -1
  64. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +1 -0
  65. data/app/pb_kits/playbook/pb_list/_list.jsx +1 -1
  66. data/app/pb_kits/playbook/pb_list/_list_item.jsx +1 -1
  67. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +1 -1
  68. data/app/pb_kits/playbook/pb_online_status/{_online_status.jsx → _online_status.tsx} +4 -6
  69. data/app/pb_kits/playbook/pb_passphrase/_passphrase.jsx +2 -1
  70. data/app/pb_kits/playbook/pb_pill/_pill.jsx +1 -1
  71. data/app/pb_kits/playbook/pb_popover/_popover.jsx +3 -5
  72. data/app/pb_kits/playbook/pb_popover/docs/_popover_close.html.erb +7 -7
  73. data/app/pb_kits/playbook/pb_popover/index.js +4 -9
  74. data/app/pb_kits/playbook/pb_popover/popover.html.erb +1 -1
  75. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +1 -1
  76. data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +1 -1
  77. data/app/pb_kits/playbook/pb_radio/_radio.jsx +1 -1
  78. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx +5 -0
  79. data/app/pb_kits/playbook/pb_table/_table.jsx +1 -1
  80. data/app/pb_kits/playbook/pb_table/_table_row.jsx +1 -1
  81. data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +1 -1
  82. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -1
  83. data/app/pb_kits/playbook/pb_text_input/text_input.test.js +14 -0
  84. data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +1 -0
  85. data/app/pb_kits/playbook/pb_time/_time.jsx +1 -1
  86. data/app/pb_kits/playbook/pb_title/_title.jsx +1 -1
  87. data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +1 -1
  88. data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +1 -1
  89. data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +1 -1
  90. data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.jsx +1 -1
  91. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.jsx +1 -1
  92. data/app/pb_kits/playbook/plugins/pb_chart.js +8 -4
  93. data/app/pb_kits/playbook/utilities/globalProps.ts +156 -0
  94. data/app/pb_kits/playbook/utilities/{props.js → props.ts} +9 -7
  95. data/lib/playbook/version.rb +1 -1
  96. metadata +17 -10
  97. data/app/pb_kits/playbook/types.js +0 -4
  98. data/app/pb_kits/playbook/utilities/globalProps.js +0 -97
@@ -27,7 +27,7 @@ module Playbook
27
27
  end
28
28
 
29
29
  def size_class
30
- size == "none" ? nil : "_#{size}"
30
+ size == "none" ? nil : "_size_#{size}"
31
31
  end
32
32
 
33
33
  def transition_class
@@ -26,7 +26,7 @@ test('default classname', () => {
26
26
 
27
27
  test('size = xs', () => {
28
28
  const kit = renderKit(Image, props, { size: 'xs' })
29
- expect(kit).toHaveClass('pb_image_kit_xs lazyload')
29
+ expect(kit).toHaveClass('pb_image_kit_size_xs lazyload')
30
30
  })
31
31
 
32
32
  test('transition = blur', () => {
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
- import { globalProps } from '../utilities/globalProps.js'
5
+ import { globalProps } from '../utilities/globalProps'
6
6
 
7
7
  import { buildAriaProps, buildDataProps } from '../utilities/props'
8
8
 
@@ -4,7 +4,7 @@ import React from 'react'
4
4
  import classnames from 'classnames'
5
5
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
6
 
7
- import { globalProps } from '../utilities/globalProps.js'
7
+ import { globalProps } from '../utilities/globalProps'
8
8
 
9
9
  type LayoutPropTypes = {
10
10
  aria?: object,
@@ -3,11 +3,12 @@
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
5
 
6
- import { globalProps } from '../utilities/globalProps.js'
6
+ import { globalProps } from '../utilities/globalProps'
7
7
  import pbChart from '../plugins/pb_chart'
8
8
 
9
9
  type LineGraphProps = {
10
10
  axisTitle?: string,
11
+ dark?: Boolean,
11
12
  xAxisCategories: array,
12
13
  yAxisMin: number,
13
14
  yAxisMax: number,
@@ -31,6 +32,7 @@ type LineGraphProps = {
31
32
  export default class LineGraph extends React.Component<LineGraphProps> {
32
33
  static defaultProps = {
33
34
  className: 'pb_bar_graph',
35
+ dark: false,
34
36
  gradient: false,
35
37
  type: 'line',
36
38
  legend: false,
@@ -40,6 +42,7 @@ export default class LineGraph extends React.Component<LineGraphProps> {
40
42
  componentDidMount() {
41
43
  const {
42
44
  axisTitle,
45
+ dark,
43
46
  xAxisCategories,
44
47
  yAxisMin,
45
48
  yAxisMax,
@@ -60,6 +63,7 @@ export default class LineGraph extends React.Component<LineGraphProps> {
60
63
  axisTitle: axisTitle,
61
64
  chartData: chartData,
62
65
  colors: colors,
66
+ dark,
63
67
  id: id,
64
68
  pointStart: pointStart,
65
69
  subtitle: subTitle,
@@ -32,6 +32,7 @@ module Playbook
32
32
  id: id,
33
33
  className: classname,
34
34
  chartData: chart_data,
35
+ dark: dark ? "dark" : "",
35
36
  type: chart_type,
36
37
  title: title,
37
38
  subtitle: subtitle,
@@ -3,7 +3,7 @@
3
3
  import React, { type Node } from 'react'
4
4
  import classnames from 'classnames'
5
5
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
- import { globalProps } from '../utilities/globalProps.js'
6
+ import { globalProps } from '../utilities/globalProps'
7
7
 
8
8
  type ListProps = {
9
9
  aria?: object,
@@ -3,7 +3,7 @@
3
3
  import React, { type Node } from 'react'
4
4
  import classnames from 'classnames'
5
5
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
- import { globalProps } from '../utilities/globalProps.js'
6
+ import { globalProps } from '../utilities/globalProps'
7
7
 
8
8
  type ListItemProps = {
9
9
  aria?: object,
@@ -4,7 +4,7 @@ import React from 'react'
4
4
  import classnames from 'classnames'
5
5
 
6
6
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
7
- import { globalProps } from '../utilities/globalProps.js'
7
+ import { globalProps } from '../utilities/globalProps'
8
8
 
9
9
  import Avatar from '../pb_avatar/_avatar'
10
10
 
@@ -1,18 +1,16 @@
1
- /* @flow */
2
-
3
1
  import React from 'react'
4
2
  import classnames from 'classnames'
5
- import { globalProps } from '../utilities/globalProps.js'
3
+ import { GlobalProps, globalProps } from '../utilities/globalProps'
6
4
 
7
5
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
8
6
 
9
7
  type OnlineStatusProps = {
10
- aria?: object,
8
+ aria?: {[key: string]: string},
11
9
  className?: string,
12
- data?: object,
10
+ data?: {[key: string]: string | number},
13
11
  id?: string,
14
12
  status?: "online" | "offline" | "away",
15
- }
13
+ } & GlobalProps
16
14
 
17
15
  const OnlineStatus = (props: OnlineStatusProps) => {
18
16
  const {
@@ -1,10 +1,11 @@
1
1
  /* @flow */
2
+ /* eslint-disable react-hooks/rules-of-hooks */
2
3
 
3
4
  import React, { useCallback, useEffect, useMemo, useState } from 'react'
4
5
  import classnames from 'classnames'
5
6
 
6
7
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
7
- import { globalProps } from '../utilities/globalProps.js'
8
+ import { globalProps } from '../utilities/globalProps'
8
9
 
9
10
  import useZxcvbn from './useZxcvbn'
10
11
  import useHaveIBeenPwned from './useHaveIBeenPwned'
@@ -5,7 +5,7 @@ import React from 'react'
5
5
  import classnames from 'classnames'
6
6
  import Title from '../pb_title/_title.jsx'
7
7
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
8
- import { globalProps } from '../utilities/globalProps.js'
8
+ import { globalProps } from '../utilities/globalProps'
9
9
 
10
10
  type PillProps = {
11
11
  aria?: object,
@@ -13,7 +13,7 @@ import {
13
13
  import { buildAriaProps, buildCss, buildDataProps, noop } from '../utilities/props'
14
14
 
15
15
  import classnames from 'classnames'
16
- import { globalProps } from '../utilities/globalProps.js'
16
+ import { globalProps } from '../utilities/globalProps'
17
17
 
18
18
  type PbPopoverProps = {
19
19
  aria?: object,
@@ -150,16 +150,14 @@ export default class PbReactPopover extends React.Component<PbPopoverProps> {
150
150
  const targetIsReference =
151
151
  target.closest('.pb_popover_reference_wrapper') !== null
152
152
 
153
- if (targetIsReference) return
154
-
155
153
  switch (closeOnClick) {
156
154
  case 'outside':
157
- if (!targetIsPopover) {
155
+ if (!targetIsPopover || targetIsReference) {
158
156
  shouldClosePopover(true)
159
157
  }
160
158
  break
161
159
  case 'inside':
162
- if (targetIsPopover) {
160
+ if (targetIsPopover || targetIsReference) {
163
161
  shouldClosePopover(true)
164
162
  }
165
163
  break
@@ -1,23 +1,23 @@
1
1
  <%= pb_rails("flex", props: {classname: "flex-container", spacing: "between"}) do %>
2
2
  <span>
3
- <%= pb_rails("button", props: { text: "Click Inside", variant: "secondary", id: 'inside-popover-1' }) %>
3
+ <%= pb_rails("button", props: { text: "Click Inside", variant: "secondary", id: "inside-popover-1" }) %>
4
4
  <%= pb_rails("popover", props: {
5
5
  close_on_click: "inside",
6
6
  trigger_element_id: "inside-popover-1",
7
7
  tooltip_id: "inside-tooltip-1",
8
- position: 'bottom',
8
+ position: "bottom",
9
9
  offset: true
10
10
  }) do %>
11
11
  Click on me!
12
12
  <% end %>
13
13
  </span>
14
14
  <span>
15
- <%= pb_rails("button", props: { text: "Click Outside", variant: "secondary", id: 'outside-popover-1' }) %>
15
+ <%= pb_rails("button", props: { text: "Click Outside", variant: "secondary", id: "outside-popover-1" }) %>
16
16
  <%= pb_rails("popover", props: {
17
17
  close_on_click: "outside",
18
18
  trigger_element_id: "outside-popover-1",
19
19
  tooltip_id: "outside-tooltip-1",
20
- position: 'left',
20
+ position: "left",
21
21
  offset: true
22
22
  }) do %>
23
23
  Click anywhere but me!
@@ -27,16 +27,16 @@
27
27
  <%= pb_rails("button", props: {
28
28
  text: "Click Anywhere",
29
29
  variant: "secondary",
30
- id: 'any-popover-1'
30
+ id: "any-popover-1"
31
31
  }) %>
32
32
  <%= pb_rails("popover", props: {
33
33
  close_on_click: "any",
34
34
  trigger_element_id: "any-popover-1",
35
35
  tooltip_id: "any-tooltip-1",
36
- position: 'top',
36
+ position: "top",
37
37
  offset: true
38
38
  }) do %>
39
39
  Click anything!
40
40
  <% end %>
41
41
  </span>
42
- <% end %>
42
+ <% end %>
@@ -36,15 +36,14 @@ export default class PbPopover extends PbEnhancedElement {
36
36
  }
37
37
 
38
38
  setTimeout(() => {
39
- this.popper.update()
40
39
  this.toggleTooltip()
40
+ this.popper.update()
41
41
  }, 0)
42
42
  })
43
43
  }
44
44
 
45
45
  checkCloseTooltip() {
46
46
  document.querySelector('body').addEventListener('click', ({ target }) => {
47
- const isTriggerElement = target.closest(`#${this.triggerElementId}`) !== null
48
47
  const isTooltipElement = target.closest(`#${this.tooltipId}`) !== null
49
48
 
50
49
  switch (this.closeOnClick) {
@@ -52,21 +51,17 @@ export default class PbPopover extends PbEnhancedElement {
52
51
  this.hideTooltip()
53
52
  break
54
53
  case 'outside':
55
- if (isTooltipElement) {
56
- this.checkCloseTooltip()
57
- } else {
54
+ if (!isTooltipElement) {
58
55
  this.hideTooltip()
59
56
  }
60
57
  break
61
58
  case 'inside':
62
- if (isTooltipElement || isTriggerElement) {
59
+ if (isTooltipElement) {
63
60
  this.hideTooltip()
64
- } else {
65
- this.checkCloseTooltip()
66
61
  }
67
62
  break
68
63
  }
69
- }, { once: true })
64
+ }, true)
70
65
  }
71
66
 
72
67
  hideTooltip() {
@@ -3,7 +3,7 @@
3
3
  class: object.classname,
4
4
  data: object.data,
5
5
  id: object.id) do %>
6
- <div class="pb_popover_tooltip" id="<%= object.tooltip_id %>" role="tooltip" style="<%= object.z_index_helper %>">
6
+ <div class="pb_popover_tooltip hide" id="<%= object.tooltip_id %>" role="tooltip" style="<%= object.z_index_helper %>">
7
7
  <div class="pb_popover_body <%= object.width_height_class_helper %> <%= object.popover_spacing_helper %>" style="<%= object.width_height_helper %>">
8
8
  <%= content.presence %>
9
9
  </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
- import { globalProps } from '../utilities/globalProps.js'
5
+ import { globalProps } from '../utilities/globalProps'
6
6
 
7
7
  type ProgressSimpleProps = {
8
8
  align?: "left" | "center" | "right",
@@ -3,7 +3,7 @@
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
5
  import { buildCss } from '../utilities/props'
6
- import { globalProps } from '../utilities/globalProps.js'
6
+ import { globalProps } from '../utilities/globalProps'
7
7
 
8
8
  type ProgressStepProps = {
9
9
  className?: string,
@@ -5,7 +5,7 @@ import React, { forwardRef } from 'react'
5
5
  import Body from '../pb_body/_body.jsx'
6
6
  import classnames from 'classnames'
7
7
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
8
- import { globalProps } from '../utilities/globalProps.js'
8
+ import { globalProps } from '../utilities/globalProps'
9
9
 
10
10
  type RadioProps = {
11
11
  aria?: object,
@@ -1,4 +1,5 @@
1
1
  /* @flow */
2
+ /* eslint-disable react-hooks/rules-of-hooks */
2
3
 
3
4
  import React, { useEffect, useRef } from 'react'
4
5
  import classnames from 'classnames'
@@ -129,6 +130,10 @@ const RichTextEditor = (props: RichTextEditorProps) => {
129
130
  trixRef.current.addEventListener('click', handleClick)
130
131
  }, [])
131
132
 
133
+ useEffect(() => {
134
+ trixRef.current.editor.loadHTML(value)
135
+ }, [value])
136
+
132
137
  const RichTextEditorClass = 'pb_rich_text_editor_kit'
133
138
  const SimpleClass = simple ? 'simple' : ''
134
139
  const FocusClass = focus ? 'focus-editor-targets' : ''
@@ -3,7 +3,7 @@
3
3
  import React, { type Node } from 'react'
4
4
  import classnames from 'classnames'
5
5
  import { buildAriaProps, buildDataProps } from '../utilities/props'
6
- import { globalProps } from '../utilities/globalProps.js'
6
+ import { globalProps } from '../utilities/globalProps'
7
7
  import PbTable from './'
8
8
 
9
9
  type TableProps = {
@@ -2,7 +2,7 @@
2
2
  import React from 'react'
3
3
  import classnames from 'classnames'
4
4
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
5
- import { globalProps } from '../utilities/globalProps.js'
5
+ import { globalProps } from '../utilities/globalProps'
6
6
 
7
7
  type TableRowPropTypes = {
8
8
  aria?: object,
@@ -2,7 +2,7 @@
2
2
  import React, { forwardRef } from 'react'
3
3
  import classnames from 'classnames'
4
4
 
5
- import { globalProps } from '../utilities/globalProps.js'
5
+ import { globalProps } from '../utilities/globalProps'
6
6
  import { buildAriaProps, buildDataProps } from '../utilities/props'
7
7
 
8
8
  import Flex from '../pb_flex/_flex'
@@ -4,12 +4,12 @@
4
4
 
5
5
 
6
6
  [class^=pb_text_input_kit] {
7
+ margin-bottom: $space_sm;
7
8
  .pb_text_input_kit_label {
8
9
  margin-bottom: $space_xs;
9
10
  display: block;
10
11
  }
11
12
  .text_input_wrapper {
12
- margin-bottom: $space_sm;
13
13
  display: block;
14
14
  input::placeholder,
15
15
  .text_input .placeholder {
@@ -75,3 +75,17 @@ test('returns additional class name', () => {
75
75
  const kit = screen.getByTestId(testId)
76
76
  expect(kit).toHaveClass(`${kitClass} dark error`)
77
77
  })
78
+
79
+ test('returns additional class name', () => {
80
+ render(
81
+ <TextInput
82
+ data={{ testid: testId }}
83
+ label="First Name"
84
+ marginBottom="lg"
85
+ placeholder="Enter first name"
86
+ />
87
+ )
88
+
89
+ const kit = screen.getByTestId(testId)
90
+ expect(kit).toHaveClass(`${kitClass} mb_lg`)
91
+ })
@@ -1,4 +1,5 @@
1
1
  /* @flow */
2
+ /* eslint-disable react-hooks/rules-of-hooks */
2
3
 
3
4
  import React, { forwardRef, useEffect, useRef } from 'react'
4
5
  import classnames from 'classnames'
@@ -5,7 +5,7 @@ import classnames from 'classnames'
5
5
 
6
6
  import DateTime from '../pb_kit/dateTime.js'
7
7
  import { buildCss } from '../utilities/props'
8
- import { globalProps } from '../utilities/globalProps.js'
8
+ import { globalProps } from '../utilities/globalProps'
9
9
 
10
10
  import Body from '../pb_body/_body'
11
11
  import Caption from '../pb_caption/_caption'
@@ -3,7 +3,7 @@
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
5
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
- import { deprecatedProps, globalProps } from '../utilities/globalProps.js'
6
+ import { deprecatedProps, globalProps } from '../utilities/globalProps'
7
7
 
8
8
  type TitleProps = {
9
9
  aria?: object,
@@ -10,7 +10,7 @@ import {
10
10
  buildDataProps,
11
11
  } from '../utilities/props'
12
12
 
13
- import { globalProps } from '../utilities/globalProps.js'
13
+ import { globalProps } from '../utilities/globalProps'
14
14
 
15
15
  type Props = {
16
16
  aria?: object,
@@ -6,7 +6,7 @@ import AsyncSelect from 'react-select/async'
6
6
  import CreateableSelect from 'react-select/creatable'
7
7
  import AsyncCreateableSelect from 'react-select/async-creatable'
8
8
  import { get, isString, uniqueId } from 'lodash'
9
- import { globalProps } from '../utilities/globalProps.js'
9
+ import { globalProps } from '../utilities/globalProps'
10
10
  import classnames from 'classnames'
11
11
 
12
12
  import Control from './components/Control'
@@ -2,7 +2,7 @@
2
2
  import React from 'react'
3
3
  import classnames from 'classnames'
4
4
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
5
- import { globalProps } from '../utilities/globalProps.js'
5
+ import { globalProps } from '../utilities/globalProps'
6
6
 
7
7
  type UserBadgeProps = {
8
8
  aria?: object,
@@ -6,7 +6,7 @@
6
6
  import React from 'react'
7
7
  import classnames from 'classnames'
8
8
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
9
- import { globalProps } from '../utilities/globalProps.js'
9
+ import { globalProps } from '../utilities/globalProps'
10
10
  import Joyride from 'react-joyride'
11
11
  import Button from '../pb_button/_button'
12
12
  import Flex from '../pb_flex/_flex'
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
- import { globalProps } from '../utilities/globalProps.js'
5
+ import { globalProps } from '../utilities/globalProps'
6
6
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
7
7
 
8
8
  import Caption from '../pb_caption/_caption'
@@ -1,6 +1,7 @@
1
1
  import Highcharts from 'highcharts'
2
2
 
3
3
  import { highchartsTheme } from '../pb_dashboard/pbChartsLightTheme'
4
+ import { highchartsDarkTheme } from '../pb_dashboard/pbChartsDarkTheme'
4
5
  import colors from '../tokens/exports/_colors.scss'
5
6
 
6
7
  import pie from 'highcharts/modules/variable-pie'
@@ -67,10 +68,14 @@ class pbChart {
67
68
  }
68
69
  }
69
70
 
71
+ setupTheme() {
72
+ this.options.dark ? Highcharts.setOptions(highchartsDarkTheme) : Highcharts.setOptions(highchartsTheme)
73
+ }
74
+
70
75
  setupGauge(options) {
71
76
  highchartsMore(Highcharts)
72
77
  solidGauge(Highcharts)
73
- Highcharts.setOptions(highchartsTheme)
78
+ this.setupTheme()
74
79
 
75
80
  Highcharts.chart(this.defaults.id, {
76
81
  chart: {
@@ -140,7 +145,7 @@ class pbChart {
140
145
  }
141
146
 
142
147
  setupPieChart(options) {
143
- Highcharts.setOptions(highchartsTheme)
148
+ this.setupTheme()
144
149
  Highcharts.chart(this.defaults.id, {
145
150
  title: {
146
151
  text: this.defaults.title,
@@ -187,8 +192,7 @@ class pbChart {
187
192
  }
188
193
 
189
194
  setupChart(options) {
190
- Highcharts.setOptions(highchartsTheme)
191
-
195
+ this.setupTheme()
192
196
  const configOptions = {
193
197
  title: {
194
198
  text: this.defaults.title,