chore: update package version to 0.1.5 and adjust peer dependencies

- Bump version in package.json from 0.1.4 to 0.1.5.
- Update peer dependency for @tanstack/react-query to allow version 5.0.0.
- Add @tanstack/react-table and @tanstack/react-virtual as dependencies.
- Update various dependencies to their latest compatible versions.
- Simplify postcss.config.js by removing unnecessary options.
- Clean up rollup.config.js by removing ignored PostCSS warnings.
- Update CheckboxButton component to cast icon as React JSX element.
- Adjust Combobox component's class names for better styling.
- Change DropdownPopup component to use React's namespace import.
- Modify InputOTP component to use 'any' type for OTPInputContext.
- Ensure displayLabel and value in ModelParameters are converted to strings.
- Update MultiSearch component's placeholder to ensure it's a string.
- Cast selectIcon in MultiSelect as React JSX element for consistency.
- Update OGDialogTemplate to cast selectText as React JSX element.
- Initialize animationRef in PixelCard with undefined for clarity.
- Add TypeScript ignore comments in Select and SelectDropDown components for Radix UI type conflicts.
- Ensure title in SelectDropDown is a string and adjust rendering of options.
- Update useLocalize hook to cast options as any for compatibility.
This commit is contained in:
Marco Beretta 2025-07-23 16:28:55 +02:00
parent 59412c2b36
commit de69bcdd64
No known key found for this signature in database
GPG key ID: D918033D8E74CC11
15 changed files with 10122 additions and 14220 deletions

