From e2d24fc98e4d16f2206b78d9c6d7e281319f4ddd Mon Sep 17 00:00:00 2001 From: Robert Snow Date: Fri, 18 Jul 2025 13:28:15 +1000 Subject: [PATCH 1/3] fix: release audit issues --- .../@adobe/spectrum-css-temp/components/tabs/index.css | 2 +- packages/@react-aria/calendar/src/index.ts | 1 - packages/@react-spectrum/s2/src/Calendar.tsx | 5 ++--- packages/@react-spectrum/tabs/src/Tabs.tsx | 7 ++----- packages/@react-types/tabs/src/index.d.ts | 7 +------ 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/packages/@adobe/spectrum-css-temp/components/tabs/index.css b/packages/@adobe/spectrum-css-temp/components/tabs/index.css index ca3fbe2772f..5c218b253e2 100644 --- a/packages/@adobe/spectrum-css-temp/components/tabs/index.css +++ b/packages/@adobe/spectrum-css-temp/components/tabs/index.css @@ -246,7 +246,7 @@ governing permissions and limitations under the License. /* Allow tab labels to wrap when TabList component has minWidth set. */ - &.spectrum-Tabs--verticalWrap:not(.spectrum-Tabs--compact) .spectrum-Tabs-item { + &:not(.spectrum-Tabs--compact) .spectrum-Tabs-item { display: flex; align-items: center; white-space: normal; diff --git a/packages/@react-aria/calendar/src/index.ts b/packages/@react-aria/calendar/src/index.ts index f9da6b5f40c..1676e603a42 100644 --- a/packages/@react-aria/calendar/src/index.ts +++ b/packages/@react-aria/calendar/src/index.ts @@ -14,7 +14,6 @@ export {useCalendar} from './useCalendar'; export {useRangeCalendar} from './useRangeCalendar'; export {useCalendarGrid} from './useCalendarGrid'; export {useCalendarCell} from './useCalendarCell'; -export {getEraFormat} from './utils'; export type {AriaCalendarProps, AriaRangeCalendarProps, CalendarProps, DateValue, RangeCalendarProps} from '@react-types/calendar'; export type {CalendarAria} from './useCalendarBase'; diff --git a/packages/@react-spectrum/s2/src/Calendar.tsx b/packages/@react-spectrum/s2/src/Calendar.tsx index 0950485650a..6b4f11400a7 100644 --- a/packages/@react-spectrum/s2/src/Calendar.tsx +++ b/packages/@react-spectrum/s2/src/Calendar.tsx @@ -31,7 +31,7 @@ import { RangeCalendarStateContext, Text } from 'react-aria-components'; -import {AriaCalendarGridProps, getEraFormat} from '@react-aria/calendar'; +import {AriaCalendarGridProps} from '@react-aria/calendar'; import {baseColor, focusRing, lightDark, style} from '../style' with {type: 'macro'}; import { CalendarDate, @@ -363,11 +363,10 @@ export const CalendarHeading = (): ReactElement => { let calendarStateContext = useContext(CalendarStateContext); let rangeCalendarStateContext = useContext(RangeCalendarStateContext); let {visibleRange, timeZone} = calendarStateContext ?? rangeCalendarStateContext ?? {}; - let era: any = getEraFormat(visibleRange?.start) || getEraFormat(visibleRange?.end); let monthFormatter = useDateFormatter({ month: 'long', year: 'numeric', - era, + era: (visibleRange?.start.era ?? visibleRange?.end.era) as 'long' | 'short' | 'narrow' | undefined, calendar: visibleRange?.start.calendar.identifier, timeZone }); diff --git a/packages/@react-spectrum/tabs/src/Tabs.tsx b/packages/@react-spectrum/tabs/src/Tabs.tsx index f7907940efc..e6342c14bb7 100644 --- a/packages/@react-spectrum/tabs/src/Tabs.tsx +++ b/packages/@react-spectrum/tabs/src/Tabs.tsx @@ -261,7 +261,7 @@ function TabLine(props: TabLineProps) { * A TabList is used within Tabs to group tabs that a user can switch between. * The keys of the items within the must match up with a corresponding item inside the . */ -export function TabList(props: SpectrumTabListProps & {wrap?: boolean}): ReactNode { +export function TabList(props: SpectrumTabListProps): ReactNode { const tabContext = useContext(TabContext)!; const {refs, tabState, tabProps, tabPanelProps} = tabContext; const {isQuiet, density, isEmphasized, orientation} = tabProps; @@ -288,8 +288,6 @@ export function TabList(props: SpectrumTabListProps & {wrap?: boolean}): R let tabListclassName = classNames(styles, 'spectrum-TabsPanel-tabs'); - const verticalWrap = props.wrap && orientation === 'vertical'; - const tabContent = (
(props: SpectrumTabListProps & {wrap?: boolean}): R { 'spectrum-Tabs--quiet': isQuiet, 'spectrum-Tabs--emphasized': isEmphasized, - ['spectrum-Tabs--compact']: density === 'compact', - 'spectrum-Tabs--verticalWrap': verticalWrap + ['spectrum-Tabs--compact']: density === 'compact' }, orientation === 'vertical' && styleProps.className ) diff --git a/packages/@react-types/tabs/src/index.d.ts b/packages/@react-types/tabs/src/index.d.ts index 2f1ea36b428..a24d94a8338 100644 --- a/packages/@react-types/tabs/src/index.d.ts +++ b/packages/@react-types/tabs/src/index.d.ts @@ -81,12 +81,7 @@ export interface SpectrumTabsProps extends AriaTabListBase, Omit extends DOMProps, StyleProps { /** The tab items to display. Item keys should match the key of the corresponding `` within the `` element. */ - children: CollectionChildren, - /** - * When `true`, tab labels will wrap if they exceed the TabList's width. Only supported in vertical orientation with `regular` density. For proper wrapping, set a `minWidth` on TabList. - * @default false - */ - wrap?: boolean + children: CollectionChildren } export interface SpectrumTabPanelsProps extends DOMProps, StyleProps { From f689c32c49799f9394b67b57cec7b10a86855c19 Mon Sep 17 00:00:00 2001 From: Robert Snow Date: Fri, 18 Jul 2025 14:03:14 +1000 Subject: [PATCH 2/3] fix stately form props --- packages/@react-types/checkbox/src/index.d.ts | 6 +++--- packages/@react-types/datepicker/src/index.d.ts | 14 ++++---------- packages/@react-types/radio/src/index.d.ts | 4 ++-- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/packages/@react-types/checkbox/src/index.d.ts b/packages/@react-types/checkbox/src/index.d.ts index a2bcfb85327..0e8ea876149 100644 --- a/packages/@react-types/checkbox/src/index.d.ts +++ b/packages/@react-types/checkbox/src/index.d.ts @@ -64,7 +64,7 @@ export interface AriaToggleProps extends ToggleProps, FocusableDOMProps, AriaLab 'aria-controls'?: string } -export interface CheckboxGroupProps extends ValueBase, InputBase, InputDOMProps, LabelableProps, HelpTextProps, Validation {} +export interface CheckboxGroupProps extends ValueBase, Pick, InputBase, LabelableProps, HelpTextProps, Validation {} export interface CheckboxProps extends ToggleProps { /** @@ -74,9 +74,9 @@ export interface CheckboxProps extends ToggleProps { isIndeterminate?: boolean } -export interface AriaCheckboxProps extends CheckboxProps, AriaToggleProps {} +export interface AriaCheckboxProps extends CheckboxProps, InputDOMProps, AriaToggleProps {} -export interface AriaCheckboxGroupProps extends CheckboxGroupProps, DOMProps, AriaLabelingProps, AriaValidationProps, FocusEvents {} +export interface AriaCheckboxGroupProps extends CheckboxGroupProps, InputDOMProps, DOMProps, AriaLabelingProps, AriaValidationProps, FocusEvents {} export interface AriaCheckboxGroupItemProps extends Omit { value: string diff --git a/packages/@react-types/datepicker/src/index.d.ts b/packages/@react-types/datepicker/src/index.d.ts index d1fd486416e..6877d61e49c 100644 --- a/packages/@react-types/datepicker/src/index.d.ts +++ b/packages/@react-types/datepicker/src/index.d.ts @@ -81,10 +81,10 @@ interface DatePickerBase extends DateFieldBase, OverlayT */ firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' } -export interface AriaDatePickerBaseProps extends DatePickerBase, AriaLabelingProps, DOMProps {} +export interface AriaDatePickerBaseProps extends DatePickerBase, AriaLabelingProps, InputDOMProps, DOMProps {} export interface DatePickerProps extends DatePickerBase, ValueBase | null> {} -export interface AriaDatePickerProps extends DatePickerProps, AriaDatePickerBaseProps, InputDOMProps {} +export interface AriaDatePickerProps extends DatePickerProps, AriaDatePickerBaseProps {} export type DateRange = RangeValue; export interface DateRangePickerProps extends Omit, 'validate' | 'autoComplete'>, Validation>>, ValueBase | null, RangeValue> | null> { @@ -100,13 +100,7 @@ export interface DateRangePickerProps extends Omit` element to associate the input with. - * The value of this attribute must be the id of a `
` in the same document. - * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form). - */ - form?: string + endName?: string } export interface AriaDateRangePickerProps extends Omit, 'validate' | 'autoComplete'>, DateRangePickerProps {} @@ -137,7 +131,7 @@ interface SpectrumDatePickerBase extends SpectrumDateFieldB shouldFlip?: boolean, /** * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) - * object for a given calendar identifier. This will be used for the popover calendar. If not provided, the + * object for a given calendar identifier. This will be used for the popover calendar. If not provided, the * `createCalendar` function from `@internationalized/date` will be used. */ createCalendar?: (identifier: CalendarIdentifier) => ICalendar diff --git a/packages/@react-types/radio/src/index.d.ts b/packages/@react-types/radio/src/index.d.ts index 54ebb3c8bd0..5916b6bc51d 100644 --- a/packages/@react-types/radio/src/index.d.ts +++ b/packages/@react-types/radio/src/index.d.ts @@ -30,7 +30,7 @@ import { } from '@react-types/shared'; import {ReactElement, ReactNode} from 'react'; -export interface RadioGroupProps extends ValueBase, InputBase, InputDOMProps, Validation, LabelableProps, HelpTextProps, FocusEvents { +export interface RadioGroupProps extends ValueBase, InputBase, Pick, Validation, LabelableProps, HelpTextProps, FocusEvents { /** * The axis the Radio Button(s) should align with. * @default 'vertical' @@ -55,7 +55,7 @@ export interface RadioProps extends FocusableProps { isDisabled?: boolean } -export interface AriaRadioGroupProps extends RadioGroupProps, DOMProps, AriaLabelingProps, AriaValidationProps {} +export interface AriaRadioGroupProps extends RadioGroupProps, InputDOMProps, DOMProps, AriaLabelingProps, AriaValidationProps {} export interface SpectrumRadioGroupProps extends AriaRadioGroupProps, SpectrumLabelableProps, StyleProps, SpectrumHelpTextProps { /** * The Radio(s) contained within the RadioGroup. From 161cd1d582953188b758e6c10c8b31277f4444e4 Mon Sep 17 00:00:00 2001 From: Daniel Lu Date: Fri, 18 Jul 2025 13:25:36 -0700 Subject: [PATCH 3/3] fix era --- packages/@react-spectrum/s2/src/Calendar.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@react-spectrum/s2/src/Calendar.tsx b/packages/@react-spectrum/s2/src/Calendar.tsx index 6b4f11400a7..4d8d3bccd73 100644 --- a/packages/@react-spectrum/s2/src/Calendar.tsx +++ b/packages/@react-spectrum/s2/src/Calendar.tsx @@ -363,10 +363,11 @@ export const CalendarHeading = (): ReactElement => { let calendarStateContext = useContext(CalendarStateContext); let rangeCalendarStateContext = useContext(RangeCalendarStateContext); let {visibleRange, timeZone} = calendarStateContext ?? rangeCalendarStateContext ?? {}; + let currentMonth = visibleRange?.start ?? visibleRange?.end; let monthFormatter = useDateFormatter({ month: 'long', year: 'numeric', - era: (visibleRange?.start.era ?? visibleRange?.end.era) as 'long' | 'short' | 'narrow' | undefined, + era: currentMonth && currentMonth.calendar.identifier === 'gregory' && currentMonth.era === 'BC' ? 'short' : undefined, calendar: visibleRange?.start.calendar.identifier, timeZone });