playbook_ui 10.26.0.pre.alpha.sticky1 → 10.26.0.pre.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/data/menu.yml +1 -0
  3. data/app/pb_kits/playbook/index.js +2 -1
  4. data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +3 -3
  5. data/app/pb_kits/playbook/pb_badge/{_badge.jsx → _badge.tsx} +14 -15
  6. data/app/pb_kits/playbook/pb_badge/docs/_badge_colors.jsx +1 -1
  7. data/app/pb_kits/playbook/pb_badge/docs/_badge_default.jsx +1 -1
  8. data/app/pb_kits/playbook/pb_badge/docs/_badge_rounded.jsx +1 -1
  9. data/app/pb_kits/playbook/pb_badge/docs/index.js +3 -3
  10. data/app/pb_kits/playbook/pb_body/_body.tsx +8 -8
  11. data/app/pb_kits/playbook/pb_button/{_button.jsx → _button.tsx} +65 -46
  12. data/app/pb_kits/playbook/pb_button/docs/_button_options.jsx +1 -1
  13. data/app/pb_kits/playbook/pb_caption/{_caption.jsx → _caption.tsx} +7 -8
  14. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -0
  15. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.jsx +4 -2
  16. data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +1 -1
  17. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.js +37 -0
  18. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +37 -0
  19. data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +2 -2
  20. data/app/pb_kits/playbook/pb_icon/{_icon.jsx → _icon.tsx} +40 -30
  21. data/app/pb_kits/playbook/pb_image/_image.tsx +1 -1
  22. data/app/pb_kits/playbook/pb_pill/{_pill.jsx → _pill.tsx} +6 -8
  23. data/app/pb_kits/playbook/pb_pill/docs/_pill_default.jsx +1 -1
  24. data/app/pb_kits/playbook/pb_pill/docs/_pill_variants.jsx +1 -1
  25. data/app/pb_kits/playbook/pb_title/{_title.jsx → _title.tsx} +10 -12
  26. data/app/pb_kits/playbook/pb_title/title.test.js +2 -2
  27. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx +79 -0
  28. data/app/pb_kits/playbook/pb_treemap_chart/docs/_description.md +5 -0
  29. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb +37 -0
  30. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx +48 -0
  31. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.md +2 -0
  32. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.html.erb +37 -0
  33. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.jsx +47 -0
  34. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.md +3 -0
  35. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.html.erb +79 -0
  36. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.jsx +90 -0
  37. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.md +1 -0
  38. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.html.erb +54 -0
  39. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.jsx +65 -0
  40. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.md +3 -0
  41. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.html.erb +37 -0
  42. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx +48 -0
  43. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.md +3 -0
  44. data/app/pb_kits/playbook/pb_treemap_chart/docs/example.yml +15 -0
  45. data/app/pb_kits/playbook/pb_treemap_chart/docs/index.js +5 -0
  46. data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.html.erb +1 -0
  47. data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +43 -0
  48. data/app/pb_kits/playbook/playbook-doc.js +2 -0
  49. data/app/pb_kits/playbook/playbook-rails-react-bindings.js +2 -0
  50. data/app/pb_kits/playbook/plugins/pb_chart.js +34 -0
  51. data/app/pb_kits/playbook/tokens/_display.scss +13 -0
  52. data/app/pb_kits/playbook/tokens/_screen_sizes.scss +36 -0
  53. data/app/pb_kits/playbook/utilities/_display.scss +26 -2
  54. data/app/pb_kits/playbook/utilities/globalProps.ts +31 -16
  55. data/lib/playbook/display.rb +21 -7
  56. data/lib/playbook/version.rb +2 -2
  57. metadata +30 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf78ed906a18245b33919539767b4548820b23c2e88196f790cc4cc3c928dde4
4
- data.tar.gz: f4619a7704a66989d2dbc5221d904e0fe3bec27d6908ea8349247de683fc68b2
3
+ metadata.gz: '048acddb29dd15f68b34839ca45ccd4df1d42336d4820e47de25dbe3ebc0249c'
4
+ data.tar.gz: 34eebfcebf6b68b56463789a1e38c1fb5984f3a84359b18e2443155cbe3ac8c8
5
5
  SHA512:
