Use shared form controls and enforce UI patterns (Refs #110)
CI / checks (push) Successful in 4m51s
CI / checks (push) Successful in 4m51s
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
<script lang="ts">
|
||||
import Select from '$ui/components/primitives/Select.svelte';
|
||||
import Input from '$ui/components/primitives/Input.svelte';
|
||||
import Field from '$ui/components/primitives/Field.svelte';
|
||||
import { countLabel } from '$ui/plural.js';
|
||||
import { page } from '$app/stores';
|
||||
import { contextHref, safeReturnHref } from '$lib/navigation-context.js';
|
||||
@@ -667,29 +670,30 @@
|
||||
<form onsubmit={openBeta} class="beta-form">
|
||||
<h2 bind:this={stepHeading} tabindex="-1">{steps[step]}</h2>
|
||||
{#if step === 0}
|
||||
<label
|
||||
>Beta label (optional)<input
|
||||
<Field label="Beta label (optional)">
|
||||
<Input
|
||||
bind:value={betaLabel}
|
||||
maxlength="120"
|
||||
maxlength={120}
|
||||
placeholder="For example, Town balance update"
|
||||
/><span class="muted"
|
||||
>Shown in the beta list so others can identify this test.</span
|
||||
></label
|
||||
></Field
|
||||
>
|
||||
<div class="picks">
|
||||
{#each picks as pick, index (pick.key)}<section class="pick-row">
|
||||
<label
|
||||
>File {index + 1}<select
|
||||
<Field
|
||||
>{#snippet label()}File {index + 1}{/snippet}
|
||||
<Select
|
||||
bind:value={pick.scriptId}
|
||||
onchange={() => onPickFile(index)}
|
||||
><option value={null}>Choose a file</option
|
||||
>{#each eligibleFor(index) as file}<option value={file.id}
|
||||
>[{file.kind}] {file.name}</option
|
||||
>{/each}</select
|
||||
></label
|
||||
>{/each}</Select
|
||||
></Field
|
||||
>
|
||||
<label
|
||||
>Exact version<select
|
||||
<Field label="Exact version">
|
||||
<Select
|
||||
bind:value={pick.versionId}
|
||||
disabled={pick.scriptId === null ||
|
||||
loadingVersions.has(pick.key)}
|
||||
@@ -702,8 +706,8 @@
|
||||
0,
|
||||
8
|
||||
)} · {version.state.replaceAll('-', ' ')}</option
|
||||
>{/each}</select
|
||||
></label
|
||||
>{/each}</Select
|
||||
></Field
|
||||
>
|
||||
<Button
|
||||
ariaLabel={`Remove file ${index + 1}`}
|
||||
@@ -742,8 +746,8 @@
|
||||
At launch, Electric Cherry chooses compatible servers with the fewest
|
||||
current players. Every requested instance must pass the test plan.
|
||||
</p>
|
||||
<label class="instance-count"
|
||||
>Instances per game<input
|
||||
<Field class="instance-count" label="Instances per game">
|
||||
<Input
|
||||
type="number"
|
||||
min="1"
|
||||
max="1000"
|
||||
@@ -756,7 +760,7 @@
|
||||
: event.currentTarget.valueAsNumber)}
|
||||
/><span class="muted"
|
||||
>The same number applies to every game in this beta.</span
|
||||
></label
|
||||
></Field
|
||||
>
|
||||
<p class="muted">
|
||||
{applicableGames
|
||||
@@ -812,14 +816,14 @@
|
||||
</fieldset>
|
||||
{#if selectionMode === 'manual' && candidateServers.length}
|
||||
<div class="filters">
|
||||
<label
|
||||
>Find servers<input
|
||||
<Field label="Find servers">
|
||||
<Input
|
||||
type="search"
|
||||
bind:value={search}
|
||||
placeholder="Name, map, lobby…"
|
||||
/></label
|
||||
><label
|
||||
>Game<select bind:value={serverGame}
|
||||
/></Field
|
||||
><Field label="Game">
|
||||
<Select bind:value={serverGame}
|
||||
><option value="">All games</option
|
||||
>{#each [...new Set(fleetServers
|
||||
.map((s) => s.game)
|
||||
@@ -829,16 +833,16 @@
|
||||
: game === 't6'
|
||||
? 'Black Ops II'
|
||||
: game}</option
|
||||
>{/each}</select
|
||||
></label
|
||||
><label
|
||||
>Availability<select bind:value={availability}
|
||||
>{/each}</Select
|
||||
></Field
|
||||
><Field label="Availability">
|
||||
<Select bind:value={availability}
|
||||
><option value="">All servers</option><option value="empty"
|
||||
>Confirmed empty</option
|
||||
><option value="occupied">Occupied</option><option
|
||||
value="unknown">Unknown / stale / offline</option
|
||||
></select
|
||||
></label
|
||||
></Select
|
||||
></Field
|
||||
>
|
||||
</div>
|
||||
<div class="actions">
|
||||
@@ -999,8 +1003,7 @@
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.beta-form input:not([type='checkbox']):not([type='radio']),
|
||||
.beta-form select {
|
||||
.beta-form input:not([type='checkbox']):not([type='radio']) {
|
||||
border-color: var(--border-control);
|
||||
}
|
||||
.page,
|
||||
@@ -1081,8 +1084,7 @@
|
||||
color: var(--text-secondary);
|
||||
min-width: 0;
|
||||
}
|
||||
input:not([type='checkbox']):not([type='radio']),
|
||||
select {
|
||||
input:not([type='checkbox']):not([type='radio']) {
|
||||
width: 100%;
|
||||
min-height: 40px;
|
||||
padding: 9px 12px;
|
||||
@@ -1108,7 +1110,7 @@
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
}
|
||||
.instance-count {
|
||||
.automatic-selection :global(.instance-count) {
|
||||
max-width: 400px;
|
||||
}
|
||||
.advanced-selection {
|
||||
@@ -1148,7 +1150,8 @@
|
||||
.filters {
|
||||
align-items: end;
|
||||
}
|
||||
.filters label {
|
||||
|
||||
.filters :global(.field) {
|
||||
flex: 1 1 180px;
|
||||
}
|
||||
.draft-status,
|
||||
@@ -1217,7 +1220,8 @@
|
||||
.pick-row {
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
}
|
||||
.pick-row label:first-child {
|
||||
|
||||
.pick-row > :global(.field:first-child) {
|
||||
grid-column: 1/-1;
|
||||
}
|
||||
.steps {
|
||||
|
||||
Reference in New Issue
Block a user