File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { useEventCallback } from './hooks';
1515 */
1616export type PillProps = {
1717 label ?: string ;
18+ fullLabel ?: string ;
1819 truncate ?: boolean ;
1920 disabled ?: boolean ;
2021 icon ?: {
@@ -33,6 +34,7 @@ export const Pill: FC<PillProps> = (props) => {
3334 icon,
3435 disabled,
3536 label,
37+ fullLabel,
3638 truncate,
3739 className,
3840 pillRef,
@@ -56,6 +58,7 @@ export const Pill: FC<PillProps> = (props) => {
5658
5759 const pillClassNames = classnames (
5860 'slds-pill' ,
61+ { 'slds-pill_link' : ! disabled } ,
5962 { 'slds-truncate' : truncate } ,
6063 className
6164 ) ;
@@ -73,7 +76,15 @@ export const Pill: FC<PillProps> = (props) => {
7376 icon = { icon . icon }
7477 />
7578 ) : undefined }
76- < span className = 'slds-pill__label' > { label } </ span >
79+ { disabled ? (
80+ < span className = 'slds-pill__label' title = { fullLabel } >
81+ { label }
82+ </ span >
83+ ) : (
84+ < a className = 'slds-pill__action' title = { fullLabel } >
85+ < span className = 'slds-pill__label' > { label } </ span >
86+ </ a >
87+ ) }
7788 < Button
7889 disabled = { disabled }
7990 className = 'slds-pill__remove'
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export const ControlledWithKnobs: ComponentStoryObj<typeof Pill> = {
2222 name : 'Controlled with knobs' ,
2323 args : {
2424 label : 'Pill Label' ,
25+ fullLabel : 'Full Label of the Pill' ,
2526 } ,
2627 parameters : {
2728 info : 'Pill controlled with knobs' ,
You can’t perform that action at this time.
0 commit comments