Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsMeBrianD committed Feb 11, 2025
1 parent 825e45b commit 009cc01
Show file tree
Hide file tree
Showing 4 changed files with 756 additions and 1,010 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@
$: options[fieldValueKey] = fieldValue;
$: fieldDisabled = disabled || spec.forceReference || (spec.references && refVal !== null);
const inputClasses = "rounded-md border border-base-300 bg-base-100 shadow-sm px-2 py-1 text-sm focus-visible:ring-base-300 flex h-9 w-full transition-colors focus-visible:outline-none focus-visible:ring-1 p-1 ml-auto align-middle"
</script>
<div class="w-full mb-2">
Expand All @@ -161,15 +164,15 @@
{#if spec.type === 'string'}
{#if spec.secret && !reveal && spec.shown !== true}
<input
class="rounded-sm border border-base-300 p-1 ml-auto w-2/3 bg-base-100 align-middle text-sm"
class="{inputClasses}"
disabled={fieldDisabled}
required={spec.required}
type="password"
bind:value={fieldValue}
/>
{:else}
<input
class="rounded-sm border border-base-300 p-1 ml-auto w-2/3 bg-base-100 align-middle text-sm"
class="{inputClasses}"
disabled={fieldDisabled}
required={spec.required}
type="text"
Expand All @@ -181,7 +184,7 @@
></textarea>
{:else if spec.type === 'number'}
<input
class="rounded-sm border border-base-300 p-1 ml-auto w-2/3 bg-base-100 align-middle text-sm"
class="{inputClasses}"
disabled={fieldDisabled}
required={spec.required}
type="number"
Expand All @@ -191,7 +194,7 @@
<select
disabled={fieldDisabled}
bind:value={fieldValue}
class="rounded-sm border border-base-300 p-1 ml-auto w-2/3 bg-base-100 align-middle text-sm"
class="{inputClasses}"
>
<option disabled={spec.required} value={undefined} />
{#each spec.options as option}
Expand Down Expand Up @@ -233,16 +236,4 @@
/>
</div>
{/if}
</div>
<style lang="postcss">
input:not([type='file']),
select,
textarea {
@apply rounded-md border border-base-300 bg-base-100 shadow-sm px-2 py-1 text-sm focus-visible:ring-base-300 flex h-9 w-full rounded-md border bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1;
}
input[type='file'] {
@apply hidden;
}
</style>
</div>
Loading

0 comments on commit 009cc01

Please sign in to comment.