playbook_ui 7.1.2 → 7.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +1 -1
  3. data/app/pb_kits/playbook/pb_body/body.rb +1 -1
  4. data/app/pb_kits/playbook/pb_caption/_caption.html.erb +7 -5
  5. data/app/pb_kits/playbook/pb_caption/docs/_caption_block.html.erb +11 -0
  6. data/app/pb_kits/playbook/pb_caption/docs/_caption_block.jsx +28 -0
  7. data/app/pb_kits/playbook/pb_caption/docs/example.yml +2 -0
  8. data/app/pb_kits/playbook/pb_caption/docs/index.js +1 -0
  9. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx +1 -1
  10. data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +1 -1
  11. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +1 -1
  12. data/app/pb_kits/playbook/pb_nav/_item.html.erb +3 -0
  13. data/app/pb_kits/playbook/pb_nav/_item.jsx +14 -1
  14. data/app/pb_kits/playbook/pb_nav/_nav.jsx +3 -0
  15. data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +22 -3
  16. data/app/pb_kits/playbook/pb_nav/docs/_borderless_nav.html.erb +6 -0
  17. data/app/pb_kits/playbook/pb_nav/docs/_borderless_nav.jsx +29 -0
  18. data/app/pb_kits/playbook/pb_nav/docs/_with_img_nav.html.erb +7 -0
  19. data/app/pb_kits/playbook/pb_nav/docs/_with_img_nav.jsx +42 -0
  20. data/app/pb_kits/playbook/pb_nav/docs/_with_img_nav.md +1 -0
  21. data/app/pb_kits/playbook/pb_nav/docs/example.yml +5 -0
  22. data/app/pb_kits/playbook/pb_nav/docs/index.js +2 -0
  23. data/app/pb_kits/playbook/pb_nav/item.rb +1 -0
  24. data/app/pb_kits/playbook/pb_nav/nav.rb +6 -1
  25. data/app/pb_kits/playbook/pb_pill/_pill.scss +1 -0
  26. data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +1 -3
  27. data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +26 -47
  28. data/app/pb_kits/playbook/pb_section_separator/_section_separator_mixin.scss +32 -0
  29. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_line.jsx +6 -2
  30. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text.jsx +2 -1
  31. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text_background.jsx +2 -1
  32. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical.jsx +9 -3
  33. data/app/pb_kits/playbook/pb_section_separator/section_separator.rb +1 -1
  34. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.html.erb +4 -4
  35. data/app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_options.html.erb +16 -0
  36. data/app/pb_kits/playbook/pb_selectable_card/docs/example.yml +3 -2
  37. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.rb +16 -9
  38. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.html.erb +3 -2
  39. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_options.html.erb +16 -0
  40. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/example.yml +4 -3
  41. data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.rb +3 -0
  42. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.html.erb +3 -3
  43. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_options.html.erb +15 -0
  44. data/app/pb_kits/playbook/pb_selectable_icon/docs/example.yml +3 -2
  45. data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.rb +10 -0
  46. data/app/pb_kits/playbook/pb_time/_time.html.erb +17 -20
  47. data/app/pb_kits/playbook/pb_time/_time.jsx +40 -27
  48. data/app/pb_kits/playbook/pb_time/_time.scss +4 -24
  49. data/app/pb_kits/playbook/pb_time/docs/_time_align.jsx +4 -1
  50. data/app/pb_kits/playbook/pb_time/docs/_time_default.html.erb +11 -11
  51. data/app/pb_kits/playbook/pb_time/docs/_time_default.jsx +13 -1
  52. data/app/pb_kits/playbook/pb_time/docs/_time_sizes.jsx +4 -1
  53. data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.jsx +3 -1
  54. data/app/pb_kits/playbook/pb_time/docs/_time_timezone.jsx +7 -2
  55. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb +3 -2
  56. data/app/pb_kits/playbook/props.rb +1 -1
  57. data/app/pb_kits/playbook/props/base.rb +6 -4
  58. data/lib/playbook/version.rb +1 -1
  59. metadata +13 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1cb61398fc3d613b35dc39daba264bf9aeaa61144b5f9cc4880807a51ff477ed
4
- data.tar.gz: fb3db39898e1601ffdc37bc76bfa0de086b31e94b388424b7ad17b3f9d1e4e9d
3
+ metadata.gz: 923bb2a3586c197a5c26d22490b0de323332170dc657b22bd62e3d585a4ef853
4
+ data.tar.gz: 4cd8de5c0c0eb75b29fef20d7d182bed50d6161a8fa29638e6f56de94520795c
5
5
  SHA512:
