1616 :itemsHeadline =" itemsHeadline"
1717 :item-template =" itemTemplate"
1818 :valueOnly =" firstInputValue"
19+ :inputClass =" errorInsufficientBalance? 'text-typography-error' : undefined"
1920 searchable
2021 />
2122 <div class =" relative" >
5657 :itemsHeadline =" itemsHeadline"
5758 :item-template =" itemTemplate"
5859 :valueOnly =" secondInputValue"
60+ :inputClass =" errorInsufficientBalance? 'text-typography-error' : undefined"
5961 searchable
6062 />
61- <span
62- :class =" { hidden: !errorMsg?.length }"
63- class =" px-6 py-4 text-14 text-typography-error"
64- >
65- {{ errorMsg }}
66- </span >
63+ <AnimatePresence >
64+ <Motion
65+ v-if =" errorMsg?.length"
66+ :initial =" { opacity: 0, y: 4, overflow: 'hidden' }"
67+ :animate =" { opacity: 1, y: 0, overflow: 'hidden', transition: { type: 'spring', stiffness: 400, damping: 20 } }"
68+ :exit =" { opacity: 0, y: 4, overflow: 'hidden', transition: { type: 'spring', stiffness: 400, damping: 40 } }"
69+ tag =" div"
70+ class =" px-6 py-4 text-14 text-typography-error flex items-center gap-1"
71+ >
72+ <SvgIcon size =" s" name =" warning" class =" fill-typography-error" />
73+ <AnimatePresence mode =" wait" >
74+ <Motion
75+ :key =" errorMsg"
76+ :initial =" { opacity: 0, y: 4 }"
77+ :animate =" { opacity: 1, y: 0, transition: { type: 'spring', stiffness: 400, damping: 20 } }"
78+ :exit =" { opacity: 0, y: 4, transition: { type: 'spring', stiffness: 400, damping: 40 } }"
79+ tag =" span"
80+ >{{ errorMsg }}</Motion >
81+ </AnimatePresence >
82+ </Motion >
83+ </AnimatePresence >
6784</template >
6885
6986<script lang="ts" setup>
7087import { ref , watch , type Component } from " vue" ;
71- import { type AdvancedCurrencyFieldOption , AdvancedFormControl } from " web-components" ;
88+ import { type AdvancedCurrencyFieldOption , AdvancedFormControl , SvgIcon } from " web-components" ;
89+ import { AnimatePresence , Motion } from " motion-v" ;
7290import DownArrow from " @/common/components/icons/down-arrow.vue" ;
7391import Swap from " @/common/components/icons/swap.vue" ;
7492import { MultipleCurrencyEventType } from " ../types" ;
@@ -89,6 +107,7 @@ const props = defineProps<{
89107 selectedSecondCurrencyOption: AdvancedCurrencyFieldOption | undefined ;
90108 currencyOptions: AdvancedCurrencyFieldOption [];
91109 errorMsg? : string ;
110+ errorInsufficientBalance? : boolean ;
92111 disabled? : boolean ;
93112 isLoading? : boolean ;
94113 itemsHeadline? : string [];
0 commit comments