Skip to content

Commit 531b32d

Browse files
authored
fix: override default RAC class names for all S2 components (#9245)
* fix: override default RAC class names for all S2 components * get rid of hidden input field class name
1 parent d5f1280 commit 531b32d

File tree

9 files changed

+12
-9
lines changed

9 files changed

+12
-9
lines changed

packages/@react-spectrum/s2/src/Calendar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,14 +353,14 @@ export const CalendarGrid = (props: Omit<AriaCalendarGridProps, 'children'> & Pr
353353
isolation: 'isolate'
354354
})}
355355
offset={{months: props.months}}>
356-
<CalendarGridHeader>
356+
<CalendarGridHeader className="">
357357
{(day) => (
358358
<CalendarHeaderCell>
359359
{day}
360360
</CalendarHeaderCell>
361361
)}
362362
</CalendarGridHeader>
363-
<CalendarGridBody>
363+
<CalendarGridBody className="">
364364
{(date) => (
365365
<CalendarCell date={date} firstDayOfWeek={props.firstDayOfWeek} />
366366
)}

packages/@react-spectrum/s2/src/DateField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export function DateInputContainer(props: PropsWithChildren): ReactElement {
171171

172172
export function DateInput(props: Omit<DateInputProps, 'children'>): ReactElement {
173173
return (
174-
<AriaDateInput {...props}>
174+
<AriaDateInput className="" {...props}>
175175
{(segment) => (
176176
<AriaDateSegment
177177
segment={segment}

packages/@react-spectrum/s2/src/Popover.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export const PopoverBase = forwardRef(function PopoverBase(props: PopoverProps,
225225
{composeRenderProps(props.children, (children, renderProps) => (
226226
<>
227227
{!hideArrow && (
228-
<OverlayArrow>
228+
<OverlayArrow className="">
229229
<svg viewBox="0 0 18 10" className={arrow(renderProps)}>
230230
<path transform="translate(0 -1)" d="M1 1L7.93799 8.52588C8.07224 8.67448 8.23607 8.79362 8.41895 8.87524C8.60182 8.95687 8.79973 8.9993 9 9C9.19984 8.99882 9.39724 8.95606 9.57959 8.87427C9.76193 8.79248 9.9253 8.67336 10.0591 8.5249L17 1" />
231231
</svg>

packages/@react-spectrum/s2/src/Tabs.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,7 @@ let CollapsingTabs = ({collection, containerRef, ...props}: {collection: Collect
681681
contents = (
682682
<RACTabs
683683
{...props}
684+
className=""
684685
style={{display: 'contents'}}>
685686
{props.children}
686687
</RACTabs>

packages/@react-spectrum/s2/src/TabsPicker.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ function Picker<T extends object>(props: PickerProps<T>, ref: FocusableRef<HTMLB
185185
<div>
186186
<AriaSelect
187187
{...pickerProps}
188+
className=""
188189
aria-labelledby={`${labelBehavior === 'hide' ? valueId : ''} ${ariaLabelledby}`}>
189190
{({isOpen}) => (
190191
<>

packages/@react-spectrum/s2/src/Tooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export const Tooltip = forwardRef(function Tooltip(props: TooltipProps, ref: DOM
174174
className={renderProps => UNSAFE_className + tooltip({...renderProps, colorScheme})}>
175175
{renderProps => (
176176
<>
177-
<OverlayArrow>
177+
<OverlayArrow className="">
178178
<svg className={arrowStyles(renderProps)} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 5">
179179
<path d="M4.29289 4.29289L0 0H10L5.70711 4.29289C5.31658 4.68342 4.68342 4.68342 4.29289 4.29289Z" />
180180
</svg>

packages/react-aria-components/src/Calendar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ function CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HT
449449
{...mergeProps(DOMProps, headerProps)}
450450
ref={ref}
451451
style={style}
452-
className={className || 'react-aria-CalendarGridHeader'}>
452+
className={className ?? 'react-aria-CalendarGridHeader'}>
453453
<tr>
454454
{weekDays.map((day, key) => React.cloneElement(children(day), {key}))}
455455
</tr>
@@ -514,7 +514,7 @@ function CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTa
514514
{...DOMProps}
515515
ref={ref}
516516
style={style}
517-
className={className || 'react-aria-CalendarGridBody'}>
517+
className={className ?? 'react-aria-CalendarGridBody'}>
518518
{[...new Array(weeksInMonth).keys()].map((weekIndex) => (
519519
<tr key={weekIndex}>
520520
{state.getDatesInWeek(weekIndex, startDate).map((date, i) => (

packages/react-aria-components/src/DateField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export const TimeField = /*#__PURE__*/ (forwardRef as forwardRefType)(function T
214214
ref={ref}
215215
slot={props.slot || undefined}
216216
data-invalid={state.isInvalid || undefined}
217-
data-disabled={state.isDisabled || undefined}
217+
data-disabled={state.isDisabled || undefined}
218218
data-readonly={state.isReadOnly || undefined} />
219219
</Provider>
220220
);
@@ -313,7 +313,7 @@ const DateInputInner = forwardRef((props: DateInputProps, ref: ForwardedRef<HTML
313313
isDisabled={state.isDisabled}>
314314
{state.segments.map((segment, i) => cloneElement(children(segment), {key: i}))}
315315
</Group>
316-
<Input />
316+
<Input className="" />
317317
</>
318318
);
319319
});

packages/react-aria-components/src/FileTrigger.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export const FileTrigger = forwardRef(function FileTrigger(props: FileTriggerPro
6464
</PressResponder>
6565
<Input
6666
{...domProps}
67+
className=""
6768
type="file"
6869
ref={inputRef}
6970
style={{display: 'none'}}

0 commit comments

Comments
 (0)