6
- metadata.gz: 64df1795f5747f3cd07c3b232ab59bd5b495de12befe3521ead0d5038a2aa6c7fbd473bd58437a21fef615818aec5250edf41230335d94698751b51bcbf51e8a
7
- data.tar.gz: 77437b020c051293e007d11ab19dcb0c1e8cc01def39f1b105dc6ee0343f372e173d4acb13e675b82fb2db91f7595073c435dc0fda7cd24992183653f4b91ebd
6
+ metadata.gz: 14c2b363c5544fd935d0ae869ef1c3d1aa5b6d353f6cde7dfab2ff58160253f6d3cc69e047da895746a7457bc84389542462d2f9e5510c02d014d02730be9fe6
7
+ data.tar.gz: e92da77938a44999642573959a8c5236045bf9ca177e8eb7e52a4ee84391fbac05a2554a4ba2dc4fb0f67b506b2ae405f226d40394a65b0cba65f88c10798c9b
@@ -16,7 +16,7 @@ module Playbook
16
16
  prop :subtitle
17
17
  prop :title
18
18
  prop :x_axis_categories, type: Playbook::Props::Array,
19
- default:[]
19
+ default: []
20
20
  prop :y_axis_min, type: Playbook::Props::Numeric
21
21
  prop :y_axis_max, type: Playbook::Props::Numeric
22
22
  prop :legend, type: Playbook::Props::Boolean,
@@ -5,7 +5,7 @@ module Playbook
5
5
  class Body
6
6
  include Playbook::Props
7
7
  include ActionView::Helpers
8
-
8
+
9
9
  partial "pb_body/body"
10
10
 
11
11
  prop :color, type: Playbook::Props::Enum,
@@ -1,5 +1,7 @@
1
- <%= content_tag(object.tag, object.text,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- aria: object.aria) %>
1
+ <%= content_tag(object.tag,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname) do %>
6
+ <%= object.children.present? ? capture(&object.children) : object.text %>
7
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <%= pb_rails("caption") do %>
2
+ Block
3
+ <% end %>
4
+
5
+ <%= pb_rails("caption", props: { size: 'lg' }) do %>
6
+ Large Block
7
+ <% end %>
8
+
9
+ <%= pb_rails("caption", props: { size: 'xs' }) do %>
10
+ Subcaption Block
11
+ <% end %>
@@ -0,0 +1,28 @@
1
+ import React from 'react'
2
+ import { Caption } from '../../'
3
+
4
+ const CaptionBlock = (props) => {
5
+ return (
6
+ <div>
7
+ <Caption {...props}>
8
+ {'Block'}
9
+ </Caption>
10
+
11
+ <Caption
12
+ {...props}
13
+ size="lg"
14
+ >
15
+ {'Large Block'}
16
+ </Caption>
17
+
18
+ <Caption
19
+ {...props}
20
+ size="xs"
21
+ >
22
+ {'Subcaption Block'}
23
+ </Caption>
24
+ </div>
25
+ )
26
+ }
27
+
28
+ export default CaptionBlock
@@ -1,5 +1,7 @@
1
1
  examples:
2
2
  rails:
3
3
  - caption_light: Default
4
+ - caption_block: Block
4
5
  react:
5
6
  - caption_light: Default
7
+ - caption_block: Block
@@ -1,2 +1,3 @@
1
1
  export { default as CaptionLight } from './_caption_light.jsx'
2
2
  export { default as CaptionVariants } from './_caption_variants.jsx'
