fix: Right Align Copy Buttons & <btrix-desc-list> vertical width: 100% (#1177)

* Reorders actions, adds tooltip

- All copy buttons on the collection share dialog are now on the right side
- Adds a tooltip to tell the user the button opens the link in a new tab

* Make vertical `dec-list` items fill 100% width of their parent container

- Allows for better placement of items within the container
- Adds horizontal padding to info bars

* Right align copy button in item details page
This commit is contained in:
Henry Wilkinson 2023-09-28 15:08:27 -04:00 committed by GitHub
parent 86a424af93
commit e93f195d59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 15 deletions

View File

@ -46,6 +46,10 @@ export class DescListItem extends LitElement {
justify-content: var(--justify-item, initial); justify-content: var(--justify-item, initial);
border-right: var(--border-right, 0px); border-right: var(--border-right, 0px);
} }
.content {
width: var(--width-full, initial);
}
`; `;
@property({ type: String }) @property({ type: String })
@ -71,6 +75,7 @@ export class DescList extends LitElement {
.vertical { .vertical {
grid-template-columns: 100%; grid-template-columns: 100%;
gap: 1rem; gap: 1rem;
--width-full: 100%;
} }
.horizontal { .horizontal {

View File

@ -121,7 +121,9 @@ export class CollectionDetail extends LiteElement {
</sl-button> </sl-button>
${when(this.isCrawler, this.renderActions)} ${when(this.isCrawler, this.renderActions)}
</header> </header>
<div class="border rounded-lg py-2 mb-3">${this.renderInfoBar()}</div> <div class="border rounded-lg py-2 px-4 mb-3">
${this.renderInfoBar()}
</div>
<div class="mb-3">${this.renderTabs()}</div> <div class="mb-3">${this.renderTabs()}</div>
${choose( ${choose(
@ -217,21 +219,23 @@ export class CollectionDetail extends LiteElement {
${msg("This collection can be viewed by anyone with the link.")} ${msg("This collection can be viewed by anyone with the link.")}
</p> </p>
<div class="flex items-center rounded border"> <div class="flex items-center rounded border">
<div class="text-base">
<sl-tooltip content="Open in New Tab">
<sl-icon-button
href=${publicReplayUrl}
name="box-arrow-up-right"
target="_blank"
>
</sl-icon-button>
</sl-tooltip>
</div>
<div class="flex-1 min-w-0 truncate">${publicReplayUrl}</div>
<div class="text-base"> <div class="text-base">
<btrix-copy-button <btrix-copy-button
.getValue=${() => publicReplayUrl} .getValue=${() => publicReplayUrl}
content=${msg("Copy Public URL")} content=${msg("Copy Public URL")}
></btrix-copy-button> ></btrix-copy-button>
</div> </div>
<div class="flex-1 min-w-0 truncate">${publicReplayUrl}</div>
<div class="text-base">
<sl-icon-button
href=${publicReplayUrl}
name="box-arrow-up-right"
target="_blank"
>
</sl-icon-button>
</div>
</div> </div>
</section> </section>
<btrix-section-heading>${msg("Embed Collection")}</btrix-section-heading> <btrix-section-heading>${msg("Embed Collection")}</btrix-section-heading>

View File

@ -699,10 +699,14 @@ export class CrawlDetail extends LiteElement {
</btrix-desc-list-item> </btrix-desc-list-item>
<btrix-desc-list-item label=${msg("Crawl ID")}> <btrix-desc-list-item label=${msg("Crawl ID")}>
${this.crawl ${this.crawl
? html`<btrix-copy-button ? html`
value=${this.crawl.id} <div class="flex items-center gap-2">
></btrix-copy-button> <code class="grow" title=${this.crawl.id}
<code title=${this.crawl.id}>${this.crawl.id}</code> ` >${this.crawl.id}</code
>
<btrix-copy-button value=${this.crawl.id}></btrix-copy-button>
</div>
`
: html`<sl-skeleton class="h-6"></sl-skeleton>`} : html`<sl-skeleton class="h-6"></sl-skeleton>`}
</btrix-desc-list-item> </btrix-desc-list-item>
</btrix-desc-list> </btrix-desc-list>

View File

@ -318,7 +318,7 @@ export class WorkflowDetail extends LiteElement {
</div> </div>
</header> </header>
<section class="col-span-1 border rounded-lg py-2"> <section class="col-span-1 border rounded-lg py-2 px-4">
${this.renderDetails()} ${this.renderDetails()}
</section> </section>