playbook_ui 11.10.0.pre.alpha.pre.bold1 → 11.11.0.pre.alpha.dialog1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/index.js +1 -0
  3. data/app/pb_kits/playbook/pb_dialog/_dialog.scss +25 -1
  4. data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +22 -0
  5. data/app/pb_kits/playbook/pb_dialog/dialog.rb +7 -35
  6. data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +16 -0
  7. data/app/pb_kits/playbook/pb_dialog/dialog_body.html.erb +7 -0
  8. data/app/pb_kits/playbook/pb_dialog/dialog_body.rb +13 -0
  9. data/app/pb_kits/playbook/pb_dialog/dialog_footer.html.erb +13 -0
  10. data/app/pb_kits/playbook/pb_dialog/dialog_footer.rb +16 -0
  11. data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +13 -0
  12. data/app/pb_kits/playbook/pb_dialog/dialog_header.rb +3 -20
  13. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +12 -0
  14. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default.html.erb +11 -0
  15. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_sizes.html.erb +29 -0
  16. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +3 -0
  17. data/app/pb_kits/playbook/pb_title/_title.scss +0 -7
  18. data/app/pb_kits/playbook/pb_title/_title.tsx +1 -4
  19. data/app/pb_kits/playbook/pb_title/docs/{_title_default.html.erb → _title_light.html.erb} +1 -1
  20. data/app/pb_kits/playbook/pb_title/docs/{_title_default.jsx → _title_light.jsx} +2 -2
  21. data/app/pb_kits/playbook/pb_title/docs/{_title_default.md → _title_light.md} +0 -0
  22. data/app/pb_kits/playbook/pb_title/docs/example.yml +2 -4
  23. data/app/pb_kits/playbook/pb_title/docs/index.js +1 -2
  24. data/app/pb_kits/playbook/pb_title/title.rb +1 -6
  25. data/app/pb_kits/playbook/pb_title/title.test.js +0 -13
  26. data/app/pb_kits/playbook/pb_user/_user.tsx +15 -1
  27. data/app/pb_kits/playbook/pb_user/docs/_user_block_content_subtitle_rails.html.erb +36 -0
  28. data/app/pb_kits/playbook/pb_user/docs/_user_block_content_subtitle_rails.md +1 -0
  29. data/app/pb_kits/playbook/pb_user/docs/_user_block_content_subtitle_react.jsx +56 -0
  30. data/app/pb_kits/playbook/pb_user/docs/_user_block_content_subtitle_react.md +1 -0
  31. data/app/pb_kits/playbook/pb_user/docs/_user_subtitle.html.erb +23 -0
  32. data/app/pb_kits/playbook/pb_user/docs/_user_subtitle.jsx +33 -0
  33. data/app/pb_kits/playbook/pb_user/docs/example.yml +4 -3
  34. data/app/pb_kits/playbook/pb_user/docs/index.js +2 -0
  35. data/app/pb_kits/playbook/pb_user/user.html.erb +10 -2
  36. data/app/pb_kits/playbook/pb_user/user.rb +1 -0
  37. data/app/pb_kits/playbook/pb_user/user.test.js +28 -0
  38. data/app/pb_kits/playbook/playbook-rails.js +4 -0
  39. data/app/pb_kits/playbook/tokens/_titles.scss +0 -11
  40. data/lib/playbook/version.rb +2 -2
  41. metadata +22 -9
  42. data/app/pb_kits/playbook/pb_dialog/_dialog.html.erb +0 -10
  43. data/app/pb_kits/playbook/pb_title/docs/_title_light_weight.html.erb +0 -3
  44. data/app/pb_kits/playbook/pb_title/docs/_title_light_weight.jsx +0 -33
  45. data/app/pb_kits/playbook/pb_title/docs/_title_light_weight.md +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a43eeb1b663289ece01c3728bf0c0d0348b53dcaa3ff791ac1fe255320d6f82
4
- data.tar.gz: cf333518cc9c0532f39673f3203331652d592d4bad9b39556c07ffa126aa2a9c
3
+ metadata.gz: 75154344c3369be789e9fdeb6a2140baecde97c1a8f817008348c5635ce0b8dd
4
+ data.tar.gz: f9a48fef542601d8a685b3198c2f8bfe3342a47351cbf8c602cfe83917821928
5
5
  SHA512:
6
- metadata.gz: 9d28385a01e24ac9aca74db35b63c0d4799373a9912f0a42202f3dfa5e67a4a93f1c1299de00a4b545007a8c53a82928f990219b1db1ef25b8ff791a68aae003
7
- data.tar.gz: 754c695cdb22bf7dfbf63550804c6f464773df5f33106995dad2266e0dc5c01e2545b88f63a9b909839cdaf5f2b10bbeb6167af180160fc88bef775ba61ba0f6
6
+ metadata.gz: 6bb37ea63470119137bcb870cf1aa00a35aba2c8d345011ee138f07bf7cd60ebb5007affdb89e81d3b8934fe1e0dc826873300b1f1ee67d27da04b5fcf5ad512
7
+ data.tar.gz: 1cbc92c01f4028755ceb6b68ea9cdb996d9d1cc6cc48758e5cfd5774c9d1128f4f71b61d5412c44cf18ba7481ee33416a42d87651970f4fd17182981963fdf96
@@ -121,3 +121,4 @@ export { default as PbTable } from './pb_table'
121
121
  export { default as PbTextarea } from './pb_textarea'
