Skip to content

Commit 636e403

Browse files
fix(deps): update non-major package dependencies (#1692)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jonathan Zempel <jzempel@gmail.com>
1 parent cd8d54b commit 636e403

File tree

4 files changed

+26
-64
lines changed

4 files changed

+26
-64
lines changed

.github/renovate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": ["config:base"],
33
"rebaseStalePrs": true,
4-
"ignorePaths": ["**/node_modules/**", "packages/dropdowns"],
4+
"ignorePaths": ["**/node_modules/**", "packages/dropdowns/**"],
55
"schedule": ["on Monday every 9 weeks of the year starting on the 5th week"],
66
"labels": ["PR: Internal :seedling:"],
77
"postUpdateOptions": ["npmDedupe"],

package-lock.json

Lines changed: 5 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/chrome/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"sideEffects": false,
2222
"types": "dist/typings/index.d.ts",
2323
"dependencies": {
24-
"@zendeskgarden/container-accordion": "^2.0.0",
24+
"@zendeskgarden/container-accordion": "^3.0.4",
2525
"@zendeskgarden/container-utilities": "^2.0.0",
2626
"dom-helpers": "^5.2.1",
2727
"polished": "^4.0.0",

packages/chrome/src/elements/subnav/CollapsibleSubNavItem.tsx

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* found at http://www.apache.org/licenses/LICENSE-2.0.
66
*/
77

8-
import React, { useEffect, useRef, useState } from 'react';
8+
import React, { ButtonHTMLAttributes, HTMLAttributes, createRef, useEffect, useState } from 'react';
99
import PropTypes from 'prop-types';
1010
import { useAccordion } from '@zendeskgarden/container-accordion';
1111
import { getControlledValue } from '@zendeskgarden/container-utilities';
@@ -24,12 +24,14 @@ import { useChromeContext } from '../../utils/useChromeContext';
2424
export const CollapsibleSubNavItem = React.forwardRef<HTMLDivElement, ICollapsibleSubNavItemProps>(
2525
({ header, children, isExpanded: controlledExpanded, onChange, ...other }, ref) => {
2626
const { isDark, isLight } = useChromeContext();
27-
const panelRef = useRef<HTMLDivElement>();
27+
const panelRef = createRef<HTMLDivElement>();
2828
const [internalExpanded, setInternalExpanded] = useState(controlledExpanded);
2929
const expanded = getControlledValue(controlledExpanded, internalExpanded);
30-
const expandedSections = expanded ? [0] : [];
30+
const value = 0;
31+
const expandedSections = expanded ? [value] : [];
3132

3233
const { getHeaderProps, getTriggerProps, getPanelProps } = useAccordion({
34+
sections: [value],
3335
expandedSections,
3436
onChange: () => {
3537
const isExpanded = expandedSections.length === 0;
@@ -46,21 +48,22 @@ export const CollapsibleSubNavItem = React.forwardRef<HTMLDivElement, ICollapsib
4648
if (expanded && panelRef.current) {
4749
panelRef.current.style.maxHeight = `${panelRef.current.scrollHeight}px`;
4850
}
49-
}, [expanded, children]);
51+
}, [expanded, children, panelRef]);
5052

5153
return (
5254
<div ref={ref}>
53-
<div {...getHeaderProps({ ariaLevel: 2 })}>
55+
<div {...getHeaderProps({ 'aria-level': 2 })}>
5456
<StyledSubNavItemHeader
5557
isDark={isDark}
5658
isLight={isLight}
57-
{...getTriggerProps({
58-
isExpanded: expanded,
59-
index: 0,
59+
isExpanded={expanded}
60+
{...(getTriggerProps({
61+
...other,
6062
role: null,
61-
tabIndex: null,
62-
...other
63-
})}
63+
tabIndex: null as any,
64+
value
65+
}) as ButtonHTMLAttributes<HTMLButtonElement>)}
66+
type="button"
6467
>
6568
<>
6669
{header}
@@ -71,11 +74,11 @@ export const CollapsibleSubNavItem = React.forwardRef<HTMLDivElement, ICollapsib
7174
</StyledSubNavItemHeader>
7275
</div>
7376
<StyledSubNavPanel
74-
{...getPanelProps({
75-
index: 0,
76-
isHidden: !expanded,
77-
ref: panelRef
78-
})}
77+
isHidden={!expanded}
78+
{...(getPanelProps({
79+
ref: panelRef,
80+
value
81+
}) as HTMLAttributes<HTMLDivElement>)}
7982
>
8083
{children}
8184
</StyledSubNavPanel>

0 commit comments

Comments
 (0)