Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: solid date button border color #353

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/lib/components/ui/input/date-input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import type { HTMLInputAttributes } from 'svelte/elements'
import Typography from '../typography.svelte'

type Variant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'large' | 'default' | 'small'
type TypoVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'large' | 'default' | 'small'

let {
dimension = 'default',
variant = 'outline',
disabled,
value = $bindable(),
...restProps
Expand All @@ -23,7 +24,7 @@
let showDatePicker = $state(false)
let isMobile = $state(false)
let size: 16 | 24 | 32 = $derived(dimension === 'large' ? 32 : dimension === 'small' ? 16 : 24)
let variant: Variant = $derived(
let typoVariant: TypoVariant = $derived(
isMobile
? 'small'
: dimension === 'large'
Expand Down Expand Up @@ -191,7 +192,7 @@
<Button
{dimension}
{disabled}
variant="secondary"
variant={variant === 'outline' ? 'secondary' : 'solid'}
onclick={(e:MouseEvent) => {
e.stopPropagation()
showDatePicker = !showDatePicker
Expand All @@ -211,6 +212,7 @@
oninput={inputChange}
{buttons}
type="date"
{variant}
/>
<div class:modal={isMobile}>
<div class="date-picker" class:showDatePicker bind:this={datePicker}>
Expand All @@ -222,7 +224,9 @@
onclick={() => changeMonth(-1)}><ChevronLeft size={isMobile ? 16 : size} /></Button
>
<div class="current-month">
<Typography {variant} bold>{months[selectedMonth]} {selectedYear}</Typography>
<Typography variant={typoVariant} bold
>{months[selectedMonth]} {selectedYear}</Typography
>
<Button
dimension={isMobile ? 'small' : dimension}
variant="ghost"
Expand All @@ -244,7 +248,7 @@
{#if !showYearPicker}
<div class="days">
{#each days as day}
<Typography {variant}>{day}</Typography>
<Typography variant={typoVariant}>{day}</Typography>
{/each}
</div>
{/if}
Expand Down