Skip to content

Commit 587b230

Browse files
fix: Release audit (#8575)
* fix: release audit issues * fix stately form props * fix era --------- Co-authored-by: Daniel Lu <[email protected]>
1 parent a98c2a5 commit 587b230

File tree

8 files changed

+16
-31
lines changed

8 files changed

+16
-31
lines changed

packages/@adobe/spectrum-css-temp/components/tabs/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ governing permissions and limitations under the License.
246246
/*
247247
Allow tab labels to wrap when TabList component has minWidth set.
248248
*/
249-
&.spectrum-Tabs--verticalWrap:not(.spectrum-Tabs--compact) .spectrum-Tabs-item {
249+
&:not(.spectrum-Tabs--compact) .spectrum-Tabs-item {
250250
display: flex;
251251
align-items: center;
252252
white-space: normal;

packages/@react-aria/calendar/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export {useCalendar} from './useCalendar';
1414
export {useRangeCalendar} from './useRangeCalendar';
1515
export {useCalendarGrid} from './useCalendarGrid';
1616
export {useCalendarCell} from './useCalendarCell';
17-
export {getEraFormat} from './utils';
1817

1918
export type {AriaCalendarProps, AriaRangeCalendarProps, CalendarProps, DateValue, RangeCalendarProps} from '@react-types/calendar';
2019
export type {CalendarAria} from './useCalendarBase';

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
RangeCalendarStateContext,
3232
Text
3333
} from 'react-aria-components';
34-
import {AriaCalendarGridProps, getEraFormat} from '@react-aria/calendar';
34+
import {AriaCalendarGridProps} from '@react-aria/calendar';
3535
import {baseColor, focusRing, lightDark, style} from '../style' with {type: 'macro'};
3636
import {
3737
CalendarDate,
@@ -363,11 +363,11 @@ export const CalendarHeading = (): ReactElement => {
363363
let calendarStateContext = useContext(CalendarStateContext);
364364
let rangeCalendarStateContext = useContext(RangeCalendarStateContext);
365365
let {visibleRange, timeZone} = calendarStateContext ?? rangeCalendarStateContext ?? {};
366-
let era: any = getEraFormat(visibleRange?.start) || getEraFormat(visibleRange?.end);
366+
let currentMonth = visibleRange?.start ?? visibleRange?.end;
367367
let monthFormatter = useDateFormatter({
368368
month: 'long',
369369
year: 'numeric',
370-
era,
370+
era: currentMonth && currentMonth.calendar.identifier === 'gregory' && currentMonth.era === 'BC' ? 'short' : undefined,
371371
calendar: visibleRange?.start.calendar.identifier,
372372
timeZone
373373
});

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ function TabLine(props: TabLineProps) {
261261
* A TabList is used within Tabs to group tabs that a user can switch between.
262262
* The keys of the items within the <TabList> must match up with a corresponding item inside the <TabPanels>.
263263
*/
264-
export function TabList<T>(props: SpectrumTabListProps<T> & {wrap?: boolean}): ReactNode {
264+
export function TabList<T>(props: SpectrumTabListProps<T>): ReactNode {
265265
const tabContext = useContext(TabContext)!;
266266
const {refs, tabState, tabProps, tabPanelProps} = tabContext;
267267
const {isQuiet, density, isEmphasized, orientation} = tabProps;
@@ -288,8 +288,6 @@ export function TabList<T>(props: SpectrumTabListProps<T> & {wrap?: boolean}): R
288288

289289
let tabListclassName = classNames(styles, 'spectrum-TabsPanel-tabs');
290290

291-
const verticalWrap = props.wrap && orientation === 'vertical';
292-
293291
const tabContent = (
294292
<div
295293
{...stylePropsFinal}
@@ -303,8 +301,7 @@ export function TabList<T>(props: SpectrumTabListProps<T> & {wrap?: boolean}): R
303301
{
304302
'spectrum-Tabs--quiet': isQuiet,
305303
'spectrum-Tabs--emphasized': isEmphasized,
306-
['spectrum-Tabs--compact']: density === 'compact',
307-
'spectrum-Tabs--verticalWrap': verticalWrap
304+
['spectrum-Tabs--compact']: density === 'compact'
308305
},
309306
orientation === 'vertical' && styleProps.className
310307
)

packages/@react-types/checkbox/src/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export interface AriaToggleProps extends ToggleProps, FocusableDOMProps, AriaLab
6464
'aria-controls'?: string
6565
}
6666

67-
export interface CheckboxGroupProps extends ValueBase<string[]>, InputBase, InputDOMProps, LabelableProps, HelpTextProps, Validation<string[]> {}
67+
export interface CheckboxGroupProps extends ValueBase<string[]>, Pick<InputDOMProps, 'name'>, InputBase, LabelableProps, HelpTextProps, Validation<string[]> {}
6868

6969
export interface CheckboxProps extends ToggleProps {
7070
/**
@@ -74,9 +74,9 @@ export interface CheckboxProps extends ToggleProps {
7474
isIndeterminate?: boolean
7575
}
7676

77-
export interface AriaCheckboxProps extends CheckboxProps, AriaToggleProps {}
77+
export interface AriaCheckboxProps extends CheckboxProps, InputDOMProps, AriaToggleProps {}
7878

79-
export interface AriaCheckboxGroupProps extends CheckboxGroupProps, DOMProps, AriaLabelingProps, AriaValidationProps, FocusEvents {}
79+
export interface AriaCheckboxGroupProps extends CheckboxGroupProps, InputDOMProps, DOMProps, AriaLabelingProps, AriaValidationProps, FocusEvents {}
8080

8181
export interface AriaCheckboxGroupItemProps extends Omit<AriaCheckboxProps, 'isSelected' | 'defaultSelected'> {
8282
value: string

packages/@react-types/datepicker/src/index.d.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ interface DatePickerBase<T extends DateValue> extends DateFieldBase<T>, OverlayT
8181
*/
8282
firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'
8383
}
84-
export interface AriaDatePickerBaseProps<T extends DateValue> extends DatePickerBase<T>, AriaLabelingProps, DOMProps {}
84+
export interface AriaDatePickerBaseProps<T extends DateValue> extends DatePickerBase<T>, AriaLabelingProps, InputDOMProps, DOMProps {}
8585

8686
export interface DatePickerProps<T extends DateValue> extends DatePickerBase<T>, ValueBase<T | null, MappedDateValue<T> | null> {}
87-
export interface AriaDatePickerProps<T extends DateValue> extends DatePickerProps<T>, AriaDatePickerBaseProps<T>, InputDOMProps {}
87+
export interface AriaDatePickerProps<T extends DateValue> extends DatePickerProps<T>, AriaDatePickerBaseProps<T> {}
8888

8989
export type DateRange = RangeValue<DateValue>;
9090
export interface DateRangePickerProps<T extends DateValue> extends Omit<DatePickerBase<T>, 'validate' | 'autoComplete'>, Validation<RangeValue<MappedDateValue<T>>>, ValueBase<RangeValue<T> | null, RangeValue<MappedDateValue<T>> | null> {
@@ -100,13 +100,7 @@ export interface DateRangePickerProps<T extends DateValue> extends Omit<DatePick
100100
/**
101101
* The name of the end date input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
102102
*/
103-
endName?: string,
104-
/**
105-
* The `<form>` element to associate the input with.
106-
* The value of this attribute must be the id of a `<form>` in the same document.
107-
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).
108-
*/
109-
form?: string
103+
endName?: string
110104
}
111105

112106
export interface AriaDateRangePickerProps<T extends DateValue> extends Omit<AriaDatePickerBaseProps<T>, 'validate' | 'autoComplete'>, DateRangePickerProps<T> {}
@@ -137,7 +131,7 @@ interface SpectrumDatePickerBase<T extends DateValue> extends SpectrumDateFieldB
137131
shouldFlip?: boolean,
138132
/**
139133
* A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)
140-
* object for a given calendar identifier. This will be used for the popover calendar. If not provided, the
134+
* object for a given calendar identifier. This will be used for the popover calendar. If not provided, the
141135
* `createCalendar` function from `@internationalized/date` will be used.
142136
*/
143137
createCalendar?: (identifier: CalendarIdentifier) => ICalendar

packages/@react-types/radio/src/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
} from '@react-types/shared';
3131
import {ReactElement, ReactNode} from 'react';
3232

33-
export interface RadioGroupProps extends ValueBase<string|null, string>, InputBase, InputDOMProps, Validation<string | null>, LabelableProps, HelpTextProps, FocusEvents {
33+
export interface RadioGroupProps extends ValueBase<string|null, string>, InputBase, Pick<InputDOMProps, 'name'>, Validation<string | null>, LabelableProps, HelpTextProps, FocusEvents {
3434
/**
3535
* The axis the Radio Button(s) should align with.
3636
* @default 'vertical'
@@ -55,7 +55,7 @@ export interface RadioProps extends FocusableProps {
5555
isDisabled?: boolean
5656
}
5757

58-
export interface AriaRadioGroupProps extends RadioGroupProps, DOMProps, AriaLabelingProps, AriaValidationProps {}
58+
export interface AriaRadioGroupProps extends RadioGroupProps, InputDOMProps, DOMProps, AriaLabelingProps, AriaValidationProps {}
5959
export interface SpectrumRadioGroupProps extends AriaRadioGroupProps, SpectrumLabelableProps, StyleProps, SpectrumHelpTextProps {
6060
/**
6161
* The Radio(s) contained within the RadioGroup.

packages/@react-types/tabs/src/index.d.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,7 @@ export interface SpectrumTabsProps<T> extends AriaTabListBase, Omit<SingleSelect
8181

8282
export interface SpectrumTabListProps<T> extends DOMProps, StyleProps {
8383
/** The tab items to display. Item keys should match the key of the corresponding `<Item>` within the `<TabPanels>` element. */
84-
children: CollectionChildren<T>,
85-
/**
86-
* 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.
87-
* @default false
88-
*/
89-
wrap?: boolean
84+
children: CollectionChildren<T>
9085
}
9186

9287
export interface SpectrumTabPanelsProps<T> extends DOMProps, StyleProps {

0 commit comments

Comments
 (0)