diff --git a/CHANGELOG.md b/CHANGELOG.md index 2295ee8..78fb0a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## [2.38.1] - 2025-10-15 + +### 🚀 Enhancements + +- _(sidebar)_ Add conversation search functionality (#223) + +### 🎨 Styling + +- _(chat)_ Update styling for main content and chat input (#224) + +### 🚜 Refactor + +- _(Input)_ Replace native input with custom Input component (#222) +- _(icon)_ Migrate to direct icon component usage (#225) + ## [2.38.0] - 2025-10-12 ### 🚀 Enhancements diff --git a/package-lock.json b/package-lock.json index ab7e52e..192b0ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "llama.ui", - "version": "2.38.0", + "version": "2.38.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "llama.ui", - "version": "2.38.0", + "version": "2.38.1", "license": "MIT", "dependencies": { "@radix-ui/react-collapsible": "^1.1.12", diff --git a/package.json b/package.json index f43189d..b5ffb68 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "name": "llama.ui", "description": "A minimal Interface for AI Companion that runs entirely in your browser.", - "version": "2.38.0", + "version": "2.38.1", "homepage": "https://llama-ui.js.org/", "license": "MIT", "type": "module", diff --git a/src/App.tsx b/src/App.tsx index 324aaa3..043a9d6 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -55,7 +55,7 @@ const AppLayout: FC = () => {
diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 8b9f0ba..462efcf 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -2,7 +2,7 @@ import { cva, VariantProps } from 'class-variance-authority'; import * as React from 'react'; import { cn } from '../utils'; -const variants = cva('btn', { +const ButtonVariants = cva('btn', { variants: { variant: { default: '', @@ -15,8 +15,9 @@ const variants = cva('btn', { default: '', small: 'btn-sm', icon: 'w-8 h-8 p-0', - 'icon-rounded': 'w-8 h-8 p-0 rounded-full', - 'icon-small': 'btn-sm w-4 h-4 p-0 rounded-full', + 'icon-sm': 'btn-sm w-4 h-4 p-0 rounded-full', + 'icon-md': 'btn-sm w-5 h-5 p-0 rounded-full', + 'icon-xl': 'w-8 h-8 p-0 rounded-full', }, }, defaultVariants: { @@ -26,13 +27,13 @@ const variants = cva('btn', { }); export type ButtonProps = React.ButtonHTMLAttributes & - VariantProps; + VariantProps; const Button = React.forwardRef( ({ className, variant, size, ...props }, ref) => ( @@ -122,14 +127,16 @@ export default function Header() {
diff --git a/src/components/Icon.tsx b/src/components/Icon.tsx index f769569..083d22e 100644 --- a/src/components/Icon.tsx +++ b/src/components/Icon.tsx @@ -1,11 +1,8 @@ import { cva, VariantProps } from 'class-variance-authority'; import * as React from 'react'; import { IconBaseProps } from 'react-icons'; -import * as LucideIcons from 'react-icons/lu'; import { cn } from '../utils'; -type IconNames = keyof Omit; - const iconVariants = cva('', { variants: { library: { @@ -26,6 +23,7 @@ const iconVariants = cva('', { }, defaultVariants: { library: 'lucide', + size: 'sm', }, }); @@ -33,36 +31,28 @@ type IconProps = Omit & VariantProps & React.SVGAttributes & { className?: string; - icon: IconNames; + children: React.ReactElement; }; const Icon = React.forwardRef( - ({ className, library = 'lucide', variant, size, icon, ...props }, ref) => { - let SelectedIcon: React.ElementType; - - switch (library) { - case 'lucide': - SelectedIcon = LucideIcons[icon]; - break; - default: - throw new Error(`Library "${library}" not found in icons`); + ({ className, variant, size, children, ...props }, ref) => { + if (!children) { + throw new Error('Icon component requires a child icon element'); } - if (!SelectedIcon) { - throw new Error(`Icon "${icon}" not found in Lucide icons`); - } + const iconElement = React.cloneElement(children, { + className: cn( + iconVariants({ variant, size, className }), + children.props.className + ), + ref, + ...props, + }); - return ( - - ); + return iconElement; } ); Icon.displayName = 'Icon'; -export default Icon; export { Icon }; diff --git a/src/components/Label.tsx b/src/components/Label.tsx index 06a205b..012222d 100644 --- a/src/components/Label.tsx +++ b/src/components/Label.tsx @@ -2,7 +2,7 @@ import { cva, VariantProps } from 'class-variance-authority'; import * as React from 'react'; import { cn } from '../utils'; -const variants = cva('', { +const LabelVariants = cva('', { variants: { variant: { default: '', @@ -10,15 +10,15 @@ const variants = cva('', { 'fake-btn': 'text-center cursor-pointer', btn: 'btn', 'btn-ghost': 'btn btn-ghost', - 'form-control': 'form-control flex flex-col justify-center mb-3', + 'form-control': 'form-control flex flex-col justify-center', 'input-bordered': - 'input input-bordered join-item grow flex items-center gap-2 mb-1', + 'input input-bordered join-item grow flex items-center gap-2 focus-within:outline-1 focus-within:outline-offset-0 inset-shadow-xs', }, size: { default: '', xs: 'text-xs', icon: 'w-8 h-8 p-0', - 'icon-rounded': 'w-8 h-8 p-0 rounded-full', + 'icon-xl': 'w-8 h-8 p-0 rounded-full', }, }, defaultVariants: { @@ -28,12 +28,12 @@ const variants = cva('', { }); export type LabelProps = React.LabelHTMLAttributes & - VariantProps; + VariantProps; const Label = React.forwardRef( ({ className, variant, size, ...props }, ref) => (