Refactored MultiSelect

pull/5701/head
Cagatay Civici 2024-05-05 20:10:37 +03:00
parent 18283c10fa
commit feec112a2a
2 changed files with 33 additions and 63 deletions

View File

@ -46,7 +46,7 @@ const theme = ({ dt }) => `
justify-content: center; justify-content: center;
flex-shrink: 0; flex-shrink: 0;
background: transparent; background: transparent;
color: ${dt('multiselect.toggle.color')}; color: ${dt('multiselect.dropdown.color')};
width: 2.5rem; width: 2.5rem;
border-top-right-radius: ${dt('rounded.base')}; border-top-right-radius: ${dt('rounded.base')};
border-bottom-right-radius: ${dt('rounded.base')}; border-bottom-right-radius: ${dt('rounded.base')};
@ -151,7 +151,7 @@ const theme = ({ dt }) => `
margin: 2px 0; margin: 2px 0;
padding: 0.5rem 0.75rem; padding: 0.5rem 0.75rem;
border: 0 none; border: 0 none;
color: ${dt('multiselect.item.color')}; color: ${dt('multiselect.option.color')};
background: transparent; background: transparent;
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')}, outline-color ${dt('transition.duration')}; transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
border-radius: ${dt('rounded.sm')}; border-radius: ${dt('rounded.sm')};
@ -166,18 +166,18 @@ const theme = ({ dt }) => `
} }
.p-multiselect-option:not(.p-multiselect-option-selected):not(.p-disabled).p-focus { .p-multiselect-option:not(.p-multiselect-option-selected):not(.p-disabled).p-focus {
background: ${dt('multiselect.item.focus.background')}; background: ${dt('multiselect.option.focus.background')};
color: ${dt('multiselect.item.focus.color')}; color: ${dt('multiselect.option.focus.color')};
} }
.p-multiselect-option.p-multiselect-option-selected { .p-multiselect-option.p-multiselect-option-selected {
background: ${dt('multiselect.item.selected.background')}; background: ${dt('multiselect.option.selected.background')};
color: ${dt('multiselect.item.selected.color')}; color: ${dt('multiselect.option.selected.color')};
} }
.p-multiselect-option.p-multiselect-option-selected.p-focus { .p-multiselect-option.p-multiselect-option-selected.p-focus {
background: ${dt('multiselect.item.selected.focus.background')}; background: ${dt('multiselect.option.selected.focus.background')};
color: ${dt('multiselect.item.selected.focus.color')}; color: ${dt('multiselect.option.selected.focus.color')};
} }
.p-multiselect-option .p-checkbox { .p-multiselect-option .p-checkbox {
@ -188,8 +188,8 @@ const theme = ({ dt }) => `
cursor: auto; cursor: auto;
margin: 0; margin: 0;
padding: 0.5rem 0.75rem; padding: 0.5rem 0.75rem;
color: ${dt('multiselect.item.group.color')}; color: ${dt('multiselect.option.group.color')};
background: ${dt('multiselect.item.group.background')}; background: ${dt('multiselect.option.group.background')};
font-weight: 600; font-weight: 600;
} }

View File

@ -13,58 +13,28 @@ export default {
placeholderColor: '{form.field.placeholder.color}', placeholderColor: '{form.field.placeholder.color}',
boxShadow: '{form.field.box.shadow}' boxShadow: '{form.field.box.shadow}'
}, },
colorScheme: { dropdown: {
light: { color: '{form.field.icon.color}'
toggle: { },
color: '{surface.400}' overlay: {
}, background: '{overlay.select.background}',
overlay: { borderColor: '{overlay.select.border.color}',
background: '{surface.0}', color: '{overlay.select.color}'
borderColor: '{surface.200}', },
color: '{surface.700}' option: {
}, focusBackground: '{list.option.focus.background}',
filterIcon: { selectedBackground: '{list.option.selected.background}',
color: '{surface.400}' selectedFocusBackground: '{list.option.selected.focus.background}',
}, color: '{list.option.color}',
itemGroup: { focusColor: '{list.option.focus.color}',
background: '{surface.0}', selectedColor: '{list.option.selected.color}',
color: '{surface.500}' selectedFocusColor: '{list.option.selected.focus.color}'
}, },
item: { optionGroup: {
focusBackground: '{surface.100}', background: '{list.option.group.background}',
selectedBackground: '{highlight.background}', color: '{list.option.group.color}'
selectedFocusBackground: '{highlight.focus.background}', },
color: '{surface.700}', filterIcon: {
focusColor: '{surface.800}', color: '{form.field.icon.color}'
selectedColor: '{highlight.color}',
selectedFocusColor: '{highlight.focus.color}'
}
},
dark: {
toggle: {
color: '{surface.400}'
},
overlay: {
background: '{surface.900}',
borderColor: '{surface.700}',
color: '{surface.0}'
},
filterIcon: {
color: '{surface.400}'
},
itemGroup: {
background: '{surface.900}',
color: '{surface.400}'
},
item: {
focusBackground: '{surface.800}',
selectedBackground: '{highlight.background}',
selectedFocusBackground: '{highlight.focus.background}',
color: '{surface.0}',
focusColor: '{surface.0}',
selectedColor: '{highlight.color}',
selectedFocusColor: '{highlight.focus.color}'
}
}
} }
}; };