playbook_ui 2.9.7 → 2.9.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/app/assets/images/pb.logo.svg +14 -14
  4. data/app/pb_kits/playbook/_playbook.scss +6 -6
  5. data/app/pb_kits/playbook/index.js +11 -10
  6. data/app/pb_kits/playbook/kits/pb_nav.js +4 -0
  7. data/app/pb_kits/playbook/kits/pb_text_input.js +4 -0
  8. data/app/pb_kits/playbook/packs/examples.js +4 -4
  9. data/app/pb_kits/playbook/packs/kits.js +2 -2
  10. data/app/pb_kits/playbook/packs/site_styles/docs/_color_utilities.scss +0 -1
  11. data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +1 -1
  12. data/app/pb_kits/playbook/pb_badge/_badge.jsx +5 -2
  13. data/app/pb_kits/playbook/pb_badge/_badge.scss +19 -7
  14. data/app/pb_kits/playbook/pb_badge/badge.rb +6 -1
  15. data/app/pb_kits/playbook/pb_badge/docs/_badge_dark.html.erb +124 -0
  16. data/app/pb_kits/playbook/pb_badge/docs/_badge_dark.jsx +82 -0
  17. data/app/pb_kits/playbook/pb_badge/docs/example.yml +2 -0
  18. data/app/pb_kits/playbook/pb_badge/docs/index.js +1 -0
  19. data/app/pb_kits/playbook/pb_button/_button.scss +15 -0
  20. data/app/pb_kits/playbook/pb_button/_button_mixins.scss +37 -3
  21. data/app/pb_kits/playbook/pb_button/button.rb +7 -1
  22. data/app/pb_kits/playbook/pb_button/docs/_button_default_dark.html.erb +22 -4
  23. data/app/pb_kits/playbook/pb_button/docs/_button_default_dark.jsx +6 -1
  24. data/app/pb_kits/playbook/pb_caption/_caption.jsx +13 -9
  25. data/app/pb_kits/playbook/pb_caption/_caption.scss +4 -0
  26. data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +11 -7
  27. data/app/pb_kits/playbook/pb_caption/caption.rb +4 -5
  28. data/app/pb_kits/playbook/pb_caption/docs/_caption_dark.html.erb +2 -1
  29. data/app/pb_kits/playbook/pb_caption/docs/_caption_dark.jsx +2 -1
  30. data/app/pb_kits/playbook/pb_caption/docs/_caption_light.html.erb +2 -1
  31. data/app/pb_kits/playbook/pb_caption/docs/_caption_light.jsx +2 -1
  32. data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +3 -3
  33. data/app/pb_kits/playbook/pb_contact/_contact.html.erb +2 -1
  34. data/app/pb_kits/playbook/pb_contact/_contact.jsx +10 -4
  35. data/app/pb_kits/playbook/pb_contact/contact.rb +4 -9
  36. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +1 -4
  37. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +0 -3
  38. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.html.erb +16 -0
  39. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.jsx +25 -0
  40. data/app/pb_kits/playbook/pb_contact/docs/example.yml +2 -0
  41. data/app/pb_kits/playbook/pb_contact/docs/index.js +1 -0
  42. data/app/pb_kits/playbook/pb_date/_date.html.erb +10 -2
  43. data/app/pb_kits/playbook/pb_date/date.rb +18 -90
  44. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.html.erb +3 -3
  45. data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb +15 -54
  46. data/app/pb_kits/playbook/pb_hashtag/_hashtag.html.erb +2 -2
  47. data/app/pb_kits/playbook/pb_hashtag/_hashtag.jsx +13 -11
  48. data/app/pb_kits/playbook/pb_hashtag/_hashtag.scss +3 -1
  49. data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_dark.html.erb +9 -0
  50. data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_dark.jsx +31 -0
  51. data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_default.jsx +2 -2
  52. data/app/pb_kits/playbook/pb_hashtag/docs/example.yml +2 -1
  53. data/app/pb_kits/playbook/pb_hashtag/docs/index.js +1 -0
  54. data/app/pb_kits/playbook/pb_hashtag/hashtag.rb +6 -1
  55. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.html.erb +12 -6
  56. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.jsx +10 -5
  57. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.scss +0 -20
  58. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_dark.jsx +1 -1
  59. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_default.jsx +1 -1
  60. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_modified.jsx +1 -0
  61. data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +3 -3
  62. data/app/pb_kits/playbook/pb_label_pill/docs/_label_pill_default.html.erb +9 -3
  63. data/app/pb_kits/playbook/pb_label_pill/label_pill.rb +1 -1
  64. data/app/pb_kits/playbook/pb_nav/_horizontal_nav.scss +67 -0
  65. data/app/pb_kits/playbook/{pb_vertical_nav → pb_nav}/_item.html.erb +2 -2
  66. data/app/pb_kits/playbook/{pb_vertical_nav → pb_nav}/_item.jsx +7 -7
  67. data/app/pb_kits/playbook/{pb_vertical_nav/_vertical_nav.html.erb → pb_nav/_nav.html.erb} +2 -2
  68. data/app/pb_kits/playbook/{pb_vertical_nav/_vertical_nav.jsx → pb_nav/_nav.jsx} +7 -7
  69. data/app/pb_kits/playbook/pb_nav/_nav.scss +6 -0
  70. data/app/pb_kits/playbook/{pb_vertical_nav → pb_nav}/_vertical_nav.scss +38 -35
  71. data/app/pb_kits/playbook/pb_nav/docs/_block_nav.html.erb +5 -0
  72. data/app/pb_kits/playbook/pb_nav/docs/_block_no_title.html.erb +5 -0
  73. data/app/pb_kits/playbook/pb_nav/docs/_default_nav.html.erb +5 -0
  74. data/app/pb_kits/playbook/{pb_vertical_nav → pb_nav}/docs/_default_nav.jsx +2 -2
  75. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav.html.erb +5 -0
  76. data/app/pb_kits/playbook/{pb_vertical_nav → pb_nav}/docs/example.yml +1 -0
  77. data/app/pb_kits/playbook/{pb_vertical_nav → pb_nav}/docs/index.js +0 -0
  78. data/app/pb_kits/playbook/{pb_vertical_nav → pb_nav}/item.rb +3 -3
  79. data/app/pb_kits/playbook/pb_nav/nav.rb +27 -0
  80. data/app/pb_kits/playbook/pb_person_contact/_person_contact.html.erb +13 -6
  81. data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +8 -14
  82. data/app/pb_kits/playbook/pb_person_contact/_person_contact.scss +1 -0
  83. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_default.html.erb +5 -20
  84. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_default.jsx +2 -17
  85. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_multiple.html.erb +27 -0
  86. data/app/pb_kits/playbook/pb_person_contact/docs/{_person_contact_single_person.jsx → _person_contact_multiple.jsx} +13 -11
  87. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_with_detail.html.erb +19 -0
  88. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_with_detail.jsx +30 -0
  89. data/app/pb_kits/playbook/pb_person_contact/docs/example.yml +5 -4
  90. data/app/pb_kits/playbook/pb_person_contact/docs/index.js +2 -2
  91. data/app/pb_kits/playbook/pb_person_contact/person_contact.rb +10 -1
  92. data/app/pb_kits/playbook/pb_pill/docs/_pill_default.html.erb +7 -0
  93. data/app/pb_kits/playbook/pb_pill/docs/_pill_default.jsx +4 -0
  94. data/app/pb_kits/playbook/pb_pill/pill.rb +1 -1
  95. data/app/pb_kits/playbook/pb_table/styles/_headers.scss +3 -4
  96. data/app/pb_kits/playbook/{pb_input/_input.html.erb → pb_text_input/_text_input.html.erb} +2 -2
  97. data/app/pb_kits/playbook/{pb_input/_input.jsx → pb_text_input/_text_input.jsx} +7 -7
  98. data/app/pb_kits/playbook/{pb_input/_input.scss → pb_text_input/_text_input.scss} +3 -3
  99. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.html.erb +5 -0
  100. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +16 -0
  101. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +5 -0
  102. data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
  103. data/app/pb_kits/playbook/{pb_input/input.rb → pb_text_input/text_input.rb} +4 -4
  104. data/app/pb_kits/playbook/pb_time/_time.html.erb +32 -2
  105. data/app/pb_kits/playbook/pb_time/time.rb +15 -116
  106. data/app/pb_kits/playbook/pb_timestamp/_timestamp-mixins.scss +0 -2
  107. data/app/pb_kits/playbook/pb_timestamp/_timestamp.html.erb +1 -1
  108. data/app/pb_kits/playbook/tokens/_colors.scss +18 -22
  109. data/app/pb_kits/playbook/utilities/_colors.scss +12 -0
  110. data/app/pb_kits/playbook/utilities/text.js +16 -0
  111. data/app/views/layouts/playbook/_sidebar.html.slim +10 -11
  112. data/lib/playbook/version.rb +1 -1
  113. metadata +39 -29
  114. data/app/pb_kits/playbook/kits/pb_input.js +0 -4
  115. data/app/pb_kits/playbook/kits/pb_vertical_nav.js +0 -4
  116. data/app/pb_kits/playbook/pb_input/docs/_input_default.html.erb +0 -5
  117. data/app/pb_kits/playbook/pb_input/docs/_input_default.jsx +0 -16
  118. data/app/pb_kits/playbook/pb_input/docs/example.yml +0 -5
  119. data/app/pb_kits/playbook/pb_input/docs/index.js +0 -1
  120. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_single_person.html.erb +0 -24
  121. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_three_people.html.erb +0 -16
  122. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_three_people.jsx +0 -33
  123. data/app/pb_kits/playbook/pb_vertical_nav/docs/_block_nav.html.erb +0 -5
  124. data/app/pb_kits/playbook/pb_vertical_nav/docs/_block_no_title.html.erb +0 -5
  125. data/app/pb_kits/playbook/pb_vertical_nav/docs/_default_nav.html.erb +0 -5
  126. data/app/pb_kits/playbook/pb_vertical_nav/vertical_nav.rb +0 -19
