playbook_ui 2.8.7 → 2.8.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/packs/examples.js +3 -0
  3. data/app/pb_kits/playbook/packs/kits.js +1 -0
  4. data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +25 -36
  5. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +54 -14
  6. data/app/pb_kits/playbook/pb_bar_graph/barGraphSettings.js +17 -17
  7. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.html.erb +8 -1
  8. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +30 -8
  9. data/app/pb_kits/playbook/pb_body/_body.jsx +46 -33
  10. data/app/pb_kits/playbook/pb_body/docs/_body_dark.jsx +3 -0
  11. data/app/pb_kits/playbook/pb_body/docs/_body_light.jsx +3 -0
  12. data/app/pb_kits/playbook/pb_button/_button.jsx +106 -37
  13. data/app/pb_kits/playbook/pb_button/docs/_button_accessibility.jsx +15 -0
  14. data/app/pb_kits/playbook/pb_button/docs/_button_block_content.jsx +14 -0
  15. data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +22 -0
  16. data/app/pb_kits/playbook/pb_button/docs/_button_default_dark.jsx +22 -0
  17. data/app/pb_kits/playbook/pb_button/docs/_button_full_width.jsx +13 -0
  18. data/app/pb_kits/playbook/pb_button/docs/_button_link.jsx +23 -0
  19. data/app/pb_kits/playbook/pb_button/docs/_button_loading.jsx +23 -0
  20. data/app/pb_kits/playbook/pb_button/docs/example.yml +8 -4
  21. data/app/pb_kits/playbook/pb_button/docs/index.js +7 -3
  22. data/app/pb_kits/playbook/pb_caption/_caption.jsx +31 -34
  23. data/app/pb_kits/playbook/pb_card/_card.jsx +35 -20
  24. data/app/pb_kits/playbook/pb_card/docs/_card_content.jsx +17 -0
  25. data/app/pb_kits/playbook/pb_card/docs/_card_padding.jsx +23 -0
  26. data/app/pb_kits/playbook/pb_card/docs/_card_selected.jsx +14 -0
  27. data/app/pb_kits/playbook/pb_card/docs/_card_shadow.jsx +23 -0
  28. data/app/pb_kits/playbook/pb_card/docs/example.yml +4 -0
  29. data/app/pb_kits/playbook/pb_card/docs/index.js +4 -0
  30. data/app/pb_kits/playbook/pb_currency/_currency.jsx +67 -18
  31. data/app/pb_kits/playbook/pb_currency/docs/_currency_default.jsx +14 -1
  32. data/app/pb_kits/playbook/pb_currency/docs/_currency_large.jsx +28 -0
  33. data/app/pb_kits/playbook/pb_currency/docs/example.yml +2 -3
  34. data/app/pb_kits/playbook/pb_currency/docs/index.js +1 -0
  35. data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_default.jsx +1 -3
  36. data/app/pb_kits/playbook/pb_dashboard_value/docs/example.yml +0 -2
  37. data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +1 -1
  38. data/app/pb_kits/playbook/pb_icon/docs/_icon_default.jsx +1 -1
  39. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.jsx +1 -3
  40. data/app/pb_kits/playbook/pb_icon_value/docs/_icon_value_default.jsx +1 -3
  41. data/app/pb_kits/playbook/pb_label_pill/docs/_label_pill_default.jsx +1 -3
  42. data/app/pb_kits/playbook/pb_label_value/docs/_label_value_default.jsx +1 -3
  43. data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +57 -25
  44. data/app/pb_kits/playbook/pb_line_graph/docs/{_rails.html.erb → _line_graph_default.html.erb} +0 -0
  45. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.jsx +34 -0
  46. data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +5 -2
  47. data/app/pb_kits/playbook/pb_line_graph/docs/index.js +1 -0
  48. data/app/pb_kits/playbook/pb_line_graph/lineGraphSettings.js +9 -9
  49. data/app/pb_kits/playbook/pb_list/docs/_list_default.jsx +1 -5
  50. data/app/pb_kits/playbook/pb_message/docs/_message_default.jsx +1 -3
  51. data/app/pb_kits/playbook/pb_online_status/docs/_online_status_default.jsx +1 -3
  52. data/app/pb_kits/playbook/pb_owner/docs/_owner_default.jsx +1 -3
  53. data/app/pb_kits/playbook/pb_owner_phone/docs/_owner_phone_default.jsx +1 -3
  54. data/app/pb_kits/playbook/pb_phone/docs/_phone_default.jsx +1 -3
  55. data/app/pb_kits/playbook/pb_pill/_pill.jsx +22 -16
  56. data/app/pb_kits/playbook/pb_pill/docs/_pill_default.jsx +21 -1
  57. data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_default.jsx +1 -3
  58. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_default.jsx +1 -3
  59. data/app/pb_kits/playbook/pb_source/docs/_source_default.jsx +1 -3
  60. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.jsx +1 -3
  61. data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_default.jsx +1 -3
  62. data/app/pb_kits/playbook/pb_stat_value/docs/_stat_value_default.jsx +1 -3
  63. data/app/pb_kits/playbook/pb_table/docs/example.yml +10 -10
  64. data/app/pb_kits/playbook/pb_time/docs/_time_default.html.erb +4 -9
  65. data/app/pb_kits/playbook/pb_time/docs/_time_default.jsx +1 -3
  66. data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.html.erb +16 -0
  67. data/app/pb_kits/playbook/pb_time/docs/example.yml +4 -5
  68. data/app/pb_kits/playbook/pb_time/time.rb +19 -7
  69. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx +1 -3
  70. data/app/pb_kits/playbook/pb_title/_title.jsx +41 -30
  71. data/app/pb_kits/playbook/pb_title/docs/_title_light.jsx +1 -0
  72. data/app/pb_kits/playbook/pb_title_count/_title_count.scss +2 -2
  73. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_default.jsx +1 -3
  74. data/app/pb_kits/playbook/pb_title_count/title_count.rb +1 -1
  75. data/app/pb_kits/playbook/pb_title_detail/docs/_title_detail_default.jsx +1 -3
  76. data/app/pb_kits/playbook/pb_toggle/_toggle.html.erb +2 -2
  77. data/app/pb_kits/playbook/pb_toggle/_toggle.scss +1 -0
  78. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx +1 -4
  79. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_name.html.erb +25 -0
  80. data/app/pb_kits/playbook/pb_toggle/docs/example.yml +1 -1
  81. data/app/pb_kits/playbook/pb_toggle/toggle.rb +28 -11
  82. data/app/pb_kits/playbook/pb_user/docs/_user_default.jsx +1 -3
  83. data/app/pb_kits/playbook/pb_user_badge/docs/_user_badge_default.jsx +1 -3
  84. data/app/pb_kits/playbook/pb_vertical_nav/docs/_default_nav.jsx +1 -5
  85. data/lib/generators/kit/templates/kit_jsx.erb.tt +7 -29
  86. data/lib/playbook/version.rb +1 -1
  87. metadata +19 -7
  88. data/app/pb_kits/playbook/pb_button/docs/_button_dark.jsx +0 -14
  89. data/app/pb_kits/playbook/pb_button/docs/_button_light.jsx +0 -14
  90. data/app/pb_kits/playbook/pb_button/docs/_button_sizes.jsx +0 -14
  91. data/app/pb_kits/playbook/pb_line_graph/docs/_react.html.erb +0 -2