24226
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "@librechat/client",
"version": "0.1.4",
"version": "0.1.5",
"description": "React components for LibreChat",
"main": "dist/index.js",
"module": "dist/index.es.js",
@ -22,14 +22,14 @@
"dev": "rollup -c -w --bundleConfigAsCjs"
},
"peerDependencies": {
"@tanstack/react-query": "^4.28.0 || ^5.69.0",
"@tanstack/react-query": "^4.28.0 || ^5.0.0",
"i18next": "^24.2.2 || ^25.3.2",
"jotai": "^2.12.5",
"react": "^18.2.0 || ^19.1.0",
"react-dom": "^18.2.0 || ^19.1.0",
"react-i18next": "^15.4.0 || ^15.6.0"
},
"dependencies": {
"react-i18next": "^15.4.0 || ^15.6.0",
"@tanstack/react-table": "^8.11.7",
"@tanstack/react-virtual": "^3.0.0",
"@ariakit/react": "^0.4.16",
"@ariakit/react-core": "^0.4.17",
"@headlessui/react": "^2.1.2",
@ -51,10 +51,10 @@
"@radix-ui/react-switch": "^1.2.5",
"@radix-ui/react-tabs": "^1.0.3",
"@radix-ui/react-toast": "^1.1.5",
"@radix-ui/react-tooltip": "^1.2.7",
"@radix-ui/react-tooltip": "^1.2.7"
},
"dependencies": {
"@react-spring/web": "^10.0.1",
"@tanstack/react-table": "^8.11.7",
"@tanstack/react-virtual": "^3.0.0",
"class-variance-authority": "^0.6.0",
"clsx": "^1.2.1",
"framer-motion": "^12.23.6",
@ -75,19 +75,19 @@
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-terser": "^0.4.4",
"@tailwindcss/typography": "^0.5.10",
"@tanstack/react-query": "^5.69.0",
"@testing-library/react": "^16.3.0",
"@types/react": "^19.0.12",
"@types/react-dom": "^19.0.4",
"@tanstack/react-query": "^4.28.0",
"@testing-library/react": "^14.0.0",
"@types/react": "^18.2.11",
"@types/react-dom": "^18.2.4",
"autoprefixer": "^10.4.20",
"i18next": "^25.3.2",
"i18next": "^24.2.3",
"jotai": "^2.12.5",
"postcss": "^8.4.31",
"postcss-import": "^15.1.0",
"postcss-preset-env": "^8.5.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-i18next": "^15.4.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^15.4.0",
"rimraf": "^5.0.1",
"rollup": "^4.0.0",
"rollup-plugin-peer-deps-external": "^2.2.4",

View file

@ -1,18 +1,7 @@
module.exports = {
plugins: [
require('postcss-import'),
require('postcss-preset-env')({
stage: 1,
features: {
'nesting-rules': true,
'custom-media-queries': true,
'custom-properties': true,
'is-pseudo-class': false,
},
autoprefixer: {
flexbox: 'no-2009',
},
}),
require('postcss-preset-env'),
require('tailwindcss'),
require('autoprefixer'),
],

View file

@ -79,14 +79,6 @@ export default {
if (warning.code === 'MODULE_LEVEL_DIRECTIVE') {
return;
}
// Ignore PostCSS warnings about complex selectors
if (
warning.plugin === 'postcss' &&
warning.message &&
warning.message.includes('can not be transformed to an equivalent selector')
) {
return;
}
warn(warning);
},
};

View file

@ -63,7 +63,7 @@ const CheckboxButton = React.forwardRef<
render={<button type="button" aria-label={label} />}
>
{/* Icon if provided */}
{icon && <span className="icon-md text-text-primary">{icon}</span>}
{icon && <span className="icon-md text-text-primary">{icon as React.JSX.Element}</span>}
{/* Show the label on larger screens */}
<span className="hidden truncate md:block">{label}</span>

View file

@ -110,7 +110,7 @@ export default function ComboboxComponent({
)}
>
<RadixSelect.Viewport className="mb-5 h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]">
<div className="group sticky left-0 top-0 z-10 flex h-12 items-center gap-2 bg-white px-2 px-3 py-2 text-black duration-300 dark:bg-gray-700 dark:text-white">
<div className="group sticky left-0 top-0 z-10 flex h-12 items-center gap-2 bg-white px-3 py-2 text-black duration-300 dark:bg-gray-700 dark:text-white">
<SearchIcon className="h-4 w-4 text-gray-500 transition-colors duration-300 dark:group-focus-within:text-gray-300 dark:group-hover:text-gray-300" />
<Combobox
autoSelect

View file

@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import * as Ariakit from '@ariakit/react';
import type * as t from '~/common';
import { cn } from '~/utils';
@ -42,14 +42,14 @@ const DropdownPopup: React.FC<DropdownProps> = ({
if (mountByState) {
return (
<Ariakit.MenuProvider store={menu}>
{trigger}
{trigger as React.JSX.Element}
{isOpen && <Menu {...props} />}
</Ariakit.MenuProvider>
);
}
return (
<Ariakit.MenuProvider store={menu}>
{trigger}
{trigger as React.JSX.Element}
<Menu {...props} />
</Ariakit.MenuProvider>
);
@ -98,7 +98,6 @@ const Menu: React.FC<MenuProps> = ({
itemClassName,
)}
disabled={item.disabled}
render={item.render}
ref={item.ref}
hideOnClick={item.hideOnClick}
onClick={(event) => {

View file

@ -32,6 +32,11 @@ const InputOTPSlot = React.forwardRef<
React.ComponentPropsWithoutRef<'div'> & { index: number }
>(({ index, className, ...props }, ref) => {
const inputOTPContext = React.useContext(OTPInputContext);
if (!inputOTPContext) {
throw new Error('InputOTPSlot must be used within an OTPInput');
}
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
return (

View file

@ -99,7 +99,7 @@ const ModelParameters: React.FC<ModelParametersProps> = ({
htmlFor={id}
className={`text-sm font-medium ${disabled ? 'text-gray-400 dark:text-gray-400' : ''}`}
>
{displayLabel}
{String(displayLabel)}
</label>
<div className="flex items-center gap-2">
<output
@ -109,7 +109,7 @@ const ModelParameters: React.FC<ModelParametersProps> = ({
}`}
aria-live="polite"
>
{value.toFixed(decimalPlaces).replace('-0.00', '0.00')}
{String(value.toFixed(decimalPlaces).replace('-0.00', '0.00'))}
</output>
{showButtons && (
<div className="flex items-center gap-1">

View file

@ -46,7 +46,7 @@ export default function MultiSearch({
type="text"
value={value ?? ''}
onChange={onChangeHandler}
placeholder={placeholder ?? localize('com_ui_select_search_model')}
placeholder={String(placeholder ?? localize('com_ui_select_search_model'))}
aria-label="Search Model"
className="flex-1 rounded-md border-none bg-transparent px-2.5 py-2 text-sm placeholder-text-secondary focus:outline-none focus:ring-1 focus:ring-ring-primary"
/>

View file

@ -87,7 +87,7 @@ export default function MultiSelect<T extends string>({
)}
onChange={(e) => e.stopPropagation()}
>
{selectIcon && selectIcon}
{selectIcon && <span>{selectIcon as React.JSX.Element}</span>}
<span className="mr-auto hidden truncate md:block">
{renderSelectedValues(selectedValues, placeholder)}
</span>
@ -130,8 +130,12 @@ export default function MultiSelect<T extends string>({
)}
>
{renderItemContent
? renderItemContent(value, defaultContent, isCurrentItemSelected)
: defaultContent}
? (renderItemContent(
value,
defaultContent,
isCurrentItemSelected,
) as React.JSX.Element)
: (defaultContent as React.JSX.Element)}
</SelectItem>
);
})}

View file

@ -97,7 +97,11 @@ const OGDialogTemplate = forwardRef((props: DialogTemplateProps, ref: Ref<HTMLDi
selectClasses ?? defaultSelect
} flex h-10 items-center justify-center rounded-lg border-none px-4 py-2 text-sm disabled:opacity-80 max-sm:order-first max-sm:w-full sm:order-none`}
>
{isLoading === true ? <Spinner className="size-4 text-white" /> : selectText}
{isLoading === true ? (
<Spinner className="size-4 text-white" />
) : (
(selectText as React.JSX.Element)
)}
</OGDialogClose>
) : null}
</div>

View file

@ -173,7 +173,7 @@ export default function PixelCard({
const containerRef = useRef<HTMLDivElement>(null);
const canvasRef = useRef<HTMLCanvasElement>(null);
const pixelsRef = useRef<Pixel[]>([]);
const animationRef = useRef<number>();
const animationRef = useRef<number | undefined>(undefined);
const timePrevRef = useRef(performance.now());
const progressRef = useRef<number | undefined>(progress);
const reducedMotion = useRef(
@ -221,9 +221,11 @@ export default function PixelCard({
let idle = true;
for (const p of pixelsRef.current) {
if (method === 'appearWithProgress') {
progressRef.current !== undefined
? p.appearWithProgress(progressRef.current)
: (p.isIdle = true);
if (progressRef.current !== undefined) {
p.appearWithProgress(progressRef.current);
} else {
p.isIdle = true;
}
} else {
// @ts-ignore dynamic dispatch
p[method]();
@ -312,7 +314,9 @@ export default function PixelCard({
useEffect(() => {
initPixels();
const obs = new ResizeObserver(initPixels);
containerRef.current && obs.observe(containerRef.current);
if (containerRef.current) {
obs.observe(containerRef.current);
}
return () => {
obs.disconnect();
cancelAnimationFrame(animationRef.current!);

View file

@ -4,12 +4,15 @@ import { CaretSortIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon } from '@radix
import { cn } from '~/utils';
// @ts-ignore - Radix UI type conflicts with React types
const Select = SelectPrimitive.Root;
// @ts-ignore - Radix UI type conflicts with React types
const SelectGroup = SelectPrimitive.Group;
const SelectValue = SelectPrimitive.Value;
// @ts-ignore - Radix UI type conflicts with React types
const SelectTrigger = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>

View file

@ -85,7 +85,7 @@ function SelectDropDown({
if (emptyTitle) {
title = '';
} else if (!(title ?? '')) {
title = localize('com_ui_model');
title = String(localize('com_ui_model'));
}
const values = availableValues ?? [];
@ -186,7 +186,7 @@ function SelectDropDown({
</ListboxButton>
<Transition
show={open}
as={React.Fragment}
as="div"
leave="transition ease-in duration-100"
leaveFrom="opacity-100"
leaveTo="opacity-0"
@ -207,10 +207,10 @@ function SelectDropDown({
optionsClass ?? '',
)}
>
{renderOption()}
{renderOption() as React.JSX.Element}
</ListboxOption>
)}
{searchRender}
{searchRender as React.JSX.Element}
{options.map((option: string | Option, i: number) => {
if (!option) {
return null;