852 lines
29 KiB
Plaintext
852 lines
29 KiB
Plaintext
component TogglePassword {
|
|
outputs {
|
|
input(payload: { name?: string; value: string | number | boolean | null | object; visible: boolean })
|
|
change(payload: { name?: string; value: string | number | boolean | null | object; visible: boolean })
|
|
toggle(payload: { visible: boolean })
|
|
}
|
|
|
|
props {
|
|
size: string = "default"
|
|
color: string = "primary"
|
|
label: string = "Password"
|
|
name: string = "password"
|
|
value: string = ""
|
|
placeholder: string = "Enter your password"
|
|
autocomplete: string = "current-password"
|
|
minlength: string = ""
|
|
maxlength: string = ""
|
|
pattern: string = "(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).{8,}"
|
|
fields: unknown[] = []
|
|
visible: boolean = false
|
|
toggleable: boolean = true
|
|
toggleMode: string = "button"
|
|
checkboxLabel: string = "Show password"
|
|
showLabel: string = "Show password"
|
|
hideLabel: string = "Hide password"
|
|
disabled: boolean = false
|
|
readonly: boolean = false
|
|
required: boolean = false
|
|
invalid: boolean = false
|
|
helpText: string = ""
|
|
validationMessage: string = ""
|
|
class: string = ""
|
|
}
|
|
|
|
state revealed = visible
|
|
|
|
functions {
|
|
shared function toggleVisibility() {
|
|
if (disabled || readonly || !toggleable) {
|
|
return
|
|
}
|
|
revealed = !revealed
|
|
}
|
|
|
|
shared function fieldId(field, index) {
|
|
return field.id || field.name || name + "-" + index
|
|
}
|
|
|
|
shared function fieldName(field, index) {
|
|
return field.name || name + "-" + index
|
|
}
|
|
}
|
|
|
|
view {
|
|
<fieldset
|
|
class="wire-component wire-component--color-{color} wire-component--size-{size} wire-next--toggle-password {invalid ? 'wire-next--invalid' : ''} {disabled ? 'wire-next--disabled' : ''} {class}"
|
|
data-wrn-toggle-password
|
|
data-visible="{revealed ? 'true' : 'false'}"
|
|
>
|
|
{#if fields.length}
|
|
<div class="wire-next__password-fields">
|
|
{#each fields as field, index}
|
|
<div class="wire-next__password-field">
|
|
<label for="{fieldId(field, index)}">{field.label || label}</label>
|
|
<div class="wire-next__password-control">
|
|
<input
|
|
id="{fieldId(field, index)}"
|
|
type="{revealed ? 'text' : 'password'}"
|
|
name="{fieldName(field, index)}"
|
|
value="{field.value || ''}"
|
|
placeholder="{field.placeholder || placeholder}"
|
|
autocomplete="{field.autocomplete || autocomplete}"
|
|
minlength="{field.minlength || minlength}"
|
|
maxlength="{field.maxlength || maxlength}"
|
|
pattern="{field.pattern || pattern}"
|
|
disabled="{disabled || field.disabled}"
|
|
readonly="{readonly || field.readonly}"
|
|
required="{required || field.required}"
|
|
aria-invalid="{invalid ? 'true' : 'false'}"
|
|
@input="output.input({ name: event.target.name, value: event.target.value, visible: revealed })"
|
|
@change="output.change({ name: event.target.name, value: event.target.value, visible: revealed })"
|
|
/>
|
|
{#if toggleable && toggleMode === "button"}
|
|
<button
|
|
type="button"
|
|
class="wire-next__password-toggle"
|
|
aria-label="{revealed ? hideLabel : showLabel}"
|
|
title="{revealed ? hideLabel : showLabel}"
|
|
aria-pressed="{revealed ? 'true' : 'false'}"
|
|
disabled="{disabled || readonly}"
|
|
@click="toggleVisibility(); output.toggle({ visible: revealed })"
|
|
>
|
|
<span class="wire-next__password-icon wire-next__password-icon--show" aria-hidden="true"></span>
|
|
</button>
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
{/each}
|
|
</div>
|
|
{:else}
|
|
<label for="{name}-password">{label}</label>
|
|
<div class="wire-next__password-control">
|
|
<input
|
|
{...attrs}
|
|
id="{name}-password"
|
|
type="{revealed ? 'text' : 'password'}"
|
|
name="{name}"
|
|
value="{value}"
|
|
placeholder="{placeholder}"
|
|
autocomplete="{autocomplete}"
|
|
minlength="{minlength}"
|
|
maxlength="{maxlength}"
|
|
pattern="{pattern}"
|
|
disabled="{disabled}"
|
|
readonly="{readonly}"
|
|
required="{required}"
|
|
aria-invalid="{invalid ? 'true' : 'false'}"
|
|
aria-describedby="{validationMessage ? name + '-validation' : helpText ? name + '-help' : ''}"
|
|
@input="output.input({ value: event.target.value, visible: revealed })"
|
|
@change="output.change({ value: event.target.value, visible: revealed })"
|
|
/>
|
|
{#if toggleable && toggleMode === "button"}
|
|
<button
|
|
type="button"
|
|
class="wire-next__password-toggle"
|
|
aria-label="{revealed ? hideLabel : showLabel}"
|
|
title="{revealed ? hideLabel : showLabel}"
|
|
aria-pressed="{revealed ? 'true' : 'false'}"
|
|
disabled="{disabled || readonly}"
|
|
@click="toggleVisibility(); output.toggle({ visible: revealed })"
|
|
>
|
|
<span class="wire-next__password-icon wire-next__password-icon--show" aria-hidden="true"></span>
|
|
</button>
|
|
{/if}
|
|
</div>
|
|
{/if}
|
|
{#if toggleable && toggleMode === "checkbox"}
|
|
<label class="wire-next__password-checkbox">
|
|
<input
|
|
type="checkbox"
|
|
checked="{revealed}"
|
|
disabled="{disabled || readonly}"
|
|
@change="revealed = event.target.checked; output.toggle({ visible: revealed })"
|
|
/>
|
|
<span>{checkboxLabel}</span>
|
|
</label>
|
|
{/if}
|
|
{#if helpText && !validationMessage}<small id="{name}-help">{helpText}</small>{/if}
|
|
<small
|
|
id="{name}-validation"
|
|
class="wire-next__validation"
|
|
data-error="{name}"
|
|
>{validationMessage}</small>
|
|
</fieldset>
|
|
}
|
|
|
|
style {
|
|
.wire-next--toggle-password {
|
|
display: grid;
|
|
width: 100%;
|
|
min-width: 0;
|
|
max-width: none;
|
|
box-sizing: border-box;
|
|
gap: 0.45rem;
|
|
padding: 0;
|
|
border: 0;
|
|
}
|
|
|
|
.wire-next--toggle-password > label {
|
|
color: var(--wire-color-text);
|
|
font-size: 0.75rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.wire-next__password-fields {
|
|
display: grid;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.wire-next__password-field {
|
|
display: grid;
|
|
gap: 0.45rem;
|
|
}
|
|
|
|
.wire-next__password-field > label {
|
|
color: var(--wire-color-text);
|
|
font-size: 0.82em;
|
|
font-weight: 750;
|
|
}
|
|
|
|
.wire-next__password-control {
|
|
position: relative;
|
|
display: flex;
|
|
min-width: 0;
|
|
align-items: center;
|
|
width: 100%;
|
|
}
|
|
|
|
.wire-next__password-control > input {
|
|
width: 100%;
|
|
min-width: 0;
|
|
min-height: 2.75em;
|
|
padding: 0.65em 3em 0.65em 0.8em;
|
|
border: 1px solid var(--wire-color-border);
|
|
border-radius: var(--wire-radius-sm);
|
|
outline: 0;
|
|
color: var(--wire-color-text);
|
|
background: var(--wire-color-bg);
|
|
font: inherit;
|
|
font-size: 0.8125rem;
|
|
transition:
|
|
border-color var(--wire-motion-base) var(--wire-ease-standard),
|
|
box-shadow var(--wire-motion-base) var(--wire-ease-standard);
|
|
}
|
|
|
|
.wire-next__password-control > input:focus-visible {
|
|
border-color: var(--wire-component-color);
|
|
box-shadow: 0 0 0 3px color-mix(in srgb, var(--wire-component-color) 18%, transparent);
|
|
}
|
|
|
|
.wire-next__password-toggle {
|
|
position: absolute;
|
|
top: 50%;
|
|
right: 0.45em;
|
|
display: grid;
|
|
width: 2em;
|
|
height: 2em;
|
|
padding: 0;
|
|
place-items: center;
|
|
border: 0;
|
|
border-radius: calc(var(--wire-radius-sm) * 0.72);
|
|
color: var(--wire-color-muted);
|
|
background: transparent;
|
|
cursor: pointer;
|
|
transform: translateY(-50%);
|
|
}
|
|
|
|
.wire-next__password-toggle:hover,
|
|
.wire-next__password-toggle:focus-visible {
|
|
color: var(--wire-component-color);
|
|
background: color-mix(in srgb, var(--wire-component-color) 10%, transparent);
|
|
outline: 0;
|
|
}
|
|
|
|
.wire-next__password-icon {
|
|
display: block;
|
|
width: 1.05em;
|
|
height: 1.05em;
|
|
background: currentColor;
|
|
mask-position: center;
|
|
mask-repeat: no-repeat;
|
|
mask-size: contain;
|
|
}
|
|
|
|
.wire-next__password-icon--show {
|
|
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.06 12.35a1 1 0 0 1 0-.7C3.7 7.6 7.64 5 12 5c4.36 0 8.3 2.6 9.94 6.65a1 1 0 0 1 0 .7C20.3 16.4 16.36 19 12 19c-4.36 0-8.3-2.6-9.94-6.65Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
|
|
}
|
|
|
|
.wire-next__password-toggle[aria-pressed="true"]::after {
|
|
position: absolute;
|
|
width: 1.25em;
|
|
height: 0.12em;
|
|
border-radius: 999px;
|
|
background: currentColor;
|
|
content: "";
|
|
transform: rotate(45deg);
|
|
box-shadow: 0 0 0 1px var(--wire-color-bg);
|
|
}
|
|
|
|
.wire-next__password-checkbox {
|
|
display: inline-flex;
|
|
width: fit-content;
|
|
align-items: center;
|
|
gap: 0.55rem;
|
|
color: var(--wire-color-muted);
|
|
font-size: 0.78em;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.wire-next__password-checkbox > input {
|
|
width: 1rem;
|
|
height: 1rem;
|
|
margin: 0;
|
|
accent-color: var(--wire-component-color);
|
|
}
|
|
|
|
.wire-next--toggle-password > small {
|
|
color: var(--wire-color-muted);
|
|
font-size: 0.72em;
|
|
}
|
|
|
|
/* Shared component foundation. */
|
|
|
|
.wire-component {
|
|
--wire-component-color: var(--wire-color-primary);
|
|
--wire-component-scale: 1;
|
|
margin: 0;
|
|
color: var(--wire-color-text);
|
|
font-family: var(--wrn-font-sans, inherit);
|
|
}
|
|
|
|
.wire-component--color-primary {
|
|
--wire-component-color: var(--wire-color-primary);
|
|
}
|
|
|
|
.wire-component--color-secondary {
|
|
--wire-component-color: var(--wire-color-secondary);
|
|
}
|
|
|
|
.wire-component--color-success {
|
|
--wire-component-color: var(--wire-color-success);
|
|
}
|
|
|
|
.wire-component--color-warning {
|
|
--wire-component-color: var(--wire-color-warning);
|
|
}
|
|
|
|
.wire-component--color-danger {
|
|
--wire-component-color: var(--wire-color-danger);
|
|
}
|
|
|
|
.wire-component--color-info {
|
|
--wire-component-color: var(--wire-color-info);
|
|
}
|
|
|
|
.wire-component--size-xs {
|
|
--wire-component-scale: 0.78;
|
|
}
|
|
|
|
.wire-component--size-sm {
|
|
--wire-component-scale: 0.88;
|
|
}
|
|
|
|
.wire-component--size-default,
|
|
.wire-component--size-md {
|
|
--wire-component-scale: 1;
|
|
}
|
|
|
|
.wire-component--size-lg {
|
|
--wire-component-scale: 1.14;
|
|
}
|
|
|
|
.wire-component--size-xl {
|
|
--wire-component-scale: 1.28;
|
|
}
|
|
|
|
.wire-component:not(.wire-btn) {
|
|
font-size: calc(1em * var(--wire-component-scale));
|
|
}
|
|
|
|
.wire-component :is(a, button, input, select, textarea):focus-visible {
|
|
outline-color: var(--wire-component-color);
|
|
}
|
|
|
|
.wire-component p {
|
|
margin: 0;
|
|
color: var(--wire-color-muted);
|
|
line-height: 1.6;
|
|
}
|
|
|
|
/* Shared field foundation. */
|
|
|
|
/* Validation states set by the browser validation runtime. */
|
|
.wire-invalid {
|
|
border-color: var(--wire-color-danger) !important;
|
|
}
|
|
|
|
.wire-field-error {
|
|
display: block;
|
|
min-height: 1em;
|
|
margin-top: 0.25rem;
|
|
color: var(--wire-color-danger);
|
|
font-size: 0.8rem;
|
|
}
|
|
|
|
.wire-next--choice {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.55rem;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.wire-next--choice input {
|
|
width: 1.1rem;
|
|
height: 1.1rem;
|
|
accent-color: var(--wire-color-primary);
|
|
}
|
|
|
|
.wire-next--field {
|
|
display: grid;
|
|
width: min(100%, 28rem);
|
|
gap: 0.4rem;
|
|
font-size: 0.78rem;
|
|
font-weight: 700;
|
|
}
|
|
.wire-next--field :where(input, textarea, select) {
|
|
width: 100%;
|
|
min-height: 2.65rem;
|
|
padding: 0.6rem 0.7rem;
|
|
border: 1px solid var(--wire-color-border);
|
|
border-radius: 0.6rem;
|
|
outline: 0;
|
|
color: var(--wire-color-text);
|
|
background: var(--wire-color-bg);
|
|
font: inherit;
|
|
font-weight: 500;
|
|
}
|
|
.wire-auth-form form > .wire-next--field,
|
|
.wire-auth-form form > .wire-field {
|
|
width: 100%;
|
|
max-width: none;
|
|
}
|
|
.wire-auth-form__submit > .wire-btn {
|
|
width: 100%;
|
|
min-height: 3rem;
|
|
border-radius: 0.75rem;
|
|
box-shadow: 0 0.8rem 1.8rem color-mix(in srgb, var(--wire-btn-color) 20%, transparent);
|
|
}
|
|
.wire-next--field :where(input, textarea, select):focus-visible {
|
|
border-color: var(--wire-color-primary);
|
|
box-shadow: 0 0 0 3px color-mix(in srgb, var(--wire-color-primary) 16%, transparent);
|
|
}
|
|
.wire-next--field textarea {
|
|
resize: vertical;
|
|
}
|
|
.wire-next--field,
|
|
.wire-next--choice-field {
|
|
--wire-field-color: var(--wire-component-color, var(--wire-color-primary));
|
|
width: min(100%, 34rem);
|
|
min-width: 0;
|
|
color: var(--wire-color-text);
|
|
font-size: 0.8125rem;
|
|
font-weight: 500;
|
|
}
|
|
.wire-next--field.wire-next--size-sm,
|
|
.wire-next--choice-field.wire-next--size-sm {
|
|
font-size: 0.8125rem;
|
|
}
|
|
.wire-next--field.wire-next--size-lg,
|
|
.wire-next--choice-field.wire-next--size-lg {
|
|
font-size: 1rem;
|
|
}
|
|
.wire-next__field-heading {
|
|
display: flex;
|
|
min-width: 0;
|
|
align-items: baseline;
|
|
justify-content: space-between;
|
|
gap: 1rem;
|
|
}
|
|
.wire-next__field-heading label {
|
|
color: var(--wire-color-text);
|
|
font-weight: 600;
|
|
}
|
|
.wire-next__field-hint,
|
|
.wire-next__field-help {
|
|
color: var(--wire-color-muted);
|
|
font-size: 0.82em;
|
|
font-weight: 500;
|
|
}
|
|
.wire-next__field-control {
|
|
position: relative;
|
|
min-width: 0;
|
|
}
|
|
.wire-next__field-control > :is(input, textarea, select) {
|
|
padding-inline: 0.85rem;
|
|
border-color: var(--wire-color-border);
|
|
border-radius: var(--wire-radius-sm);
|
|
background: var(--wire-color-surface);
|
|
font-size: 0.8125rem;
|
|
}
|
|
.wire-next__field-control[data-icon-position="start"] > :is(input, textarea, select) {
|
|
padding-inline-start: 2.5rem;
|
|
}
|
|
.wire-next__field-control[data-icon-position="end"] > :is(input, textarea, select) {
|
|
padding-inline-end: 2.5rem;
|
|
}
|
|
.wire-next__field-icon {
|
|
position: absolute;
|
|
z-index: 1;
|
|
top: 50%;
|
|
left: 0.85rem;
|
|
color: var(--wire-color-muted);
|
|
pointer-events: none;
|
|
transform: translateY(-50%);
|
|
}
|
|
.wire-next__field-control[data-icon-position="end"] > .wire-next__field-icon {
|
|
right: 0.85rem;
|
|
left: auto;
|
|
}
|
|
.wire-next--field[data-variant="outlined"]
|
|
.wire-next__field-control
|
|
> :is(input, textarea, select) {
|
|
border-width: 2px;
|
|
}
|
|
.wire-next--field[data-variant="underline"]
|
|
.wire-next__field-control
|
|
> :is(input, textarea, select) {
|
|
padding-inline: 0;
|
|
border-width: 0 0 1px;
|
|
border-radius: 0;
|
|
background: transparent;
|
|
box-shadow: none;
|
|
}
|
|
.wire-next--field[data-variant="pill"] .wire-next__field-control > :is(input, select) {
|
|
border-radius: 999px;
|
|
padding-inline: 1.15rem;
|
|
}
|
|
.wire-next--field[data-variant="ghost"] .wire-next__field-control > :is(input, textarea, select) {
|
|
border-color: transparent;
|
|
background: color-mix(in srgb, var(--wire-field-color) 8%, var(--wire-color-surface));
|
|
}
|
|
.wire-next__field-floating-label {
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 0.85rem;
|
|
color: var(--wire-color-muted);
|
|
pointer-events: none;
|
|
transform: translateY(-50%);
|
|
transition: 150ms ease;
|
|
}
|
|
.wire-next--textarea .wire-next__field-floating-label {
|
|
top: 1.35rem;
|
|
}
|
|
.wire-next--field[data-floating="true"] .wire-next__field-control > :is(input, textarea, select) {
|
|
padding-top: 1.2rem;
|
|
padding-bottom: 0.3rem;
|
|
}
|
|
.wire-next--field[data-floating="true"] .wire-next__field-heading > label {
|
|
position: absolute !important;
|
|
width: 1px !important;
|
|
height: 1px !important;
|
|
overflow: hidden !important;
|
|
margin: -1px !important;
|
|
clip: rect(0, 0, 0, 0) !important;
|
|
white-space: nowrap !important;
|
|
}
|
|
.wire-next--field[data-floating="true"]
|
|
.wire-next__field-heading:not(:has(.wire-next__field-hint)) {
|
|
display: none;
|
|
}
|
|
.wire-next--field[data-floating="true"]
|
|
.wire-next__field-control
|
|
> :is(input, textarea):is(:focus, :not(:placeholder-shown))
|
|
+ .wire-next__field-floating-label {
|
|
top: 0.42rem;
|
|
font-size: 0.7em;
|
|
transform: none;
|
|
}
|
|
.wire-next__field-error {
|
|
min-height: 1em;
|
|
color: var(--wire-color-danger);
|
|
font-size: 0.82em;
|
|
font-weight: 600;
|
|
}
|
|
.wire-next__field-error:empty {
|
|
display: none;
|
|
}
|
|
.wire-next--field[data-invalid="true"] :is(input, textarea, select),
|
|
.wire-next--choice-field[data-invalid="true"] input {
|
|
border-color: var(--wire-color-danger);
|
|
}
|
|
.wire-next--field :is(input, textarea, select):disabled,
|
|
.wire-next--choice-field input:disabled {
|
|
cursor: not-allowed;
|
|
opacity: 0.58;
|
|
}
|
|
.wire-next--field :is(input, textarea, select):read-only {
|
|
background: var(--wire-color-surface-2);
|
|
}
|
|
.wire-next--field[data-inline="true"],
|
|
.wire-next--choice-field[data-inline="true"] {
|
|
display: grid;
|
|
width: 100%;
|
|
max-width: none;
|
|
grid-template-columns: minmax(7rem, max-content) minmax(12rem, 20rem) minmax(10rem, 1fr);
|
|
justify-content: center;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
}
|
|
.wire-next--field[data-inline="true"] .wire-next__field-heading,
|
|
.wire-next--choice-field[data-inline="true"] .wire-next__field-heading {
|
|
min-height: 2.65rem;
|
|
align-items: center;
|
|
}
|
|
.wire-next--field[data-inline="true"] .wire-next__field-heading {
|
|
justify-content: flex-end;
|
|
}
|
|
.wire-next--field[data-inline="true"] .wire-next__field-help,
|
|
.wire-next--choice-field[data-inline="true"] .wire-next__field-help {
|
|
display: flex;
|
|
min-height: 2.65rem;
|
|
align-items: center;
|
|
}
|
|
.wire-next--choice-field[data-inline="true"] {
|
|
grid-template-columns: minmax(12rem, 20rem) minmax(10rem, 1fr);
|
|
}
|
|
.wire-next--choice-field[data-inline="true"] .wire-next__field-heading:empty {
|
|
display: none;
|
|
}
|
|
.wire-next--field[data-inline="true"] .wire-next__field-error,
|
|
.wire-next--choice-field[data-inline="true"] .wire-next__field-error {
|
|
grid-column: 2 / -1;
|
|
}
|
|
.wire-next__sr-only {
|
|
position: absolute !important;
|
|
width: 1px !important;
|
|
height: 1px !important;
|
|
overflow: hidden !important;
|
|
padding: 0 !important;
|
|
border: 0 !important;
|
|
margin: -1px !important;
|
|
clip: rect(0, 0, 0, 0) !important;
|
|
white-space: nowrap !important;
|
|
}
|
|
.wire-next__choice-field {
|
|
display: grid;
|
|
width: 100%;
|
|
max-width: none;
|
|
gap: 0.4rem;
|
|
}
|
|
.wire-next__choice {
|
|
display: flex;
|
|
min-width: 0;
|
|
align-items: center;
|
|
gap: 0.65rem;
|
|
color: var(--wire-color-text);
|
|
width: 100%;
|
|
font-size: 0.75rem;
|
|
font-weight: 500;
|
|
}
|
|
.wire-next__checkbox-content > .wire-next__choice {
|
|
width: 100%;
|
|
min-width: 0;
|
|
align-items: flex-start;
|
|
}
|
|
.wire-next__choice input {
|
|
flex: 0 0 auto;
|
|
margin: 0;
|
|
accent-color: var(--wire-field-color);
|
|
}
|
|
.wire-next__choice-copy {
|
|
display: grid;
|
|
min-width: 0;
|
|
gap: 0.15rem;
|
|
line-height: 1.35;
|
|
}
|
|
.wire-next__choice-copy small {
|
|
color: var(--wire-color-muted);
|
|
font-weight: 500;
|
|
}
|
|
.wire-next__radio-group,
|
|
.wire-next__checkbox-group {
|
|
display: grid;
|
|
min-width: 0;
|
|
gap: 0.65rem;
|
|
}
|
|
.wire-next--radio-field[data-orientation="horizontal"] .wire-next__radio-group,
|
|
.wire-next--checkbox-field[data-orientation="horizontal"] .wire-next__checkbox-group {
|
|
grid-template-columns: repeat(auto-fit, minmax(8rem, max-content));
|
|
align-items: stretch;
|
|
}
|
|
.wire-next--radio-field[data-card="true"] .wire-next__radio-group,
|
|
.wire-next--checkbox-field[data-card="true"] .wire-next__checkbox-group {
|
|
grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
|
|
}
|
|
.wire-next--radio-field[data-card="true"] .wire-next--radio,
|
|
.wire-next--checkbox-field[data-card="true"] .wire-next--checkbox {
|
|
min-height: 4.5rem;
|
|
padding: 0.85rem;
|
|
border: 1px solid var(--wire-color-border);
|
|
border-radius: var(--wire-radius-sm);
|
|
background: var(--wire-color-surface);
|
|
}
|
|
.wire-next--radio-field[data-card="true"] .wire-next--radio:has(input:checked),
|
|
.wire-next--checkbox-field[data-card="true"] .wire-next--checkbox:has(input:checked) {
|
|
border-color: var(--wire-field-color);
|
|
box-shadow: 0 0 0 1px var(--wire-field-color);
|
|
}
|
|
.wire-next--radio-field[data-list="true"] .wire-next--radio,
|
|
.wire-next--checkbox-field[data-list="true"] .wire-next--checkbox {
|
|
padding-block: 0.75rem;
|
|
border-bottom: 1px solid var(--wire-color-border);
|
|
}
|
|
.wire-next--radio-field[data-right-aligned="true"] .wire-next--radio,
|
|
.wire-next--checkbox-field[data-right-aligned="true"] .wire-next--checkbox {
|
|
justify-content: space-between;
|
|
}
|
|
.wire-next--radio-field[data-right-aligned="true"] .wire-next--radio input,
|
|
.wire-next--checkbox-field[data-right-aligned="true"] .wire-next--checkbox input {
|
|
order: 2;
|
|
}
|
|
.wire-next--radio-field[data-right-aligned="true"] .wire-next__choice-copy,
|
|
.wire-next--checkbox-field[data-right-aligned="true"] .wire-next__choice-copy {
|
|
order: 1;
|
|
}
|
|
.wire-next__choice[data-variant="outlined"],
|
|
.wire-next__choice[data-variant="floating"] {
|
|
padding: 0.65rem 0.8rem;
|
|
border: 1px solid var(--wire-color-border);
|
|
border-radius: var(--wire-radius-sm);
|
|
}
|
|
.wire-next__choice[data-variant="pill"] {
|
|
padding: 0.65rem 1rem;
|
|
border-radius: 999px;
|
|
background: color-mix(in srgb, var(--wire-field-color) 9%, var(--wire-color-surface));
|
|
}
|
|
.wire-next__choice[data-variant="ghost"] {
|
|
padding: 0.65rem 0.8rem;
|
|
border-radius: var(--wire-radius-sm);
|
|
background: color-mix(in srgb, var(--wire-field-color) 7%, transparent);
|
|
}
|
|
.wire-next__choice[data-variant="underline"] {
|
|
padding-block: 0.5rem;
|
|
border-bottom: 1px solid var(--wire-color-border);
|
|
}
|
|
.wire-next--select .wire-next__field-control {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
.wire-next__color-control,
|
|
.wire-next__range-control,
|
|
.wire-next__input-group-control,
|
|
.wire-next__file-control {
|
|
display: flex;
|
|
min-width: 0;
|
|
align-items: center;
|
|
gap: 0.65rem;
|
|
}
|
|
.wire-next__picker-control,
|
|
.wire-next--time-picker .wire-next__field-control {
|
|
position: relative;
|
|
display: flex;
|
|
min-width: 0;
|
|
align-items: center;
|
|
}
|
|
.wire-next__picker-control > button:first-of-type,
|
|
.wire-next__time-trigger {
|
|
display: flex;
|
|
width: 100%;
|
|
min-height: 2.65rem;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 0.75rem;
|
|
padding: 0.7rem 0.85rem;
|
|
border: 1px solid var(--wire-color-border);
|
|
border-radius: var(--wire-radius-sm);
|
|
background: var(--wire-color-surface);
|
|
color: var(--wire-color-text);
|
|
font: inherit;
|
|
text-align: left;
|
|
}
|
|
.wire-next__calendar,
|
|
.wire-next__time-panel {
|
|
z-index: 20;
|
|
display: grid;
|
|
width: min(100%, 22rem);
|
|
gap: 0.75rem;
|
|
padding: 0.85rem;
|
|
border: 1px solid var(--wire-color-border);
|
|
border-radius: var(--wire-radius-md);
|
|
background: var(--wire-color-surface);
|
|
box-shadow: var(--wire-shadow-3);
|
|
}
|
|
.wire-next--date-picker[data-expanded="false"] .wire-next__calendar,
|
|
.wire-next--time-picker[data-expanded="false"] .wire-next__time-panel {
|
|
display: none;
|
|
}
|
|
.wire-next__calendar button,
|
|
.wire-next__time-panel button {
|
|
min-height: 2.25rem;
|
|
border: 0;
|
|
border-radius: var(--wire-radius-sm);
|
|
background: transparent;
|
|
color: inherit;
|
|
}
|
|
.wire-next__calendar-weekdays,
|
|
.wire-next__calendar-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(7, 1fr);
|
|
gap: 0.2rem;
|
|
text-align: center;
|
|
}
|
|
.wire-next__calendar-weekdays {
|
|
color: var(--wire-color-muted);
|
|
font-size: 0.75rem;
|
|
}
|
|
.wire-next__calendar-grid button:hover,
|
|
.wire-next__time-panel button:hover {
|
|
background: var(--wire-color-surface-2);
|
|
}
|
|
.wire-next__calendar-grid button[aria-pressed="true"],
|
|
.wire-next__time-panel button[aria-pressed="true"] {
|
|
background: var(--wire-field-color);
|
|
color: var(--wire-color-primary-contrast, #fff);
|
|
}
|
|
.wire-next__time-period {
|
|
display: flex;
|
|
gap: 0.35rem;
|
|
}
|
|
.wire-next--file-upload-progress .wire-next__row,
|
|
.wire-next__upload-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 0.75rem;
|
|
}
|
|
.wire-next--file-upload-progress .wire-next__row > span {
|
|
display: grid;
|
|
min-width: 0;
|
|
}
|
|
.wire-next--field[data-variant="underline"]
|
|
:is(.wire-next__input-group-control, .wire-next__file-control, .wire-next__color-control) {
|
|
border-width: 0 0 1px;
|
|
border-radius: 0;
|
|
background: transparent;
|
|
}
|
|
.wire-next--field[data-variant="outlined"]
|
|
:is(.wire-next__input-group-control, .wire-next__file-control) {
|
|
border-width: 2px;
|
|
}
|
|
.wire-next--field[data-variant="pill"]
|
|
:is(.wire-next__input-group-control, .wire-next__file-control) {
|
|
border-radius: 999px;
|
|
}
|
|
.wire-next--field[data-variant="ghost"]
|
|
:is(.wire-next__input-group-control, .wire-next__file-control, .wire-next__color-control) {
|
|
border-color: transparent;
|
|
background: color-mix(in srgb, var(--wire-field-color) 8%, var(--wire-color-surface));
|
|
}
|
|
@media (max-width: 640px) {
|
|
.wire-next--field[data-inline="true"],
|
|
.wire-next--choice-field[data-inline="true"] {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.wire-next--field[data-inline="true"] .wire-next__field-error,
|
|
.wire-next--choice-field[data-inline="true"] .wire-next__field-error {
|
|
grid-column: auto;
|
|
}
|
|
}
|
|
.wire-next--toggle-password:has(input.wire-invalid) .wire-next__password-control > input,
|
|
.wire-next--toggle-password.wire-next--invalid .wire-next__password-control > input {
|
|
border-color: var(--wire-color-danger);
|
|
box-shadow: 0 0 0 3px color-mix(in srgb, var(--wire-color-danger) 14%, transparent);
|
|
}
|
|
.wire-next--strong-password.wire-next--invalid input,
|
|
.wire-next--strong-password input.wire-invalid {
|
|
border-color: var(--wire-color-danger);
|
|
}
|
|
}
|
|
}
|