@@ -1,42 +1,26 @@
1
- @import "../tokens/typography";
2
- @import "../tokens/spacing";
3
- @import "../tokens/colors";
4
1
 
5
- // Another style should be borders like buttons
6
- .vertical_nav_list {
7
- $selector: ".vertical_nav_list";
8
- &_title {
9
- padding: 0 $space_xl $space_sm;
10
- }
2
+ $selector: ".pb_nav_list";
3
+
4
+ [class^=pb_nav_list][class*=_vertical] {
11
5
  ul {
12
6
  padding: 0;
13
7
  margin: 0;
14
8
  list-style: none;
15
9
  }
16
- &_border_item {
10
+
11
+ [class*=_title] {
12
+ padding: 0 $space_xl $space_sm;
13
+ }
14
+
15
+ [class*=_border_item] {
17
16
  list-style: none;
18
17
  border-bottom: 1px solid $border_light;
18
+
19
19
  &:last-child {
20
20
  border-bottom: 0;
21
21
  }
22
- }
23
- &_item,
24
- &_border_item {
25
- &_active,
26
- &.active {
27
- background-color: $active_light;
28
- #{$selector}_item_link,
29
- #{$selector}_border_item_link {
30
- border-color: $primary;
31
- &_icon {
32
- color: $primary;
33
- }
34
- &_text {
35
- color: $primary;
36
- }
37
- }
38
- }
39
- &_link {
22
+
23
+ [class*=_link] {
40
24
  text-decoration: none;
41
25
  display: flex;
42
26
  align-items: center;
@@ -45,28 +29,47 @@
45
29
  border-width: 0 0 0 3px;
46
30
  transition-property: color, border-color, background-color;
47
31
  transition-duration: 0.15s;
48
- transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
49
- &_icon {
32
+ transition-timing-function: $bezier;
33
+
34
+ [class*=_icon] {
50
35
  font-size: $font_large;
51
36
  margin-right: $space_sm;
52
37
  color: $text_lt_lighter;
53
38
  }
54
- &_text {
39
+
40
+ [class*=_text] {
55
41
  font-size: $font_base;
56
42
  font-weight: $bold;
57
43
  color: $text_lt_default;
58
44
  }
45
+
59
46
  &:hover {
60
47
  background-color: rgba($primary, 0.03);
61
- #{$selector}_item_link_icon,
62
- #{$selector}_border_item_link_icon {
48
+
49
+ #{$selector}_item_icon {
63
50
  color: $primary;
64
51
  }
65
- #{$selector}_item_link_text,
66
- #{$selector}_border_item_link_text {
52
+
53
+ #{$selector}_item_text {
67
54
  color: $primary;
68
55
  }
69
56
  }
70
57
  }
71
58
  }
59
+
60
+ [class*=_active] {
61
+ background-color: $active_light;
62
+
63
+ #{$selector}_item_link {
64
+ border-color: $primary;
65
+
66
+ [class*=_item_icon] {
67
+ color: $primary;
68
+ }
69
+
70
+ [class*=_item_text] {
71
+ color: $primary;
72
+ }
73
+ }
74
+ }
72
75
  }
@@ -0,0 +1,5 @@
1
+ <%= pb_rails("nav", props: {title: "Title Example", link: "#"}) do %>
2
+ <%= pb_rails("nav/item", props: { link: "#", active: true }) do%>Active Nav Item using block<% end %>
3
+ <%= pb_rails("nav/item", props: { link: "#" }) do%>Nav Item using block<% end %>
4
+ <%= pb_rails("nav/item", props: { link: "#" }) do%>Nav Item using block<% end %>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= pb_rails("nav") do %>
2
+ <%= pb_rails("nav/item", props: { link: "#", active: true }) do%>Active Nav Item using block<% end %>
3
+ <%= pb_rails("nav/item", props: { link: "#" }) do%>Nav Item using block<% end %>
4
+ <%= pb_rails("nav/item", props: { link: "#" }) do%>Nav Item using block<% end %>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= pb_rails("nav", props: {title: "Title Example", link: "#"}) do %>
2
+ <%= pb_rails("nav/item", props: { text: "Active Nav Item using text prop", link: "#", active: true }) %>
3
+ <%= pb_rails("nav/item", props: { text: "Nav Item using text prop", link: "#" }) %>
4
+ <%= pb_rails("nav/item", props: { text: "Nav Item using text prop", link: "#" }) %>
5
+ <% end %>
@@ -1,6 +1,6 @@
1
1
  import React from "react"
2
- import {VerticalNav} from "../../"
3
- import VerticalNavItem from "../_item.jsx"
2
+ import {Nav} from "../../"
3
+ import NavItem from "../_item.jsx"
4
4
 
5
5
  function DefaultNav() {
6
6
  return (
@@ -0,0 +1,5 @@
1
+ <%= pb_rails("nav", props: { orientation: "horizontal"}) do %>
2
+ <%= pb_rails("nav/item", props: { text: "Active Nav Item using text prop", link: "#", active: true }) %>
3
+ <%= pb_rails("nav/item", props: { text: "Nav Item using text prop", link: "#" }) %>
4
+ <%= pb_rails("nav/item", props: { text: "Nav Item using text prop", link: "#" }) %>
5
+ <% end %>
@@ -1,6 +1,7 @@
1
1
  examples:
2
2
  rails:
3
3
  - default_nav: Default
4
+ - horizontal_nav: Horizontal Nav
4
5
  - block_nav: Block
5
6
  - block_no_title: Without Title
6
7
  react:
@@ -1,18 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- module PbVerticalNav
4
+ module PbNav
5
5
  class Item
6
6
  include Playbook::Props
7
7
 
8
- partial "pb_vertical_nav/item"
8
+ partial "pb_nav/item"
9
9
 
10
10
  prop :active, type: Playbook::Props::Boolean, default: false
11
11
  prop :link, default: "#"
12
12
  prop :text
13
13
 
14
14
  def classname
15
- generate_classname("vertical_nav_list_border_item", active_class)
15
+ generate_classname("pb_nav_list_border_item", active_class)
16
16
  end
17
17
 
18
18
  private
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbNav
5
+ class Nav
6
+ include ActionView::Helpers::TagHelper
7
+ include Playbook::Props
8
+
9
+ partial "pb_nav/nav"
10
+
11
+ prop :link, default: "#"
12
+ prop :title
13
+ prop :orientation, type: Playbook::Props::Enum,
14
+ values: ["vertical", "horizontal"],
15
+ default: "vertical"
16
+
17
+ def classname
18
+ [
19
+ "pb_nav_list",
20
+ orientation
21
+ ].compact.join("_")
22
+ end
23
+
24
+
25
+ end
26
+ end
27
+ end
@@ -2,12 +2,10 @@
2
2
  id: object.id,
3
3
  data: object.data,
4
4
  class: object.classname) do %>
5
- <% object.people.each do |person| %>
6
- <%= pb_rails("person", props: {
7
- first_name: person[:first_name],
8
- last_name: person[:last_name],
9
- }) %>
10
- <% end %>
5
+ <%= pb_rails("person", props: {
6
+ first_name: object.first_name,
7
+ last_name: object.last_name,
8
+ }) %>
11
9
  <% object.contacts.each do |contact| %>
12
10
  <%= pb_rails("contact", props: {
13
11
  contact_type: contact[:contact_type],
@@ -15,4 +13,13 @@
15
13
  contact_detail: contact[:contact_detail],
16
14
  }) %>
17
15
  <% end %>
16
+ <% unless object.wrong_contacts.empty? %>
17
+ <%= pb_rails("caption", props: { text: "wrong number" })%>
18
+ <% end %>
19
+ <% object.wrong_contacts.each do |wrong_number| %>
20
+ <%= pb_rails("contact", props: {
21
+ contact_type: wrong_number[:contact_type],
22
+ contact_value: wrong_number[:contact_value],
23
+ }) %>
24
+ <% end %>
18
25
  <% end %>
@@ -4,15 +4,19 @@
4
4
  import React from 'react'
5
5
  import classnames from 'classnames'
6
6
 
7
+
8
+
7
9
  import {
8
10
  Person,
11
+ Body,
9
12
  Contact,
10
13
  } from '../'
11
14
 
12
15
  type PersonContactProps = {
13
16
  className?: String | Array<String>,
14
17
  dark?: Boolean,
15
- people?: Array<{firstName: String, lastName: String}>,
18
+ firstName: String,
19
+ lastName: String,
16
20
  contacts?: Array<{contactType: String, contactValue: String, contactDetail: String}>,
17
21
  }
18
22
 
@@ -28,30 +32,20 @@ const contactsArray = ({contacts=[]}: PersonContactProps) => {
28
32
  })
29
33
  }