@@ -4,7 +4,20 @@ import Currency from "../_currency.jsx"
4
4
  function CurrencyDefault() {
5
5
  return (
6
6
  <div>
7
- <Currency />
7
+ <Currency
8
+ label='Caption'
9
+ value='2,000'
10
+ />
11
+ <Currency
12
+ align='center'
13
+ label='Caption'
14
+ value='2,000'
15
+ />
16
+ <Currency
17
+ align='right'
18
+ label='Caption'
19
+ value='2,000'
20
+ />
8
21
  </div>
9
22
  )
10
23
  }
@@ -0,0 +1,28 @@
1
+ import React from "react"
2
+ import Currency from "../_currency.jsx"
3
+
4
+ function CurrencyDefault() {
5
+ return (
6
+ <div>
7
+ <Currency
8
+ label='Caption'
9
+ size='lg'
10
+ value='2,000'
11
+ />
12
+ <Currency
13
+ align='center'
14
+ label='Caption'
15
+ size='lg'
16
+ value='2,000'
17
+ />
18
+ <Currency
19
+ align='right'
20
+ label='Caption'
21
+ size='lg'
22
+ value='2,000'
23
+ />
24
+ </div>
25
+ )
26
+ }
27
+
28
+ export default CurrencyDefault;
@@ -3,7 +3,6 @@ examples:
3
3
  rails:
