File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { property } from 'lit/decorators.js';
44import { UUIButtonElement } from '@umbraco-ui/uui-button/lib' ;
55import { UUICopyEvent } from './UUICopyEvent' ;
66import { demandCustomElement } from '@umbraco-ui/uui-base/lib/utils' ;
7+ import { LabelMixin } from '@umbraco-ui/uui-base' ;
78
89/**
910 * @summary A button to trigger text content to be copied to the clipboard
@@ -15,7 +16,7 @@ import { demandCustomElement } from '@umbraco-ui/uui-base/lib/utils';
1516 * @slot - Use to replace the default content of 'Copy' and the copy icon
1617 */
1718@defineElement ( 'uui-copy' )
18- export class UUICopyElement extends LitElement {
19+ export class UUICopyElement extends LabelMixin ( '' , LitElement ) {
1920 /**
2021 * Set a string you wish to copy to the clipboard
2122 * @type {string }
@@ -30,7 +31,7 @@ export class UUICopyElement extends LitElement {
3031 * @attr
3132 * @default false
3233 */
33- @property ( { type : Boolean , reflect : true } )
34+ @property ( { type : Boolean } )
3435 disabled = false ;
3536
3637 /**
@@ -144,6 +145,7 @@ export class UUICopyElement extends LitElement {
144145 .look = ${ this . look }
145146 .disabled = ${ this . disabled }
146147 .compact = ${ this . compact }
148+ .label = ${ this . label }
147149 @click = ${ this . #onClick} >
148150 <slot> <uui- icon name= "copy" > </ uui- icon> Copy </ slot>
149151 </ uui- butto n> ` ;
Original file line number Diff line number Diff line change @@ -35,6 +35,22 @@ export const Overview: Story = {
3535 } ,
3636} ;
3737
38+ export const WithLabelSet : Story = {
39+ name : 'Simple Copy with an A11y Label set' ,
40+ args : {
41+ value : 'Hey stop copying me 🥸' ,
42+ disabled : false ,
43+ label : 'This is my A11y label I want' ,
44+ } ,
45+ parameters : {
46+ docs : {
47+ source : {
48+ code : `<uui-copy value="Hey stop copying me 🥸" label="This is my A11y label I want"></uui-copy>` ,
49+ } ,
50+ } ,
51+ } ,
52+ } ;
53+
3854export const Disabled : Story = {
3955 name : 'Disabled State' ,
4056 args : {
You can’t perform that action at this time.
0 commit comments