@@ -22,7 +22,8 @@ export default {
2222 kind : "primary" ,
2323 size : "md" ,
2424 isExpressive : "false" ,
25- disabled : false
25+ disabled : false ,
26+ autoAlign : false
2627 } ,
2728 argTypes : {
2829 align : {
@@ -41,7 +42,7 @@ export default {
4142 "danger--ghost"
4243 ] ,
4344 control : { type : "select" } ,
44- name : "cdsButton "
45+ name : "kind "
4546 } ,
4647 size : {
4748 options : [ "sm" , "md" , "lg" , "xl" , "2xl" ] ,
@@ -97,3 +98,40 @@ Basic.args = {
9798 "example-global-class" : true
9899 }
99100} ;
101+
102+ const AutoAlignTemplate = ( args ) => ( {
103+ props : args ,
104+ template : `
105+ <div style="height:3000px">
106+ Scrolling will update the position of the tooltip:
107+ <div style="position: absolute; top: 500px; left: 500px;">
108+ <cds-icon-button
109+ buttonId="icon-btn1"
110+ type="button"
111+ [kind]="kind"
112+ [size]="size"
113+ [align]="align"
114+ [autoAlign]="autoAlign"
115+ [isOpen]="isOpen"
116+ [buttonNgClass]="buttonNgClass"
117+ [buttonAttributes]="buttonAttributes"
118+ [disabled]="disabled"
119+ [description]="description"
120+ (click)="onClick($event)"
121+ (mouseenter)="onMouseEnter($event)"
122+ (mouseleave)="onMouseleave($event)"
123+ (focus)="onFocus($event)"
124+ (blur)="onBlur($event)">
125+ <svg class="cds--btn__icon" cdsIcon="copy" size="16"></svg>
126+ </cds-icon-button>
127+ </div>
128+ </div>
129+ `
130+ } ) ;
131+ export const WithAutoAlign = AutoAlignTemplate . bind ( { } ) ;
132+ WithAutoAlign . args = {
133+ autoAlign : true ,
134+ description : "Icon Description" ,
135+ align : "top" ,
136+ isOpen : true
137+ } ;
0 commit comments