Refactored cascadeselect tokens

pull/5701/head
Cagatay Civici 2024-05-05 18:46:45 +03:00
parent 21b27cf96b
commit 17d2ecb665
3 changed files with 48 additions and 66 deletions

View File

@ -46,7 +46,7 @@ const theme = ({ dt }) => `
justify-content: center;
flex-shrink: 0;
background: transparent;
color: ${dt('cascadeselect.toggle.color')};
color: ${dt('cascadeselect.dropdown.color')};
width: 2.5rem;
border-top-right-radius: ${dt('rounded.base')};
border-bottom-right-radius: ${dt('rounded.base')};
@ -94,10 +94,10 @@ const theme = ({ dt }) => `
.p-cascadeselect-overlay {
background: ${dt('cascadeselect.overlay.background')};
color: ${dt('cascadeselect.overlay.color')};
border: 1px solid ${dt('cascadeselect.overlay.border.color')};
border-radius: ${dt('rounded.base')};
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
color: ${dt('cascadeselect.overlay.color')};
}
.p-cascadeselect .p-cascadeselect-overlay {
@ -105,16 +105,15 @@ const theme = ({ dt }) => `
}
.p-cascadeselect-item-list {
position: absolute;
min-width: 100%;
z-index: 1;
display: none;
min-width: 100%;
position: absolute;
z-index: 1;
}
.p-cascadeselect-list {
margin: 0;
padding: 0;
list-style-type: none;
margin: 0;
min-width: 100%;
padding: 0.25rem 0.25rem;
}
@ -125,7 +124,7 @@ const theme = ({ dt }) => `
white-space: nowrap;
margin: 2px 0;
border: 0 none;
color: ${dt('cascadeselect.item.color')};
color: ${dt('cascadeselect.option.color')};
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')};
border-radius: ${dt('rounded.sm')};
@ -140,28 +139,28 @@ const theme = ({ dt }) => `
}
.p-cascadeselect-item:not(.p-cascadeselect-item-selected):not(.p-disabled).p-focus {
background: ${dt('cascadeselect.item.focus.background')};
color: ${dt('cascadeselect.item.focus.color')};
background: ${dt('cascadeselect.option.focus.background')};
color: ${dt('cascadeselect.option.focus.color')};
}
.p-cascadeselect-item:not(.p-cascadeselect-item-selected):not(.p-disabled).p-focus .p-cascadeselect-group-icon {
color: ${dt('cascadeselect.item.icon.focus.color')};
color: ${dt('cascadeselect.option.icon.focus.color')};
}
.p-cascadeselect-item-selected {
background: ${dt('cascadeselect.item.selected.background')};
color: ${dt('cascadeselect.item.selected.color')};
background: ${dt('cascadeselect.option.selected.background')};
color: ${dt('cascadeselect.option.selected.color')};
}
.p-cascadeselect-item-selected.p-focus {
background: ${dt('cascadeselect.item.selected.focus.background')};
color: ${dt('cascadeselect.item.selected.focus.color')};
background: ${dt('cascadeselect.option.selected.focus.background')};
color: ${dt('cascadeselect.option.selected.focus.color')};
}
.p-cascadeselect-item-active {
overflow: visible;
background: ${dt('cascadeselect.item.focus.background')};
color: ${dt('cascadeselect.item.focus.color')};
background: ${dt('cascadeselect.option.focus.background')};
color: ${dt('cascadeselect.option.focus.color')};
}
.p-cascadeselect-item-active > .p-cascadeselect-item-list {
@ -181,7 +180,7 @@ const theme = ({ dt }) => `
.p-cascadeselect-group-icon {
margin-left: auto;
font-size: 0.875rem;
color: ${dt('cascadeselect.item.icon.color')};
color: ${dt('cascadeselect.option.icon.color')};
}
`;

View File

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

View File

@ -181,6 +181,7 @@ export default {
floatLabelColor: '{surface.500}',
floatLabelFocusColor: '{surface.500}',
floatLabelInvalidColor: '{red.400}',
iconColor: '{surface.400}',
boxShadow: '0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(18, 18, 23, 0.05)'
},
text: {
@ -211,7 +212,11 @@ export default {
color: '{text.color}',
focusColor: '{text.hover.color}',
selectedColor: '{highlight.color}',
selectedFocusColor: '{highlight.focus.color}'
selectedFocusColor: '{highlight.focus.color}',
icon: {
color: '{surface.400}',
focusColor: '{surface.500}'
}
},
optionGroup: {
background: '{surface.0}',
@ -276,6 +281,7 @@ export default {
floatLabelColor: '{surface.400}',
floatLabelFocusColor: '{surface.400}',
floatLabelInvalidColor: '{red.300}',
iconColor: '{surface.400}',
boxShadow: '0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(18, 18, 23, 0.05)'
},
text: {
@ -306,7 +312,11 @@ export default {
color: '{text.color}',
focusColor: '{text.hover.color}',
selectedColor: '{highlight.color}',
selectedFocusColor: '{highlight.focus.color}'
selectedFocusColor: '{highlight.focus.color}',
icon: {
color: '{surface.500}',
focusColor: '{surface.400}'
}
},
optionGroup: {
background: '{surface.900}',