6
- metadata.gz: 27b1b9f29f502c1fb95cb03b6bd623ecd0a0c90cb3aad20b95fb687c9048f37c3a3e7737f27d14f54719f1dd0afa3455cfc46f2fdd0470e70b1879db59cdb615
7
- data.tar.gz: 9d7a07450758941dc3c1427723d94508bfef0a9db8ebc227d5ad12af04556fc4fe2a5d0aaa12d7f273bcd3658b8c2733581b24ca4dba3ac4fed359fb2965ef56
6
+ metadata.gz: 9c9c0665cee4d841bb9b4b404727e5a0912218f6e1f285996cb8c3de268380e7b5936a63f0befd150a0f5c9bfd6db55551da65a29d59269d3add7710f95d9c73
7
+ data.tar.gz: 3507fad3d27741a06660b2f50c8068e0a2736b80b9f07edb753a539c31f43cfa34b36e1d0e0251547c6262570ff7d02859b0ee69fa0377a0f63068b82f49b1a7
@@ -20,6 +20,7 @@ kits:
20
20
  - gauge
21
21
  - legend
22
22
  - line_graph
23
+ - treemap_chart
23
24
  - dialog
24
25
  - filter
25
26
  - fixed_confirmation_toast
@@ -4,7 +4,6 @@ import 'lazysizes/plugins/attrchange/ls.attrchange'
4
4
  import 'lazysizes'
5
5
 
6
6
  // vvv React Component JSX Imports from the React Kits vvv
7
- export { default as Walkthrough } from './pb_walkthrough/_walkthrough'
8
7
  export { default as Avatar } from './pb_avatar/_avatar'
9
8
  export { default as AvatarActionButton } from './pb_avatar_action_button/_avatar_action_button'
10
9
  export { default as Background } from './pb_background/_background'
@@ -98,9 +97,11 @@ export { default as Title } from './pb_title/_title'
98
97
  export { default as TitleCount } from './pb_title_count/_title_count'
99
98
  export { default as TitleDetail } from './pb_title_detail/_title_detail'
100
99
  export { default as Toggle } from './pb_toggle/_toggle'
100
+ export { default as TreemapChart } from './pb_treemap_chart/_treemap_chart'
101
101
  export { default as Typeahead } from './pb_typeahead/_typeahead'
102
102
  export { default as User } from './pb_user/_user'
103
103
  export { default as UserBadge } from './pb_user_badge/_user_badge'
104
+ export { default as Walkthrough } from './pb_walkthrough/_walkthrough'
104
105
  export { default as WeekdayStacked } from './pb_weekday_stacked/_weekday_stacked'
105
106
  // ^^^ React Component JSX Imports from the React Kits ^^^
106
107
 
@@ -2,7 +2,7 @@ import React, { useState } from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
5
- import { globalProps } from '../utilities/globalProps'
5
+ import { globalProps, GlobalProps } from '../utilities/globalProps'
6
6
 
7
7
  import Image from '../pb_image/_image'
8
8
  import OnlineStatus from '../pb_online_status/_online_status'
@@ -18,14 +18,14 @@ type AvatarProps = {
18
18
  name: string,
19
19
  size?: "md" | "lg" | "sm" | "xl" | "xs" | "xxs",
20
20
  status: "away" | "offline" | "online",
21
- }
21
+ } & GlobalProps
22
22
 
23
23
  const firstTwoInitials = (name: string) =>
24
24
  name.split(/\s/).map((name) => name[0])
25
25
  .join('')
26
26
  .substring(0, 2)
27
27
 
