2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-chip {
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
background: ${dt('chip.background')};
|
|
|
|
color: ${dt('chip.color')};
|
2024-05-09 18:49:49 +00:00
|
|
|
border-radius: ${dt('chip.border.radius')};
|
|
|
|
padding: ${dt('chip.padding.y')} ${dt('chip.padding.x')};
|
|
|
|
gap: ${dt('chip.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-chip-image {
|
|
|
|
border-radius: 50%;
|
2024-05-09 18:49:49 +00:00
|
|
|
width: ${dt('chip.image.width')};
|
|
|
|
height: ${dt('chip.image.height')};
|
|
|
|
margin-left: calc(-1 * ${dt('chip.padding.y')});
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-chip:has(.p-chip-remove-icon) {
|
2024-05-09 18:49:49 +00:00
|
|
|
padding-right: ${dt('chip.padding.y')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-chip:has(.p-chip-image) {
|
|
|
|
padding-top: calc(${dt('chip.padding.y')} / 2);
|
|
|
|
padding-bottom: calc(${dt('chip.padding.y')} / 2);
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-chip-remove-icon {
|
|
|
|
cursor: pointer;
|
2024-05-09 18:49:49 +00:00
|
|
|
border-radius: ${dt('chip.remove.icon.border.radius')};
|
|
|
|
transition: outline-color ${dt('transition.duration')}, box-shadow-color ${dt('transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
outline-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-chip-remove-icon:focus-visible {
|
2024-05-09 18:49:49 +00:00
|
|
|
box-shadow: ${dt('chip.remove.icon.focus.ring.shadow')};
|
|
|
|
outline: ${dt('chip.remove.icon.focus.ring.width')} ${dt('chip.remove.icon.focus.ring.style')} ${dt('chip.remove.icon.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('chip.remove.icon.focus.ring.offset')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
2024-04-07 21:49:16 +00:00
|
|
|
root: 'p-chip p-component',
|
|
|
|
image: 'p-chip-image',
|
2023-10-02 10:46:09 +00:00
|
|
|
icon: 'p-chip-icon',
|
2024-04-07 21:49:16 +00:00
|
|
|
label: 'p-chip-label',
|
2023-10-02 10:46:09 +00:00
|
|
|
removeIcon: 'p-chip-remove-icon'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'chip',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|