Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
};

const AlertDialogPortal = ({ children }: AlertDialogPortalProps) => {
const { rootClass } = useContext(AlertDialogContext);

Check warning on line 11 in src/components/ui/AlertDialog/fragments/AlertDialogPortal.tsx

View workflow job for this annotation

GitHub Actions / lint

'rootClass' is assigned a value but never used
const rootElement = document.querySelector('#rad-ui-theme-container') || document.body as HTMLElement | null;

return (
<Floater.Portal
root={rootElement}
Expand Down
21 changes: 21 additions & 0 deletions src/components/ui/Select/Select.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use client';
import SelectContent from './fragments/SelectContent';
import SelectItem from './fragments/SelectItem';
import SelectTrigger from './fragments/SelectTrigger';
import SelectRoot from './fragments/SelectRoot';
import SelectIndicator from './fragments/SelectIndicator';
import SelectPortal from './fragments/SelectPortal';

const Select = () => {
console.warn('Direct usage of Select is not supported. Please use Select.Root, Select.Content, etc. instead.');
return null;
};

Select.Root = SelectRoot;
Select.Content = SelectContent;
Select.Item = SelectItem;
Select.Trigger = SelectTrigger;
Select.Portal = SelectPortal;
Select.Indicator = SelectIndicator;

export default Select;
9 changes: 9 additions & 0 deletions src/components/ui/Select/contexts/SelectRootContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

interface SelectRootContextType {
rootClass: string;
}

export const SelectRootContext = React.createContext<SelectRootContextType>({
rootClass: ''
});
22 changes: 22 additions & 0 deletions src/components/ui/Select/fragments/SelectContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use client';
import React, { useEffect, useRef, useContext } from 'react';
import SelectPrimitive from '~/core/primitives/Select/Select';
import { SelectRootContext } from '../contexts/SelectRootContext';

function SelectContent({ customRootClass, children, position = 'popper', ...props }: any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve type safety by defining proper prop types.

The component uses any type for props, which eliminates type checking benefits. Consider defining a proper interface for the component props.

+interface SelectContentProps {
+  customRootClass?: string;
+  children: React.ReactNode;
+  position?: 'popper' | 'item-aligned';
+  [key: string]: any; // for additional props to spread
+}
+
-function SelectContent({ customRootClass, children, position = 'popper', ...props }: any) {
+function SelectContent({ customRootClass, children, position = 'popper', ...props }: SelectContentProps) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function SelectContent({ customRootClass, children, position = 'popper', ...props }: any) {
interface SelectContentProps {
customRootClass?: string;
children: React.ReactNode;
position?: 'popper' | 'item-aligned';
[key: string]: any; // for additional props to spread
}
function SelectContent({ customRootClass, children, position = 'popper', ...props }: SelectContentProps) {
// ...rest of the implementation
}
🤖 Prompt for AI Agents
In src/components/ui/Select/fragments/SelectContent.tsx at line 7, the
SelectContent component uses the 'any' type for its props, which disables type
checking. Define a proper TypeScript interface for the component props
specifying types for customRootClass, children, position, and any other props,
then replace 'any' with this interface to improve type safety.

const { rootClass } = useContext(SelectRootContext);
return (
<SelectPrimitive.Content
className={`${rootClass}-content`}
position={position}
data-position={position}

{...props}
>

{children}
</SelectPrimitive.Content>
);
}
Comment on lines +6 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Clarify the purpose of the customRootClass prop.

The customRootClass prop is destructured from the component props but is never used in the implementation. Either implement its intended functionality or remove it from the prop destructuring to avoid confusion.

If customRootClass should override the context-provided rootClass, consider this implementation:

function SelectContent({ customRootClass, children, position = 'popper', ...props }: any) {
    const { rootClass } = useContext(SelectRootContext);
+    const effectiveRootClass = customRootClass || rootClass;
    return (
        <SelectPrimitive.Content
-            className={`${rootClass}-content`}
+            className={`${effectiveRootClass}-content`}
            position={position}
            data-position={position}
            {...props}
        >
            {children}
        </SelectPrimitive.Content>
    );
}

Alternatively, if it's not needed, remove it from the props:

-function SelectContent({ customRootClass, children, position = 'popper', ...props }: any) {
+function SelectContent({ children, position = 'popper', ...props }: any) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function SelectContent({ customRootClass, children, position = 'popper', ...props }: any) {
const { rootClass } = useContext(SelectRootContext);
return (
<SelectPrimitive.Content
className={`${rootClass}-content`}
position={position}
data-position={position}
{...props}
>
{children}
</SelectPrimitive.Content>
);
}
function SelectContent({ customRootClass, children, position = 'popper', ...props }: any) {
const { rootClass } = useContext(SelectRootContext);
const effectiveRootClass = customRootClass || rootClass;
return (
<SelectPrimitive.Content
className={`${effectiveRootClass}-content`}
position={position}
data-position={position}
{...props}
>
{children}
</SelectPrimitive.Content>
);
}
🤖 Prompt for AI Agents
In src/components/ui/Select/fragments/SelectContent.tsx around lines 5 to 19,
the customRootClass prop is destructured but never used, causing confusion.
Either remove customRootClass from the component's props if it is unnecessary,
or update the implementation to use customRootClass to override the rootClass
from context by applying customRootClass in the className instead of rootClass.
Ensure the className reflects the correct root class based on whether
customRootClass is provided.


export default SelectContent;
16 changes: 16 additions & 0 deletions src/components/ui/Select/fragments/SelectIndicator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use client';
import React, { useContext } from 'react';
import { SelectRootContext } from '../contexts/SelectRootContext';

function SelectIndicator() {
const { rootClass } = useContext(SelectRootContext);
return (
<div className={`${rootClass}-item-indicator`}>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.3332 4L5.99984 11.3333L2.6665 8" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
</svg>
</div>
);
}

export default SelectIndicator;
24 changes: 24 additions & 0 deletions src/components/ui/Select/fragments/SelectItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use client';
import React, { useContext } from 'react';
import SelectPrimitive from '~/core/primitives/Select/Select';
import { SelectRootContext } from '../contexts/SelectRootContext';

function SelectItem({ customRootClass, children, value, disabled, ...props }: any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace any type with proper TypeScript interface for better type safety.

Using any eliminates TypeScript's type checking benefits and reduces IDE support for autocompletion and error detection.

-function SelectItem({ customRootClass, children, value, disabled, ...props }: any) {
+interface SelectItemProps {
+    customRootClass?: string;
+    children: React.ReactNode;
+    value: string;
+    disabled?: boolean;
+    [key: string]: any; // for additional props
+}
+
+function SelectItem({ customRootClass, children, value, disabled, ...props }: SelectItemProps) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function SelectItem({ customRootClass, children, value, disabled, ...props }: any) {
interface SelectItemProps {
customRootClass?: string;
children: React.ReactNode;
value: string;
disabled?: boolean;
[key: string]: any; // for additional props
}
function SelectItem(
{ customRootClass, children, value, disabled, ...props }: SelectItemProps
) {
// ...
}
🤖 Prompt for AI Agents
In src/components/ui/Select/fragments/SelectItem.tsx at line 7, replace the use
of the `any` type for the function parameter with a properly defined TypeScript
interface that specifies the expected props such as customRootClass, children,
value, disabled, and any other relevant properties. Define this interface above
the function or in a separate types file, then use it to type the props
parameter to improve type safety and enable better IDE support.

const { rootClass } = useContext(SelectRootContext);

return (
<SelectPrimitive.Item
className={`${rootClass}-item`}
value={value}
disabled={disabled}
data-disabled={disabled ? '' : undefined}
role="option"
aria-disabled={disabled ? 'true' : undefined}
{...props}
>
<span className={`${rootClass}-text`}>{children}</span>
</SelectPrimitive.Item>
);
}

export default SelectItem;
20 changes: 20 additions & 0 deletions src/components/ui/Select/fragments/SelectPortal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use client';
import React, { useContext } from 'react';
import SelectPrimitive from '~/core/primitives/Select/Select';

export type SelectPortalProps = {
children: React.ReactNode;
};

const SelectPortal = ({ children }: SelectPortalProps) => {
const rootElement = document.querySelector('#rad-ui-theme-container') || document.body as HTMLElement | null;

return (
<SelectPrimitive.Portal>
{children}
</SelectPrimitive.Portal>

);
};

export default SelectPortal;
27 changes: 27 additions & 0 deletions src/components/ui/Select/fragments/SelectRoot.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React, { useState, useCallback } from 'react';
import SelectPrimitive from '~/core/primitives/Select/Select';
import { customClassSwitcher } from '~/core/customClassSwitcher';
import { SelectRootContext } from '../contexts/SelectRootContext';

const COMPONENT_NAME = 'Select';

function SelectRoot({ customRootClass, children, defaultValue, value, onValueChange, ...props }: any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve type safety by replacing 'any' with proper types.

Using any type reduces type safety and IDE support. Consider defining proper prop types.

+type SelectRootProps = {
+    customRootClass?: string;
+    children?: React.ReactNode;
+    defaultValue?: string;
+    value?: string;
+    onValueChange?: (value: string) => void;
+} & React.ComponentPropsWithoutRef<'div'>;

-function SelectRoot({ customRootClass, children, defaultValue, value, onValueChange, ...props }: any) {
+function SelectRoot({ customRootClass, children, defaultValue, value, onValueChange, ...props }: SelectRootProps) {
🤖 Prompt for AI Agents
In src/components/ui/Select/fragments/SelectRoot.tsx at line 7, replace the use
of 'any' for the function props with a properly defined TypeScript interface or
type that explicitly lists all expected props and their types, such as
customRootClass as string or undefined, children as React.ReactNode,
defaultValue and value as appropriate types, and onValueChange as a function
type. This will improve type safety and enhance IDE support.

const rootClass = customClassSwitcher(customRootClass, COMPONENT_NAME);

return (
<SelectRootContext.Provider value={{ rootClass }}>
<SelectPrimitive.Root
className={`${rootClass}-root`}
defaultValue={defaultValue}
value={value}
onValueChange={onValueChange}
{...props}
>
{children}
</SelectPrimitive.Root>
</SelectRootContext.Provider>

);
}

export default SelectRoot;
26 changes: 26 additions & 0 deletions src/components/ui/Select/fragments/SelectTrigger.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use client';
import React, { useContext } from 'react';
import SelectPrimitive from '~/core/primitives/Select/Select';

import { SelectRootContext } from '../contexts/SelectRootContext';

function SelectTrigger({ customRootClass, children, disabled, placeholder, ...props }: any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace any type with proper TypeScript interface for consistency and type safety.

Similar to SelectItem, this component should use a proper TypeScript interface to maintain type safety across the Select component system.

-function SelectTrigger({ customRootClass, children, disabled, placeholder, ...props }: any) {
+interface SelectTriggerProps {
+    customRootClass?: string;
+    children: React.ReactNode;
+    disabled?: boolean;
+    placeholder?: string;
+    [key: string]: any;
+}
+
+function SelectTrigger({ customRootClass, children, disabled, placeholder, ...props }: SelectTriggerProps) {
🤖 Prompt for AI Agents
In src/components/ui/Select/fragments/SelectTrigger.tsx at line 7, replace the
use of the `any` type in the function parameter with a properly defined
TypeScript interface that specifies the expected props such as customRootClass,
children, disabled, placeholder, and any other relevant properties. Define this
interface above the function or import it if it exists, then use it to type the
props parameter to ensure type safety and consistency with other Select
components like SelectItem.

const { rootClass } = useContext(SelectRootContext);
const triggerRef = React.useRef<HTMLDivElement>(null);
console.log(triggerRef);
return (
<SelectPrimitive.Trigger
className={`${rootClass}-trigger`}
aria-disabled={disabled ? 'true' : undefined}
data-placeholder={placeholder ? '' : undefined}
ref={triggerRef}
{...props}
>

{children}

</SelectPrimitive.Trigger>
);
}

export default SelectTrigger;
133 changes: 133 additions & 0 deletions src/components/ui/Select/stories/Select.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import React from 'react';
import Select from '../Select';
import SandboxEditor from '~/components/tools/SandboxEditor/SandboxEditor';
import SelectPrimitive from '~/core/primitives/Select/Select';

// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
export default {
title: 'WIP/Select',
component: Select
};

export const Basic = () => {
return (
<SandboxEditor>
<div className="w-[240px]">
<Select.Root>
<Select.Trigger>
<span>Select an option</span>
</Select.Trigger>
<Select.Portal>
<Select.Content>
<Select.Item value="apple"> <Select.Indicator />Apple</Select.Item>
<Select.Item value="banana"> <Select.Indicator />Banana</Select.Item>
<Select.Item value="orange"> <Select.Indicator />Orange</Select.Item>
<Select.Item value="grape"> <Select.Indicator />Grape</Select.Item>
</Select.Content>
</Select.Portal>
</Select.Root>
</div>
</SandboxEditor>
);
};

export const WithDisabledOptions = () => {
return (
<SandboxEditor>
<div className="w-[240px]">
<Select.Root>
<Select.Trigger>
<span>Select a fruit</span>
</Select.Trigger>
<Select.Content>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="banana">Banana</Select.Item>
<Select.Item value="orange" disabled>Orange (Sold Out)</Select.Item>
<Select.Item value="grape">Grape</Select.Item>
<Select.Item value="pear" disabled>Pear (Sold Out)</Select.Item>
</Select.Content>
</Select.Root>
</div>
</SandboxEditor>
);
};

export const WithInitialValue = () => {
return (
<SandboxEditor>
<div className="w-[240px]">
<Select.Root defaultValue="react">
<Select.Trigger>
<span>Favorite Framework</span>
</Select.Trigger>
<Select.Content>
<Select.Item value="react">React</Select.Item>
<Select.Item value="angular">Angular</Select.Item>
<Select.Item value="vue">Vue</Select.Item>
<Select.Item value="svelte">Svelte</Select.Item>
</Select.Content>
</Select.Root>
</div>
</SandboxEditor>
);
};

export const MultipleSelects = () => {
return (
<SandboxEditor>
<div className="flex flex-col gap-4">
<div className="w-[240px]">
<Select.Root>
<Select.Trigger>
<span>Select a color</span>
</Select.Trigger>
<Select.Content>
<Select.Item value="red">Red</Select.Item>
<Select.Item value="green">Green</Select.Item>
<Select.Item value="blue">Blue</Select.Item>
<Select.Item value="yellow">Yellow</Select.Item>
</Select.Content>
</Select.Root>
</div>

<div className="w-[240px]">
<Select.Root>
<Select.Trigger>
<span>Select a size</span>
</Select.Trigger>
<Select.Content>
<Select.Item value="sm">Small</Select.Item>
<Select.Item value="md">Medium</Select.Item>
<Select.Item value="lg">Large</Select.Item>
<Select.Item value="xl">Extra Large</Select.Item>
</Select.Content>
</Select.Root>
</div>
</div>
</SandboxEditor>
);
};

export const ControlledExample = () => {
const [value, setValue] = React.useState('');
return (
<SandboxEditor>
<div className="w-[240px]">
<Select.Root defaultValue="option1" value={value} onValueChange={setValue}>
<Select.Trigger>
helo
</Select.Trigger>
<Select.Content>
<Select.Item value='option1'>Option 1</Select.Item>
<Select.Item value='option2'>Option 2</Select.Item>
<Select.Item value='option3'>Option 3</Select.Item>
</Select.Content>
</Select.Root>
</div>

<div className='mt-32'>
<p className='text-gray-950'>Value: {value}</p>
</div>
</SandboxEditor>
);
};
Comment on lines +111 to +133
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix conflicting props and state in controlled example.

The controlled example has several issues:

  1. Both defaultValue and value props are used together, which can cause conflicts
  2. State is initialized with empty string but defaultValue is "option1"
 export const ControlledExample = () => {
-    const [value, setValue] = React.useState('');
+    const [value, setValue] = React.useState('option1');
     return (
         <SandboxEditor>
             <div className="w-[240px]">
-                <Select.Root defaultValue="option1" value={value} onValueChange={setValue}>
+                <Select.Root value={value} onValueChange={setValue}>
                     <Select.Trigger>
-            helo
+                        <span>Select an option</span>
                     </Select.Trigger>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const ControlledExample = () => {
const [value, setValue] = React.useState('');
return (
<SandboxEditor>
<div className="w-[240px]">
<Select.Root defaultValue="option1" value={value} onValueChange={setValue}>
<Select.Trigger>
helo
</Select.Trigger>
<Select.Content>
<Select.Item value='option1'>Option 1</Select.Item>
<Select.Item value='option2'>Option 2</Select.Item>
<Select.Item value='option3'>Option 3</Select.Item>
</Select.Content>
</Select.Root>
</div>
<div className='mt-32'>
<p className='text-gray-950'>Value: {value}</p>
</div>
</SandboxEditor>
);
};
export const ControlledExample = () => {
const [value, setValue] = React.useState('option1');
return (
<SandboxEditor>
<div className="w-[240px]">
<Select.Root value={value} onValueChange={setValue}>
<Select.Trigger>
<span>Select an option</span>
</Select.Trigger>
<Select.Content>
<Select.Item value='option1'>Option 1</Select.Item>
<Select.Item value='option2'>Option 2</Select.Item>
<Select.Item value='option3'>Option 3</Select.Item>
</Select.Content>
</Select.Root>
</div>
<div className='mt-32'>
<p className='text-gray-950'>Value: {value}</p>
</div>
</SandboxEditor>
);
};
🤖 Prompt for AI Agents
In src/components/ui/Select/stories/Select.stories.tsx around lines 132 to 154,
the ControlledExample component incorrectly uses both defaultValue and value
props on Select.Root, causing conflicts, and initializes state with an empty
string while defaultValue is "option1". Remove the defaultValue prop from
Select.Root and initialize the state with "option1" to ensure the component is
properly controlled and consistent.

20 changes: 20 additions & 0 deletions src/core/primitives/Select/Select.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import SelectPrimitiveContent from './fragments/SelectPrimitiveContent';
import SelectPrimitiveItem from './fragments/SelectPrimitiveItem';
import SelectPrimitiveTrigger from './fragments/SelectPrimitiveTrigger';
import SelectPrimitiveRoot from './fragments/SelectPrimitiveRoot';
import SelectPrimitivePortal from './fragments/SelectPrimitivePortal';
import SelectPrimitiveOverlay from './fragments/SelectPrimitiveOverlay';

const SelectPrimitive = () => {
console.warn('Direct usage of Select is not supported. Please use Select.Root, Select.Content, etc. instead.');
return null;
};

SelectPrimitive.Root = SelectPrimitiveRoot;
SelectPrimitive.Content = SelectPrimitiveContent;
SelectPrimitive.Portal = SelectPrimitivePortal;
SelectPrimitive.Overlay = SelectPrimitiveOverlay;
SelectPrimitive.Item = SelectPrimitiveItem;
SelectPrimitive.Trigger = SelectPrimitiveTrigger;

export default SelectPrimitive;
22 changes: 22 additions & 0 deletions src/core/primitives/Select/contexts/SelectPrimitiveContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { createContext } from 'react';

export type SelectPrimitiveContextType = {
isOpen: boolean,
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>,
selectedValue: string,
setSelectedValue: React.Dispatch<React.SetStateAction<string>>
handleSelect: (value: string) => void
refs: {
reference: React.RefObject<any>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve type safety by replacing any types.

Several properties use any type which reduces type safety. Consider using more specific types, especially for the refs and floating UI properties.

+import type { FloatingContext, ReferenceType, UseFloatingReturn } from '@floating-ui/react';

export type SelectPrimitiveContextType = {
    isOpen: boolean,
    setIsOpen: React.Dispatch<React.SetStateAction<boolean>>,
    selectedValue: string,
    setSelectedValue: React.Dispatch<React.SetStateAction<string>>
    handleSelect: (value: string) => void
    refs: {
-        reference: React.RefObject<any>;
-        floating: React.RefObject<any>;
-        setReference: (node: any) => void;
-        setFloating: (node: any) => void;
+        reference: React.RefObject<ReferenceType>;
+        floating: React.RefObject<HTMLElement>;
+        setReference: (node: ReferenceType | null) => void;
+        setFloating: (node: HTMLElement | null) => void;
    };
    floatingStyles: React.CSSProperties;
-    floatingContext: any;
-    getReferenceProps: () => any;
-    getFloatingProps: () => any;
-    getItemProps: (userProps?: any) => any;
+    floatingContext: FloatingContext;
+    getReferenceProps: () => React.HTMLProps<Element>;
+    getFloatingProps: () => React.HTMLProps<HTMLElement>;
+    getItemProps: (userProps?: React.HTMLProps<HTMLElement>) => React.HTMLProps<HTMLElement>;
}

Also applies to: 16-19

🤖 Prompt for AI Agents
In src/core/primitives/Select/contexts/SelectPrimitiveContext.tsx around lines
10 and 16-19, the use of `any` for the `reference` ref and other floating UI
properties reduces type safety. Replace `React.RefObject<any>` with a more
specific type that matches the expected DOM element or component type the ref
points to, such as `React.RefObject<HTMLDivElement>` or the appropriate element
type. Similarly, update other properties using `any` to their precise types
based on their usage to improve overall type safety.

floating: React.RefObject<any>;
setReference: (node: any) => void;
setFloating: (node: any) => void;
};
floatingStyles: React.CSSProperties;
floatingContext: any;
getReferenceProps: () => any;
getFloatingProps: () => any;
getItemProps: (userProps?: any) => any;
}

export const SelectPrimitiveContext = createContext<SelectPrimitiveContextType>({} as SelectPrimitiveContextType);
Loading
Loading