122
122
  export { default as PbTooltip } from './pb_tooltip'
123
123
  export { default as PbTypeahead } from './pb_typeahead'
124
+ export { default as dialogHelper } from './pb_dialog/dialogHelper'
@@ -68,7 +68,7 @@
68
68
  $opacity_visible: 1;
69
69
  $opacity_hidden: 0;
70
70
 
71
- @include pb_card;
71
+ // @include pb_card;
72
72
  background-color: $white;
73
73
  box-shadow: $shadow_deepest;
74
74
  border: 0;
@@ -80,6 +80,7 @@
80
80
  animation-duration: $animation-duration;
81
81
  outline: none;
82
82
  animation-timing-function: $easeInOutQuint;
83
+ margin: auto;
83
84
 
84
85
  &[class*="_status_size"] {
85
86
  width: $status_size;
@@ -167,4 +168,27 @@
167
168
  }
168
169
  }
169
170
  }
171
+
172
+ .dialog-button-class {
173
+ background-color: unset;
174
+ border: none;
175
+ cursor: pointer;
176
+ }
177
+
178
+ }
179
+
180
+ .pb_dialog_wrapper_rails {
181
+ dialog::backdrop {
182
+ position: fixed;
183
+ top: 0;
184
+ left: 0;
185
+ right: 0;
186
+ bottom: 0;
187
+ display: flex;
188
+ align-items: center;
189
+ justify-content: center;
190
+ background-color: rgba($bg_dark, $opacity_4);
191
+ animation-name: overlayFade;
192
+ animation-duration: 0.2s;
193
+ }
170
194
  }
@@ -0,0 +1,22 @@
1
+ <div class="pb_dialog_wrapper_rails">
2
+ <%= content_tag(:dialog,
3
+ aria: object.aria,
4
+ data: object.data,
5
+ id: object.id,
6
+ class: object.classname) do %>
7
+ <% if object.title %>
8
+ <%= pb_rails("dialog/dialog_header", props: {title: object.title, id: object.id }) %>
9
+ <% end %>
10
+ <% if object.text %>
11
+ <%= pb_rails("dialog/dialog_body", props: { text: object.text }) %>
12
+ <% end %>
13
+ <% if object.cancel_button && object.confirm_button %>
14
+ <%= pb_rails("dialog/dialog_footer", props: {
15
+ cancel_button: object.cancel_button,
16
+ confirm_button: object.confirm_button,
17
+ id: object.id
18
+ }) %>
19
+ <% end %>
20
+ <%= content %>
21
+ <% end %>
22
+ </div>
@@ -2,45 +2,17 @@
2
2
 
3
3
  module Playbook
4
4
  module PbDialog
5
- class Dialog
6
- include Playbook::Props
7
-
8
- partial "pb_dialog/dialog"
9
-
10
- prop :ref
11
- prop :cancel_button
12
- prop :closeable, type: Playbook::Props::Boolean, default: true
13
- prop :confirm_button
14
- prop :oncancel
15
- prop :onchange
16
- prop :onclose
17
- prop :onconfirm
18
- prop :opened, type: Playbook::Props::Boolean, default: false
5
+ class Dialog < Playbook::KitBase
19
6
  prop :size, type: Playbook::Props::Enum,
20
- values: %w[sm md lg content],
7
+ values: %w[sm md lg xl status_size content],
21
8
  default: "md"
22
- prop :text
23
9
  prop :title
24
- prop :trigger
10
+ prop :text
11
+ prop :confirm_button
12
+ prop :cancel_button
25
13
 
26
- def dialog_options
27
- {
28
- id: id,
29
- ref: ref,
30
- trigger: trigger,
31
- className: classname,
32
- cancelButton: cancel_button,
33
- closeable: closeable,
34
- confirmButton: confirm_button,
35
- onCancel: oncancel,
36
- onChange: onchange,
37
- onClose: onclose,
38
- onConfirm: onconfirm,
39
- opened: opened,
40
- size: size,
41
- text: text,
42
- title: title,
43
- }
14
+ def classname
15
+ generate_classname("pb_dialog pb_dialog_#{size}")
44
16
  end
45
17
  end
46
18
  end
