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-fieldset {
|
|
|
|
background: ${dt('fieldset.background')};
|
|
|
|
border: 1px solid ${dt('fieldset.border.color')};
|
2024-05-06 21:18:22 +00:00
|
|
|
border-radius: ${dt('border.radius.md')};
|
2024-05-01 08:26:48 +00:00
|
|
|
color: ${dt('fieldset.color')};
|
|
|
|
padding: 0 1.125rem 1.125rem 1.125rem;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fieldset-legend {
|
2024-05-04 11:47:06 +00:00
|
|
|
background: ${dt('fieldset.legend.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
border-radius: 6px;
|
|
|
|
border: 0 none;
|
|
|
|
padding: 0.5rem 0.75rem;
|
|
|
|
margin-bottom: 0.375rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fieldset-toggleable > .p-fieldset-legend {
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
|
2024-05-10 09:47:23 +00:00
|
|
|
.p-fieldset-toggleable > .p-fieldset-legend > button {
|
2024-05-01 08:26:48 +00:00
|
|
|
cursor: pointer;
|
|
|
|
user-select: none;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
text-decoration: none;
|
|
|
|
display: flex;
|
|
|
|
gap: 0.5rem;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
padding: 0.5rem 0.75rem;
|
2024-05-10 09:47:23 +00:00
|
|
|
background: transparent;
|
2024-05-01 08:26:48 +00:00
|
|
|
color: ${dt('fieldset.legend.color')};
|
2024-05-10 09:47:23 +00:00
|
|
|
border: 0 none;
|
2024-05-06 21:18:22 +00:00
|
|
|
border-radius: ${dt('border.radius.md')};
|
2024-05-01 08:26:48 +00:00
|
|
|
transition: background ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
|
|
|
|
outline-color: transparent;
|
|
|
|
}
|
|
|
|
|
2024-05-10 09:47:23 +00:00
|
|
|
.p-fieldset-legend-label {
|
|
|
|
font-weight: 600;
|
|
|
|
}
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-fieldset-toggleable > .p-fieldset-legend > a:focus-visible {
|
|
|
|
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')};
|
|
|
|
outline-offset: ${dt('focus.ring.offset')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fieldset-toggleable > .p-fieldset-legend > a:hover {
|
|
|
|
color: ${dt('fieldset.legend.hover.color')};
|
|
|
|
background: ${dt('fieldset.legend.hover.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fieldset-toggle-icon {
|
|
|
|
color: ${dt('fieldset.toggle.icon.color')};
|
|
|
|
transition: color ${dt('transition.duration')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fieldset-toggleable > .p-fieldset-legend > a:hover > .p-fieldset-toggle-icon {
|
|
|
|
color: ${dt('fieldset.toggle.icon.hover.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fieldset .p-fieldset-content {
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: ({ props }) => [
|
|
|
|
'p-fieldset p-component',
|
|
|
|
{
|
|
|
|
'p-fieldset-toggleable': props.toggleable
|
|
|
|
}
|
|
|
|
],
|
|
|
|
legend: 'p-fieldset-legend',
|
2024-04-30 14:09:06 +00:00
|
|
|
legendLabel: 'p-fieldset-legend-label',
|
|
|
|
toggleIcon: 'p-fieldset-toggle-icon',
|
|
|
|
contentContainer: 'p-fieldset-content-container',
|
2023-10-02 10:46:09 +00:00
|
|
|
content: 'p-fieldset-content'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'fieldset',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|