28
- const Avatar = (props: AvatarProps) => {
28
+ const Avatar = (props: AvatarProps): React.ReactElement => {
29
29
  const {
30
30
  aria = {},
31
31
  className,
@@ -1,9 +1,7 @@
1
- /* @flow */
2
-
3
1
  import React from 'react'
4
2
  import classnames from 'classnames'
5
3
 
6
- import { globalProps } from '../utilities/globalProps'
4
+ import { GlobalProps, globalProps } from '../utilities/globalProps'
7
5
  import {
8
6
  buildAriaProps,
9
7
  buildCss,
@@ -13,21 +11,22 @@ import {
13
11
  import Icon from '../pb_icon/_icon'
14
12
 
15
13
  type BadgeProps = {
16
- aria?: object,
14
+ aria?: {[key: string]: string},
17
15
  className?: string,
18
16
  closeProps?: {
19
- onClick?: EventHandler,
20
- onMouseDown?: EventHandler,
21
- onTouchEnd?: EventHandler,
17
+ onClick?: React.MouseEventHandler<HTMLSpanElement>,
18
+ onMouseDown?: React.MouseEventHandler<HTMLSpanElement>,
19
+ onTouchEnd?: React.TouchEventHandler<HTMLSpanElement>,
22
20
  },
23
- data?: object,
21
+ data?: {[key: string]: string},
24
22
  id?: string,
25
- removeIcon?: Boolean,
26
- removeOnClick?: EventHandler,
23
+ removeIcon?: boolean,
24
+ removeOnClick?: React.MouseEventHandler<HTMLSpanElement>,
27
25
  rounded?: boolean,
28
26
  text?: string,
29
27
  variant?: "error" | "info" | "neutral" | "primary" | "success" | "warning",
30
- }
28
+ } & GlobalProps
29
+
31
30
  const Badge = (props: BadgeProps) => {
32
31
  const {
33
32
  aria = {},
@@ -36,7 +35,7 @@ const Badge = (props: BadgeProps) => {
36
35
  data = {},
37
36
  id,
38
37
  removeIcon = false,
39
- removeOnClick = () => {},
38
+ removeOnClick,
40
39
  rounded = false,
41
40
  text,
42
41
  variant = 'neutral',
@@ -44,7 +43,7 @@ const Badge = (props: BadgeProps) => {
44
43
  const ariaProps = buildAriaProps(aria)
45
44
  const dataProps = buildDataProps(data)
46
45
  const css = classnames(
47
- buildCss('pb_badge_kit', variant, { rounded }),
46
+ buildCss('pb_badge_kit', variant, rounded ? 'rounded' : null),
48
47
  globalProps(props),
49
48
  className
50
49
  )
@@ -58,7 +57,7 @@ const Badge = (props: BadgeProps) => {
58
57
  >
59
58
  <span>
60
59
  {text}
61
- <If condition={removeIcon}>
60
+ {removeIcon && (
62
61
  <span
63
62
  onClick={removeOnClick}
64
63
  style={{ cursor: 'pointer' }}
@@ -69,7 +68,7 @@ const Badge = (props: BadgeProps) => {
69
68
  icon="times"
70
69
  />
71
70
  </span>
72
- </If>
71
+ )}
73
72
  </span>
74
73
  </div>
75
74
  )
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import Badge from '../_badge.jsx'
2
+ import Badge from '../_badge'
3
3
 
4
4
  const BadgeColors = (props) => {
5
5
  return (
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import Badge from '../_badge.jsx'
2
+ import Badge from '../_badge'
3
3
 
4
4
  const BadgeDefault = (props) => {
5
5
  return (
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import Badge from '../_badge.jsx'
2
+ import Badge from '../_badge'
3
3
 
4
4
  const BadgeRounded = (props) => {
5
5
  return (
@@ -1,3 +1,3 @@
1
- export { default as BadgeDefault } from './_badge_default.jsx'
2
- export { default as BadgeRounded } from './_badge_rounded.jsx'
3
- export { default as BadgeColors } from './_badge_colors.jsx'
1
+ export { default as BadgeDefault } from './_badge_default'
2
+ export { default as BadgeRounded } from './_badge_rounded'
3
+ export { default as BadgeColors } from './_badge_colors'
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
5
- import { globalProps } from '../utilities/globalProps'
5
+ import { globalProps, GlobalProps } from '../utilities/globalProps'
6
6
 
7
7
  import Highlight from '../pb_highlight/_highlight'
8
8
 
@@ -20,7 +20,7 @@ type BodyProps = {
20
20
  tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div',
21
21
  text?: string,
22
22
  variant: null | 'link',
23
- }
23
+ } & GlobalProps
24
24
 
25
25
  const Body = (props: BodyProps): React.ReactElement => {
26
26
  const {
@@ -56,12 +56,12 @@ const Body = (props: BodyProps): React.ReactElement => {
56
56
  id={id}
57
57
  >
58
58
  { highlighting && (
59
- <Highlight
60
- highlightedText={highlightedText}
61
- text={text}
62
- >
63
- {children}
64
- </Highlight>
59
+ <Highlight
60
+ highlightedText={highlightedText}
61
+ text={text}
62
+ >
63
+ {children}
64
+ </Highlight>
65
65
  ) }
66
66
  { !highlighting && (
67
67
  text || children
@@ -1,18 +1,17 @@
1
- /* @flow */
2
-
3
1
  import React from 'react'
4
2
  import classnames from 'classnames'
5
3
  import { buildAriaProps, buildDataProps } from '../utilities/props'
6
- import { globalProps } from '../utilities/globalProps'
4
+ import { GlobalProps, globalProps } from '../utilities/globalProps'
5
+
6
+ import Icon from '../pb_icon/_icon'
7
7
 
8
- import Icon from '../pb_icon/_icon.jsx'
8
+ type EventHandler = (React.MouseEventHandler<HTMLElement>)
9
9
 
10
- type EventHandler = (SyntheticInputEvent<HTMLInputElement>) => void
11
10
  type ButtonPropTypes = {
12
- aria?: object,
13
- children?: array<React.ReactChild>,
14
- className?: string | array<string>,
15
- data?: object,
11
+ aria?: {[key: string]: string},
12
+ children?: React.ReactChild[] | React.ReactChild,
13
+ className?: string | string[],
14
+ data?: {[key: string]: string},
16
15
  disabled?: boolean,
17
16
  fixedWidth?: boolean,
18
17
  form?: string,
@@ -26,11 +25,11 @@ type ButtonPropTypes = {
26
25
  size?: 'sm' | 'md' | 'lg',
27
26
  text?: string,
28
27
  type: 'inline' | null,
29
- htmlType: string | 'button',
28
+ htmlType: 'submit' | 'reset' | 'button' | undefined,
30
29
  value?: string | null,
31
30
  variant: 'primary' | 'secondary' | 'link',
32
31
  wrapperClass: string,
33
- }
32
+ } & GlobalProps
34
33
 
35
34
  const buttonClassName = (props: ButtonPropTypes) => {
36
35
  const {
@@ -64,7 +63,7 @@ const Button = (props: ButtonPropTypes) => {
64
63
  icon = null,
65
64
  id,
66
65
  loading = false,
67
- onClick = () => {},
66
+ onClick,
68
67
  link = null,
69
68
  newWindow = false,
70
69
  text,
@@ -92,46 +91,66 @@ const Button = (props: ButtonPropTypes) => {
92
91
 
93
92
  const content = (
94
93
  <span className="pb_button_content">
95
- <If condition={icon !== null}>
94
+ {icon && (
96
95
  <i className={`pb_icon_kit far fa-${icon} fa-fw`} />
97
- {' '}
98
- </If>
96
+ )}
99
97
  <span>{text || children}</span>
100
98
  </span>
101
99
  )
102
100
 
101
+ const ifLoading = () => {
102
+ if (loading){
103
+ return(
104
+ <>
105
+ {loadingIcon}
106
+ </>
107
+ )
108
+ } else {
109
+ return (
110
+ content
111
+ )
112
+ }
113
+ }
114
+
115
+ const displayButton = () => {
116
+ if (link)
117
+ return (
118
+ <a
119
+ {...ariaProps}
120
+ {...dataProps}
121
+ className={css}
122
+ href={link}
123
+ id={id}
124
+ rel="noreferrer"
125
+ role="link"
126
+ target={newWindow ? '_blank' : null}
127
+ >
128
+ {ifLoading()}
129
+ </a>
130
+ )
131
+ else
132
+ return (
133
+ <button
134
+ {...ariaProps}
135
+ {...dataProps}
136
+ className={css}
137
+ disabled={disabled}
138
+ form={form}
139
+ id={id}
140
+ onClick={onClick}
141
+ role="button"
142
+ type={htmlType}
143
+ value={value}
144
+ >
145
+ {ifLoading()}
146
+ </button>
147
+ )
148
+ }
149
+
103
150
  return (
104
- <If condition={link !== null}>
105
- <a
106
- {...ariaProps}
107
- {...dataProps}
108
- className={css}
109
- href={link}
110
- id={id}
111
- rel="noreferrer"
112
- role="link"
113
- target={newWindow ? '_blank' : null}
114
- >
115
- <If condition={loading}>{loadingIcon}</If>
116
- {content}
117
- </a>
118
- <Else />
119
- <button
120
- {...ariaProps}
121
- {...dataProps}
122
- className={css}
123
- disabled={disabled}
124
- form={form}
125
- id={id}
126
- onClick={onClick}
127
- role="button"
128
- type={htmlType}
129
- value={value}
130
- >
131
- <If condition={loading}>{loadingIcon}</If>
132
- {content}
133
- </button>
134
- </If>
151
+ <>
152
+ {displayButton()}
153
+ </>
135
154
  )
136
155
  }
137
156
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import Button from '../_button.jsx'
2
+ import Button from '../_button'
3
3
 
4
4
  const ButtonOptions = (props) => (
5
5
  <div>
@@ -1,24 +1,22 @@
1
- /* @flow */
2
-
3
1
  import React from 'react'
4
2
  import classnames from 'classnames'
5
3
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
- import { deprecatedProps, globalProps } from '../utilities/globalProps'
4
+ import { deprecatedProps, globalProps, GlobalProps } from '../utilities/globalProps'
7
5
 
8
6
  type CaptionProps = {
9
- aria?: object,
10
- children: array<React.ReactNode> | React.ReactNode,
7
+ aria?: {[key: string]: string},
8
+ children: React.ReactChild[],
11
9
  className?: string,
12
10
  color?: "default" | "light" | "lighter" | "success" | "error" | "link",
13
- data?: object,
11
+ data?: {[key: string]: string},
14
12
  id?: string,
15
13
  size?: "xs" | "sm" | "md" | "lg" | "xl",
16
14
  tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div" | "caption",
17
15
  text?: string,
18
16
  variant?: null | "link",
19
- };
17
+ } & GlobalProps;
20
18
 
21
- const Caption = (props: CaptionProps) => {
19
+ const Caption = (props: CaptionProps): React.ReactElement => {
22
20
  if (props.variant) deprecatedProps('Title', ['variant']) //variant prop is deprecated, use color instead
23
21
  const {
24
22
  aria = {},
@@ -32,6 +30,7 @@ const Caption = (props: CaptionProps) => {
32
30
  text,
33
31
  variant = null,
34
32
  } = props
33
+
35
34
  const tagOptions = [
36
35
  'h1',
37
36
  'h2',
@@ -4,6 +4,7 @@
4
4
  @import "../tokens/colors";
5
5
  @import "../tokens/transition";
6
6
  @import "../tokens/animation-curves";
7
+ @import "../tokens/display";
7
8
 
8
9
  $pb_card_border_width: 1px;
9
10
  $pb_card_border_radius: $border_rad_heavier;
@@ -35,12 +35,14 @@ const Icon = ({ collapsed }: IconProps) => {
35
35
  const CollapsibleMain = ({
36
36
  children,
37
37
  className,
38
+ cursor = 'pointer',
38
39
  padding = 'md',
40
+
39
41
  ...props
40
42
  }: CollapsibleMainProps) => {
41
43
  const context = useContext(CollapsibleContext)
42
44
  const mainCSS = buildCss('pb_collapsible_main_kit')
43
- const mainSpacing = globalProps(props, { padding })
45
+ const mainSpacing = globalProps(props, { cursor, padding })
44
46
 
45
47
  return (
46
48
  <div className={classnames(mainCSS, className, mainSpacing)}>
@@ -50,7 +52,7 @@ const CollapsibleMain = ({
50
52
  vertical="center"
51
53
  >
52
54
  <FlexItem>{children}</FlexItem>
53
- <FlexItem><Icon collapsed={context.collapsed} /></FlexItem>
55
+ <FlexItem><Icon collapsed={context.collapsed}/></FlexItem>
54
56
  </Flex>
55
57
  </div>
56
58
  </div>
@@ -4,7 +4,7 @@
4
4
  class: object.classname,
5
5
  aria: object.aria) do %>
6
6
 
7
- <%= pb_rails("flex", props: {vertical: "center", spacing: "between"}) do %>
7
+ <%= pb_rails("flex", props: {vertical: "center", spacing: "between", cursor: "pointer"}) do %>
8
8
  <%= pb_rails("flex/flex_item") do %>
9
9
  <%= content.presence %>
10
10
  <% end %>
@@ -209,6 +209,43 @@ const highchartsDarkTheme = {
209
209
  threshold: null,
210
210
  },
211
211
  },
212
+
213
+ //TREEMAP CHART STYLES
214
+ treemap: {
215
+ layoutAlgorithm: "squarified",
216
+ allowTraversingTree: false,
217
+ animationLimit: 1000,
218
+ colors: [
219
+ colors.data_1,
220
+ colors.data_2,
221
+ colors.data_3,
222
+ colors.data_4,
223
+ colors.data_5,
224
+ colors.data_6,
225
+ colors.data_7,
226
+ colors.data_8,
227
+ ],
228
+ colorByPoint: true,
229
+ dataLabels: {
230
+ enabled: true,
231
+ style: {
232
+ fontFamily: typography.font_family_base,
233
+ fontWeight: typography.bold,
234
+ fontSize: typography.heading_4,
235
+ },
236
+ },
237
+ levels: [
238
+ {
239
+ level: 1,
240
+ dataLabels: {
241
+ enabled: false,
242
+ },
243
+ },
244
+ ],
245
+ traverseUpButton: {
246
+ position: { y: -40 },
247
+ }
248
+ },
212
249
  },
213
250
  }
214
251
 
@@ -209,6 +209,43 @@ const highchartsTheme = {
209
209
  threshold: null,
210
210
  },
211
211
  },
212
+
213
+ //TREEMAP CHART STYLES
214
+ treemap: {
215
+ layoutAlgorithm: "squarified",
216
+ allowTraversingTree: false,
217
+ animationLimit: 1000,
218
+ colors: [
219
+ colors.data_1,
220
+ colors.data_2,
221
+ colors.data_3,
222
+ colors.data_4,
223
+ colors.data_5,
224
+ colors.data_6,
225
+ colors.data_7,
226
+ colors.data_8,
227
+ ],
228
+ colorByPoint: true,
229
+ dataLabels: {
230
+ enabled: true,
231
+ style: {
232
+ fontFamily: typography.font_family_base,
233
+ fontWeight: typography.bold,
234
+ fontSize: typography.heading_4,
235
+ },
236
+ },
237
+ levels: [
238
+ {
239
+ level: 1,
240
+ dataLabels: {
241
+ enabled: false,
242
+ },
243
+ },
244
+ ],
245
+ traverseUpButton: {
246
+ position: { y: -40 },
247
+ }
248
+ },
212
249
  },
213
250
  }
214
251
 
@@ -1,8 +1,8 @@
1
1
  /* @flow */
2
2
  import React from 'react'
3
3
  import classnames from 'classnames'
4
- import Title from '../pb_title/_title.jsx'
5
- import Icon from '../pb_icon/_icon.jsx'
4
+ import Title from '../pb_title/_title'
5
+ import Icon from '../pb_icon/_icon'
6
6
  import Avatar from '../pb_avatar/_avatar'
7
7
  import { globalProps } from '../utilities/globalProps'
8
8
 
@@ -1,16 +1,14 @@
1
- /* @flow */
2
-
3
1
  import React from 'react'
4
2
  import classnames from 'classnames'
5
3
  import { buildAriaProps, buildDataProps } from '../utilities/props'
6
- import { globalProps } from '../utilities/globalProps'
4
+ import { GlobalProps, globalProps } from '../utilities/globalProps'
7
5
 
8
6
  type IconProps = {
9
- aria?: object,
10
- border?: boolean,
7
+ aria?: {[key: string]: string},
8
+ border?: string,
11
9
  className?: string,
12
- customIcon?: SVGElement,
13
- data?: object,
10
+ customIcon?: {[key: string] :SVGElement},
11
+ data?: {[key: string]: string},
14
12
  fixedWidth?: boolean,
15
13
  flip?: "horizontal" | "vertical" | "both" | "none",
16
14
  icon: string,
@@ -34,12 +32,13 @@ type IconProps = {
34
32
  | "9x"
35
33
  | "10x",
36
34
  spin?: boolean,
37
- }
35
+ } & GlobalProps
38
36
 
39
37
  const flipMap = {
40
38
  horizontal: 'fa-flip-horizontal',
41
39
  vertical: 'fa-flip-vertical',
42
40
  both: 'fa-flip-horizontal fa-flip-vertical',
41
+ none: ""
43
42
  }
44
43
 
45
44
  const Icon = (props: IconProps) => {
@@ -50,7 +49,7 @@ const Icon = (props: IconProps) => {
50
49
  customIcon,
51
50
  data = {},
52
51
  fixedWidth = true,
53
- flip = false,
52
+ flip = "none",
54
53
  icon,
55
54
  id,
56
55
  inverse = false,
@@ -90,31 +89,42 @@ const Icon = (props: IconProps) => {
90
89
  )
91
90
 
92
91
  aria.label ? null : aria.label = `${icon} icon`
93
- const ariaProps = buildAriaProps(aria)
94
- const dataProps = buildDataProps(data)
92
+ const ariaProps: {[key: string]: any} = buildAriaProps(aria)
93
+ const dataProps: {[key: string]: any} = buildDataProps(data)
95
94
 
96
95
  // Add a conditional here to show only the SVG if custom
96
+ const displaySVG = (customIcon: any) => {
97
+ if (customIcon)
98
+ return (
99
+ <>
100
+ {
101
+ React.cloneElement(customIcon, {
102
+ ...dataProps,
103
+ className: classes,
104
+ id,
105
+ })
106
+ }
107
+ </>
108
+ )
109
+ else
110
+ return (
111
+ <>
112
+ <i
113
+ {...dataProps}
114
+ className={classes}
115
+ id={id}
116
+ />
117
+ <span
118
+ {...ariaProps}
119
+ hidden
120
+ />
121
+ </>
122
+ )
123
+ }
124
+
97
125
  return (
98
126
  <>
99
- <If condition={customIcon}>
100
- {
101
- React.cloneElement(customIcon, {
102
- ...dataProps,
103
- className: classes,
104
- id,
105
- })
106
- }
107
- <Else />
108
- <i
109
- {...dataProps}
110
- className={classes}
111
- id={id}
112
- />
113
- <span
114
- {...ariaProps}
115
- hidden
116
- />
117
- </If>
127
+ {displaySVG(customIcon)}
118
128
  </>
119
129
  )
120
130
  }
@@ -16,7 +16,7 @@ type ImageType = {
16
16
  url?: string,
17
17
  } & GlobalProps
18
18
 
19
- const Image = (props: ImageType) => {
19
+ const Image = (props: ImageType): React.ReactElement => {
20
20
  const {
21
21
  alt = '',
22
22
  aria = {},