playbook_ui 14.10.0.pre.rc.19 → 14.10.0.pre.rc.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0db00405bd73a7d733f9dcb81f68c86dab5104053480460df1bb4cd662f64cc4
4
- data.tar.gz: 62318e1c0f631c6c9a233def0d6c114997b564bdbf4fcf4231f9009b746d3550
3
+ metadata.gz: 8004b611a0e7ed5891628daf08be8b7560b22d0faa48631442fc94116f6fba30
4
+ data.tar.gz: 5e7b1d10c69dc6148f1778ea2d9c912cc220d199a54db0d9f9179c75ba5bfdd2
5
5
  SHA512:
6
- metadata.gz: 5db0081e5de8ef6e228810d22f313d64a722752fc1f74b5a37d0a8720be182b8b4d589c5198e90fa536dd5939bc0aeac676de1e48fe8f4ae9013ddb646a70202
7
- data.tar.gz: 8d5ab849f68bdc5361c07d06f055d0760ea41bbf8792ab85e4732e085ad79ecb28b1c3229ed9cd2d4ec6876b0e808059aa404dd7559a567c25177cc92e469ce8
6
+ metadata.gz: 79e6cc10512af3e174eb5a6e11b9b638c63af121d7c9a398aaae6086e083bd3569dbcd2ab11dc0f436858a3c4c2aefe2d7677252c8cff64d5f60b75c211e4281
7
+ data.tar.gz: 2405a386d65dc6880cc5ffb3dc835a7556caa55ce59eea569cf42205a6f090d1f9ad413fc29b52c210fef9e7d51c0d84e19aaf8eec7215746f1d847086ea08e9
@@ -18,7 +18,7 @@ type HomeAddressStreetProps = {
18
18
  className?: string,
19
19
  data?: { [key: string]: string },
20
20
  dark?: boolean,
21
- emphasis: "street" | "city",
21
+ emphasis: "street" | "city" | "none",
22
22
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
23
23
  homeId: string,
24
24
  houseStyle: string,
@@ -129,6 +129,22 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
129
129
  </div>
130
130
  </div>
131
131
  }
132
+ {emphasis == 'none' &&
133
+ <div>
134
+ <Body dark={dark}>
135
+ {joinPresent([titleize(address), houseStyle], ' · ')}
136
+ </Body>
137
+ <Body dark={dark}>{titleize(addressCont)}</Body>
138
+ <div>
139
+ <Body
140
+ color="light"
141
+ dark={dark}
142
+ >
143
+ {`${titleize(city)}, ${state} ${zipcode}`}
144
+ </Body>
145
+ </div>
146
+ </div>
147
+ }
132
148
  {homeId &&
133
149
  <Hashtag
134
150
  classname="home-hashtag"
@@ -24,4 +24,20 @@
24
24
  state: "PA",
25
25
  zipcode: "19382",
26
26
  territory: "PHL",
27
- }) %>
27
+ }) %>
28
+
29
+ <br>
30
+ <br>
31
+
32
+ <%= pb_rails("home_address_street", props: {
33
+ address: "70 Prospect Ave",
34
+ address_cont: "Apt M18",
35
+ city: "West Chester",
36
+ emphasis: "none",
37
+ home_id: 8250263,
38
+ home_url: "https://powerhrg.com/",
39
+ house_style: "Colonial",
40
+ state: "PA",
41
+ zipcode: "19382",
42
+ territory: "PHL",
43
+ }) %>
@@ -32,6 +32,21 @@ const HomeAddressStreetEmphasis = (props) => {
32
32
  zipcode="19382"
33
33
  {...props}
34
34
  />
35
+ <br />
36
+ <br />
37
+ <HomeAddressStreet
38
+ address="70 Prospect Ave"
39
+ addressCont="Apt M18"
40
+ city="West Chester"
41
+ emphasis="none"
42
+ homeId="8250263"
43
+ homeUrl="https://powerhrg.com/"
44
+ houseStyle="Colonial"
45
+ state="PA"
46
+ territory="PHL"
47
+ zipcode="19382"
48
+ {...props}
49
+ />
35
50
  </div>
36
51
  )
37
52
  }
@@ -1,2 +1,3 @@
1
1
  Emphasis on street happens by default. (no prop needed)
2
- Emphasis on "city" makes the city emphasized, rather than the street.
2
+ Emphasis on "city" makes the city emphasized, rather than the street.
3
+ Adding "none" to emphasis prop will provide no emphasis.
@@ -7,7 +7,7 @@ module Playbook
7
7
  prop :address_cont
8
8
  prop :city
9
9
  prop :emphasis, type: Playbook::Props::Enum,
10
- values: %w[street city],
10
+ values: %w[street city none],
11
11
  default: "street"
12
12
  prop :home_id, type: Playbook::Props::Number
13
13
  prop :home_url
@@ -77,6 +77,20 @@ module Playbook
77
77
  }
78
78
  end
79
79
 
80
+ def none_emphasis_props
81
+ {
82
+ address_house_style: address_house_style,
83
+ address_house_style2: address_house_style2,
84
+ city_state_zip: city_state_zip,
85
+ dark: dark,
86
+ home_id: home_id,
87
+ home_url: home_url,
88
+ target: target_option,
89
+ new_window: new_window,
90
+ territory: territory,
91
+ }
92
+ end
93
+
80
94
  def target_option
81
95
  if target && home_url
82
96
  target
@@ -0,0 +1,32 @@
1
+ <%= pb_rails "body", props: {
2
+ classname: "pb_home_address_street_address",
3
+ size: 4,
4
+ text: object.address_house_style,
5
+ dark: object.dark
6
+ } %>
7
+ <%= pb_rails "body", props: {
8
+ classname: "pb_home_address_street_address",
9
+ size: 4,
10
+ text: object.address_house_style2,
11
+ dark: object.dark
12
+ } %>
13
+ <%= pb_rails "body", props: {
14
+ color: "light",
15
+ text: object.city_state_zip,
16
+ dark: object.dark
17
+ } %>
18
+
19
+ <% if object.home_id %>
20
+ <%= pb_rails("hashtag", props: {
21
+ text: "#{object.home_id}",
22
+ url: object.home_url || "#",
23
+ type: "home",
24
+ dark: object.dark,
25
+ classname: "home-hashtag",
26
+ new_window: object.new_window,
27
+ target: object.target_option}) %>
28
+ <% end %>
29
+
30
+ <%= pb_rails "body", props: { color: "light", tag: "span", dark: object.dark } do %>
31
+ <small><%= object.territory %></small>
32
+ <% end %>
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbHomeAddressStreet
5
+ class NoneEmphasis < Playbook::KitBase
6
+ prop :address_house_style
7
+ prop :address_house_style2
8
+ prop :city_state_zip
9
+ prop :home_id, type: Playbook::Props::Number
10
+ prop :home_url
11
+ prop :new_window, type: Playbook::Props::Boolean,
12
+ default: false
13
+ prop :target
14
+ prop :territory
15
+ prop :dark, type: Playbook::Props::Boolean,
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
27
+ end
28
+ end
29
+ end