4
4
  - currency_small: Small
5
5
  - currency_large: Large
6
-
7
-
8
6
  react:
9
- - currency_default: Default
7
+ - currency_default: Small
8
+ - currency_large: Large
@@ -1 +1,2 @@
1
1
  export {default as CurrencyDefault} from './_currency_default.jsx';
2
+ export {default as CurrencyLarge} from './_currency_large.jsx';
@@ -3,9 +3,7 @@ import DashboardValue from "../_dashboard_value.jsx"
3
3
 
4
4
  function DashboardValueDefault() {
5
5
  return (
6
- <div>
7
- <DashboardValue />
8
- </div>
6
+ <h1>{`Coming Soon...`}</h1>
9
7
  )
10
8
  }
11
9
 
@@ -3,7 +3,5 @@ examples:
3
3
  rails:
4
4
  - dashboard_value_default: Full Example
5
5
  - dashboard_value_align: Align
6
-
7
-
8
6
  react:
9
7
  - dashboard_value_default: Default
@@ -4,7 +4,7 @@ import Date from "../_date.jsx"
4
4
  function DateDefault() {
5
5
  return (
6
6
  <div>
7
- <Date />
7
+ <h1>{`Coming Soon...`}</h1>
8
8
  </div>
9
9
  )
10
10
  }
@@ -4,7 +4,7 @@ import Icon from "../_icon.jsx"
4
4
  function IconDefault() {
5
5
  return (
6
6
  <div>
7
- <Icon />
7
+ <h1>{`Coming Soon...`}</h1>
8
8
  </div>
9
9
  )
10
10
  }
