playbook_ui 14.12.0.pre.alpha.PLAY1865reactdatepickerreinitializingbug5732 → 14.12.0.pre.alpha.PLAY18565866
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/pb_advanced_table/_advanced_table.scss +3 -4
- data/app/pb_kits/playbook/pb_advanced_table/index.js +9 -6
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +8 -5
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +9 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +11 -7
- data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +6 -7
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.jsx +9 -3
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.jsx +6 -2
- data/app/pb_kits/playbook/pb_button/button.rb +1 -1
- data/app/pb_kits/playbook/pb_date/_date.tsx +14 -4
- data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +2 -1
- data/app/pb_kits/playbook/pb_date/docs/_date_unstyled.jsx +13 -5
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -1
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +71 -36
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +6 -6
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +1 -6
- data/app/pb_kits/playbook/pb_filter/filter.html.erb +1 -5
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.html.erb +58 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close_rails.md +3 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/index.js +7 -5
- data/app/pb_kits/playbook/pb_form_group/form_group.html.erb +1 -6
- data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +11 -7
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.html.erb +11 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.jsx +22 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_rails.md +1 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_react.md +1 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +11 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_with_background_kit.html.erb +6 -9
- data/app/pb_kits/playbook/pb_table/docs/_table_with_background_kit.jsx +6 -9
- data/app/pb_kits/playbook/pb_table/styles/_desktop_collapse.scss +26 -0
- data/app/pb_kits/playbook/pb_table/styles/_mobile.scss +0 -1
- data/app/pb_kits/playbook/pb_table/styles/_mobile_collapse.scss +25 -0
- data/app/pb_kits/playbook/pb_table/styles/_tablet_collapse.scss +25 -0
- data/app/pb_kits/playbook/pb_user/_user.tsx +3 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.html.erb +42 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.jsx +59 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.md +2 -0
- data/app/pb_kits/playbook/pb_user/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_user/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_user/user.html.erb +1 -1
- data/app/pb_kits/playbook/pb_user/user.rb +1 -0
- data/app/pb_kits/playbook/pb_user/user.test.js +14 -0
- data/dist/chunks/{_typeahead-BIhRQo8Q.js → _typeahead-W0hatdPs.js} +2 -2
- data/dist/chunks/_weekday_stacked-C98LOqgG.js +45 -0
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +14 -5
- data/dist/chunks/_weekday_stacked-bORvL0Zi.js +0 -45
- /data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/{_fixed_confirmation_toast_auto_close.md → _fixed_confirmation_toast_auto_close_react.md} +0 -0
@@ -0,0 +1,58 @@
|
|
1
|
+
<%= pb_rails("button", props: { text: "Show Auto Close Toast", variant: "secondary", data: { toast: "#toast-auto-close" } }) %>
|
2
|
+
<%= pb_rails("button", props: { text: "Show Closeable Auto Close Toast", variant: "secondary", data: { toast: "#toast-auto-close-closeable" } }) %>
|
3
|
+
|
4
|
+
<%= pb_rails("fixed_confirmation_toast", props: {
|
5
|
+
auto_close: 3000,
|
6
|
+
classname: "toast-to-hide",
|
7
|
+
id: "toast-auto-close",
|
8
|
+
text: "I will disappear in 3 seconds.",
|
9
|
+
status: "tip",
|
10
|
+
vertical: "top",
|
11
|
+
horizontal: "center"
|
12
|
+
}) %>
|
13
|
+
|
14
|
+
<%= pb_rails("fixed_confirmation_toast", props: {
|
15
|
+
auto_close: 10000,
|
16
|
+
closeable: true,
|
17
|
+
id: "toast-auto-close-closeable",
|
18
|
+
text: "I will disappear in 10 seconds.",
|
19
|
+
status: "tip",
|
20
|
+
vertical: "top",
|
21
|
+
horizontal: "center"
|
22
|
+
}) %>
|
23
|
+
|
24
|
+
<script>
|
25
|
+
document.addEventListener('DOMContentLoaded', () => {
|
26
|
+
// Initialize toast elements and buttons
|
27
|
+
const toasts = {
|
28
|
+
'#toast-auto-close': document.querySelector("#toast-auto-close"),
|
29
|
+
'#toast-auto-close-closeable': document.querySelector("#toast-auto-close-closeable")
|
30
|
+
}
|
31
|
+
|
32
|
+
const buttons = {
|
33
|
+
'#toast-auto-close': document.querySelector("button[data-toast='#toast-auto-close']"),
|
34
|
+
'#toast-auto-close-closeable': document.querySelector("button[data-toast='#toast-auto-close-closeable']")
|
35
|
+
}
|
36
|
+
|
37
|
+
// Store original toasts and remove them from DOM
|
38
|
+
const originalToasts = {}
|
39
|
+
Object.entries(toasts).forEach(([id, toast]) => {
|
40
|
+
if (toast) {
|
41
|
+
originalToasts[id] = toast.cloneNode(true)
|
42
|
+
toast.remove()
|
43
|
+
}
|
44
|
+
})
|
45
|
+
|
46
|
+
// Set up button click handlers
|
47
|
+
Object.keys(buttons).forEach((toastId) => {
|
48
|
+
const button = buttons[toastId]
|
49
|
+
if (button) {
|
50
|
+
button.onclick = () => {
|
51
|
+
const newToast = originalToasts[toastId].cloneNode(true)
|
52
|
+
newToast.style.display = "flex"
|
53
|
+
document.body.appendChild(newToast)
|
54
|
+
}
|
55
|
+
}
|
56
|
+
})
|
57
|
+
})
|
58
|
+
</script>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
Auto close is used when you want the confirmation toast to close automatically after a certain time. `auto_close` property will be a delay number in ms.
|
2
|
+
|
3
|
+
The script tag in this code snippet is for demonstration purposes only. It clones the toasts in order to have it appear with a button click prompt and not upon initial page load. In a typical production environment the event triggering a fixed confirmation toast to appear would be handled by a controller or a separate javascript file.
|
@@ -5,6 +5,7 @@ examples:
|
|
5
5
|
- fixed_confirmation_toast_multi_line: Multi Line
|
6
6
|
- fixed_confirmation_toast_close: Click to Close
|
7
7
|
- fixed_confirmation_toast_positions: Click to Show Positions
|
8
|
+
- fixed_confirmation_toast_auto_close: Click to Show Auto Close
|
8
9
|
- fixed_confirmation_toast_children: Children
|
9
10
|
- fixed_confirmation_toast_custom_icon: Custom Icon
|
10
11
|
|
@@ -2,16 +2,18 @@ import PbEnhancedElement from '../pb_enhanced_element'
|
|
2
2
|
|
3
3
|
export default class PbFixedConfirmationToast extends PbEnhancedElement {
|
4
4
|
static get selector() {
|
5
|
-
return '
|
5
|
+
return '[class*="pb_fixed_confirmation_toast_kit"]'
|
6
6
|
}
|
7
7
|
|
8
8
|
connect() {
|
9
9
|
this.self = this.element
|
10
10
|
this.autoCloseToast(this.self)
|
11
11
|
|
12
|
-
this.self.
|
13
|
-
this.
|
14
|
-
|
12
|
+
if (this.self.classList.contains('remove_toast')) {
|
13
|
+
this.self.addEventListener('click', () => {
|
14
|
+
this.removeToast(this.self)
|
15
|
+
})
|
16
|
+
}
|
15
17
|
}
|
16
18
|
|
17
19
|
removeToast(elem) {
|
@@ -32,4 +34,4 @@ export default class PbFixedConfirmationToast extends PbEnhancedElement {
|
|
32
34
|
}, autoCloseIntValue)
|
33
35
|
}
|
34
36
|
}
|
35
|
-
}
|
37
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%=
|
1
|
+
<%= pb_content_tag(:div, class: object.classname + object.size_class, tabindex: object.tabindex) do %>
|
2
2
|
<% if object.name.present? %>
|
3
3
|
<%= pb_rails("avatar", props: { name: object.name, image_url: object.avatar_url, size: "xxs" }) %>
|
4
4
|
<% if object.truncate %>
|
@@ -18,6 +18,7 @@ type HomeAddressStreetProps = {
|
|
18
18
|
className?: string,
|
19
19
|
data?: { [key: string]: string },
|
20
20
|
dark?: boolean,
|
21
|
+
preserveCase?: boolean,
|
21
22
|
emphasis: "street" | "city" | "none",
|
22
23
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
23
24
|
homeId: string,
|
@@ -43,6 +44,7 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
|
|
43
44
|
htmlOptions = {},
|
44
45
|
homeId,
|
45
46
|
homeUrl,
|
47
|
+
preserveCase = false,
|
46
48
|
target,
|
47
49
|
newWindow,
|
48
50
|
houseStyle,
|
@@ -77,6 +79,8 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
|
|
77
79
|
return null
|
78
80
|
}
|
79
81
|
|
82
|
+
const formatStreetAdr = (address: string): string => preserveCase ? address : titleize(address)
|
83
|
+
|
80
84
|
return (
|
81
85
|
<div
|
82
86
|
className={classes(className, dark)}
|
@@ -91,7 +95,7 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
|
|
91
95
|
dark={dark}
|
92
96
|
size={4}
|
93
97
|
>
|
94
|
-
{joinPresent([
|
98
|
+
{joinPresent([formatStreetAdr(address), houseStyle], ' · ')}
|
95
99
|
</Title>
|
96
100
|
<Title
|
97
101
|
className="pb_home_address_street_address"
|
@@ -101,14 +105,14 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
|
|
101
105
|
{titleize(addressCont)}
|
102
106
|
</Title>
|
103
107
|
<Body color="light">
|
104
|
-
{`${titleize(city)}, ${state} ${zipcode}`}
|
108
|
+
{`${titleize(city)}, ${state.toUpperCase()} ${zipcode}`}
|
105
109
|
</Body>
|
106
110
|
</div>
|
107
111
|
}
|
108
112
|
{emphasis == 'city' &&
|
109
113
|
<div>
|
110
114
|
<Body color="light">
|
111
|
-
{joinPresent([
|
115
|
+
{joinPresent([formatStreetAdr(address), houseStyle], ' · ')}
|
112
116
|
</Body>
|
113
117
|
<Body color="light">{titleize(addressCont)}</Body>
|
114
118
|
<div>
|
@@ -118,7 +122,7 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
|
|
118
122
|
size={4}
|
119
123
|
tag="span"
|
120
124
|
>
|
121
|
-
{`${titleize(city)}, ${state}`}
|
125
|
+
{`${titleize(city)}, ${state.toUpperCase()}`}
|
122
126
|
</Title>
|
123
127
|
<Body
|
124
128
|
color="light"
|
@@ -132,15 +136,15 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
|
|
132
136
|
{emphasis == 'none' &&
|
133
137
|
<div>
|
134
138
|
<Body dark={dark}>
|
135
|
-
{joinPresent([
|
139
|
+
{joinPresent([formatStreetAdr(address), houseStyle], ' · ')}
|
136
140
|
</Body>
|
137
|
-
<Body dark={dark}>{
|
141
|
+
<Body dark={dark}>{formatStreetAdr(addressCont)}</Body>
|
138
142
|
<div>
|
139
143
|
<Body
|
140
144
|
color="light"
|
141
145
|
dark={dark}
|
142
146
|
>
|
143
|
-
{`${titleize(city)}, ${state} ${zipcode}`}
|
147
|
+
{`${titleize(city)}, ${state.toUpperCase()} ${zipcode}`}
|
144
148
|
</Body>
|
145
149
|
</div>
|
146
150
|
</div>
|
data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.html.erb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= pb_rails("home_address_street", props: {
|
2
|
+
address: "70 pRoSpEcT ave",
|
3
|
+
address_cont: "Apt M18",
|
4
|
+
city: "West Chester",
|
5
|
+
home_id: 8250263,
|
6
|
+
home_url: "https://powerhrg.com/",
|
7
|
+
preserve_case: true,
|
8
|
+
state: "pa",
|
9
|
+
zipcode: "19382",
|
10
|
+
territory: "PHL",
|
11
|
+
}) %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import HomeAddressStreet from '../_home_address_street'
|
4
|
+
|
5
|
+
const HomeAddressStreetFormatting = (props) => {
|
6
|
+
return (
|
7
|
+
<HomeAddressStreet
|
8
|
+
address="70 pRoSpEcT ave"
|
9
|
+
addressCont="Apt M18"
|
10
|
+
city="West Chester"
|
11
|
+
homeId="8250263"
|
12
|
+
homeUrl="https://powerhrg.com/"
|
13
|
+
preserveCase
|
14
|
+
state="pa"
|
15
|
+
territory="PHL"
|
16
|
+
zipcode="19382"
|
17
|
+
{...props}
|
18
|
+
/>
|
19
|
+
)
|
20
|
+
}
|
21
|
+
|
22
|
+
export default HomeAddressStreetFormatting
|
data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_rails.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
The `state` prop will always capitalize the state name, even if the data entered is in lowercase. For example, when `state="pa"` is passed, it will be rendered as "PA". When you pass `preserve_case: true`, the street address will be rendered exactly as entered, without automatic title capitalization.
|
data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_react.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
The `state` prop will always capitalize the state name, even if the data entered is in lowercase. For example, when `state="pa"` is passed, it will be rendered as "PA". When you pass `preserveCase`, the street address will be rendered exactly as entered, without automatic title capitalization.
|
@@ -5,12 +5,14 @@ examples:
|
|
5
5
|
- home_address_street_emphasis: Emphasis
|
6
6
|
- home_address_street_modified: Modified
|
7
7
|
- home_address_street_link: Link
|
8
|
+
- home_address_street_formatting: Formatting
|
8
9
|
|
9
10
|
react:
|
10
11
|
- home_address_street_default: Default
|
11
12
|
- home_address_street_emphasis: Emphasis
|
12
13
|
- home_address_street_modified: Modified
|
13
14
|
- home_address_street_link: Link
|
15
|
+
- home_address_street_formatting: Formatting
|
14
16
|
|
15
17
|
swift:
|
16
18
|
- home_address_street_default_swift: Default
|
@@ -2,3 +2,4 @@ export { default as HomeAddressStreetDefault } from './_home_address_street_defa
|
|
2
2
|
export { default as HomeAddressStreetEmphasis } from './_home_address_street_emphasis.jsx'
|
3
3
|
export { default as HomeAddressStreetModified } from './_home_address_street_modified.jsx'
|
4
4
|
export { default as HomeAddressStreetLink } from './_home_address_street_link.jsx'
|
5
|
+
export { default as HomeAddressStreetFormatting } from './_home_address_street_formatting.jsx'
|
@@ -18,6 +18,7 @@ module Playbook
|
|
18
18
|
prop :state
|
19
19
|
prop :zipcode
|
20
20
|
prop :territory
|
21
|
+
prop :preserve_case, default: false
|
21
22
|
prop :dark, type: Playbook::Props::Boolean, default: false
|
22
23
|
|
23
24
|
def classname
|
@@ -29,7 +30,7 @@ module Playbook
|
|
29
30
|
end
|
30
31
|
|
31
32
|
def city_state
|
32
|
-
[city&.titleize, state].join(", ")
|
33
|
+
[city&.titleize, state&.upcase].join(", ")
|
33
34
|
end
|
34
35
|
|
35
36
|
def zip
|
@@ -37,7 +38,7 @@ module Playbook
|
|
37
38
|
end
|
38
39
|
|
39
40
|
def address_house_style
|
40
|
-
[
|
41
|
+
[format_street_address, house_style].join(separator)
|
41
42
|
end
|
42
43
|
|
43
44
|
def address_house_style2
|
@@ -48,6 +49,14 @@ module Playbook
|
|
48
49
|
house_style ? " \u00b7 " : ""
|
49
50
|
end
|
50
51
|
|
52
|
+
def format_street_address
|
53
|
+
preserve_case ? address : custom_titleize(address)
|
54
|
+
end
|
55
|
+
|
56
|
+
def custom_titleize(str)
|
57
|
+
str.split(" ").map(&:capitalize).join(" ")
|
58
|
+
end
|
59
|
+
|
51
60
|
def city_emphasis_props
|
52
61
|
{
|
53
62
|
address_house_style: address_house_style,
|
@@ -39,20 +39,17 @@
|
|
39
39
|
</tr>
|
40
40
|
</tbody>
|
41
41
|
<% end %>
|
42
|
-
|
43
42
|
<%= pb_rails("table", props: { size: "sm", margin_bottom: "lg" }) do %>
|
44
43
|
<colgroup>
|
45
44
|
<%= pb_rails("background", props: { background_color: "error_subtle", tag: "col" }) %>
|
46
|
-
<%= pb_rails("background", props: { background_color: "
|
45
|
+
<%= pb_rails("background", props: { background_color: "info_subtle", tag: "col" }) %>
|
47
46
|
<%= pb_rails("background", props: { background_color: "warning_subtle", tag: "col" }) %>
|
48
47
|
</colgroup>
|
49
|
-
|
50
|
-
<
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
</tr>
|
55
|
-
<% end %>
|
48
|
+
<thead>
|
49
|
+
<th>Column 1</th>
|
50
|
+
<th>Column 2</th>
|
51
|
+
<th>Column 3</th>
|
52
|
+
</thead>
|
56
53
|
<tbody>
|
57
54
|
<tr>
|
58
55
|
<td>Value 1</td>
|
@@ -68,7 +68,7 @@ const TableWithBackgroundKit = (props) => {
|
|
68
68
|
tag='col'
|
69
69
|
/>
|
70
70
|
<Background
|
71
|
-
backgroundColor="
|
71
|
+
backgroundColor="info_subtle"
|
72
72
|
tag='col'
|
73
73
|
/>
|
74
74
|
<Background
|
@@ -76,16 +76,13 @@ const TableWithBackgroundKit = (props) => {
|
|
76
76
|
tag='col'
|
77
77
|
/>
|
78
78
|
</colgroup>
|
79
|
-
<
|
80
|
-
backgroundColor="card_light"
|
81
|
-
tag='thead'
|
82
|
-
>
|
79
|
+
<thead>
|
83
80
|
<tr>
|
84
|
-
|
85
|
-
|
86
|
-
|
81
|
+
<th>{'Column 1'}</th>
|
82
|
+
<th>{'Column 2'}</th>
|
83
|
+
<th>{'Column 3'}</th>
|
87
84
|
</tr>
|
88
|
-
</
|
85
|
+
</thead>
|
89
86
|
<tbody>
|
90
87
|
<tr>
|
91
88
|
<td>{'Value 1'}</td>
|
@@ -74,6 +74,31 @@
|
|
74
74
|
&.table-card {
|
75
75
|
background: none !important;
|
76
76
|
|
77
|
+
&.dark {
|
78
|
+
tbody, .pb_table_tbody {
|
79
|
+
tr, .pb_table_tr {
|
80
|
+
td, .pb_table_td {
|
81
|
+
background: $bg_dark_card !important;
|
82
|
+
border-color: $border_dark !important;
|
83
|
+
&:before {
|
84
|
+
color: $text_dk_light !important;
|
85
|
+
}
|
86
|
+
&:after {
|
87
|
+
height: 0;
|
88
|
+
background-color: transparent;
|
89
|
+
}
|
90
|
+
|
91
|
+
&:first-child {
|
92
|
+
border-radius: $border_rad_light $border_rad_light 0 0 !important;
|
93
|
+
}
|
94
|
+
&:last-child {
|
95
|
+
border-radius: 0 0 $border_rad_light $border_rad_light !important;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
77
102
|
tbody, .pb_table_tbody {
|
78
103
|
tr, .pb_table_tr {
|
79
104
|
td, .pb_table_td {
|
@@ -81,6 +106,7 @@
|
|
81
106
|
border-left-width: 1px !important;
|
82
107
|
border-right-width: 1px !important;
|
83
108
|
border-top-width: 1px !important;
|
109
|
+
|
84
110
|
&:after {
|
85
111
|
height: 0;
|
86
112
|
background-color: transparent;
|
@@ -74,6 +74,31 @@
|
|
74
74
|
&.table-card {
|
75
75
|
background: none !important;
|
76
76
|
|
77
|
+
&.dark {
|
78
|
+
tbody, .pb_table_tbody {
|
79
|
+
tr, .pb_table_tr {
|
80
|
+
td, .pb_table_td {
|
81
|
+
background: $bg_dark_card !important;
|
82
|
+
border-color: $border_dark !important;
|
83
|
+
&:before {
|
84
|
+
color: $text_dk_light !important;
|
85
|
+
}
|
86
|
+
&:after {
|
87
|
+
height: 0;
|
88
|
+
background-color: transparent;
|
89
|
+
}
|
90
|
+
|
91
|
+
&:first-child {
|
92
|
+
border-radius: $border_rad_light $border_rad_light 0 0 !important;
|
93
|
+
}
|
94
|
+
&:last-child {
|
95
|
+
border-radius: 0 0 $border_rad_light $border_rad_light !important;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
77
102
|
tbody, .pb_table_tbody {
|
78
103
|
tr, .pb_table_tr {
|
79
104
|
td, .pb_table_td {
|
@@ -74,6 +74,31 @@
|
|
74
74
|
&.table-card {
|
75
75
|
background: none !important;
|
76
76
|
|
77
|
+
&.dark {
|
78
|
+
tbody, .pb_table_tbody {
|
79
|
+
tr, .pb_table_tr {
|
80
|
+
td, .pb_table_td {
|
81
|
+
background: $bg_dark_card !important;
|
82
|
+
border-color: $border_dark !important;
|
83
|
+
&:before {
|
84
|
+
color: $text_dk_light !important;
|
85
|
+
}
|
86
|
+
&:after {
|
87
|
+
height: 0;
|
88
|
+
background-color: transparent;
|
89
|
+
}
|
90
|
+
|
91
|
+
&:first-child {
|
92
|
+
border-radius: $border_rad_light $border_rad_light 0 0 !important;
|
93
|
+
}
|
94
|
+
&:last-child {
|
95
|
+
border-radius: 0 0 $border_rad_light $border_rad_light !important;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
77
102
|
tbody, .pb_table_tbody {
|
78
103
|
tr, .pb_table_tr {
|
79
104
|
td, .pb_table_td {
|
@@ -13,6 +13,7 @@ type UserProps = {
|
|
13
13
|
aria?: {[key: string]: string},
|
14
14
|
avatar?: boolean,
|
15
15
|
avatarUrl?: string,
|
16
|
+
bold?: boolean,
|
16
17
|
className?: string,
|
17
18
|
dark?: boolean,
|
18
19
|
data?: {[key: string]: string},
|
@@ -32,6 +33,7 @@ const User = (props: UserProps): React.ReactElement => {
|
|
32
33
|
aria = {},
|
33
34
|
avatar = false,
|
34
35
|
avatarUrl,
|
36
|
+
bold = true,
|
35
37
|
className,
|
36
38
|
dark = false,
|
37
39
|
data = {},
|
@@ -75,6 +77,7 @@ const User = (props: UserProps): React.ReactElement => {
|
|
75
77
|
}
|
76
78
|
<div className="content_wrapper">
|
77
79
|
<Title
|
80
|
+
bold={bold}
|
78
81
|
dark={dark}
|
79
82
|
size={size == 'lg' ? 3 : 4}
|
80
83
|
text={name}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<div class="pb--doc-demo-row">
|
2
|
+
<div>
|
3
|
+
<%= pb_rails("user", props: {
|
4
|
+
name: "Anna Black",
|
5
|
+
title: "Remodeling Consultant",
|
6
|
+
orientation: "vertical",
|
7
|
+
align: "center",
|
8
|
+
size: "lg",
|
9
|
+
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
|
10
|
+
bold: false
|
11
|
+
}) %>
|
12
|
+
</div>
|
13
|
+
<div>
|
14
|
+
<%= pb_rails("user", props: {
|
15
|
+
name: "Anna Black",
|
16
|
+
title: "Remodeling Consultant",
|
17
|
+
orientation: "horizontal",
|
18
|
+
align: "left",
|
19
|
+
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
|
20
|
+
bold: false
|
21
|
+
}) %>
|
22
|
+
</div>
|
23
|
+
<div>
|
24
|
+
<%= pb_rails("user", props: {
|
25
|
+
name: "Anna Black",
|
26
|
+
orientation: "horizontal",
|
27
|
+
align: "left",
|
28
|
+
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
|
29
|
+
bold: false
|
30
|
+
}) %>
|
31
|
+
|
32
|
+
<br>
|
33
|
+
|
34
|
+
<%= pb_rails("user", props: {
|
35
|
+
name: "Anna Black",
|
36
|
+
orientation: "horizontal",
|
37
|
+
align: "left",
|
38
|
+
avatar: true,
|
39
|
+
bold: false
|
40
|
+
}) %>
|
41
|
+
</div>
|
42
|
+
</div>
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { User } from 'playbook-ui'
|
3
|
+
|
4
|
+
const UserLightWeight = (props) => {
|
5
|
+
return (
|
6
|
+
<div className="pb--doc-demo-row">
|
7
|
+
|
8
|
+
<div>
|
9
|
+
<User
|
10
|
+
align="center"
|
11
|
+
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
12
|
+
bold={false}
|
13
|
+
name="Anna Black"
|
14
|
+
orientation="vertical"
|
15
|
+
size="lg"
|
16
|
+
title="Remodeling Consultant"
|
17
|
+
{...props}
|
18
|
+
/>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div>
|
22
|
+
<User
|
23
|
+
align="left"
|
24
|
+
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
25
|
+
bold={false}
|
26
|
+
name="Anna Black"
|
27
|
+
orientation="horizontal"
|
28
|
+
title="Remodeling Consultant"
|
29
|
+
{...props}
|
30
|
+
/>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div>
|
34
|
+
<User
|
35
|
+
align="left"
|
36
|
+
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
37
|
+
bold={false}
|
38
|
+
name="Anna Black"
|
39
|
+
orientation="horizontal"
|
40
|
+
{...props}
|
41
|
+
/>
|
42
|
+
|
43
|
+
<br />
|
44
|
+
|
45
|
+
<User
|
46
|
+
align="left"
|
47
|
+
avatar
|
48
|
+
bold={false}
|
49
|
+
name="Anna Black"
|
50
|
+
orientation="horizontal"
|
51
|
+
{...props}
|
52
|
+
/>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
</div>
|
56
|
+
)
|
57
|
+
}
|
58
|
+
|
59
|
+
export default UserLightWeight
|
@@ -2,6 +2,7 @@ examples:
|
|
2
2
|
|
3
3
|
rails:
|
4
4
|
- user_default: Default
|
5
|
+
- user_light_weight: Light Weight
|
5
6
|
- user_with_territory: With Territory
|
6
7
|
- user_text_only: Text Only
|
7
8
|
- user_size: Horizontal Size
|
@@ -11,6 +12,7 @@ examples:
|
|
11
12
|
|
12
13
|
react:
|
13
14
|
- user_default: Default
|
15
|
+
- user_light_weight: Light Weight
|
14
16
|
- user_with_territory: With Territory
|
15
17
|
- user_text_only: Text Only
|
16
18
|
- user_size: Horizontal Size
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export { default as UserDefault } from './_user_default.jsx'
|
2
|
+
export { default as UserLightWeight } from './_user_light_weight.jsx'
|
2
3
|
export { default as UserWithTerritory } from './_user_with_territory.jsx'
|
3
4
|
export { default as UserTextOnly } from './_user_text_only.jsx'
|
4
5
|
export { default as UserSize } from './_user_size.jsx'
|
@@ -12,7 +12,7 @@
|
|
12
12
|
}) %>
|
13
13
|
<% end %>
|
14
14
|
<%= content_tag(:div, class: "content_wrapper") do %>
|
15
|
-
<%= pb_rails("title", props: { text: object.name, size: object.title_size, dark: object.dark }) %>
|
15
|
+
<%= pb_rails("title", props: { text: object.name, size: object.title_size, dark: object.dark, bold: object.bold }) %>
|
16
16
|
<%= pb_rails("body", props: {
|
17
17
|
text: "#{object.details}",
|
18
18
|
dark: object.dark,
|