fix: restore old select selectors for label to still support the temp design select
deprecated the temp design select in favor of the new one
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import Select from "@/components/TempDesignSystem/Select"
|
import DeprecatedSelect from "@/components/TempDesignSystem/DeprecatedSelect"
|
||||||
|
|
||||||
import styles from "./filter.module.css"
|
import styles from "./filter.module.css"
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ export default function Filter({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<form className={styles.filterForm}>
|
<form className={styles.filterForm}>
|
||||||
<Select
|
<DeprecatedSelect
|
||||||
items={countryFilters}
|
items={countryFilters}
|
||||||
defaultSelectedKey={""}
|
defaultSelectedKey={""}
|
||||||
label={intl.formatMessage({
|
label={intl.formatMessage({
|
||||||
@@ -42,7 +42,7 @@ export default function Filter({
|
|||||||
name="country"
|
name="country"
|
||||||
onSelect={(value) => onFilterChange(JobylonFilterKey.country, value)}
|
onSelect={(value) => onFilterChange(JobylonFilterKey.country, value)}
|
||||||
/>
|
/>
|
||||||
<Select
|
<DeprecatedSelect
|
||||||
items={cityFilters}
|
items={cityFilters}
|
||||||
defaultSelectedKey={""}
|
defaultSelectedKey={""}
|
||||||
label={intl.formatMessage({
|
label={intl.formatMessage({
|
||||||
@@ -54,7 +54,7 @@ export default function Filter({
|
|||||||
name="city"
|
name="city"
|
||||||
onSelect={(value) => onFilterChange(JobylonFilterKey.city, value)}
|
onSelect={(value) => onFilterChange(JobylonFilterKey.city, value)}
|
||||||
/>
|
/>
|
||||||
<Select
|
<DeprecatedSelect
|
||||||
items={departmentFilters}
|
items={departmentFilters}
|
||||||
defaultSelectedKey={""}
|
defaultSelectedKey={""}
|
||||||
label={intl.formatMessage({
|
label={intl.formatMessage({
|
||||||
@@ -66,7 +66,7 @@ export default function Filter({
|
|||||||
name="department"
|
name="department"
|
||||||
onSelect={(value) => onFilterChange(JobylonFilterKey.department, value)}
|
onSelect={(value) => onFilterChange(JobylonFilterKey.department, value)}
|
||||||
/>
|
/>
|
||||||
<Select
|
<DeprecatedSelect
|
||||||
items={categoryFilters}
|
items={categoryFilters}
|
||||||
defaultSelectedKey={""}
|
defaultSelectedKey={""}
|
||||||
label={intl.formatMessage({
|
label={intl.formatMessage({
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
} from "@/constants/membershipLevels"
|
} from "@/constants/membershipLevels"
|
||||||
|
|
||||||
import MembershipLevelIcon from "@/components/Levels/Icon"
|
import MembershipLevelIcon from "@/components/Levels/Icon"
|
||||||
import Select from "@/components/TempDesignSystem/Select"
|
import DeprecatedSelect from "@/components/TempDesignSystem/DeprecatedSelect"
|
||||||
|
|
||||||
import LargeTable from "./LargeTable"
|
import LargeTable from "./LargeTable"
|
||||||
import LevelSummary from "./LevelSummary"
|
import LevelSummary from "./LevelSummary"
|
||||||
@@ -98,7 +98,7 @@ export default function OverviewTableClient({
|
|||||||
}
|
}
|
||||||
showDescription={false}
|
showDescription={false}
|
||||||
/>
|
/>
|
||||||
<Select
|
<DeprecatedSelect
|
||||||
aria-label={intl.formatMessage({
|
aria-label={intl.formatMessage({
|
||||||
defaultMessage: "Level",
|
defaultMessage: "Level",
|
||||||
})}
|
})}
|
||||||
@@ -137,7 +137,7 @@ export default function OverviewTableClient({
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Select
|
<DeprecatedSelect
|
||||||
aria-label={intl.formatMessage({
|
aria-label={intl.formatMessage({
|
||||||
defaultMessage: "Level",
|
defaultMessage: "Level",
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { useIntl } from "react-intl"
|
|||||||
|
|
||||||
import { useDestinationDataStore } from "@/stores/destination-data"
|
import { useDestinationDataStore } from "@/stores/destination-data"
|
||||||
|
|
||||||
import Select from "@/components/TempDesignSystem/Select"
|
import DeprecatedSelect from "@/components/TempDesignSystem/DeprecatedSelect"
|
||||||
|
|
||||||
import type { SortItem } from "@/types/components/destinationFilterAndSort"
|
import type { SortItem } from "@/types/components/destinationFilterAndSort"
|
||||||
import type { SortOption } from "@/types/enums/destinationFilterAndSort"
|
import type { SortOption } from "@/types/enums/destinationFilterAndSort"
|
||||||
@@ -21,7 +21,7 @@ export default function Sort({ sortItems }: SortProps) {
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Select
|
<DeprecatedSelect
|
||||||
items={sortItems}
|
items={sortItems}
|
||||||
defaultSelectedKey={pendingSort}
|
defaultSelectedKey={pendingSort}
|
||||||
label={intl.formatMessage({
|
label={intl.formatMessage({
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { useIntl } from "react-intl"
|
|||||||
|
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
|
||||||
import Select from "@/components/TempDesignSystem/Select"
|
import DeprecatedSelect from "@/components/TempDesignSystem/DeprecatedSelect"
|
||||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||||
|
|
||||||
import styles from "./child-selector.module.css"
|
import styles from "./child-selector.module.css"
|
||||||
@@ -100,7 +100,7 @@ export default function ChildInfoSelector({
|
|||||||
<>
|
<>
|
||||||
<div key={index} className={styles.childInfoContainer}>
|
<div key={index} className={styles.childInfoContainer}>
|
||||||
<div>
|
<div>
|
||||||
<Select
|
<DeprecatedSelect
|
||||||
required={true}
|
required={true}
|
||||||
items={ageList}
|
items={ageList}
|
||||||
label={ageLabel}
|
label={ageLabel}
|
||||||
@@ -116,7 +116,7 @@ export default function ChildInfoSelector({
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{child.age >= 0 ? (
|
{child.age >= 0 ? (
|
||||||
<Select
|
<DeprecatedSelect
|
||||||
items={getAvailableBeds(child.age)}
|
items={getAvailableBeds(child.age)}
|
||||||
label={bedLabel}
|
label={bedLabel}
|
||||||
aria-label={bedLabel}
|
aria-label={bedLabel}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
|||||||
import { useHotelFilterStore } from "@/stores/hotel-filters"
|
import { useHotelFilterStore } from "@/stores/hotel-filters"
|
||||||
|
|
||||||
import Button from "@/components/TempDesignSystem/Button"
|
import Button from "@/components/TempDesignSystem/Button"
|
||||||
import Select from "@/components/TempDesignSystem/Select"
|
import DeprecatedSelect from "@/components/TempDesignSystem/DeprecatedSelect"
|
||||||
import Footnote from "@/components/TempDesignSystem/Text/Footnote"
|
import Footnote from "@/components/TempDesignSystem/Text/Footnote"
|
||||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||||
import useInitializeFiltersFromUrl from "@/hooks/useInitializeFiltersFromUrl"
|
import useInitializeFiltersFromUrl from "@/hooks/useInitializeFiltersFromUrl"
|
||||||
@@ -167,7 +167,7 @@ export default function FilterAndSortModal({
|
|||||||
</Subtitle>
|
</Subtitle>
|
||||||
</header>
|
</header>
|
||||||
<div className={styles.sorter}>
|
<div className={styles.sorter}>
|
||||||
<Select
|
<DeprecatedSelect
|
||||||
items={sortItems}
|
items={sortItems}
|
||||||
defaultSelectedKey={
|
defaultSelectedKey={
|
||||||
searchParams.get("sort") ?? DEFAULT_SORT
|
searchParams.get("sort") ?? DEFAULT_SORT
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { usePathname, useSearchParams } from "next/navigation"
|
|||||||
import { useCallback } from "react"
|
import { useCallback } from "react"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import Select from "@/components/TempDesignSystem/Select"
|
import DeprecatedSelect from "@/components/TempDesignSystem/DeprecatedSelect"
|
||||||
import { trackEvent } from "@/utils/tracking/base"
|
import { trackEvent } from "@/utils/tracking/base"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -71,7 +71,7 @@ export default function HotelSorter({ discreet }: HotelSorterProps) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Select
|
<DeprecatedSelect
|
||||||
items={sortItems}
|
items={sortItems}
|
||||||
defaultSelectedKey={searchParams.get("sort") ?? DEFAULT_SORT}
|
defaultSelectedKey={searchParams.get("sort") ?? DEFAULT_SORT}
|
||||||
label={intl.formatMessage({
|
label={intl.formatMessage({
|
||||||
|
|||||||
@@ -123,20 +123,3 @@
|
|||||||
.listBoxItem[data-selected="true"].showRadioButton:before {
|
.listBoxItem[data-selected="true"].showRadioButton:before {
|
||||||
box-shadow: inset 0 0 0 8px var(--Surface-UI-Fill-Active);
|
box-shadow: inset 0 0 0 8px var(--Surface-UI-Fill-Active);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Use global react aria classnames here since setting a css modules classname overrides
|
|
||||||
the class set by react aria.We use that class to style the child label component. */
|
|
||||||
.select:not(.discreet) :global(.react-aria-SelectValue) {
|
|
||||||
display: grid;
|
|
||||||
transition: height 200ms ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input :global(.react-aria-SelectValue) {
|
|
||||||
height: 18px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input :global(.react-aria-SelectValue):has(:nth-child(2)) {
|
|
||||||
height: 38px;
|
|
||||||
overflow: visible;
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { useController, useFormContext } from "react-hook-form"
|
import { useController, useFormContext } from "react-hook-form"
|
||||||
|
|
||||||
import ReactAriaSelect from "@/components/TempDesignSystem/Select"
|
import DeprecatedSelect from "@/components/TempDesignSystem/DeprecatedSelect"
|
||||||
|
|
||||||
import type { SelectProps } from "./select"
|
import type { SelectProps } from "./select"
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ export default function Select({
|
|||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ReactAriaSelect
|
<DeprecatedSelect
|
||||||
className={className}
|
className={className}
|
||||||
defaultSelectedKey={field.value}
|
defaultSelectedKey={field.value}
|
||||||
disabled={disabled || field.disabled}
|
disabled={disabled || field.disabled}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { RegisterOptions } from "react-hook-form"
|
import type { RegisterOptions } from "react-hook-form"
|
||||||
|
|
||||||
import type { SelectProps as ReactAriaSelectProps } from "@/components/TempDesignSystem/Select/select"
|
import type { SelectProps as ReactAriaSelectProps } from "@/components/TempDesignSystem/DeprecatedSelect/select"
|
||||||
|
|
||||||
export interface SelectProps
|
export interface SelectProps
|
||||||
extends Omit<
|
extends Omit<
|
||||||
|
|||||||
@@ -82,3 +82,17 @@ textarea:disabled {
|
|||||||
margin-bottom: var(--Space-x05);
|
margin-bottom: var(--Space-x05);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Legacy selector for deprecated select component */
|
||||||
|
:global(.select-container)[data-disabled] .label {
|
||||||
|
color: var(--Text-Interactive-Disabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.select-button) .label {
|
||||||
|
order: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.select-container)[data-open='true'] .label:not(.discreet),
|
||||||
|
:global(.react-aria-SelectValue):has(:nth-child(2)) .label:not(.discreet) {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user