@@ -9,9 +9,7 @@ const propTypes = {
9
9
  class IconCircle extends React.Component {
10
10
  render() {
11
11
  return (
12
- <div className="pb_icon_circle">
13
- <span>ICON CIRCLE CONTENT</span>
14
- </div>
12
+ <h1>{`Coming Soon...`}</h1>
15
13
  )
16
14
  }
17
15
  }
@@ -3,9 +3,7 @@ import IconValue from "../_icon_value.jsx"
3
3
 
4
4
  function IconValueDefault() {
5
5
  return (
6
- <div>
7
- <IconValue />
8
- </div>
6
+ <h1>{`Coming Soon...`}</h1>
9
7
  )
10
8
  }
11
9
 
@@ -3,9 +3,7 @@ import LabelPill from "../_label_pill.jsx"
3
3
 
4
4
  function LabelPillDefault() {
5
5
  return (
6
- <div>
7
- <LabelPill />
8
- </div>
6
+ <h1>{`Coming Soon...`}</h1>
9
7
  )
10
8
  }
11
9
 
@@ -3,9 +3,7 @@ import LabelValue from "../_label_value.jsx"
3
3
 
4
4
  function LabelValueDefault() {
5
5
  return (
6
- <div>
7
- <LabelValue />
8
- </div>
6
+ <h1>{`Coming Soon...`}</h1>
9
7
  )
10
8
  }
11
9
 
@@ -1,31 +1,63 @@
1
- import React from 'react';
2
- import PropTypes from "prop-types";
1
+ /* @flow */
3
2
 
4
- const propTypes = {
5
- className: PropTypes.string,
6
- text: PropTypes.string
7
- };
3
+ import React from "react"
8
4
 
9
- const defaultProps = {
10
- text: "I am a react kit"
11
- };
5
+ import pbChart from "../plugins/pb_chart_plugin.js"
12
6
 
13
- class LineGraph extends React.Component {
14
- render() {
15
- const {
16
- className,
17
- text
18
- } = this.props;
19
-
20
- return (
21
- <div className={className}>
22
- <span>{text}</span>
23
- </div>
24
- )
25
- }
7
+ type LineGraphProps = {
8
+ axisTitle?: String,
9
+ className?: String,
10
+ chartData: Array<{
11
+ name: String,
12
+ data: Array<Number>,
13
+ }>,
14
+ gradient?: Boolean,
15
+ id: String,
16
+ pointStart: Number,
17
+ subTitle?: String,
18
+ title: String,
26
19
  }
27
20
 
28
- LineGraph.propTypes = propTypes;
29
- LineGraph.defaultProps = defaultProps;
21
+ export default class LineGraph extends React.Component<LineGraphProps> {
22
+ static defaultProps = {
23
+ className: 'pb_bar_graph',
24
+ gradient: false,
25
+ type: 'line',
26
+ }
27
+
28
+ componentDidMount() {
29
+ const {
30
+ axisTitle,
31
+ className,
32
+ chartData,
33
+ id,
34
+ pointStart,
35
+ subTitle,
36
+ title,
37
+ type,
38
+ } = this.props
39
+
40
+ new pbChart(`.${className}`, {
41
+ axisTitle: axisTitle,
42
+ chartData: chartData,
43
+ id: id,
44
+ pointStart: pointStart,
45
+ subtitle: subTitle,
46
+ type,
47
+ title: title,
48
+ })
49
+ }
30
50
 
31
- export default LineGraph;
51
+ props: LineGraphProps
52
+
53
+ render() {
54
+ const { className, id } = this.props
55
+
56
+ return (
57
+ <div
58
+ className={className}
59
+ id={id}
60
+ />
61
+ )
62
+ }
63
+ }
@@ -0,0 +1,34 @@
1
+ import React from "react"
2
+ import LineGraph from "../_line_graph.jsx"
3
+
4
+ const data = [{
5
+ name: 'Installation',
6
+ data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
7
+ }, {
8
+ name: 'Manufacturing',
9
+ data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
10
+ }, {
11
+ name: 'Sales & Distribution',
12
+ data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387]
13
+ }, {
14
+ name: 'Project Development',
15
+ data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227]
16
+ }, {
17
+ name: 'Other',
18
+ data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111]
19
+ }]
20
+
21
+ const LineGraphDefault = () => (
22
+ <div>
23
+ <LineGraph
24
+ axisTitle="Number of Employees"
25
+ chartData={data}
26
+ id="line-test"
27
+ pointStart={1}
28
+ subTitle="Source: thesolarfoundation.com"
29
+ title="Solar Employment Growth by Sector, 2010-2016"
30
+ />
31
+ </div>
32
+ )
33
+
34
+ export default LineGraphDefault
@@ -1,5 +1,8 @@
1
1
  examples:
2
+
2
3
  rails:
3
- - rails: Line Graph
4
+ - line_graph_default: Default
5
+
6
+
4
7
  react:
5
- - react: Line Graph
8
+ - line_graph_default: Default
@@ -0,0 +1 @@
1
+ export {default as LineGraphDefault} from './_line_graph_default.jsx';
@@ -1,15 +1,15 @@
1
- import commonSettings from "../pb_dashboard/commonSettings.js";
1
+ import commonSettings from "../pb_dashboard/commonSettings.js"
2
2
 
3
3
  const markerStyles = function(highchart){
4
- highchart.plotOptions.line.marker.enabled = true;
5
- highchart.plotOptions.series.marker.enabled = true;
6
- highchart.plotOptions.series.marker.fillColor = "white";
7
- highchart.plotOptions.series.marker.lineWidth = 2;
4
+ highchart.plotOptions.line.marker.enabled = true
5
+ highchart.plotOptions.series.marker.enabled = true
6
+ highchart.plotOptions.series.marker.fillColor = "white"
7
+ highchart.plotOptions.series.marker.lineWidth = 2
8
8
  }
