@silentswap/ui-kit 0.0.42 → 0.0.44
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,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
|
+
declare const Popover: ({ open, onOpenChange, children, ...props }: PopoverPrimitive.PopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const PopoverOverlay: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
interface PopoverContentProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {
|
|
8
|
+
triggerElement?: HTMLElement | null;
|
|
9
|
+
containerElement?: HTMLElement | null;
|
|
10
|
+
isOpen?: boolean;
|
|
11
|
+
showOverlay?: boolean;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverOverlay };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
5
|
+
import { motion, AnimatePresence } from 'motion/react';
|
|
6
|
+
import { cn } from '../utils';
|
|
7
|
+
import { useIsMobile } from '../hooks/use-mobile';
|
|
8
|
+
// Context to handle exit animations
|
|
9
|
+
const PopoverAnimationContext = React.createContext(null);
|
|
10
|
+
const Popover = ({ open, onOpenChange, children, ...props }) => {
|
|
11
|
+
const [isPresent, setIsPresent] = React.useState(open);
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
if (open)
|
|
14
|
+
setIsPresent(true);
|
|
15
|
+
}, [open]);
|
|
16
|
+
const handleExitComplete = React.useCallback(() => {
|
|
17
|
+
setIsPresent(false);
|
|
18
|
+
}, []);
|
|
19
|
+
// The Radix root should stay "open" as long as the parent says so OR we are still animating out
|
|
20
|
+
return (_jsx(PopoverAnimationContext.Provider, { value: { onExitComplete: handleExitComplete }, children: _jsx(PopoverPrimitive.Root, { open: open || isPresent, onOpenChange: onOpenChange, ...props, children: children }) }));
|
|
21
|
+
};
|
|
22
|
+
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
23
|
+
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
24
|
+
const PopoverOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(motion.div, { ref: ref, className: cn('fixed inset-0 z-40 pointer-events-auto md:pointer-events-none', className), style: {
|
|
25
|
+
background: 'rgba(0, 0, 0, 0.80)',
|
|
26
|
+
opacity: 0.7,
|
|
27
|
+
}, initial: { opacity: 0 }, animate: { opacity: 0.7 }, exit: { opacity: 0 }, transition: { duration: 0.2, ease: 'easeOut' }, onClick: props.onClick, onKeyDown: props.onKeyDown })));
|
|
28
|
+
PopoverOverlay.displayName = 'PopoverOverlay';
|
|
29
|
+
// Bottom sheet animation for mobile - slides up from bottom
|
|
30
|
+
const contentVariantsBottomSheet = {
|
|
31
|
+
hidden: {
|
|
32
|
+
opacity: 0,
|
|
33
|
+
y: '100%',
|
|
34
|
+
x: '-50%',
|
|
35
|
+
},
|
|
36
|
+
visible: {
|
|
37
|
+
opacity: 1,
|
|
38
|
+
y: 0,
|
|
39
|
+
x: '-50%',
|
|
40
|
+
transition: {
|
|
41
|
+
type: 'spring',
|
|
42
|
+
stiffness: 300,
|
|
43
|
+
damping: 30,
|
|
44
|
+
opacity: { duration: 0.2 },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
exit: {
|
|
48
|
+
opacity: 0,
|
|
49
|
+
y: '100%',
|
|
50
|
+
x: '-50%',
|
|
51
|
+
transition: {
|
|
52
|
+
duration: 0.25,
|
|
53
|
+
ease: 'easeIn',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, triggerElement, containerElement, isOpen, showOverlay = false, onClose, children, ...props }, ref) => {
|
|
58
|
+
const isMobile = useIsMobile();
|
|
59
|
+
const animationContext = React.useContext(PopoverAnimationContext);
|
|
60
|
+
// Create anchor element ref for positioning (desktop only)
|
|
61
|
+
const anchorRef = React.useRef(null);
|
|
62
|
+
// Update anchor position when trigger element changes, on scroll, or on resize (desktop only)
|
|
63
|
+
React.useEffect(() => {
|
|
64
|
+
if (isMobile)
|
|
65
|
+
return; // Don't position anchor on mobile
|
|
66
|
+
if (!triggerElement || !anchorRef.current || !isOpen)
|
|
67
|
+
return;
|
|
68
|
+
const updateAnchorPosition = () => {
|
|
69
|
+
if (!anchorRef.current || !triggerElement)
|
|
70
|
+
return;
|
|
71
|
+
const triggerRect = triggerElement.getBoundingClientRect();
|
|
72
|
+
// Get the viewport-relative position for the fixed anchor
|
|
73
|
+
let x;
|
|
74
|
+
if (containerElement) {
|
|
75
|
+
const containerRect = containerElement.getBoundingClientRect();
|
|
76
|
+
x = containerRect.left + containerRect.width / 2;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
x = triggerRect.left + triggerRect.width / 2;
|
|
80
|
+
}
|
|
81
|
+
const y = triggerRect.bottom;
|
|
82
|
+
anchorRef.current.style.position = 'fixed';
|
|
83
|
+
anchorRef.current.style.left = `${x}px`;
|
|
84
|
+
anchorRef.current.style.top = `${y}px`;
|
|
85
|
+
anchorRef.current.style.width = '0';
|
|
86
|
+
anchorRef.current.style.height = '0';
|
|
87
|
+
anchorRef.current.style.pointerEvents = 'none';
|
|
88
|
+
anchorRef.current.style.zIndex = '50';
|
|
89
|
+
};
|
|
90
|
+
// Update immediately
|
|
91
|
+
updateAnchorPosition();
|
|
92
|
+
// Update on scroll and resize
|
|
93
|
+
window.addEventListener('scroll', updateAnchorPosition, true);
|
|
94
|
+
window.addEventListener('resize', updateAnchorPosition);
|
|
95
|
+
return () => {
|
|
96
|
+
window.removeEventListener('scroll', updateAnchorPosition, true);
|
|
97
|
+
window.removeEventListener('resize', updateAnchorPosition);
|
|
98
|
+
};
|
|
99
|
+
}, [triggerElement, containerElement, isOpen, isMobile]);
|
|
100
|
+
return (_jsxs(_Fragment, { children: [!isMobile && triggerElement && (_jsx(PopoverAnchor, { asChild: true, children: _jsx("div", { ref: anchorRef }) })), _jsx(PopoverPrimitive.Portal, { children: _jsx(AnimatePresence, { onExitComplete: animationContext?.onExitComplete, children: isOpen && (_jsxs(_Fragment, { children: [showOverlay && _jsx(PopoverOverlay, { onClick: onClose }), isMobile ? (_jsx(motion.div, { ref: ref, className: cn('!fixed !left-[50%] !bottom-0 !top-auto z-50 w-[95vw] max-w-[580px] rounded-t-[20px] border-t border-l border-r bg-popover text-popover-foreground shadow-md outline-none flex flex-col', className), style: {
|
|
101
|
+
height: '650px',
|
|
102
|
+
maxHeight: '90vh',
|
|
103
|
+
}, variants: contentVariantsBottomSheet, initial: "hidden", animate: "visible", exit: "exit", children: children })) : (_jsx(PopoverPrimitive.Content, { ref: ref, side: "bottom", align: align, sideOffset: sideOffset, avoidCollisions: false, className: cn('z-50 min-w-72 rounded-md bg-popover text-popover-foreground shadow-md outline-none 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 flex flex-col', className), ...props, children: children }))] })) }) })] }));
|
|
104
|
+
});
|
|
105
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
106
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverOverlay };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { S_CAIP19_USDC_AVALANCHE } from '../constants';
|
|
4
|
+
import { asset_get } from '../data';
|
|
5
|
+
import { AssetTile } from './assetTile';
|
|
6
|
+
export const PopularTokensArea = ({ onTokenSelect, title = 'Popular Tokens', tokens, className = '' }) => {
|
|
7
|
+
const defaultTokens = [
|
|
8
|
+
'eip155:1/slip44:60', // ETH on Ethereum
|
|
9
|
+
'eip155:1/erc20:0xdAC17F958D2ee523a2206206994597C13D831ec7', // USDT on Ethereum
|
|
10
|
+
'eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC on Ethereum
|
|
11
|
+
'eip155:1/erc20:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH on Ethereum
|
|
12
|
+
'eip155:1/erc20:0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', // WBTC on Ethereum
|
|
13
|
+
'eip155:56/slip44:714', // BNB on BSC
|
|
14
|
+
'eip155:56/erc20:0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c', // WBNB on BSC
|
|
15
|
+
'eip155:8453/slip44:60', // ETH on Base
|
|
16
|
+
'eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC on Base
|
|
17
|
+
'eip155:43114/slip44:9005', // WAVAX on Avalanche
|
|
18
|
+
S_CAIP19_USDC_AVALANCHE, // USDC on Avalanche
|
|
19
|
+
'eip155:137/slip44:966', // WMATIC/WPOL on Polygon
|
|
20
|
+
'eip155:137/erc20:0xc2132D05D31c914a87C6611C10748AEb04B58e8F', // USDT0 on Polygon
|
|
21
|
+
'eip155:137/erc20:0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359', // USDC on Polygon
|
|
22
|
+
'eip155:10/slip44:60', // WETH on Optimism
|
|
23
|
+
'eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', // USDC on Optimism
|
|
24
|
+
'eip155:42161/slip44:60', // WETH on Arbitrum
|
|
25
|
+
'eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831', // USDC on Arbitrum
|
|
26
|
+
];
|
|
27
|
+
const popularTokens = tokens || defaultTokens;
|
|
28
|
+
return (_jsxs("div", { className: `${className}`, children: [_jsx("div", { className: "font-orbitron text-lg font-bold text-white mb-3", children: title }), _jsx("div", { className: "flex gap-2 overflow-x-auto pb-2", children: popularTokens.map((caip19) => {
|
|
29
|
+
const asset = asset_get(caip19);
|
|
30
|
+
if (!asset)
|
|
31
|
+
return null;
|
|
32
|
+
return (_jsxs("div", { className: "flex flex-col items-center gap-2 bg-dim-med rounded-lg p-2 cursor-pointer hover:bg-dim-light transition-colors min-w-fit", onClick: () => onTokenSelect?.(caip19), role: "button", tabIndex: 0, "aria-label": `Select ${asset.symbol}`, children: [_jsx(AssetTile, { caip19: caip19, size: "small" }), _jsx("div", { className: "text-text-dim text-xs text-center", children: asset.symbol?.toUpperCase() })] }, caip19));
|
|
33
|
+
}) })] }));
|
|
34
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { HTMLAttributes } from 'react';
|
|
3
|
+
export interface ProgressBarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
4
|
+
/** Progress value from 0 to 1 (0 = 0%, 1 = 100%) */
|
|
5
|
+
value: number;
|
|
6
|
+
/** Height of the progress bar in pixels */
|
|
7
|
+
height?: number;
|
|
8
|
+
/** Color of the progress fill */
|
|
9
|
+
color?: 'green' | 'yellow' | 'purple' | 'orange';
|
|
10
|
+
/** Whether to show the progress bar (animates height) */
|
|
11
|
+
show?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Simple progress bar component
|
|
15
|
+
* Based on SilentSwap Plate.svelte progress styles
|
|
16
|
+
*/
|
|
17
|
+
export declare const ProgressBar: React.FC<ProgressBarProps>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Simple progress bar component
|
|
5
|
+
* Based on SilentSwap Plate.svelte progress styles
|
|
6
|
+
*/
|
|
7
|
+
export const ProgressBar = ({ value, height = 6, color = 'green', show = true, className = '', style, ...props }) => {
|
|
8
|
+
const colorClasses = {
|
|
9
|
+
green: 'bg-[var(--color-green)]',
|
|
10
|
+
yellow: 'bg-[var(--color-yellow)]',
|
|
11
|
+
purple: 'bg-[var(--color-purple)]',
|
|
12
|
+
orange: 'bg-[var(--color-orange)]',
|
|
13
|
+
};
|
|
14
|
+
// Clamp value between 0 and 1
|
|
15
|
+
const clampedValue = Math.max(0, Math.min(1, value));
|
|
16
|
+
const containerStyle = {
|
|
17
|
+
height: show ? `${height}px` : '0px',
|
|
18
|
+
width: '100%',
|
|
19
|
+
backgroundColor: 'var(--color-gray-dark)',
|
|
20
|
+
transition: 'height 500ms linear',
|
|
21
|
+
overflow: 'hidden',
|
|
22
|
+
...style,
|
|
23
|
+
};
|
|
24
|
+
const fillStyle = {
|
|
25
|
+
width: `${clampedValue * 100}%`,
|
|
26
|
+
height: '100%',
|
|
27
|
+
transition: 'width 490ms linear',
|
|
28
|
+
};
|
|
29
|
+
return (_jsx("div", { className: className, style: containerStyle, role: "progressbar", "aria-valuenow": clampedValue * 100, "aria-valuemin": 0, "aria-valuemax": 100, ...props, children: _jsx("div", { className: colorClasses[color], style: fillStyle }) }));
|
|
30
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../utils';
|
|
3
|
+
import React, { useRef, useState, useCallback, useEffect } from 'react';
|
|
4
|
+
const ResponsiveContainer = ({ className = '', children }) => {
|
|
5
|
+
const containerRef = useRef(null);
|
|
6
|
+
const [containerHeight, setContainerHeight] = useState('60vh');
|
|
7
|
+
const [showTopShadow, setShowTopShadow] = useState(false);
|
|
8
|
+
const [showBottomShadow, setShowBottomShadow] = useState(false);
|
|
9
|
+
// Calculate container height based on viewport and position
|
|
10
|
+
const calculateHeight = useCallback(() => {
|
|
11
|
+
if (!containerRef.current)
|
|
12
|
+
return;
|
|
13
|
+
const viewportHeight = window.innerHeight;
|
|
14
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
15
|
+
const topPosition = rect.top;
|
|
16
|
+
// Increased buffer to account for bottom padding and safe areas
|
|
17
|
+
const bottomBuffer = 40; // Adjust based on your layout
|
|
18
|
+
const maxHeight = viewportHeight - topPosition - bottomBuffer;
|
|
19
|
+
// Ensure minimum height and max height constraints
|
|
20
|
+
const calculatedHeight = Math.max(200, Math.min(maxHeight, 800));
|
|
21
|
+
setContainerHeight(`${calculatedHeight}px`);
|
|
22
|
+
}, []);
|
|
23
|
+
// Handle scroll to determine shadow visibility
|
|
24
|
+
const handleScroll = useCallback(() => {
|
|
25
|
+
if (!containerRef.current)
|
|
26
|
+
return;
|
|
27
|
+
const { scrollTop, scrollHeight, clientHeight } = containerRef.current;
|
|
28
|
+
setShowTopShadow(scrollTop > 10); // Small threshold to avoid flickering
|
|
29
|
+
setShowBottomShadow(scrollTop + clientHeight < scrollHeight - 10);
|
|
30
|
+
}, []);
|
|
31
|
+
// Set up resize listener
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
calculateHeight();
|
|
34
|
+
window.addEventListener('resize', calculateHeight);
|
|
35
|
+
return () => window.removeEventListener('resize', calculateHeight);
|
|
36
|
+
}, [calculateHeight]);
|
|
37
|
+
// Set up scroll listener
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
const container = containerRef.current;
|
|
40
|
+
if (container) {
|
|
41
|
+
handleScroll();
|
|
42
|
+
container.addEventListener('scroll', handleScroll);
|
|
43
|
+
return () => container.removeEventListener('scroll', handleScroll);
|
|
44
|
+
}
|
|
45
|
+
}, [handleScroll]);
|
|
46
|
+
// Recalculate on mount and when children change
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
const timer = setTimeout(calculateHeight, 100); // Longer delay for animations
|
|
49
|
+
return () => clearTimeout(timer);
|
|
50
|
+
}, [calculateHeight, children]);
|
|
51
|
+
// Use ResizeObserver to watch for parent container size changes
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (!containerRef.current)
|
|
54
|
+
return;
|
|
55
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
56
|
+
calculateHeight();
|
|
57
|
+
});
|
|
58
|
+
// Observe the parent element
|
|
59
|
+
const parent = containerRef.current.parentElement;
|
|
60
|
+
if (parent) {
|
|
61
|
+
resizeObserver.observe(parent);
|
|
62
|
+
}
|
|
63
|
+
return () => {
|
|
64
|
+
resizeObserver.disconnect();
|
|
65
|
+
};
|
|
66
|
+
}, [calculateHeight]);
|
|
67
|
+
return (_jsx("div", { className: "relative w-full h-full", children: _jsx("div", { ref: containerRef, className: cn(`w-full overflow-y-auto no-scrollbar pb-safe-offset-14 md:pb-safe-offset-10`, className), style: { height: containerHeight }, onScroll: handleScroll, children: children }) }));
|
|
68
|
+
};
|
|
69
|
+
export default ResponsiveContainer;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
3
|
+
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
5
|
+
import { cn } from '../utils';
|
|
6
|
+
const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(ScrollAreaPrimitive.Root, { ref: ref, className: cn('relative overflow-hidden', className), ...props, children: [_jsx(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children: children }), _jsx(ScrollBar, {}), _jsx(ScrollAreaPrimitive.Corner, {})] })));
|
|
7
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
8
|
+
const ScrollBar = React.forwardRef(({ className, orientation = 'vertical', ...props }, ref) => (_jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, { ref: ref, orientation: orientation, className: cn('flex touch-none select-none transition-colors', orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent p-[1px]', orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent p-[1px]', className), ...props, children: _jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" }) })));
|
|
9
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
10
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
3
|
+
declare const Select: React.FC<SelectPrimitive.SelectProps>;
|
|
4
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
|
|
@@ -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 SelectPrimitive from '@radix-ui/react-select';
|
|
5
|
+
import { Check, ChevronDown, ChevronUp } from 'lucide-react';
|
|
6
|
+
import { cn } from '../utils';
|
|
7
|
+
const Select = SelectPrimitive.Root;
|
|
8
|
+
const SelectGroup = SelectPrimitive.Group;
|
|
9
|
+
const SelectValue = SelectPrimitive.Value;
|
|
10
|
+
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn('flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1', className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: "h-4 w-4 opacity-50" }) })] })));
|
|
11
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
12
|
+
const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollUpButton, { ref: ref, className: cn('flex cursor-default items-center justify-center py-1', className), ...props, children: _jsx(ChevronUp, { className: "h-4 w-4" }) })));
|
|
13
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
14
|
+
const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollDownButton, { ref: ref, className: cn('flex cursor-default items-center justify-center py-1', className), ...props, children: _jsx(ChevronDown, { className: "h-4 w-4" }) })));
|
|
15
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
16
|
+
const SelectContent = React.forwardRef(({ className, children, position = 'popper', ...props }, ref) => (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { ref: ref, className: cn('relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover 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', position === 'popper' &&
|
|
17
|
+
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), position: position, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn('p-1', position === 'popper' &&
|
|
18
|
+
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]'), children: children }), _jsx(SelectScrollDownButton, {})] }) })));
|
|
19
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
20
|
+
const SelectLabel = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Label, { ref: ref, className: cn('px-2 py-1.5 text-sm font-semibold', className), ...props })));
|
|
21
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
22
|
+
const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Item, { ref: ref, className: cn('relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 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 right-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] })));
|
|
23
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
24
|
+
const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Separator, { ref: ref, className: cn('-mx-1 my-1 h-px bg-muted', className), ...props })));
|
|
25
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
26
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
3
|
+
declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export { Separator };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
5
|
+
import { cn } from '../utils';
|
|
6
|
+
const Separator = React.forwardRef(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (_jsx(SeparatorPrimitive.Root, { ref: ref, decorative: decorative, orientation: orientation, className: cn('shrink-0 bg-border', orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]', className), ...props })));
|
|
7
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
8
|
+
export { Separator };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
|
|
5
|
+
declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
8
|
+
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const sheetVariants: (props?: ({
|
|
10
|
+
side?: "top" | "right" | "bottom" | "left" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
13
|
+
}
|
|
14
|
+
declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const SheetHeader: {
|
|
16
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
declare const SheetFooter: {
|
|
20
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
declare const SheetTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
24
|
+
declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
25
|
+
export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { cn } from '../utils';
|
|
7
|
+
import { CloseIcon } from './icons';
|
|
8
|
+
const Sheet = SheetPrimitive.Root;
|
|
9
|
+
const SheetTrigger = SheetPrimitive.Trigger;
|
|
10
|
+
const SheetClose = SheetPrimitive.Close;
|
|
11
|
+
const SheetPortal = SheetPrimitive.Portal;
|
|
12
|
+
const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(SheetPrimitive.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 })));
|
|
13
|
+
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
14
|
+
const sheetVariants = cva('fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out', {
|
|
15
|
+
variants: {
|
|
16
|
+
side: {
|
|
17
|
+
top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
|
|
18
|
+
bottom: 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
|
|
19
|
+
left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-[400px]',
|
|
20
|
+
right: 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-[400px]',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
side: 'right',
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
const SheetContent = React.forwardRef(({ side = 'right', className, children, ...props }, ref) => (_jsxs(SheetPortal, { children: [_jsx(SheetOverlay, {}), _jsxs(SheetPrimitive.Content, { ref: ref, className: cn(sheetVariants({ side }), className), ...props, children: [_jsxs(SheetPrimitive.Close, { className: "cursor-pointer absolute right-5 top-8 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [_jsx(CloseIcon, {}), _jsx("span", { className: "sr-only", children: "Close" })] }), children] })] })));
|
|
28
|
+
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
29
|
+
const SheetHeader = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col space-y-2 text-center sm:text-left', className), ...props }));
|
|
30
|
+
SheetHeader.displayName = 'SheetHeader';
|
|
31
|
+
const SheetFooter = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className), ...props }));
|
|
32
|
+
SheetFooter.displayName = 'SheetFooter';
|
|
33
|
+
const SheetTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(SheetPrimitive.Title, { ref: ref, className: cn('text-lg font-semibold text-foreground', className), ...props })));
|
|
34
|
+
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
35
|
+
const SheetDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(SheetPrimitive.Description, { ref: ref, className: cn('text-sm text-muted-foreground', className), ...props })));
|
|
36
|
+
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
37
|
+
export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { TooltipContent } from './tooltip';
|
|
4
|
+
type SidebarContext = {
|
|
5
|
+
state: 'expanded' | 'collapsed';
|
|
6
|
+
open: boolean;
|
|
7
|
+
setOpen: (open: boolean) => void;
|
|
8
|
+
openMobile: boolean;
|
|
9
|
+
setOpenMobile: (open: boolean) => void;
|
|
10
|
+
isMobile: boolean;
|
|
11
|
+
toggleSidebar: () => void;
|
|
12
|
+
};
|
|
13
|
+
declare const SidebarContext: React.Context<SidebarContext | null>;
|
|
14
|
+
declare function useSidebar(): SidebarContext;
|
|
15
|
+
declare const SidebarProvider: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
16
|
+
defaultOpen?: boolean;
|
|
17
|
+
open?: boolean;
|
|
18
|
+
onOpenChange?: (open: boolean) => void;
|
|
19
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const Sidebar: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
21
|
+
side?: "left" | "right";
|
|
22
|
+
variant?: "sidebar" | "floating" | "inset";
|
|
23
|
+
collapsible?: "offcanvas" | "icon" | "none";
|
|
24
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<import("./button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
26
|
+
declare const SidebarRail: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
27
|
+
declare const SidebarInset: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
declare const SidebarInput: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
29
|
+
declare const SidebarHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
declare const SidebarFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
declare const SidebarSeparator: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-separator").SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
declare const SidebarContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
declare const SidebarGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
declare const SidebarGroupLabel: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
35
|
+
asChild?: boolean;
|
|
36
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
+
declare const SidebarGroupAction: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
38
|
+
asChild?: boolean;
|
|
39
|
+
}, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
40
|
+
declare const SidebarGroupContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
declare const SidebarMenu: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
42
|
+
declare const SidebarMenuItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
43
|
+
declare const SidebarMenuButton: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
isActive?: boolean;
|
|
46
|
+
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
47
|
+
} & VariantProps<(props?: ({
|
|
48
|
+
variant?: "default" | "outline" | null | undefined;
|
|
49
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
50
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
51
|
+
declare const SidebarMenuAction: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
52
|
+
asChild?: boolean;
|
|
53
|
+
showOnHover?: boolean;
|
|
54
|
+
}, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
55
|
+
declare const SidebarMenuBadge: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
56
|
+
declare const SidebarMenuSkeleton: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
57
|
+
showIcon?: boolean;
|
|
58
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
59
|
+
declare const SidebarMenuSub: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
60
|
+
declare const SidebarMenuSubItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
61
|
+
declare const SidebarMenuSubButton: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
62
|
+
asChild?: boolean;
|
|
63
|
+
size?: "sm" | "md";
|
|
64
|
+
isActive?: boolean;
|
|
65
|
+
}, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
66
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, };
|