diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 873f98bf..62acf38b 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -41,7 +41,8 @@ "Bash(timeout 60 npx tsc:*)", "Bash(tee:*)", "WebFetch(domain:medium.com)", - "Bash(pnpm info:*)" + "Bash(pnpm info:*)", + "Bash(for file in )" ], "deny": [] } diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index eac9227b..00000000 --- a/.prettierignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -*.d.ts -.* diff --git a/app/HomePage.tsx b/app/HomePage.tsx index ee24833a..5090c3fa 100644 --- a/app/HomePage.tsx +++ b/app/HomePage.tsx @@ -7,7 +7,7 @@ import { useTheme } from 'next-themes'; import { RiBookLine, RiDiscordFill, RiGithubFill, RiArrowDownLine, RiExternalLinkLine } from 'react-icons/ri'; import RebalanceAnimation from '@/components/animations/RebalanceAnimation'; import { Badge } from '@/components/common/Badge'; -import { Button } from '@/components/common/Button'; +import { Button } from '@/components/ui/button'; import Header from '@/components/layout/header/Header'; import { EXTERNAL_LINKS } from '@/utils/external'; import logo from '../src/components/imgs/logo.png'; @@ -227,7 +227,7 @@ function HomePage() { variant="default" className="flex w-auto min-w-[200px] items-center justify-center gap-2 px-8 py-3 font-zen sm:px-10 sm:py-4" size="lg" - onPress={() => scrollToSection('section-1')} + onClick={() => scrollToSection('section-1')} > Learn More @@ -237,7 +237,7 @@ function HomePage() { className="block no-underline" > @@ -452,7 +452,7 @@ function HomePage() { className="block no-underline" > diff --git a/app/admin/stats/page.tsx b/app/admin/stats/page.tsx index b807b6ce..40d40cbb 100644 --- a/app/admin/stats/page.tsx +++ b/app/admin/stats/page.tsx @@ -1,10 +1,9 @@ 'use client'; import { useState, useEffect } from 'react'; -import { Button } from '@heroui/react'; +import { Button } from '@/components/ui/button'; import { Dropdown, DropdownTrigger, DropdownMenu, DropdownItem } from '@heroui/react'; import Image from 'next/image'; -import { FiChevronDown } from 'react-icons/fi'; import ButtonGroup from '@/components/ButtonGroup'; import { Spinner } from '@/components/common/Spinner'; import { TokenIcon } from '@/components/TokenIcon'; @@ -182,11 +181,8 @@ export default function StatsPage() { {/* Network selector */} - - ) : ( diff --git a/app/autovault/[chainId]/[vaultAddress]/components/VaultInitializationModal.tsx b/app/autovault/[chainId]/[vaultAddress]/components/VaultInitializationModal.tsx index 4ca72823..e65fe302 100644 --- a/app/autovault/[chainId]/[vaultAddress]/components/VaultInitializationModal.tsx +++ b/app/autovault/[chainId]/[vaultAddress]/components/VaultInitializationModal.tsx @@ -3,7 +3,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react'; import { FiZap } from 'react-icons/fi'; import { type Address, zeroAddress } from 'viem'; -import { Button } from '@/components/common'; +import { Button } from '@/components/ui/button'; import { AccountIdentity } from '@/components/common/AccountIdentity'; import { AllocatorCard } from '@/components/common/AllocatorCard'; import { Modal, ModalHeader, ModalBody, ModalFooter } from '@/components/common/Modal'; @@ -296,11 +296,11 @@ export function VaultInitializationModal({ if (stepIndex === 0) { return ( @@ -332,11 +332,11 @@ export function VaultInitializationModal({ if (stepIndex === 2) { return ( @@ -350,17 +350,17 @@ export function VaultInitializationModal({ variant="ghost" size="sm" className="min-w-[120px]" - onPress={() => void handleCompleteInitialization()} - isDisabled={isInitializing} + onClick={() => void handleCompleteInitialization()} + disabled={isInitializing} > Skip for now diff --git a/app/autovault/[chainId]/[vaultAddress]/components/settings/AgentsTab.tsx b/app/autovault/[chainId]/[vaultAddress]/components/settings/AgentsTab.tsx index ab396af9..7db2058e 100644 --- a/app/autovault/[chainId]/[vaultAddress]/components/settings/AgentsTab.tsx +++ b/app/autovault/[chainId]/[vaultAddress]/components/settings/AgentsTab.tsx @@ -1,7 +1,7 @@ import { useCallback, useState } from 'react'; import type { Address } from 'viem'; import { AccountIdentity } from '@/components/common/AccountIdentity'; -import { Button } from '@/components/common/Button'; +import { Button } from '@/components/ui/button'; import { Spinner } from '@/components/common/Spinner'; import { useMarketNetwork } from '@/hooks/useMarketNetwork'; import { v2AgentsBase } from '@/utils/monarch-agent'; @@ -100,10 +100,10 @@ export function AgentsTab({ {!isEditingAllocators && ( @@ -123,10 +123,10 @@ export function AgentsTab({ > diff --git a/app/autovault/[chainId]/[vaultAddress]/components/settings/CurrentCaps.tsx b/app/autovault/[chainId]/[vaultAddress]/components/settings/CurrentCaps.tsx index fe1f39e0..1acc1294 100644 --- a/app/autovault/[chainId]/[vaultAddress]/components/settings/CurrentCaps.tsx +++ b/app/autovault/[chainId]/[vaultAddress]/components/settings/CurrentCaps.tsx @@ -1,7 +1,7 @@ import { useMemo, useState } from 'react'; import { ChevronDownIcon, ChevronUpIcon } from '@radix-ui/react-icons'; import { type Address, maxUint128 } from 'viem'; -import { Button } from '@/components/common/Button'; +import { Button } from '@/components/ui/button'; import { MarketDetailsBlock } from '@/components/common/MarketDetailsBlock'; import { Spinner } from '@/components/common/Spinner'; import { TokenIcon } from '@/components/TokenIcon'; @@ -138,9 +138,9 @@ export function CurrentCaps({ existingCaps, isOwner, onStartEdit, chainId, vault
{isOwner && ( diff --git a/app/autovault/[chainId]/[vaultAddress]/components/settings/EditCaps.tsx b/app/autovault/[chainId]/[vaultAddress]/components/settings/EditCaps.tsx index 37bee851..cec8a9ca 100644 --- a/app/autovault/[chainId]/[vaultAddress]/components/settings/EditCaps.tsx +++ b/app/autovault/[chainId]/[vaultAddress]/components/settings/EditCaps.tsx @@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react'; import { PlusIcon } from '@radix-ui/react-icons'; import { type Address, parseUnits, maxUint128 } from 'viem'; import { Badge } from '@/components/common/Badge'; -import { Button } from '@/components/common/Button'; +import { Button } from '@/components/ui/button'; import { Spinner } from '@/components/common/Spinner'; import { useTokens } from '@/components/providers/TokenProvider'; import { TokenIcon } from '@/components/TokenIcon'; @@ -525,10 +525,10 @@ export function EditCaps({ existingCaps, vaultAsset, chainId, isOwner, isUpdatin {/* Add Market Button */}
+
@@ -151,10 +151,10 @@ export default function VaultContent() { linkTo="explorer" /> {vault.isOwner && ( @@ -205,10 +205,10 @@ export default function VaultContent() {

Add an agent to enable automated allocation and rebalancing.

+ ); } diff --git a/app/global-error.tsx b/app/global-error.tsx index db064b3e..1fac68e9 100644 --- a/app/global-error.tsx +++ b/app/global-error.tsx @@ -1,6 +1,6 @@ 'use client'; -import { Button } from '@/components/common'; +import { Button } from '@/components/ui/button'; export default function GlobalError({ error, reset }: { error: Error; reset: () => void }) { return ( @@ -15,7 +15,7 @@ export default function GlobalError({ error, reset }: { error: Error; reset: () An unexpected error occurred. Please try again. If the issue persists, it may be due to a transient data source outage.

{error?.message ?? 'Unknown error'}
- + diff --git a/app/history/components/HistoryTable.tsx b/app/history/components/HistoryTable.tsx index 2a10e931..666b6ed6 100644 --- a/app/history/components/HistoryTable.tsx +++ b/app/history/components/HistoryTable.tsx @@ -348,7 +348,7 @@ export function HistoryTable({ account, positions, rebalancerInfos }: HistoryTab diff --git a/app/market/[chainId]/[marketid]/components/BorrowsTable.tsx b/app/market/[chainId]/[marketid]/components/BorrowsTable.tsx index f559392a..d4c9da3e 100644 --- a/app/market/[chainId]/[marketid]/components/BorrowsTable.tsx +++ b/app/market/[chainId]/[marketid]/components/BorrowsTable.tsx @@ -4,7 +4,7 @@ import moment from 'moment'; import { FiFilter } from 'react-icons/fi'; import type { Address } from 'viem'; import { formatUnits } from 'viem'; -import { Button } from '@/components/common'; +import { Button } from '@/components/ui/button'; import { AccountIdentity } from '@/components/common/AccountIdentity'; import { Badge } from '@/components/common/Badge'; import { Spinner } from '@/components/common/Spinner'; @@ -69,12 +69,11 @@ export function BorrowsTable({ chainId, market, minAssets, onOpenFiltersModal }: } > diff --git a/app/market/[chainId]/[marketid]/content.tsx b/app/market/[chainId]/[marketid]/content.tsx index 5856f698..8f7505a7 100644 --- a/app/market/[chainId]/[marketid]/content.tsx +++ b/app/market/[chainId]/[marketid]/content.tsx @@ -11,7 +11,7 @@ import { useParams, useRouter, useSearchParams } from 'next/navigation'; import { formatUnits, parseUnits } from 'viem'; import { useConnection } from 'wagmi'; import { BorrowModal } from '@/components/BorrowModal'; -import { Button } from '@/components/common'; +import { Button } from '@/components/ui/button'; import { Spinner } from '@/components/common/Spinner'; import Header from '@/components/layout/header/Header'; import { OracleTypeInfo } from '@/components/MarketOracle'; @@ -217,7 +217,7 @@ function MarketContent() { {/* navigation buttons */}
diff --git a/app/markets/components/MarketActionsDropdown.tsx b/app/markets/components/MarketActionsDropdown.tsx index 9a476a9a..7316bb66 100644 --- a/app/markets/components/MarketActionsDropdown.tsx +++ b/app/markets/components/MarketActionsDropdown.tsx @@ -7,7 +7,7 @@ import { AiOutlineStop } from 'react-icons/ai'; import { GoStarFill, GoStar, GoGraph } from 'react-icons/go'; import { IoEllipsisVertical } from 'react-icons/io5'; import { TbArrowUp } from 'react-icons/tb'; -import { Button } from '@/components/common/Button'; +import { Button } from '@/components/ui/button'; import type { Market } from '@/utils/types'; import { BlacklistConfirmationModal } from './BlacklistConfirmationModal'; @@ -68,9 +68,8 @@ export function MarketActionsDropdown({ diff --git a/app/markets/components/MarketRowDetail.tsx b/app/markets/components/MarketRowDetail.tsx index 89ba7ed7..3d90e959 100644 --- a/app/markets/components/MarketRowDetail.tsx +++ b/app/markets/components/MarketRowDetail.tsx @@ -9,8 +9,8 @@ export function ExpandedMarketDetail({ market }: { market: Market }) { const warningsWithDetail = useMarketWarnings(market, true); return ( -
-
+
+

Oracle Info

@@ -26,7 +26,7 @@ export function ExpandedMarketDetail({ market }: { market: Market }) {
{/* market info */} -
+

Market State

@@ -41,12 +41,12 @@ export function ExpandedMarketDetail({ market }: { market: Market }) {
{/* warnings */} -
+

Warnings

-
+
{warningsWithDetail.map((warning) => { return ( @@ -261,8 +261,8 @@ export default function MarketSettingsModal({ diff --git a/app/markets/components/markets.tsx b/app/markets/components/markets.tsx index 8f5bab62..c08ca21f 100644 --- a/app/markets/components/markets.tsx +++ b/app/markets/components/markets.tsx @@ -8,7 +8,7 @@ import { CgCompress } from 'react-icons/cg'; import { FiSettings } from 'react-icons/fi'; import { RiExpandHorizontalLine } from 'react-icons/ri'; -import { Button } from '@/components/common'; +import { Button } from '@/components/ui/button'; import { SuppliedAssetFilterCompactSwitch } from '@/components/common/SuppliedAssetFilterCompactSwitch'; import Header from '@/components/layout/header/Header'; import { useTokens } from '@/components/providers/TokenProvider'; @@ -577,16 +577,17 @@ export default function Markets({ initialNetwork, initialCollaterals, initialLoa /> } > - + + + {/* Hide expand/compact toggle on mobile */} @@ -608,16 +609,17 @@ export default function Markets({ initialNetwork, initialCollaterals, initialLoa /> } > - + + +
@@ -633,16 +635,17 @@ export default function Markets({ initialNetwork, initialCollaterals, initialLoa /> } > - + + +
diff --git a/app/positions/components/FromMarketsTable.tsx b/app/positions/components/FromMarketsTable.tsx index 5f9a2e0b..aa5e8ab8 100644 --- a/app/positions/components/FromMarketsTable.tsx +++ b/app/positions/components/FromMarketsTable.tsx @@ -1,6 +1,6 @@ import { useState } from 'react'; import { Pagination } from '@heroui/react'; -import { Button } from '@/components/common/Button'; +import { Button } from '@/components/ui/button'; import { MarketIdentity, MarketIdentityMode, MarketIdentityFocus } from '@/components/MarketIdentity'; import { useMarkets } from '@/hooks/useMarkets'; import { useRateLabel } from '@/hooks/useRateLabel'; @@ -146,18 +146,16 @@ export function FromMarketsTable({ positions, selectedMarketUniqueKey, onSelectM
diff --git a/app/positions/components/PositionsContent.tsx b/app/positions/components/PositionsContent.tsx index dd89f803..600d1fe7 100644 --- a/app/positions/components/PositionsContent.tsx +++ b/app/positions/components/PositionsContent.tsx @@ -3,6 +3,7 @@ import { useEffect, useMemo, useState } from 'react'; import Link from 'next/link'; import { useParams } from 'next/navigation'; +import { Tooltip } from '@heroui/react'; import { FaHistory, FaPlus } from 'react-icons/fa'; import { IoRefreshOutline } from 'react-icons/io5'; import { TbReport } from 'react-icons/tb'; @@ -10,11 +11,12 @@ import { toast } from 'react-toastify'; import type { Address } from 'viem'; import { useConnection } from 'wagmi'; import { AccountIdentity } from '@/components/common/AccountIdentity'; -import { Button } from '@/components/common/Button'; +import { Button } from '@/components/ui/button'; import Header from '@/components/layout/header/Header'; import EmptyScreen from '@/components/Status/EmptyScreen'; import LoadingScreen from '@/components/Status/LoadingScreen'; import { SupplyModalV2 } from '@/components/SupplyModalV2'; +import { TooltipContent } from '@/components/TooltipContent'; import { useMarkets } from '@/hooks/useMarkets'; import useUserPositionsSummaryData, { type EarningsPeriod } from '@/hooks/useUserPositionsSummaryData'; import type { MarketPosition } from '@/utils/types'; @@ -111,10 +113,10 @@ export default function Positions() { {isOwner && ( + + + +
- + + + + - - - + + diff --git a/app/positions/report/components/ReportContent.tsx b/app/positions/report/components/ReportContent.tsx index e4d1afdb..39d166ee 100644 --- a/app/positions/report/components/ReportContent.tsx +++ b/app/positions/report/components/ReportContent.tsx @@ -5,7 +5,7 @@ import type { DateValue } from '@heroui/react'; import { parseDate, getLocalTimeZone, today, parseAbsoluteToLocal, type ZonedDateTime, now } from '@internationalized/date'; import { useDateFormatter } from '@react-aria/i18n'; import type { Address } from 'viem'; -import { Button } from '@/components/common/Button'; +import { Button } from '@/components/ui/button'; import DatePicker from '@/components/common/DatePicker'; import { Spinner } from '@/components/common/Spinner'; import Header from '@/components/layout/header/Header'; @@ -213,9 +213,9 @@ export default function ReportContent({ account }: { account: Address }) { onClick={() => { void handleGenerateReport(); }} - isDisabled={!selectedAsset || isGenerating || isReportCurrent || !!startDateError || !!endDateError} + disabled={!selectedAsset || isGenerating || isReportCurrent || !!startDateError || !!endDateError} className="inline-flex h-14 min-w-[120px] items-center gap-2" - variant="cta" + variant="primary" > {isGenerating ? ( totalClaimable > 0n, [totalClaimable]); - const showLegacy = useMemo(() => morphoBalanceLegacy && morphoBalanceLegacy !== 0n, [morphoBalanceLegacy]); + const showLegacy = useMemo(() => morphoBalanceLegacy !== undefined && morphoBalanceLegacy !== 0n, [morphoBalanceLegacy]); const { wrap, currentStep, showProcessModal, setShowProcessModal } = useWrapLegacyMorpho(morphoBalanceLegacy ?? 0n, () => { // Refresh rewards data after successful wrap diff --git a/app/rewards/components/RewardTable.tsx b/app/rewards/components/RewardTable.tsx index a08a72fb..da812e5c 100644 --- a/app/rewards/components/RewardTable.tsx +++ b/app/rewards/components/RewardTable.tsx @@ -6,7 +6,7 @@ import Image from 'next/image'; import Link from 'next/link'; import type { Address } from 'viem'; import { useConnection } from 'wagmi'; -import { Button } from '@/components/common/Button'; +import { Button } from '@/components/ui/button'; import { TokenIcon } from '@/components/TokenIcon'; import { useMarketNetwork } from '@/hooks/useMarketNetwork'; import type { DistributionResponseType } from '@/hooks/useRewards'; @@ -194,19 +194,19 @@ export default function RewardTable({ rewards, distributions, account, showClaim rel="noopener noreferrer" > ) : (
@@ -243,8 +243,8 @@ export default function SettingsPage() {
diff --git a/app/tools/page.tsx b/app/tools/page.tsx index 496caf5d..4995771a 100644 --- a/app/tools/page.tsx +++ b/app/tools/page.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { isAddress } from 'viem'; import { useChainId, useSwitchChain } from 'wagmi'; -import { Button } from '@/components/common'; +import { Button } from '@/components/ui/button'; import Header from '@/components/layout/header/Header'; import { useMorphoAuthorization } from '@/hooks/useMorphoAuthorization'; import { useStyledToast } from '@/hooks/useStyledToast'; @@ -153,18 +153,18 @@ export default function ToolsPage() { {/* Action Buttons */} {isAuthorized === true ? ( ) : ( - + + ``` @@ -115,7 +115,7 @@ import { TokenIcon } from '@/components/TokenIcon'; title="Rebalance Position" description="Manage your positions" actions={ - } @@ -153,8 +153,8 @@ Use this pattern for filters, confirmations, and quick actions: - - + + ``` @@ -282,66 +282,94 @@ For custom modals using `framer-motion`, apply `font-zen` to the outer container ### Button Component ```typescript -import { Button } from '@/components/common/Button'; +import { Button } from '@/components/ui/button'; ``` #### Button Variants -- `default`: Standard surface-colored button - - - Use for: Navigation buttons, "Back", "Cancel" actions - - Example: "Back to Markets", "Cancel" - -- `cta`: Primary call-to-action with orange background - - - Use for: Main actions, confirmations, primary flows - - Example: "Launch App", "Execute Rebalance", "Start Lending" - -- `interactive`: Subtle background with strong hover effect (background → primary) - - - Use for: Table row actions, interactive elements - - Example: "Claim", "Supply", "Withdraw" in tables - -- `secondary`: Subtle background (hovered color) without hover transform - - - Use for: Secondary actions, less prominent options - - Example: "Remove" in tables, "Cancel" in modals - -- `ghost`: Most subtle variant with minimal visual impact - - Use for: Tertiary actions, subtle navigation - - Example: "Refresh" buttons, utility actions +Our button system uses 4 simple, purpose-driven variants: + +**default** - For buttons on background areas +- Uses `bg-surface` color +- Hover: Darkens slightly and increases opacity +- Use for: Navigation buttons, actions on main background +- Example: "Back to Markets", top-level page actions + +**primary** - For important actions +- Uses `bg-primary` color (primary theme color, NOT orange) +- Hover: Increases shadow and opacity, slight scale down on click +- Use for: Main CTAs, confirmations, primary flows +- Example: "New Position", "Execute Rebalance", "Supply", "Withdraw" + +**surface** - For buttons on surface-colored backgrounds +- Uses `bg-hovered` color - Subtle, doesn't stand out too much +- Hover: `bg-default-200`, Active: `bg-default-300` (gentle color progression) +- Use for: Actions in cards, modals, table rows +- Example: "Claim" button in tables, dropdown triggers, actions in cards + +**ghost** - For icon buttons and minimal actions +- Transparent background with responsive hover states +- Icon buttons: Scale up slightly on hover, visible background feedback +- Size-specific hover styles for optimal feedback +- Use for: Icon-only buttons, utility actions, settings +- Example: Refresh icons, settings icons, filter toggles #### Examples ```tsx -// Primary CTA - -// Table Action - -// Navigation +// Default - Navigation on background -// Secondary Action - - -// Utility Action - +// Ghost - Icon-only button with tooltip (always wrap in span for HeroUI Tooltip) +} +> + + + + ``` +#### Button Sizes + +- `xs`: Extra small (h-6, 40px min-width) - Rare use +- `sm`: Small (h-8, 64px min-width) - Common for compact actions +- `md`/`default`: Medium (h-10, 80px min-width) - Standard size +- `lg`: Large (h-12, 96px min-width) - Important CTAs +- `icon`: Icon-only (h-8 w-8, 14px icons) - Use for icon buttons + +#### Button Hover Effects + +All buttons have subtle hover refinements: +- **Opacity**: Buttons start at 95% opacity and become 100% on hover for a refined look +- **Color transitions**: Smooth 200ms transitions for all state changes +- **Scale feedback**: Active state provides tactile press feedback +- **Ghost buttons**: Size-specific hover behaviors for optimal UX + - Icon size: Scales to 105% on hover, darker background + - Small size: Scales to 102% on hover, medium background + - Medium/Large: Scales to 101% on hover, lighter background + +**Important Note**: When wrapping Button in HeroUI Tooltip, always wrap the Button in a `` to prevent ResizeObserver errors. + ### Toggle Controls - Always use the shared `IconSwitch` component (`@/components/common/IconSwitch`) for boolean toggles so dimensions, motion, and iconography stay consistent across pages. @@ -819,7 +847,7 @@ For simple text inputs, use native HTML input with consistent styling: ) : (!permit2Authorized && !useEth) || (!usePermit2Setting && !isApproved) ? ( ) : ( diff --git a/src/components/Borrow/WithdrawCollateralAndRepay.tsx b/src/components/Borrow/WithdrawCollateralAndRepay.tsx index 6e1ccd12..aa45ea37 100644 --- a/src/components/Borrow/WithdrawCollateralAndRepay.tsx +++ b/src/components/Borrow/WithdrawCollateralAndRepay.tsx @@ -1,7 +1,7 @@ import { useMemo, useState, useEffect, useCallback } from 'react'; import { ReloadIcon } from '@radix-ui/react-icons'; import { useConnection } from 'wagmi'; -import { Button } from '@/components/common'; +import { Button } from '@/components/ui/button'; import { LTVWarning } from '@/components/common/LTVWarning'; import Input from '@/components/Input/Input'; import AccountConnect from '@/components/layout/header/AccountConnect'; @@ -304,15 +304,15 @@ export function WithdrawCollateralAndRepay({ {isConnected ? ( needSwitchChain ? ( ) : ( diff --git a/src/components/RiskNotificationModal.tsx b/src/components/RiskNotificationModal.tsx index 82ef717a..351c2918 100644 --- a/src/components/RiskNotificationModal.tsx +++ b/src/components/RiskNotificationModal.tsx @@ -1,7 +1,8 @@ 'use client'; import { useState, useEffect } from 'react'; -import { Button, Checkbox } from '@heroui/react'; +import { Checkbox } from '@heroui/react'; +import { Button } from '@/components/ui/button'; import { usePathname } from 'next/navigation'; import { PiButterflyDuotone } from 'react-icons/pi'; import { Modal, ModalHeader, ModalBody, ModalFooter } from '@/components/common/Modal'; @@ -72,8 +73,8 @@ export default function RiskNotificationModal() { diff --git a/src/components/SupplyModalContent.tsx b/src/components/SupplyModalContent.tsx index a87d7fdf..bfc9e823 100644 --- a/src/components/SupplyModalContent.tsx +++ b/src/components/SupplyModalContent.tsx @@ -11,7 +11,7 @@ import { formatBalance } from '@/utils/balance'; import { getNativeTokenSymbol } from '@/utils/networks'; import { isWrappedNativeToken } from '@/utils/tokens'; import type { Market } from '@/utils/types'; -import { Button } from './common'; +import { Button } from '@/components/ui/button'; import { SupplyProcessModal } from './SupplyProcessModal'; type SupplyModalContentProps = { @@ -147,27 +147,27 @@ export function SupplyModalContent({ onClose, market, refetch, onAmountChange }: {needSwitchChain ? ( ) : (!permit2Authorized && !useEth) || (!usePermit2Setting && !isApproved) ? ( ) : ( diff --git a/src/components/WithdrawModalContent.tsx b/src/components/WithdrawModalContent.tsx index 267e0349..f0d38957 100644 --- a/src/components/WithdrawModalContent.tsx +++ b/src/components/WithdrawModalContent.tsx @@ -12,7 +12,7 @@ import { formatBalance, formatReadable, min } from '@/utils/balance'; import { getMorphoAddress } from '@/utils/morpho'; import type { SupportedNetworks } from '@/utils/networks'; import type { Market, MarketPosition } from '@/utils/types'; -import { Button } from './common'; +import { Button } from '@/components/ui/button'; type WithdrawModalContentProps = { position?: MarketPosition | null; @@ -147,18 +147,18 @@ export function WithdrawModalContent({ position, market, onClose, refetch, onAmo
{needSwitchChain ? ( ) : ( diff --git a/src/components/common/Button.tsx b/src/components/common/Button.tsx deleted file mode 100644 index c71233e3..00000000 --- a/src/components/common/Button.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import type React from 'react'; -import { extendVariants, Button as NextUIButton } from '@heroui/react'; - -export const Button = extendVariants(NextUIButton, { - variants: { - // Main variant types that define the button's purpose and behavior - variant: { - default: 'bg-surface hover:bg-surface/80 transition-all duration-200 ease-in-out', // Default surface-colored button - cta: 'bg-monarch-orange text-white hover:bg-monarch-orange/80 transition-all duration-200 ease-in-out', // Primary CTA with orange background - secondary: 'bg-hovered text-foreground ', - interactive: 'bg-hovered text-foreground hover:bg-primary hover:text-white transition-all duration-200 ease-in-out', // Starts subtle, strong hover effect - ghost: 'bg-transparent hover:bg-surface/5 transition-all duration-200 ease-in-out', // Most subtle variant - subtle: 'bg-surface shadow-sm hover:shadow text-foreground hover:bg-default-100 transition-all duration-200 ease-in-out', // Subtle button with shadow, background and shadow change on hover - }, - // Size variants - size: { - xs: 'px-1.5 py-1 text-xs min-w-[40px] h-6', - sm: 'px-1.5 py-1 text-xs min-w-[64px] h-8', - md: 'px-4 py-2 text-sm min-w-[80px] h-10', - lg: 'px-6 py-3 text-md min-w-[96px] h-12', - }, - // Rounded corners - radius: { - none: 'rounded-none', - base: 'rounded-sm', - }, - // Full width option - fullWidth: { - true: 'w-full', - }, - // Loading state - isLoading: { - true: 'cursor-not-allowed', - }, - }, - defaultVariants: { - variant: 'default', - size: 'md', - radius: 'base', - fullWidth: false, - }, - compoundVariants: [ - // Disabled state - { - isDisabled: 'true', - class: 'opacity-50 cursor-not-allowed pointer-events-none', - }, - // Loading state - { - isLoading: true, - class: 'gap-2 [&>span]:opacity-0 [&>svg]:opacity-0 [&>*:not(.loading-spinner)]:opacity-0', - }, - ], -}); - -export type ButtonProps = React.ComponentProps; - -Button.displayName = 'Button'; diff --git a/src/components/common/MarketSelectionModal.tsx b/src/components/common/MarketSelectionModal.tsx index 4b1aafc7..6e3bf5a2 100644 --- a/src/components/common/MarketSelectionModal.tsx +++ b/src/components/common/MarketSelectionModal.tsx @@ -1,7 +1,7 @@ import { useState, useMemo } from 'react'; import { FiSearch } from 'react-icons/fi'; import type { Address } from 'viem'; -import { Button } from '@/components/common/Button'; +import { Button } from '@/components/ui/button'; import { MarketsTableWithSameLoanAsset } from '@/components/common/MarketsTableWithSameLoanAsset'; import { Modal, ModalHeader, ModalBody, ModalFooter } from '@/components/common/Modal'; import { Spinner } from '@/components/common/Spinner'; @@ -141,17 +141,17 @@ export function MarketSelectionModal({

@@ -160,9 +160,9 @@ export function MarketSelectionModal({ ) : (
diff --git a/src/components/common/MarketsTableWithSameLoanAsset.tsx b/src/components/common/MarketsTableWithSameLoanAsset.tsx index 33733536..11094620 100644 --- a/src/components/common/MarketsTableWithSameLoanAsset.tsx +++ b/src/components/common/MarketsTableWithSameLoanAsset.tsx @@ -6,7 +6,7 @@ import Image from 'next/image'; import { FaSearch } from 'react-icons/fa'; import { IoHelpCircleOutline } from 'react-icons/io5'; import { LuX } from 'react-icons/lu'; -import { Button } from '@/components/common'; +import { Button } from '@/components/ui/button'; import { SuppliedAssetFilterCompactSwitch } from '@/components/common/SuppliedAssetFilterCompactSwitch'; import { TablePagination } from '@/components/common/TablePagination'; import { useTokens } from '@/components/providers/TokenProvider'; @@ -491,7 +491,7 @@ function MarketRow({ e.stopPropagation()} size="sm" @@ -1005,9 +1005,9 @@ export function MarketsTableWithSameLoanAsset({ /> {showSettings && ( diff --git a/src/components/common/index.ts b/src/components/common/index.ts index 8d412f78..719afc52 100644 --- a/src/components/common/index.ts +++ b/src/components/common/index.ts @@ -1,4 +1,3 @@ -export * from './Button'; export * from './TransactionIdentity'; export * from './AccountIdentity'; export * from './AccountActionsPopover'; diff --git a/src/components/layout/header/AccountConnect.tsx b/src/components/layout/header/AccountConnect.tsx index 0c943a24..334f4ffb 100644 --- a/src/components/layout/header/AccountConnect.tsx +++ b/src/components/layout/header/AccountConnect.tsx @@ -1,7 +1,7 @@ import { useAppKit } from '@reown/appkit/react'; import { useConnection } from 'wagmi'; import { useEffect, useState } from 'react'; -import { Button } from '@/components/common'; +import { Button } from '@/components/ui/button'; import { useConnectRedirect } from '@/components/providers/ConnectRedirectProvider'; import { AccountDropdown } from './AccountDropdown'; @@ -41,9 +41,9 @@ function AccountConnect({ onConnectPath }: { onConnectPath?: string }) {
) : ( diff --git a/src/components/settings/BlacklistedMarketsModal.tsx b/src/components/settings/BlacklistedMarketsModal.tsx index 78176cc5..c30add26 100644 --- a/src/components/settings/BlacklistedMarketsModal.tsx +++ b/src/components/settings/BlacklistedMarketsModal.tsx @@ -4,7 +4,7 @@ import React, { useMemo } from 'react'; import { Divider } from '@heroui/react'; import { FiPlus, FiX } from 'react-icons/fi'; import { MdBlockFlipped } from 'react-icons/md'; -import { Button } from '@/components/common'; +import { Button } from '@/components/ui/button'; import { Modal, ModalHeader, ModalBody, ModalFooter } from '@/components/common/Modal'; import { MarketIdentity, MarketIdentityMode, MarketIdentityFocus } from '@/components/MarketIdentity'; import { useMarkets } from '@/contexts/MarketsContext'; @@ -124,9 +124,9 @@ export function BlacklistedMarketsModal({ isOpen, onOpenChange }: BlacklistedMar
@@ -219,9 +219,9 @@ export function BlacklistedMarketsModal({ isOpen, onOpenChange }: BlacklistedMar @@ -233,8 +233,8 @@ export function BlacklistedMarketsModal({ isOpen, onOpenChange }: BlacklistedMar @@ -261,10 +261,10 @@ function RpcModal({ isOpen, onClose }: { isOpen: boolean; onClose: () => void }) }`} /> @@ -329,9 +329,9 @@ export function AdvancedRpcSettings() {
diff --git a/src/components/settings/TrustedVaultsModal.tsx b/src/components/settings/TrustedVaultsModal.tsx index 16530ec5..af8612e9 100644 --- a/src/components/settings/TrustedVaultsModal.tsx +++ b/src/components/settings/TrustedVaultsModal.tsx @@ -5,7 +5,7 @@ import { Divider, Input, Spinner } from '@heroui/react'; import { FiChevronDown, FiChevronUp } from 'react-icons/fi'; import { GoShield, GoShieldCheck } from 'react-icons/go'; import { IoWarningOutline } from 'react-icons/io5'; -import { Button } from '@/components/common'; +import { Button } from '@/components/ui/button'; import { IconSwitch } from '@/components/common/IconSwitch'; import { Modal, ModalHeader, ModalBody, ModalFooter } from '@/components/common/Modal'; import { NetworkIcon } from '@/components/common/NetworkIcon'; @@ -163,15 +163,15 @@ export default function TrustedVaultsModal({ isOpen, onOpenChange, userTrustedVa
@@ -286,8 +286,8 @@ export default function TrustedVaultsModal({ isOpen, onOpenChange, userTrustedVa