3
+ export { default as CaptionBlock } from './_caption_block.jsx'
@@ -101,7 +101,7 @@ const CircleChart = (props: CircleChartProps) => {
101
101
  useEffect(() => {
102
102
  if (componentDidMount.current) {
103
103
  Highcharts.charts.forEach((chart) => {
104
- if (chart.renderTo.id === id) {
104
+ if (chart && chart.renderTo.id === id) {
105
105
  const updatedValueArray = chartData.map((obj) => {
106
106
  return obj.value
107
107
  })
@@ -88,7 +88,7 @@ const Gauge = (props: GaugeProps) => {
88
88
  useEffect(() => {
89
89
  if (componentDidMount.current) {
90
90
  Highcharts.charts.forEach((chart) => {
91
- if (chart.renderTo.id === id) {
91
+ if (chart && chart.renderTo.id === id) {
92
92
  chart.series[0].setData([chartData[0].value])
93
93
  chart.series[0].data[0].name = chartData[0].name
94
94
  }
@@ -16,7 +16,7 @@ module Playbook
16
16
  prop :subtitle
17
17
  prop :title
18
18
  prop :x_axis_categories, type: Playbook::Props::Array,
19
- default:[]
19
+ default: []
20
20
  prop :y_axis_min, type: Playbook::Props::Numeric
21
21
  prop :y_axis_max, type: Playbook::Props::Numeric
22
22
  prop :legend, type: Playbook::Props::Boolean,
@@ -5,6 +5,9 @@
5
5
  id: object.id) do %>
6
6
  <%= content_tag(object.tag,
7
7
  object.link ? object.link_options : object.options) do %>
8
+ <% if object.image_url %>
9
+ <%= pb_rails("image", props: { url: object.image_url, classname: "pb_nav_img_wrapper" }) %>
10
+ <% end %>
8
11
  <% if object.icon_left %>
9
12
  <%= pb_rails("icon", props: { icon: object.icon_left, classname: "pb_nav_list_item_icon_left", fixed_width: true}) %>
10
13
  <% end %>
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
- import { Icon } from '../'
5
+ import { Icon, Image } from '../'
6
6
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
7
7
  import { globalProps } from '../utilities/globalProps.js'
8
8
 
@@ -15,6 +15,7 @@ type NavItemProps = {
15
15
  iconLeft: string,
16
16
  iconRight: string,
17
17
  id?: string,
18
+ imageUrl: String,
18
19
  link: string,
19
20
  onClick?: EventHandler,
20
21
  text: string,
@@ -30,6 +31,7 @@ const NavItem = (props: NavItemProps) => {
30
31
  iconLeft,
31
32
  iconRight,
32
33
  id,
34
+ imageUrl,
33
35
  link,
34
36
  onClick = () => {},
35
37
  text = '',
@@ -53,6 +55,17 @@ const NavItem = (props: NavItemProps) => {
53
55
  href={link}
54
56
  onClick={onClick}
55
57
  >
58
+ <If condition={imageUrl}>
59
+ <div
60
+ className="pb_nav_list_item_icon_section"
61
+ key={imageUrl}
62
+ >
63
+ <Image
64
+ className="pb_nav_img_wrapper"
65
+ url={imageUrl}
66
+ />
67
+ </div>
68
+ </If>
56
69
  <If condition={iconLeft}>
57
70
  <div
58
71
  className="pb_nav_list_item_icon_section"
@@ -8,6 +8,7 @@ import { globalProps } from '../utilities/globalProps.js'
8
8
 
9
9
  type NavProps = {
10
10
  aria?: object,
11
+ borderless?: boolean,
11
12
  children?: React.Node,
12
13
  className?: string | array<string>,
13
14
  data?: object,
@@ -22,6 +23,7 @@ type NavProps = {
22
23
  const Nav = (props: NavProps) => {
23
24
  const {
24
25
  aria = {},
26
+ borderless = false,
25
27
  children,
26
28
  className,
27
29
  data = {},
@@ -39,6 +41,7 @@ const Nav = (props: NavProps) => {
39
41
  const cardCss = classnames(
40
42
  buildCss('pb_nav_list', variant, orientation, {
41
43
  highlight: highlight,
44
+ borderless: borderless,
42
45
  }),
43
46
  globalProps(props),
44
47
  className
@@ -40,7 +40,7 @@ $selector: ".pb_nav_list";
40
40
  text-decoration: none;
41
41
  display: flex;
42
42
  align-items: center;
43
- padding: $space_sm $space_md $space_sm ($space_md - 3px);
43
+ padding: $space_sm $space_sm $space_sm ($space_sm - 3px);
44
44
  border: 0 solid transparent;
45
45
  border-width: 0 0 0 3px;
46
46
  transition-property: color, border-color, background-color;
@@ -59,7 +59,7 @@ $selector: ".pb_nav_list";
59
59
  }
60
60
  [class*=_icon_left] {
61
61
  font-size: $font_large;
62
- margin-right: $space_sm;
62
+ margin-right: $space_xs;
63
63
  color: $text_lt_lighter;
64
64
  }
65
65
  [class*=_icon_right] {
@@ -69,10 +69,14 @@ $selector: ".pb_nav_list";
69
69
  }
70
70
  [class*=_text] {
71
71
  font-size: $font_base;
72
- font-weight: $bold;
73
72
  color: $text_lt_default;
74
73
  flex: 1;
75
74
  }
75
+ [class*=_img_left] {
76
+ margin-right: $space_xs;
77
+ height: 20px;
78
+ width: 25px;
79
+ }
76
80
  }
77
81
  &:last-child {
78
82
  border-bottom: 0;
@@ -167,4 +171,19 @@ $selector: ".pb_nav_list";
167
171
  }
168
172
  }
169
173
 
174
+ //Borderless
175
+ &[class*=_borderless] {
176
+ [class*=pb_nav_list_kit_item] {
177
+ list-style: none;
178
+ border-bottom: 0;
179
+ }
180
+ }
181
+
182
+ }
183
+
184
+ //Image Wrapper
185
+ .pb_nav_img_wrapper {
186
+ width: 24px;
187
+ height: 24px;
188
+ margin-right: $space_xs;
170
189
  }
@@ -0,0 +1,6 @@
1
+ <%= pb_rails("nav", props: {borderless: true}) do %>
2
+ <%= pb_rails("nav/item", props: { text: "Photos", link: "#" }) %>
3
+ <%= pb_rails("nav/item", props: { text: "Music", link: "#" }) %>
4
+ <%= pb_rails("nav/item", props: { text: "Video", link: "#", active: true }) %>
5
+ <%= pb_rails("nav/item", props: { text: "Files", link: "#" }) %>
6
+ <% end %>
@@ -0,0 +1,29 @@
1
+ import React from 'react'
2
+ import { Nav } from '../../'
3
+ import NavItem from '../_item.jsx'
4
+
5
+ const BorderlessNav = () => {
6
+ return (
7
+ <Nav borderless>
8
+ <NavItem
9
+ active
10
+ link="#"
11
+ text="All Categories"
12
+ />
13
+ <NavItem
14
+ link="#"
15
+ text="Food"
16
+ />
17
+ <NavItem
18
+ link="#"
19
+ text="Digital"
20
+ />
21
+ <NavItem
22
+ link="#"
23
+ text="Design Art"
24
+ />
25
+ </Nav>
26
+ )
27
+ }
28
+
29
+ export default BorderlessNav
@@ -0,0 +1,7 @@
1
+ <%= pb_rails("nav", props: {title: "Browse", link: "#"}) do %>
2
+ <%= pb_rails("nav/item", props: { image_url: "https://upload.wikimedia.org/wikipedia/commons/0/00/Apple_News_icon_%28macOS%29.png", text: "News Feed" }) %>
3
+ <%= pb_rails("nav/item", props: { image_url: "https://p7.hiclipart.com/preview/928/339/723/messages-iphone-apple-imessage-iphone-thumbnail.jpg", link: "#", text: "Messages", active: true }) %>
4
+ <%= pb_rails("nav/item", props: { image_url: "https://www.clipartmax.com/png/middle/103-1038653_circle-icons-calendar-svg-event-icon.png", icon_right: "angle-down", link: "#", text: "Events" }) %>
5
+ <%= pb_rails("nav/item", props: { image_url: "https://www.pngitem.com/pimgs/m/228-2289227_find-friends-icon-png-image-iphone-find-my.png", link: "#", text: "Friends" }) %>
6
+ <%= pb_rails("nav/item", props: { image_url: "https://img.favpng.com/18/5/20/blue-human-behavior-silhouette-area-communication-png-favpng-wLT3QYknSwc68uu9GAUHGS5FY_t.jpg", icon_right: "angle-down", link: "#", text: "Groups" }) %>
7
+ <% end %>
@@ -0,0 +1,42 @@
1
+ import React from 'react'
2
+ import { Nav } from '../../'
3
+ import NavItem from '../_item.jsx'
4
+
5
+ const WithImageNav = () => {
6
+ return (
7
+ <Nav
8
+ link="#"
9
+ title="Browse"
10
+ >
11
+ <NavItem
12
+ imageUrl="https://upload.wikimedia.org/wikipedia/commons/0/00/Apple_News_icon_%28macOS%29.png"
13
+ text="News Feed"
14
+ />
15
+ <NavItem
16
+ active
17
+ imageUrl="https://p7.hiclipart.com/preview/928/339/723/messages-iphone-apple-imessage-iphone-thumbnail.jpg"
18
+ link="#"
19
+ text="Messages"
20
+ />
21
+ <NavItem
22
+ iconRight="angle-down"
23
+ imageUrl="https://www.clipartmax.com/png/middle/103-1038653_circle-icons-calendar-svg-event-icon.png"
24
+ link="#"
25
+ text="Events"
26
+ />
27
+ <NavItem
28
+ imageUrl="https://www.pngitem.com/pimgs/m/228-2289227_find-friends-icon-png-image-iphone-find-my.png"
29
+ link="#"
30
+ text="Friends"
31
+ />
32
+ <NavItem
33
+ iconRight="angle-down"
34
+ imageUrl="https://img.favpng.com/18/5/20/blue-human-behavior-silhouette-area-communication-png-favpng-wLT3QYknSwc68uu9GAUHGS5FY_t.jpg"
35
+ link="#"
36
+ text="Groups"
37
+ />
38
+ </Nav>
39
+ )
40
+ }
41
+
42
+ export default WithImageNav
@@ -0,0 +1 @@
1
+ Icon used needs to be square. Icon size is 24px by 24px.
@@ -2,7 +2,9 @@ examples:
2
2
  rails:
3
3
  - default_nav: Default
4
4
  - with_icons_nav: With Icons
5
+ - with_img_nav: With Custom Icon
5
6
  - no_highlight_nav: No Highlight
7
+ - borderless_nav: No Borders
6
8
  - subtle_nav: Subtle Variant
7
9
  - subtle_with_icons_nav: Subtle With Icons
8
10
  - subtle_no_highlight_nav: Subtle No Highlight
@@ -13,10 +15,13 @@ examples:
13
15
  react:
14
16
  - default_nav: Default
15
17
  - with_icons_nav: With Icons
18
+ - with_img_nav: With Custom Icon
16
19
  - no_highlight_nav: No Highlight
20
+ - borderless_nav: No Borders
17
21
  - subtle_nav: Subtle Variant
18
22
  - subtle_with_icons_nav: Subtle With Icons
19
23
  - subtle_no_highlight_nav: Subtle No Highlight
20
24
  - horizontal_nav: Horizontal Nav
21
25
  - block_nav: Block
22
26
  - block_no_title_nav: Without Title
27
+
@@ -3,7 +3,9 @@ export { default as HorizontalNav } from './_horizontal_nav.jsx'
3
3
  export { default as BlockNav } from './_block_nav.jsx'
4
4
  export { default as BlockNoTitleNav } from './_block_no_title_nav.jsx'
5
5
  export { default as NoHighlightNav } from './_no_highlight_nav.jsx'
6
+ export { default as BorderlessNav } from './_borderless_nav.jsx'
6
7
  export { default as SubtleNav } from './_subtle_nav.jsx'
7
8
  export { default as SubtleNoHighlightNav } from './_subtle_no_highlight_nav.jsx'
8
9
  export { default as WithIconsNav } from './_with_icons_nav.jsx'
9
10
  export { default as SubtleWithIconsNav } from './_subtle_with_icons_nav.jsx'
11
+ export { default as WithImgNav } from './_with_img_nav.jsx'
@@ -12,6 +12,7 @@ module Playbook
12
12
  prop :text
13
13
  prop :icon_left
14
14
  prop :icon_right
15
+ prop :image_url
15
16
 
16
17
  def classname
17
18
  generate_classname("pb_nav_list_kit_item", active_class)
@@ -17,14 +17,19 @@ module Playbook
17
17
  values: %w[normal subtle],
18
18
  default: "normal"
19
19
  prop :highlight, type: Playbook::Props::Boolean, default: true
20
+ prop :borderless, type: Playbook::Props::Boolean, default: false
20
21
 
21
22
  def classname
22
- generate_classname("pb_nav_list", variant, orientation, highlight_class)
23
+ generate_classname("pb_nav_list", variant, orientation, highlight_class, borderless_class)
23
24
  end
24
25
 
25
26
  def highlight_class
26
27
  highlight ? "highlight" : nil
27
28
  end
29
+
30
+ def borderless_class
31
+ borderless ? "borderless" : nil
32
+ end
28
33
  end
29
34
  end
30
35
  end
@@ -12,6 +12,7 @@ $pb_pill_height: 22px;
12
12
  padding: 0 $space-sm/1.8;
13
13
  height: $pb_pill_height;
14
14
  border-radius: $pb_pill_height/2;
15
+ white-space: nowrap;
15
16
 
16
17
  @each $color_name, $color_value in $status_color_text {
17
18
  &[class*=_#{$color_name}] {
@@ -20,17 +20,15 @@ const SectionSeparator = (props: SectionSeparatorProps) => {
20
20
  const {
21
21
  aria = {},
22
22
  className,
23
- dark = false,
24
23
  data = {},
25
24
  id,
26
25
  orientation = 'horizontal',
27
26
  text,
28
27
  variant = 'card',
29
28
  } = props
30
- const themeStyle = dark === true ? '_dark' : ''
31
29
  const ariaProps = buildAriaProps(aria)
32
30
  const dataProps = buildDataProps(data)
33
- const classes = classnames(buildCss('pb_section_separator_kit', variant, orientation, themeStyle), globalProps(props), className)
31
+ const classes = classnames(buildCss('pb_section_separator_kit', variant, orientation), globalProps(props), className)
34
32
 
35
33
  return (
36
34