Skip to content

Commit

Permalink
S2 TagGroup collapse (adobe#6795)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowystinger committed Aug 15, 2024
1 parent b27e449 commit 16176b8
Show file tree
Hide file tree
Showing 7 changed files with 407 additions and 104 deletions.
1 change: 0 additions & 1 deletion .storybook-s2/custom-addons/provider/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ addons.register('ProviderSwitcher', (api) => {
title: 'viewport',
type: types.TOOL,
match: ({ viewMode }) => {
console.log('viewMode', viewMode);
return viewMode === 'story' || viewMode === 'docs'
},
render: () => <ProviderFieldSetter api={api} />,
Expand Down
1 change: 1 addition & 0 deletions packages/@react-spectrum/s2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"@parcel/macros": "2.12.1-canary.3165"
},
"dependencies": {
"@react-aria/collections": "3.0.0-alpha.3",
"@react-aria/i18n": "^3.11.0",
"@react-aria/interactions": "^3.22.0",
"@react-aria/utils": "^3.23.0",
Expand Down
9 changes: 5 additions & 4 deletions packages/@react-spectrum/s2/src/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ import {Breadcrumb as AriaBreadcrumb, BreadcrumbsProps as AriaBreadcrumbsProps,
import {AriaBreadcrumbItemProps, useLocale} from 'react-aria';
import ChevronIcon from '../ui-icons/Chevron';
import {createContext, forwardRef, ReactNode, useRef} from 'react';
import {DOMRefValue, LinkDOMProps} from '@react-types/shared';
import {DOMRef, DOMRefValue, LinkDOMProps} from '@react-types/shared';
import {focusRing, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
import {forwardRefType} from './types';
import {size, style} from '../style/spectrum-theme' with { type: 'macro' };
import {useDOMRef} from '@react-spectrum/utils';

interface BreadcrumbsStyleProps {
/**
Expand Down Expand Up @@ -69,7 +70,7 @@ const wrapper = style<BreadcrumbsStyleProps>({
}
}, getAllowedOverrides());

function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>) {
function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: DOMRef<HTMLOListElement>) {
let {
UNSAFE_className = '',
UNSAFE_style,
Expand All @@ -78,11 +79,11 @@ function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>) {
children,
...otherProps
} = props;
let ref = useRef(null);
let domRef = useDOMRef(ref);
return (
<RACBreadcrumbs
{...otherProps}
ref={ref}
ref={domRef}
style={UNSAFE_style}
className={UNSAFE_className + wrapper({
size
Expand Down
Loading

0 comments on commit 16176b8

Please sign in to comment.