File tree Expand file tree Collapse file tree 7 files changed +96
-26
lines changed
docs-site/src/pages/pattern-lab/_patterns/04-pages/99999-bolt-dev-sandbox/interactive-pathway-fragments
packages/components/bolt-interactive-step Expand file tree Collapse file tree 7 files changed +96
-26
lines changed Original file line number Diff line number Diff line change 19
19
character-left-url =" https://github.com/basaltinc/temp-pega-dummy-assets/raw/master/customer-neutral.png"
20
20
character-right-url =" https://github.com/basaltinc/temp-pega-dummy-assets/raw/master/pega-rep.png"
21
21
>
22
+ <span slot =" connection" >
23
+ <bolt -connection
24
+ connection-url =" https://github.com/basaltinc/temp-pega-dummy-assets/raw/master/animated-bands-ltr.png"
25
+ >
26
+ <span slot =" top" >
27
+ <bolt -text >Top slot</bolt -text >
28
+ </span >
29
+ <span slot =" bottom" >
30
+ <bolt -text >Bottom slot</bolt -text >
31
+ </span >
32
+ </bolt -connection >
33
+ </span >
22
34
</bolt -two-character-chat >
23
35
</span >
24
36
<bolt -text tag =" p" style =" margin-bottom: 0;" slot =" dialogue" ><span style =" color: black;" >Why is my bill so high?</span ></bolt -text >
Original file line number Diff line number Diff line change @@ -7,4 +7,7 @@ polyfillLoader.then(res => {
7
7
import (
8
8
/* webpackMode: 'eager', webpackChunkName: 'bolt-two-character-chat' */ './src/two-character-chat'
9
9
) ;
10
+ import (
11
+ /* webpackMode: 'eager', webpackChunkName: 'bolt-connection' */ './src/connection'
12
+ ) ;
10
13
} ) ;
Original file line number Diff line number Diff line change
1
+ import { props , define , hasNativeShadowDomSupport } from '@bolt/core/utils' ;
2
+ import { withLitHtml , html } from '@bolt/core' ;
3
+ import classNames from 'classnames/bind' ;
4
+ import styles from './connection.scss' ;
5
+
6
+ let cx = classNames . bind ( styles ) ;
7
+
8
+ @define
9
+ class BoltTwoCharacterChat extends withLitHtml ( ) {
10
+ static is = 'bolt-connection' ;
11
+
12
+ static props = {
13
+ noShadow : {
14
+ ...props . boolean ,
15
+ ...{ default : false } ,
16
+ } ,
17
+ connectionUrl : {
18
+ ...props . string ,
19
+ ...{
20
+ default :
21
+ 'https://github.com/basaltinc/temp-pega-dummy-assets/raw/master/animated-bands-ltr.png' ,
22
+ } ,
23
+ } ,
24
+ } ;
25
+
26
+ // https://github.com/WebReflection/document-register-element#upgrading-the-constructor-context
27
+ constructor ( self ) {
28
+ self = super ( self ) ;
29
+ self . useShadow = hasNativeShadowDomSupport ;
30
+ return self ;
31
+ }
32
+
33
+ render ( ) {
34
+ const {
35
+ connectionUrl,
36
+ } = this . validateProps ( this . props ) ;
37
+ const classes = cx ( 'c-bolt-connection' ) ;
38
+
39
+ return html `
40
+ ${ this . addStyles ( [ styles ] ) }
41
+ < div class ="${ classes } " is ="shadow-root ">
42
+ < span class ="c-bolt-connection__top-slot ">
43
+ ${ this . slot ( 'top' ) }
44
+ </ span >
45
+ < img
46
+ class ="c-bolt-connection__main-image "
47
+ src ="${ connectionUrl } "
48
+ alt ="Connection Band "
49
+ />
50
+ < span class ="c-bolt-connection__bottom-slot ">
51
+ ${ this . slot ( 'bottom' ) }
52
+ </ span >
53
+ </ div >
54
+ ` ;
55
+ }
56
+ }
57
+
58
+ export { BoltTwoCharacterChat } ;
Original file line number Diff line number Diff line change
1
+ .c-bolt-connection {
2
+ display : flex ;
3
+ justify-content : center ;
4
+ align-items : center ;
5
+ flex-direction : column ;
6
+ position : relative ;
7
+
8
+ & __main-image {
9
+ // @todo Height will probably need to be exposed as an adjustable field to match the various sizes of the character elements
10
+ width : 350px ;
11
+ height : 60px ;
12
+ }
13
+
14
+ & __top-slot {
15
+ margin-bottom : 10px ;
16
+ }
17
+
18
+ & __bottom-slot {
19
+ margin-top : 10px ;
20
+ }
21
+ }
Original file line number Diff line number Diff line change @@ -27,18 +27,6 @@ class BoltInteractiveStep extends withLitHtml() {
27
27
...props . boolean ,
28
28
...{ default : false } ,
29
29
} ,
30
- hideInteractionAnimations : {
31
- ...props . boolean ,
32
- ...{ default : false } ,
33
- } ,
34
- customerDisposition : {
35
- ...props . string ,
36
- ...{ default : 'happy' } ,
37
- } ,
38
- speakerPosition : {
39
- ...props . string ,
40
- ...{ default : 'left' } ,
41
- } ,
42
30
} ;
43
31
44
32
// https://github.com/WebReflection/document-register-element#upgrading-the-constructor-context
@@ -49,13 +37,11 @@ class BoltInteractiveStep extends withLitHtml() {
49
37
}
50
38
51
39
render ( ) {
52
- const { step, customerDisposition } = this ;
53
40
// validate the original prop data passed along -- returns back the validated data w/ added default values
54
41
const {
55
42
disabled,
56
43
active,
57
- hideInteractionAnimations,
58
- speakerPosition,
44
+ step,
59
45
} = this . validateProps ( this . props ) ;
60
46
61
47
const classes = cx ( 'c-bolt-interactive-step' , {
Original file line number Diff line number Diff line change @@ -68,11 +68,7 @@ class BoltTwoCharacterChat extends withLitHtml() {
68
68
src ="${ characterLeftUrl } "
69
69
alt ="Character on the left "
70
70
/>
71
- < img
72
- class ="c-bolt-two-character-chat__connection "
73
- src ="${ connectionUrl } "
74
- alt ="Connection Band "
75
- />
71
+ ${ this . slot ( 'connection' ) }
76
72
< img
77
73
class ="c-bolt-two-character-chat__character c-bolt-two-character-chat__character--right "
78
74
src ="${ characterRightUrl } "
Original file line number Diff line number Diff line change 20
20
transform : translateX (-50% );
21
21
}
22
22
}
23
-
24
- & __connection {
25
- // @todo Height will probably need to be exposed as an adjustable field to match the various sizes of the character elements
26
- width : 350px ;
27
- height : 60px ;
28
- }
29
23
}
You can’t perform that action at this time.
0 commit comments