30
34
 
31
- const peopleArray = ({people=[]}: PersonContactProps) => {
32
- return people.map((personObject, index) => {
33
- return (
34
- <Person
35
- firstName={personObject.firstName}
36
- lastName={personObject.lastName}
37
- />
38
- );
39
- })
40
- }
41
35
 
42
36
  const PersonContact = ({
43
37
  className,
44
38
  dark=false,
45
- people,
39
+ firstName,
40
+ lastName,
46
41
  contacts,
47
42
  }: PersonContactProps) => {
48
43
 
49
44
  const contactKits = contactsArray({contacts})
50
- const personKits = peopleArray({people})
51
45
 
52
46
  return (
53
47
  <div className={classnames('pb_person_contact_kit', className)}>
54
- {personKits}
48
+ <Person firstName={firstName} lastName={lastName} />
55
49
  {contactKits}
56
50
  </div>
57
51
  )
@@ -7,4 +7,5 @@
7
7
  justify-content: flex-start;
8
8
  align-items: flex-start;
9
9
  flex-direction: column;
10
+ margin-bottom: $space_xs;
10
11
  }
@@ -1,32 +1,17 @@
1
1
  <%= pb_rails("person_contact", props: {
2
- people: [
3
- {
4
- first_name: "Pauline",
5
- last_name: "Smith",
6
- },
7
- {
8
- first_name: "Harvey",
9
- last_name: "Walters"
10
- }
11
- ],
2
+ first_name: "Pauline",
3
+ last_name: "Smith",
12
4
  contacts: [
13
5
  {
14
6
  contact_type: "email",
15
- contact_value: "email@example.com",
16
- contact_detail: "Pauline's Email"
7
+ contact_value: "email@example.com"
17
8
  },
18
9
  {
19
- contact_value: 5555555555,
20
- contact_detail: "Home"
21
- },
22
- {
23
- contact_type: "email",
24
- contact_value: "email@example.com",
10
+ contact_value: 5555555555
25
11
  },
26
12
  {
27
13
  contact_type: "work",
28
- contact_value: "3245627482",
29
- contact_detail: "Harvey's Work"
14
+ contact_value: "3245627482"
30
15
  }
31
16
  ]
32
17
  }) %>
