playbook_ui 14.19.0.pre.alpha.PLAY2033atactionbarrails7751 → 14.19.0.pre.alpha.PLAY2145fixhtmloptionsstyle7775

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.
@@ -81,6 +81,11 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
81
81
 
82
82
  const formatStreetAdr = (address: string): string => preserveCase ? address : titleize(address)
83
83
 
84
+ const uppercaseState = state?.toUpperCase() ?? ''
85
+
86
+ const fields = [address, addressCont, city, homeId, homeUrl, houseStyle, state, territory, zipcode]
87
+ const hasAllEmptyProps = fields.every(field => field === undefined || field === null || field === '')
88
+
84
89
  return (
85
90
  <div
86
91
  className={classes(className, dark)}
@@ -88,7 +93,8 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
88
93
  {...dataProps}
89
94
  {...htmlProps}
90
95
  >
91
- {emphasis == 'street' &&
96
+ {hasAllEmptyProps && ''}
97
+ {emphasis == 'street' && !hasAllEmptyProps &&
92
98
  <div>
93
99
  <Title
94
100
  className="pb_home_address_street_address"
@@ -105,11 +111,11 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
105
111
  {titleize(addressCont)}
106
112
  </Title>
107
113
  <Body color="light">
108
- {`${titleize(city)}, ${state.toUpperCase()} ${zipcode}`}
114
+ {`${city ? `${titleize(city)}, ` : ''}${uppercaseState}${zipcode ? ` ${zipcode}` : ''}`}
109
115
  </Body>
110
116
  </div>
111
117
  }
112
- {emphasis == 'city' &&
118
+ {emphasis == 'city' && !hasAllEmptyProps &&
113
119
  <div>
114
120
  <Body color="light">
115
121
  {joinPresent([formatStreetAdr(address), houseStyle], ' · ')}
@@ -122,18 +128,18 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
122
128
  size={4}
123
129
  tag="span"
124
130
  >
125
- {`${titleize(city)}, ${state.toUpperCase()}`}
131
+ {`${city ? `${titleize(city)}, ` : ''}${uppercaseState}`}
126
132
  </Title>
127
133
  <Body
128
134
  color="light"
129
135
  tag="span"
130
136
  >
131
- {` ${zipcode}`}
137
+ {` ${zipcode ?? ''}`}
132
138
  </Body>
133
139
  </div>
134
140
  </div>
135
141
  }
136
- {emphasis == 'none' &&
142
+ {emphasis == 'none' && !hasAllEmptyProps &&
137
143
  <div>
138
144
  <Body dark={dark}>
139
145
  {joinPresent([formatStreetAdr(address), houseStyle], ' · ')}
@@ -144,7 +150,7 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
144
150
  color="light"
145
151
  dark={dark}
146
152
  >
147
- {`${titleize(city)}, ${state.toUpperCase()} ${zipcode}`}
153
+ {`${city ? `${titleize(city)}, ` : ''}${uppercaseState}${zipcode ? ` ${zipcode}` : ''}`}
148
154
  </Body>
149
155
  </div>
150
156
  </div>
@@ -41,6 +41,16 @@ const Person = (props: PersonProps): React.ReactElement => {
41
41
  className
42
42
  )
43
43
 
44
+ const hasAllEmptyProps = [firstName, lastName].every(field => field === undefined || field === null || field === '')
45
+
46
+ if (hasAllEmptyProps) {
47
+ return (
48
+ <>
49
+
50
+ </>
51
+ )
52
+ }
53
+
44
54
  return (
45
55
  <div
46
56
  {...ariaProps}
@@ -53,13 +63,13 @@ const Person = (props: PersonProps): React.ReactElement => {
53
63
  className="pb_person_first"
54
64
  tag="span"
55
65
  >
56
- {firstName}
66
+ {firstName ?? ''}
57
67
  </Body>
58
68
  {lastName &&
59
69
  <Title
60
70
  className="pb_person_first"
61
71
  size={4}
62
- text={` ${lastName}`}
72
+ text={lastName ? ` ${lastName}` : ''}
63
73
  />
64
74
  }
65
75
  </div>