@silentswap/ui-kit 0.0.41 → 0.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/accordion.js +14 -0
- package/dist/components/add-button.d.ts +10 -0
- package/dist/components/add-button.js +20 -0
- package/dist/components/address-selector.d.ts +34 -0
- package/dist/components/address-selector.js +57 -0
- package/dist/components/alert-dialog.d.ts +20 -0
- package/dist/components/alert-dialog.js +26 -0
- package/dist/components/alert.d.ts +8 -0
- package/dist/components/alert.js +22 -0
- package/dist/components/avatar.d.ts +6 -0
- package/dist/components/avatar.js +12 -0
- package/dist/components/badge.d.ts +9 -0
- package/dist/components/badge.js +21 -0
- package/dist/components/button.d.ts +12 -0
- package/dist/components/button.js +39 -0
- package/dist/components/card.d.ts +8 -0
- package/dist/components/card.js +16 -0
- package/dist/components/coin.d.ts +6 -0
- package/dist/components/coin.js +20 -0
- package/dist/components/collapsible.d.ts +5 -0
- package/dist/components/collapsible.js +6 -0
- package/dist/components/context-menu.d.ts +27 -0
- package/dist/components/context-menu.js +33 -0
- package/dist/components/dialog.d.ts +19 -0
- package/dist/components/dialog.js +99 -0
- package/dist/components/disconnect-confirmation-dialog.d.ts +10 -0
- package/dist/components/disconnect-confirmation-dialog.js +16 -0
- package/dist/components/drawer copy.js +25 -0
- package/dist/components/drawer.d.ts +22 -0
- package/dist/components/drawer.js +25 -0
- package/dist/components/dropdown-menu.d.ts +27 -0
- package/dist/components/dropdown-menu.js +33 -0
- package/dist/components/icons.d.ts +30 -0
- package/dist/components/icons.js +71 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/input.js +8 -0
- package/dist/components/label.d.ts +5 -0
- package/dist/components/label.js +10 -0
- package/dist/components/modal.d.ts +40 -0
- package/dist/components/modal.js +100 -0
- package/dist/components/panel-row.d.ts +11 -0
- package/dist/components/panel-row.js +8 -0
- package/dist/components/popover.d.ts +15 -0
- package/dist/components/popover.js +106 -0
- package/dist/components/popular-tokens-area.d.ts +8 -0
- package/dist/components/popular-tokens-area.js +34 -0
- package/dist/components/progress-bar.d.ts +17 -0
- package/dist/components/progress-bar.js +30 -0
- package/dist/components/responsive-container.d.ts +7 -0
- package/dist/components/responsive-container.js +69 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.js +10 -0
- package/dist/components/select.d.ts +13 -0
- package/dist/components/select.js +26 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/separator.js +8 -0
- package/dist/components/sheet.d.ts +25 -0
- package/dist/components/sheet.js +37 -0
- package/dist/components/sidebar.d.ts +66 -0
- package/dist/components/sidebar.js +222 -0
- package/dist/components/skeleton.d.ts +3 -0
- package/dist/components/skeleton.js +7 -0
- package/dist/components/status-card.d.ts +23 -0
- package/dist/components/status-card.js +27 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.js +8 -0
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.js +11 -0
- package/dist/components-v2/accordion.d.ts +7 -0
- package/dist/components-v2/accordion.js +14 -0
- package/dist/components-v2/add-button.d.ts +10 -0
- package/dist/components-v2/add-button.js +21 -0
- package/dist/components-v2/address-selector.d.ts +34 -0
- package/dist/components-v2/address-selector.js +57 -0
- package/dist/components-v2/alert-dialog.d.ts +20 -0
- package/dist/components-v2/alert-dialog.js +26 -0
- package/dist/components-v2/alert.d.ts +8 -0
- package/dist/components-v2/alert.js +22 -0
- package/dist/components-v2/assetTile.d.ts +10 -0
- package/dist/components-v2/assetTile.js +18 -0
- package/dist/components-v2/avatar.d.ts +6 -0
- package/dist/components-v2/avatar.js +12 -0
- package/dist/components-v2/badge.d.ts +9 -0
- package/dist/components-v2/badge.js +21 -0
- package/dist/components-v2/collapsible.d.ts +5 -0
- package/dist/components-v2/collapsible.js +6 -0
- package/dist/components-v2/context-menu.d.ts +27 -0
- package/dist/components-v2/context-menu.js +33 -0
- package/dist/components-v2/disconnect-confirmation-dialog.d.ts +10 -0
- package/dist/components-v2/disconnect-confirmation-dialog.js +16 -0
- package/dist/components-v2/drawer.d.ts +22 -0
- package/dist/components-v2/drawer.js +25 -0
- package/dist/components-v2/dropdown-menu.d.ts +27 -0
- package/dist/components-v2/dropdown-menu.js +33 -0
- package/dist/components-v2/icons.d.ts +30 -0
- package/dist/components-v2/icons.js +72 -0
- package/dist/components-v2/label.d.ts +5 -0
- package/dist/components-v2/label.js +10 -0
- package/dist/components-v2/modal.d.ts +40 -0
- package/dist/components-v2/modal.js +100 -0
- package/dist/components-v2/popular-tokens-area.d.ts +8 -0
- package/dist/components-v2/popular-tokens-area.js +34 -0
- package/dist/components-v2/progress-bar.d.ts +17 -0
- package/dist/components-v2/progress-bar.js +30 -0
- package/dist/components-v2/scroll-area.d.ts +5 -0
- package/dist/components-v2/scroll-area.js +10 -0
- package/dist/components-v2/separator.d.ts +4 -0
- package/dist/components-v2/separator.js +8 -0
- package/dist/components-v2/sheet.d.ts +25 -0
- package/dist/components-v2/sheet.js +37 -0
- package/dist/components-v2/skeleton.d.ts +3 -0
- package/dist/components-v2/skeleton.js +7 -0
- package/dist/components-v2/status-card.d.ts +23 -0
- package/dist/components-v2/status-card.js +27 -0
- package/dist/components-v2/textarea.d.ts +3 -0
- package/dist/components-v2/textarea.js +8 -0
- package/dist/components-v2/tooltip.d.ts +7 -0
- package/dist/components-v2/tooltip.js +11 -0
- package/dist/components-v2/warning.d.ts +15 -0
- package/dist/components-v2/warning.js +23 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/index.d.ts +14 -14
- package/dist/index.js +8 -8
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +5 -0
- package/dist/test.css +1383 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +5 -0
- package/package.json +2 -2
- package/src/{components/PopularTokensArea.tsx → components-v2/popular-tokens-area.tsx} +1 -1
- package/src/index.ts +14 -14
- /package/dist/{components/Button.d.ts → components-v2/button.d.ts} +0 -0
- /package/dist/{components/Button.js → components-v2/button.js} +0 -0
- /package/dist/{components/Card.d.ts → components-v2/card.d.ts} +0 -0
- /package/dist/{components/Card.js → components-v2/card.js} +0 -0
- /package/dist/{components/Input.d.ts → components-v2/input.d.ts} +0 -0
- /package/dist/{components/Input.js → components-v2/input.js} +0 -0
- /package/dist/{components/Select.d.ts → components-v2/select.d.ts} +0 -0
- /package/dist/{components/Select.js → components-v2/select.js} +0 -0
- /package/src/{components/AssetTile.tsx → components-v2/assetTile.tsx} +0 -0
- /package/src/{components/Button.tsx → components-v2/button.tsx} +0 -0
- /package/src/{components/Card.tsx → components-v2/card.tsx} +0 -0
- /package/src/{components/Input.tsx → components-v2/input.tsx} +0 -0
- /package/src/{components/ProgressBar.tsx → components-v2/progress-bar.tsx} +0 -0
- /package/src/{components/Select.tsx → components-v2/select.tsx} +0 -0
- /package/src/{components/Warning.tsx → components-v2/warning.tsx} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
3
|
+
declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const AccordionContent: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
5
|
+
import { ChevronDown } from 'lucide-react';
|
|
6
|
+
import { cn } from '../utils';
|
|
7
|
+
const Accordion = AccordionPrimitive.Root;
|
|
8
|
+
const AccordionItem = React.forwardRef(({ className, ...props }, ref) => (_jsx(AccordionPrimitive.Item, { ref: ref, className: cn('border-b', className), ...props })));
|
|
9
|
+
AccordionItem.displayName = 'AccordionItem';
|
|
10
|
+
const AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { ref: ref, className: cn('flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180', className), ...props, children: [children, _jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" })] }) })));
|
|
11
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
12
|
+
const AccordionContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(AccordionPrimitive.Content, { ref: ref, className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", ...props, children: _jsx("div", { className: cn('pb-4 pt-0', className), children: children }) })));
|
|
13
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
14
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { cn } from '../utils';
|
|
4
|
+
import { AddIcon } from './icons';
|
|
5
|
+
export const AddButton = ({ onClick, label, disabled = false, disabledLabel, className }) => {
|
|
6
|
+
return (_jsxs("div", { className: cn(
|
|
7
|
+
// Layout - matching Figma design
|
|
8
|
+
'flex items-center justify-center gap-[10px]', 'w-[90vw] max-w-[640px] mx-auto', 'px-[20px] py-[12px] box-border', 'min-h-[42px]',
|
|
9
|
+
// Background - matching Figma: bg-secondary (#211f12)
|
|
10
|
+
'rounded-[12px]',
|
|
11
|
+
// Typography - matching Figma: Manrope Medium, 14px, line-height 1.5, yellow
|
|
12
|
+
'font-medium text-[14px] leading-[1.5]',
|
|
13
|
+
// Interaction
|
|
14
|
+
'transition-all duration-300 z-[2]', disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer hover:opacity-80', 'bg-secondary', 'text-yellow', 'font-manrope', className), onClick: disabled ? undefined : onClick, role: "button", tabIndex: disabled ? -1 : 0, onKeyDown: (e) => {
|
|
15
|
+
if (!disabled && (e.key === 'Enter' || e.key === ' ')) {
|
|
16
|
+
e.preventDefault();
|
|
17
|
+
onClick();
|
|
18
|
+
}
|
|
19
|
+
}, children: [_jsx("div", { className: "flex flex-col justify-end leading-[0] shrink-0 pb-[2px]", children: _jsx("p", { className: "leading-[1.5] whitespace-nowrap", children: disabled ? disabledLabel || label : label }) }), !disabled && (_jsx("div", { className: "relative shrink-0 size-[10px]", children: _jsx(AddIcon, {}) }))] }));
|
|
20
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ContactSource as SDKContactSource } from '@silentswap/sdk';
|
|
3
|
+
export interface Contact {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
address: string | (() => Promise<string>);
|
|
7
|
+
source?: ContactSource;
|
|
8
|
+
ens?: string;
|
|
9
|
+
rawAddress?: () => string | undefined;
|
|
10
|
+
isEvm?: () => boolean;
|
|
11
|
+
isSolana?: () => boolean;
|
|
12
|
+
isBip122?: () => boolean;
|
|
13
|
+
isCosmos?: () => boolean;
|
|
14
|
+
}
|
|
15
|
+
export type ContactSource = SDKContactSource | 'wallet' | 'saved' | 'ens' | 'unknown';
|
|
16
|
+
interface AddressSelectorProps {
|
|
17
|
+
isOpen: boolean;
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
onSelect: (address: string, label?: string) => void;
|
|
20
|
+
onSaveContact?: (contactInfo: {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
source: ContactSource;
|
|
24
|
+
}) => void;
|
|
25
|
+
connectedAddress?: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
mode?: 'sender' | 'recipient';
|
|
28
|
+
contacts?: Contact[];
|
|
29
|
+
targetAsset?: string;
|
|
30
|
+
connectedAccounts?: Record<string, Contact>;
|
|
31
|
+
activeSenderId?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const AddressSelector: React.FC<AddressSelectorProps>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React, { useState, useCallback, useEffect } from 'react';
|
|
4
|
+
import { Dialog, DialogContent, DialogTitle } from './dialog';
|
|
5
|
+
import { formatAddress } from '@silentswap/sdk';
|
|
6
|
+
// Hooks
|
|
7
|
+
import { useEnsResolution } from '../../hooks/useEnsResolution';
|
|
8
|
+
import { useAddressSearch } from '../../hooks/useAddressSearch';
|
|
9
|
+
import { useContactSearch } from '../../hooks/useContactSearch';
|
|
10
|
+
// Components
|
|
11
|
+
import { PanelRow } from './panel-row';
|
|
12
|
+
import { UserTile } from './UserTile';
|
|
13
|
+
import { ContactRow } from './ContactRow';
|
|
14
|
+
import { ContactSourceBadge } from './ContactSourceBadge';
|
|
15
|
+
import { ManualAddressEntry } from './ManualAddressEntry';
|
|
16
|
+
import { EnsResult } from './EnsResult';
|
|
17
|
+
import { BinocularsIcon } from './icons';
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// Main Component
|
|
20
|
+
// ============================================================================
|
|
21
|
+
export const AddressSelector = ({ isOpen, onClose, onSelect, onSaveContact, connectedAddress, title, mode = 'recipient', contacts = [], targetAsset, connectedAccounts = {}, activeSenderId, }) => {
|
|
22
|
+
// Search state
|
|
23
|
+
const [search, setSearch] = useState('');
|
|
24
|
+
const [newLabel, setNewLabel] = useState('');
|
|
25
|
+
// Hooks
|
|
26
|
+
const ensState = useEnsResolution(search, mode === 'recipient');
|
|
27
|
+
const manualAddress = useAddressSearch(search);
|
|
28
|
+
const filteredContacts = useContactSearch(contacts, search, targetAsset, connectedAccounts);
|
|
29
|
+
// Dynamic title and placeholder
|
|
30
|
+
const displayTitle = title || `Select ${mode === 'sender' ? 'Sender' : 'Recipient'} Address`;
|
|
31
|
+
const placeholder = mode === 'recipient' ? 'Address, ENS, or nickname' : 'Filter by address';
|
|
32
|
+
// Reset and select handler
|
|
33
|
+
const resetAndSelect = useCallback((address, label) => {
|
|
34
|
+
setSearch('');
|
|
35
|
+
setNewLabel('');
|
|
36
|
+
onSelect(address, label);
|
|
37
|
+
onClose();
|
|
38
|
+
}, [onSelect, onClose]);
|
|
39
|
+
// Reset state when closing
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!isOpen) {
|
|
42
|
+
setSearch('');
|
|
43
|
+
setNewLabel('');
|
|
44
|
+
}
|
|
45
|
+
}, [isOpen]);
|
|
46
|
+
// Handle dialog open change
|
|
47
|
+
const handleOpenChange = useCallback((open) => {
|
|
48
|
+
if (!open) {
|
|
49
|
+
onClose();
|
|
50
|
+
}
|
|
51
|
+
}, [onClose]);
|
|
52
|
+
return (_jsx(Dialog, { open: isOpen, onOpenChange: handleOpenChange, children: _jsxs(DialogContent, { className: "text-white rounded-2xl border-[#333] bg-[#141414] w-[95vw] max-w-[580px] max-h-[85vh] p-0 flex flex-col", children: [_jsx(DialogTitle, { asChild: true, children: _jsx("div", { className: "p-4 border-b border-[#333] shrink-0", children: _jsx("div", { className: "flex items-center justify-between text-lg cursor-default", children: _jsx("div", { className: "font-semibold text-white", children: displayTitle }) }) }) }), _jsx("div", { className: "p-4 border-b border-[#333] shrink-0 mt-3", children: _jsx("input", { type: "text", className: "w-full bg-[#1a1a1a] border border-[#333] outline-none rounded-lg px-4 py-3 h-[52px] text-white text-sm box-border focus:ring-1 focus:ring-yellow focus:border-yellow", placeholder: placeholder, value: search, onChange: (e) => setSearch(e.target.value), autoFocus: true }) }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsxs("div", { className: "p-4", children: [manualAddress && (_jsx(ManualAddressEntry, { manualAddress: manualAddress, newLabel: newLabel, onLabelChange: setNewLabel, onSave: resetAndSelect, onSaveContact: onSaveContact })), ensState.searching && (_jsx(PanelRow, { left: _jsxs("span", { className: "text-[#888] text-sm", children: ["Searching ENS for ", ensState.searching, "..."] }) })), ensState.resolved && (_jsx(EnsResult, { name: ensState.resolved.name, address: ensState.resolved.address, onSelect: resetAndSelect, onSaveContact: onSaveContact })), connectedAddress && mode === 'recipient' && !manualAddress && (_jsx("div", { className: "mb-4 pb-4 border-b border-[#333]", children: _jsx(PanelRow, { onClick: () => resetAndSelect(connectedAddress), left: _jsxs(_Fragment, { children: [_jsx("div", { style: { zoom: 0.75 }, children: _jsx(UserTile, { address: connectedAddress }) }), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "text-[14px] font-mono text-white", children: "Connected Wallet" }), _jsx("span", { className: "text-[12px] font-mono text-[#888]", children: formatAddress(connectedAddress, 6) })] })] }), right: _jsx(ContactSourceBadge, { source: "wallet", isActive: true }) }) })), !manualAddress && filteredContacts.length > 0 && (_jsx("div", { className: "flex flex-col", children: filteredContacts.map((contact) => {
|
|
53
|
+
const isActive = activeSenderId === contact.id;
|
|
54
|
+
const isWallet = connectedAccounts[contact.id] !== undefined;
|
|
55
|
+
return (_jsx(ContactRow, { contact: contact, onSelect: resetAndSelect, isActive: isActive, isWallet: isWallet, connectedAccounts: connectedAccounts }, contact.id));
|
|
56
|
+
}) })), !manualAddress && !ensState.searching && filteredContacts.length === 0 && search.trim() && (_jsxs("div", { className: "flex flex-col items-center justify-center py-10 px-4 text-center", children: [_jsx("div", { className: "mb-4", children: _jsx(BinocularsIcon, { width: 40, height: 40, className: "text-[#868686]" }) }), _jsx("div", { className: "text-white font-medium text-base mb-1", children: "No results found" }), _jsxs("div", { className: "text-[#868686] text-sm max-w-[240px]", children: ["We couldn't find any contacts or addresses matching \"", search.trim(), "\""] })] })), !manualAddress && !ensState.searching && contacts.length === 0 && !search.trim() && !connectedAddress && (_jsxs("div", { className: "flex flex-col items-center justify-center py-10 px-4 text-center", children: [_jsx("div", { className: "mb-4", children: _jsx(BinocularsIcon, { width: 40, height: 40, className: "text-[#868686]" }) }), _jsx("div", { className: "text-white font-medium text-base mb-1", children: "No contacts yet" }), _jsx("div", { className: "text-[#868686] text-sm", children: "Enter an address or ENS name above" })] }))] }) }), _jsx("div", { className: "p-4 border-t border-[#333] shrink-0", children: _jsx("button", { className: "w-full px-6 py-3 rounded-lg text-base font-medium bg-[#333] text-white hover:bg-[#444] transition-colors border-none", onClick: onClose, children: "Cancel" }) })] }) }));
|
|
57
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
3
|
+
declare const AlertDialog: React.FC<AlertDialogPrimitive.AlertDialogProps>;
|
|
4
|
+
declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
|
|
6
|
+
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const AlertDialogHeader: {
|
|
9
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
declare const AlertDialogFooter: {
|
|
13
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
17
|
+
declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
18
|
+
declare const AlertDialogAction: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
5
|
+
import { cn } from '../utils';
|
|
6
|
+
import { buttonVariants } from './button';
|
|
7
|
+
const AlertDialog = AlertDialogPrimitive.Root;
|
|
8
|
+
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
9
|
+
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
10
|
+
const AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Overlay, { className: cn('fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0', className), ...props, ref: ref })));
|
|
11
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
12
|
+
const AlertDialogContent = React.forwardRef(({ className, ...props }, ref) => (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, { ref: ref, className: cn('fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg', className), ...props })] })));
|
|
13
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
14
|
+
const AlertDialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col space-y-2 text-center sm:text-left', className), ...props }));
|
|
15
|
+
AlertDialogHeader.displayName = 'AlertDialogHeader';
|
|
16
|
+
const AlertDialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className), ...props }));
|
|
17
|
+
AlertDialogFooter.displayName = 'AlertDialogFooter';
|
|
18
|
+
const AlertDialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Title, { ref: ref, className: cn('text-lg font-semibold', className), ...props })));
|
|
19
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
20
|
+
const AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Description, { ref: ref, className: cn('text-sm text-muted-foreground', className), ...props })));
|
|
21
|
+
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
22
|
+
const AlertDialogAction = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Action, { ref: ref, className: cn(buttonVariants(), className), ...props })));
|
|
23
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
24
|
+
const AlertDialogCancel = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Cancel, { ref: ref, className: cn(buttonVariants({ variant: 'outline' }), 'mt-2 sm:mt-0', className), ...props })));
|
|
25
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
26
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
7
|
+
declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
8
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { cn } from '../utils';
|
|
5
|
+
const alertVariants = cva('relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7', {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: 'bg-background text-foreground',
|
|
9
|
+
destructive: 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
variant: 'default',
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
const Alert = React.forwardRef(({ className, variant, ...props }, ref) => (_jsx("div", { ref: ref, role: "alert", className: cn(alertVariants({ variant }), className), ...props })));
|
|
17
|
+
Alert.displayName = 'Alert';
|
|
18
|
+
const AlertTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx("h5", { ref: ref, className: cn('mb-1 font-medium leading-none tracking-tight', className), ...props })));
|
|
19
|
+
AlertTitle.displayName = 'AlertTitle';
|
|
20
|
+
const AlertDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('text-sm [&_p]:leading-relaxed', className), ...props })));
|
|
21
|
+
AlertDescription.displayName = 'AlertDescription';
|
|
22
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
3
|
+
declare const Avatar: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
4
|
+
declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
|
|
5
|
+
declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
5
|
+
import { cn } from '../utils';
|
|
6
|
+
const Avatar = React.forwardRef(({ className, ...props }, ref) => (_jsx(AvatarPrimitive.Root, { ref: ref, className: cn('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className), ...props })));
|
|
7
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
8
|
+
const AvatarImage = React.forwardRef(({ className, ...props }, ref) => (_jsx(AvatarPrimitive.Image, { ref: ref, className: cn('aspect-square h-full w-full', className), ...props })));
|
|
9
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
10
|
+
const AvatarFallback = React.forwardRef(({ className, ...props }, ref) => (_jsx(AvatarPrimitive.Fallback, { ref: ref, className: cn('flex h-full w-full items-center justify-center rounded-full bg-muted', className), ...props })));
|
|
11
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
12
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { cn } from '../utils';
|
|
5
|
+
const badgeVariants = cva('inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-ring focus:ring-offset-2', {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: 'border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80',
|
|
9
|
+
secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
10
|
+
destructive: 'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80',
|
|
11
|
+
outline: 'text-foreground',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
variant: 'default',
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
function Badge({ className, variant, ...props }) {
|
|
19
|
+
return _jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
20
|
+
}
|
|
21
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "yellow" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { cn } from '../utils';
|
|
6
|
+
const buttonVariants = cva('inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-0 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: 'cursor-pointer bg-primary text-primary-foreground shadow hover:bg-primary/90',
|
|
10
|
+
yellow: 'cursor-pointer bg-yellow text-black shadow hover:bg-yellow/90',
|
|
11
|
+
destructive: 'cursor-pointer bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
|
|
12
|
+
outline: 'cursor-pointer border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
|
|
13
|
+
secondary: 'cursor-pointer bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
|
|
14
|
+
ghost: 'cursor-pointer hover:bg-accent hover:text-accent-foreground',
|
|
15
|
+
link: 'cursor-pointer text-primary underline-offset-4 hover:underline',
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
default: 'h-9 px-4 py-2',
|
|
19
|
+
sm: 'h-8 rounded-md px-3 text-xs',
|
|
20
|
+
lg: 'h-10 rounded-md px-8',
|
|
21
|
+
icon: 'h-9 w-9',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: 'default',
|
|
26
|
+
size: 'default',
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const Button = React.forwardRef(({ className, variant, size, asChild = false, disabled, ...props }, ref) => {
|
|
30
|
+
const Comp = asChild ? Slot : 'button';
|
|
31
|
+
const { disabled: _disabledProp, ...restProps } = props;
|
|
32
|
+
const buttonProps = {
|
|
33
|
+
...restProps,
|
|
34
|
+
disabled: disabled === true ? true : undefined,
|
|
35
|
+
};
|
|
36
|
+
return (_jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref: ref, suppressHydrationWarning: true, ...buttonProps }));
|
|
37
|
+
});
|
|
38
|
+
Button.displayName = 'Button';
|
|
39
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from '../utils';
|
|
4
|
+
const Card = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('rounded-xl border bg-card text-card-foreground shadow', className), ...props })));
|
|
5
|
+
Card.displayName = 'Card';
|
|
6
|
+
const CardHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('flex flex-col space-y-1.5 p-6', className), ...props })));
|
|
7
|
+
CardHeader.displayName = 'CardHeader';
|
|
8
|
+
const CardTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('font-semibold leading-none tracking-tight', className), ...props })));
|
|
9
|
+
CardTitle.displayName = 'CardTitle';
|
|
10
|
+
const CardDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('text-sm text-muted-foreground', className), ...props })));
|
|
11
|
+
CardDescription.displayName = 'CardDescription';
|
|
12
|
+
const CardContent = React.forwardRef(({ className, ...props }, ref) => _jsx("div", { ref: ref, className: cn('p-6 pt-0', className), ...props }));
|
|
13
|
+
CardContent.displayName = 'CardContent';
|
|
14
|
+
const CardFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('flex items-center p-6 pt-0', className), ...props })));
|
|
15
|
+
CardFooter.displayName = 'CardFooter';
|
|
16
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState, useEffect, useMemo } from 'react';
|
|
3
|
+
import { cn } from '../utils';
|
|
4
|
+
import { Skeleton } from './skeleton';
|
|
5
|
+
export const CoinAvatar = ({ tokenImage, chainImage, className, chainIconSize = 3, }) => {
|
|
6
|
+
const [isTokenImageError, setTokenImageError] = useState(false);
|
|
7
|
+
const [isChainImageError, setChainImageError] = useState(false);
|
|
8
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
9
|
+
const borderCircleSize = chainIconSize * 4 + 4;
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
setTokenImageError(false);
|
|
12
|
+
}, [tokenImage]);
|
|
13
|
+
const resolvedTokenImage = useMemo(() => {
|
|
14
|
+
if (!tokenImage) {
|
|
15
|
+
return '/tokens/default.png';
|
|
16
|
+
}
|
|
17
|
+
return isTokenImageError ? '/tokens/default.png' : tokenImage;
|
|
18
|
+
}, [isTokenImageError, tokenImage]);
|
|
19
|
+
return (_jsxs("div", { "data-testid": "coin-avatar", className: "relative inline-block", children: [isLoading && _jsx(Skeleton, { className: cn('rounded-full bg-gray-700', className) }), _jsx("img", { src: resolvedTokenImage, alt: "Token Avatar", "data-testid": "token-image", className: cn(className ? className : 'w-7 h-7 rounded-full object-cover aspect-square shrink-0 grow-0', isLoading ? 'hidden' : ''), onError: () => setTokenImageError(true), onLoad: () => setIsLoading(false) }), _jsx("div", { "data-testid": "chain-image", className: `absolute -bottom-0.5 -right-1.5 flex items-center justify-center bg-base rounded-full border border-base-stroke`, style: { width: `${borderCircleSize}px`, height: `${borderCircleSize}px` }, children: isLoading ? (_jsx(Skeleton, { className: `w-${chainIconSize} h-${chainIconSize} bg-gray-500 rounded-full` })) : (_jsx("img", { src: isChainImageError ? '/tokens/default-chain.png' : chainImage, alt: "Chain Image", className: `w-${chainIconSize} h-${chainIconSize} object-fill`, onError: () => setChainImageError(true) })) })] }));
|
|
20
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
2
|
+
declare const Collapsible: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const CollapsibleContent: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
3
|
+
const Collapsible = CollapsiblePrimitive.Root;
|
|
4
|
+
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
5
|
+
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
|
|
6
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
3
|
+
declare const ContextMenu: React.FC<ContextMenuPrimitive.ContextMenuProps>;
|
|
4
|
+
declare const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
declare const ContextMenuGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const ContextMenuPortal: React.FC<ContextMenuPrimitive.ContextMenuPortalProps>;
|
|
7
|
+
declare const ContextMenuSub: React.FC<ContextMenuPrimitive.ContextMenuSubProps>;
|
|
8
|
+
declare const ContextMenuRadioGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const ContextMenuSubTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
10
|
+
inset?: boolean;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const ContextMenuSubContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const ContextMenuContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const ContextMenuItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
15
|
+
inset?: boolean;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const ContextMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const ContextMenuRadioItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const ContextMenuLabel: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
20
|
+
inset?: boolean;
|
|
21
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const ContextMenuSeparator: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const ContextMenuShortcut: {
|
|
24
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
5
|
+
import { Check, ChevronRight, Circle } from 'lucide-react';
|
|
6
|
+
import { cn } from '../utils';
|
|
7
|
+
const ContextMenu = ContextMenuPrimitive.Root;
|
|
8
|
+
const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
9
|
+
const ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
10
|
+
const ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
11
|
+
const ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
12
|
+
const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
13
|
+
const ContextMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(ContextMenuPrimitive.SubTrigger, { ref: ref, className: cn('flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground', inset && 'pl-8', className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto h-4 w-4" })] })));
|
|
14
|
+
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
15
|
+
const ContextMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.SubContent, { ref: ref, className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]', className), ...props })));
|
|
16
|
+
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
17
|
+
const ContextMenuContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Content, { ref: ref, className: cn('z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]', className), ...props }) })));
|
|
18
|
+
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
19
|
+
const ContextMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(ContextMenuPrimitive.Item, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', inset && 'pl-8', className), ...props })));
|
|
20
|
+
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
21
|
+
const ContextMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(ContextMenuPrimitive.CheckboxItem, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), children] })));
|
|
22
|
+
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
23
|
+
const ContextMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(ContextMenuPrimitive.RadioItem, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "h-4 w-4 fill-current" }) }) }), children] })));
|
|
24
|
+
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
25
|
+
const ContextMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(ContextMenuPrimitive.Label, { ref: ref, className: cn('px-2 py-1.5 text-sm font-semibold text-foreground', inset && 'pl-8', className), ...props })));
|
|
26
|
+
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
27
|
+
const ContextMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.Separator, { ref: ref, className: cn('-mx-1 my-1 h-px bg-border', className), ...props })));
|
|
28
|
+
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
29
|
+
const ContextMenuShortcut = ({ className, ...props }) => {
|
|
30
|
+
return _jsx("span", { className: cn('ml-auto text-xs tracking-widest text-muted-foreground', className), ...props });
|
|
31
|
+
};
|
|
32
|
+
ContextMenuShortcut.displayName = 'ContextMenuShortcut';
|
|
33
|
+
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DialogHeader: {
|
|
10
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
declare const DialogFooter: {
|
|
14
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
18
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
19
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|