New tokens for RadioButton

pull/5701/head
Cagatay Civici 2024-05-07 11:44:03 +03:00
parent 865b3d2a1f
commit 04c457f3bf
3 changed files with 36 additions and 12 deletions

View File

@ -56,18 +56,18 @@ const theme = ({ dt }) => `
border-color: ${dt('radiobutton.hover.border.color')}; border-color: ${dt('radiobutton.hover.border.color')};
} }
.p-radiobutton.p-radiobutton-checked .p-radiobutton-box { .p-radiobutton-checked .p-radiobutton-box {
border-color: ${dt('radiobutton.checked.border.color')}; border-color: ${dt('radiobutton.checked.border.color')};
background: ${dt('radiobutton.checked.background')}; background: ${dt('radiobutton.checked.background')};
} }
.p-radiobutton.p-radiobutton-checked .p-radiobutton-box .p-radiobutton-icon { .p-radiobutton-checked .p-radiobutton-box .p-radiobutton-icon {
background: ${dt('radiobutton.icon.checked.color')}; background: ${dt('radiobutton.icon.checked.color')};
transform: translateZ(0) scale(1, 1); transform: translateZ(0) scale(1, 1);
visibility: visible; visibility: visible;
} }
.p-radiobutton:not(.p-disabled):has(.p-radiobutton-input:hover).p-radiobutton-checked .p-radiobutton-box { .p-radiobutton-checked:not(.p-disabled):has(.p-radiobutton-input:hover) .p-radiobutton-box {
border-color: ${dt('radiobutton.checked.hover.border.color')}; border-color: ${dt('radiobutton.checked.hover.border.color')};
background: ${dt('radiobutton.checked.hover.background')}; background: ${dt('radiobutton.checked.hover.background')};
} }
@ -77,8 +77,14 @@ const theme = ({ dt }) => `
} }
.p-radiobutton:not(.p-disabled):has(.p-radiobutton-input:focus-visible) .p-radiobutton-box { .p-radiobutton:not(.p-disabled):has(.p-radiobutton-input:focus-visible) .p-radiobutton-box {
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')}; border-color: ${dt('radiobutton.focus.border.color')};
outline-offset: ${dt('focus.ring.offset')}; box-shadow: ${dt('radiobutton.focus.ring.shadow')};
outline: ${dt('radiobutton.focus.ring.width')} ${dt('radiobutton.focus.ring.style')} ${dt('radiobutton.focus.ring.color')};
outline-offset: ${dt('radiobutton.focus.ring.offset')};
}
.p-radiobutton-checked:not(.p-disabled):has(.p-radiobutton-input:focus-visible) .p-radiobutton-box {
border-color: ${dt('radiobutton.checked.focus.border.color')};
} }
.p-radiobutton.p-invalid > .p-radiobutton-box { .p-radiobutton.p-invalid > .p-radiobutton-box {

View File

@ -8,11 +8,20 @@ export default {
disabledBackground: '{form.field.disabled.background}', disabledBackground: '{form.field.disabled.background}',
filledBackground: '{form.field.filled.background}', filledBackground: '{form.field.filled.background}',
borderColor: '{form.field.border.color}', borderColor: '{form.field.border.color}',
hoverBordercolor: '{form.field.hover.border.color}', hoverBorderColor: '{form.field.hover.border.color}',
focusBorderColor: '{form.field.border.color}',
checkedBorderColor: '{primary.color}', checkedBorderColor: '{primary.color}',
checkedHoverBorderColor: '{primary.hover.color}', checkedHoverBorderColor: '{primary.hover.color}',
checkedFocusBorderColor: '{primary.color}',
invalidBorderColor: '{form.field.invalid.border.color}', invalidBorderColor: '{form.field.invalid.border.color}',
shadow: '{form.field.shadow}' shadow: '{form.field.shadow}',
focusRing: {
width: '{focus.ring.width}',
style: '{focus.ring.style}',
color: '{focus.ring.color}',
offset: '{focus.ring.offset}',
shadow: '{focus.ring.shadow}'
}
}, },
icon: { icon: {
size: '0.75rem', size: '0.75rem',

View File

@ -1,21 +1,30 @@
export default { export default {
root: { root: {
width: '1.25rem', width: '1.5rem',
height: '1.25rem', height: '1.5rem',
background: '{form.field.background}', background: '{form.field.background}',
checkedBackground: '{primary.color}', checkedBackground: '{primary.color}',
checkedHoverBackground: '{primary.hover.color}', checkedHoverBackground: '{primary.hover.color}',
disabledBackground: '{form.field.disabled.background}', disabledBackground: '{form.field.disabled.background}',
filledBackground: '{form.field.filled.background}', filledBackground: '{form.field.filled.background}',
borderColor: '{form.field.border.color}', borderColor: '{form.field.border.color}',
hoverBordercolor: '{form.field.hover.border.color}', hoverBorderColor: '{form.field.hover.border.color}',
focusBorderColor: '{form.field.focus.border.color}',
checkedBorderColor: '{primary.color}', checkedBorderColor: '{primary.color}',
checkedHoverBorderColor: '{primary.hover.color}', checkedHoverBorderColor: '{primary.hover.color}',
checkedFocusBorderColor: '{primary.color}',
invalidBorderColor: '{form.field.invalid.border.color}', invalidBorderColor: '{form.field.invalid.border.color}',
shadow: '{form.field.shadow}' shadow: '{form.field.shadow}',
focusRing: {
width: '{form.field.focus.ring.width}',
style: '{form.field.focus.ring.style}',
color: '{form.field.focus.ring.color}',
offset: '{form.field.focus.ring.offset}',
shadow: '{form.field.focus.ring.shadow}'
}
}, },
icon: { icon: {
size: '0.75rem', size: '1rem',
checkedColor: '{primary.inverse.color}', checkedColor: '{primary.inverse.color}',
checkedHoverColor: '{primary.inverse.color}', checkedHoverColor: '{primary.inverse.color}',
disabledColor: '{form.field.disabled.color}' disabledColor: '{form.field.disabled.color}'