forked from fa/breadcrumb-the-shire
- New core partial templates/partials/app-input-copy.phtml renders a
standard label + input with a compact copy button overlaid on the
right edge of the input. Used for privacy/imprint URLs on the tenant
form; reusable for any field where a one-click copy is helpful.
- Extend the shared copy-field component (web/js/components/app-copy-field.js)
with data-copy-target support — the button now reads the target input's
.value at click-time, so users can edit a field and still copy the
current value. Static data-copy-value keeps working unchanged.
- New component CSS web/css/components/app-input-copy.css positions the
button absolute/inset + margin-block:auto (robust vertical centering
regardless of input height) and uses a descendant selector (0,2,0)
so the button wins over the global [data-tooltip] position:relative.
- Also register app-input-copy.css + app-tenant-logo.css in core.css
@import list — they were only in the shared asset group before, which
default-template admin pages don't load, so tenant-logo styles were
effectively missing on admin tenant edit (topbar size etc.).
- Document the Copy-to-Clipboard + Copyable Input standards in
docs/reference-frontend-javascript.md so future consumers don't
re-invent the markup/selectors.
- File-upload preview: pending-file block restructured to a compact
list-item row (small square thumb + filename/size stack + clear X)
and removed the transparency checker pattern on the current-image
preview in favour of a flat --app-preview-bg surface.
- Tenant edit page title + breadcrumb now show the tenant description
("Acme GmbH") instead of the generic "Mandant bearbeiten" when one
is present.
- i18n: add "Copy to clipboard" / "In Zwischenablage kopieren" across
both locales.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
263 lines
6.8 KiB
CSS
263 lines
6.8 KiB
CSS
@layer components {
|
|
/* File upload — card-based dropzone with drag-and-drop, current file preview, and pending file preview. */
|
|
.app-file-upload {
|
|
position: relative;
|
|
border: 1px solid var(--app-muted-border-color);
|
|
border-radius: var(--app-border-radius);
|
|
background: var(--app-card-background-color);
|
|
overflow: hidden;
|
|
transition: border-color 0.15s ease;
|
|
margin-bottom: var(--app-spacing);
|
|
}
|
|
|
|
.app-file-upload.is-dragover {
|
|
border-color: var(--app-primary);
|
|
background: color-mix(in srgb, var(--app-primary) 5%, var(--app-card-background-color));
|
|
}
|
|
|
|
/* ── Current file (server-side, shown when data-current-src is set) ──
|
|
Full-width preview on top, filename + actions row below. */
|
|
.app-file-upload-current {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: calc(var(--app-spacing) * 0.5);
|
|
padding: calc(var(--app-spacing) * 0.75);
|
|
}
|
|
|
|
.app-file-upload-current-image {
|
|
width: 100%;
|
|
aspect-ratio: 16 / 9;
|
|
padding: var(--app-spacing);
|
|
border-radius: calc(var(--app-border-radius) * 0.5);
|
|
object-fit: contain;
|
|
object-position: center;
|
|
border: 1px solid var(--app-muted-border-color);
|
|
background-color: var(--app-preview-bg);
|
|
box-sizing: border-box;
|
|
cursor: pointer;
|
|
transition: border-color 0.15s ease, opacity 0.15s ease;
|
|
}
|
|
|
|
.app-file-upload-current-image:hover {
|
|
border-color: var(--app-primary);
|
|
opacity: 0.92;
|
|
}
|
|
|
|
.app-file-upload-current-meta {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: calc(var(--app-spacing) * 0.5);
|
|
min-width: 0;
|
|
}
|
|
|
|
.app-file-upload-current-label {
|
|
font-size: var(--text-sm);
|
|
font-weight: var(--font-medium);
|
|
color: var(--app-contrast);
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.app-file-upload-current-actions {
|
|
display: flex;
|
|
gap: calc(var(--app-spacing) * 0.25);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.app-file-upload-current-actions button {
|
|
background: none;
|
|
border: none;
|
|
padding: calc(var(--app-spacing) * 0.15) calc(var(--app-spacing) * 0.35);
|
|
cursor: pointer;
|
|
font-size: var(--text-xs);
|
|
border-radius: var(--app-border-radius);
|
|
transition: color 0.15s ease, background 0.15s ease;
|
|
margin: 0;
|
|
width: auto;
|
|
line-height: var(--leading-normal);
|
|
}
|
|
|
|
.app-file-upload-replace-button {
|
|
color: var(--app-primary);
|
|
}
|
|
|
|
.app-file-upload-replace-button:hover {
|
|
background: color-mix(in srgb, var(--app-primary) 10%, transparent);
|
|
}
|
|
|
|
.app-file-upload-delete-button {
|
|
color: var(--app-del-color);
|
|
}
|
|
|
|
.app-file-upload-delete-button:hover {
|
|
background: color-mix(in srgb, var(--app-del-color) 10%, transparent);
|
|
}
|
|
|
|
.app-file-upload.has-current .app-file-upload-dropzone {
|
|
display: none;
|
|
}
|
|
|
|
.app-file-upload:not(.has-current) .app-file-upload-current {
|
|
display: none;
|
|
}
|
|
|
|
/* ── Dropzone (visible when no current file and no pending file) ── */
|
|
.app-file-upload-dropzone {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: calc(var(--app-spacing) * 0.5);
|
|
padding: calc(var(--app-spacing) * 1.5) var(--app-spacing);
|
|
cursor: pointer;
|
|
text-align: center;
|
|
color: var(--app-muted-color);
|
|
border: 2px dashed var(--app-muted-border-color);
|
|
border-radius: var(--app-border-radius);
|
|
margin: calc(var(--app-spacing) * 0.5);
|
|
transition: border-color 0.15s ease, color 0.15s ease;
|
|
}
|
|
|
|
.app-file-upload.is-dragover .app-file-upload-dropzone {
|
|
border-color: var(--app-primary);
|
|
color: var(--app-primary);
|
|
}
|
|
|
|
.app-file-upload-dropzone:hover {
|
|
border-color: var(--app-primary);
|
|
color: var(--app-primary);
|
|
}
|
|
|
|
.app-file-upload-dropzone-icon {
|
|
font-size: var(--text-2xl);
|
|
line-height: var(--leading-none);
|
|
}
|
|
|
|
.app-file-upload-dropzone-label {
|
|
font-size: var(--text-sm);
|
|
font-weight: var(--font-medium);
|
|
}
|
|
|
|
.app-file-upload-dropzone-hint {
|
|
font-size: var(--text-xs);
|
|
opacity: 0.7;
|
|
}
|
|
|
|
.app-file-upload.has-file .app-file-upload-dropzone,
|
|
.app-file-upload.has-file .app-file-upload-current {
|
|
display: none;
|
|
}
|
|
|
|
.app-file-upload.is-rejected {
|
|
animation: file-upload-shake 0.4s ease;
|
|
}
|
|
|
|
.app-file-upload.is-rejected .app-file-upload-dropzone {
|
|
border-color: var(--app-del-color);
|
|
color: var(--app-del-color);
|
|
}
|
|
|
|
@keyframes file-upload-shake {
|
|
0%, 100% { transform: translateX(0); }
|
|
20% { transform: translateX(-4px); }
|
|
40% { transform: translateX(4px); }
|
|
60% { transform: translateX(-2px); }
|
|
80% { transform: translateX(2px); }
|
|
}
|
|
|
|
/* ── Pending file preview (visible when new file selected) ──
|
|
Compact row: small thumb (left) + filename/size stack (middle) + clear X (right). */
|
|
.app-file-upload-preview {
|
|
display: none;
|
|
align-items: center;
|
|
gap: calc(var(--app-spacing) * 0.75);
|
|
padding: calc(var(--app-spacing) * 0.75);
|
|
}
|
|
|
|
.app-file-upload.has-file .app-file-upload-preview {
|
|
display: flex;
|
|
}
|
|
|
|
.app-file-upload-thumbnail {
|
|
width: 48px;
|
|
height: 48px;
|
|
border-radius: calc(var(--app-border-radius) * 0.5);
|
|
object-fit: cover;
|
|
border: 1px solid var(--app-muted-border-color);
|
|
background-color: var(--app-preview-bg);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.app-file-upload-file-icon {
|
|
width: 48px;
|
|
height: 48px;
|
|
border-radius: calc(var(--app-border-radius) * 0.5);
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: var(--text-xl);
|
|
color: var(--app-muted-color);
|
|
background: var(--app-preview-bg);
|
|
border: 1px solid var(--app-muted-border-color);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.app-file-upload-meta {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.app-file-upload-filename {
|
|
font-size: var(--text-sm);
|
|
font-weight: var(--font-medium);
|
|
color: var(--app-color);
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.app-file-upload-filesize {
|
|
font-size: var(--text-xs);
|
|
color: var(--app-muted-color);
|
|
}
|
|
|
|
.app-file-upload-clear {
|
|
flex-shrink: 0;
|
|
background: none;
|
|
border: none;
|
|
padding: calc(var(--app-spacing) * 0.25);
|
|
cursor: pointer;
|
|
color: var(--app-muted-color);
|
|
font-size: var(--text-base);
|
|
line-height: var(--leading-none);
|
|
border-radius: var(--app-border-radius);
|
|
transition: color 0.15s ease;
|
|
margin: 0;
|
|
width: auto;
|
|
}
|
|
|
|
.app-file-upload-clear:hover {
|
|
color: var(--app-del-color);
|
|
}
|
|
|
|
/* ── Hidden native input ── */
|
|
.app-file-upload input[type="file"] {
|
|
position: absolute;
|
|
width: 1px;
|
|
height: 1px;
|
|
padding: 0;
|
|
margin: -1px;
|
|
overflow: hidden;
|
|
clip: rect(0, 0, 0, 0);
|
|
white-space: nowrap;
|
|
border: 0;
|
|
}
|
|
}
|