9
9
 
10
10
  const pbLineGraph = function(highchart) {
11
- commonSettings(highchart);
12
- markerStyles(highchart);
13
- };
11
+ commonSettings(highchart)
12
+ markerStyles(highchart)
13
+ }
14
14
 
15
- export default pbLineGraph;
15
+ export default pbLineGraph
@@ -5,11 +5,7 @@ import ListItem from "../_list_item.jsx"
5
5
 
6
6
  function ListDefault() {
7
7
  return (
8
- <List>
9
- <ListItem>{`List Item`}</ListItem>
10
- <ListItem>{`List Item`}</ListItem>
11
- <ListItem>{`List Item`}</ListItem>
12
- </List>
8
+ <h1>{`Coming Soon...`}</h1>
13
9
  )
14
10
  }
15
11
 
@@ -3,9 +3,7 @@ import Message from "../_message.jsx"
3
3
 
4
4
  function MessageDefault() {
5
5
  return (
6
- <div>
7
- <Message />
8
- </div>
6
+ <h1>{`Coming Soon...`}</h1>
9
7
  )
10
8
  }
11
9
 
@@ -3,9 +3,7 @@ import OnlineStatus from "../_online_status.jsx"
3
3
 
4
4
  function OnlineStatusDefault() {
5
5
  return (
6
- <div>
7
- <OnlineStatus />
8
- </div>
6
+ <h1>{`Coming Soon...`}</h1>
9
7
  )
10
8
  }
11
9
 
@@ -3,9 +3,7 @@ import Owner from "../_owner.jsx"
3
3
 
4
4
  function OwnerDefault() {
5
5
  return (
6
- <div>
7
- <Owner />
8
- </div>
6
+ <h1>{`Coming Soon...`}</h1>
9
7
  )
10
8
  }
11
9
 
@@ -3,9 +3,7 @@ import OwnerPhone from "../_owner_phone.jsx"
3
3
 
4
4
  function OwnerPhoneDefault() {
5
5
  return (
6
- <div>
7
- <OwnerPhone />
8
- </div>
6
+ <h1>{`Coming Soon...`}</h1>
9
7
  )
10
8
  }
11
9
 
@@ -3,9 +3,7 @@ import Phone from "../_phone.jsx"
3
3
 
4
4
  function PhoneDefault() {
5
5
  return (
6
- <div>
7
- <Phone />
8
- </div>
6
+ <h1>{`Coming Soon...`}</h1>
9
7
  )
10
8
  }
11
9
 
@@ -1,21 +1,27 @@
1
- import React from 'react';
2
- import PropTypes from "prop-types";
1
+ /* @flow */
2
+ /*eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */
3
3
 
4
- const propTypes = {
5
- className: PropTypes.string,
6
- id: PropTypes.string
7
- };
4
+ import React from 'react'
5
+ import Body from '../pb_body/_body.jsx'
8
6
 
9
- class Pill extends React.Component {
10
- render() {
11
- return (
12
- <div className="pb_pill">
13
- <span>PILL CONTENT</span>
14
- </div>
15
- )
16
- }
7
+ type PillProps = {
8
+ className?: String,
9
+ id?: String,
10
+ text: String,
11
+ variant?: 'success' | 'warning' | 'error' | 'info' | 'neutral',
17
12
  }
18
13
 
19
- Pill.propTypes = propTypes;
14
+ const Pill = ({ className, id, text, variant }: PillProps) => (
15
+ <div className={`pb_pill_kit_${variant} ${className}`}>
16
+ <Body tag="span">
17
+ {text}
18
+ </Body>
19
+ </div>
20
+ )
21
+
22
+ Pill.defaultProps = {
23
+ className: "",
24
+ variant: "neutral"
25
+ };
20
26
 
21
- export default Pill;
27
+ export default Pill