@@ -47,32 +47,34 @@ export const CoachContainer = (
4747 </ div >
4848 ` ,
4949 ) }
50- < div class ="spectrum-CoachMark-header ">
50+ < div class ="spectrum-CoachMark-header " style =${ styleMap ( {
51+ "--mod-popover-width" : "0px" ,
52+ "--mod-popover-height" : "0px" ,
53+ "--mod-popover-wrapper-spacing" : "0px" ,
54+ } ) } >
5155 < div class ="spectrum-CoachMark-title "> ${ title } </ div >
5256 ${ when (
5357 hasActionMenu ,
54- ( ) =>
55- html ` < div class ="spectrum-CoachMark-action-menu ">
56- ${ ActionMenu (
58+ ( ) => ActionMenu (
59+ {
60+ isOpen,
61+ position : "bottom-start" ,
62+ iconName : "More" ,
63+ size : scale === "large" ? "s" : "m" ,
64+ customClasses : [
65+ `${ rootClass } -action-menu`
66+ ] ,
67+ items : [
68+ {
69+ label : "Skip tour" ,
70+ } ,
5771 {
58- isOpen,
59- position : "bottom-start" ,
60- iconName : "More" ,
61- size : scale === "large" ? "s" : "m" ,
62- items : [
63- {
64- label : "Skip tour" ,
65- } ,
66- {
67- label : "Reset tour" ,
68- } ,
69- ] ,
70- popoverHeight : 68 ,
71- popoverWidth : 84 ,
72+ label : "Reset tour" ,
7273 } ,
73- context ,
74- ) }
75- </ div > ` ,
74+ ] ,
75+ } ,
76+ context ,
77+ ) ,
7678 ) }
7779 </ div >
7880 < div class ="spectrum-CoachMark-content ">
@@ -127,29 +129,24 @@ export const CoachContainer = (
127129} ;
128130
129131export const Template = ( args , context ) => {
130- return html `
131- < div
132- class =${ classMap ( {
133- [ args . rootClass ] : true ,
134- ...args . customClasses . reduce ( ( a , c ) => ( { ...a , [ c ] : true } ) , { } ) ,
135- } ) }
136- style =${ styleMap ( args . customStyles ) }
137- >
138- ${ Popover (
139- {
140- customStyles : {
141- "inline-size" : "var(--spectrum-coach-mark-width)" ,
142- } ,
143- customClasses : [ `${ args . rootClass } -popover` ] ,
144- isOpen : true ,
145- position : "right-top" ,
146- trigger : ( passthrough ) => CoachIndicator ( passthrough , context ) ,
147- content : [ CoachContainer ( args , context ) ] ,
148- } ,
149- context ,
150- ) }
151- </ div >
152- ` ;
132+ return Popover (
133+ {
134+ customWrapperClasses : [
135+ args . rootClass ,
136+ ...args ?. customClasses ?? [ ]
137+ ] ,
138+ customStyles : {
139+ ...args ?. customStyles ?? { } ,
140+ "inline-size" : "var(--spectrum-coach-mark-width)" ,
141+ } ,
142+ customClasses : [ `${ args . rootClass } -popover` ] ,
143+ isOpen : true ,
144+ position : "right-top" ,
145+ trigger : ( passthrough ) => CoachIndicator ( passthrough , context ) ,
146+ content : [ CoachContainer ( args , context ) ] ,
147+ } ,
148+ context ,
149+ ) ;
153150} ;
154151
155152/* Displays open and closed action menus in a single story. */
@@ -165,15 +162,7 @@ export const CoachmarkMenuStatesTemplate = (args, context) =>
165162 Container ( {
166163 withBorder : false ,
167164 heading : "With action menu (closed) and media" ,
168- content : Template (
169- {
170- ...args ,
171- customStyles : {
172- "height" : "265px"
173- }
174- } ,
175- context ,
176- ) ,
165+ content : Template ( args , context ) ,
177166 } ) ,
178167 Container ( {
179168 withBorder : false ,
@@ -183,10 +172,7 @@ export const CoachmarkMenuStatesTemplate = (args, context) =>
183172 ...args ,
184173 hasImage : false ,
185174 hasActionMenu : true ,
186- isOpen : true ,
187- customStyles : {
188- "height" : "260px"
189- }
175+ isOpen : true
190176 } ,
191177 context ,
192178 ) ,
0 commit comments