Files
stefan.tollkuehn cc1fd4e508 Add live contact search to invitee input
The static datalist only carried the first 50 address book
contacts, so typed fragments could not match anything beyond
that. A new read-only GET /contacts/search endpoint queries
the full address book per keystroke, and a small vanilla JS
combobox shows the results and replaces only the fragment
after the last separator, so comma-separated lists keep
working. The server-rendered datalist remains as the no-JS
fallback; the JS removes the list attribute at runtime so
the native popup does not double the custom one.
2026-10-22 18:50:46 +02:00

250 lines
5.7 KiB
CSS

/*
* Page scaffold: center the card, let it shrink with the viewport.
*
* ┌────────────── #app-content ──────────────┐
* │ 16px ┌──────────── card ──────────┐ │
* │ pad │ padding 32px, max 640px │ │
* │ └────────────────────────────┘ │
* └──────────────────────────────────────────┘
*/
.atocal-container {
display: flex;
justify-content: center;
padding: 48px 16px;
}
.atocal-card {
width: 100%;
max-width: 640px;
align-self: flex-start;
background: var(--color-main-background);
border: 1px solid var(--color-border);
border-radius: 12px;
padding: 32px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.atocal-card h1 {
margin-top: 0;
margin-bottom: 12px;
}
.atocal-intro {
color: var(--color-text-maxcontrast);
margin-bottom: 28px;
}
.atocal-notice {
background: var(--color-warning);
color: var(--color-warning-text);
border-radius: 6px;
padding: 12px 16px;
margin-bottom: 28px;
}
.atocal-error {
background: var(--color-error);
color: var(--color-error-text);
border-radius: 6px;
padding: 12px 16px;
margin-bottom: 28px;
}
.atocal-details {
border-top: 1px solid var(--color-border);
border-bottom: 1px solid var(--color-border);
margin-bottom: 28px;
}
.atocal-row {
display: grid;
grid-template-columns: 150px 1fr;
gap: 16px;
padding: 14px 0;
border-bottom: 1px solid var(--color-border);
}
.atocal-row:last-child {
border-bottom: 0;
}
.atocal-row span {
overflow-wrap: anywhere;
}
/*
* Input wrappers with a theme-colored chevron instead of the
* native arrow, which is not visible on every platform.
*
* ┌───────────────────────────────┐
* │ Personal ⌄ │
* └───────────────────────────────┘
*/
.atocal-select {
position: relative;
display: block;
}
.atocal-select::after {
content: "";
position: absolute;
top: calc(50% - 5px);
right: 12px;
width: 8px;
height: 8px;
border-right: 2px solid var(--color-text-maxcontrast);
border-bottom: 2px solid var(--color-text-maxcontrast);
transform: rotate(45deg);
pointer-events: none;
}
.atocal-select select,
.atocal-select input[type="text"] {
padding-right: 32px;
}
/* Chrome draws its own datalist arrow on hover; hide the duplicate */
.atocal-select input::-webkit-calendar-picker-indicator {
display: none;
}
.atocal-select select {
appearance: none;
}
/*
* Live contact search results, anchored to the invitee wrapper.
*/
.atocal-suggestions {
position: absolute;
top: 100%;
left: 0;
right: 0;
margin: 2px 0 0;
padding: 4px;
list-style: none;
background: var(--color-main-background);
border: 1px solid var(--color-border);
border-radius: 6px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
z-index: 10;
max-height: 220px;
overflow-y: auto;
}
.atocal-suggestions button {
display: flex;
justify-content: space-between;
gap: 12px;
width: 100%;
padding: 6px 8px;
border: 0;
border-radius: 4px;
background: transparent;
color: var(--color-main-text);
text-align: left;
cursor: pointer;
}
.atocal-suggestions li.atocal-active > button,
.atocal-suggestions button:hover {
background: var(--color-background-hover);
}
.atocal-suggestions .atocal-suggestion-email {
color: var(--color-text-maxcontrast);
}
.atocal-row select,
.atocal-row input[type="text"] {
align-self: center;
width: 100%;
padding: 6px 8px;
border: 1px solid var(--color-border);
border-radius: 6px;
background: var(--color-main-background);
color: var(--color-main-text);
}
.atocal-row .description {
white-space: normal;
}
.atocal-actions {
display: flex;
gap: 12px;
flex-wrap: wrap;
}
.atocal-actions button,
.atocal-actions a {
display: inline-block;
padding: 10px 18px;
border-radius: 6px;
text-decoration: none;
cursor: pointer;
}
.atocal-actions button.primary {
background: var(--color-primary-element);
color: var(--color-primary-element-text);
border: 0;
}
.atocal-actions a.secondary {
border: 1px solid var(--color-border);
color: var(--color-main-text);
}
/* Feedback for pointer users */
.atocal-actions button.primary:hover {
background: var(--color-primary-element-hover);
}
.atocal-actions a.secondary:hover {
background: var(--color-background-hover);
border-color: var(--color-primary-element);
}
.atocal-row select:hover,
.atocal-row input[type="text"]:hover {
border-color: var(--color-primary-element);
}
/* Keyboard navigation must stay visible */
.atocal-actions button:focus-visible,
.atocal-actions a:focus-visible,
.atocal-row select:focus-visible,
.atocal-row input[type="text"]:focus-visible {
outline: 2px solid var(--color-primary-element);
outline-offset: 2px;
}
/* Phones: stack rows and buttons, restore tap-friendly spacing */
@media (max-width: 600px) {
.atocal-container {
padding: 16px 12px;
}
.atocal-card {
padding: 20px;
border-radius: 8px;
}
.atocal-row {
grid-template-columns: 1fr;
gap: 4px;
padding: 12px 0;
}
.atocal-actions {
flex-direction: column;
}
.atocal-actions button.primary,
.atocal-actions a.secondary {
box-sizing: border-box;
width: 100%;
text-align: center;
}
}