-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
303 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +0,0 @@ | ||
// Select | ||
select.form-select { | ||
@apply block w-full rounded-md border-0 py-1.5 text-body-txt shadow-sm ring-1 ring-inset ring-polarnight-nord-3 | ||
focus:ring-2 focus:ring-inset focus:ring-accent sm:max-w-xs sm:text-sm sm:leading-6; | ||
} | ||
|
||
input[type="text"].form-input, .input-text { | ||
@apply block w-full rounded-md border-0 py-1.5 text-body-txt shadow-sm ring-1 ring-inset ring-polarnight-nord-3 | ||
focus:ring-2 focus:ring-inset focus:ring-accent sm:max-w-xs sm:text-sm sm:leading-6; | ||
} | ||
|
||
input[type="checkbox"] { | ||
@apply rounded border-b-polarnight-nord-0 text-body-txt shadow-sm focus:border-accent focus:ring focus:ring-offset-0 focus:ring-accent focus:ring-opacity-50; | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,5 @@ | |
@layer components { | ||
@import 'components/index'; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
|
||
@forward "lenis"; | ||
@forward "tailwindcss-form"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Select | ||
.form-select, .form-multiselect { | ||
@apply block w-full rounded-md border-0 py-1.5 text-body-txt shadow-sm ring-1 ring-inset ring-polarnight-nord-3 | ||
focus:ring-2 focus:ring-inset focus:ring-accent sm:max-w-xs sm:text-sm sm:leading-6; | ||
} | ||
|
||
input[type="text"].form-input, .input-text { | ||
@apply block w-full rounded-md border-0 py-1.5 text-body-txt shadow-sm ring-1 ring-inset ring-polarnight-nord-3 | ||
focus:ring-2 focus:ring-inset focus:ring-accent sm:max-w-xs sm:text-sm sm:leading-6; | ||
} | ||
|
||
input[type="checkbox"] { | ||
@apply rounded border-b-polarnight-nord-0 text-body-txt shadow-sm focus:border-accent focus:ring focus:ring-offset-0 focus:ring-accent focus:ring-opacity-50; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<script setup lang="ts"> | ||
// Define props | ||
import type { IOption } from '~/components/MultiSelectTag.vue'; | ||
defineProps<{ | ||
tags: IOption[] | ||
pending: boolean | ||
}>(); | ||
// Define emits | ||
const emit = defineEmits(['clearFilters']); | ||
const { t } = useI18n(); | ||
// Define model | ||
const selectedOptions = defineModel<IOption[]>('selectedOptions', { required: true }); | ||
const search = defineModel<string>('search', { required: true }); | ||
const status = defineModel<string>('status', { required: true }); | ||
const sort = defineModel<string>('sort', { required: true }); | ||
// Computed - Has any filters | ||
const hasFilters = computed<boolean>(() => { | ||
return status.value !== '' || search.value !== ''; | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div class="flex flex-col flex-wrap gap-x-6 gap-y-1.5 lg:flex-row lg:items-end"> | ||
<div class="lg:mr-8"> | ||
<input | ||
v-model.lazy="search" autocomplete="search" name="search" type="text" | ||
placeholder="Search an article" class="form-input min-w-64" | ||
> | ||
</div> | ||
|
||
<div> | ||
<label class="mb-1 block" for="selectStatus">{{ t('pages.readings.filters.statusLabel') }}</label> | ||
<select id="selectStatus" v-model="status" class="form-select"> | ||
<option value=""> | ||
{{ t('pages.readings.filters.status.all') }} | ||
</option> | ||
<option value="To read"> | ||
{{ t('pages.readings.filters.status.toRead') }} | ||
</option> | ||
<option value="Read"> | ||
{{ t('pages.readings.filters.status.read') }} | ||
</option> | ||
<option value="Reading"> | ||
{{ t('pages.readings.filters.status.inProgress') }} | ||
</option> | ||
<option value="Canceled"> | ||
{{ t('pages.readings.filters.status.canceled') }} | ||
</option> | ||
</select> | ||
</div> | ||
|
||
<div> | ||
<MultiSelectTag v-model="selectedOptions" :options="tags" /> | ||
</div> | ||
|
||
<div> | ||
<label class="mb-1 block" for="selectSort">{{ t('pages.readings.sort.sortLabel') }}</label> | ||
<select id="selectSort" v-model="sort" class="form-select"> | ||
<option value="Created time"> | ||
{{ t('pages.readings.sort.createdTime') }} | ||
</option> | ||
<option value="Last edited time"> | ||
{{ t('pages.readings.sort.lastEditedTime') }} | ||
</option> | ||
<option value="Name"> | ||
{{ t('pages.readings.sort.name') }} | ||
</option> | ||
<option value="Score"> | ||
{{ t('pages.readings.sort.score') }} | ||
</option> | ||
</select> | ||
</div> | ||
|
||
<div v-if="hasFilters" class="leading-none lg:mb-2"> | ||
<button class="inline-flex items-center" @click="emit('clearFilters')"> | ||
<Icon class="mr-1.5" name="material-symbols:cancel" /> | ||
{{ t('common.clearFilters') }} | ||
</button> | ||
</div> | ||
<Transition name="fade"> | ||
<AppLoader v-if="pending" class="m-1 text-2xl" /> | ||
</Transition> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.