Add unified badge and dropdown preview components for admin lists

- Add .mpr-badge--preview base class with consistent sizing (20px height, pill shape)
- Add color variants: -primary, -success, -warning, -muted
- Add .mpr-dropdown-preview component for inline schedule details
- Add schedule row layout with day/hours styling
- Support material icons inside badges with proper sizing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-04 13:27:53 +00:00
parent 7c9b57aaa2
commit 4d14afa767
3 changed files with 246 additions and 2 deletions

View File

@@ -8579,6 +8579,122 @@ body > .target-search-dropdown .dropdown-item:not(:last-child) {
opacity: 0.9;
}
.mpr-dropdown-preview {
display: none;
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
margin-top: 6px;
z-index: 1000;
padding: 0.625rem 0.75rem;
background: #ffffff;
border: 1px solid #dee2e6;
border-radius: 0.3rem;
box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
font-size: 12px;
text-align: left;
text-transform: none;
font-weight: normal;
white-space: nowrap;
}
.mpr-dropdown-preview.is-open {
display: block;
}
.mpr-dropdown-preview__item {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.375rem 0;
color: #666;
line-height: 1.4;
}
.mpr-dropdown-preview__item:not(:last-child) {
margin-bottom: 0.25rem;
padding-bottom: 0.5rem;
border-bottom: 1px solid rgba(222, 226, 230, 0.5);
}
.mpr-dropdown-preview__item > .material-icons,
.mpr-dropdown-preview__item > i:first-child {
flex-shrink: 0;
width: 16px;
font-size: 14px;
color: #999;
text-align: center;
}
.mpr-dropdown-preview__muted {
color: #999;
}
.mpr-dropdown-preview__schedule {
display: inline;
}
.mpr-dropdown-preview__schedule-row {
display: inline;
}
.mpr-dropdown-preview__schedule-row:not(:last-child)::after {
content: ",";
margin-right: 0.5rem;
}
.mpr-dropdown-preview__day {
color: #666;
}
.mpr-dropdown-preview__hours {
color: #25b9d7;
font-weight: 500;
margin-left: 0.25rem;
}
.mpr-badge--preview {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.25rem;
position: relative;
min-width: 20px;
height: 20px;
padding: 0 0.5rem;
font-size: 0.75rem;
font-weight: 600;
border-radius: 50rem;
cursor: pointer;
text-transform: none;
}
.mpr-badge--preview .icon-eye {
font-size: 10px;
line-height: 1;
opacity: 0.8;
}
.mpr-badge--preview .material-icons {
font-size: 12px;
line-height: 1;
}
.mpr-badge--preview-primary {
background: #25b9d7;
color: #ffffff;
}
.mpr-badge--preview-success {
background: #d4edda;
color: #155724;
}
.mpr-badge--preview-warning {
background: #fff3cd;
color: #856404;
}
.mpr-badge--preview-muted {
background: #e2e8f0;
color: #6c757d;
}
/**
* Entity Selector Styles
* @package prestashop-entity-selector

File diff suppressed because one or more lines are too long

View File

@@ -518,4 +518,132 @@
}
}
// Schedule Preview - uses shared mpr-dropdown-preview from prestashop-admin
// =============================================================================
// Schedule Dropdown Preview
// Inline dropdown for schedule details in admin list
// =============================================================================
.mpr-dropdown-preview {
display: none;
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
margin-top: 6px;
z-index: 1000;
padding: 0.625rem 0.75rem;
background: $es-white;
border: 1px solid $es-border-color;
border-radius: $es-radius-lg;
box-shadow: $es-shadow-lg;
font-size: 12px;
text-align: left;
text-transform: none;
font-weight: normal;
white-space: nowrap; // Allow dropdown to grow as needed
&.is-open {
display: block;
}
}
.mpr-dropdown-preview__item {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.375rem 0;
color: #666;
line-height: 1.4;
&:not(:last-child) {
margin-bottom: 0.25rem;
padding-bottom: 0.5rem;
border-bottom: 1px solid rgba($es-border-color, 0.5);
}
// Icon styles
> .material-icons,
> i:first-child {
flex-shrink: 0;
width: 16px;
font-size: 14px;
color: #999;
text-align: center;
}
}
.mpr-dropdown-preview__muted {
color: #999;
}
// Schedule inline layout
.mpr-dropdown-preview__schedule {
display: inline;
}
.mpr-dropdown-preview__schedule-row {
display: inline;
&:not(:last-child)::after {
content: ',';
margin-right: 0.5rem;
}
}
.mpr-dropdown-preview__day {
color: #666;
}
.mpr-dropdown-preview__hours {
color: $es-primary;
font-weight: 500;
margin-left: 0.25rem;
}
// Badge trigger for preview dropdown/popover
.mpr-badge--preview {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.25rem;
position: relative;
min-width: 20px;
height: 20px;
padding: 0 0.5rem;
font-size: 0.75rem;
font-weight: 600;
border-radius: 50rem;
cursor: pointer;
text-transform: none;
.icon-eye {
font-size: 10px;
line-height: 1;
opacity: 0.8;
}
.material-icons {
font-size: 12px;
line-height: 1;
}
}
.mpr-badge--preview-primary {
background: $es-primary;
color: $es-white;
}
.mpr-badge--preview-success {
background: #d4edda;
color: #155724;
}
.mpr-badge--preview-warning {
background: #fff3cd;
color: #856404;
}
.mpr-badge--preview-muted {
background: $es-slate-200;
color: $es-text-muted;
}