@@ -4,10 +4,11 @@ import { withLitHtml, html } from '@bolt/core/renderers/renderer-lit-html';
4
4
import { convertInitialTags } from '@bolt/core/decorators' ;
5
5
import classNames from 'classnames/bind' ;
6
6
import styles from './blockquote.scss' ;
7
+ import textStyles from '@bolt/components-text/index.scss' ;
7
8
import schema from '../blockquote.schema.yml' ;
8
9
import { AuthorImage , AuthorName , AuthorTitle } from './Author' ;
9
10
10
- let cx = classNames . bind ( styles ) ;
11
+ let cx = classNames . bind ( [ styles , textStyles ] ) ;
11
12
12
13
@define
13
14
@convertInitialTags ( 'blockquote' ) // The first matching tag will have its attributes converted to component props
@@ -37,7 +38,10 @@ class BoltBlockquote extends withLitHtml() {
37
38
super . rendered && super . rendered ( ) ;
38
39
const self = this ;
39
40
40
- if ( window . MutationObserver ) {
41
+ // @todo : I've added this.useShadow here to exclude IE.
42
+ // In IE-only this mutation callback causes multiple re-renders
43
+ // and causes component to disappear.
44
+ if ( window . MutationObserver && this . useShadow ) {
41
45
// Re-generate slots + re-render when mutations are observed
42
46
const mutationCallback = function ( mutationsList , observer ) {
43
47
self . slots = self . _checkSlots ( ) ;
@@ -164,8 +168,23 @@ class BoltBlockquote extends withLitHtml() {
164
168
165
169
this . addClassesToSlottedChildren ( ) ;
166
170
171
+ const textClasses = cx (
172
+ 'c-bolt-text-v2' ,
173
+ 'c-bolt-text-v2--block' ,
174
+ 'c-bolt-text-v2--body' ,
175
+ 'c-bolt-text-v2--font-size-xlarge' ,
176
+ 'c-bolt-text-v2--font-weight-semibold' ,
177
+ 'c-bolt-text-v2--font-style-regular' ,
178
+ 'c-bolt-text-v2--color-theme-headline' ,
179
+ 'c-bolt-text-v2--letter-spacing-regular' ,
180
+ 'c-bolt-text-v2--align-inherit' ,
181
+ 'c-bolt-text-v2--text-transform-regular' ,
182
+ 'c-bolt-text-v2--line-height-regular' ,
183
+ 'c-bolt-text-v2--opacity-100' ,
184
+ ) ;
185
+
167
186
return html `
168
- ${ this . addStyles ( [ styles ] ) }
187
+ ${ this . addStyles ( [ styles , textStyles ] ) }
169
188
< blockquote class ="${ classes } " is ="shadow-root ">
170
189
${ this . slots . logo
171
190
? html `
@@ -175,14 +194,9 @@ class BoltBlockquote extends withLitHtml() {
175
194
`
176
195
: '' }
177
196
< div class ="${ cx ( 'c-bolt-blockquote__quote' ) } ">
178
- < bolt-text
179
- tag ="div "
180
- font-size ="${ size } "
181
- font-weight ="semibold "
182
- color ="theme-headline "
183
- >
197
+ < div class ="${ textClasses } ">
184
198
${ this . slot ( 'default' ) }
185
- </ bolt-text >
199
+ </ div >
186
200
</ div >
187
201
${ footerItems . length > 0
188
202
? html `
@@ -203,3 +217,41 @@ class BoltBlockquote extends withLitHtml() {
203
217
}
204
218
205
219
export { BoltBlockquote } ;
220
+
221
+ // @todo : Original return statement - backing this out until `bolt-text` is ready for release
222
+ // return html`
223
+ // ${this.addStyles([styles])}
224
+ // <blockquote class="${classes}" is="shadow-root">
225
+ // ${this.slots.logo
226
+ // ? html`
227
+ // <div class="${cx('c-bolt-blockquote__logo')}">
228
+ // ${this.slot('logo')}
229
+ // </div>
230
+ // `
231
+ // : '' }
232
+ // <div class="${cx('c-bolt-blockquote__quote')}">
233
+ // <bolt-text
234
+ // tag="div"
235
+ // font-size="${size}"
236
+ // font-weight="semibold"
237
+ // color="theme-headline"
238
+ // >
239
+ // ${this.slot('default')}
240
+ // </bolt-text>
241
+ // </div>
242
+ // ${footerItems.length > 0
243
+ // ? html`
244
+ // <footer class="${cx('c-bolt-blockquote__footer')}">
245
+ // ${footerItems.map(
246
+ // footerItem => html`
247
+ // <div class="${cx('c-bolt-blockquote__footer-item')}">
248
+ // ${footerItem}
249
+ // </div>
250
+ // `,
251
+ // )}
252
+ // </footer>
253
+ // `
254
+ // : '' }
255
+ // </blockquote>
256
+ // `;
257
+ // }
0 commit comments