Skip to content

Commit d27e833

Browse files
authored
types: fix S2 types/defaults (#6917)
1 parent 64e4a40 commit d27e833

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function Avatar(props: AvatarProps, ref: DOMRef<HTMLImageElement>) {
6262
src,
6363
UNSAFE_style,
6464
UNSAFE_className = '',
65-
size,
65+
size = 24,
6666
isOverBackground,
6767
...otherProps
6868
} = props;

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ import {useDOMRef} from '@react-spectrum/utils';
2525
import {useSpectrumContextProps} from './useSpectrumContextProps';
2626

2727
interface MeterStyleProps {
28-
/** The [visual style](https://spectrum.adobe.com/page/meter/#-Options) of the Meter. */
29-
variant: 'informative' | 'positive' | 'notice' | 'negative',
28+
/** The [visual style](https://spectrum.adobe.com/page/meter/#-Options) of the Meter.
29+
* @default 'informative'
30+
*/
31+
variant?: 'informative' | 'positive' | 'notice' | 'negative',
3032
/**
3133
* The size of the Meter.
3234
*
@@ -109,7 +111,7 @@ function Meter(props: MeterProps, ref: DOMRef<HTMLDivElement>) {
109111
styles,
110112
UNSAFE_className = '',
111113
UNSAFE_style,
112-
variant,
114+
variant = 'informative',
113115
...groupProps
114116
} = props;
115117

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ export interface TabsProps extends Omit<AriaTabsProps, 'className' | 'style' | '
4040
styles?: StylesPropWithHeight,
4141
/** The content to display in the tabs. */
4242
children?: ReactNode,
43-
/** The amount of space between the tabs. */
43+
/**
44+
* The amount of space between the tabs.
45+
* @default "regular"
46+
*/
4447
density?: 'compact' | 'regular'
4548
}
4649

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ let _Tag = /*#__PURE__*/ (forwardRef as forwardRefType)(Tag);
547547
export {_Tag as Tag};
548548

549549
function TagWrapper({children, isDisabled, allowsRemoving, isInRealDOM}) {
550-
let {size} = useSlottedContext(TagGroupContext) ?? {};
550+
let {size = 'M'} = useSlottedContext(TagGroupContext) ?? {};
551551
return (
552552
<>
553553
{isInRealDOM && (

0 commit comments

Comments
 (0)