@ark-ui/react 2.2.1 → 2.2.2
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.
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ description: All notable changes to this project will be documented in this file
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [2.2.2] - 2024-02-27
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Resolved an issue that a disabled `Accordion.Item` could still be opened.̊
|
|
14
|
+
|
|
9
15
|
## [2.2.1] - 2024-02-27
|
|
10
16
|
|
|
11
17
|
### Changed
|
|
@@ -8,19 +8,16 @@ const accordion = require('@zag-js/accordion');
|
|
|
8
8
|
const react$1 = require('@zag-js/react');
|
|
9
9
|
const react = require('react');
|
|
10
10
|
const collapsibleRoot = require('../collapsible/collapsible-root.cjs');
|
|
11
|
-
const splitCollapsibleProps = require('../collapsible/split-collapsible-props.cjs');
|
|
12
11
|
const renderStrategy = require('../render-strategy.cjs');
|
|
13
12
|
const runIfFn = require('../run-if-fn.cjs');
|
|
14
13
|
const accordionContext = require('./accordion-context.cjs');
|
|
15
14
|
const accordionItemContext = require('./accordion-item-context.cjs');
|
|
16
15
|
|
|
17
16
|
const AccordionItem = react.forwardRef((props, ref) => {
|
|
18
|
-
const [
|
|
19
|
-
const [itemProps, { children, ...localProps }] = accordion.splitItemProps(accordionItemProps);
|
|
17
|
+
const [itemProps, { children, ...localProps }] = accordion.splitItemProps(props);
|
|
20
18
|
const api = accordionContext.useAccordionContext();
|
|
21
19
|
const renderStrategyProps = renderStrategy.useRenderStrategyContext();
|
|
22
20
|
const mergedItemProps = react$1.mergeProps(api.getItemProps(itemProps), localProps);
|
|
23
|
-
const mergedCollapsibleProps = react$1.mergeProps(renderStrategyProps, collapsibleProps);
|
|
24
21
|
const itemState = api.getItemState(itemProps);
|
|
25
22
|
const view = runIfFn.runIfFn(children, itemState);
|
|
26
23
|
const itemContentProps = api.getItemContentProps(itemProps);
|
|
@@ -30,8 +27,8 @@ const AccordionItem = react.forwardRef((props, ref) => {
|
|
|
30
27
|
ref,
|
|
31
28
|
open: itemState.isOpen,
|
|
32
29
|
ids: { content: itemContentProps.id },
|
|
30
|
+
...renderStrategyProps,
|
|
33
31
|
...mergedItemProps,
|
|
34
|
-
...mergedCollapsibleProps,
|
|
35
32
|
children: view
|
|
36
33
|
}
|
|
37
34
|
) });
|
|
@@ -4,19 +4,16 @@ import { splitItemProps } from '@zag-js/accordion';
|
|
|
4
4
|
import { mergeProps } from '@zag-js/react';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
import { CollapsibleRoot } from '../collapsible/collapsible-root.mjs';
|
|
7
|
-
import { splitCollapsibleProps } from '../collapsible/split-collapsible-props.mjs';
|
|
8
7
|
import { useRenderStrategyContext } from '../render-strategy.mjs';
|
|
9
8
|
import { runIfFn } from '../run-if-fn.mjs';
|
|
10
9
|
import { useAccordionContext } from './accordion-context.mjs';
|
|
11
10
|
import { AccordionItemProvider } from './accordion-item-context.mjs';
|
|
12
11
|
|
|
13
12
|
const AccordionItem = forwardRef((props, ref) => {
|
|
14
|
-
const [
|
|
15
|
-
const [itemProps, { children, ...localProps }] = splitItemProps(accordionItemProps);
|
|
13
|
+
const [itemProps, { children, ...localProps }] = splitItemProps(props);
|
|
16
14
|
const api = useAccordionContext();
|
|
17
15
|
const renderStrategyProps = useRenderStrategyContext();
|
|
18
16
|
const mergedItemProps = mergeProps(api.getItemProps(itemProps), localProps);
|
|
19
|
-
const mergedCollapsibleProps = mergeProps(renderStrategyProps, collapsibleProps);
|
|
20
17
|
const itemState = api.getItemState(itemProps);
|
|
21
18
|
const view = runIfFn(children, itemState);
|
|
22
19
|
const itemContentProps = api.getItemContentProps(itemProps);
|
|
@@ -26,8 +23,8 @@ const AccordionItem = forwardRef((props, ref) => {
|
|
|
26
23
|
ref,
|
|
27
24
|
open: itemState.isOpen,
|
|
28
25
|
ids: { content: itemContentProps.id },
|
|
26
|
+
...renderStrategyProps,
|
|
29
27
|
...mergedItemProps,
|
|
30
|
-
...mergedCollapsibleProps,
|
|
31
28
|
children: view
|
|
32
29
|
}
|
|
33
30
|
) });
|