1
- import { props , define , hasNativeShadowDomSupport } from '@bolt/core/utils' ;
1
+ import {
2
+ props ,
3
+ define ,
4
+ hasNativeShadowDomSupport ,
5
+ withContext ,
6
+ } from '@bolt/core/utils' ;
2
7
import { withLitHtml , html , convertSchemaToProps } from '@bolt/core' ;
3
8
import { triggerAnims } from '@bolt/components-animate/utils' ;
4
9
import classNames from 'classnames/bind' ;
10
+ import { BoltInteractivePathwaysContext } from './interactive-pathways' ;
5
11
import styles from './interactive-step.scss' ;
6
12
import schema from './interactive-step.schema' ;
7
13
8
14
const cx = classNames . bind ( styles ) ;
9
15
10
16
@define
11
- class BoltInteractiveStep extends withLitHtml ( ) {
17
+ class BoltInteractiveStep extends withContext ( withLitHtml ( ) ) {
12
18
static is = 'bolt-interactive-step' ;
13
19
14
20
static props = {
@@ -19,6 +25,10 @@ class BoltInteractiveStep extends withLitHtml() {
19
25
...convertSchemaToProps ( schema ) ,
20
26
} ;
21
27
28
+ static get consumes ( ) {
29
+ return [ [ BoltInteractivePathwaysContext , 'theme' ] ] ;
30
+ }
31
+
22
32
// https://github.com/WebReflection/document-register-element#upgrading-the-constructor-context
23
33
constructor ( self ) {
24
34
self = super ( self ) ;
@@ -122,6 +132,7 @@ class BoltInteractiveStep extends withLitHtml() {
122
132
render ( ) {
123
133
// validate the original prop data passed along -- returns back the validated data w/ added default values
124
134
const { tabTitle } = this . validateProps ( this . props ) ;
135
+ this . theme = this . context . theme ;
125
136
const isLastStep = ! (
126
137
this . nextElementSibling &&
127
138
this . nextElementSibling . tagName . toLowerCase ( ) === 'bolt-interactive-step'
@@ -136,6 +147,7 @@ class BoltInteractiveStep extends withLitHtml() {
136
147
[ `c-bolt-interactive-step--active` ] : this . _isActiveStep ,
137
148
[ `c-bolt-interactive-step--first` ] : isFirstStep ,
138
149
[ `c-bolt-interactive-step--last` ] : isLastStep ,
150
+ [ `t-bolt-${ this . theme } ` ] : this . theme ,
139
151
} ) ;
140
152
141
153
const titleClasses = cx ( 'c-bolt-interactive-step__title' ) ;
0 commit comments