@zendeskgarden/react-accordions 8.69.6 → 8.69.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,14 +6,14 @@
6
6
  */
7
7
  import React from 'react';
8
8
  import { IAccordionProps } from '../../types';
9
- import { Section } from '../accordion/components/Section';
10
- import { Header } from '../accordion/components/Header';
11
- import { Label } from '../accordion/components/Label';
12
- import { Panel } from '../accordion/components/Panel';
9
+ import { Section } from './components/Section';
10
+ import { Header } from './components/Header';
11
+ import { Label } from './components/Label';
12
+ import { Panel } from './components/Panel';
13
13
  /**
14
14
  * @extends HTMLAttributes<HTMLDivElement>
15
15
  */
16
- export declare const Accordion: React.ForwardRefExoticComponent<IAccordionProps & React.RefAttributes<HTMLDivElement>> & {
16
+ export declare const Accordion: React.ForwardRefExoticComponent<IAccordionProps<any> & React.RefAttributes<HTMLDivElement>> & {
17
17
  Header: typeof Header;
18
18
  Label: typeof Label;
19
19
  Panel: typeof Panel;
@@ -4,12 +4,7 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- interface IStyledInnerPanel {
8
- isExpanded?: boolean;
9
- isAnimated?: boolean;
10
- }
11
- /**
12
- * 1. Override the inline max-height style used for animation.
13
- */
14
- export declare const StyledInnerPanel: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, IStyledInnerPanel, never>;
15
- export {};
7
+ export declare const StyledInnerPanel: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
8
+ 'data-garden-id': string;
9
+ 'data-garden-version': string;
10
+ }, "data-garden-id" | "data-garden-version">;
@@ -4,14 +4,15 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
+ import { IUseAccordionProps } from '@zendeskgarden/container-accordion';
7
8
  import { ReactNode, SVGAttributes, HTMLAttributes, LiHTMLAttributes, OlHTMLAttributes } from 'react';
8
- export interface IAccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
9
+ export interface IAccordionProps<Value = any> extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
9
10
  /** Sets `aria-level` heading rank in the document structure */
10
- level: number;
11
+ level: NonNullable<HTMLAttributes<HTMLDivElement>['aria-level']>;
11
12
  /** Sets the expanded sections in a controlled accordion */
12
- expandedSections?: number[];
13
+ expandedSections?: Value[];
13
14
  /** Sets the default expanded sections in an uncontrolled accordion */
14
- defaultExpandedSections?: number[];
15
+ defaultExpandedSections?: Value[];
15
16
  /** Hides section borders */
16
17
  isBare?: boolean;
17
18
  /** Allows uncontrolled accordion sections to collapse */
@@ -25,9 +26,9 @@ export interface IAccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'o
25
26
  /**
26
27
  * Handles accordion expansion changes
27
28
  *
28
- * @param {number} index A section index
29
+ * @param {*} value A section value
29
30
  */
30
- onChange?: (index: number) => void;
31
+ onChange?: IUseAccordionProps<Value>['onChange'];
31
32
  }
32
33
  export interface IStepperProps extends OlHTMLAttributes<HTMLOListElement> {
33
34
  /** Defines the currently active step, starting at 0 */
@@ -4,16 +4,10 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import { MutableRefObject } from 'react';
8
- import { IUseAccordionPropGetters } from '@zendeskgarden/container-accordion';
9
- export interface IAccordionContext extends IUseAccordionPropGetters {
10
- expandedSections: number[];
11
- currentIndexRef: MutableRefObject<number>;
12
- level: number;
13
- isCompact?: boolean;
14
- isAnimated?: boolean;
15
- isBare?: boolean;
16
- isCollapsible?: boolean;
7
+ /// <reference types="react" />
8
+ import { IUseAccordionReturnValue } from '@zendeskgarden/container-accordion';
9
+ import { IAccordionProps } from '../types';
10
+ export interface IAccordionContext<Value> extends Omit<IUseAccordionReturnValue<Value>, 'disabledSections'>, Pick<IAccordionProps<Value>, 'level' | 'isCompact' | 'isAnimated' | 'isBare' | 'isCollapsible'> {
17
11
  }
18
- export declare const AccordionContext: import("react").Context<IAccordionContext | undefined>;
19
- export declare const useAccordionContext: () => IAccordionContext;
12
+ export declare const AccordionContext: import("react").Context<IAccordionContext<any> | undefined>;
13
+ export declare const useAccordionContext: () => IAccordionContext<any>;
@@ -7,6 +7,9 @@
7
7
  /// <reference types="react" />
8
8
  export interface IStepContext {
9
9
  currentStepIndex: number;
10
+ isActive: boolean;
11
+ isCompleted: boolean;
12
+ isHorizontal: boolean;
10
13
  }
11
14
  export declare const StepContext: import("react").Context<IStepContext | undefined>;
12
15
  export declare const useStepContext: () => IStepContext;
@@ -8,7 +8,6 @@
8
8
  export interface IStepperContext {
9
9
  activeIndex: number;
10
10
  isHorizontal: boolean;
11
- currentIndexRef: React.MutableRefObject<number>;
12
11
  }
13
12
  export declare const StepperContext: import("react").Context<IStepperContext | undefined>;
14
13
  export declare const useStepperContext: () => IStepperContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-accordions",
3
- "version": "8.69.6",
3
+ "version": "8.69.8",
4
4
  "description": "Components related to accordions in the Garden Design System",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
@@ -21,12 +21,10 @@
21
21
  "sideEffects": false,
22
22
  "types": "dist/typings/index.d.ts",
23
23
  "dependencies": {
24
- "@zendeskgarden/container-accordion": "^2.0.0",
24
+ "@zendeskgarden/container-accordion": "^3.0.0",
25
25
  "@zendeskgarden/container-utilities": "^1.0.0",
26
- "lodash.debounce": "^4.0.8",
27
26
  "polished": "^4.0.0",
28
- "prop-types": "^15.5.7",
29
- "react-merge-refs": "^1.1.0"
27
+ "prop-types": "^15.5.7"
30
28
  },
31
29
  "peerDependencies": {
32
30
  "@zendeskgarden/react-theming": "^8.67.0",
@@ -35,8 +33,7 @@
35
33
  "styled-components": "^4.2.0 || ^5.0.0"
36
34
  },
37
35
  "devDependencies": {
38
- "@types/lodash.debounce": "4.0.7",
39
- "@zendeskgarden/react-theming": "^8.69.6",
36
+ "@zendeskgarden/react-theming": "^8.69.8",
40
37
  "@zendeskgarden/svg-icons": "6.33.0"
41
38
  },
42
39
  "keywords": [
@@ -50,5 +47,5 @@
50
47
  "access": "public"
51
48
  },
52
49
  "zendeskgarden:src": "src/index.ts",
53
- "gitHead": "94a3ebb91ac24820eae13118b40be1623cb50c43"
50
+ "gitHead": "bf838e7472834d51d05d2eb3de92920fecc187f0"
54
51
  }