@@ -0,0 +1,16 @@
1
+ document.addEventListener("DOMContentLoaded", function () {
2
+ const openTrigger = document.querySelectorAll('[data-open-dialog]');
3
+ const closeTrigger = document.querySelectorAll('[data-close-dialog]');
4
+ openTrigger.forEach((open) => {
5
+ open.addEventListener("click", () => {
6
+ var openTriggerData = open.dataset.openDialog
7
+ document.getElementById(openTriggerData).showModal()
8
+ });
9
+ })
10
+ closeTrigger.forEach((close) => {
11
+ close.addEventListener("click", () => {
12
+ var closeTriggerData = close.dataset.closeDialog
13
+ document.getElementById(closeTriggerData).close()
14
+ })
15
+ })
16
+ });
@@ -0,0 +1,7 @@
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ aria: object.aria) do %>
6
+ <%= content.presence || object.text %>
7
+ <% end %>
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbDialog
5
+ class DialogBody < Playbook::KitBase
6
+ prop :text
7
+
8
+ def classname
9
+ generate_classname("dialog_body p_sm")
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ aria: object.aria) do %>
5
+ <%= pb_rails("flex", props: { classname:object.classname, spacing:"between", padding_x:"sm", padding:"sm", padding_bottom:"sm" }) do %>
6
+ <%= pb_rails("button", props: { type: "submit", id: object.confirm_button_id }) do %>
7
+ <%= object.confirm_button %>
8
+ <% end %>
9
+ <%= pb_rails("button", props: { data: {"close-dialog": "#{object.id}" }, id: object.cancel_button_id}) do %>
10
+ <%= object.cancel_button %>
11
+ <% end %>
12
+ <% end %>
13
+ <% end %>
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbDialog
5
+ class DialogFooter < Playbook::KitBase
6
+ prop :cancel_button
7
+ prop :confirm_button
8
+ prop :confirm_button_id
9
+ prop :cancel_button_id
10
+
11
+ def classname
12
+ generate_classname("dialog_footer")
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,13 @@
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ aria: object.aria) do %>
5
+ <%= pb_rails("flex", props: {classname:object.classname, spacing:"between", padding:"sm"}) do %>
6
+ <%= content.presence || object.title %>
7
+
8
+ <button class="dialog-button-class" data-close-dialog= <%= object.id %> >
9
+ <%= pb_rails("icon", props:{icon: "times"}) %>
10
+ </button>
11
+ <% end %>
12
+ <%= pb_rails("section_separator") %>
13
+ <% end %>
@@ -2,28 +2,11 @@
2
2
 
3
3
  module Playbook
4
4
  module PbDialog
5
- class DialogHeader
6
- include Playbook::Props
7
-
8
- partial "pb_dialog/child_kits/dialog_header"
9
-
10
- prop :closeable, type: Playbook::Props::Boolean, default: true
11
- prop :padding
12
- prop :separator, type: Playbook::Props::Boolean, default: true
13
- prop :spacing
14
- prop :text
5
+ class DialogHeader < Playbook::KitBase
15
6
  prop :title
16
7
 
17
- def dialog_header_options
18
- {
19
- id: id,
20
- closeable: closeable,
21
- padding: padding,
22
- separator: separator,
23
- spacing: spacing,
24
- text: text,
25
- title: title,
26
- }
8
+ def classname
9
+ generate_classname("dialog_header")
27
10
  end
28
11
  end
29
12
  end
@@ -0,0 +1,12 @@
1
+ <%= pb_rails("button", props: { text: "Open Complex Dialog", data:{"open-dialog": "dialog-complex"} }) %>
2
+
3
+ <%= pb_rails("dialog", props: { id:"dialog-complex", size: "lg" }) do %>
4
+ <%= pb_rails("dialog/dialog_header", props: { id: "dialog-complex" } ) do %>
5
+ <%= pb_rails("caption", props: { text: "This is a complex dialog" }) %>
6
+ <% end %>
7
+ <%= pb_rails("dialog/dialog_body") do %>
8
+ <%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
9
+ <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
10
+ <% end %>
11
+ <%= pb_rails("dialog/dialog_footer", props: {cancel_button: "Cancel", confirm_button: "Confirm", confirm_button_id:"confirm-complex", id: "dialog-complex"}) %>
12
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <%= pb_rails("button", props: { text: "Open Dialog", data: {"open-dialog": "dialog-1"} }) %>
2
+
3
+ <%= pb_rails("dialog", props: {
4
+ id:"dialog-1",
5
+ size: "sm",
6
+ title: "This is a header",
7
+ text: "This is a dialog.",
8
+ cancel_button: "Cancel",
9
+ confirm_button: "Confirm",
10
+ confirm_button_id: "confirm-button-1"
11
+ }) %>
@@ -0,0 +1,29 @@
1
+ <%= pb_rails("button", props: { text: "Small Dialog", data:{"open-dialog": "dialog-sm"} }) %>
2
+ <%= pb_rails("button", props: { text: "Medium Dialog", data:{"open-dialog": "dialog-md"} }) %>
3
+ <%= pb_rails("button", props: { text: "Large Dialog", data:{"open-dialog": "dialog-lg"} }) %>
4
+
5
+ <%= pb_rails("dialog", props: {
6
+ id:"dialog-sm",
7
+ size: "sm",
8
+ title: "This is a header",
9
+ text: "I am a small dialog",
10
+ cancel_button: "Cancel",
11
+ confirm_button: "Confirm",
12
+ }) %>
13
+
14
+
15
+ <%= pb_rails("dialog", props: {
16
+ id:"dialog-md",
17
+ size: "md",
18
+ title: "This is a header",
19
+ text: "I am a medium dialog",
20
+ cancel_button: "Cancel", confirm_button: "Confirm",
21
+ }) %>
22
+
23
+ <%= pb_rails("dialog", props: {
24
+ id:"dialog-lg", size: "lg",
25
+ title: "This is a header",
26
+ text: "I am a large dialog",
27
+ cancel_button: "Cancel",
28
+ confirm_button: "Confirm"
29
+ }) %>
@@ -1,6 +1,9 @@
1
1
  examples:
