From 17d2ecb6650e80cfaf41565d4091e60a64d15061 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Sun, 5 May 2024 18:46:45 +0300 Subject: [PATCH] Refactored cascadeselect tokens --- .../cascadeselect/style/CascadeSelectStyle.js | 35 +++++----- .../lib/themes/aura/cascadeselect/index.js | 65 ++++++------------- components/lib/themes/aura/index.js | 14 +++- 3 files changed, 48 insertions(+), 66 deletions(-) diff --git a/components/lib/cascadeselect/style/CascadeSelectStyle.js b/components/lib/cascadeselect/style/CascadeSelectStyle.js index 48329953b..271cca0ee 100644 --- a/components/lib/cascadeselect/style/CascadeSelectStyle.js +++ b/components/lib/cascadeselect/style/CascadeSelectStyle.js @@ -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')}; } `; diff --git a/components/lib/themes/aura/cascadeselect/index.js b/components/lib/themes/aura/cascadeselect/index.js index 58db12f7e..96b2a199c 100644 --- a/components/lib/themes/aura/cascadeselect/index.js +++ b/components/lib/themes/aura/cascadeselect/index.js @@ -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}', } } }; diff --git a/components/lib/themes/aura/index.js b/components/lib/themes/aura/index.js index facd30a97..c78d977cd 100644 --- a/components/lib/themes/aura/index.js +++ b/components/lib/themes/aura/index.js @@ -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}',