@ark-ui/react 0.1.0 → 0.2.0
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,6 +6,7 @@ const jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
const react = require('@polymorphic-factory/react');
|
|
7
7
|
const react$1 = require('@zag-js/react');
|
|
8
8
|
const factory = require('../factory.cjs');
|
|
9
|
+
const runIfFn = require('../run-if-fn.cjs');
|
|
9
10
|
const accordionContext = require('./accordion-context.cjs');
|
|
10
11
|
const accordionItemContext = require('./accordion-item-context.cjs');
|
|
11
12
|
|
|
@@ -14,7 +15,8 @@ const AccordionItem = react.forwardRef((props, ref) => {
|
|
|
14
15
|
const { getItemProps, getItemState } = accordionContext.useAccordionContext();
|
|
15
16
|
const itemState = getItemState({ value });
|
|
16
17
|
const mergedProps = react$1.mergeProps(getItemProps({ value, disabled }), rest);
|
|
17
|
-
|
|
18
|
+
const view = runIfFn.runIfFn(children, itemState);
|
|
19
|
+
return /* @__PURE__ */ jsxRuntime.jsx(accordionItemContext.AccordionItemProvider, { value: { value, disabled, ...itemState }, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref, children: view }) });
|
|
18
20
|
});
|
|
19
21
|
|
|
20
22
|
exports.AccordionItem = AccordionItem;
|
|
@@ -2,6 +2,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { forwardRef } from '@polymorphic-factory/react';
|
|
3
3
|
import { mergeProps } from '@zag-js/react';
|
|
4
4
|
import { ark } from '../factory.mjs';
|
|
5
|
+
import { runIfFn } from '../run-if-fn.mjs';
|
|
5
6
|
import { useAccordionContext } from './accordion-context.mjs';
|
|
6
7
|
import { AccordionItemProvider } from './accordion-item-context.mjs';
|
|
7
8
|
|
|
@@ -10,7 +11,8 @@ const AccordionItem = forwardRef((props, ref) => {
|
|
|
10
11
|
const { getItemProps, getItemState } = useAccordionContext();
|
|
11
12
|
const itemState = getItemState({ value });
|
|
12
13
|
const mergedProps = mergeProps(getItemProps({ value, disabled }), rest);
|
|
13
|
-
|
|
14
|
+
const view = runIfFn(children, itemState);
|
|
15
|
+
return /* @__PURE__ */ jsx(AccordionItemProvider, { value: { value, disabled, ...itemState }, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref, children: view }) });
|
|
14
16
|
});
|
|
15
17
|
|
|
16
18
|
export { AccordionItem };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ark-ui/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"@zag-js/accordion": "0.6.0",
|
|
34
34
|
"@zag-js/anatomy": "0.1.4",
|
|
35
35
|
"@zag-js/carousel": "0.5.0",
|
|
36
|
+
"@zag-js/color-picker": "0.6.0",
|
|
36
37
|
"@zag-js/checkbox": "0.6.0",
|
|
37
38
|
"@zag-js/combobox": "0.6.0",
|
|
38
39
|
"@zag-js/dialog": "0.6.0",
|
|
@@ -67,24 +68,30 @@
|
|
|
67
68
|
"@types/react": "18.0.32",
|
|
68
69
|
"@types/react-dom": "18.0.11",
|
|
69
70
|
"@types/testing-library__jest-dom": "5.14.5",
|
|
70
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
71
|
-
"@typescript-eslint/parser": "5.
|
|
71
|
+
"@typescript-eslint/eslint-plugin": "5.59.1",
|
|
72
|
+
"@typescript-eslint/parser": "5.59.1",
|
|
72
73
|
"@vitejs/plugin-react": "3.1.0",
|
|
73
74
|
"@vitest/coverage-c8": "0.30.1",
|
|
74
75
|
"clean-package": "2.2.0",
|
|
75
|
-
"eslint": "8.
|
|
76
|
+
"eslint": "8.39.0",
|
|
76
77
|
"eslint-plugin-react": "7.32.2",
|
|
77
78
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
78
|
-
"happy-dom": "9.
|
|
79
|
+
"happy-dom": "9.10.0",
|
|
79
80
|
"jsdom": "21.1.1",
|
|
80
81
|
"react": "18.2.0",
|
|
81
82
|
"react-dom": "18.2.0",
|
|
82
83
|
"react-frame-component": "5.2.6",
|
|
83
84
|
"resize-observer-polyfill": "1.5.1",
|
|
84
85
|
"typescript": "5.0.4",
|
|
85
|
-
"vite": "4.
|
|
86
|
+
"vite": "4.3.3",
|
|
86
87
|
"vite-plugin-dts": "2.3.0",
|
|
87
|
-
"vitest": "0.30.1"
|
|
88
|
+
"vitest": "0.30.1",
|
|
89
|
+
"storybook": "7.0.7",
|
|
90
|
+
"@storybook/react": "7.0.7",
|
|
91
|
+
"@storybook/react-vite": "7.0.7",
|
|
92
|
+
"@storybook/addons": "7.0.7",
|
|
93
|
+
"@storybook/addon-a11y": "7.0.7",
|
|
94
|
+
"@storybook/addon-essentials": "7.0.7"
|
|
88
95
|
},
|
|
89
96
|
"peerDependencies": {
|
|
90
97
|
"react": ">=18.0.0",
|
|
@@ -108,6 +115,7 @@
|
|
|
108
115
|
"test:ci": "vitest --run --coverage",
|
|
109
116
|
"typecheck": "tsc",
|
|
110
117
|
"typedocs": "ts-node ../../scripts/generate-type-docs.ts",
|
|
111
|
-
"storydocs": "ts-node ../../scripts/generate-stories.ts"
|
|
118
|
+
"storydocs": "ts-node ../../scripts/generate-stories.ts",
|
|
119
|
+
"storybook": "storybook dev -p 6006"
|
|
112
120
|
}
|
|
113
121
|
}
|