2
2
 
3
3
  rails:
4
+ - dialog_default: Simple
5
+ - dialog_compound_components: Complex
6
+ - dialog_sizes: Sizes
4
7
 
5
8
  react:
6
9
  - dialog_default: Simple
@@ -6,19 +6,16 @@
6
6
  &[class*=_1] {
7
7
  @include pb_title_1;
8
8
  @include title_colors;
9
- @include pb_title_bold;
10
9
  }
11
10
 
12
11
  &[class*=_2] {
13
12
  @include pb_title_2;
14
13
  @include title_colors;
15
- @include pb_title_bold;
16
14
  }
17
15
 
18
16
  &[class*=_3] {
19
17
  @include pb_title_3;
20
18
  @include title_colors;
21
- @include pb_title_bold;
22
19
  }
23
20
 
24
21
  &[class*=_4] {
@@ -29,8 +26,4 @@
29
26
  &.dark {
30
27
  @include pb_title_dark;
31
28
  }
32
-
33
- &[class*=_thin] {
34
- @include pb_title_thin;
35
- }
36
29
  }
@@ -5,7 +5,6 @@ import { deprecatedProps, GlobalProps, globalProps } from '../utilities/globalPr
5
5
 
6
6
  type TitleProps = {
7
7
  aria?: {[key: string]: string},
8
- bold?: boolean,
9
8
  children?: React.ReactChild[] | React.ReactChild,
10
9
  className?: string,
11
10
  color?: "default" | "light" | "lighter" | "success" | "error" | "link",
@@ -21,7 +20,6 @@ const Title = (props: TitleProps): React.ReactElement => {
21
20
  if (props.variant) deprecatedProps('Title', ['variant']) //variant prop is deprecated, use color instead
22
21
  const {
23
22
  aria = {},
24
- bold = true,
25
23
  children,
26
24
  className,
27
25
  color,
@@ -35,9 +33,8 @@ const Title = (props: TitleProps): React.ReactElement => {
35
33
 
36
34
  const ariaProps: {[key: string]: string | number} = buildAriaProps(aria)
37
35
  const dataProps: {[key: string]: string | number} = buildDataProps(data)
38
- const getBold = bold ? '' : 'thin'
39
36
  const classes = classnames(
40
- buildCss('pb_title_kit', `size_${size}`, variant, color, getBold),
37
+ buildCss('pb_title_kit', `size_${size}`, variant, color),
41
38
  globalProps(props),
42
39
  className,
43
40
  )
@@ -5,7 +5,7 @@
5
5
 
6
6
  <br/>
7
7
 
8
- <%= pb_rails("title", props: { text: "Title 4", tag: "h4", size: 4 }) %>
8
+ <%= pb_rails("title", props: { text: "Title 4", tag: "h4", size: 4 }) %>
9
9
  <%= pb_rails("title", props: { text: "Title 3", tag: "h3", size: 3 }) %>
10
10
  <%= pb_rails("title", props: { text: "Title 2", tag: "h2", size: 2 }) %>
11
11
  <%= pb_rails("title", props: { text: "Title 1", tag: "h1", size: 1 }) %>
@@ -2,7 +2,7 @@ import React from 'react'
2
2
 
3
3
  import Title from '../_title'
4
4
 
5
- const TitleDefault = (props) => {
5
+ const TitleLight = (props) => {
6
6
  return (
7
7
  <div>
8
8
  <Title
@@ -38,4 +38,4 @@ const TitleDefault = (props) => {
38
38
  )
39
39
  }
40
40
 
41
- export default TitleDefault
41
+ export default TitleLight
@@ -1,10 +1,8 @@
1
1
  examples:
2
2
  rails:
3
- - title_default: Default UI
4
- - title_light_weight: Light Weight UI
3
+ - title_light: Light UI
5
4
  - title_colors: Colors
6
5
 
7
6
  react:
8
- - title_default: Default UI
9
- - title_light_weight: Light Weight UI
7
+ - title_light: Light UI
10
8
  - title_colors: Colors
@@ -1,3 +1,2 @@
1
- export { default as TitleDefault } from './_title_default.jsx'
2
- export { default as TitleLightWeight } from './_title_light_weight.jsx'
1
+ export { default as TitleLight } from './_title_light.jsx'
3
2
  export { default as TitleColors } from './_title_colors.jsx'
@@ -17,14 +17,9 @@ module Playbook
17
17
  values: [nil, "link"],
18
18
  default: nil,
19
19
  deprecated: true
20
- prop :bold, type: Playbook::Props::Boolean, default: true
21
20
 
22
21
  def classname
23
- generate_classname("pb_title_kit", size, variant, color, is_bold)
24
- end
25
-
26
- def is_bold
27
- bold ? nil : "thin"
22
+ generate_classname("pb_title_kit", size, variant, color)
28
23
  end
29
24
  end
30
25
  end
@@ -15,19 +15,6 @@ test('returns namespaced class name', () => {
15
15
  expect(kit).toHaveClass('pb_title_kit_size_3')
16
16
  })
17
17
 
18
- test('with thin font weight', () => {
19
- render(
20
- <Title
21
- bold={false}
22
- data={{ testid: 'primary-test' }}
23
- text="Test thin font weight"
24
- />
25
- )
26
-
27
- const kit = screen.getByTestId('primary-test')
28
- expect(kit).toHaveClass('pb_title_kit_size_3_thin')
29
- })
30
-
31
18
  test('with colors', () => {
32
19
  render(
33
20
  <Title
@@ -1,4 +1,3 @@
1
-
2
1
  import React from 'react'
3
2
  import classnames from 'classnames'
4
3
 
@@ -21,6 +20,7 @@ type UserProps = {
21
20
  name?: string,
22
21
  orientation?: "horiztonal" | "vertical",
23
22
  size?: "sm" | "md" | "lg",
23
+ subtitle?: string | Array<Node> | Node,
24
24
  territory?: string,
25
25
  title?: string,
26
26
  } & GlobalProps
@@ -38,6 +38,7 @@ const User = (props: UserProps) => {
38
38
  name,
39
39
  orientation = 'horizontal',
40
40
  size = 'sm',
41
+ subtitle,
41
42
  territory = '',
42
43
  title = '',
43
44
  } = props
@@ -81,6 +82,19 @@ const User = (props: UserProps) => {
81
82
  >
82
83
  {territory === '' ? title : `${territory} • ${title}`}
83
84
  </Body>
85
+ { typeof(subtitle) === 'string' &&
86
+ <Body
87
+ color="light"
88
+ dark={dark}
89
+ text={subtitle}
90
+ variant={null}
91
+ />
92
+ }
93
+ { typeof(subtitle) !== 'string' &&
94
+ <>
95
+ {subtitle}
96
+ </>
97
+ }
84
98
  </div>
85
99
  </div>
86
100
  )
@@ -0,0 +1,36 @@
1
+ <div class="pb--doc-demo-row">
2
+ <%= pb_rails("user", props: {
3
+ align: "left",
4
+ avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
5
+ name: "Anna Black",
6
+ orientation: "horizontal",
7
+ size: "md",
8
+ territory: "PHL",
9
+ title: "Remodeling Consultant"
10
+ }) do %>
11
+ <%= pb_rails("flex", props: { align: "center" }) do %>
12
+ <%= pb_rails("icon", props: { icon: "users" }) %>
13
+ <%= pb_rails("caption", props: { padding_left: "xs", text: "Admin" }) %>
14
+ <% end %>
15
+ <% end %>
16
+
17
+ <%= pb_rails("user", props: {
18
+ align: "left",
19
+ avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
20
+ name: "Anna Black",
21
+ orientation: "horizontal",
22
+ size: "md",
23
+ }) do %>
24
+ <%= pb_rails("contact", props: {
25
+ contact_type: "cell",
26
+ contact_value: "349-185-9988"
27
+ }) %>
28
+ <%= pb_rails("contact", props: {
29
+ contact_value: 5555555555
30
+ }) %>
31
+ <%= pb_rails("contact", props: {
32
+ contact_type: "email",
33
+ contact_value: "email@example.com"
34
+ }) %>
35
+ <% end %>
36
+ </div>
@@ -0,0 +1 @@
1
+ The kit accepts block content and whatever is passed as block content will display in the subtitle section.
@@ -0,0 +1,56 @@
1
+ import React from "react"
2
+ import { Caption, Contact, Flex, Icon, User } from "../.."
3
+
4
+ const MentorSubtitle = (
5
+ <Flex>
6
+ <Icon icon="users" />
7
+ <Caption
8
+ paddingLeft="xs"
9
+ text="Admin"
10
+ />
11
+ </Flex>
12
+ )
13
+
14
+ const ContactSubtitle = (
15
+ <>
16
+ <Contact
17
+ contactType="cell"
18
+ contactValue="349-185-9988"
19
+ />
20
+ <Contact
21
+ contactValue="5555555555"
22
+ />
23
+ <Contact
24
+ contactType="email"
25
+ contactValue="email@example.com"
26
+ />
27
+ </>
28
+ )
29
+
30
+ const UserBlockContentSubtitleReact = (props) => {
31
+ return (
32
+ <div className="pb--doc-demo-row">
33
+ <User
34
+ align="left"
35
+ avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
36
+ name="Anna Black"
37
+ orientation="horizontal"
38
+ subtitle={MentorSubtitle}
39
+ territory="PHL"
40
+ title="Remodeling Consultant"
41
+ {...props}
42
+ />
43
+
44
+ <User
45
+ align="left"
46
+ avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
47
+ name="Anna Black"
48
+ orientation="horizontal"
49
+ subtitle={ContactSubtitle}
50
+ {...props}
51
+ />
52
+ </div>
53
+ )
54
+ }
55
+
56
+ export default UserBlockContentSubtitleReact
@@ -0,0 +1 @@
1
+ The `subtitle` prop accepts strings as well as nodes. Whatever node is passed will display in the subtitle section.
@@ -0,0 +1,23 @@
1
+ <div class="pb--doc-demo-row">
2
+ <%= pb_rails("user", props: {
3
+ align: "center",
4
+ avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
5
+ name: "Anna Black",
6
+ orientation: "vertical",
7
+ size: "md",
8
+ subtitle: "User ID: 12345",
9
+ territory: "PHL",
10
+ title: "Remodeling Consultant"
11
+ }) %>
12
+
13
+ <%= pb_rails("user", props: {
14
+ align: "left",
15
+ avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
16
+ name: "Anna Black",
17
+ orientation: "horizontal",
18
+ size: "md",
19
+ subtitle: "User ID: 12345",
20
+ territory: "PHL",
21
+ title: "Remodeling Consultant"
22
+ }) %>
23
+ </div>
@@ -0,0 +1,33 @@
1
+ import React from "react"
2
+ import { User } from "../../"
3
+
4
+ const UserSubtitle = (props) => {
5
+ return (
6
+ <div className="pb--doc-demo-row">
7
+ <User
8
+ align="center"
9
+ avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
10
+ name="Anna Black"
11
+ orientation="vertical"
12
+ size="lg"
13
+ subtitle="User ID: 12345"
14
+ territory="PHL"
15
+ title="Remodeling Consultant"
16
+ {...props}
17
+ />
18
+
19
+ <User
20
+ align="left"
21
+ avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
22
+ name="Anna Black"
23
+ orientation="horizontal"
24
+ subtitle="User ID: 12345"
25
+ territory="PHL"
26
+ title="Remodeling Consultant"
27
+ {...props}
28
+ />
29
+ </div>
30
+ )
31
+ }
32
+
33
+ export default UserSubtitle
@@ -6,9 +6,8 @@ examples:
6
6
  - user_text_only: Text Only
7
7
  - user_size: Horizontal Size
8
8
  - user_vertical_size: Vertical Size
9
-
10
-
11
-
9
+ - user_subtitle: Subtitle
10
+ - user_block_content_subtitle_rails: Block Content Subtitle
12
11
 
13
12
  react:
14
13
  - user_default: Default
@@ -16,3 +15,5 @@ examples:
16
15
  - user_text_only: Text Only
17
16
  - user_size: Horizontal Size
18
17
  - user_vertical_size: Vertical Size
18
+ - user_subtitle: Subtitle
19
+ - user_block_content_subtitle_react: Block Content Subtitle
@@ -3,3 +3,5 @@ export { default as UserWithTerritory } from './_user_with_territory.jsx'
3
3
  export { default as UserTextOnly } from './_user_text_only.jsx'
4
4
  export { default as UserSize } from './_user_size.jsx'
5
5
  export { default as UserVerticalSize } from './_user_vertical_size.jsx'
6
+ export { default as UserSubtitle } from './_user_subtitle.jsx'
7
+ export { default as UserBlockContentSubtitleReact } from './_user_block_content_subtitle_react.jsx'
@@ -10,13 +10,21 @@
10
10
  image_url: object.avatar_url
11
11
  }) %>
12
12
  <% end %>
13
- <%= content_tag(:div,
14
- class: "content_wrapper") do %>
13
+ <%= content_tag(:div, class: "content_wrapper") do %>
15
14
  <%= pb_rails("title", props: { text: object.name, size: object.title_size, dark: object.dark }) %>
16
15
  <%= pb_rails("body", props: {
17
16
  text: "#{object.details}",
18
17
  dark: object.dark,
19
18
  color: "light"
20
19
  }) %>
20
+ <% if content %>
21
+ <%= content.presence %>
22
+ <% else %>
23
+ <%= pb_rails("body", props: {
24
+ text: "#{object.subtitle}",
25
+ dark: object.dark,
26
+ color: "light"
27
+ }) %>
28
+ <% end %>
21
29
  <% end %>
22
30
  <% end %>
@@ -16,6 +16,7 @@ module Playbook
16
16
  prop :size, type: Playbook::Props::Enum,
17
17
  values: %w[lg md sm],
18
18
  default: "sm"
19
+ prop :subtitle
19
20
  prop :title
20
21
  prop :territory
21
22
 
@@ -0,0 +1,28 @@
1
+ import React from 'react'
2
+ import { render, screen } from '../utilities/test-utils'
3
+ import User from './_user'
4
+ import Caption from "../pb_caption/_caption"
5
+
6
+ test('subtitle prop adds subtitle text', () => {
7
+ render(
8
+ <User
9
+ data={{ testid: 'test-subtitle' }}
10
+ subtitle='test subtitle'
11
+ />
12
+ )
13
+
14
+ expect(screen.getByTestId('test-subtitle')).toHaveTextContent('test subtitle')
15
+ })
16
+
17
+ test('subtitle prop accepts a node', () => {
18
+ const TestCaption = <Caption text='test caption' />
19
+
20
+ render(
21
+ <User
22
+ data={{ testid: 'test-subtitle-block' }}
23
+ subtitle={TestCaption}
24
+ />
25
+ )
26
+
27
+ expect(screen.getByTestId('test-subtitle-block')).toHaveTextContent('test caption')
28
+ })
@@ -9,6 +9,10 @@ import './pb_form/pb_form_validation'
9
9
  import datePickerHelper from './pb_date_picker/date_picker_helper'
10
10
  window.datePickerHelper = datePickerHelper
11
11
 
12
+ // Dialog
13
+ import dialogHelper from './pb_dialog/dialogHelper'
14
+ window.dialogHelper = dialogHelper
15
+
12
16
  // Lazy image loading
13
17
  import 'lazysizes'
14
18
 
@@ -31,19 +31,8 @@
31
31
 
32
32
  @mixin pb_title_4 {
33
33
  @include pb_title($heading_4, $bolder);
34
- letter-spacing: -0.03em !important;
35
34
  }
36
35
 
37
36
  @mixin pb_title_dark {
38
37
  color: $text_dk_default;
39
38
  }
40
-
41
- @mixin pb_title_bold {
42
- font-weight: $bolder;
43
- letter-spacing: 0em;
44
- }
45
-
46
- @mixin pb_title_thin {
47
- font-weight: $lighter;
48
- letter-spacing: $lspace_tight;
49
- }
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- PREVIOUS_VERSION = "11.10.0"
5
- VERSION = "11.10.0.pre.alpha-bold1"
4
+ PREVIOUS_VERSION = "11.11.0"
5
+ VERSION = "11.11.0.pre.alpha.dialog1"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.10.0.pre.alpha.pre.bold1
4
+ version: 11.11.0.pre.alpha.dialog1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-10-27 00:00:00.000000000 Z
12
+ date: 2022-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -808,18 +808,26 @@ files:
808
808
  - app/pb_kits/playbook/pb_date_year_stacked/docs/example.yml
809
809
  - app/pb_kits/playbook/pb_date_year_stacked/docs/index.js
810
810
  - app/pb_kits/playbook/pb_dialog/_close_icon.tsx
811
- - app/pb_kits/playbook/pb_dialog/_dialog.html.erb
812
811
  - app/pb_kits/playbook/pb_dialog/_dialog.scss
813
812
  - app/pb_kits/playbook/pb_dialog/_dialog.tsx
814
813
  - app/pb_kits/playbook/pb_dialog/_dialog_context.tsx
815
814
  - app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.tsx
816
815
  - app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx
817
816
  - app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx
817
+ - app/pb_kits/playbook/pb_dialog/dialog.html.erb
818
818
  - app/pb_kits/playbook/pb_dialog/dialog.rb
819
819
  - app/pb_kits/playbook/pb_dialog/dialog.test.jsx
820
+ - app/pb_kits/playbook/pb_dialog/dialogHelper.js
821
+ - app/pb_kits/playbook/pb_dialog/dialog_body.html.erb
822
+ - app/pb_kits/playbook/pb_dialog/dialog_body.rb
823
+ - app/pb_kits/playbook/pb_dialog/dialog_footer.html.erb
824
+ - app/pb_kits/playbook/pb_dialog/dialog_footer.rb
825
+ - app/pb_kits/playbook/pb_dialog/dialog_header.html.erb
820
826
  - app/pb_kits/playbook/pb_dialog/dialog_header.rb
827
+ - app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb
821
828
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.jsx
822
829
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.md
830
+ - app/pb_kits/playbook/pb_dialog/docs/_dialog_default.html.erb
823
831
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_default.jsx
824
832
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.jsx
825
833
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.md
@@ -831,6 +839,7 @@ files:
831
839
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_separators.md
832
840
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_should_close_on_overlay.jsx
833
841
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_should_close_on_overlay.md
842
+ - app/pb_kits/playbook/pb_dialog/docs/_dialog_sizes.html.erb
834
843
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_sizes.jsx
835
844
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_stacked_alert.jsx
836
845
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_stacked_alert.md
@@ -1995,12 +2004,9 @@ files:
1995
2004
  - app/pb_kits/playbook/pb_title/docs/_title_colors.html.erb
1996
2005
  - app/pb_kits/playbook/pb_title/docs/_title_colors.jsx
1997
2006
  - app/pb_kits/playbook/pb_title/docs/_title_colors.md
1998
- - app/pb_kits/playbook/pb_title/docs/_title_default.html.erb
1999
- - app/pb_kits/playbook/pb_title/docs/_title_default.jsx
2000
- - app/pb_kits/playbook/pb_title/docs/_title_default.md
2001
- - app/pb_kits/playbook/pb_title/docs/_title_light_weight.html.erb
2002
- - app/pb_kits/playbook/pb_title/docs/_title_light_weight.jsx
2003
- - app/pb_kits/playbook/pb_title/docs/_title_light_weight.md
2007
+ - app/pb_kits/playbook/pb_title/docs/_title_light.html.erb
2008
+ - app/pb_kits/playbook/pb_title/docs/_title_light.jsx
2009
+ - app/pb_kits/playbook/pb_title/docs/_title_light.md
2004
2010
  - app/pb_kits/playbook/pb_title/docs/example.yml
2005
2011
  - app/pb_kits/playbook/pb_title/docs/index.js
2006
2012
  - app/pb_kits/playbook/pb_title/title.html.erb
@@ -2133,10 +2139,16 @@ files:
2133
2139
  - app/pb_kits/playbook/pb_user/_user.tsx
2134
2140
  - app/pb_kits/playbook/pb_user/docs/_description.md
2135
2141
  - app/pb_kits/playbook/pb_user/docs/_footer.md
2142
+ - app/pb_kits/playbook/pb_user/docs/_user_block_content_subtitle_rails.html.erb
2143
+ - app/pb_kits/playbook/pb_user/docs/_user_block_content_subtitle_rails.md
2144
+ - app/pb_kits/playbook/pb_user/docs/_user_block_content_subtitle_react.jsx
2145
+ - app/pb_kits/playbook/pb_user/docs/_user_block_content_subtitle_react.md
2136
2146
  - app/pb_kits/playbook/pb_user/docs/_user_default.html.erb
2137
2147
  - app/pb_kits/playbook/pb_user/docs/_user_default.jsx
2138
2148
  - app/pb_kits/playbook/pb_user/docs/_user_size.html.erb
2139
2149
  - app/pb_kits/playbook/pb_user/docs/_user_size.jsx
2150
+ - app/pb_kits/playbook/pb_user/docs/_user_subtitle.html.erb
2151
+ - app/pb_kits/playbook/pb_user/docs/_user_subtitle.jsx
2140
2152
  - app/pb_kits/playbook/pb_user/docs/_user_text_only.html.erb
2141
2153
  - app/pb_kits/playbook/pb_user/docs/_user_text_only.jsx
2142
2154
  - app/pb_kits/playbook/pb_user/docs/_user_vertical_size.html.erb
@@ -2147,6 +2159,7 @@ files:
2147
2159
  - app/pb_kits/playbook/pb_user/docs/index.js
2148
2160
  - app/pb_kits/playbook/pb_user/user.html.erb
2149
2161
  - app/pb_kits/playbook/pb_user/user.rb
2162
+ - app/pb_kits/playbook/pb_user/user.test.js
2150
2163
  - app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
2151
2164
  - app/pb_kits/playbook/pb_user_badge/_user_badge.scss
2152
2165
  - app/pb_kits/playbook/pb_user_badge/badges/million-dollar.svg
@@ -1,10 +0,0 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- aria: object.aria,
6
- dark: object.dark) do %>
7
- <% if object.children %>
8
- <%= pb_rails("dialog/dialog_header", props: { children: object.children }) %>
9
- <% end %>
10
- <% end %>
@@ -1,3 +0,0 @@
1
- <%= pb_rails("title", props: { text: "Title 3", tag: "h3", size: 3, bold: false }) %>
2
- <%= pb_rails("title", props: { text: "Title 2", tag: "h2", size: 2, bold: false }) %>
3
- <%= pb_rails("title", props: { text: "Title 1", tag: "h1", size: 1, bold: false }) %>
@@ -1,33 +0,0 @@
1
- import React from 'react'
2
-
3
- import Title from '../_title'
4
-
5
- const TitleLightWeight = (props) => {
6
- return (
7
- <div>
8
- <Title
9
- bold={false}
10
- size={3}
11
- tag="h3"
12
- text="Title 3"
13
- {...props}
14
- />
15
- <Title
16
- bold={false}
17
- size={2}
18
- tag="h2"
19
- text="Title 2"
20
- {...props}
21
- />
22
- <Title
23
- bold={false}
24
- size={1}
25
- tag="h1"
26
- text="Title 1"
27
- {...props}
28
- />
29
- </div>
30
- )
31
- }
32
-
33
- export default TitleLightWeight
@@ -1,3 +0,0 @@
1
- ##### Prop
2
- Title kit will use `font-weight: 700` by default, if you want a lighter font weight, use the `bold` prop set to `false`.
3
- Title `size 4` uses a heavy font weight by default and will not accept a lighter font weight.