@@ -5,34 +5,19 @@ function PersonContactDefault() {
5
5
  return (
6
6
  <div>
7
7
  <PersonContact
8
- people={[
9
- {
10
- firstName: "Pauline",
11
- lastName: "Smith",
12
- },
13
- {
14
- firstName: "Harvey",
15
- lastName: "Walters"
16
- }
17
- ]}
8
+ firstName="Pauline"
9
+ lastName="Smith"
18
10
  contacts={[
19
11
  {
20
12
  contactType: "email",
21
13
  contactValue: "email@example.com",
22
- contactDetail: "Pauline's Email",
23
14
  },
24
15
  {
25
16
  contactValue: "5555555555",
26
- contactDetail: "Home",
27
- },
28
- {
29
- contactType: "email",
30
- contactValue: "email@example.com",
31
17
  },
32
18
  {
33
19
  contactType: "work",
34
20
  contactValue: "3245627482",
35
- contactDetail: "Harvey's Work"
36
21
  }
37
22
  ]}
38
23
  />
@@ -0,0 +1,27 @@
1
+ <%= pb_rails("person_contact", props: {
2
+ first_name: "Harvey",
3
+ last_name: "Walters",
4
+ contacts: [
5
+ {
6
+ contact_type: "email",
7
+ contact_value: "email@example.com"
8
+ },
9
+ {
10
+ contact_value: 5555555555,
11
+ },
12
+ {
13
+ contact_type: "work",
14
+ contact_value: "3245627482"
15
+ }
16
+ ]
17
+ }) %>
18
+
19
+ <%= pb_rails("person_contact", props: {
20
+ first_name: "Brenda",
21
+ last_name: "Walters",
22
+ contacts: [
23
+ {
24
+ contact_value: 5555555555,
25
+ }
26
+ ]
27
+ }) %>
@@ -1,30 +1,32 @@
1
1
  import React from "react"
2
2
  import {PersonContact} from "../../"
3
3
 
4
- function PersonContactSinglePerson() {
4
+ function PersonContactMultiple() {
5
5
  return (
6
6
  <div>
7
7
  <PersonContact
8
- people={[
9
- {
10
- firstName: "Harvey",
11
- lastName: "Walters"
12
- }
13
- ]}
8
+ firstName="Harvey"
9
+ lastName="Walters"
14
10
  contacts={[
15
11
  {
16
12
  contactType: "email",
17
13
  contactValue: "email@example.com",
18
- contactDetail: "Harvey's Email",
19
14
  },
20
15
  {
21
16
  contactValue: "5555555555",
22
- contactDetail: "Home",
23
17
  },
24
18
  {
25
19
  contactType: "work",
26
20
  contactValue: "3245627482",
27
- contactDetail: "Harvey's Work",
21
+ }
22
+ ]}
23
+ />
24
+ <PersonContact
25
+ firstName="Brenda"
26
+ lastName="Walters"
27
+ contacts={[
28
+ {
29
+ contactValue: "5555555555",
28
30
  }
29
31
  ]}
30
32
  />
@@ -32,4 +34,4 @@ function PersonContactSinglePerson() {
32
34
  )
33
35
  }
34
36
 
35
- export default PersonContactSinglePerson;
37
+ export default PersonContactMultiple;
@@ -0,0 +1,19 @@
1
+ <%= pb_rails("person_contact", props: {
2
+ first_name: "Harvey",
3
+ last_name: "Walters",
4
+ contacts: [
5
+ {
6
+ contact_type: "email",
7
+ contact_value: "email@example.com"
8
+ },
9
+ {
10
+ contact_value: 5555555555,
11
+ contact_detail: "Home"
12
+ },
13
+ {
14
+ contact_type: "work",
15
+ contact_value: "3245627482",
16
+ contact_detail: "Work"
17
+ }
18
+ ]
19
+ }) %>
@@ -0,0 +1,30 @@
1
+ import React from "react"
2
+ import {PersonContact} from "../../"
3
+
4
+ function PersonContactWithDetail() {
5
+ return (
6
+ <div>
7
+ <PersonContact
8
+ firstName="Harvey"
9
+ lastName="Walters"
10
+ contacts={[
11
+ {
12
+ contactType: "email",
13
+ contactValue: "email@example.com",
14
+ },
15
+ {
16
+ contactValue: "5555555555",
17
+ contactDetail: "Home",
18
+ },
19
+ {
20
+ contactType: "work",
21
+ contactValue: "3245627482",
22
+ contactDetail: "Work",
23
+ }
24
+ ]}
25
+ />
26
+ </div>
27
+ )
28
+ }
29
+
30
+ export default PersonContactWithDetail;
@@ -2,11 +2,12 @@ examples:
2
2
 
3
3
  rails:
4
4
  - person_contact_default: Default
5
- - person_contact_single_person: One Person
6
- - person_contact_three_people: Three People
5
+ - person_contact_multiple: Multiple People
6
+ - person_contact_with_detail: With Detail
7
+
7
8
 
8
9
 
9
10
  react:
10
11
  - person_contact_default: Default
11
- - person_contact_single_person: One Person
12
- - person_contact_three_people: Three People
12
+ - person_contact_multiple: Multiple People
13
+ - person_contact_with_detail: With Detail
@@ -1,3 +1,3 @@
1
1
  export {default as PersonContactDefault} from './_person_contact_default.jsx';
2
- export {default as PersonContactSinglePerson} from './_person_contact_single_person.jsx';
3
- export {default as PersonContactThreePeople} from './_person_contact_three_people.jsx';
2
+ export {default as PersonContactMultiple} from './_person_contact_multiple.jsx';
3
+ export {default as PersonContactWithDetail} from './_person_contact_with_detail.jsx';
@@ -8,7 +8,16 @@ module Playbook
8
8
  partial "pb_person_contact/person_contact"
9
9
 
10
10
  prop :contacts, type: Playbook::Props::HashArray, default: []
11
- prop :people, type: Playbook::Props::HashArray, default: []
11
+ prop :first_name
12
+ prop :last_name
13
+
14
+ def wrong_contacts
15
+ contacts.select {|contact| contact[:contact_type] == "wrong number" }
16
+ end
17
+
18
+ def valid_contacts
19
+ contacts.select {|contact| contact[:contact_type] != "wrong number" }
20
+ end
12
21
 
13
22
  def classname
14
23
  generate_classname("pb_person_contact_kit")
@@ -36,3 +36,10 @@
36
36
  text: "neutral",
37
37
  variant: "neutral"
38
38
  }) %>
39
+
40
+ <br><br>
41
+
42
+ <%= pb_rails("pill", props: {
43
+ text: "primary",
44
+ variant: "primary"
45
+ }) %>
@@ -25,6 +25,10 @@ function PillDefault() {
25
25
  <br/><br/>
26
26
 
27
27
  <Pill text="neutral" variant="neutral" />
28
+
29
+ <br/><br/>
30
+
31
+ <Pill text="primary" variant="primary" />
28
32
  </div>
29
33
  )
30
34
  }
@@ -9,7 +9,7 @@ module Playbook
9
9
 
10
10
  prop :text
11
11
  prop :variant, type: Playbook::Props::Enum,
12
- values: %w[success warning error info neutral],
12
+ values: %w[success warning error info neutral primary],
13
13
  default: "neutral"
14
14
 
15
15
  def classname
@@ -1,3 +1,5 @@
1
+ @import "../../pb_caption/caption_mixin";
2
+
1
3
  [class^=pb_table] {
2
4
  &.table-sm,
3
5
  &.table-md,
@@ -5,10 +7,7 @@
5
7
  thead {
6
8
  tr {
7
9
  th {
8
- color: $text_lt_lighter;
9
- font-size: $default-header-size;
10
- font-weight: $regular;
11
- text-transform: uppercase;
10
+ @include caption;
12
11
  border-bottom: 1px solid $border_light;
13
12
  }
14
13
  }
@@ -1,10 +1,10 @@
1
1
  <%= content_tag(:div,
2
- class: "pb_input_kit") do %>
2
+ class: "pb_text_input_kit") do %>
3
3
  <% if object.label.present? %>
4
4
  <%= pb_rails("caption", props: {text: object.label}) %>
5
5
  <% end %>
6
6
  <%= content_tag(:div,
7
- class: "input_wrapper") do %>
7
+ class: "text_input_wrapper") do %>
8
8
  <%= tag(:input,
9
9
  id: object.id,
10
10
  data: object.data,
@@ -19,7 +19,7 @@ const defaultProps = {
19
19
  type: "text"
20
20
  }
21
21
 
22
- class Input extends React.Component {
22
+ class TextInput extends React.Component {
23
23
  render() {
24
24
  const {
25
25
  className,
@@ -31,14 +31,14 @@ class Input extends React.Component {
31
31
  } = this.props
32
32
 
33
33
  const css = classnames([
34
- `pb_input_kit`,
34
+ `pb_text_input_kit`,
35
35
  className,
36
36
  ])
37
37
 
38
38
  return (
39
- <div className="pb_input_kit">
39
+ <div className="pb_text_input_kit">
40
40
  <Caption text={label} />
41
- <div className="input_wrapper">
41
+ <div className="text_input_wrapper">
42
42
  <input className={css}
43
43
  name={name}
44
44
  placeholder={placeholder}
@@ -51,7 +51,7 @@ class Input extends React.Component {
51
51
  }
52
52
  }
53
53
 
54
- Input.propTypes = propTypes
55
- Input.defaultProps = defaultProps
54
+ TextInput.propTypes = propTypes
55
+ TextInput.defaultProps = defaultProps
56
56
 
57
- export default Input
57
+ export default TextInput
@@ -3,14 +3,14 @@
3
3
  @import "../tokens/spacing";
4
4
  @import "../tokens/typography";
5
5
 
6
- .pb_input_kit {
6
+ .pb_text_input_kit {
7
7
  margin: 8px;
8
8
 
9
- .input_wrapper {
9
+ .text_input_wrapper {
10
10
  margin-bottom: 1rem;
11
11
  }
12
12
 
13
- .pb_input_kit {
13
+ .pb_text_input_kit {
14
14
  border: 1px solid $border-light;
15
15
  border-radius: $border-rad-light;
16
16
  display: block;