playbook_ui 14.3.0.pre.rc.8 → 14.3.0.pre.rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +16 -2
- data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_link.html.erb +1 -1
- data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_link.jsx +1 -1
- data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_link.md +1 -1
- data/app/pb_kits/playbook/pb_hashtag/hashtag.html.erb +1 -1
- data/app/pb_kits/playbook/pb_hashtag/hashtag.rb +9 -2
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +16 -0
- data/app/pb_kits/playbook/pb_home_address_street/city_emphasis.html.erb +1 -0
- data/app/pb_kits/playbook/pb_home_address_street/city_emphasis.rb +11 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link.html.erb +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link.jsx +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link.md +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +13 -0
- data/app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js +2 -2
- data/app/pb_kits/playbook/pb_home_address_street/street_emphasis.html.erb +2 -1
- data/app/pb_kits/playbook/pb_home_address_street/street_emphasis.rb +11 -0
- data/dist/chunks/{_weekday_stacked-8iXUzsvg.js → _weekday_stacked-DpRkKl3_.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d27bc0773d0b2b97125ccaf0b86f53cc44090fc1e7e7c77c39027bd0be7dd093
|
4
|
+
data.tar.gz: 5e4253b6ed65adcbe071d8581e9aa3b92b512a28aba751fe379d50f1587255c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54b2d14f3b2d4aab0f1f8fa0fbf106ffe53fa504cc4e07c51cb840fafbfe5ed903bab2a6a30c77a9342dce1452998914b2fbb0261da01bf8a557e9e7b37bba46
|
7
|
+
data.tar.gz: 879f68fe40a025427d08849c019874d9e62905d69020f478edfd8871781f0f5e2095d37748b3c986d0bab02c5ae56e2aa1c8382d4c2159af584ba7bdbefd3709
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* eslint-disable react/jsx-no-target-blank */
|
2
|
-
/* eslint-disable react/no-multi-comp
|
2
|
+
/* eslint-disable react/no-multi-comp */
|
3
3
|
|
4
4
|
import React from 'react'
|
5
5
|
import classnames from 'classnames'
|
@@ -18,6 +18,7 @@ type HashtagProps = {
|
|
18
18
|
id?: string,
|
19
19
|
newWindow?: boolean,
|
20
20
|
rel?: string,
|
21
|
+
target?: string,
|
21
22
|
text?: string,
|
22
23
|
type: "default" | "home" | "project" | "appointment",
|
23
24
|
url?: string,
|
@@ -40,6 +41,7 @@ const Hashtag = (props: HashtagProps) => {
|
|
40
41
|
id,
|
41
42
|
newWindow,
|
42
43
|
rel,
|
44
|
+
target,
|
43
45
|
text,
|
44
46
|
type = 'default',
|
45
47
|
url,
|
@@ -50,6 +52,18 @@ const Hashtag = (props: HashtagProps) => {
|
|
50
52
|
const htmlProps = buildHtmlProps(htmlOptions)
|
51
53
|
const classes = classnames(buildCss('pb_hashtag_kit'), globalProps(props), className)
|
52
54
|
|
55
|
+
const getTargetAttribute = () => {
|
56
|
+
if (target && url) {
|
57
|
+
return target
|
58
|
+
} else if (newWindow) {
|
59
|
+
return '_blank'
|
60
|
+
} else {
|
61
|
+
return '_self'
|
62
|
+
}
|
63
|
+
|
64
|
+
return null
|
65
|
+
}
|
66
|
+
|
53
67
|
return (
|
54
68
|
<span
|
55
69
|
{...ariaProps}
|
@@ -61,7 +75,7 @@ const Hashtag = (props: HashtagProps) => {
|
|
61
75
|
<a
|
62
76
|
href={url}
|
63
77
|
rel={(newWindow ? "noreferrer" : rel)}
|
64
|
-
target={(
|
78
|
+
target={getTargetAttribute()}
|
65
79
|
>
|
66
80
|
<Badge
|
67
81
|
dark={dark}
|
@@ -2,4 +2,4 @@
|
|
2
2
|
|
3
3
|
<br/><br/>
|
4
4
|
|
5
|
-
<%= pb_rails("hashtag", props: {text: "Open in a new Window", url: "https://google.com", type: "project",
|
5
|
+
<%= pb_rails("hashtag", props: {text: "Open in a new Window", url: "https://google.com", type: "project", target: "_blank"}) %>
|
@@ -1 +1 @@
|
|
1
|
-
Use the
|
1
|
+
Use the `target` prop to control whether the link opens on the same or a new tab (same page is the default behavior). You can use any [web/standard](https://www.w3schools.com/tags/att_a_target.asp) values or a custom string to specify your link target.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= pb_content_tag(:span) do %>
|
2
|
-
<%= link_to object.url, target: object.
|
2
|
+
<%= link_to object.url, target: object.target_option do %>
|
3
3
|
<%= pb_rails("badge", props: { dark: object.dark, variant: "primary", text: object.hashtag_text }) %>
|
4
4
|
<% end %>
|
5
5
|
<% end %>
|
@@ -10,6 +10,7 @@ module Playbook
|
|
10
10
|
values: %w[default project home appointment],
|
11
11
|
default: "default"
|
12
12
|
prop :url
|
13
|
+
prop :target
|
13
14
|
|
14
15
|
def classname
|
15
16
|
generate_classname("pb_hastag_kit")
|
@@ -19,8 +20,14 @@ module Playbook
|
|
19
20
|
type_text + text
|
20
21
|
end
|
21
22
|
|
22
|
-
def
|
23
|
-
|
23
|
+
def target_option
|
24
|
+
if target && url
|
25
|
+
target
|
26
|
+
elsif new_window
|
27
|
+
"_blank"
|
28
|
+
else
|
29
|
+
"_self"
|
30
|
+
end
|
24
31
|
end
|
25
32
|
|
26
33
|
private
|
@@ -23,6 +23,7 @@ type HomeAddressStreetProps = {
|
|
23
23
|
homeId: string,
|
24
24
|
houseStyle: string,
|
25
25
|
homeUrl: string,
|
26
|
+
target: string,
|
26
27
|
newWindow: boolean,
|
27
28
|
state: string,
|
28
29
|
zipcode: string,
|
@@ -42,6 +43,7 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
|
|
42
43
|
htmlOptions = {},
|
43
44
|
homeId,
|
44
45
|
homeUrl,
|
46
|
+
target,
|
45
47
|
newWindow,
|
46
48
|
houseStyle,
|
47
49
|
state,
|
@@ -62,6 +64,19 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
|
|
62
64
|
const dataProps: GenericObject = buildDataProps(data)
|
63
65
|
const ariaProps: GenericObject = buildAriaProps(aria)
|
64
66
|
const htmlProps = buildHtmlProps(htmlOptions)
|
67
|
+
|
68
|
+
const getTargetAttribute = () => {
|
69
|
+
if (target && homeUrl) {
|
70
|
+
return target
|
71
|
+
} else if (newWindow) {
|
72
|
+
return '_blank'
|
73
|
+
} else {
|
74
|
+
return '_self'
|
75
|
+
}
|
76
|
+
|
77
|
+
return null
|
78
|
+
}
|
79
|
+
|
65
80
|
return (
|
66
81
|
<div
|
67
82
|
className={classes(className, dark)}
|
@@ -120,6 +135,7 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
|
|
120
135
|
dark={dark}
|
121
136
|
marginRight="xxs"
|
122
137
|
newWindow={newWindow}
|
138
|
+
target={getTargetAttribute()}
|
123
139
|
text={homeId}
|
124
140
|
type="home"
|
125
141
|
url={homeUrl || '#'}
|
@@ -10,9 +10,20 @@ module Playbook
|
|
10
10
|
prop :home_url
|
11
11
|
prop :new_window, type: Playbook::Props::Boolean,
|
12
12
|
default: false
|
13
|
+
prop :target
|
13
14
|
prop :territory
|
14
15
|
prop :zip
|
15
16
|
prop :dark, type: Playbook::Props::Boolean, default: false
|
17
|
+
|
18
|
+
def target_option
|
19
|
+
if target && home_url
|
20
|
+
target
|
21
|
+
elsif new_window
|
22
|
+
"_blank"
|
23
|
+
else
|
24
|
+
"_self"
|
25
|
+
end
|
26
|
+
end
|
16
27
|
end
|
17
28
|
end
|
18
29
|
end
|
@@ -1 +1 @@
|
|
1
|
-
Use the `
|
1
|
+
Use the `target` prop to control whether the link opens on the same or a new tab (same page is the default behavior). You can use any [web/standard](https://www.w3schools.com/tags/att_a_target.asp) values or a custom string to specify your link target.
|
@@ -14,6 +14,7 @@ module Playbook
|
|
14
14
|
prop :house_style
|
15
15
|
prop :new_window, type: Playbook::Props::Boolean,
|
16
16
|
default: false
|
17
|
+
prop :target
|
17
18
|
prop :state
|
18
19
|
prop :zipcode
|
19
20
|
prop :territory
|
@@ -55,6 +56,7 @@ module Playbook
|
|
55
56
|
dark: dark,
|
56
57
|
home_id: home_id,
|
57
58
|
home_url: home_url,
|
59
|
+
target: target_option,
|
58
60
|
new_window: new_window,
|
59
61
|
territory: territory,
|
60
62
|
zip: zip,
|
@@ -69,11 +71,22 @@ module Playbook
|
|
69
71
|
dark: dark,
|
70
72
|
home_id: home_id,
|
71
73
|
home_url: home_url,
|
74
|
+
target: target_option,
|
72
75
|
new_window: new_window,
|
73
76
|
territory: territory,
|
74
77
|
}
|
75
78
|
end
|
76
79
|
|
80
|
+
def target_option
|
81
|
+
if target && home_url
|
82
|
+
target
|
83
|
+
elsif new_window
|
84
|
+
"_blank"
|
85
|
+
else
|
86
|
+
"_self"
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
77
90
|
private
|
78
91
|
|
79
92
|
def dark_class
|
@@ -23,10 +23,10 @@ function HomeAdressStreetTest(props) {
|
|
23
23
|
territory="PHL"
|
24
24
|
zipcode="19382"
|
25
25
|
{...props}
|
26
|
-
|
26
|
+
/>
|
27
27
|
);
|
28
28
|
}
|
29
|
-
|
29
|
+
|
30
30
|
test("renders the component", () => {
|
31
31
|
render(<HomeAdressStreetTest />);
|
32
32
|
const kit = screen.getByTestId("primary-test");
|
@@ -23,7 +23,8 @@
|
|
23
23
|
type: "home",
|
24
24
|
dark: object.dark,
|
25
25
|
classname: "home-hashtag",
|
26
|
-
new_window: object.new_window
|
26
|
+
new_window: object.new_window,
|
27
|
+
target: object.target_option}) %>
|
27
28
|
<% end %>
|
28
29
|
|
29
30
|
<%= pb_rails "body", props: { color: "light", tag: "span", dark: object.dark } do %>
|
@@ -10,9 +10,20 @@ module Playbook
|
|
10
10
|
prop :home_url
|
11
11
|
prop :new_window, type: Playbook::Props::Boolean,
|
12
12
|
default: false
|
13
|
+
prop :target
|
13
14
|
prop :territory
|
14
15
|
prop :dark, type: Playbook::Props::Boolean,
|
15
16
|
default: false
|
17
|
+
|
18
|
+
def target_option
|
19
|
+
if target && home_url
|
20
|
+
target
|
21
|
+
elsif new_window
|
22
|
+
"_blank"
|
23
|
+
else
|
24
|
+
"_self"
|
25
|
+
end
|
26
|
+
end
|
16
27
|
end
|
17
28
|
end
|
18
29
|
end
|