Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit d5ec4f5

Browse files
committed
Refactor DatePicker component icons
1 parent e7fbf31 commit d5ec4f5

File tree

7 files changed

+27
-149
lines changed

7 files changed

+27
-149
lines changed
Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
<template>
2-
<button
3-
type="button"
4-
:class="buttonTV({ size: props.size, variant: props.variant, class: props.class })"
5-
@click="(e) => $emit('click', e)"
6-
>
7-
<LeftArrowIcon v-if="$props.quickIcon == 'left-arrow'" />
8-
<CircleFilledIcon v-if="$props.quickIcon == 'center'" />
9-
<RightArrowIcon v-if="$props.quickIcon == 'right-arrow'" />
2+
<button type="button" :class="button({ class: $props.class })" @click="(e) => $emit('click', e)">
3+
<Icon name="ep:arrow-left-bold" v-if="$props.quickIcon == 'left-arrow'" :class="icon()" />
4+
<Icon name="ph:circle-fill" v-if="$props.quickIcon == 'center'" :class="icon()" />
5+
<Icon name="ep:arrow-right-bold" v-if="$props.quickIcon == 'right-arrow'" :class="icon()" />
106
<slot />
117
</button>
128
</template>
@@ -15,16 +11,30 @@
1511
import { tv, type VariantProps } from 'tailwind-variants'
1612
1713
const buttonTV = tv({
18-
base: 'inline-flex flex-row items-center justify-center whitespace-nowrap rounded-lg text-sm text-primary-900 transition-colors',
14+
slots: {
15+
button:
16+
'inline-flex flex-row items-center justify-center whitespace-nowrap rounded-lg text-sm text-primary-900 transition-colors',
17+
icon: 'h-full w-full'
18+
},
1919
variants: {
2020
variant: {
21-
solid: 'bg-transparent hover:bg-primary-600 active:bg-primary-700',
22-
hidden: 'pointer-events-none bg-transparent hover:bg-transparent'
21+
solid: {
22+
button: 'bg-transparent hover:bg-primary-600 active:bg-primary-700'
23+
},
24+
hidden: {
25+
button: 'pointer-events-none bg-transparent hover:bg-transparent'
26+
}
2327
},
2428
size: {
25-
sm: '',
26-
md: 'h-7 w-7 p-1',
27-
lg: ''
29+
sm: {
30+
button: ''
31+
},
32+
md: {
33+
button: 'h-7 w-7 p-1'
34+
},
35+
lg: {
36+
button: ''
37+
}
2838
}
2939
},
3040
defaultVariants: {
@@ -45,4 +55,6 @@ type Props = {
4555
4656
defineEmits(['click'])
4757
const props = defineProps<Props>()
58+
59+
const { button, icon } = buttonTV({ size: props.size, variant: props.variant })
4860
</script>

components/UI/DatePicker/DatePicker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div :class="base()" v-click-outside="() => (isOpen = false)">
33
<button :class="button()" @click="() => (isOpen = !isOpen)">
44
<span>{{ currentDateString }}</span>
5-
<CalendarIcon :class="calendarIcon()" />
5+
<Icon name="ion:calendar-outline" :class="calendarIcon()" />
66
</button>
77

88
<div v-show="isOpen" :class="calendarDropdown()">

components/UI/DatePicker/Icons/CalendarIcon.vue

Lines changed: 0 additions & 46 deletions
This file was deleted.

components/UI/DatePicker/Icons/CircleFilledIcon.vue

Lines changed: 0 additions & 21 deletions
This file was deleted.

components/UI/DatePicker/Icons/ClearIcon.vue

Lines changed: 0 additions & 21 deletions
This file was deleted.

components/UI/DatePicker/Icons/LeftArrowIcon.vue

Lines changed: 0 additions & 22 deletions
This file was deleted.

components/UI/DatePicker/Icons/RightArrowIcon.vue

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)