Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🌐 fix: Scrollable Language Dropdown in Shared Chat Settings (#14954)

Marco Beretta7480e9318112
diff --git a/client/src/components/Nav/SettingsTabs/General/LangSelector.spec.tsx b/client/src/components/Appearance/LangSelector.spec.tsx
similarity index 100%
rename from client/src/components/Nav/SettingsTabs/General/LangSelector.spec.tsx
rename to client/src/components/Appearance/LangSelector.spec.tsx
diff --git a/client/src/components/Nav/SettingsTabs/General/Selectors.tsx b/client/src/components/Appearance/Selectors.tsx
similarity index 93%
rename from client/src/components/Nav/SettingsTabs/General/Selectors.tsx
rename to client/src/components/Appearance/Selectors.tsx
index 25f9d066c7..2814c9daba 100644
--- a/client/src/components/Nav/SettingsTabs/General/Selectors.tsx
+++ b/client/src/components/Appearance/Selectors.tsx
@@ -4,15 +4,19 @@ import { useLocalize } from '~/hooks';
import { cn } from '~/utils';
import store from '~/store';
+type PortalElement = ((element: HTMLElement) => HTMLElement | null) | HTMLElement | null;
+
export const ThemeSelector = ({
theme,
onChange,
portal = true,
+ portalElement,
popoverClassName,
}: {
theme: string;
onChange: (value: string) => void;
portal?: boolean;
+ portalElement?: PortalElement;
popoverClassName?: string;
}) => {
const localize = useLocalize();
@@ -37,6 +41,7 @@ export const ThemeSelector = ({
testId="theme-selector"
aria-labelledby={labelId}
portal={portal}
+ portalElement={portalElement}
/>
</div>
);
@@ -46,11 +51,13 @@ export const LangSelector = ({
langcode,
onChange,
portal = true,
+ portalElement,
popoverClassName,
}: {
langcode: string;
onChange: (value: string) => void;
portal?: boolean;
+ portalElement?: PortalElement;
popoverClassName?: string;
}) => {
const localize = useLocalize();
@@ -120,13 +127,11 @@ export const LangSelector = ({
<Dropdown
value={langcode}
onChange={onChange}
- sizeClasses={cn(
- 'z-50 [--anchor-max-height:256px] max-h-[60vh] w-[220px]',
- popoverClassName,
- )}
+ sizeClasses={cn('z-50 w-[220px]', popoverClassName)}
options={languageOptions}
aria-labelledby={labelId}
portal={portal}
+ portalElement={portalElement}
searchable
searchPlaceholder={localize('com_ui_search_language')}
searchEmptyText={localize('com_ui_no_results_found')}
diff --git a/client/src/components/Nav/SettingsTabs/General/ThemeSelector.spec.tsx b/client/src/components/Appearance/ThemeSelector.spec.tsx
similarity index 100%
rename from client/src/components/Nav/SettingsTabs/General/ThemeSelector.spec.tsx
rename to client/src/components/Appearance/ThemeSelector.spec.tsx
diff --git a/client/src/components/Appearance/index.ts b/client/src/components/Appearance/index.ts
new file mode 100644
index 0000000000..22bd02e23e
--- /dev/null
+++ b/client/src/components/Appearance/index.ts
@@ -0,0 +1 @@
+export { ThemeSelector, LangSelector } from './Selectors';
diff --git a/client/src/components/Audio/Voices.tsx b/client/src/components/Audio/Voices.tsx
index 5d1d843b58..a7246b42f8 100644
--- a/client/src/components/Audio/Voices.tsx
+++ b/client/src/components/Audio/Voices.tsx
@@ -29,7 +29,7 @@ export function BrowserVoiceDropdown({ disabled = false }: { disabled?: boolean
value={voice ?? ''}
options={voices}
onChange={handleVoiceChange}
- sizeClasses="min-w-[200px] !max-w-[400px] [--anchor-max-width:400px]"
+ sizeClasses="z-50 min-w-[200px] max-w-[400px]"
testId="BrowserVoiceDropdown"
className="z-50"
aria-labelledby={labelId}
@@ -62,7 +62,7 @@ export function ExternalVoiceDropdown({ disabled = false }: { disabled?: boolean
value={voice ?? ''}
options={voices}
onChange={handleVoiceChange}
- sizeClasses="min-w-[200px] !max-w-[400px] [--anchor-max-width:400px]"
+ sizeClasses="z-50 min-w-[200px] max-w-[400px]"
testId="ExternalVoiceDropdown"
className="z-50"
aria-labelledby={labelId}
diff --git a/client/src/components/Nav/ExportConversation/ExportModal.tsx b/client/src/components/Nav/ExportConversation/ExportModal.tsx
index 5cdc502833..f74d25c14f 100644
--- a/client/src/components/Nav/ExportConversation/ExportModal.tsx
+++ b/client/src/components/Nav/ExportConversation/ExportModal.tsx
@@ -107,6 +107,7 @@ export default function ExportModal({
value={type}
onChange={handleTypeChange}
options={TYPE_OPTIONS}
+ sizeClasses="z-50"
className="z-50"
portal={false}
/>
diff --git a/client/src/components/Nav/Settings/controls.tsx b/client/src/components/Nav/Settings/controls.tsx
index 55d0d38412..22d9ef4cfd 100644
--- a/client/src/components/Nav/Settings/controls.tsx
+++ b/client/src/components/Nav/Settings/controls.tsx
@@ -4,7 +4,7 @@ import { useRecoilState } from 'recoil';
import { ThemeContext } from '@librechat/client';
import type { ComponentType } from 'react';
import type { TranslationKeys } from '~/hooks';
-import { ThemeSelector, LangSelector } from '../SettingsTabs/General/Selectors';
+import { ThemeSelector, LangSelector } from '~/components/Appearance';
import ToggleSwitch from '../SettingsTabs/ToggleSwitch';
import store from '~/store';
diff --git a/client/src/components/Nav/SettingsTabs/Chat/FontSizeSelector.tsx b/client/src/components/Nav/SettingsTabs/Chat/FontSizeSelector.tsx
index 66b3f832ab..3cdbf776ce 100644
--- a/client/src/components/Nav/SettingsTabs/Chat/FontSizeSelector.tsx
+++ b/client/src/components/Nav/SettingsTabs/Chat/FontSizeSelector.tsx
@@ -29,7 +29,7 @@ export default function FontSizeSelector() {
options={options}
onChange={handleChange}
testId="font-size-selector"
- sizeClasses="w-[150px]"
+ sizeClasses="z-50 w-[150px]"
className="z-50"
aria-labelledby={labelId}
/>
diff --git a/client/src/components/Nav/SettingsTabs/Chat/ForkSettings.tsx b/client/src/components/Nav/SettingsTabs/Chat/ForkSettings.tsx
index e1145fc3ca..83c995a732 100644
--- a/client/src/components/Nav/SettingsTabs/Chat/ForkSettings.tsx
+++ b/client/src/components/Nav/SettingsTabs/Chat/ForkSettings.tsx
@@ -45,7 +45,7 @@ export const ForkSettings = () => {
value={forkSetting}
onChange={setForkSetting}
options={forkOptions}
- sizeClasses="w-[200px]"
+ sizeClasses="z-[50] w-[200px]"
testId="fork-setting-dropdown"
className="z-[50]"
aria-labelledby="fork-change-default-label"
diff --git a/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsx b/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsx
index eca0a29619..fa6b728a02 100644
--- a/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsx
+++ b/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsx
@@ -450,6 +450,7 @@ export default function LangfuseConnection() {
options={destinationOptions}
disabled={destinations.length === 0 || busy}
className="w-full"
+ triggerClassName="w-full"
sizeClasses="z-50 w-[var(--popover-anchor-width)]"
testId="langfuse-destination"
aria-labelledby="langfuse-destination-label"
diff --git a/client/src/components/Nav/SettingsTabs/Speech/STT/EngineSTTDropdown.tsx b/client/src/components/Nav/SettingsTabs/Speech/STT/EngineSTTDropdown.tsx
index e1602f4fd9..2fac3e82ca 100644
--- a/client/src/components/Nav/SettingsTabs/Speech/STT/EngineSTTDropdown.tsx
+++ b/client/src/components/Nav/SettingsTabs/Speech/STT/EngineSTTDropdown.tsx
@@ -33,7 +33,7 @@ const EngineSTTDropdown: React.FC<EngineSTTDropdownProps> = ({ external }) => {
value={engineSTT}
onChange={handleSelect}
options={endpointOptions}
- sizeClasses="w-[180px]"
+ sizeClasses="z-50 w-[180px]"
testId="EngineSTTDropdown"
className="z-50"
aria-labelledby={labelId}
diff --git a/client/src/components/Nav/SettingsTabs/Speech/STT/LanguageSTTDropdown.tsx b/client/src/components/Nav/SettingsTabs/Speech/STT/LanguageSTTDropdown.tsx
index 617a6a275f..45d4ff1b2a 100644
--- a/client/src/components/Nav/SettingsTabs/Speech/STT/LanguageSTTDropdown.tsx
+++ b/client/src/components/Nav/SettingsTabs/Speech/STT/LanguageSTTDropdown.tsx
@@ -104,8 +104,8 @@ export default function LanguageSTTDropdown() {
value={languageSTT}
onChange={handleSelect}
options={languageOptions}
- sizeClasses="[--anchor-max-height:256px]"
testId="LanguageSTTDropdown"
+ sizeClasses="z-50"
className="z-50"
aria-labelledby={labelId}
disabled={!speechToText}
diff --git a/client/src/components/Nav/SettingsTabs/Speech/TTS/EngineTTSDropdown.tsx b/client/src/components/Nav/SettingsTabs/Speech/TTS/EngineTTSDropdown.tsx
index 466a972a73..8a9f478b75 100644
--- a/client/src/components/Nav/SettingsTabs/Speech/TTS/EngineTTSDropdown.tsx
+++ b/client/src/components/Nav/SettingsTabs/Speech/TTS/EngineTTSDropdown.tsx
@@ -33,7 +33,7 @@ const EngineTTSDropdown: React.FC<EngineTTSDropdownProps> = ({ external }) => {
value={engineTTS}
onChange={handleSelect}
options={endpointOptions}
- sizeClasses="w-[180px]"
+ sizeClasses="z-50 w-[180px]"
testId="EngineTTSDropdown"
className="z-50"
aria-labelledby={labelId}
diff --git a/client/src/components/Nav/SettingsTabs/index.ts b/client/src/components/Nav/SettingsTabs/index.ts
index a220a2496c..e94def7d5d 100644
--- a/client/src/components/Nav/SettingsTabs/index.ts
+++ b/client/src/components/Nav/SettingsTabs/index.ts
@@ -1,2 +1 @@
export { default as About } from './About/About';
-export { ThemeSelector, LangSelector } from './General/Selectors';
diff --git a/client/src/components/Prompts/sidebar/FilterPrompts.tsx b/client/src/components/Prompts/sidebar/FilterPrompts.tsx
index 36078cd2e8..ca61562cc2 100644
--- a/client/src/components/Prompts/sidebar/FilterPrompts.tsx
+++ b/client/src/components/Prompts/sidebar/FilterPrompts.tsx
@@ -106,7 +106,8 @@ export default function FilterPrompts({
value={categoryFilter || SystemCategories.ALL}
onChange={onSelect}
options={filterOptions}
- className={cn('shrink-0 rounded-lg bg-transparent [&>button]:size-9', dropdownClassName)}
+ className={cn('shrink-0 [&>button]:size-9', dropdownClassName)}
+ triggerClassName="rounded-lg bg-transparent"
icon={<ListFilter className="h-4 w-4" />}
label="Filter: "
ariaLabel={localize('com_ui_filter_prompts')}
diff --git a/client/src/components/Share/ShareView.tsx b/client/src/components/Share/ShareView.tsx
index 59c84a798c..4d5f0c2a6a 100644
--- a/client/src/components/Share/ShareView.tsx
+++ b/client/src/components/Share/ShareView.tsx
@@ -16,10 +16,11 @@ import {
OGDialogHeader,
OGDialogContent,
OGDialogTrigger,
+ TooltipAnchor,
useToastContext,
} from '@librechat/client';
-import { ThemeSelector, LangSelector } from '~/components/Nav/SettingsTabs/General/Selectors';
import { cn, DEFAULT_APP_TITLE, getResponseStatus, selectActiveBranchTail } from '~/utils';
+import { ThemeSelector, LangSelector } from '~/components/Appearance';
import { ShareMessagesProvider } from './ShareMessagesProvider';
import { useForkSharedConvoMutation } from '~/data-provider';
import { useGetSharedStartupConfig } from '~/data-provider';
@@ -206,7 +207,7 @@ function SharedView() {
<div className="pointer-events-none absolute inset-x-0 bottom-0 z-10 bg-gradient-to-t from-surface-secondary from-40% to-transparent">
<Footer
startupConfig={config ?? null}
- className="pointer-events-auto relative mx-auto flex max-w-[55rem] flex-wrap items-center justify-center gap-2 px-3 pb-4 pt-6 text-center text-xs text-text-secondary"
+ className="pointer-events-auto relative mx-auto flex max-w-7xl flex-wrap items-center justify-center gap-2 px-3 pb-4 pt-6 text-center text-xs text-text-secondary"
/>
</div>
);
@@ -242,6 +243,29 @@ function SharedView() {
);
}
+function ShareTitle({ title }: { title?: string }) {
+ if (title == null || title === '') {
+ return null;
+ }
+
+ return (
+ <TooltipAnchor
+ description={title}
+ side="bottom"
+ tabIndex={0}
+ className="block min-w-0 max-w-full cursor-default"
+ render={
+ <h1
+ data-testid="share-title"
+ className="cursor-default truncate text-2xl font-semibold text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-text-primary md:text-4xl"
+ >
+ {title}
+ </h1>
+ }
+ />
+ );
+}
+
interface ShareHeaderProps {
title?: string;
formattedDate: string | null;
@@ -268,6 +292,7 @@ function ShareHeader({
onLangChange,
}: ShareHeaderProps) {
const [settingsOpen, setSettingsOpen] = useState(false);
+ const [settingsContent, setSettingsContent] = useState<HTMLDivElement | null>(null);
const isMobile = useMediaQuery('(max-width: 767px)');
const handleDialogOutside = useCallback((event: Event) => {
@@ -279,12 +304,10 @@ function ShareHeader({
return (
<section className="mx-auto w-full px-2 pb-3 pt-4 md:px-5 md:pb-4 md:pt-6">
- <div className="relative mx-auto flex w-full max-w-[60rem] flex-col gap-3 rounded-2xl border border-border-light bg-surface-primary/80 px-4 py-4 shadow-xl backdrop-blur md:gap-4 md:rounded-3xl md:px-6 md:py-5">
- <div className="flex flex-col gap-3 md:flex-row md:items-end md:justify-between">
- <div className="min-w-0 space-y-1.5 md:space-y-2">
- <h1 className="line-clamp-2 break-words text-2xl font-semibold text-text-primary md:text-4xl">
- {title}
- </h1>
+ <div className="relative mx-auto flex w-full max-w-7xl flex-col gap-3 rounded-2xl border border-border-light bg-surface-secondary px-4 py-4 shadow-xl md:gap-4 md:rounded-3xl md:px-6 md:py-5">
+ <div className="flex flex-col gap-3 md:flex-row md:items-start md:justify-between">
+ <div className="min-w-0 flex-1 space-y-1.5 md:space-y-2">
+ <ShareTitle title={title} />
{formattedDate && (
<div className="flex items-center gap-2 text-sm text-text-secondary">
<CalendarDays className="size-4" aria-hidden="true" />
@@ -327,7 +350,8 @@ function ShareHeader({
</Button>
</OGDialogTrigger>
<OGDialogContent
- className="w-11/12 max-w-lg"
+ ref={setSettingsContent}
+ className="w-11/12 max-w-lg overflow-y-visible"
showCloseButton={true}
onPointerDownOutside={handleDialogOutside}
onInteractOutside={handleDialogOutside}
@@ -335,16 +359,18 @@ function ShareHeader({
<OGDialogHeader className="text-left">
<OGDialogTitle>{settingsLabel}</OGDialogTitle>
</OGDialogHeader>
- <div className="flex flex-col gap-4 pt-2 text-sm">
+ <div className="flex max-h-[70vh] flex-col gap-4 overflow-y-auto pt-2 text-sm">
<ThemeSelector
theme={theme}
onChange={onThemeChange}
+ portalElement={settingsContent}
popoverClassName="z-[150]"
/>
<Separator orientation="horizontal" className="bg-border-medium/60" />
<LangSelector
langcode={langcode}
onChange={onLangChange}
+ portalElement={settingsContent}
popoverClassName="z-[150]"
/>
</div>
diff --git a/client/src/components/SidePanel/Memories/MemoryPanel.tsx b/client/src/components/SidePanel/Memories/MemoryPanel.tsx
index 46443a9d00..600a31de9a 100644
--- a/client/src/components/SidePanel/Memories/MemoryPanel.tsx
+++ b/client/src/components/SidePanel/Memories/MemoryPanel.tsx
@@ -193,6 +193,7 @@ export default function MemoryPanel() {
onChange={setPartitionFilter}
options={partitionOptions}
className="w-full"
+ triggerClassName="w-full"
ariaLabel={localize('com_ui_memories_partition_filter')}
testId="memory-partition-filter"
/>
diff --git a/client/src/locales/README.md b/client/src/locales/README.md
index d387a55a8c..61c085b552 100644
--- a/client/src/locales/README.md
+++ b/client/src/locales/README.md
@@ -8,24 +8,26 @@ To add a new language to LibreChat, follow these steps:
### 1. Add the Language to Locize Project
-- Navigate to the [LibreChat locize project](https://www.locize.app/cat/62uyy7c9),
+- Navigate to the [LibreChat locize project](https://www.locize.app/cat/62uyy7c9),
- Click the "ADD LANGUAGE" button, typically found within the "..." menu of the "Start to translate" card on the project overview page.
### 2. Update the Language Selector Component
-Edit `client/src/components/Nav/SettingsTabs/General/Selectors.tsx` and add your new language option to the `languageOptions` array:
+Edit `client/src/components/Appearance/Selectors.tsx` and add your new language option to the `languageOptions` array:
```typescript
{ value: 'language-code', label: localize('com_nav_lang_language_name') },
```
Example:
+
```typescript
{ value: 'bo', label: localize('com_nav_lang_tibetan') },
{ value: 'uk-UA', label: localize('com_nav_lang_ukrainian') },
```
**Note:** Use the appropriate language code format:
+
- Use simple codes (e.g., `bo`) for languages without regional variants
- Use region-specific codes (e.g., `uk-UA`) when needed
@@ -38,6 +40,7 @@ In `client/src/locales/en/translation.json`, add the corresponding localization
```
Example:
+
```json
"com_nav_lang_tibetan": "བོད་སྐད་",
"com_nav_lang_ukrainian": "Українська",
@@ -56,11 +59,11 @@ mkdir -p client/src/locales/[language-code]
Create `client/src/locales/[language-code]/translation.json` with an empty JSON object:
```json
-{
-}
+{}
```
Example:
+
- `client/src/locales/bo/translation.json`
- `client/src/locales/uk/translation.json`
@@ -69,11 +72,13 @@ Example:
Update `client/src/locales/i18n.ts`:
1. Import the new translation file:
+
```typescript
import translationLanguageCode from './language-code/translation.json';
```
2. Add it to the `resources` object:
+
```typescript
export const resources = {
// ... existing languages
@@ -82,6 +87,7 @@ export const resources = {
```
Example:
+
```typescript
import translationBo from './bo/translation.json';
import translationUk from './uk/translation.json';
diff --git a/package-lock.json b/package-lock.json
index 9b99dc6790..4a95464f4e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -43548,6 +43548,7 @@
"react-dom": "^18.2.0",
"react-i18next": "^15.4.0",
"rimraf": "^6.1.3",
+ "tailwindcss": "^3.4.1",
"tailwindcss-radix": "^2.8.0",
"tsdown": "^0.22.2",
"typescript": "^5.9.3"
@@ -43576,6 +43577,7 @@
"@radix-ui/react-switch": "^1.2.5",
"@radix-ui/react-tabs": "^1.0.3",
"@radix-ui/react-toast": "^1.1.5",
+ "@rc-component/mini-decimal": "^1.0.1",
"@react-spring/web": "^10.0.1",
"@tanstack/react-query": "^4.28.0 || ^5.0.0",
"@tanstack/react-table": "^8.11.7",
diff --git a/packages/client/package.json b/packages/client/package.json
index d25ccac4bc..c5476f32ae 100644
--- a/packages/client/package.json
+++ b/packages/client/package.json
@@ -63,6 +63,7 @@
"@radix-ui/react-switch": "^1.2.5",
"@radix-ui/react-tabs": "^1.0.3",
"@radix-ui/react-toast": "^1.1.5",
+ "@rc-component/mini-decimal": "^1.0.1",
"@react-spring/web": "^10.0.1",
"@tanstack/react-query": "^4.28.0 || ^5.0.0",
"@tanstack/react-table": "^8.11.7",
@@ -114,6 +115,7 @@
"react-dom": "^18.2.0",
"react-i18next": "^15.4.0",
"rimraf": "^6.1.3",
+ "tailwindcss": "^3.4.1",
"tailwindcss-radix": "^2.8.0",
"tsdown": "^0.22.2",
"typescript": "^5.9.3"
diff --git a/packages/client/src/components/Dropdown.css b/packages/client/src/components/Dropdown.css
index 64d8bcb54a..9728604bf6 100644
--- a/packages/client/src/components/Dropdown.css
+++ b/packages/client/src/components/Dropdown.css
@@ -4,7 +4,7 @@
flex-direction: column;
overflow: auto;
overscroll-behavior: contain;
- border-radius: 1rem;
+ border-radius: 0.7rem;
border-width: 1px;
border-style: solid;
border-color: rgb(var(--border-light) / var(--border-light-alpha, 1));
diff --git a/packages/client/src/components/Dropdown.tsx b/packages/client/src/components/Dropdown.tsx
index 522a713c34..c18ddb9bd3 100644
--- a/packages/client/src/components/Dropdown.tsx
+++ b/packages/client/src/components/Dropdown.tsx
@@ -12,7 +12,11 @@ interface DropdownProps {
label?: string;
onChange: (value: string) => void;
options: (string | Option | { divider: true })[];
+ /** Applied to the positioning wrapper */
className?: string;
+ /** Applied to the trigger button */
+ triggerClassName?: string;
+ /** Applied to the popover */
sizeClasses?: string;
testId?: string;
icon?: React.ReactNode;
@@ -21,6 +25,8 @@ interface DropdownProps {
ariaLabel?: string;
'aria-labelledby'?: string;
portal?: boolean;
+ /** Renders the popover into this element instead of document.body */
+ portalElement?: ((element: HTMLElement) => HTMLElement | null) | HTMLElement | null;
disabled?: boolean;
searchable?: boolean;
searchPlaceholder?: string;
@@ -42,6 +48,7 @@ const Dropdown: React.FC<DropdownProps> = ({
onChange,
options,
className = '',
+ triggerClassName,
sizeClasses,
testId = 'dropdown-menu',
icon,
@@ -50,6 +57,7 @@ const Dropdown: React.FC<DropdownProps> = ({
ariaLabel,
'aria-labelledby': ariaLabelledBy,
portal = true,
+ portalElement,
disabled = false,
searchable = false,
searchPlaceholder,
@@ -141,7 +149,7 @@ const Dropdown: React.FC<DropdownProps> = ({
'disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-text-primary',
/** Horizontal padding would squeeze the icon, which flex-shrinks to fit */
iconOnly ? 'size-10 justify-center px-0' : 'w-fit gap-2 px-3',
- className,
+ triggerClassName,
)}
data-testid={testId}
aria-label={ariaLabel}
@@ -166,13 +174,12 @@ const Dropdown: React.FC<DropdownProps> = ({
</Select.Select>
<Select.SelectPopover
portal={portal}
+ portalElement={portalElement}
store={selectProps}
className={cn(
'popover-ui z-40 text-sm',
- sizeClasses,
- className,
- 'max-h-[80vh] overflow-y-auto',
'[pointer-events:auto]', // Override body's pointer-events:none when in modal
+ sizeClasses,
)}
>
{searchable ? (
diff --git a/packages/client/src/components/DropdownNoState.tsx b/packages/client/src/components/DropdownNoState.tsx
deleted file mode 100644
index 0f12bcbd8a..0000000000
--- a/packages/client/src/components/DropdownNoState.tsx
+++ /dev/null
@@ -1,136 +0,0 @@
-import React, { FC } from 'react';
-import {
- Listbox,
- ListboxButton,
- ListboxOption,
- ListboxOptions,
- Transition,
-} from '@headlessui/react';
-import type { Option } from '~/common';
-import { cn } from '~/utils/';
-
-interface DropdownProps {
- value?: string | Option;
- label?: string;
- onChange: (value: string | Option) => void;
- options: (string | Option)[];
- className?: string;
- sizeClasses?: string;
- testId?: string;
-}
-
-/*
- * Mainly used for the Speech Voice Selection Dropdown
- */
-
-const Dropdown: FC<DropdownProps> = ({
- value,
- label = '',
- onChange,
- options,
- className = '',
- sizeClasses,
- testId = 'dropdown-menu',
-}) => {
- const getValue = (option?: string | Option) =>
- typeof option === 'string' ? option : option?.value;
-
- const getDisplay = (option?: string | Option) =>
- typeof option === 'string' ? option : (option?.label ?? option?.value);
-
- const isEqual = (a: string | Option, b: string | Option): boolean => getValue(a) === getValue(b);
-
- const selectedOption = options.find((option) => isEqual(option, value ?? '')) ?? value;
-
- const handleChange = (newValue: string | Option) => {
- onChange(newValue);
- };
-
- return (
- <div className={cn('relative', className)}>
- <Listbox value={selectedOption} onChange={handleChange}>
- <div className={cn('relative', className)}>
- <ListboxButton
- data-testid={testId}
- className={cn(
- 'relative inline-flex items-center justify-between rounded-md border-border-light bg-surface-secondary py-2 pl-3 pr-8 text-text-primary transition-all duration-100 ease-in-out hover:bg-surface-hover',
- 'w-auto',
- className,
- )}
- aria-label="Select an option"
- >
- <span className="block truncate">
- {label}
- {getDisplay(selectedOption)}
- </span>
- <span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
- <svg
- xmlns="http://www.w3.org/2000/svg"
- fill="none"
- viewBox="0 0 24 24"
- strokeWidth="2"
- stroke="currentColor"
- className="h-4 w-5 rotate-0 transform text-text-primary transition-transform duration-300 ease-in-out"
- >
- <polyline points="6 9 12 15 18 9"></polyline>
- </svg>
- </span>
- </ListboxButton>
- <Transition
- leave="transition ease-in duration-50"
- leaveFrom="opacity-100"
- leaveTo="opacity-0"
- >
- <ListboxOptions
- className={cn(
- 'absolute z-50 mt-1 flex flex-col items-start gap-1 overflow-auto rounded-lg border border-border-medium bg-surface-secondary p-1.5 text-text-primary shadow-lg transition-opacity focus:outline-none',
- sizeClasses,
- className,
- )}
- aria-label="List of options"
- >
- {options.map((item, index) => (
- <ListboxOption
- key={index}
- value={item}
- className={cn(
- 'relative cursor-pointer select-none rounded border-border-medium bg-surface-secondary py-2.5 pl-3 pr-3 text-sm text-text-primary hover:bg-surface-hover',
- )}
- style={{ width: '100%' }}
- data-theme={getValue(item)}
- >
- {({ selected }) => (
- <div className="flex w-full items-center justify-between">
- <span className="block truncate">{getDisplay(item)}</span>
- {selected && (
- <span className="ml-auto pl-2">
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- className="icon-md block group-hover:hidden"
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM16.0755 7.93219C16.5272 8.25003 16.6356 8.87383 16.3178 9.32549L11.5678 16.0755C11.3931 16.3237 11.1152 16.4792 10.8123 16.4981C10.5093 16.517 10.2142 16.3973 10.0101 16.1727L7.51006 13.4227C7.13855 13.014 7.16867 12.3816 7.57733 12.0101C7.98598 11.6386 8.61843 11.6687 8.98994 12.0773L10.6504 13.9039L14.6822 8.17451C15 7.72284 15.6238 7.61436 16.0755 7.93219Z"
- fill="currentColor"
- />
- </svg>
- </span>
- )}
- </div>
- )}
- </ListboxOption>
- ))}
- </ListboxOptions>
- </Transition>
- </div>
- </Listbox>
- </div>
- );
-};
-
-export default Dropdown;
diff --git a/packages/client/src/components/InputNumber.tsx b/packages/client/src/components/InputNumber.tsx
index 72b1a812b9..e85e3e4aa1 100644
--- a/packages/client/src/components/InputNumber.tsx
+++ b/packages/client/src/components/InputNumber.tsx
@@ -4,8 +4,8 @@ import * as React from 'react';
import RCInputNumber from 'rc-input-number';
import * as InputNumberPrimitive from 'rc-input-number';
+import type { ValueType } from '@rc-component/mini-decimal';
import { cn } from '~/utils';
-import { ValueType } from '@rc-component/mini-decimal';
// TODO help needed
// React.ElementRef<typeof LabelPrimitive.Root>,