Merged in feat/SW-1557-implement-booking-code-select (pull request #1304)

feat: SW-1577 Implemented booking code city search

* feat: SW-1577 Implemented booking code city search

* feat: SW-1557 Strict comparison

* feat: SW-1557 Review comments fix


Approved-by: Michael Zetterberg
Approved-by: Pontus Dreij
This commit is contained in:
Hrishikesh Vaipurkar
2025-02-13 09:24:47 +00:00
parent d46a85a529
commit eabe45b73c
35 changed files with 627 additions and 276 deletions

View File

@@ -40,6 +40,7 @@ export default function Select({
showRadioButton = false,
discreet = false,
isNestedInModal = false,
optionsIcon,
}: SelectProps) {
const [rootDiv, setRootDiv] = useState<SelectPortalContainer>(undefined)
const setOverflowVisible = useSetOverflowVisibleOnRA(isNestedInModal)
@@ -89,7 +90,12 @@ export default function Select({
{label}
{discreet && `:`}
</Label>
{selectedText && <Body>{selectedText}</Body>}
{selectedText && (
<Body className={optionsIcon ? styles.iconLabel : ""}>
{optionsIcon ? optionsIcon : null}
{selectedText}
</Body>
)}
</>
)}
</SelectValue>
@@ -114,11 +120,12 @@ export default function Select({
{items.map((item) => (
<ListBoxItem
aria-label={item.label}
className={`${styles.listBoxItem} ${showRadioButton && styles.showRadioButton}`}
className={`${styles.listBoxItem} ${showRadioButton && styles.showRadioButton} ${optionsIcon && styles.iconLabel}`}
id={item.value}
key={item.label}
data-testid={item.label}
>
{optionsIcon ? optionsIcon : null}
{item.label}
</ListBoxItem>
))}

View File

@@ -40,6 +40,11 @@
pointer-events: none;
}
.iconLabel {
display: flex;
gap: var(--Spacing-x-half);
}
.input {
align-items: center;
background-color: var(--UI-Opacity-White-100);

View File

@@ -1,3 +1,4 @@
import type { ReactElement } from "react"
import type { Key } from "react-aria-components"
export interface SelectProps
@@ -12,6 +13,7 @@ export interface SelectProps
showRadioButton?: boolean
discreet?: boolean
isNestedInModal?: boolean
optionsIcon?: ReactElement
}
export type SelectPortalContainer = HTMLDivElement | undefined