Skip to content

Commit 16176b8

Browse files
authored
S2 TagGroup collapse (#6795)
1 parent b27e449 commit 16176b8

File tree

7 files changed

+407
-104
lines changed

7 files changed

+407
-104
lines changed

.storybook-s2/custom-addons/provider/register.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ addons.register('ProviderSwitcher', (api) => {
5555
title: 'viewport',
5656
type: types.TOOL,
5757
match: ({ viewMode }) => {
58-
console.log('viewMode', viewMode);
5958
return viewMode === 'story' || viewMode === 'docs'
6059
},
6160
render: () => <ProviderFieldSetter api={api} />,

packages/@react-spectrum/s2/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
"@parcel/macros": "2.12.1-canary.3165"
125125
},
126126
"dependencies": {
127+
"@react-aria/collections": "3.0.0-alpha.3",
127128
"@react-aria/i18n": "^3.11.0",
128129
"@react-aria/interactions": "^3.22.0",
129130
"@react-aria/utils": "^3.23.0",

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ import {Breadcrumb as AriaBreadcrumb, BreadcrumbsProps as AriaBreadcrumbsProps,
1414
import {AriaBreadcrumbItemProps, useLocale} from 'react-aria';
1515
import ChevronIcon from '../ui-icons/Chevron';
1616
import {createContext, forwardRef, ReactNode, useRef} from 'react';
17-
import {DOMRefValue, LinkDOMProps} from '@react-types/shared';
17+
import {DOMRef, DOMRefValue, LinkDOMProps} from '@react-types/shared';
1818
import {focusRing, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
1919
import {forwardRefType} from './types';
2020
import {size, style} from '../style/spectrum-theme' with { type: 'macro' };
21+
import {useDOMRef} from '@react-spectrum/utils';
2122

2223
interface BreadcrumbsStyleProps {
2324
/**
@@ -69,7 +70,7 @@ const wrapper = style<BreadcrumbsStyleProps>({
6970
}
7071
}, getAllowedOverrides());
7172

72-
function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>) {
73+
function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: DOMRef<HTMLOListElement>) {
7374
let {
7475
UNSAFE_className = '',
7576
UNSAFE_style,
@@ -78,11 +79,11 @@ function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>) {
7879
children,
7980
...otherProps
8081
} = props;
81-
let ref = useRef(null);
82+
let domRef = useDOMRef(ref);
8283
return (
8384
<RACBreadcrumbs
8485
{...otherProps}
85-
ref={ref}
86+
ref={domRef}
8687
style={UNSAFE_style}
8788
className={UNSAFE_className + wrapper({
8889
size

0 commit comments

Comments
 (0)