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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fuzzy-needles-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bigcommerce/catalyst-core": patch
---

Delete duplicate Select component.
73 changes: 0 additions & 73 deletions core/vibes/soul/form/select-field/index.tsx

This file was deleted.

4 changes: 3 additions & 1 deletion core/vibes/soul/form/select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ export function Select({
{label}
</Label>
)}
<SelectPrimitive.Root {...rest} name={name} value={value}>
{/* Workaround for https://github.com/radix-ui/primitives/issues/3198, remove when fixed */}
<input name={name} type="hidden" value={value} />
<SelectPrimitive.Root {...rest} name={`${name}_display`} value={value}>
<SelectPrimitive.Trigger
aria-label={label}
className={clsx(
Expand Down
6 changes: 3 additions & 3 deletions core/vibes/soul/sections/cart/shipping-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { FormStatus } from '@/vibes/soul/form/form-status';
import { Input } from '@/vibes/soul/form/input';
import { Label } from '@/vibes/soul/form/label';
import { RadioGroup } from '@/vibes/soul/form/radio-group';
import { SelectField } from '@/vibes/soul/form/select-field';
import { Select } from '@/vibes/soul/form/select';
import { Button } from '@/vibes/soul/primitives/button';

import { shippingActionFormDataSchema } from '../schema';
Expand Down Expand Up @@ -267,7 +267,7 @@ export function ShippingForm({
className={clsx('mt-4 space-y-4', { hidden: !showAddressForm })}
>
{Array.isArray(countries) ? (
<SelectField
<Select
errors={addressFields.country.errors}
key={addressFields.country.id}
label={countryLabel}
Expand Down Expand Up @@ -295,7 +295,7 @@ export function ShippingForm({
/>
<div className="flex gap-3">
{Array.isArray(states) ? (
<SelectField
<Select
disabled={addressFields.country.value === undefined}
errors={addressFields.state.errors}
key={addressFields.state.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { FormStatus } from '@/vibes/soul/form/form-status';
import { Input } from '@/vibes/soul/form/input';
import { NumberInput } from '@/vibes/soul/form/number-input';
import { RadioGroup } from '@/vibes/soul/form/radio-group';
import { SelectField } from '@/vibes/soul/form/select-field';
import { Select } from '@/vibes/soul/form/select';
import { SwatchRadioGroup } from '@/vibes/soul/form/swatch-radio-group';
import { Textarea } from '@/vibes/soul/form/textarea';
import { Button } from '@/vibes/soul/primitives/button';
Expand Down Expand Up @@ -432,7 +432,7 @@ function FormField({

case 'select':
return (
<SelectField
<Select
errors={formField.errors}
key={formField.id}
label={field.label}
Expand Down
4 changes: 2 additions & 2 deletions core/vibes/soul/sections/products-list-section/sorting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { parseAsString, useQueryStates } from 'nuqs';
import { useOptimistic, useTransition } from 'react';

import { SelectField } from '@/vibes/soul/form/select-field';
import { Select } from '@/vibes/soul/form/select';
import { Streamable, useStreamable } from '@/vibes/soul/lib/streamable';

export interface Option {
Expand Down Expand Up @@ -39,7 +39,7 @@ export function Sorting({
const placeholder = useStreamable(streamablePlaceholder) ?? 'Sort by';

return (
<SelectField
<Select
hideLabel
label={label}
name={paramName}
Expand Down