The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Complete Select public parts (#27741)
Raphaël Bosi3708bcce38d8
diff --git a/packages/twenty-docs/snippets/ui/generated/input/select.mdx b/packages/twenty-docs/snippets/ui/generated/input/select.mdxindex dc00494bab2..a224029fda6 100644--- a/packages/twenty-docs/snippets/ui/generated/input/select.mdx+++ b/packages/twenty-docs/snippets/ui/generated/input/select.mdx@@ -23,6 +23,10 @@Provides a hint to the browser for autofill.</ParamField>+<ParamField body="Root.children" type="ReactNode">+ Select parts sharing selection, open state and accessible relationships. Root renders no DOM node.+</ParamField>+<ParamField body="Root.defaultOpen" type="boolean" default="false">Whether the select popup is initially open.@@ -54,7 +58,7 @@</ParamField><ParamField body="Root.inputRef" type="Ref<HTMLInputElement>">- A ref to access the hidden input element.+ Ref to the native hidden input used for form submission.</ParamField><ParamField body="Root.isItemEqualToValue" type="((itemValue: Value, value: Value) => boolean)">@@ -94,7 +98,7 @@</ParamField><ParamField body="Root.onOpenChange" type="((open: boolean, eventDetails: SelectRootChangeEventDetails) => void)">- Event handler called when the select popup is opened or closed.+ Receives the requested open state and unchanged Base UI event details.</ParamField><ParamField body="Root.onOpenChangeComplete" type="((open: boolean) => void)">@@ -102,7 +106,7 @@</ParamField><ParamField body="Root.onValueChange" type="((value: SelectValueType<Value, Multiple> | (Multiple extends true ? never : null), eventDetails: SelectRootChangeEventDetails) => void)">- Event handler called when the value of the select changes.+ Receives the requested generic value and unchanged Base UI event details, including reason, event and cancel(). Multiple selection receives an array; a cleared single value is null.</ParamField><ParamField body="Root.open" type="boolean">@@ -121,8 +125,31 @@The value of the select. Use when controlled.</ParamField>+### Select.Label++<ParamField body="Label.className" type="string | ((state: FieldRootState) => string | undefined)">+ CSS class applied to the element, or a function that+ returns a class based on the component's state.+</ParamField>++<ParamField body="Label.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, FieldRootState>">+ Allows you to replace the component's HTML element+ with a different tag, or compose it with another component.++ Accepts a `ReactElement` or a function that returns the element to render.+</ParamField>++<ParamField body="Label.style" type="CSSProperties | ((state: FieldRootState) => CSSProperties | undefined)">+ Style applied to the element, or a function that+ returns a style object based on the component's state.+</ParamField>+### Select.Trigger+<ParamField body="Trigger.children" type="ReactNode">+ Trigger content rendered as supplied. Compose Value and Icon explicitly.+</ParamField>+<ParamField body="Trigger.className" type="string | ((state: SelectTriggerState) => string | undefined)">CSS class applied to the element, or a function thatreturns a class based on the component's state.@@ -138,6 +165,10 @@Set to `false` if the rendered element is not a button (for example, `<div>`).</ParamField>+<ParamField body="Trigger.ref" type="Ref<HTMLButtonElement>">+ Ref to the rendered trigger element, a button by default.+</ParamField>+<ParamField body="Trigger.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectTriggerState>">Allows you to replace the component's HTML elementwith a different tag, or compose it with another component.@@ -146,7 +177,7 @@</ParamField><ParamField body="Trigger.size" type=""md" | "sm"" default="md">- Visual size of the trigger.+ Visual size of the trigger. Defaults to md.</ParamField><ParamField body="Trigger.style" type="CSSProperties | ((state: SelectTriggerState) => CSSProperties | undefined)">@@ -184,17 +215,86 @@returns a style object based on the component's state.</ParamField>-### Select.Popup+### Select.Icon++<ParamField body="Icon.children" type="ReactNode" default="<IconChevronDown />">+ Trigger icon content. Defaults to the Twenty chevron; explicit children replace it.+</ParamField>++<ParamField body="Icon.className" type="string | ((state: SelectIconState) => string | undefined)">+ CSS class applied to the element, or a function that+ returns a class based on the component's state.+</ParamField>++<ParamField body="Icon.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectIconState>">+ Allows you to replace the component's HTML element+ with a different tag, or compose it with another component.++ Accepts a `ReactElement` or a function that returns the element to render.+</ParamField>++<ParamField body="Icon.style" type="CSSProperties | ((state: SelectIconState) => CSSProperties | undefined)">+ Style applied to the element, or a function that+ returns a style object based on the component's state.+</ParamField>++### Select.Portal++<ParamField body="Portal.className" type="string | ((state: SelectPortalState) => string | undefined)">+ CSS class applied to the element, or a function that+ returns a class based on the component's state.+</ParamField>++<ParamField body="Portal.container" type="HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null">+ Portal destination. Defaults to the current theme container, then the document body. Explicit null waits for a container before mounting.+</ParamField>++<ParamField body="Portal.ref" type="Ref<HTMLDivElement>">+ Ref to the portal div. Native props and render apply to this element.+</ParamField>++<ParamField body="Portal.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectPortalState>">+ Allows you to replace the component's HTML element+ with a different tag, or compose it with another component.++ Accepts a `ReactElement` or a function that returns the element to render.+</ParamField>++<ParamField body="Portal.style" type="CSSProperties | ((state: SelectPortalState) => CSSProperties | undefined)">+ Style applied to the element, or a function that+ returns a style object based on the component's state.+</ParamField>++### Select.Backdrop++<ParamField body="Backdrop.className" type="string | ((state: SelectBackdropState) => string | undefined)">+ CSS class applied to the element, or a function that+ returns a class based on the component's state.+</ParamField>++<ParamField body="Backdrop.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectBackdropState>">+ Allows you to replace the component's HTML element+ with a different tag, or compose it with another component.-<ParamField body="Popup.align" type=""center" | "end" | "start"" default="start">+ Accepts a `ReactElement` or a function that returns the element to render.+</ParamField>++<ParamField body="Backdrop.style" type="CSSProperties | ((state: SelectBackdropState) => CSSProperties | undefined)">+ Style applied to the element, or a function that+ returns a style object based on the component's state.+</ParamField>++### Select.Positioner++<ParamField body="Positioner.align" type=""center" | "end" | "start"" default="center">How to align the popup relative to the specified side.</ParamField>-<ParamField body="Popup.alignItemWithTrigger" type="boolean" default="false">- Whether the positioner overlaps the trigger so the selected item's text is aligned with the trigger's value text. This only applies to mouse input and is automatically disabled if there is not enough space.+<ParamField body="Positioner.alignItemWithTrigger" type="boolean" default="true">+ Uses the upstream selected-item alignment by default. Set false to use side, align and offsets without overlapping the trigger.</ParamField>-<ParamField body="Popup.alignOffset" type="number | OffsetFunction" default="0">+<ParamField body="Positioner.alignOffset" type="number | OffsetFunction" default="0">Additional offset along the alignment axis in pixels.Also accepts a function that returns the offset to read the dimensions of the anchorand positioner elements, along with its side and alignment.@@ -206,44 +306,83 @@- `data.align`: how the positioner is aligned relative to the specified side.</ParamField>-<ParamField body="Popup.anchor" type="Element | VirtualElement | RefObject<Element | null> | (() => Element | VirtualElement | null) | null">+<ParamField body="Positioner.anchor" type="Element | VirtualElement | RefObject<Element | null> | (() => Element | VirtualElement | null) | null">An element to position the popup against.By default, the popup will be positioned against the trigger.</ParamField>-<ParamField body="Popup.className" type="string | ((state: SelectPopupState) => string | undefined)">+<ParamField body="Positioner.arrowPadding" type="number" default="5">+ Minimum distance to maintain between the arrow and the edges of the popup.++ Use it to prevent the arrow element from hanging out of the rounded corners of a popup.+</ParamField>++<ParamField body="Positioner.className" type="string | ((state: SelectPositionerState) => string | undefined)">CSS class applied to the element, or a function thatreturns a class based on the component's state.</ParamField>-<ParamField body="Popup.container" type="HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null">- Element the popup is portaled into. Defaults to the theme's portal- container.+<ParamField body="Positioner.collisionAvoidance" type="CollisionAvoidance">+ Determines how to handle collisions when positioning the popup.++ `side` controls overflow on the preferred placement axis (`top`/`bottom` or `left`/`right`):+ - `'flip'`: keep the requested side when it fits; otherwise try the opposite side+ (`top` and `bottom`, or `left` and `right`).+ - `'shift'`: never change side; keep the requested side and move the popup within+ the clipping boundary so it stays visible.+ - `'none'`: do not correct side-axis overflow.++ `align` controls overflow on the alignment axis (`start`/`center`/`end`):+ - `'flip'`: keep side, but swap `start` and `end` when the requested alignment overflows.+ - `'shift'`: keep side and requested alignment, then nudge the popup along the+ alignment axis to fit.+ - `'none'`: do not correct alignment-axis overflow.++ `fallbackAxisSide` controls fallback behavior on the perpendicular axis when the+ preferred axis cannot fit:+ - `'start'`: allow perpendicular fallback and try the logical start side first+ (`top` before `bottom`, or `left` before `right` in LTR).+ - `'end'`: allow perpendicular fallback and try the logical end side first+ (`bottom` before `top`, or `right` before `left` in LTR).+ - `'none'`: do not fallback to the perpendicular axis.++ When `side` is `'shift'`, explicitly setting `align` only supports `'shift'` or `'none'`.+ If `align` is omitted, it defaults to `'flip'`.</ParamField>-<ParamField body="Popup.finalFocus" type="boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | void | HTMLElement | null)">- Determines the element to focus when the select popup is closed.+<ParamField body="Positioner.collisionBoundary" type="Boundary" default="clipping-ancestors">+ An element or a rectangle that delimits the area that the popup is confined to.+</ParamField>- - `false`: Do not move focus.- - `true`: Move focus based on the default behavior (trigger or previously focused element).- - `RefObject`: Move focus to the ref element.- - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).- Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing.+<ParamField body="Positioner.collisionPadding" type="Padding" default="5">+ Additional space to maintain from the edge of the collision boundary.</ParamField>-<ParamField body="Popup.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectPopupState>">+<ParamField body="Positioner.disableAnchorTracking" type="boolean" default="false">+ Whether to disable the popup from tracking any layout shift of its positioning anchor.+</ParamField>++<ParamField body="Positioner.positionMethod" type=""absolute" | "fixed"" default="absolute">+ Determines which CSS `position` property to use.+</ParamField>++<ParamField body="Positioner.ref" type="Ref<HTMLDivElement>">+ Ref to the positioning div. Native props, styles and render apply to this element.+</ParamField>++<ParamField body="Positioner.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectPositionerState>">Allows you to replace the component's HTML elementwith a different tag, or compose it with another component.Accepts a `ReactElement` or a function that returns the element to render.</ParamField>-<ParamField body="Popup.side" type=""bottom" | "inline-end" | "inline-start" | "left" | "right" | "top"" default="bottom">+<ParamField body="Positioner.side" type=""bottom" | "inline-end" | "inline-start" | "left" | "right" | "top"" default="bottom">Which side of the anchor element to align the popup against.May automatically change to avoid collisions.</ParamField>-<ParamField body="Popup.sideOffset" type="number | OffsetFunction" default="8">+<ParamField body="Positioner.sideOffset" type="number | OffsetFunction" default="0">Distance between the anchor and the popup in pixels.Also accepts a function that returns the distance to read the dimensions of the anchorand positioner elements, along with its side and alignment.@@ -255,33 +394,85 @@- `data.align`: how the positioner is aligned relative to the specified side.</ParamField>+<ParamField body="Positioner.sticky" type="boolean" default="false">+ Whether to maintain the popup in the viewport after+ the anchor element was scrolled out of view.+</ParamField>++<ParamField body="Positioner.style" type="CSSProperties | ((state: SelectPositionerState) => CSSProperties | undefined)">+ Style applied to the element, or a function that+ returns a style object based on the component's state.+</ParamField>++### Select.Popup++<ParamField body="Popup.children" type="ReactNode">+ Popup content rendered as supplied. Compose inside Positioner and choose Portal separately.+</ParamField>++<ParamField body="Popup.className" type="string | ((state: SelectPopupState) => string | undefined)">+ CSS class applied to the element, or a function that+ returns a class based on the component's state.+</ParamField>++<ParamField body="Popup.finalFocus" type="boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | void | HTMLElement | null)">+ Determines the element to focus when the select popup is closed.++ - `false`: Do not move focus.+ - `true`: Move focus based on the default behavior (trigger or previously focused element).+ - `RefObject`: Move focus to the ref element.+ - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).+ Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing.+</ParamField>++<ParamField body="Popup.ref" type="Ref<HTMLDivElement>">+ Ref to the popup div. Native props, styles and render apply to this element.+</ParamField>++<ParamField body="Popup.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectPopupState>">+ Allows you to replace the component's HTML element+ with a different tag, or compose it with another component.++ Accepts a `ReactElement` or a function that returns the element to render.+</ParamField>+<ParamField body="Popup.style" type="CSSProperties | ((state: SelectPopupState) => CSSProperties | undefined)">Style applied to the element, or a function thatreturns a style object based on the component's state.</ParamField>-### Select.Item+### Select.List-<ParamField body="Item.className" type="string | ((state: SelectItemState) => string | undefined)">+<ParamField body="List.className" type="string | ((state: SelectListState) => string | undefined)">CSS class applied to the element, or a function thatreturns a class based on the component's state.</ParamField>-<ParamField body="Item.description" type="ReactNode">- Supporting text, placed according to `descriptionPlacement`.+<ParamField body="List.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectListState>">+ Allows you to replace the component's HTML element+ with a different tag, or compose it with another component.++ Accepts a `ReactElement` or a function that returns the element to render.</ParamField>-<ParamField body="Item.descriptionPlacement" type=""end" | "inline"" default="inline">- Where the description renders: inline after the content or at the end of- the row.+<ParamField body="List.style" type="CSSProperties | ((state: SelectListState) => CSSProperties | undefined)">+ Style applied to the element, or a function that+ returns a style object based on the component's state.</ParamField>-<ParamField body="Item.disabled" type="boolean" default="false">- Whether the component should ignore user interaction.+### Select.Item++<ParamField body="Item.children" type="ReactNode">+ Option content rendered as supplied. Compose ItemText and an optional ItemIndicator explicitly.</ParamField>-<ParamField body="Item.endIcon" type="ReactNode">- Icon rendered after the content.+<ParamField body="Item.className" type="string | ((state: SelectItemState) => string | undefined)">+ CSS class applied to the element, or a function that+ returns a class based on the component's state.+</ParamField>++<ParamField body="Item.disabled" type="boolean" default="false">+ Whether the component should ignore user interaction.</ParamField><ParamField body="Item.label" type="string">@@ -296,6 +487,10 @@Set to `true` if the rendered element is a native button.</ParamField>+<ParamField body="Item.ref" type="Ref<HTMLElement>">+ Ref to the rendered option element. Native props and render apply to this element.+</ParamField>+<ParamField body="Item.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectItemState>">Allows you to replace the component's HTML elementwith a different tag, or compose it with another component.@@ -303,10 +498,6 @@Accepts a `ReactElement` or a function that returns the element to render.</ParamField>-<ParamField body="Item.startIcon" type="ReactNode">- Icon rendered before the content.-</ParamField>-<ParamField body="Item.style" type="CSSProperties | ((state: SelectItemState) => CSSProperties | undefined)">Style applied to the element, or a function thatreturns a style object based on the component's state.@@ -316,6 +507,117 @@A unique value that identifies this select item.</ParamField>+### Select.ItemIndicator++<ParamField body="ItemIndicator.children" type="ReactNode" default="<IconCheck className={listItemStyles.checkIndicator} />">+ Selected indicator content. Defaults to the Twenty check icon; explicit children replace it.+</ParamField>++<ParamField body="ItemIndicator.className" type="string | ((state: SelectItemIndicatorState) => string | undefined)">+ CSS class applied to the element, or a function that+ returns a class based on the component's state.+</ParamField>++<ParamField body="ItemIndicator.keepMounted" type="boolean">+ Whether to keep the HTML element in the DOM when the item is not selected.+</ParamField>++<ParamField body="ItemIndicator.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectItemIndicatorState>">+ Allows you to replace the component's HTML element+ with a different tag, or compose it with another component.++ Accepts a `ReactElement` or a function that returns the element to render.+</ParamField>++<ParamField body="ItemIndicator.style" type="CSSProperties | ((state: SelectItemIndicatorState) => CSSProperties | undefined)">+ Style applied to the element, or a function that+ returns a style object based on the component's state.+</ParamField>++### Select.ItemText++<ParamField body="ItemText.className" type="string | ((state: SelectItemTextState) => string | undefined)">+ CSS class applied to the element, or a function that+ returns a class based on the component's state.+</ParamField>++<ParamField body="ItemText.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectItemTextState>">+ Allows you to replace the component's HTML element+ with a different tag, or compose it with another component.++ Accepts a `ReactElement` or a function that returns the element to render.+</ParamField>++<ParamField body="ItemText.style" type="CSSProperties | ((state: SelectItemTextState) => CSSProperties | undefined)">+ Style applied to the element, or a function that+ returns a style object based on the component's state.+</ParamField>++### Select.Arrow++<ParamField body="Arrow.className" type="string | ((state: SelectArrowState) => string | undefined)">+ CSS class applied to the element, or a function that+ returns a class based on the component's state.+</ParamField>++<ParamField body="Arrow.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectArrowState>">+ Allows you to replace the component's HTML element+ with a different tag, or compose it with another component.++ Accepts a `ReactElement` or a function that returns the element to render.+</ParamField>++<ParamField body="Arrow.style" type="CSSProperties | ((state: SelectArrowState) => CSSProperties | undefined)">+ Style applied to the element, or a function that+ returns a style object based on the component's state.+</ParamField>++### Select.ScrollDownArrow++<ParamField body="ScrollDownArrow.className" type="string | ((state: SelectScrollDownArrowState) => string | undefined)">+ CSS class applied to the element, or a function that+ returns a class based on the component's state.+</ParamField>++<ParamField body="ScrollDownArrow.keepMounted" type="boolean" default="false">+ Whether to keep the HTML element in the DOM while the select popup is not scrollable.+</ParamField>++<ParamField body="ScrollDownArrow.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectScrollDownArrowState>">+ Allows you to replace the component's HTML element+ with a different tag, or compose it with another component.++ Accepts a `ReactElement` or a function that returns the element to render.+</ParamField>++<ParamField body="ScrollDownArrow.style" type="CSSProperties | ((state: SelectScrollDownArrowState) => CSSProperties | undefined)">+ Style applied to the element, or a function that+ returns a style object based on the component's state.+</ParamField>++### Select.ScrollUpArrow++<ParamField body="ScrollUpArrow.className" type="string | ((state: SelectScrollUpArrowState) => string | undefined)">+ CSS class applied to the element, or a function that+ returns a class based on the component's state.+</ParamField>++<ParamField body="ScrollUpArrow.keepMounted" type="boolean" default="false">+ Whether to keep the HTML element in the DOM while the select popup is not scrollable.+</ParamField>++<ParamField body="ScrollUpArrow.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectScrollUpArrowState>">+ Allows you to replace the component's HTML element+ with a different tag, or compose it with another component.++ Accepts a `ReactElement` or a function that returns the element to render.+</ParamField>++<ParamField body="ScrollUpArrow.style" type="CSSProperties | ((state: SelectScrollUpArrowState) => CSSProperties | undefined)">+ Style applied to the element, or a function that+ returns a style object based on the component's state.+</ParamField>+### Select.Group<ParamField body="Group.className" type="string | ((state: SelectGroupState) => string | undefined)">diff --git a/packages/twenty-docs/ui/primitives/input/select.mdx b/packages/twenty-docs/ui/primitives/input/select.mdxindex a7bf894561b..d260e092101 100644--- a/packages/twenty-docs/ui/primitives/input/select.mdx+++ b/packages/twenty-docs/ui/primitives/input/select.mdx@@ -7,7 +7,7 @@ import { StoryEmbed } from '/snippets/ui/StoryEmbed.mdx';import SelectReference from '/snippets/ui/generated/input/select.mdx';-Use `Select` for a form value chosen from a list. Use [Menu](/ui/primitives/surfaces/menu) for commands and actions.+Use `Select` for a form value chosen from a list. [Dropdown](/ui/components/navigation/dropdown) remains the main higher-level API for menus, pickers, panels, and pages that combine those workflows. Use [Menu](/ui/primitives/surfaces/menu) for primitive commands and actions.<StoryEmbedstoryId="ui-input-select--documentation"@@ -17,27 +17,51 @@ Use `Select` for a form value chosen from a list. Use [Menu](/ui/primitives/surf## Anatomy-Keep the trigger and popup inside the same `Select.Root`. Put option labels directly inside `Select.Item`.+Compose the public parts inside `Select.Root`. `Trigger` and `Item` render only their children. Add `Icon`, `ItemText`, and `ItemIndicator` explicitly when you want the default chevron, label, and checkmark.```textSelect.Root+├── Select.Label├── Select.Trigger-│ └── Select.Value-└── Select.Popup- └── Select.Item+│ ├── Select.Value+│ └── Select.Icon+└── Select.Portal+ ├── Select.Backdrop+ └── Select.Positioner+ └── Select.Popup+ ├── Select.Arrow+ ├── Select.ScrollUpArrow+ ├── Select.List+ │ ├── Select.Group+ │ │ ├── Select.GroupLabel+ │ │ └── Select.Item+ │ │ ├── Select.ItemText+ │ │ └── Select.ItemIndicator+ │ └── Select.Separator+ └── Select.ScrollDownArrow```-| Part | Requirement | Purpose |-| --------------------- | ----------------------------------- | ------------------------------------------------------------------------------------ |-| `Root` | Required | Owns selection, open state, and form integration. |-| `Trigger` | Required for a trigger-based select | Opens the list and displays its current value. |-| `Value` | Optional | Renders the selected label or a placeholder; you can provide custom trigger content. |-| `Popup` | Required for the option list | Renders the positioned, portaled list. |-| `Item` | One per option | Provides selection behavior and an option label. |-| `Group`, `GroupLabel` | Optional | Group related options under a label. |-| `Separator` | Optional | Separates groups visually. |--Twenty UI includes the chevron in `Trigger`, the option text and checkmark in `Item`, and the portal and positioner in `Popup`. Compose these public parts directly; placement and portal options belong on `Popup`.+| Part | Purpose |+| ---------------------------------- | ----------------------------------------------------------------------------- |+| `Root` | Owns selection, open state, generic values, and native form integration. |+| `Label` | Associates a visible label with the trigger. |+| `Trigger` | Opens the list and contains the displayed value. |+| `Value` | Renders the selected label or a placeholder. |+| `Icon` | Renders a default chevron or custom children in the trigger. |+| `Portal` | Moves popup content to the theme's portal container or an explicit container. |+| `Backdrop` | Provides an optional backdrop while the popup is open. |+| `Positioner` | Owns anchor geometry, placement, offsets, and collision behavior. |+| `Popup` | Renders the popup surface without adding a portal or positioner. |+| `List` | Provides a separate scrolling container for options. |+| `Item` | Provides selection behavior for one option. |+| `ItemText` | Identifies the option label used for typeahead and selected-value alignment. |+| `ItemIndicator` | Renders the selected option's default checkmark or custom children. |+| `Arrow` | Positions an optional arrow against the popup anchor. |+| `ScrollUpArrow`, `ScrollDownArrow` | Scroll a long list when hovered. |+| `Group`, `GroupLabel` | Group related options under a label. |+| `Separator` | Separates groups visually. |++`Portal`, `List`, `Backdrop`, arrows, and indicators are optional. Use `Positioner` around `Popup` for positioning, including when you render the popup inline without a portal.## Uncontrolled state@@ -56,14 +80,24 @@ export const PrioritySelect = () => (<Select.Root name="priority" defaultValue="normal" items={PRIORITIES}><Select.Trigger aria-label="Priority"><Select.Value placeholder="Choose a priority" />+ <Select.Icon /></Select.Trigger>- <Select.Popup>- {PRIORITIES.map(({ value, label }) => (- <Select.Item key={value} value={value}>- {label}- </Select.Item>- ))}- </Select.Popup>+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup>+ {PRIORITIES.map(({ value, label }) => (+ <Select.Item key={value} value={value}>+ <Select.ItemText>{label}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal></Select.Root>);```@@ -96,14 +130,24 @@ export const PrioritySelect = () => {><Select.Trigger aria-label="Priority"><Select.Value placeholder="Choose a priority" />+ <Select.Icon /></Select.Trigger>- <Select.Popup>- {PRIORITIES.map(({ value, label }) => (- <Select.Item key={value} value={value}>- {label}- </Select.Item>- ))}- </Select.Popup>+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup>+ {PRIORITIES.map(({ value, label }) => (+ <Select.Item key={value} value={value}>+ <Select.ItemText>{label}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal></Select.Root>);};@@ -133,14 +177,24 @@ export const LanguageSelect = () => {><Select.Trigger aria-label="Languages"><Select.Value placeholder="Choose languages" />+ <Select.Icon /></Select.Trigger>- <Select.Popup>- {LANGUAGES.map(({ value, label }) => (- <Select.Item key={value} value={value}>- {label}- </Select.Item>- ))}- </Select.Popup>+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup>+ {LANGUAGES.map(({ value, label }) => (+ <Select.Item key={value} value={value}>+ <Select.ItemText>{label}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal></Select.Root>);};@@ -177,14 +231,24 @@ export const PrioritySelect = () => {><Select.Trigger aria-label="Priority"><Select.Value placeholder="Choose a priority" />+ <Select.Icon /></Select.Trigger>- <Select.Popup>- {PRIORITIES.map(({ value, label }) => (- <Select.Item key={value} value={value}>- {label}- </Select.Item>- ))}- </Select.Popup>+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup>+ {PRIORITIES.map(({ value, label }) => (+ <Select.Item key={value} value={value}>+ <Select.ItemText>{label}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal></Select.Root>);};@@ -209,14 +273,24 @@ export const PriorityField = () => (<Select.Root name="priority" defaultValue="normal" items={PRIORITIES}><Select.Trigger><Select.Value />+ <Select.Icon /></Select.Trigger>- <Select.Popup>- {PRIORITIES.map(({ value, label }) => (- <Select.Item key={value} value={value}>- {label}- </Select.Item>- ))}- </Select.Popup>+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup>+ {PRIORITIES.map(({ value, label }) => (+ <Select.Item key={value} value={value}>+ <Select.ItemText>{label}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal></Select.Root><Field.Description>Choose how soon this record needs attention.@@ -225,13 +299,177 @@ export const PriorityField = () => ();```-## Placement and keyboard+## Item composition++Compose arbitrary content inside `Item`. Put the searchable label in `ItemText`; additional content does not become its typeahead label. Provide children to `Icon` or `ItemIndicator` to replace their default icons, or omit those parts altogether.++```tsx+import { Select } from 'twenty-ui/primitives/input';++export const PrioritySelect = () => (+ <Select.Root defaultValue="high" items={{ high: 'High' }}>+ <Select.Trigger aria-label="Priority">+ <Select.Value />+ <Select.Icon />+ </Select.Trigger>+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup>+ <Select.Item value="high">+ <Select.ItemText>High</Select.ItemText>+ <span>Needs attention today</span>+ <Select.ItemIndicator />+ </Select.Item>+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal>+ </Select.Root>+);+```++All parts that render elements accept native attributes, refs, and Base UI's `render`, `className`, and `style` composition APIs. For example, use `render={<Button />}` on `Trigger` to compose it with a Twenty UI button. For a non-button render element, also set `nativeButton={false}`.++## Placement++Set `size="sm"` or `size="md"` on `Trigger`. Placement belongs on `Positioner`; portal destination belongs on `Portal`.++`Positioner` preserves Base UI's defaults: `side="bottom"`, `align="center"`, `sideOffset={0}`, and `alignItemWithTrigger={true}`. Selected-item alignment applies to pointer input when there is enough space. Set `alignItemWithTrigger={false}` to use anchored positioning consistently. The examples above choose `align="start"` and `sideOffset={8}` explicitly.++```tsx+import { useRef, useState } from 'react';+import { Button, Select } from 'twenty-ui/primitives/input';++const PRIORITIES = [+ { value: 'low', label: 'Low' },+ { value: 'normal', label: 'Normal' },+ { value: 'high', label: 'High' },+];++export const PositionedPrioritySelect = () => {+ const anchorRef = useRef<HTMLButtonElement>(null);+ const boundaryRef = useRef<HTMLDivElement>(null);+ const [portalContainer, setPortalContainer] = useState<HTMLDivElement | null>(+ null,+ );++ return (+ <div ref={boundaryRef}>+ <Button ref={anchorRef}>Position anchor</Button>+ <Select.Root defaultValue="normal" items={PRIORITIES}>+ <Select.Trigger aria-label="Priority">+ <Select.Value />+ <Select.Icon />+ </Select.Trigger>+ <Select.Portal container={portalContainer}>+ <Select.Positioner+ anchor={anchorRef}+ positionMethod="fixed"+ side="inline-end"+ align="start"+ alignItemWithTrigger={false}+ sideOffset={({ anchor }) => anchor.width / 4}+ alignOffset={4}+ collisionBoundary={boundaryRef.current ?? undefined}+ collisionPadding={12}+ collisionAvoidance={{ side: 'flip', align: 'shift' }}+ sticky+ >+ <Select.Popup>+ <Select.Arrow />+ <Select.List>+ {PRIORITIES.map(({ value, label }) => (+ <Select.Item key={value} value={value}>+ <Select.ItemText>{label}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.List>+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal>+ </Select.Root>+ <div ref={setPortalContainer} />+ </div>+ );+};+```++`Positioner` also supports virtual anchors, offset functions, `arrowPadding`, and `disableAnchorTracking`. `Portal` uses the [theme's portal container](/ui/theming#scope-an-override) unless you provide `container`. An explicit `container={null}` waits until that container is available.++<StoryEmbed+ storyId="ui-input-select-portals--positioning-documentation"+ title="Select with a custom anchor and scrollable list"+ height={440}+/>++## Native forms and callback details++Set `name` on `Root` to include the selected value in `FormData`. Multiple selection submits one entry per selected value. `form` associates the hidden input with an external form, and `inputRef` gives access to that input. `required`, `disabled`, and `autoComplete` retain Base UI's native form behavior.++`onValueChange` and `onOpenChange` receive the next state and upstream event details, including `reason`, the native `event`, `cancel()`, and `allowPropagation()`. Calling `cancel()` prevents the corresponding internal state change. Controlled roots still require you to update `value` or `open`.++```tsx+import { useState } from 'react';+import { Select } from 'twenty-ui/primitives/input';++const PRIORITIES = [+ { value: 'normal', label: 'Normal' },+ { value: 'high', label: 'High' },+];++type PrioritySelectProps = { canSetHighPriority: boolean };++export const PrioritySelect = ({ canSetHighPriority }: PrioritySelectProps) => {+ const [priority, setPriority] = useState<string | null>('normal');++ return (+ <Select.Root+ items={PRIORITIES}+ value={priority}+ onValueChange={(nextPriority, details) => {+ if (nextPriority === 'high' && !canSetHighPriority) {+ details.cancel();+ return;+ }+ setPriority(nextPriority);+ }}+ >+ <Select.Trigger aria-label="Priority">+ <Select.Value />+ <Select.Icon />+ </Select.Trigger>+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup>+ {PRIORITIES.map(({ value, label }) => (+ <Select.Item key={value} value={value}>+ <Select.ItemText>{label}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal>+ </Select.Root>+ );+};+```++The generic root types represent the option value and whether multiple selection is enabled. Object values support `itemToStringLabel`, `itemToStringValue`, and `isItemEqualToValue`. Use `null` for an empty single selection and an empty array for an empty multiple selection.-Set `size="sm"` or `size="md"` on `Trigger`. Customize option content with `Item.startIcon`, `Item.endIcon`, and `Item.description` while keeping the option's label in its children.+## Keyboard-`Popup` defaults to `side="bottom"`, `align="start"`, and `sideOffset={8}`. Set `alignItemWithTrigger` to align the selected option over the trigger. It uses the [theme's portal container](/ui/theming#scope-an-override) unless you provide `container`.+Keyboard users can open the list from the trigger, navigate options with arrow keys, and type to find an option. Home and End jump to the first and last options. Enter selects an option; Escape dismisses the popup and restores trigger focus. Multiple selection keeps the popup open while options are toggled.-Keyboard users can open the list from the trigger, navigate options with arrow keys, and type to find an option. Escape dismisses the popup. Label the trigger or integrate the select with [Field](/ui/primitives/input/field); a placeholder alone does not name the control.+Label the trigger with `Select.Label`, an accessible name, or [Field](/ui/primitives/input/field). A placeholder alone does not name the control.## Propsdiff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-select.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-select.front-component.tsxindex 5eb98809d84..4287fdf6e09 100644--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-select.front-component.tsx+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-select.front-component.tsx@@ -1,35 +1,137 @@-import { useState } from 'react';+import { useRef, useState } from 'react';import { defineFrontComponent } from 'twenty-sdk/define';-import { Select } from 'twenty-ui/primitives/input';+import {+ Button,+ Field,+ Select,+ type SelectRootChangeEventReason,+} from 'twenty-ui/primitives/input';+import { Text } from 'twenty-ui/primitives/typography';import { TwentyUiGalleryCard } from '@/__stories__/shared/front-components/twenty-ui-gallery-card';const SelectExample = () => {const [value, setValue] = useState<string | null>('new');+ const [changes, setChanges] = useState(0);+ const [reason, setReason] = useState<SelectRootChangeEventReason>('none');+ const [eventType, setEventType] = useState('none');+ const [referenceTargets, setReferenceTargets] = useState('unread');+ const [segments, setSegments] = useState(['priority']);+ const triggerRef = useRef<HTMLButtonElement>(null);+ const inputRef = useRef<HTMLInputElement>(null);+ const itemRef = useRef<HTMLElement>(null);return (<TwentyUiGalleryCard title="Select">- <Select.Root- value={value}- onValueChange={setValue}- items={{ new: 'New', qualified: 'Qualified', archived: 'Archived' }}- >- <Select.Trigger aria-label="Account stage">- <Select.Value />- </Select.Trigger>- <Select.Popup>- <Select.Group>- <Select.GroupLabel>Active stages</Select.GroupLabel>- <Select.Item value="new">New</Select.Item>- <Select.Item value="qualified">Qualified</Select.Item>- </Select.Group>- <Select.Separator />- <Select.Item value="archived" disabled>- Archived- </Select.Item>- </Select.Popup>- </Select.Root>- <p role="status">Stage: {value}</p>+ <form aria-label="Account classification">+ <Field.Root>+ <Field.Label>Account stage</Field.Label>+ <Select.Root+ name="stage"+ inputRef={inputRef}+ value={value}+ onValueChange={(nextValue, details) => {+ setValue(nextValue);+ setChanges((count) => count + 1);+ setReason(details.reason);+ setEventType(details.event.type);+ setReferenceTargets(+ `${triggerRef.current?.getAttribute('data-native-trigger') ?? 'missing'}/${inputRef.current?.name ?? 'missing'}/${itemRef.current?.getAttribute('data-native-item') ?? 'missing'}`,+ );+ }}+ items={{ new: 'New', qualified: 'Qualified', archived: 'Archived' }}+ >+ <Select.Trigger+ ref={triggerRef}+ data-native-trigger="stage"+ render={<Button variant="outline" />}+ >+ <Select.Value placeholder="Choose a stage" />+ <Select.Icon />+ </Select.Trigger>+ <Select.Portal data-select-portal="stage">+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ positionMethod="fixed"+ collisionAvoidance={{ side: 'flip', align: 'shift' }}+ data-select-positioner="stage"+ >+ <Select.Popup>+ <Select.List render={<ul />}>+ <Select.Group>+ <Select.GroupLabel>Active stages</Select.GroupLabel>+ <Select.Item+ value="new"+ nativeButton+ render={<Button variant="ghost" />}+ >+ <Select.ItemText>New</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ <Select.Item+ ref={itemRef}+ value="qualified"+ data-native-item="qualified"+ render={<li />}+ >+ <Select.ItemText>Qualified</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ </Select.Group>+ <Select.Separator />+ <Select.Item value="archived" disabled render={<li />}>+ <Select.ItemText>Archived</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ </Select.List>+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal>+ </Select.Root>+ </Field.Root>+ <Select.Root+ name="segments"+ multiple+ defaultValue={['priority']}+ items={{ priority: 'Priority', renewal: 'Renewal' }}+ onValueChange={setSegments}+ >+ <Select.Trigger aria-label="Account segments">+ <Select.Value placeholder="Choose segments" />+ <Select.Icon />+ </Select.Trigger>+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup>+ <Select.List>+ <Select.Item value="priority">+ <Select.ItemText>Priority</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ <Select.Item value="renewal">+ <Select.ItemText>Renewal</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ </Select.List>+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal>+ </Select.Root>+ <Button onClick={() => setValue(null)}>Clear stage</Button>+ <Text role="status" aria-label="Stage selection">+ Stage: {value ?? 'empty'}; Changes: {changes}; Reason: {reason};+ Event: {eventType}; Refs: {referenceTargets}+ </Text>+ <Text role="status" aria-label="Segment selection">+ Segments: {segments.join(', ') || 'empty'}+ </Text>+ </form></TwentyUiGalleryCard>);};@@ -37,6 +139,7 @@ const SelectExample = () => {export default defineFrontComponent({universalIdentifier: '4d23e9af-7cb3-4e4a-bbca-8e960f840007',name: 'twenty-ui-select',- description: 'Select controlled value and portal options in the sandbox',+ description:+ 'Select public parts, selection callbacks and native forms in the sandbox',component: SelectExample,});diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/selectTest.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/selectTest.tsindex 9e7500c00c4..b71f037c01f 100644--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/selectTest.ts+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/selectTest.ts@@ -1,6 +1,105 @@-import { createOverlayOpenTest } from '@/__stories__/twenty-ui-gallery/utils/createOverlayOpenTest';+import { expect, userEvent, waitFor, within } from 'storybook/test';-export const selectTest = createOverlayOpenTest({- trigger: { role: 'combobox', name: 'Account stage' },- popupText: 'Qualified',-});+import { errorHandler } from '@/__stories__/shared/test-utils/createFrontComponentStoryMeta';+import { expectFrontComponentMounted } from '@/__stories__/shared/test-utils/matchers/expectFrontComponentMounted';+import { waitForSandboxRoundTrip } from '@/__stories__/shared/test-utils/waitForSandboxRoundTrip';+import { type TwentyUiGalleryPlayFunction } from '@/__stories__/twenty-ui-gallery/types/TwentyUiGalleryPlayFunction';++export const selectTest: TwentyUiGalleryPlayFunction = async ({+ canvasElement,+}) => {+ const canvas = within(canvasElement);+ const page = within(canvasElement.ownerDocument.body);+ await expectFrontComponentMounted(canvas);++ const trigger = canvas.getByRole('combobox', { name: 'Account stage' });+ const status = canvas.getByRole('status', { name: 'Stage selection' });+ const form = canvas.getByRole<HTMLFormElement>('form', {+ name: 'Account classification',+ });++ expect(trigger.tagName).toBe('BUTTON');+ expect(trigger).toHaveAttribute('data-native-trigger', 'stage');+ expect(trigger).toHaveTextContent('New');+ expect(trigger).toHaveAttribute('aria-expanded', 'false');+ expect(new FormData(form).get('stage')).toBe('new');+ expect(new FormData(form).getAll('segments')).toEqual(['priority']);++ await userEvent.click(trigger);+ const qualified = await page.findByRole('option', { name: 'Qualified' });+ const archived = page.getByRole('option', { name: 'Archived' });+ await waitFor(() => expect(qualified).toBeVisible());+ expect(qualified.tagName).toBe('LI');+ expect(archived).toHaveAttribute('aria-disabled', 'true');+ expect(qualified.closest('[data-select-positioner="stage"]')).toHaveStyle({+ position: 'fixed',+ });++ await userEvent.click(archived);+ await waitForSandboxRoundTrip();+ expect(status).toHaveTextContent('Stage: new; Changes: 0; Reason: none');+ expect(trigger).toHaveAttribute('aria-expanded', 'true');++ await userEvent.click(qualified);+ await waitFor(() => {+ expect(status).toHaveTextContent(+ 'Stage: qualified; Changes: 1; Reason: item-press; Event: click; Refs: stage/stage/qualified',+ );+ expect(trigger).toHaveAttribute('aria-expanded', 'false');+ });+ expect(trigger).toHaveTextContent('Qualified');+ expect(new FormData(form).get('stage')).toBe('qualified');++ await userEvent.click(canvas.getByRole('button', { name: 'Clear stage' }));+ await waitFor(() => expect(trigger).toHaveTextContent('Choose a stage'));+ expect(status).toHaveTextContent('Stage: empty; Changes: 1');+ expect(new FormData(form).get('stage')).toBe('');++ await userEvent.click(trigger);+ const newStage = await page.findByRole('option', { name: 'New' });+ await waitFor(() => expect(newStage).toBeVisible());+ expect(newStage.tagName).toBe('BUTTON');+ await userEvent.keyboard('q');+ await waitFor(() =>+ expect(page.getByRole('option', { name: 'Qualified' })).toHaveFocus(),+ );+ await userEvent.keyboard('{Home}');+ await waitFor(() => expect(newStage).toHaveFocus());+ await userEvent.keyboard('{Enter}');+ await waitFor(() => {+ expect(status).toHaveTextContent(+ 'Stage: new; Changes: 2; Reason: item-press; Event: click',+ );+ expect(trigger).toHaveAttribute('aria-expanded', 'false');+ });+ expect(new FormData(form).get('stage')).toBe('new');++ const segmentsTrigger = canvas.getByRole('combobox', {+ name: 'Account segments',+ });+ await userEvent.click(segmentsTrigger);+ await userEvent.click(await page.findByRole('option', { name: 'Renewal' }));+ const segmentsStatus = canvas.getByRole('status', {+ name: 'Segment selection',+ });+ await waitFor(() =>+ expect(segmentsStatus).toHaveTextContent('Segments: priority, renewal'),+ );+ expect(segmentsTrigger).toHaveAttribute('aria-expanded', 'true');+ expect(segmentsTrigger).toHaveTextContent('Priority');+ expect(segmentsTrigger).toHaveTextContent('Renewal');+ expect(new FormData(form).getAll('segments')).toEqual([+ 'priority',+ 'renewal',+ ]);+ await userEvent.click(page.getByRole('option', { name: 'Priority' }));+ await waitFor(() =>+ expect(segmentsStatus).toHaveTextContent('Segments: renewal'),+ );+ expect(new FormData(form).getAll('segments')).toEqual(['renewal']);+ await userEvent.click(segmentsTrigger);+ await waitFor(() =>+ expect(segmentsTrigger).toHaveAttribute('aria-expanded', 'false'),+ );+ expect(errorHandler).not.toHaveBeenCalled();+};diff --git a/packages/twenty-ui/docs/components.ts b/packages/twenty-ui/docs/components.tsindex cd1d17a9ba7..52a22340b2c 100644--- a/packages/twenty-ui/docs/components.ts+++ b/packages/twenty-ui/docs/components.ts@@ -1,3 +1,4 @@+import { SELECT_PART_PROP_DESCRIPTIONS } from './selectPartPropDescriptions';import { CHECKBOX_PROP_DESCRIPTIONS } from './checkboxPropDescriptions';import { SWITCH_PROP_DESCRIPTIONS } from './switchPropDescriptions';import { TEXTAREA_PROP_DESCRIPTIONS } from './textareaPropDescriptions';@@ -435,6 +436,8 @@ export const DOCUMENTED_COMPONENTS = [source: 'primitives/input/Select/Select.tsx',entryPoint: 'twenty-ui/primitives/input',slug: 'input/select',+ partPropDescriptions: SELECT_PART_PROP_DESCRIPTIONS,+ partPropDefaults: { Trigger: { size: 'md' } },},{name: 'Slider',diff --git a/packages/twenty-ui/docs/public-exports.json b/packages/twenty-ui/docs/public-exports.jsonindex c103a54a704..f4dddc9d46f 100644--- a/packages/twenty-ui/docs/public-exports.json+++ b/packages/twenty-ui/docs/public-exports.json@@ -852,15 +852,48 @@"RadioProps": "primitives/input/Radio/types/RadioProps","SegmentedControlOption": "primitives/input/SegmentedControl/types/SegmentedControlOption","SegmentedControlProps": "primitives/input/SegmentedControl/types/SegmentedControlProps",+ "SelectArrowProps": "primitives/input/Select/types/SelectArrowProps",+ "SelectArrowState": "primitives/input/Select/types/SelectArrowState",+ "SelectBackdropProps": "primitives/input/Select/types/SelectBackdropProps",+ "SelectBackdropState": "primitives/input/Select/types/SelectBackdropState","SelectGroupLabelProps": "primitives/input/Select/types/SelectGroupLabelProps",+ "SelectGroupLabelState": "primitives/input/Select/types/SelectGroupLabelState","SelectGroupProps": "primitives/input/Select/types/SelectGroupProps",+ "SelectGroupState": "primitives/input/Select/types/SelectGroupState",+ "SelectIconProps": "primitives/input/Select/types/SelectIconProps",+ "SelectIconState": "primitives/input/Select/types/SelectIconState",+ "SelectItemIndicatorProps": "primitives/input/Select/types/SelectItemIndicatorProps",+ "SelectItemIndicatorState": "primitives/input/Select/types/SelectItemIndicatorState","SelectItemProps": "primitives/input/Select/types/SelectItemProps",+ "SelectItemState": "primitives/input/Select/types/SelectItemState",+ "SelectItemTextProps": "primitives/input/Select/types/SelectItemTextProps",+ "SelectItemTextState": "primitives/input/Select/types/SelectItemTextState",+ "SelectLabelProps": "primitives/input/Select/types/SelectLabelProps",+ "SelectLabelState": "primitives/input/Select/types/SelectLabelState",+ "SelectListProps": "primitives/input/Select/types/SelectListProps",+ "SelectListState": "primitives/input/Select/types/SelectListState","SelectOption": "primitives/input/types/SelectOption","SelectPopupProps": "primitives/input/Select/types/SelectPopupProps",+ "SelectPopupState": "primitives/input/Select/types/SelectPopupState",+ "SelectPortalProps": "primitives/input/Select/types/SelectPortalProps",+ "SelectPortalState": "primitives/input/Select/types/SelectPortalState",+ "SelectPositionerProps": "primitives/input/Select/types/SelectPositionerProps",+ "SelectPositionerState": "primitives/input/Select/types/SelectPositionerState",+ "SelectRootActions": "primitives/input/Select/types/SelectRootActions",+ "SelectRootChangeEventDetails": "primitives/input/Select/types/SelectRootChangeEventDetails",+ "SelectRootChangeEventReason": "primitives/input/Select/types/SelectRootChangeEventReason","SelectRootProps": "primitives/input/Select/types/SelectRootProps",+ "SelectRootState": "primitives/input/Select/types/SelectRootState",+ "SelectScrollDownArrowProps": "primitives/input/Select/types/SelectScrollDownArrowProps",+ "SelectScrollDownArrowState": "primitives/input/Select/types/SelectScrollDownArrowState",+ "SelectScrollUpArrowProps": "primitives/input/Select/types/SelectScrollUpArrowProps",+ "SelectScrollUpArrowState": "primitives/input/Select/types/SelectScrollUpArrowState","SelectSeparatorProps": "primitives/input/Select/types/SelectSeparatorProps",+ "SelectSeparatorState": "primitives/input/Select/types/SelectSeparatorState","SelectTriggerProps": "primitives/input/Select/types/SelectTriggerProps",+ "SelectTriggerState": "primitives/input/Select/types/SelectTriggerState","SelectValueProps": "primitives/input/Select/types/SelectValueProps",+ "SelectValueState": "primitives/input/Select/types/SelectValueState","SliderControlProps": "primitives/input/Slider/types/SliderControlProps","SliderIndicatorProps": "primitives/input/Slider/types/SliderIndicatorProps","SliderLabelProps": "primitives/input/Slider/types/SliderLabelProps",diff --git a/packages/twenty-ui/docs/selectPartPropDescriptions.ts b/packages/twenty-ui/docs/selectPartPropDescriptions.tsnew file mode 100644index 00000000000..b0b96247911--- /dev/null+++ b/packages/twenty-ui/docs/selectPartPropDescriptions.ts@@ -0,0 +1,45 @@+export const SELECT_PART_PROP_DESCRIPTIONS = {+ Root: {+ children:+ 'Select parts sharing selection, open state and accessible relationships. Root renders no DOM node.',+ onValueChange:+ 'Receives the requested generic value and unchanged Base UI event details, including reason, event and cancel(). Multiple selection receives an array; a cleared single value is null.',+ onOpenChange:+ 'Receives the requested open state and unchanged Base UI event details.',+ inputRef: 'Ref to the native hidden input used for form submission.',+ },+ Trigger: {+ children:+ 'Trigger content rendered as supplied. Compose Value and Icon explicitly.',+ ref: 'Ref to the rendered trigger element, a button by default.',+ size: 'Visual size of the trigger. Defaults to md.',+ },+ Portal: {+ container:+ 'Portal destination. Defaults to the current theme container, then the document body. Explicit null waits for a container before mounting.',+ ref: 'Ref to the portal div. Native props and render apply to this element.',+ },+ Positioner: {+ ref: 'Ref to the positioning div. Native props, styles and render apply to this element.',+ alignItemWithTrigger:+ 'Uses the upstream selected-item alignment by default. Set false to use side, align and offsets without overlapping the trigger.',+ },+ Popup: {+ children:+ 'Popup content rendered as supplied. Compose inside Positioner and choose Portal separately.',+ ref: 'Ref to the popup div. Native props, styles and render apply to this element.',+ },+ Item: {+ children:+ 'Option content rendered as supplied. Compose ItemText and an optional ItemIndicator explicitly.',+ ref: 'Ref to the rendered option element. Native props and render apply to this element.',+ },+ Icon: {+ children:+ 'Trigger icon content. Defaults to the Twenty chevron; explicit children replace it.',+ },+ ItemIndicator: {+ children:+ 'Selected indicator content. Defaults to the Twenty check icon; explicit children replace it.',+ },+};diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.jsonindex 9b526d85ec3..96f3013a8a7 100644--- a/packages/twenty-ui/generated/components.docs.json+++ b/packages/twenty-ui/generated/components.docs.json@@ -4502,6 +4502,13 @@"defaultValue": null,"description": "Provides a hint to the browser for autofill."},+ {+ "name": "children",+ "type": "ReactNode",+ "required": false,+ "defaultValue": null,+ "description": "Select parts sharing selection, open state and accessible relationships. Root renders no DOM node."+ },{"name": "defaultOpen","type": "boolean",@@ -4549,7 +4556,7 @@"type": "Ref<HTMLInputElement>","required": false,"defaultValue": null,- "description": "A ref to access the hidden input element."+ "description": "Ref to the native hidden input used for form submission."},{"name": "isItemEqualToValue",@@ -4605,7 +4612,7 @@"type": "((open: boolean, eventDetails: SelectRootChangeEventDetails) => void)","required": false,"defaultValue": null,- "description": "Event handler called when the select popup is opened or closed."+ "description": "Receives the requested open state and unchanged Base UI event details."},{"name": "onOpenChangeComplete",@@ -4619,7 +4626,7 @@"type": "((value: SelectValueType<Value, Multiple> | (Multiple extends true ? never : null), eventDetails: SelectRootChangeEventDetails) => void)","required": false,"defaultValue": null,- "description": "Event handler called when the value of the select changes."+ "description": "Receives the requested generic value and unchanged Base UI event details, including reason, event and cancel(). Multiple selection receives an array; a cleared single value is null."},{"name": "open",@@ -4651,9 +4658,42 @@}]},+ {+ "name": "Label",+ "props": [+ {+ "name": "className",+ "type": "string | ((state: FieldRootState) => string | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, FieldRootState>",+ "required": false,+ "defaultValue": null,+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ },+ {+ "name": "style",+ "type": "CSSProperties | ((state: FieldRootState) => CSSProperties | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."+ }+ ]+ },{"name": "Trigger","props": [+ {+ "name": "children",+ "type": "ReactNode",+ "required": false,+ "defaultValue": null,+ "description": "Trigger content rendered as supplied. Compose Value and Icon explicitly."+ },{"name": "className","type": "string | ((state: SelectTriggerState) => string | undefined)",@@ -4675,6 +4715,13 @@"defaultValue": "true","description": "Whether the component renders a native `<button>` element when replacing it\nvia the `render` prop.\nSet to `false` if the rendered element is not a button (for example, `<div>`)."},+ {+ "name": "ref",+ "type": "Ref<HTMLButtonElement>",+ "required": false,+ "defaultValue": null,+ "description": "Ref to the rendered trigger element, a button by default."+ },{"name": "render","type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectTriggerState>",@@ -4687,7 +4734,7 @@"type": "\"md\" | \"sm\"","required": false,"defaultValue": "md",- "description": "Visual size of the trigger."+ "description": "Visual size of the trigger. Defaults to md."},{"name": "style",@@ -4739,21 +4786,120 @@]},{- "name": "Popup",+ "name": "Icon",+ "props": [+ {+ "name": "children",+ "type": "ReactNode",+ "required": false,+ "defaultValue": "<IconChevronDown />",+ "description": "Trigger icon content. Defaults to the Twenty chevron; explicit children replace it."+ },+ {+ "name": "className",+ "type": "string | ((state: SelectIconState) => string | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectIconState>",+ "required": false,+ "defaultValue": null,+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ },+ {+ "name": "style",+ "type": "CSSProperties | ((state: SelectIconState) => CSSProperties | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."+ }+ ]+ },+ {+ "name": "Portal",+ "props": [+ {+ "name": "className",+ "type": "string | ((state: SelectPortalState) => string | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."+ },+ {+ "name": "container",+ "type": "HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null",+ "required": false,+ "defaultValue": null,+ "description": "Portal destination. Defaults to the current theme container, then the document body. Explicit null waits for a container before mounting."+ },+ {+ "name": "ref",+ "type": "Ref<HTMLDivElement>",+ "required": false,+ "defaultValue": null,+ "description": "Ref to the portal div. Native props and render apply to this element."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectPortalState>",+ "required": false,+ "defaultValue": null,+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ },+ {+ "name": "style",+ "type": "CSSProperties | ((state: SelectPortalState) => CSSProperties | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."+ }+ ]+ },+ {+ "name": "Backdrop",+ "props": [+ {+ "name": "className",+ "type": "string | ((state: SelectBackdropState) => string | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectBackdropState>",+ "required": false,+ "defaultValue": null,+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ },+ {+ "name": "style",+ "type": "CSSProperties | ((state: SelectBackdropState) => CSSProperties | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."+ }+ ]+ },+ {+ "name": "Positioner","props": [{"name": "align","type": "\"center\" | \"end\" | \"start\"","required": false,- "defaultValue": "start",+ "defaultValue": "center","description": "How to align the popup relative to the specified side."},{"name": "alignItemWithTrigger","type": "boolean","required": false,- "defaultValue": "false",- "description": "Whether the positioner overlaps the trigger so the selected item's text is aligned with the trigger's value text. This only applies to mouse input and is automatically disabled if there is not enough space."+ "defaultValue": "true",+ "description": "Uses the upstream selected-item alignment by default. Set false to use side, align and offsets without overlapping the trigger."},{"name": "alignOffset",@@ -4769,30 +4915,65 @@"defaultValue": null,"description": "An element to position the popup against.\nBy default, the popup will be positioned against the trigger."},+ {+ "name": "arrowPadding",+ "type": "number",+ "required": false,+ "defaultValue": "5",+ "description": "Minimum distance to maintain between the arrow and the edges of the popup.\n\nUse it to prevent the arrow element from hanging out of the rounded corners of a popup."+ },{"name": "className",- "type": "string | ((state: SelectPopupState) => string | undefined)",+ "type": "string | ((state: SelectPositionerState) => string | undefined)","required": false,"defaultValue": null,"description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."},{- "name": "container",- "type": "HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null",+ "name": "collisionAvoidance",+ "type": "CollisionAvoidance","required": false,"defaultValue": null,- "description": "Element the popup is portaled into. Defaults to the theme's portal\ncontainer."+ "description": "Determines how to handle collisions when positioning the popup.\n\n`side` controls overflow on the preferred placement axis (`top`/`bottom` or `left`/`right`):\n- `'flip'`: keep the requested side when it fits; otherwise try the opposite side\n (`top` and `bottom`, or `left` and `right`).\n- `'shift'`: never change side; keep the requested side and move the popup within\n the clipping boundary so it stays visible.\n- `'none'`: do not correct side-axis overflow.\n\n`align` controls overflow on the alignment axis (`start`/`center`/`end`):\n- `'flip'`: keep side, but swap `start` and `end` when the requested alignment overflows.\n- `'shift'`: keep side and requested alignment, then nudge the popup along the\n alignment axis to fit.\n- `'none'`: do not correct alignment-axis overflow.\n\n`fallbackAxisSide` controls fallback behavior on the perpendicular axis when the\npreferred axis cannot fit:\n- `'start'`: allow perpendicular fallback and try the logical start side first\n (`top` before `bottom`, or `left` before `right` in LTR).\n- `'end'`: allow perpendicular fallback and try the logical end side first\n (`bottom` before `top`, or `right` before `left` in LTR).\n- `'none'`: do not fallback to the perpendicular axis.\n\nWhen `side` is `'shift'`, explicitly setting `align` only supports `'shift'` or `'none'`.\nIf `align` is omitted, it defaults to `'flip'`."},{- "name": "finalFocus",- "type": "boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | void | HTMLElement | null)",+ "name": "collisionBoundary",+ "type": "Boundary",+ "required": false,+ "defaultValue": "clipping-ancestors",+ "description": "An element or a rectangle that delimits the area that the popup is confined to."+ },+ {+ "name": "collisionPadding",+ "type": "Padding",+ "required": false,+ "defaultValue": "5",+ "description": "Additional space to maintain from the edge of the collision boundary."+ },+ {+ "name": "disableAnchorTracking",+ "type": "boolean",+ "required": false,+ "defaultValue": "false",+ "description": "Whether to disable the popup from tracking any layout shift of its positioning anchor."+ },+ {+ "name": "positionMethod",+ "type": "\"absolute\" | \"fixed\"",+ "required": false,+ "defaultValue": "absolute",+ "description": "Determines which CSS `position` property to use."+ },+ {+ "name": "ref",+ "type": "Ref<HTMLDivElement>","required": false,"defaultValue": null,- "description": "Determines the element to focus when the select popup is closed.\n\n- `false`: Do not move focus.\n- `true`: Move focus based on the default behavior (trigger or previously focused element).\n- `RefObject`: Move focus to the ref element.\n- `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).\n Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing."+ "description": "Ref to the positioning div. Native props, styles and render apply to this element."},{"name": "render",- "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectPopupState>",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectPositionerState>","required": false,"defaultValue": null,"description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."@@ -4808,9 +4989,63 @@"name": "sideOffset","type": "number | OffsetFunction","required": false,- "defaultValue": "8",+ "defaultValue": "0","description": "Distance between the anchor and the popup in pixels.\nAlso accepts a function that returns the distance to read the dimensions of the anchor\nand positioner elements, along with its side and alignment.\n\nThe function takes a `data` object parameter with the following properties:\n- `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.\n- `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.\n- `data.side`: which side of the anchor element the positioner is aligned against.\n- `data.align`: how the positioner is aligned relative to the specified side."},+ {+ "name": "sticky",+ "type": "boolean",+ "required": false,+ "defaultValue": "false",+ "description": "Whether to maintain the popup in the viewport after\nthe anchor element was scrolled out of view."+ },+ {+ "name": "style",+ "type": "CSSProperties | ((state: SelectPositionerState) => CSSProperties | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."+ }+ ]+ },+ {+ "name": "Popup",+ "props": [+ {+ "name": "children",+ "type": "ReactNode",+ "required": false,+ "defaultValue": null,+ "description": "Popup content rendered as supplied. Compose inside Positioner and choose Portal separately."+ },+ {+ "name": "className",+ "type": "string | ((state: SelectPopupState) => string | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."+ },+ {+ "name": "finalFocus",+ "type": "boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | void | HTMLElement | null)",+ "required": false,+ "defaultValue": null,+ "description": "Determines the element to focus when the select popup is closed.\n\n- `false`: Do not move focus.\n- `true`: Move focus based on the default behavior (trigger or previously focused element).\n- `RefObject`: Move focus to the ref element.\n- `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).\n Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing."+ },+ {+ "name": "ref",+ "type": "Ref<HTMLDivElement>",+ "required": false,+ "defaultValue": null,+ "description": "Ref to the popup div. Native props, styles and render apply to this element."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectPopupState>",+ "required": false,+ "defaultValue": null,+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ },{"name": "style","type": "CSSProperties | ((state: SelectPopupState) => CSSProperties | undefined)",@@ -4821,28 +5056,47 @@]},{- "name": "Item",+ "name": "List","props": [{"name": "className",- "type": "string | ((state: SelectItemState) => string | undefined)",+ "type": "string | ((state: SelectListState) => string | undefined)","required": false,"defaultValue": null,"description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."},{- "name": "description",+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectListState>",+ "required": false,+ "defaultValue": null,+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ },+ {+ "name": "style",+ "type": "CSSProperties | ((state: SelectListState) => CSSProperties | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."+ }+ ]+ },+ {+ "name": "Item",+ "props": [+ {+ "name": "children","type": "ReactNode","required": false,"defaultValue": null,- "description": "Supporting text, placed according to `descriptionPlacement`."+ "description": "Option content rendered as supplied. Compose ItemText and an optional ItemIndicator explicitly."},{- "name": "descriptionPlacement",- "type": "\"end\" | \"inline\"",+ "name": "className",+ "type": "string | ((state: SelectItemState) => string | undefined)","required": false,- "defaultValue": "inline",- "description": "Where the description renders: inline after the content or at the end of\nthe row."+ "defaultValue": null,+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."},{"name": "disabled",@@ -4851,13 +5105,6 @@"defaultValue": "false","description": "Whether the component should ignore user interaction."},- {- "name": "endIcon",- "type": "ReactNode",- "required": false,- "defaultValue": null,- "description": "Icon rendered after the content."- },{"name": "label","type": "string",@@ -4873,18 +5120,18 @@"description": "Whether the component renders a native `<button>` element when replacing it\nvia the `render` prop.\nSet to `true` if the rendered element is a native button."},{- "name": "render",- "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectItemState>",+ "name": "ref",+ "type": "Ref<HTMLElement>","required": false,"defaultValue": null,- "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ "description": "Ref to the rendered option element. Native props and render apply to this element."},{- "name": "startIcon",- "type": "ReactNode",+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectItemState>","required": false,"defaultValue": null,- "description": "Icon rendered before the content."+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."},{"name": "style",@@ -4902,6 +5149,164 @@}]},+ {+ "name": "ItemIndicator",+ "props": [+ {+ "name": "children",+ "type": "ReactNode",+ "required": false,+ "defaultValue": "<IconCheck className={listItemStyles.checkIndicator} />",+ "description": "Selected indicator content. Defaults to the Twenty check icon; explicit children replace it."+ },+ {+ "name": "className",+ "type": "string | ((state: SelectItemIndicatorState) => string | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."+ },+ {+ "name": "keepMounted",+ "type": "boolean",+ "required": false,+ "defaultValue": null,+ "description": "Whether to keep the HTML element in the DOM when the item is not selected."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectItemIndicatorState>",+ "required": false,+ "defaultValue": null,+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ },+ {+ "name": "style",+ "type": "CSSProperties | ((state: SelectItemIndicatorState) => CSSProperties | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."+ }+ ]+ },+ {+ "name": "ItemText",+ "props": [+ {+ "name": "className",+ "type": "string | ((state: SelectItemTextState) => string | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectItemTextState>",+ "required": false,+ "defaultValue": null,+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ },+ {+ "name": "style",+ "type": "CSSProperties | ((state: SelectItemTextState) => CSSProperties | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."+ }+ ]+ },+ {+ "name": "Arrow",+ "props": [+ {+ "name": "className",+ "type": "string | ((state: SelectArrowState) => string | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectArrowState>",+ "required": false,+ "defaultValue": null,+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ },+ {+ "name": "style",+ "type": "CSSProperties | ((state: SelectArrowState) => CSSProperties | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."+ }+ ]+ },+ {+ "name": "ScrollDownArrow",+ "props": [+ {+ "name": "className",+ "type": "string | ((state: SelectScrollDownArrowState) => string | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."+ },+ {+ "name": "keepMounted",+ "type": "boolean",+ "required": false,+ "defaultValue": "false",+ "description": "Whether to keep the HTML element in the DOM while the select popup is not scrollable."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectScrollDownArrowState>",+ "required": false,+ "defaultValue": null,+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ },+ {+ "name": "style",+ "type": "CSSProperties | ((state: SelectScrollDownArrowState) => CSSProperties | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."+ }+ ]+ },+ {+ "name": "ScrollUpArrow",+ "props": [+ {+ "name": "className",+ "type": "string | ((state: SelectScrollUpArrowState) => string | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."+ },+ {+ "name": "keepMounted",+ "type": "boolean",+ "required": false,+ "defaultValue": "false",+ "description": "Whether to keep the HTML element in the DOM while the select popup is not scrollable."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectScrollUpArrowState>",+ "required": false,+ "defaultValue": null,+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ },+ {+ "name": "style",+ "type": "CSSProperties | ((state: SelectScrollUpArrowState) => CSSProperties | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."+ }+ ]+ },{"name": "Group","props": [diff --git a/packages/twenty-ui/src/primitives/input/Select/Select.tsx b/packages/twenty-ui/src/primitives/input/Select/Select.tsxindex 2a098176dbb..abdd025a7c0 100644--- a/packages/twenty-ui/src/primitives/input/Select/Select.tsx+++ b/packages/twenty-ui/src/primitives/input/Select/Select.tsx@@ -1,18 +1,34 @@import { Select as SelectPrimitive } from '@base-ui/react/select';import { SelectGroupLabel } from './internal/SelectGroupLabel';+import { SelectIcon } from './internal/SelectIcon';import { SelectItem } from './internal/SelectItem';+import { SelectItemIndicator } from './internal/SelectItemIndicator';+import { SelectItemText } from './internal/SelectItemText';import { SelectPopup } from './internal/SelectPopup';+import { SelectPortal } from './internal/SelectPortal';+import { SelectPositioner } from './internal/SelectPositioner';import { SelectSeparator } from './internal/SelectSeparator';import { SelectTrigger } from './internal/SelectTrigger';import { SelectValue } from './internal/SelectValue';const createSelect = () => ({Root: SelectPrimitive.Root,+ Label: SelectPrimitive.Label,Trigger: SelectTrigger,Value: SelectValue,+ Icon: SelectIcon,+ Portal: SelectPortal,+ Backdrop: SelectPrimitive.Backdrop,+ Positioner: SelectPositioner,Popup: SelectPopup,+ List: SelectPrimitive.List,Item: SelectItem,+ ItemIndicator: SelectItemIndicator,+ ItemText: SelectItemText,+ Arrow: SelectPrimitive.Arrow,+ ScrollDownArrow: SelectPrimitive.ScrollDownArrow,+ ScrollUpArrow: SelectPrimitive.ScrollUpArrow,Group: SelectPrimitive.Group,GroupLabel: SelectGroupLabel,Separator: SelectSeparator,diff --git a/packages/twenty-ui/src/primitives/input/Select/__stories__/Select.interactions.stories.tsx b/packages/twenty-ui/src/primitives/input/Select/__stories__/Select.interactions.stories.tsxindex e2096110d1a..4807e823bbb 100644--- a/packages/twenty-ui/src/primitives/input/Select/__stories__/Select.interactions.stories.tsx+++ b/packages/twenty-ui/src/primitives/input/Select/__stories__/Select.interactions.stories.tsx@@ -1,14 +1,16 @@import { type Meta, type StoryObj } from '@storybook/react-vite';-import { useState } from 'react';+import { createRef, useState } from 'react';import { expect, fn, userEvent, waitFor, within } from 'storybook/test';import { IconCheck } from '@ui/icon';+import { Button } from '@ui/primitives/input/Button/Button';import { Field } from '@ui/primitives/input/Field/Field';import { A11Y_DEFER_COLOR_CONTRAST, ComponentDecorator } from '@ui/testing';import { Select } from '../Select';import { type SelectRootProps } from '../types/SelectRootProps';-import { SelectExample, SELECT_ITEMS } from './SelectExample';+import { SelectExample } from './SelectExample';+import { SELECT_ITEMS } from './selectItems';import { waitForSelectPopup } from './waitForSelectPopup';const meta: Meta<typeof SelectExample> = {@@ -22,7 +24,7 @@ type Story = StoryObj<typeof SelectExample>;export const Keyboard: Story = {decorators: [ComponentDecorator],- args: { defaultValue: 'apple', onValueChange: fn() },+ args: { defaultValue: 'apple', onValueChange: fn(), onOpenChange: fn() },play: async ({ canvasElement, args }) => {const trigger = within(canvasElement).getByRole('combobox');await userEvent.tab();@@ -30,6 +32,8 @@ export const Keyboard: Story = {await userEvent.keyboard('{ArrowDown}');const popup = await waitForSelectPopup(canvasElement);const options = within(popup);+ await expect(args.onOpenChange).toHaveBeenCalledTimes(1);+ await expect(args.onValueChange).not.toHaveBeenCalled();await waitFor(() =>expect(options.getByRole('option', { name: 'Apple' })).toHaveFocus(),);@@ -50,31 +54,39 @@ export const Keyboard: Story = {await userEvent.keyboard('{Enter}');await waitFor(() => expect(popup).not.toBeVisible());await expect(trigger).toHaveTextContent('Cherry');+ await expect(args.onValueChange).toHaveBeenCalledTimes(1);+ await expect(args.onOpenChange).toHaveBeenCalledTimes(2);await expect(trigger).toHaveFocus();await userEvent.keyboard(' ');await waitForSelectPopup(canvasElement);+ await expect(args.onOpenChange).toHaveBeenCalledTimes(3);+ await expect(args.onValueChange).toHaveBeenCalledTimes(1);await userEvent.keyboard('{Escape}');await waitFor(() =>expect(trigger).toHaveAttribute('aria-expanded', 'false'),);await expect(trigger).toHaveTextContent('Cherry');await waitFor(() => expect(trigger).toHaveFocus());+ await expect(args.onOpenChange).toHaveBeenCalledTimes(4);+ await expect(args.onValueChange).toHaveBeenCalledTimes(1);},};export const DisabledItem: Story = {decorators: [ComponentDecorator],- args: { defaultValue: 'apple', onValueChange: fn() },+ args: { defaultValue: 'apple', onValueChange: fn(), onOpenChange: fn() },play: async ({ canvasElement, args }) => {const trigger = within(canvasElement).getByRole('combobox');await userEvent.click(trigger);const popup = await waitForSelectPopup(canvasElement);+ await expect(args.onOpenChange).toHaveBeenCalledTimes(1);const disabled = within(popup).getByRole('option', { name: 'Banana' });await expect(disabled).toHaveAttribute('aria-disabled', 'true');await userEvent.click(disabled);await expect(args.onValueChange).not.toHaveBeenCalled();await expect(trigger).toHaveTextContent('Apple');await expect(popup).toBeVisible();+ await expect(args.onOpenChange).toHaveBeenCalledTimes(1);},};@@ -99,20 +111,29 @@ export const Disabled: Story = {export const ReadOnly: Story = {decorators: [ComponentDecorator],- args: { readOnly: true, defaultValue: 'apple', onValueChange: fn() },+ args: {+ readOnly: true,+ defaultValue: 'apple',+ onValueChange: fn(),+ onOpenChange: fn(),+ },play: async ({ canvasElement, args }) => {const trigger = within(canvasElement).getByRole('combobox');await expect(trigger).toHaveAttribute('aria-readonly', 'true');await userEvent.click(trigger);const popup = await waitForSelectPopup(canvasElement);+ await expect(args.onOpenChange).toHaveBeenCalledTimes(1);await userEvent.click(within(popup).getByRole('option', { name: 'Cherry' }),);await userEvent.keyboard('{End}{Enter}');await expect(trigger).toHaveTextContent('Apple');await expect(args.onValueChange).not.toHaveBeenCalled();+ await expect(args.onOpenChange).toHaveBeenCalledTimes(1);await userEvent.keyboard('{Escape}');await waitFor(() => expect(popup).not.toBeVisible());+ await expect(args.onOpenChange).toHaveBeenCalledTimes(2);+ await expect(args.onValueChange).not.toHaveBeenCalled();},};@@ -122,9 +143,9 @@ const ControlledSelectExample = (props: SelectRootProps<string, boolean>) => {return (<><SelectExample {...props} value={value} modal={false} />- <button type="button" onClick={() => setValue('cherry')}>+ <Button type="button" onClick={() => setValue('cherry')}>Apply Cherry- </button>+ </Button></>);};@@ -140,9 +161,11 @@ export const ControlledValue: Story = {const trigger = canvas.getByRole('combobox');await userEvent.click(trigger);const popup = await waitForSelectPopup(canvasElement);+ await expect(args.onValueChange).not.toHaveBeenCalled();await userEvent.click(within(popup).getByRole('option', { name: 'Cherry' }),);+ await expect(args.onValueChange).toHaveBeenCalledTimes(1);await expect(args.onValueChange).toHaveBeenCalledWith('cherry',expect.anything(),@@ -151,6 +174,7 @@ export const ControlledValue: Story = {await expect(trigger).toHaveTextContent('Apple');await userEvent.click(canvas.getByRole('button', { name: 'Apply Cherry' }));await expect(trigger).toHaveTextContent('Cherry');+ await expect(args.onValueChange).toHaveBeenCalledTimes(1);},};@@ -158,17 +182,41 @@ const ControlledOpenExample = (props: SelectRootProps<string, boolean>) => {const [open, setOpen] = useState(true);return (- <>- <SelectExample- {...props}- defaultValue="apple"- open={open}- modal={false}- />- <button type="button" onClick={() => setOpen(false)}>- Apply closed state- </button>- </>+ <Select.Root+ {...props}+ items={SELECT_ITEMS}+ defaultValue="apple"+ open={open}+ modal={false}+ >+ <Select.Trigger aria-label="Fruit">+ <Select.Value placeholder="Choose a fruit" />+ <Select.Icon />+ </Select.Trigger>+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup>+ {SELECT_ITEMS.map(({ value, label }) => (+ <Select.Item+ key={value}+ value={value}+ disabled={value === 'banana'}+ >+ <Select.ItemText>{label}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.Popup>+ <Button type="button" onClick={() => setOpen(false)}>+ Apply closed state+ </Button>+ </Select.Positioner>+ </Select.Portal>+ </Select.Root>);};@@ -178,37 +226,53 @@ export const ControlledOpen: Story = {render: (args) => <ControlledOpenExample onOpenChange={args.onOpenChange} />,play: async ({ canvasElement, args }) => {const popup = await waitForSelectPopup(canvasElement);+ await expect(args.onOpenChange).not.toHaveBeenCalled();await userEvent.click(within(popup).getByRole('option', { name: 'Cherry' }),);+ await expect(args.onOpenChange).toHaveBeenCalledTimes(1);await expect(args.onOpenChange).toHaveBeenCalledWith(false,expect.anything(),);await expect(popup).toBeVisible();await userEvent.click(- within(canvasElement).getByRole('button', { name: 'Apply closed state' }),+ within(canvasElement.ownerDocument.body).getByRole('button', {+ name: 'Apply closed state',+ }),);await waitFor(() => expect(popup).not.toBeVisible());+ await expect(args.onOpenChange).toHaveBeenCalledTimes(1);},};export const MultipleKeyboard: Story = {decorators: [ComponentDecorator],- args: { multiple: true, defaultValue: ['apple'], onValueChange: fn() },+ args: {+ multiple: true,+ defaultValue: ['apple'],+ onValueChange: fn(),+ onOpenChange: fn(),+ },play: async ({ canvasElement, args }) => {await userEvent.tab();await userEvent.keyboard('{Enter}');const popup = await waitForSelectPopup(canvasElement);+ await expect(args.onValueChange).not.toHaveBeenCalled();+ await expect(args.onOpenChange).toHaveBeenCalledTimes(1);await userEvent.keyboard('{End} ');await expect(within(popup).getByRole('option', { name: 'Dragon fruit' }),).toHaveAttribute('aria-selected', 'true');+ await expect(args.onValueChange).toHaveBeenCalledTimes(1);+ await expect(args.onOpenChange).toHaveBeenCalledTimes(1);await expect(args.onValueChange).toHaveBeenLastCalledWith(['apple', 'dragon-fruit'],expect.anything(),);await userEvent.keyboard(' ');+ await expect(args.onValueChange).toHaveBeenCalledTimes(2);+ await expect(args.onOpenChange).toHaveBeenCalledTimes(1);await expect(args.onValueChange).toHaveBeenLastCalledWith(['apple'],expect.anything(),@@ -228,11 +292,26 @@ export const ObjectValues: Story = {><Select.Trigger aria-label="Owner"><Select.Value />+ <Select.Icon /></Select.Trigger>- <Select.Popup>- <Select.Item value={{ id: 1, name: 'Ada' }}>Ada</Select.Item>- <Select.Item value={{ id: 2, name: 'Grace' }}>Grace</Select.Item>- </Select.Popup>+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup>+ <Select.Item value={{ id: 1, name: 'Ada' }}>+ <Select.ItemText>Ada</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ <Select.Item value={{ id: 2, name: 'Grace' }}>+ <Select.ItemText>Grace</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal></Select.Root>),play: async ({ canvasElement }) => {@@ -273,18 +352,28 @@ const SelectFormExample = () => {><Select.Trigger><Select.Value />+ <Select.Icon /></Select.Trigger>- <Select.Popup>- {SELECT_ITEMS.map(({ value, label }) => (- <Select.Item key={value} value={value}>- {label}- </Select.Item>- ))}- </Select.Popup>+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup>+ {SELECT_ITEMS.map(({ value, label }) => (+ <Select.Item key={value} value={value}>+ <Select.ItemText>{label}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal></Select.Root><Field.Description>Choose fruit for delivery</Field.Description></Field.Root>- <button type="submit">Submit</button>+ <Button type="submit">Submit</Button><output aria-label="Submitted fruit">{submitted}</output></form>);@@ -320,33 +409,41 @@ export const PolymorphismAndState: Story = {<Select.Root items={SELECT_ITEMS} defaultValue="apple"><Select.Trigger aria-label="Fruit" nativeButton={false} render={<div />}><Select.Value />+ <Select.Icon /></Select.Trigger>- <Select.Popup- render={(props, state) => (- <ul {...props} data-open-state={state.open} />- )}- >- <Select.Item- value="apple"- render={<li />}- startIcon={<IconCheck />}- endIcon={<IconCheck />}- >- Apple- </Select.Item>- <Select.Item- value="cherry"- className={({ selected }) =>- selected ? 'selected-consumer' : 'consumer'- }- style={({ highlighted }) => ({ outlineOffset: highlighted ? 7 : 3 })}- render={(props, state) => (- <li {...props} data-selected-state={state.selected} />- )}+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}>- Cherry- </Select.Item>- </Select.Popup>+ <Select.Popup+ render={(props, state) => (+ <ul {...props} data-open-state={state.open} />+ )}+ >+ <Select.Item value="apple" render={<li />}>+ <Select.ItemText>Apple</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ <Select.Item+ value="cherry"+ className={({ selected }) =>+ selected ? 'selected-consumer' : 'consumer'+ }+ style={({ highlighted }) => ({+ outlineOffset: highlighted ? 7 : 3,+ })}+ render={(props, state) => (+ <li {...props} data-selected-state={state.selected} />+ )}+ >+ <Select.ItemText>Cherry</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal></Select.Root>),play: async ({ canvasElement }) => {@@ -374,31 +471,36 @@ export const PolymorphismAndState: Story = {},};-export const SlotsAndTypeahead: Story = {+export const ItemCompositionAndTypeahead: Story = {decorators: [ComponentDecorator],parameters: { a11y: A11Y_DEFER_COLOR_CONTRAST },render: () => (<Select.Root items={SELECT_ITEMS} defaultValue="cherry"><Select.Trigger aria-label="Fruit"><Select.Value />+ <Select.Icon /></Select.Trigger>- <Select.Popup>- <Select.Item- value="apple"- description="Cherry alternative"- descriptionPlacement="end"- startIcon={<IconCheck />}+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}>- Apple- </Select.Item>- <Select.Item- value="cherry"- description="Seasonal"- endIcon={<IconCheck />}- >- Cherry- </Select.Item>- </Select.Popup>+ <Select.Popup>+ <Select.Item value="apple">+ <IconCheck aria-hidden />+ <Select.ItemText>Apple</Select.ItemText>+ <span>Cherry alternative</span>+ <Select.ItemIndicator />+ </Select.Item>+ <Select.Item value="cherry">+ <Select.ItemText>Cherry</Select.ItemText>+ <span>Seasonal</span>+ <Select.ItemIndicator />+ </Select.Item>+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal></Select.Root>),play: async ({ canvasElement }) => {@@ -423,7 +525,9 @@ export const SlotsAndTypeahead: Story = {},};-const ControlledMultipleExample = () => {+const ControlledMultipleExample = ({+ onValueChange,+}: Pick<SelectRootProps<string, true>, 'onValueChange'>) => {const [value, setValue] = useState<string[]>(['apple']);return (@@ -431,19 +535,32 @@ const ControlledMultipleExample = () => {<Select.Rootmultiplevalue={value}- onValueChange={setValue}+ onValueChange={(nextValue, details) => {+ setValue(nextValue);+ onValueChange?.(nextValue, details);+ }}items={SELECT_ITEMS}><Select.Trigger aria-label="Fruit"><Select.Value />+ <Select.Icon /></Select.Trigger>- <Select.Popup>- {SELECT_ITEMS.map(({ value: itemValue, label }) => (- <Select.Item key={itemValue} value={itemValue}>- {label}- </Select.Item>- ))}- </Select.Popup>+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup>+ {SELECT_ITEMS.map(({ value: itemValue, label }) => (+ <Select.Item key={itemValue} value={itemValue}>+ <Select.ItemText>{label}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal></Select.Root><output aria-label="Selected values">{value.join(', ')}</output></>@@ -452,34 +569,42 @@ const ControlledMultipleExample = () => {export const ControlledMultiple: Story = {decorators: [ComponentDecorator],- render: () => <ControlledMultipleExample />,- play: async ({ canvasElement }) => {+ args: { onValueChange: fn() },+ render: (args) => (+ <ControlledMultipleExample onValueChange={args.onValueChange} />+ ),+ play: async ({ canvasElement, args }) => {const canvas = within(canvasElement);await userEvent.click(canvas.getByRole('combobox'));const popup = await waitForSelectPopup(canvasElement);+ await expect(args.onValueChange).not.toHaveBeenCalled();await userEvent.click(within(popup).getByRole('option', { name: 'Cherry' }),);await expect(canvas.getByRole('status', { name: 'Selected values', hidden: true }),).toHaveTextContent('apple, cherry');+ await expect(args.onValueChange).toHaveBeenCalledTimes(1);await userEvent.keyboard('{Escape}');await waitFor(() => expect(popup).not.toBeVisible());await expect(canvas.getByRole('combobox')).toHaveTextContent('Apple, Cherry',);+ await expect(args.onValueChange).toHaveBeenCalledTimes(1);},};export const ClosedTypeahead: Story = {decorators: [ComponentDecorator],- args: { defaultValue: 'apple' },- play: async ({ canvasElement }) => {+ args: { defaultValue: 'apple', onValueChange: fn(), onOpenChange: fn() },+ play: async ({ canvasElement, args }) => {const trigger = within(canvasElement).getByRole('combobox');await userEvent.tab();await userEvent.keyboard('c');await expect(trigger).toHaveTextContent('Cherry');await expect(trigger).toHaveAttribute('aria-expanded', 'false');+ await expect(args.onValueChange).toHaveBeenCalledTimes(1);+ await expect(args.onOpenChange).not.toHaveBeenCalled();},};@@ -502,3 +627,211 @@ export const Invalid: Story = {);},};++export const EmptyValues: Story = {+ decorators: [ComponentDecorator],+ args: { defaultValue: null, onValueChange: fn() },+ play: async ({ canvasElement, args }) => {+ const trigger = within(canvasElement).getByRole('combobox');+ await expect(trigger).toHaveTextContent('Choose a fruit');+ await userEvent.click(trigger);+ const popup = await waitForSelectPopup(canvasElement);+ await expect(args.onValueChange).not.toHaveBeenCalled();+ await expect(popup.querySelector('[aria-selected="true"]')).toBeNull();+ await userEvent.click(+ within(popup).getByRole('option', { name: 'Cherry' }),+ );+ await expect(args.onValueChange).toHaveBeenCalledTimes(1);+ await expect(args.onValueChange).toHaveBeenLastCalledWith(+ 'cherry',+ expect.objectContaining({ reason: 'item-press' }),+ );+ await waitFor(() => expect(popup).not.toBeVisible());+ await expect(trigger).toHaveTextContent('Cherry');+ },+};++export const EmptyMultiple: Story = {+ decorators: [ComponentDecorator],+ parameters: { a11y: A11Y_DEFER_COLOR_CONTRAST },+ args: { multiple: true, defaultValue: [], onValueChange: fn() },+ play: async ({ canvasElement, args }) => {+ const trigger = within(canvasElement).getByRole('combobox');+ await expect(trigger).toHaveTextContent('Choose a fruit');+ await userEvent.click(trigger);+ const popup = await waitForSelectPopup(canvasElement);+ await expect(args.onValueChange).not.toHaveBeenCalled();+ const cherry = within(popup).getByRole('option', { name: 'Cherry' });+ await userEvent.click(cherry);+ await expect(args.onValueChange).toHaveBeenCalledTimes(1);+ await expect(args.onValueChange).toHaveBeenLastCalledWith(+ ['cherry'],+ expect.objectContaining({ reason: 'item-press' }),+ );+ await userEvent.click(cherry);+ await expect(args.onValueChange).toHaveBeenCalledTimes(2);+ await expect(args.onValueChange).toHaveBeenLastCalledWith(+ [],+ expect.objectContaining({ reason: 'item-press' }),+ );+ await expect(trigger).toHaveTextContent('Choose a fruit');+ await expect(popup).toBeVisible();+ },+};++const callbackValueChange =+ fn<NonNullable<SelectRootProps<string, boolean>['onValueChange']>>();+const callbackOpenChange =+ fn<NonNullable<SelectRootProps<string, boolean>['onOpenChange']>>();++export const CallbackDetails: Story = {+ decorators: [ComponentDecorator],+ args: {+ defaultValue: 'apple',+ onValueChange: callbackValueChange,+ onOpenChange: callbackOpenChange,+ },+ render: ({ onValueChange, ...args }) => (+ <SelectExample+ {...args}+ onValueChange={(value, details) => {+ if (value === 'cherry') {+ details.cancel();+ }+ details.allowPropagation();+ onValueChange?.(value, details);+ }}+ />+ ),+ play: async ({ canvasElement, args }) => {+ const trigger = within(canvasElement).getByRole('combobox');+ await userEvent.click(trigger);+ const popup = await waitForSelectPopup(canvasElement);+ await expect(args.onOpenChange).toHaveBeenCalledTimes(1);+ await expect(args.onValueChange).not.toHaveBeenCalled();+ await expect(args.onOpenChange).toHaveBeenLastCalledWith(+ true,+ expect.objectContaining({+ reason: 'trigger-press',+ event: expect.anything(),+ cancel: expect.anything(),+ allowPropagation: expect.anything(),+ }),+ );+ await expect(+ callbackOpenChange.mock.lastCall?.[1].event instanceof MouseEvent,+ ).toBe(true);+ await userEvent.click(+ within(popup).getByRole('option', { name: 'Cherry' }),+ );+ await expect(+ callbackValueChange.mock.lastCall?.[1].event instanceof MouseEvent,+ ).toBe(true);+ await expect(args.onValueChange).toHaveBeenCalledTimes(1);+ await expect(args.onValueChange).toHaveBeenLastCalledWith(+ 'cherry',+ expect.objectContaining({+ reason: 'item-press',+ event: expect.anything(),+ isCanceled: true,+ isPropagationAllowed: true,+ }),+ );+ await waitFor(() => expect(popup).not.toBeVisible());+ await expect(args.onOpenChange).toHaveBeenCalledTimes(2);+ await expect(args.onOpenChange).toHaveBeenLastCalledWith(+ false,+ expect.objectContaining({ reason: 'item-press' }),+ );+ await expect(trigger).toHaveTextContent('Apple');+ await userEvent.click(trigger);+ await waitForSelectPopup(canvasElement);+ await expect(args.onOpenChange).toHaveBeenCalledTimes(3);+ await expect(args.onValueChange).toHaveBeenCalledTimes(1);+ await userEvent.keyboard('{Escape}');+ await expect(args.onOpenChange).toHaveBeenCalledTimes(4);+ await expect(args.onValueChange).toHaveBeenCalledTimes(1);+ await expect(args.onOpenChange).toHaveBeenLastCalledWith(+ false,+ expect.objectContaining({+ reason: 'escape-key',+ event: expect.anything(),+ }),+ );+ await expect(+ callbackOpenChange.mock.lastCall?.[1].event instanceof KeyboardEvent,+ ).toBe(true);+ await waitFor(() => expect(trigger).toHaveFocus());+ },+};++const triggerRef = createRef<HTMLButtonElement>();+const positionerRef = createRef<HTMLDivElement>();+const popupRef = createRef<HTMLDivElement>();+const itemTextRef = createRef<HTMLDivElement>();+const inputRef = createRef<HTMLInputElement>();++export const NativeCompositionAndRefs: Story = {+ decorators: [ComponentDecorator],+ render: () => (+ <Select.Root+ items={SELECT_ITEMS}+ defaultValue="apple"+ name="fruit"+ inputRef={inputRef}+ >+ <Select.Label>Fruit</Select.Label>+ <Select.Trigger ref={triggerRef} render={<Button />}>+ <Select.Value />+ <Select.Icon>+ <IconCheck />+ </Select.Icon>+ </Select.Trigger>+ <Select.Portal>+ <Select.Backdrop data-testid="select-backdrop" />+ <Select.Positioner+ ref={positionerRef}+ alignItemWithTrigger={false}+ align="start"+ sideOffset={8}+ >+ <Select.Popup ref={popupRef}>+ <Select.Item value="apple">+ <Select.ItemText ref={itemTextRef}>Apple</Select.ItemText>+ <Select.ItemIndicator>+ <IconCheck />+ </Select.ItemIndicator>+ </Select.Item>+ <Select.Item value="cherry">+ <Select.ItemText>Cherry</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal>+ </Select.Root>+ ),+ play: async ({ canvasElement }) => {+ const trigger = within(canvasElement).getByRole('combobox', {+ name: 'Fruit',+ });+ await expect(triggerRef.current).toBe(trigger);+ await expect(inputRef.current).toBeInstanceOf(HTMLInputElement);+ await expect(inputRef.current).toHaveAttribute('name', 'fruit');+ await expect(inputRef.current).toHaveValue('apple');+ await userEvent.click(trigger);+ const popup = await waitForSelectPopup(canvasElement);+ await expect(popupRef.current).toBe(popup);+ await expect(positionerRef.current).toContainElement(popup);+ await expect(itemTextRef.current).toHaveTextContent('Apple');+ await expect(+ within(canvasElement.ownerDocument.body).getByTestId('select-backdrop'),+ ).toBeVisible();+ await userEvent.click(+ within(popup).getByRole('option', { name: 'Cherry' }),+ );+ await waitFor(() => expect(popup).not.toBeVisible());+ await expect(trigger).toHaveTextContent('Cherry');+ await expect(inputRef.current).toHaveValue('cherry');+ },+};diff --git a/packages/twenty-ui/src/primitives/input/Select/__stories__/Select.portals.stories.tsx b/packages/twenty-ui/src/primitives/input/Select/__stories__/Select.portals.stories.tsxindex 9ffb4fa3d32..672a79f0046 100644--- a/packages/twenty-ui/src/primitives/input/Select/__stories__/Select.portals.stories.tsx+++ b/packages/twenty-ui/src/primitives/input/Select/__stories__/Select.portals.stories.tsx@@ -3,11 +3,14 @@ import { useState } from 'react';import { expect, userEvent, waitFor, within } from 'storybook/test';import { DirectionProvider } from '@ui/primitives/layout/DirectionProvider/DirectionProvider';+import { Button } from '@ui/primitives/input/Button/Button';import { ComponentDecorator } from '@ui/testing';import { ThemeProvider } from '@ui/theme/ThemeProvider';import { Select } from '../Select';-import { SelectExample, type SelectExampleProps } from './SelectExample';+import { SelectExample } from './SelectExample';+import { SelectPositioningExample } from './SelectPositioningExample';+import { type SelectExampleProps } from './SelectExampleProps';import { waitForSelectPopup } from './waitForSelectPopup';const meta: Meta<typeof SelectExample> = {@@ -24,9 +27,9 @@ export const BodyPortalAndOutsideDismissal: Story = {render: () => (<><SelectExample defaultValue="apple" modal={false} />- <button type="button" style={{ marginTop: 160 }}>+ <Button type="button" style={{ marginTop: 160 }}>Outside- </button>+ </Button></>),play: async ({ canvasElement }) => {@@ -109,9 +112,9 @@ const DeferredContainerExample = () => {}}modal={false}/>- <button type="button" onClick={() => setMounted(true)}>+ <Button type="button" onClick={() => setMounted(true)}>Mount portal- </button>+ </Button>{mounted && (<div ref={setContainer} role="region" aria-label="Deferred portal" />)}@@ -176,14 +179,24 @@ export const Scrollable: Story = {><Select.Trigger aria-label="Long list"><Select.Value />+ <Select.Icon /></Select.Trigger>- <Select.Popup style={{ maxHeight: 160 }}>- {Array.from({ length: 30 }, (_, index) => (- <Select.Item key={index} value={index + 1}>- Option {index + 1}- </Select.Item>- ))}- </Select.Popup>+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup style={{ maxHeight: 160 }}>+ {Array.from({ length: 30 }, (_, index) => (+ <Select.Item key={index} value={index + 1}>+ <Select.ItemText>Option {index + 1}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal></Select.Root>),play: async ({ canvasElement }) => {@@ -234,3 +247,46 @@ export const AlignedWithSelectedItem: Story = {});},};++export const AdvancedPositioning: Story = {+ decorators: [ComponentDecorator],+ parameters: { container: { width: 580, height: 400 } },+ render: () => <SelectPositioningExample defaultValue="apple" />,+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);+ await userEvent.click(canvas.getByRole('combobox', { name: 'Fruit' }));+ const list = await waitForSelectPopup(canvasElement);+ const positioner = within(canvasElement.ownerDocument.body).getByTestId(+ 'custom-positioner',+ );+ const anchor = canvas.getByRole('region', { name: 'Popup anchor' });+ await expect(positioner).toHaveStyle({ position: 'fixed' });+ await expect(positioner).toHaveAttribute('data-side', 'bottom');+ await expect(positioner).toHaveAttribute('data-align', 'end');+ await expect(positioner).toContainElement(list);+ await expect(+ within(canvasElement.ownerDocument.body).getByTestId('select-arrow'),+ ).toHaveAttribute('data-side', 'bottom');+ await waitFor(() => {+ const anchorBounds = anchor.getBoundingClientRect();+ const positionerBounds = positioner.getBoundingClientRect();+ expect(+ Math.abs(+ positionerBounds.top - anchorBounds.bottom - anchorBounds.height / 2,+ ),+ ).toBeLessThan(2);+ });+ await expect(list.scrollHeight).toBeGreaterThan(list.clientHeight);+ await userEvent.keyboard('{End}{Enter}');+ await waitFor(() => expect(list).not.toBeVisible());+ await expect(canvas.getByRole('combobox')).toHaveTextContent(+ 'Dragon fruit',+ );+ },+};++export const PositioningDocumentation: Story = {+ decorators: AdvancedPositioning.decorators,+ parameters: AdvancedPositioning.parameters,+ render: () => <SelectPositioningExample defaultValue="apple" />,+};diff --git a/packages/twenty-ui/src/primitives/input/Select/__stories__/Select.stories.tsx b/packages/twenty-ui/src/primitives/input/Select/__stories__/Select.stories.tsxindex 36dd840277b..13e9c1d7c93 100644--- a/packages/twenty-ui/src/primitives/input/Select/__stories__/Select.stories.tsx+++ b/packages/twenty-ui/src/primitives/input/Select/__stories__/Select.stories.tsx@@ -10,11 +10,9 @@ import {} from '@ui/testing';import { Select } from '../Select';-import {- SelectExample,- type SelectExampleProps,- SELECT_ITEMS,-} from './SelectExample';+import { SelectExample } from './SelectExample';+import { type SelectExampleProps } from './SelectExampleProps';+import { SELECT_ITEMS } from './selectItems';import { waitForSelectPopup } from './waitForSelectPopup';const meta: Meta<typeof SelectExample> = {@@ -100,19 +98,37 @@ export const Grouped: Story = {<Select.Root items={SELECT_ITEMS} defaultValue="apple"><Select.Trigger aria-label="Fruit"><Select.Value />+ <Select.Icon /></Select.Trigger>- <Select.Popup>- <Select.Group>- <Select.GroupLabel>Everyday</Select.GroupLabel>- <Select.Item value="apple">Apple</Select.Item>- <Select.Item value="cherry">Cherry</Select.Item>- </Select.Group>- <Select.Separator />- <Select.Group>- <Select.GroupLabel>Tropical</Select.GroupLabel>- <Select.Item value="dragon-fruit">Dragon fruit</Select.Item>- </Select.Group>- </Select.Popup>+ <Select.Portal>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup>+ <Select.Group>+ <Select.GroupLabel>Everyday</Select.GroupLabel>+ <Select.Item value="apple">+ <Select.ItemText>Apple</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ <Select.Item value="cherry">+ <Select.ItemText>Cherry</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ </Select.Group>+ <Select.Separator />+ <Select.Group>+ <Select.GroupLabel>Tropical</Select.GroupLabel>+ <Select.Item value="dragon-fruit">+ <Select.ItemText>Dragon fruit</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ </Select.Group>+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal></Select.Root>),play: async ({ canvasElement }) => {@@ -153,18 +169,28 @@ const SelectCatalogCell = ({><Select.Trigger id={triggerId} size={size} aria-label="Fruit"><Select.Value />+ <Select.Icon /></Select.Trigger>- <Select.Popup container={container}>- {SELECT_ITEMS.map(({ value, label }) => (- <Select.Item- key={value}- value={value}- disabled={value === 'banana'}- >- {label}- </Select.Item>- ))}- </Select.Popup>+ <Select.Portal container={container}>+ <Select.Positioner+ align="start"+ sideOffset={8}+ alignItemWithTrigger={false}+ >+ <Select.Popup>+ {SELECT_ITEMS.map(({ value, label }) => (+ <Select.Item+ key={value}+ value={value}+ disabled={value === 'banana'}+ >+ <Select.ItemText>{label}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal></Select.Root></div>);diff --git a/packages/twenty-ui/src/primitives/input/Select/__stories__/SelectExample.tsx b/packages/twenty-ui/src/primitives/input/Select/__stories__/SelectExample.tsxindex bca0b4909c5..474dd6f1c45 100644--- a/packages/twenty-ui/src/primitives/input/Select/__stories__/SelectExample.tsx+++ b/packages/twenty-ui/src/primitives/input/Select/__stories__/SelectExample.tsx@@ -1,45 +1,41 @@import { Select } from '../Select';-import { type SelectPopupProps } from '../types/SelectPopupProps';-import { type SelectRootProps } from '../types/SelectRootProps';-import { type SelectTriggerProps } from '../types/SelectTriggerProps';--export const SELECT_ITEMS = [- { label: 'Apple', value: 'apple' },- { label: 'Banana', value: 'banana' },- { label: 'Cherry', value: 'cherry' },- { label: 'Dragon fruit', value: 'dragon-fruit' },-];--export type SelectExampleProps = SelectRootProps<string, boolean> &- Pick<SelectTriggerProps, 'size'> &- Pick<- SelectPopupProps,- 'container' | 'side' | 'align' | 'alignItemWithTrigger'- >;+import { type SelectExampleProps } from './SelectExampleProps';+import { SELECT_ITEMS } from './selectItems';export const SelectExample = ({size,container,side,- align,- alignItemWithTrigger,+ sideOffset = 8,+ align = 'start',+ alignItemWithTrigger = false,...props}: SelectExampleProps) => (<Select.Root {...props} items={SELECT_ITEMS}><Select.Trigger size={size} aria-label="Fruit"><Select.Value placeholder="Choose a fruit" />+ <Select.Icon /></Select.Trigger>- <Select.Popup- container={container}- side={side}- align={align}- alignItemWithTrigger={alignItemWithTrigger}- >- {SELECT_ITEMS.map(({ value, label }) => (- <Select.Item key={value} value={value} disabled={value === 'banana'}>- {label}- </Select.Item>- ))}- </Select.Popup>+ <Select.Portal container={container}>+ <Select.Positioner+ side={side}+ sideOffset={sideOffset}+ align={align}+ alignItemWithTrigger={alignItemWithTrigger}+ >+ <Select.Popup>+ {SELECT_ITEMS.map(({ value, label }) => (+ <Select.Item+ key={value}+ value={value}+ disabled={value === 'banana'}+ >+ <Select.ItemText>{label}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal></Select.Root>);diff --git a/packages/twenty-ui/src/primitives/input/Select/__stories__/SelectExampleProps.ts b/packages/twenty-ui/src/primitives/input/Select/__stories__/SelectExampleProps.tsnew file mode 100644index 00000000000..da9db011a43--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/__stories__/SelectExampleProps.ts@@ -0,0 +1,12 @@+import { type SelectPortalProps } from '../types/SelectPortalProps';+import { type SelectPositionerProps } from '../types/SelectPositionerProps';+import { type SelectRootProps } from '../types/SelectRootProps';+import { type SelectTriggerProps } from '../types/SelectTriggerProps';++export type SelectExampleProps = SelectRootProps<string, boolean> &+ Pick<SelectTriggerProps, 'size'> &+ Pick<SelectPortalProps, 'container'> &+ Pick<+ SelectPositionerProps,+ 'side' | 'sideOffset' | 'align' | 'alignItemWithTrigger'+ >;diff --git a/packages/twenty-ui/src/primitives/input/Select/__stories__/SelectPositioningExample.tsx b/packages/twenty-ui/src/primitives/input/Select/__stories__/SelectPositioningExample.tsxnew file mode 100644index 00000000000..c841b49f149--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/__stories__/SelectPositioningExample.tsx@@ -0,0 +1,72 @@+import { useState } from 'react';++import { IconChevronDown, IconChevronUp } from '@ui/icon';++import { Select } from '../Select';+import { type SelectRootProps } from '../types/SelectRootProps';+import { SELECT_ITEMS } from './selectItems';++export const SelectPositioningExample = (props: SelectRootProps<string>) => {+ const [anchor, setAnchor] = useState<HTMLDivElement | null>(null);+ const [boundary, setBoundary] = useState<HTMLDivElement | null>(null);++ return (+ <div ref={setBoundary} style={{ width: 520, height: 320, padding: 24 }}>+ <Select.Root {...props} items={SELECT_ITEMS}>+ <Select.Label>Fruit</Select.Label>+ <Select.Trigger style={{ width: 160 }}>+ <Select.Value placeholder="Choose a fruit" />+ <Select.Icon />+ </Select.Trigger>+ <div+ ref={setAnchor}+ role="region"+ aria-label="Popup anchor"+ style={{ width: 180, height: 40, marginInlineStart: 240 }}+ >+ Custom anchor+ </div>+ <Select.Portal>+ <Select.Positioner+ anchor={anchor}+ positionMethod="fixed"+ side="bottom"+ align="end"+ alignItemWithTrigger={false}+ sideOffset={({ anchor: anchorDimensions }) =>+ anchorDimensions.height / 2+ }+ alignOffset={() => 6}+ collisionBoundary={boundary ?? undefined}+ collisionPadding={12}+ collisionAvoidance={{ side: 'none', align: 'none' }}+ sticky+ disableAnchorTracking+ data-testid="custom-positioner"+ >+ <Select.Popup style={{ overflow: 'hidden' }}>+ <Select.Arrow data-testid="select-arrow" />+ <Select.ScrollUpArrow keepMounted aria-hidden>+ <IconChevronUp />+ </Select.ScrollUpArrow>+ <Select.List style={{ maxHeight: 96, overflow: 'auto' }}>+ <Select.Group>+ <Select.GroupLabel>Everyday</Select.GroupLabel>+ {SELECT_ITEMS.map(({ value, label }) => (+ <Select.Item key={value} value={value}>+ <Select.ItemText>{label}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.Group>+ </Select.List>+ <Select.ScrollDownArrow keepMounted aria-hidden>+ <IconChevronDown />+ </Select.ScrollDownArrow>+ </Select.Popup>+ </Select.Positioner>+ </Select.Portal>+ </Select.Root>+ </div>+ );+};diff --git a/packages/twenty-ui/src/primitives/input/Select/__stories__/selectItems.ts b/packages/twenty-ui/src/primitives/input/Select/__stories__/selectItems.tsnew file mode 100644index 00000000000..70cbc7da68d--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/__stories__/selectItems.ts@@ -0,0 +1,6 @@+export const SELECT_ITEMS = [+ { label: 'Apple', value: 'apple' },+ { label: 'Banana', value: 'banana' },+ { label: 'Cherry', value: 'cherry' },+ { label: 'Dragon fruit', value: 'dragon-fruit' },+];diff --git a/packages/twenty-ui/src/primitives/input/Select/__tests__/Select.behavior.test.tsx b/packages/twenty-ui/src/primitives/input/Select/__tests__/Select.behavior.test.tsxnew file mode 100644index 00000000000..19d8186fd07--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/__tests__/Select.behavior.test.tsx@@ -0,0 +1,535 @@+import { render, screen, waitFor } from '@testing-library/react';+import userEvent from '@testing-library/user-event';+import { createRef, type ReactNode } from 'react';+import { describe, expect, it, vi } from 'vitest';++import { ThemeProvider } from '@ui/theme/ThemeProvider';++import { Select } from '../Select';+import { type SelectPositionerProps } from '../types/SelectPositionerProps';+import { type SelectRootProps } from '../types/SelectRootProps';++const ITEMS = [+ { value: 'alpha', label: 'Alpha' },+ { value: 'beta', label: 'Beta' },+ { value: 'gamma', label: 'Gamma' },+];++const SelectOptions = () => (+ <Select.List>+ {ITEMS.map(({ value, label }) => (+ <Select.Item key={value} value={value}>+ <Select.ItemText>{label}</Select.ItemText>+ <Select.ItemIndicator />+ </Select.Item>+ ))}+ </Select.List>+);++const SelectContent = ({+ children = <SelectOptions />,+ positionerProps,+}: {+ children?: ReactNode;+ positionerProps?: SelectPositionerProps;+}) => (+ <Select.Portal>+ <Select.Positioner alignItemWithTrigger={false} {...positionerProps}>+ <Select.Popup>{children}</Select.Popup>+ </Select.Positioner>+ </Select.Portal>+);++const StringSelect = (props: SelectRootProps<string>) => (+ <Select.Root items={ITEMS} modal={false} {...props}>+ <Select.Label>Letter</Select.Label>+ <Select.Trigger>+ <Select.Value placeholder="Choose a letter" />+ <Select.Icon />+ </Select.Trigger>+ <SelectContent />+ </Select.Root>+);++const ThemedWrapper = ({ children }: { children: ReactNode }) => (+ <ThemeProvider colorScheme="light">{children}</ThemeProvider>+);++describe('Select behavior', () => {+ it('updates an uncontrolled value and exposes native change details', async () => {+ const user = userEvent.setup();+ const onValueChange = vi.fn();+ const onOpenChange = vi.fn();++ render(+ <StringSelect+ defaultValue="alpha"+ onValueChange={onValueChange}+ onOpenChange={onOpenChange}+ />,+ { wrapper: ThemedWrapper },+ );++ const trigger = screen.getByRole('combobox', { name: /Letter/ });++ expect(trigger).toHaveTextContent('Alpha');+ await user.click(trigger);+ expect(onOpenChange).toHaveBeenCalledTimes(1);+ expect(onOpenChange).toHaveBeenCalledWith(+ true,+ expect.objectContaining({+ reason: 'trigger-press',+ event: expect.any(MouseEvent),+ cancel: expect.any(Function),+ allowPropagation: expect.any(Function),+ }),+ );++ await user.click(await screen.findByRole('option', { name: 'Beta' }));++ expect(onValueChange).toHaveBeenCalledTimes(1);+ expect(onValueChange).toHaveBeenCalledWith(+ 'beta',+ expect.objectContaining({+ reason: 'item-press',+ event: expect.any(MouseEvent),+ isCanceled: false,+ isPropagationAllowed: false,+ }),+ );+ expect(trigger).toHaveTextContent('Beta');+ await waitFor(() => expect(screen.queryByRole('listbox')).toBeNull());+ expect(onOpenChange).toHaveBeenCalledTimes(2);+ expect(onOpenChange).toHaveBeenLastCalledWith(+ false,+ expect.objectContaining({ reason: 'item-press' }),+ );+ });++ it('keeps a controlled value until the consumer updates it', async () => {+ const user = userEvent.setup();+ const onValueChange = vi.fn();+ const { rerender } = render(+ <StringSelect value="alpha" onValueChange={onValueChange} />,+ { wrapper: ThemedWrapper },+ );++ const trigger = screen.getByRole('combobox', { name: /Letter/ });++ await user.click(trigger);+ await user.click(await screen.findByRole('option', { name: 'Beta' }));++ expect(onValueChange).toHaveBeenCalledTimes(1);+ expect(onValueChange).toHaveBeenCalledWith('beta', expect.any(Object));+ expect(trigger).toHaveTextContent('Alpha');++ rerender(<StringSelect value="beta" onValueChange={onValueChange} />);++ expect(trigger).toHaveTextContent('Beta');+ expect(onValueChange).toHaveBeenCalledTimes(1);+ });++ it('allows consumers to cancel a value change through event details', async () => {+ const user = userEvent.setup();+ const onValueChange = vi.fn<+ NonNullable<SelectRootProps<string>['onValueChange']>+ >((_value, details) => details.cancel());++ render(+ <StringSelect defaultValue="alpha" onValueChange={onValueChange} />,+ { wrapper: ThemedWrapper },+ );++ const trigger = screen.getByRole('combobox', { name: /Letter/ });++ await user.click(trigger);+ await user.click(await screen.findByRole('option', { name: 'Beta' }));++ expect(onValueChange).toHaveBeenCalledTimes(1);+ expect(onValueChange).toHaveBeenCalledWith(+ 'beta',+ expect.objectContaining({ reason: 'item-press', isCanceled: true }),+ );+ expect(trigger).toHaveTextContent('Alpha');+ });++ it('distinguishes an empty string option from a null value', async () => {+ const user = userEvent.setup();+ const onValueChange = vi.fn();+ const emptyItems = [+ { value: '', label: 'Empty string' },+ { value: null, label: 'No value' },+ { value: 'alpha', label: 'Alpha' },+ ];++ render(+ <Select.Root+ defaultValue="alpha"+ items={emptyItems}+ onValueChange={onValueChange}+ modal={false}+ >+ <Select.Trigger aria-label="Optional letter">+ <Select.Value placeholder="Choose" />+ </Select.Trigger>+ <SelectContent>+ <Select.List>+ {emptyItems.map(({ value, label }) => (+ <Select.Item key={label} value={value}>+ <Select.ItemText>{label}</Select.ItemText>+ </Select.Item>+ ))}+ </Select.List>+ </SelectContent>+ </Select.Root>,+ { wrapper: ThemedWrapper },+ );++ const trigger = screen.getByRole('combobox', { name: 'Optional letter' });++ await user.click(trigger);+ await user.click(+ await screen.findByRole('option', { name: 'Empty string' }),+ );++ expect(onValueChange).toHaveBeenCalledTimes(1);+ expect(onValueChange).toHaveBeenLastCalledWith('', expect.any(Object));+ expect(trigger).toHaveTextContent('Empty string');++ await user.click(trigger);+ await user.click(await screen.findByRole('option', { name: 'No value' }));++ expect(onValueChange).toHaveBeenCalledTimes(2);+ expect(onValueChange).toHaveBeenLastCalledWith(null, expect.any(Object));+ expect(trigger).toHaveTextContent('No value');+ expect(trigger).toHaveAttribute('data-placeholder');+ });++ it('supports empty and populated multiple selections in native forms', async () => {+ const user = userEvent.setup();+ const onValueChange = vi.fn();++ render(+ <form aria-label="Letter form">+ <Select.Root<string, true>+ multiple+ defaultValue={[]}+ items={ITEMS}+ name="letters"+ onValueChange={onValueChange}+ modal={false}+ >+ <Select.Trigger aria-label="Letters">+ <Select.Value placeholder="Choose letters" />+ </Select.Trigger>+ <SelectContent />+ </Select.Root>+ </form>,+ { wrapper: ThemedWrapper },+ );++ const trigger = screen.getByRole('combobox', { name: 'Letters' });++ expect(trigger).toHaveTextContent('Choose letters');+ expect(+ new FormData(screen.getByRole<HTMLFormElement>('form')).getAll('letters'),+ ).toEqual([]);++ await user.click(trigger);+ await user.click(await screen.findByRole('option', { name: 'Alpha' }));+ expect(onValueChange).toHaveBeenCalledTimes(1);+ expect(onValueChange).toHaveBeenLastCalledWith(+ ['alpha'],+ expect.objectContaining({ reason: 'item-press' }),+ );+ await user.click(await screen.findByRole('option', { name: 'Beta' }));++ expect(screen.getByRole('listbox')).toHaveAttribute(+ 'aria-multiselectable',+ 'true',+ );+ expect(onValueChange).toHaveBeenCalledTimes(2);+ expect(onValueChange).toHaveBeenLastCalledWith(+ ['alpha', 'beta'],+ expect.objectContaining({ reason: 'item-press' }),+ );+ expect(+ new FormData(screen.getByRole<HTMLFormElement>('form')).getAll('letters'),+ ).toEqual(['alpha', 'beta']);++ await user.click(await screen.findByRole('option', { name: 'Alpha' }));++ expect(onValueChange).toHaveBeenCalledTimes(3);+ expect(onValueChange).toHaveBeenLastCalledWith(+ ['beta'],+ expect.any(Object),+ );+ });++ it('prevents disabled root interaction', async () => {+ const user = userEvent.setup();+ const onOpenChange = vi.fn();++ render(<StringSelect disabled onOpenChange={onOpenChange} />, {+ wrapper: ThemedWrapper,+ });++ const trigger = screen.getByRole('combobox', { name: /Letter/ });++ expect(trigger).toBeDisabled();+ await user.click(trigger);++ expect(onOpenChange).not.toHaveBeenCalled();+ expect(screen.queryByRole('listbox')).toBeNull();+ });++ it('uses its accessible label and skips disabled options during keyboard navigation', async () => {+ const user = userEvent.setup();+ const onValueChange = vi.fn();++ render(+ <Select.Root onValueChange={onValueChange} items={ITEMS} modal={false}>+ <Select.Label>Keyboard letter</Select.Label>+ <Select.Trigger>+ <Select.Value placeholder="Choose" />+ </Select.Trigger>+ <SelectContent>+ <Select.List>+ <Select.Item value="alpha" disabled>+ <Select.ItemText>Alpha</Select.ItemText>+ </Select.Item>+ <Select.Item value="beta">+ <Select.ItemText>Beta</Select.ItemText>+ </Select.Item>+ <Select.Item value="gamma" label="Gamma">+ <Select.ItemText>Third letter</Select.ItemText>+ </Select.Item>+ </Select.List>+ </SelectContent>+ </Select.Root>,+ { wrapper: ThemedWrapper },+ );++ const trigger = screen.getByRole('combobox', { name: /Keyboard letter/ });++ trigger.focus();+ await user.keyboard('{ArrowDown}');++ expect(screen.getByRole('option', { name: 'Alpha' })).toHaveAttribute(+ 'aria-disabled',+ 'true',+ );+ await waitFor(() =>+ expect(screen.getByRole('option', { name: 'Beta' })).toHaveFocus(),+ );+ await user.keyboard('g');+ await waitFor(() =>+ expect(+ screen.getByRole('option', { name: 'Third letter' }),+ ).toHaveFocus(),+ );+ expect(onValueChange).not.toHaveBeenCalled();+ await user.keyboard('{Enter}');++ expect(onValueChange).toHaveBeenCalledTimes(1);+ expect(onValueChange).toHaveBeenCalledWith(+ 'gamma',+ expect.objectContaining({+ reason: 'item-press',+ event: expect.any(Event),+ }),+ );+ expect(trigger).toHaveTextContent('Gamma');+ });++ it('preserves object values, custom equality, input refs, and external native form ownership', () => {+ const selectedTeam = { identifier: 'sales', name: 'Sales team' };+ const inputRef = createRef<HTMLInputElement>();++ render(+ <>+ <form id="team-form" aria-label="Team form" />+ <Select.Root+ defaultValue={{ ...selectedTeam }}+ inputRef={inputRef}+ name="team"+ form="team-form"+ autoComplete="organization"+ required+ itemToStringLabel={(team) => team.name}+ itemToStringValue={(team) => team.identifier}+ isItemEqualToValue={(item, value) =>+ item.identifier === value.identifier+ }+ open+ modal={false}+ >+ <Select.Trigger aria-label="Team">+ <Select.Value />+ </Select.Trigger>+ <SelectContent>+ <Select.Item value={selectedTeam}>+ <Select.ItemText>Sales team</Select.ItemText>+ </Select.Item>+ </SelectContent>+ </Select.Root>+ </>,+ { wrapper: ThemedWrapper },+ );++ expect(screen.getByRole('combobox', { name: 'Team' })).toHaveTextContent(+ 'Sales team',+ );+ expect(screen.getByRole('option', { name: 'Sales team' })).toHaveAttribute(+ 'aria-selected',+ 'true',+ );+ expect(inputRef.current).toBeInstanceOf(HTMLInputElement);+ expect(inputRef.current).toHaveAttribute('autocomplete', 'organization');+ expect(inputRef.current).toBeRequired();+ expect(+ new FormData(screen.getByRole<HTMLFormElement>('form')).get('team'),+ ).toBe('sales');+ });++ it('keeps trigger and item content explicit and respects custom indicator children', () => {+ const triggerRef = createRef<HTMLButtonElement>();+ const itemRef = createRef<HTMLElement>();++ render(+ <Select.Root defaultValue="alpha" open modal={false}>+ <Select.Trigger+ ref={triggerRef}+ render={<button title="Custom trigger" />}+ >+ <span>Custom value</span>+ <Select.Icon>Custom icon</Select.Icon>+ </Select.Trigger>+ <SelectContent>+ <Select.Item+ ref={itemRef}+ value="alpha"+ nativeButton+ render={<button title="Custom option" />}+ >+ <span>Custom item</span>+ <Select.ItemIndicator>Selected marker</Select.ItemIndicator>+ </Select.Item>+ </SelectContent>+ </Select.Root>,+ { wrapper: ThemedWrapper },+ );++ expect(triggerRef.current).toBeInstanceOf(HTMLButtonElement);+ expect(triggerRef.current).toHaveAttribute('title', 'Custom trigger');+ expect(triggerRef.current?.children).toHaveLength(2);+ expect(triggerRef.current?.querySelector('svg')).toBeNull();+ expect(itemRef.current).toBeInstanceOf(HTMLButtonElement);+ expect(itemRef.current).toHaveAttribute('title', 'Custom option');+ expect(itemRef.current?.children).toHaveLength(2);+ expect(itemRef.current).toHaveTextContent('Custom itemSelected marker');+ expect(itemRef.current?.querySelector('svg')).toBeNull();+ });++ it('keeps an inline popup and uses the upstream positioner defaults', () => {+ const positionerRef = createRef<HTMLDivElement>();+ const popupRef = createRef<HTMLDivElement>();+ const { container } = render(+ <Select.Root open modal={false}>+ <Select.Trigger aria-label="Inline select" />+ <Select.Positioner ref={positionerRef}>+ <Select.Popup ref={popupRef} />+ </Select.Positioner>+ </Select.Root>,+ { wrapper: ThemedWrapper },+ );++ expect(positionerRef.current).toBeInstanceOf(HTMLDivElement);+ expect(positionerRef.current).toHaveAttribute('data-side', 'none');+ expect(positionerRef.current).toHaveAttribute('data-align', 'center');+ expect(popupRef.current?.parentElement).toBe(positionerRef.current);+ expect(container).toContainElement(popupRef.current);+ });++ it('passes advanced positioning and offset functions to the positioner', async () => {+ const positionerRef = createRef<HTMLDivElement>();+ const sideOffset = vi.fn(() => 18);+ const alignOffset = vi.fn(() => 7);++ render(+ <Select.Root open modal={false}>+ <Select.Trigger aria-label="Positioned select" />+ <SelectContent+ positionerProps={{+ ref: positionerRef,+ alignItemWithTrigger: false,+ side: 'right',+ align: 'end',+ positionMethod: 'fixed',+ sideOffset,+ alignOffset,+ collisionAvoidance: { side: 'none', align: 'none' },+ collisionPadding: { top: 12, bottom: 8 },+ arrowPadding: 9,+ sticky: true,+ disableAnchorTracking: true,+ }}+ />+ </Select.Root>,+ { wrapper: ThemedWrapper },+ );++ await waitFor(() => {+ expect(positionerRef.current).toHaveAttribute('data-side', 'right');+ expect(positionerRef.current).toHaveAttribute('data-align', 'end');+ expect(positionerRef.current).toHaveStyle({ position: 'fixed' });+ expect(sideOffset).toHaveBeenCalledWith(+ expect.objectContaining({ side: 'right', align: 'end' }),+ );+ expect(alignOffset).toHaveBeenCalledWith(+ expect.objectContaining({ side: 'right', align: 'end' }),+ );+ });+ });++ it('keeps scoped theme portaling and explicit portal containers', () => {+ const portalContainerRef = createRef<HTMLDivElement>();+ const scopedPopupRef = createRef<HTMLDivElement>();+ const customPopupRef = createRef<HTMLDivElement>();++ render(+ <>+ <div ref={portalContainerRef} data-testid="portal-container" />+ <ThemeProvider+ colorScheme="dark"+ applyToRoot={false}+ className="select-theme"+ >+ <Select.Root open modal={false}>+ <Select.Trigger aria-label="Scoped select" />+ <Select.Portal>+ <Select.Positioner alignItemWithTrigger={false}>+ <Select.Popup ref={scopedPopupRef} />+ </Select.Positioner>+ </Select.Portal>+ </Select.Root>+ <Select.Root open modal={false}>+ <Select.Trigger aria-label="Custom container select" />+ <Select.Portal container={portalContainerRef}>+ <Select.Positioner alignItemWithTrigger={false}>+ <Select.Popup ref={customPopupRef} />+ </Select.Positioner>+ </Select.Portal>+ </Select.Root>+ </ThemeProvider>+ </>,+ );++ expect(scopedPopupRef.current?.closest('.select-theme')).toHaveClass(+ 'dark',+ );+ expect(screen.getByTestId('portal-container')).toContainElement(+ customPopupRef.current,+ );+ });+});diff --git a/packages/twenty-ui/src/primitives/input/Select/__tests__/Select.test.tsx b/packages/twenty-ui/src/primitives/input/Select/__tests__/Select.test.tsxindex e0261a21fe6..d1a141eb18d 100644--- a/packages/twenty-ui/src/primitives/input/Select/__tests__/Select.test.tsx+++ b/packages/twenty-ui/src/primitives/input/Select/__tests__/Select.test.tsx@@ -14,21 +14,40 @@ const SelectTriggerWrapper = ({ children }: { children: ReactNode }) => (</Select.Root>);const OpenSelectWrapper = ({ children }: { children: ReactNode }) => (- <Select.Root open>{children}</Select.Root>+ <Select.Root open defaultValue="first" modal={false}>+ <Select.Trigger aria-label="Choose" />+ {children}+ </Select.Root>+);+const SelectPositionerWrapper = ({ children }: { children: ReactNode }) => (+ <OpenSelectWrapper>+ <Select.Positioner alignItemWithTrigger={false}>+ {children}+ </Select.Positioner>+ </OpenSelectWrapper>);const SelectPopupWrapper = ({ children }: { children: ReactNode }) => (- <Select.Root open>+ <SelectPositionerWrapper><Select.Popup>{children}</Select.Popup>- </Select.Root>+ </SelectPositionerWrapper>);const SelectGroupWrapper = ({ children }: { children: ReactNode }) => (- <Select.Root open>- <Select.Popup>- <Select.Group>{children}</Select.Group>- </Select.Popup>- </Select.Root>+ <SelectPopupWrapper>+ <Select.Group>{children}</Select.Group>+ </SelectPopupWrapper>+);+const SelectItemWrapper = ({ children }: { children: ReactNode }) => (+ <SelectPopupWrapper>+ <Select.Item value="first">{children}</Select.Item>+ </SelectPopupWrapper>);+runComponentConformance({+ name: 'Select.Label',+ element: <Select.Label>Choose</Select.Label>,+ refInstanceOf: HTMLDivElement,+ wrapper: SelectRootWrapper,+});runComponentConformance({name: 'Select.Trigger',element: <Select.Trigger>Choose</Select.Trigger>,@@ -44,13 +63,45 @@ runComponentConformance({wrapper: SelectTriggerWrapper,ownClassName: styles.value,});+runComponentConformance({+ name: 'Select.Icon',+ element: <Select.Icon />,+ refInstanceOf: HTMLSpanElement,+ wrapper: SelectTriggerWrapper,+ ownClassName: styles.icon,+});+runComponentConformance({+ name: 'Select.Portal',+ element: <Select.Portal />,+ refInstanceOf: HTMLDivElement,+ wrapper: OpenSelectWrapper,+});+runComponentConformance({+ name: 'Select.Backdrop',+ element: <Select.Backdrop />,+ refInstanceOf: HTMLDivElement,+ wrapper: OpenSelectWrapper,+});+runComponentConformance({+ name: 'Select.Positioner',+ element: <Select.Positioner alignItemWithTrigger={false} />,+ refInstanceOf: HTMLDivElement,+ wrapper: OpenSelectWrapper,+ ownClassName: styles.positioner,+});runComponentConformance({name: 'Select.Popup',element: <Select.Popup />,refInstanceOf: HTMLDivElement,- wrapper: OpenSelectWrapper,+ wrapper: SelectPositionerWrapper,ownClassName: styles.popup,});+runComponentConformance({+ name: 'Select.List',+ element: <Select.List />,+ refInstanceOf: HTMLDivElement,+ wrapper: SelectPopupWrapper,+});runComponentConformance({name: 'Select.Item',element: <Select.Item value="first">First</Select.Item>,@@ -58,6 +109,37 @@ runComponentConformance({wrapper: SelectPopupWrapper,ownClassName: styles.item,});+runComponentConformance({+ name: 'Select.ItemText',+ element: <Select.ItemText>First</Select.ItemText>,+ refInstanceOf: HTMLDivElement,+ wrapper: SelectItemWrapper,+});+runComponentConformance({+ name: 'Select.ItemIndicator',+ element: <Select.ItemIndicator />,+ refInstanceOf: HTMLSpanElement,+ wrapper: SelectItemWrapper,+ ownClassName: styles.indicator,+});+runComponentConformance({+ name: 'Select.Arrow',+ element: <Select.Arrow />,+ refInstanceOf: HTMLDivElement,+ wrapper: SelectPopupWrapper,+});+runComponentConformance({+ name: 'Select.ScrollUpArrow',+ element: <Select.ScrollUpArrow keepMounted />,+ refInstanceOf: HTMLDivElement,+ wrapper: SelectPopupWrapper,+});+runComponentConformance({+ name: 'Select.ScrollDownArrow',+ element: <Select.ScrollDownArrow keepMounted />,+ refInstanceOf: HTMLDivElement,+ wrapper: SelectPopupWrapper,+});runComponentConformance({name: 'Select.Group',element: <Select.Group />,diff --git a/packages/twenty-ui/src/primitives/input/Select/internal/SelectIcon.tsx b/packages/twenty-ui/src/primitives/input/Select/internal/SelectIcon.tsxnew file mode 100644index 00000000000..512946c904a--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/internal/SelectIcon.tsx@@ -0,0 +1,20 @@+import { Select as SelectPrimitive } from '@base-ui/react/select';++import { IconChevronDown } from '@ui/icon';+import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';++import styles from '../Select.module.scss';+import { type SelectIconProps } from '../types/SelectIconProps';++export const SelectIcon = ({+ className,+ children = <IconChevronDown />,+ ...props+}: SelectIconProps) => (+ <SelectPrimitive.Icon+ {...props}+ className={mergeClassNames(styles.icon, className)}+ >+ {children}+ </SelectPrimitive.Icon>+);diff --git a/packages/twenty-ui/src/primitives/input/Select/internal/SelectItem.tsx b/packages/twenty-ui/src/primitives/input/Select/internal/SelectItem.tsxindex fc0383b125c..97180d51b45 100644--- a/packages/twenty-ui/src/primitives/input/Select/internal/SelectItem.tsx+++ b/packages/twenty-ui/src/primitives/input/Select/internal/SelectItem.tsx@@ -1,69 +1,20 @@import { Select as SelectPrimitive } from '@base-ui/react/select';import { clsx } from 'clsx';-import { IconCheck } from '@ui/icon';import listItemStyles from '@ui/primitives/navigation/ListItem/ListItem.module.scss';-import { isRenderableSlot } from '@ui/utilities/internal/isRenderableSlot';import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';import styles from '../Select.module.scss';import { type SelectItemProps } from '../types/SelectItemProps';-export const SelectItem = ({- className,- children,- startIcon,- endIcon,- description,- descriptionPlacement = 'inline',- ...props-}: SelectItemProps) => (+export const SelectItem = ({ className, ...props }: SelectItemProps) => (<SelectPrimitive.Item+ data-color="neutral"+ data-indicator="check"{...props}className={mergeClassNames(clsx(listItemStyles.root, styles.item),className,)}- data-color="neutral"- data-indicator="check"- >- {isRenderableSlot(startIcon) && (- <div className={listItemStyles.startIcon} aria-hidden>- {startIcon}- </div>- )}- <div className={listItemStyles.label}>- <SelectPrimitive.ItemText className={listItemStyles.text}>- {children}- </SelectPrimitive.ItemText>- {isRenderableSlot(description) && descriptionPlacement === 'inline' && (- <div- className={clsx(- listItemStyles.description,- listItemStyles.inlineDescription,- )}- >- {description}- </div>- )}- </div>- {isRenderableSlot(description) && descriptionPlacement === 'end' && (- <div- className={clsx(- listItemStyles.description,- listItemStyles.endDescription,- )}- >- {description}- </div>- )}- {isRenderableSlot(endIcon) && (- <div className={listItemStyles.endIcon} aria-hidden>- {endIcon}- </div>- )}- <SelectPrimitive.ItemIndicator className={styles.indicator}>- <IconCheck className={listItemStyles.checkIndicator} />- </SelectPrimitive.ItemIndicator>- </SelectPrimitive.Item>+ />);diff --git a/packages/twenty-ui/src/primitives/input/Select/internal/SelectItemIndicator.tsx b/packages/twenty-ui/src/primitives/input/Select/internal/SelectItemIndicator.tsxnew file mode 100644index 00000000000..b36810c0122--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/internal/SelectItemIndicator.tsx@@ -0,0 +1,21 @@+import { Select as SelectPrimitive } from '@base-ui/react/select';++import { IconCheck } from '@ui/icon';+import listItemStyles from '@ui/primitives/navigation/ListItem/ListItem.module.scss';+import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';++import styles from '../Select.module.scss';+import { type SelectItemIndicatorProps } from '../types/SelectItemIndicatorProps';++export const SelectItemIndicator = ({+ className,+ children = <IconCheck className={listItemStyles.checkIndicator} />,+ ...props+}: SelectItemIndicatorProps) => (+ <SelectPrimitive.ItemIndicator+ {...props}+ className={mergeClassNames(styles.indicator, className)}+ >+ {children}+ </SelectPrimitive.ItemIndicator>+);diff --git a/packages/twenty-ui/src/primitives/input/Select/internal/SelectItemText.tsx b/packages/twenty-ui/src/primitives/input/Select/internal/SelectItemText.tsxnew file mode 100644index 00000000000..d10dba0fabc--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/internal/SelectItemText.tsx@@ -0,0 +1,20 @@+import { Select as SelectPrimitive } from '@base-ui/react/select';+import { clsx } from 'clsx';++import listItemStyles from '@ui/primitives/navigation/ListItem/ListItem.module.scss';+import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';++import { type SelectItemTextProps } from '../types/SelectItemTextProps';++export const SelectItemText = ({+ className,+ ...props+}: SelectItemTextProps) => (+ <SelectPrimitive.ItemText+ {...props}+ className={mergeClassNames(+ clsx(listItemStyles.label, listItemStyles.text),+ className,+ )}+ />+);diff --git a/packages/twenty-ui/src/primitives/input/Select/internal/SelectPopup.tsx b/packages/twenty-ui/src/primitives/input/Select/internal/SelectPopup.tsxindex 37c1d06b0cd..7888d6d6f07 100644--- a/packages/twenty-ui/src/primitives/input/Select/internal/SelectPopup.tsx+++ b/packages/twenty-ui/src/primitives/input/Select/internal/SelectPopup.tsx@@ -1,47 +1,13 @@import { Select as SelectPrimitive } from '@base-ui/react/select';-import { useProvidedTextDirection } from '@ui/primitives/layout/DirectionProvider/internal/useProvidedTextDirection';-import { useThemeContainer } from '@ui/theme';import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';import styles from '../Select.module.scss';import { type SelectPopupProps } from '../types/SelectPopupProps';-export const SelectPopup = ({- side = 'bottom',- align = 'start',- sideOffset = 8,- alignOffset,- alignItemWithTrigger = false,- anchor,- container,- className,- ...props-}: SelectPopupProps) => {- const themeContainer = useThemeContainer();- const direction = useProvidedTextDirection();-- return (- <SelectPrimitive.Portal- container={- container === undefined ? (themeContainer ?? undefined) : container- }- >- <SelectPrimitive.Positioner- dir={direction}- side={side}- align={align}- sideOffset={sideOffset}- alignOffset={alignOffset}- alignItemWithTrigger={alignItemWithTrigger}- anchor={anchor}- className={styles.positioner}- >- <SelectPrimitive.Popup- {...props}- className={mergeClassNames(styles.popup, className)}- />- </SelectPrimitive.Positioner>- </SelectPrimitive.Portal>- );-};+export const SelectPopup = ({ className, ...props }: SelectPopupProps) => (+ <SelectPrimitive.Popup+ {...props}+ className={mergeClassNames(styles.popup, className)}+ />+);diff --git a/packages/twenty-ui/src/primitives/input/Select/internal/SelectPortal.tsx b/packages/twenty-ui/src/primitives/input/Select/internal/SelectPortal.tsxnew file mode 100644index 00000000000..06324b70813--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/internal/SelectPortal.tsx@@ -0,0 +1,22 @@+import { Select as SelectPrimitive } from '@base-ui/react/select';+import { isUndefined } from '@sniptt/guards';++import { useProvidedTextDirection } from '@ui/primitives/layout/DirectionProvider/internal/useProvidedTextDirection';+import { useThemeContainer } from '@ui/theme';++import { type SelectPortalProps } from '../types/SelectPortalProps';++export const SelectPortal = ({ container, ...props }: SelectPortalProps) => {+ const themeContainer = useThemeContainer();+ const direction = useProvidedTextDirection();++ return (+ <SelectPrimitive.Portal+ dir={direction}+ {...props}+ container={+ isUndefined(container) ? (themeContainer ?? undefined) : container+ }+ />+ );+};diff --git a/packages/twenty-ui/src/primitives/input/Select/internal/SelectPositioner.tsx b/packages/twenty-ui/src/primitives/input/Select/internal/SelectPositioner.tsxnew file mode 100644index 00000000000..dbaff654d9e--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/internal/SelectPositioner.tsx@@ -0,0 +1,22 @@+import { Select as SelectPrimitive } from '@base-ui/react/select';++import { useProvidedTextDirection } from '@ui/primitives/layout/DirectionProvider/internal/useProvidedTextDirection';+import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';++import styles from '../Select.module.scss';+import { type SelectPositionerProps } from '../types/SelectPositionerProps';++export const SelectPositioner = ({+ className,+ ...props+}: SelectPositionerProps) => {+ const direction = useProvidedTextDirection();++ return (+ <SelectPrimitive.Positioner+ dir={direction}+ {...props}+ className={mergeClassNames(styles.positioner, className)}+ />+ );+};diff --git a/packages/twenty-ui/src/primitives/input/Select/internal/SelectTrigger.tsx b/packages/twenty-ui/src/primitives/input/Select/internal/SelectTrigger.tsxindex 66d1877a5a7..d22e1bfb723 100644--- a/packages/twenty-ui/src/primitives/input/Select/internal/SelectTrigger.tsx+++ b/packages/twenty-ui/src/primitives/input/Select/internal/SelectTrigger.tsx@@ -1,7 +1,6 @@import { Select as SelectPrimitive } from '@base-ui/react/select';import { clsx } from 'clsx';-import { IconChevronDown } from '@ui/icon';import inputStyles from '@ui/primitives/input/Input/Input.module.scss';import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';@@ -11,7 +10,6 @@ import { type SelectTriggerProps } from '../types/SelectTriggerProps';export const SelectTrigger = ({size = 'md',className,- children,...props}: SelectTriggerProps) => (<SelectPrimitive.Trigger@@ -20,10 +18,5 @@ export const SelectTrigger = ({clsx(inputStyles.input, inputStyles[size], styles.trigger),className,)}- >- {children}- <SelectPrimitive.Icon className={styles.icon}>- <IconChevronDown />- </SelectPrimitive.Icon>- </SelectPrimitive.Trigger>+ />);diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectArrowProps.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectArrowProps.tsnew file mode 100644index 00000000000..0644a2c546b--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectArrowProps.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectArrowProps = SelectPrimitive.Arrow.Props;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectArrowState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectArrowState.tsnew file mode 100644index 00000000000..bd85db31e6b--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectArrowState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectArrowState = SelectPrimitive.Arrow.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectBackdropProps.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectBackdropProps.tsnew file mode 100644index 00000000000..1c3596e418f--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectBackdropProps.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectBackdropProps = SelectPrimitive.Backdrop.Props;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectBackdropState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectBackdropState.tsnew file mode 100644index 00000000000..1616366296e--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectBackdropState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectBackdropState = SelectPrimitive.Backdrop.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectGroupLabelState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectGroupLabelState.tsnew file mode 100644index 00000000000..623c744ce7a--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectGroupLabelState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectGroupLabelState = SelectPrimitive.GroupLabel.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectGroupState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectGroupState.tsnew file mode 100644index 00000000000..c10165744e4--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectGroupState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectGroupState = SelectPrimitive.Group.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectIconProps.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectIconProps.tsnew file mode 100644index 00000000000..13256bda190--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectIconProps.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectIconProps = SelectPrimitive.Icon.Props;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectIconState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectIconState.tsnew file mode 100644index 00000000000..b1014d3cab7--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectIconState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectIconState = SelectPrimitive.Icon.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectItemIndicatorProps.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectItemIndicatorProps.tsnew file mode 100644index 00000000000..c7fa1306bbe--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectItemIndicatorProps.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectItemIndicatorProps = SelectPrimitive.ItemIndicator.Props;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectItemIndicatorState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectItemIndicatorState.tsnew file mode 100644index 00000000000..e5e936d6e78--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectItemIndicatorState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectItemIndicatorState = SelectPrimitive.ItemIndicator.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectItemProps.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectItemProps.tsindex b15889e846b..4e862e7cb67 100644--- a/packages/twenty-ui/src/primitives/input/Select/types/SelectItemProps.ts+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectItemProps.ts@@ -1,9 +1,6 @@import { type Select as SelectPrimitive } from '@base-ui/react/select';+import { type ComponentPropsWithRef } from 'react';-import { type ListItemProps } from '@ui/primitives/navigation/ListItem/types/ListItemProps';--export type SelectItemProps = SelectPrimitive.Item.Props &- Pick<- ListItemProps,- 'startIcon' | 'endIcon' | 'description' | 'descriptionPlacement'- >;+export type SelectItemProps = ComponentPropsWithRef<+ typeof SelectPrimitive.Item+>;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectItemState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectItemState.tsnew file mode 100644index 00000000000..84c150ed47e--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectItemState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectItemState = SelectPrimitive.Item.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectItemTextProps.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectItemTextProps.tsnew file mode 100644index 00000000000..d5a90574a19--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectItemTextProps.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectItemTextProps = SelectPrimitive.ItemText.Props;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectItemTextState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectItemTextState.tsnew file mode 100644index 00000000000..271010a4a38--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectItemTextState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectItemTextState = SelectPrimitive.ItemText.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectLabelProps.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectLabelProps.tsnew file mode 100644index 00000000000..98fbb0510db--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectLabelProps.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectLabelProps = SelectPrimitive.Label.Props;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectLabelState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectLabelState.tsnew file mode 100644index 00000000000..c081eac7cca--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectLabelState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectLabelState = SelectPrimitive.Label.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectListProps.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectListProps.tsnew file mode 100644index 00000000000..f19df3f6bfc--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectListProps.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectListProps = SelectPrimitive.List.Props;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectListState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectListState.tsnew file mode 100644index 00000000000..d10422e653a--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectListState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectListState = SelectPrimitive.List.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectPopupProps.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectPopupProps.tsindex 1861b70f6f9..a38be0267d6 100644--- a/packages/twenty-ui/src/primitives/input/Select/types/SelectPopupProps.ts+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectPopupProps.ts@@ -1,18 +1,3 @@import { type Select as SelectPrimitive } from '@base-ui/react/select';-export type SelectPopupProps = SelectPrimitive.Popup.Props &- Pick<- SelectPrimitive.Positioner.Props,- | 'side'- | 'align'- | 'sideOffset'- | 'alignOffset'- | 'alignItemWithTrigger'- | 'anchor'- > & {- /**- * Element the popup is portaled into. Defaults to the theme's portal- * container.- */- container?: SelectPrimitive.Portal.Props['container'];- };+export type SelectPopupProps = SelectPrimitive.Popup.Props;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectPopupState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectPopupState.tsnew file mode 100644index 00000000000..b7c3bdca0cc--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectPopupState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectPopupState = SelectPrimitive.Popup.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectPortalProps.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectPortalProps.tsnew file mode 100644index 00000000000..9af68be31b8--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectPortalProps.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectPortalProps = SelectPrimitive.Portal.Props;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectPortalState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectPortalState.tsnew file mode 100644index 00000000000..fee981728f6--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectPortalState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectPortalState = SelectPrimitive.Portal.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectPositionerProps.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectPositionerProps.tsnew file mode 100644index 00000000000..a2d4371b39b--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectPositionerProps.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectPositionerProps = SelectPrimitive.Positioner.Props;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectPositionerState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectPositionerState.tsnew file mode 100644index 00000000000..1818b7799da--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectPositionerState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectPositionerState = SelectPrimitive.Positioner.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectRootActions.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectRootActions.tsnew file mode 100644index 00000000000..f779b15a926--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectRootActions.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectRootActions = SelectPrimitive.Root.Actions;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectRootChangeEventDetails.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectRootChangeEventDetails.tsnew file mode 100644index 00000000000..6e8a8b5f186--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectRootChangeEventDetails.ts@@ -0,0 +1,4 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectRootChangeEventDetails =+ SelectPrimitive.Root.ChangeEventDetails;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectRootChangeEventReason.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectRootChangeEventReason.tsnew file mode 100644index 00000000000..c149ae8bebf--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectRootChangeEventReason.ts@@ -0,0 +1,4 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectRootChangeEventReason =+ SelectPrimitive.Root.ChangeEventReason;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectRootState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectRootState.tsnew file mode 100644index 00000000000..320f42080d8--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectRootState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectRootState = SelectPrimitive.Root.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectScrollDownArrowProps.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectScrollDownArrowProps.tsnew file mode 100644index 00000000000..69dc2244178--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectScrollDownArrowProps.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectScrollDownArrowProps = SelectPrimitive.ScrollDownArrow.Props;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectScrollDownArrowState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectScrollDownArrowState.tsnew file mode 100644index 00000000000..6db1d02a8e4--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectScrollDownArrowState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectScrollDownArrowState = SelectPrimitive.ScrollDownArrow.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectScrollUpArrowProps.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectScrollUpArrowProps.tsnew file mode 100644index 00000000000..fd892ad9831--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectScrollUpArrowProps.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectScrollUpArrowProps = SelectPrimitive.ScrollUpArrow.Props;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectScrollUpArrowState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectScrollUpArrowState.tsnew file mode 100644index 00000000000..d54128439a6--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectScrollUpArrowState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectScrollUpArrowState = SelectPrimitive.ScrollUpArrow.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectSeparatorState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectSeparatorState.tsnew file mode 100644index 00000000000..797459385ac--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectSeparatorState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectSeparatorState = SelectPrimitive.Separator.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectTriggerState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectTriggerState.tsnew file mode 100644index 00000000000..a029e3eb809--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectTriggerState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectTriggerState = SelectPrimitive.Trigger.State;diff --git a/packages/twenty-ui/src/primitives/input/Select/types/SelectValueState.ts b/packages/twenty-ui/src/primitives/input/Select/types/SelectValueState.tsnew file mode 100644index 00000000000..aafeb37fb79--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Select/types/SelectValueState.ts@@ -0,0 +1,3 @@+import { type Select as SelectPrimitive } from '@base-ui/react/select';++export type SelectValueState = SelectPrimitive.Value.State;diff --git a/packages/twenty-ui/src/primitives/input/index.ts b/packages/twenty-ui/src/primitives/input/index.tsindex 28098dae399..e19bdc5cf38 100644--- a/packages/twenty-ui/src/primitives/input/index.ts+++ b/packages/twenty-ui/src/primitives/input/index.ts@@ -70,14 +70,47 @@ export { SegmentedControl } from './SegmentedControl/SegmentedControl';export type { SegmentedControlOption } from './SegmentedControl/types/SegmentedControlOption';export type { SegmentedControlProps } from './SegmentedControl/types/SegmentedControlProps';export { Select } from './Select/Select';+export type { SelectArrowProps } from './Select/types/SelectArrowProps';+export type { SelectArrowState } from './Select/types/SelectArrowState';+export type { SelectBackdropProps } from './Select/types/SelectBackdropProps';+export type { SelectBackdropState } from './Select/types/SelectBackdropState';export type { SelectGroupLabelProps } from './Select/types/SelectGroupLabelProps';+export type { SelectGroupLabelState } from './Select/types/SelectGroupLabelState';export type { SelectGroupProps } from './Select/types/SelectGroupProps';+export type { SelectGroupState } from './Select/types/SelectGroupState';+export type { SelectIconProps } from './Select/types/SelectIconProps';+export type { SelectIconState } from './Select/types/SelectIconState';+export type { SelectItemIndicatorProps } from './Select/types/SelectItemIndicatorProps';+export type { SelectItemIndicatorState } from './Select/types/SelectItemIndicatorState';export type { SelectItemProps } from './Select/types/SelectItemProps';+export type { SelectItemState } from './Select/types/SelectItemState';+export type { SelectItemTextProps } from './Select/types/SelectItemTextProps';+export type { SelectItemTextState } from './Select/types/SelectItemTextState';+export type { SelectLabelProps } from './Select/types/SelectLabelProps';+export type { SelectLabelState } from './Select/types/SelectLabelState';+export type { SelectListProps } from './Select/types/SelectListProps';+export type { SelectListState } from './Select/types/SelectListState';export type { SelectPopupProps } from './Select/types/SelectPopupProps';+export type { SelectPopupState } from './Select/types/SelectPopupState';+export type { SelectPortalProps } from './Select/types/SelectPortalProps';+export type { SelectPortalState } from './Select/types/SelectPortalState';+export type { SelectPositionerProps } from './Select/types/SelectPositionerProps';+export type { SelectPositionerState } from './Select/types/SelectPositionerState';+export type { SelectRootActions } from './Select/types/SelectRootActions';+export type { SelectRootChangeEventDetails } from './Select/types/SelectRootChangeEventDetails';+export type { SelectRootChangeEventReason } from './Select/types/SelectRootChangeEventReason';export type { SelectRootProps } from './Select/types/SelectRootProps';+export type { SelectRootState } from './Select/types/SelectRootState';+export type { SelectScrollDownArrowProps } from './Select/types/SelectScrollDownArrowProps';+export type { SelectScrollDownArrowState } from './Select/types/SelectScrollDownArrowState';+export type { SelectScrollUpArrowProps } from './Select/types/SelectScrollUpArrowProps';+export type { SelectScrollUpArrowState } from './Select/types/SelectScrollUpArrowState';export type { SelectSeparatorProps } from './Select/types/SelectSeparatorProps';+export type { SelectSeparatorState } from './Select/types/SelectSeparatorState';export type { SelectTriggerProps } from './Select/types/SelectTriggerProps';+export type { SelectTriggerState } from './Select/types/SelectTriggerState';export type { SelectValueProps } from './Select/types/SelectValueProps';+export type { SelectValueState } from './Select/types/SelectValueState';export { Slider } from './Slider/Slider';export type { SliderControlProps } from './Slider/types/SliderControlProps';export type { SliderIndicatorProps } from './Slider/types/SliderIndicatorProps';