mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-03-07 23:17:37 +00:00
refactor: move components in src/components/ui to src/shared/view/ui
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { X, FolderPlus, GitBranch, Key, ChevronRight, ChevronLeft, Check, Loader2, AlertCircle, FolderOpen, Eye, EyeOff, Plus } from 'lucide-react';
|
import { X, FolderPlus, GitBranch, Key, ChevronRight, ChevronLeft, Check, Loader2, AlertCircle, FolderOpen, Eye, EyeOff, Plus } from 'lucide-react';
|
||||||
import { Button } from './ui/button';
|
import { Button, Input } from '../shared/view/ui';
|
||||||
import { Input } from './ui/input';
|
|
||||||
import { api } from '../utils/api';
|
import { api } from '../utils/api';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { memo, useMemo } from 'react';
|
import { memo, useMemo } from 'react';
|
||||||
import { CheckCircle2, Circle, Clock, type LucideIcon } from 'lucide-react';
|
import { CheckCircle2, Circle, Clock, type LucideIcon } from 'lucide-react';
|
||||||
import { Badge } from '../../../../ui/badge';
|
import { Badge } from '../../../../../shared/view/ui';
|
||||||
|
|
||||||
type TodoStatus = 'completed' | 'in_progress' | 'pending';
|
type TodoStatus = 'completed' | 'in_progress' | 'pending';
|
||||||
type TodoPriority = 'high' | 'medium' | 'low';
|
type TodoPriority = 'high' | 'medium' | 'low';
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { ReactNode, RefObject } from 'react';
|
import type { ReactNode, RefObject } from 'react';
|
||||||
import { Folder, Search } from 'lucide-react';
|
import { Folder, Search } from 'lucide-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { ScrollArea } from '../../../shared/view/ui';
|
||||||
import type { FileTreeNode, FileTreeViewMode } from '../types/types';
|
import type { FileTreeNode, FileTreeViewMode } from '../types/types';
|
||||||
import FileTreeEmptyState from './FileTreeEmptyState';
|
import FileTreeEmptyState from './FileTreeEmptyState';
|
||||||
import FileTreeList from './FileTreeList';
|
import FileTreeList from './FileTreeList';
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { ChevronDown, Eye, FileText, FolderPlus, List, RefreshCw, Search, TableProperties, X } from 'lucide-react';
|
import { ChevronDown, Eye, FileText, FolderPlus, List, RefreshCw, Search, TableProperties, X } from 'lucide-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button } from '../../ui/button';
|
import { Button, Input } from '../../../shared/view/ui';
|
||||||
import { Input } from '../../ui/input';
|
|
||||||
import { cn } from '../../../lib/utils';
|
import { cn } from '../../../lib/utils';
|
||||||
import type { FileTreeViewMode } from '../types/types';
|
import type { FileTreeViewMode } from '../types/types';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { X } from 'lucide-react';
|
import { X } from 'lucide-react';
|
||||||
import { Button } from '../../ui/button';
|
import { Button } from '../../../shared/view/ui';
|
||||||
import { authenticatedFetch } from '../../../utils/api';
|
import { authenticatedFetch } from '../../../utils/api';
|
||||||
import type { FileTreeImageSelection } from '../types/types';
|
import type { FileTreeImageSelection } from '../types/types';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Settings as SettingsIcon, X } from 'lucide-react';
|
import { Settings as SettingsIcon, X } from 'lucide-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import LoginModal from '../../LoginModal';
|
import LoginModal from '../../LoginModal';
|
||||||
import { Button } from '../../ui/button';
|
import { Button } from '../../../shared/view/ui';
|
||||||
import ClaudeMcpFormModal from '../view/modals/ClaudeMcpFormModal';
|
import ClaudeMcpFormModal from '../view/modals/ClaudeMcpFormModal';
|
||||||
import CodexMcpFormModal from '../view/modals/CodexMcpFormModal';
|
import CodexMcpFormModal from '../view/modals/CodexMcpFormModal';
|
||||||
import SettingsMainTabs from '../view/SettingsMainTabs';
|
import SettingsMainTabs from '../view/SettingsMainTabs';
|
||||||
|
|||||||
@@ -2,8 +2,7 @@ import { FolderOpen, Globe, X } from 'lucide-react';
|
|||||||
import { useEffect, useMemo, useState } from 'react';
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
import type { FormEvent } from 'react';
|
import type { FormEvent } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Input } from '../../../ui/input';
|
import { Button, Input } from '../../../../shared/view/ui';
|
||||||
import { Button } from '../../../ui/button';
|
|
||||||
import { DEFAULT_CLAUDE_MCP_FORM } from '../../constants/constants';
|
import { DEFAULT_CLAUDE_MCP_FORM } from '../../constants/constants';
|
||||||
import type { ClaudeMcpFormState, McpServer, McpScope, McpTransportType, SettingsProject } from '../../types/types';
|
import type { ClaudeMcpFormState, McpServer, McpScope, McpTransportType, SettingsProject } from '../../types/types';
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,7 @@ import { useEffect, useState } from 'react';
|
|||||||
import type { FormEvent } from 'react';
|
import type { FormEvent } from 'react';
|
||||||
import { X } from 'lucide-react';
|
import { X } from 'lucide-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button } from '../../../ui/button';
|
import { Button, Input } from '../../../../shared/view/ui';
|
||||||
import { Input } from '../../../ui/input';
|
|
||||||
import { DEFAULT_CODEX_MCP_FORM } from '../../constants/constants';
|
import { DEFAULT_CODEX_MCP_FORM } from '../../constants/constants';
|
||||||
import type { CodexMcpFormState, McpServer } from '../../types/types';
|
import type { CodexMcpFormState, McpServer } from '../../types/types';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { LogIn } from 'lucide-react';
|
import { LogIn } from 'lucide-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Badge } from '../../../../../../ui/badge';
|
import { Badge, Button } from '../../../../../../../shared/view/ui';
|
||||||
import { Button } from '../../../../../../ui/button';
|
|
||||||
import SessionProviderLogo from '../../../../../../llm-logo-provider/SessionProviderLogo';
|
import SessionProviderLogo from '../../../../../../llm-logo-provider/SessionProviderLogo';
|
||||||
import type { AgentProvider, AuthStatus } from '../../../../../types/types';
|
import type { AgentProvider, AuthStatus } from '../../../../../types/types';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Edit3, Globe, Plus, Server, Terminal, Trash2, Zap } from 'lucide-react';
|
import { Edit3, Globe, Plus, Server, Terminal, Trash2, Zap } from 'lucide-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Badge } from '../../../../../../ui/badge';
|
import { Badge, Button } from '../../../../../../../shared/view/ui';
|
||||||
import { Button } from '../../../../../../ui/button';
|
|
||||||
import type { McpServer, McpToolsResult, McpTestResult } from '../../../../../types/types';
|
import type { McpServer, McpToolsResult, McpTestResult } from '../../../../../types/types';
|
||||||
|
|
||||||
const getTransportIcon = (type: string | undefined) => {
|
const getTransportIcon = (type: string | undefined) => {
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { AlertTriangle, Plus, Shield, X } from 'lucide-react';
|
import { AlertTriangle, Plus, Shield, X } from 'lucide-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button } from '../../../../../../ui/button';
|
import { Button, Input } from '../../../../../../../shared/view/ui';
|
||||||
import { Input } from '../../../../../../ui/input';
|
|
||||||
import type { CodexPermissionMode, GeminiPermissionMode } from '../../../../../types/types';
|
import type { CodexPermissionMode, GeminiPermissionMode } from '../../../../../types/types';
|
||||||
|
|
||||||
const COMMON_CLAUDE_TOOLS = [
|
const COMMON_CLAUDE_TOOLS = [
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { ExternalLink, Key, Plus, Trash2 } from 'lucide-react';
|
import { ExternalLink, Key, Plus, Trash2 } from 'lucide-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button } from '../../../../../ui/button';
|
import { Button, Input } from '../../../../../../shared/view/ui';
|
||||||
import { Input } from '../../../../../ui/input';
|
|
||||||
import type { ApiKeyItem } from '../types';
|
import type { ApiKeyItem } from '../types';
|
||||||
|
|
||||||
type ApiKeysSectionProps = {
|
type ApiKeysSectionProps = {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Eye, EyeOff, Github, Plus, Trash2 } from 'lucide-react';
|
import { Eye, EyeOff, Github, Plus, Trash2 } from 'lucide-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button } from '../../../../../ui/button';
|
import { Button, Input } from '../../../../../../shared/view/ui';
|
||||||
import { Input } from '../../../../../ui/input';
|
|
||||||
import type { GithubCredentialItem } from '../types';
|
import type { GithubCredentialItem } from '../types';
|
||||||
|
|
||||||
type GithubCredentialsSectionProps = {
|
type GithubCredentialsSectionProps = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Check, Copy } from 'lucide-react';
|
import { Check, Copy } from 'lucide-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button } from '../../../../../ui/button';
|
import { Button } from '../../../../../../shared/view/ui';
|
||||||
import type { CreatedApiKey } from '../types';
|
import type { CreatedApiKey } from '../types';
|
||||||
|
|
||||||
type NewApiKeyAlertProps = {
|
type NewApiKeyAlertProps = {
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { Check, GitBranch } from 'lucide-react';
|
import { Check, GitBranch } from 'lucide-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useGitSettings } from '../../../hooks/useGitSettings';
|
import { useGitSettings } from '../../../hooks/useGitSettings';
|
||||||
import { Button } from '../../../../ui/button';
|
import { Button, Input } from '../../../../../shared/view/ui';
|
||||||
import { Input } from '../../../../ui/input';
|
|
||||||
|
|
||||||
export default function GitSettingsTab() {
|
export default function GitSettingsTab() {
|
||||||
const { t } = useTranslation('settings');
|
const { t } = useTranslation('settings');
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ScrollArea } from '../../../ui/scroll-area';
|
import { ScrollArea } from '../../../../shared/view/ui';
|
||||||
import type { TFunction } from 'i18next';
|
import type { TFunction } from 'i18next';
|
||||||
import type { Project } from '../../../../types/app';
|
import type { Project } from '../../../../types/app';
|
||||||
import type { ReleaseInfo } from '../../../../types/sharedTypes';
|
import type { ReleaseInfo } from '../../../../types/sharedTypes';
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { FolderPlus, Plus, RefreshCw, Search, X, PanelLeftClose } from 'lucide-react';
|
import { FolderPlus, Plus, RefreshCw, Search, X, PanelLeftClose } from 'lucide-react';
|
||||||
import type { TFunction } from 'i18next';
|
import type { TFunction } from 'i18next';
|
||||||
import { Button } from '../../../ui/button';
|
import { Button, Input } from '../../../../shared/view/ui';
|
||||||
import { Input } from '../../../ui/input';
|
|
||||||
import { IS_PLATFORM } from '../../../../constants/config';
|
import { IS_PLATFORM } from '../../../../constants/config';
|
||||||
|
|
||||||
type SidebarHeaderProps = {
|
type SidebarHeaderProps = {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useMemo } from 'react';
|
|||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import { AlertTriangle, Trash2 } from 'lucide-react';
|
import { AlertTriangle, Trash2 } from 'lucide-react';
|
||||||
import type { TFunction } from 'i18next';
|
import type { TFunction } from 'i18next';
|
||||||
import { Button } from '../../../ui/button';
|
import { Button } from '../../../../shared/view/ui';
|
||||||
import ProjectCreationWizard from '../../../ProjectCreationWizard';
|
import ProjectCreationWizard from '../../../ProjectCreationWizard';
|
||||||
import Settings from '../../../settings/view/Settings';
|
import Settings from '../../../settings/view/Settings';
|
||||||
import VersionUpgradeModal from '../modals/VersionUpgradeModal';
|
import VersionUpgradeModal from '../modals/VersionUpgradeModal';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Button } from '../../../ui/button';
|
import { Button } from '../../../../shared/view/ui';
|
||||||
import { Check, ChevronDown, ChevronRight, Edit3, Folder, FolderOpen, Star, Trash2, X } from 'lucide-react';
|
import { Check, ChevronDown, ChevronRight, Edit3, Folder, FolderOpen, Star, Trash2, X } from 'lucide-react';
|
||||||
import type { TFunction } from 'i18next';
|
import type { TFunction } from 'i18next';
|
||||||
import { cn } from '../../../../lib/utils';
|
import { cn } from '../../../../lib/utils';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ChevronDown, Plus } from 'lucide-react';
|
import { ChevronDown, Plus } from 'lucide-react';
|
||||||
import type { TFunction } from 'i18next';
|
import type { TFunction } from 'i18next';
|
||||||
import { Button } from '../../../ui/button';
|
import { Button } from '../../../../shared/view/ui';
|
||||||
import type { Project, ProjectSession, SessionProvider } from '../../../../types/app';
|
import type { Project, ProjectSession, SessionProvider } from '../../../../types/app';
|
||||||
import type { SessionWithProvider, TouchHandlerFactory } from '../../types/types';
|
import type { SessionWithProvider, TouchHandlerFactory } from '../../types/types';
|
||||||
import SidebarSessionItem from './SidebarSessionItem';
|
import SidebarSessionItem from './SidebarSessionItem';
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Badge } from '../../../ui/badge';
|
import { Badge, Button } from '../../../../shared/view/ui';
|
||||||
import { Button } from '../../../ui/button';
|
|
||||||
import { Check, Clock, Edit2, Trash2, X } from 'lucide-react';
|
import { Check, Clock, Edit2, Trash2, X } from 'lucide-react';
|
||||||
import type { TFunction } from 'i18next';
|
import type { TFunction } from 'i18next';
|
||||||
import { cn } from '../../../../lib/utils';
|
import { cn } from '../../../../lib/utils';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { cva, type VariantProps } from 'class-variance-authority';
|
import { cva, type VariantProps } from 'class-variance-authority';
|
||||||
import { cn } from '../../lib/utils';
|
import { cn } from '../../../../lib/utils';
|
||||||
|
|
||||||
const badgeVariants = cva(
|
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-2 focus:ring-ring focus:ring-offset-2',
|
'inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
||||||
@@ -17,12 +17,10 @@ const badgeVariants = cva(
|
|||||||
defaultVariants: {
|
defaultVariants: {
|
||||||
variant: 'default',
|
variant: 'default',
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
export interface BadgeProps
|
type BadgeProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof badgeVariants>;
|
||||||
extends React.HTMLAttributes<HTMLDivElement>,
|
|
||||||
VariantProps<typeof badgeVariants> {}
|
|
||||||
|
|
||||||
function Badge({ className, variant, ...props }: BadgeProps) {
|
function Badge({ className, variant, ...props }: BadgeProps) {
|
||||||
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
||||||
1
src/shared/view/ui/badge/index.ts
Normal file
1
src/shared/view/ui/badge/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { Badge, badgeVariants } from './Badge';
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { cva, type VariantProps } from 'class-variance-authority';
|
import { cva, type VariantProps } from 'class-variance-authority';
|
||||||
import { cn } from '../../lib/utils';
|
import { cn } from '../../../../lib/utils';
|
||||||
|
|
||||||
|
// Keep visual variants centralized so all button usages stay consistent.
|
||||||
const buttonVariants = cva(
|
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-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
'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-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
||||||
{
|
{
|
||||||
@@ -27,24 +28,20 @@ const buttonVariants = cva(
|
|||||||
variant: 'default',
|
variant: 'default',
|
||||||
size: 'default',
|
size: 'default',
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
export interface ButtonProps
|
type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> &
|
||||||
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
VariantProps<typeof buttonVariants>;
|
||||||
VariantProps<typeof buttonVariants> {}
|
|
||||||
|
|
||||||
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||||
({ className, variant, size, ...props }, ref) => {
|
({ className, variant, size, ...props }, ref) => {
|
||||||
return (
|
return (
|
||||||
<button
|
<button className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />
|
||||||
className={cn(buttonVariants({ variant, size, className }))}
|
|
||||||
ref={ref}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
);
|
);
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
Button.displayName = 'Button';
|
Button.displayName = 'Button';
|
||||||
|
|
||||||
export { Button, buttonVariants };
|
export { Button, buttonVariants };
|
||||||
1
src/shared/view/ui/button/index.ts
Normal file
1
src/shared/view/ui/button/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { Button, buttonVariants } from './Button';
|
||||||
@@ -1,2 +1,6 @@
|
|||||||
|
export { Badge, badgeVariants } from './badge';
|
||||||
|
export { Button, buttonVariants } from './button';
|
||||||
export { DarkModeToggle } from './dark-mode-toggle';
|
export { DarkModeToggle } from './dark-mode-toggle';
|
||||||
|
export { Input } from './input';
|
||||||
|
export { ScrollArea } from './scroll-area';
|
||||||
export { Tooltip } from './tooltip';
|
export { Tooltip } from './tooltip';
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { cn } from '../../lib/utils';
|
import { cn } from '../../../../lib/utils';
|
||||||
|
|
||||||
export interface InputProps
|
type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
|
||||||
extends React.InputHTMLAttributes<HTMLInputElement> {}
|
|
||||||
|
|
||||||
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||||
({ className, type, ...props }, ref) => {
|
({ className, type, ...props }, ref) => {
|
||||||
@@ -11,14 +10,15 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|||||||
type={type}
|
type={type}
|
||||||
className={cn(
|
className={cn(
|
||||||
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
|
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
|
||||||
className,
|
className
|
||||||
)}
|
)}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
Input.displayName = 'Input';
|
Input.displayName = 'Input';
|
||||||
|
|
||||||
export { Input };
|
export { Input };
|
||||||
1
src/shared/view/ui/input/index.ts
Normal file
1
src/shared/view/ui/input/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { Input } from './Input';
|
||||||
@@ -1,14 +1,12 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { cn } from '../../lib/utils';
|
import { cn } from '../../../../lib/utils';
|
||||||
|
|
||||||
export interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {}
|
type ScrollAreaProps = React.HTMLAttributes<HTMLDivElement>;
|
||||||
|
|
||||||
const ScrollArea = React.forwardRef<HTMLDivElement, ScrollAreaProps>(
|
const ScrollArea = React.forwardRef<HTMLDivElement, ScrollAreaProps>(
|
||||||
({ className, children, ...props }, ref) => (
|
({ className, children, ...props }, ref) => (
|
||||||
<div
|
<div className={cn(className, 'relative overflow-hidden')} {...props}>
|
||||||
className={cn(className, 'relative overflow-hidden')}
|
{/* Inner container keeps border radius while allowing momentum scrolling on touch devices. */}
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className="h-full w-full rounded-[inherit] overflow-auto"
|
className="h-full w-full rounded-[inherit] overflow-auto"
|
||||||
@@ -20,8 +18,9 @@ const ScrollArea = React.forwardRef<HTMLDivElement, ScrollAreaProps>(
|
|||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
ScrollArea.displayName = 'ScrollArea';
|
ScrollArea.displayName = 'ScrollArea';
|
||||||
|
|
||||||
export { ScrollArea };
|
export { ScrollArea };
|
||||||
1
src/shared/view/ui/scroll-area/index.ts
Normal file
1
src/shared/view/ui/scroll-area/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { ScrollArea } from './ScrollArea';
|
||||||
Reference in New Issue
Block a user