feat(design-system): add reusable Dialog primitive
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Standalone, OnPush. Backdrop click and Escape close, focus trap with return-focus on close, role=dialog/aria-modal. Sizes sm/md/lg. Colors/ radius/shadow/spacing via existing tenant CSS vars with fallbacks.
This commit is contained in:
104
src/app/shared/ui/dialog/dialog.component.scss
Normal file
104
src/app/shared/ui/dialog/dialog.component.scss
Normal file
@@ -0,0 +1,104 @@
|
||||
.app-dialog-backdrop {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: var(--space-md, 1rem);
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
animation: app-dialog-fade-in var(--transition-normal, 200ms ease);
|
||||
}
|
||||
|
||||
.app-dialog-panel {
|
||||
width: 100%;
|
||||
max-height: 90vh;
|
||||
overflow-y: auto;
|
||||
background: var(--bg-primary, #fff);
|
||||
border-radius: var(--radius-lg, 10px);
|
||||
box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.16));
|
||||
animation: app-dialog-scale-in var(--transition-normal, 200ms ease);
|
||||
|
||||
&:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
.app-dialog-panel--sm {
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.app-dialog-panel--md {
|
||||
max-width: 560px;
|
||||
}
|
||||
|
||||
.app-dialog-panel--lg {
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.app-dialog-panel__header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-md, 1rem);
|
||||
padding: var(--space-md, 1rem) var(--space-lg, 1.5rem);
|
||||
border-bottom: 1px solid var(--border-color, #e4e4e7);
|
||||
}
|
||||
|
||||
.app-dialog-panel__title {
|
||||
margin: 0;
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary, #1f322d);
|
||||
}
|
||||
|
||||
.app-dialog-panel__close {
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: var(--text-secondary, #6b7280);
|
||||
font-size: 1.5rem;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
padding: var(--space-xs, 0.25rem);
|
||||
border-radius: var(--radius-sm, 4px);
|
||||
|
||||
&:hover {
|
||||
background: var(--bg-secondary, #f4f4f5);
|
||||
}
|
||||
|
||||
&:focus-visible {
|
||||
outline: 2px solid var(--primary-color, #2f6e5d);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.app-dialog-panel__body {
|
||||
padding: var(--space-lg, 1.5rem);
|
||||
}
|
||||
|
||||
@keyframes app-dialog-fade-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes app-dialog-scale-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(0.96);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.app-dialog-backdrop,
|
||||
.app-dialog-panel {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user