playbook_ui 11.10.0 → 11.11.0.pre.alpha.renderer1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/index.js +1 -0
- data/app/pb_kits/playbook/pb_dialog/_dialog.scss +25 -1
- data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +22 -0
- data/app/pb_kits/playbook/pb_dialog/dialog.rb +7 -35
- data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +16 -0
- data/app/pb_kits/playbook/pb_dialog/dialog_body.html.erb +7 -0
- data/app/pb_kits/playbook/pb_dialog/dialog_body.rb +13 -0
- data/app/pb_kits/playbook/pb_dialog/dialog_footer.html.erb +13 -0
- data/app/pb_kits/playbook/pb_dialog/dialog_footer.rb +16 -0
- data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +13 -0
- data/app/pb_kits/playbook/pb_dialog/dialog_header.rb +3 -20
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +12 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default.html.erb +11 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_sizes.html.erb +29 -0
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_user/_user.tsx +15 -1
- data/app/pb_kits/playbook/pb_user/docs/_user_block_content_subtitle_rails.html.erb +36 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_block_content_subtitle_rails.md +1 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_block_content_subtitle_react.jsx +56 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_block_content_subtitle_react.md +1 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_subtitle.html.erb +23 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_subtitle.jsx +33 -0
- data/app/pb_kits/playbook/pb_user/docs/example.yml +4 -3
- data/app/pb_kits/playbook/pb_user/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_user/user.html.erb +10 -2
- data/app/pb_kits/playbook/pb_user/user.rb +1 -0
- data/app/pb_kits/playbook/pb_user/user.test.js +28 -0
- data/app/pb_kits/playbook/playbook-rails.js +4 -0
- data/lib/playbook/version.rb +2 -2
- metadata +21 -5
- data/app/pb_kits/playbook/pb_dialog/_dialog.html.erb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87186c6f2089fba7fd9caad01934cbe9037ceb88f81bdc1c8562c2925580312c
|
4
|
+
data.tar.gz: ae086a8528f1ed1011116bd40d30ee2b726cb6f06db27f017d6da9417438ddc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3718b986e0d2c1eeecbb0ed3323e921fe0ee307a36e728787ffcc6838ac3d155900546d4f419ffa55e961612a4d2316e49a4d41e1182975201f2f98e104a008
|
7
|
+
data.tar.gz: 83e882bb65924091cc7713e7f78cb18f65d6684367bda59b9550d5827b5393eea81bf5f72bea2a17abf9bfff112cd84fd7306f5645414013aa483c62ac53a356
|
@@ -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 :
|
10
|
+
prop :text
|
11
|
+
prop :confirm_button
|
12
|
+
prop :cancel_button
|
25
13
|
|
26
|
-
def
|
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,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
|
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,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 %>
|
@@ -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
|
|
data/lib/playbook/version.rb
CHANGED
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.
|
4
|
+
version: 11.11.0.pre.alpha.renderer1
|
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-
|
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
|
@@ -2130,10 +2139,16 @@ files:
|
|
2130
2139
|
- app/pb_kits/playbook/pb_user/_user.tsx
|
2131
2140
|
- app/pb_kits/playbook/pb_user/docs/_description.md
|
2132
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
|
2133
2146
|
- app/pb_kits/playbook/pb_user/docs/_user_default.html.erb
|
2134
2147
|
- app/pb_kits/playbook/pb_user/docs/_user_default.jsx
|
2135
2148
|
- app/pb_kits/playbook/pb_user/docs/_user_size.html.erb
|
2136
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
|
2137
2152
|
- app/pb_kits/playbook/pb_user/docs/_user_text_only.html.erb
|
2138
2153
|
- app/pb_kits/playbook/pb_user/docs/_user_text_only.jsx
|
2139
2154
|
- app/pb_kits/playbook/pb_user/docs/_user_vertical_size.html.erb
|
@@ -2144,6 +2159,7 @@ files:
|
|
2144
2159
|
- app/pb_kits/playbook/pb_user/docs/index.js
|
2145
2160
|
- app/pb_kits/playbook/pb_user/user.html.erb
|
2146
2161
|
- app/pb_kits/playbook/pb_user/user.rb
|
2162
|
+
- app/pb_kits/playbook/pb_user/user.test.js
|
2147
2163
|
- app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
|
2148
2164
|
- app/pb_kits/playbook/pb_user_badge/_user_badge.scss
|
2149
2165
|
- app/pb_kits/playbook/pb_user_badge/badges/million-dollar.svg
|
@@ -2321,9 +2337,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
2321
2337
|
version: '0'
|
2322
2338
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
2323
2339
|
requirements:
|
2324
|
-
- - "
|
2340
|
+
- - ">"
|
2325
2341
|
- !ruby/object:Gem::Version
|
2326
|
-
version:
|
2342
|
+
version: 1.3.1
|
2327
2343
|
requirements: []
|
2328
2344
|
rubygems_version: 3.3.7
|
2329
2345
|
signing_key:
|
@@ -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 %>
|