@geoinsight/react-components 0.4.1 → 0.4.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/dist/cjs/index.js
CHANGED
|
@@ -55,18 +55,18 @@ function recursiveToggle(children, toggleArray = {}, i = 0, props) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
const AccordionContext = react.createContext(undefined);
|
|
58
|
-
|
|
58
|
+
function AccordionProvider({ children, expanded = "all" }) {
|
|
59
59
|
const newChildren = react.useMemo(() => recursiveChildren(children, 0), []);
|
|
60
60
|
const [toggle, setToggle] = react.useState(recursiveToggle(newChildren, {}, 0, { expanded }));
|
|
61
61
|
return (jsxRuntime.jsx(AccordionContext.Provider, { value: { toggle, setToggle }, children: jsxRuntime.jsx("div", { className: "accordion", children: newChildren }) }));
|
|
62
|
-
}
|
|
63
|
-
|
|
62
|
+
}
|
|
63
|
+
function useAccordion() {
|
|
64
64
|
const context = react.useContext(AccordionContext);
|
|
65
65
|
if (context === undefined) {
|
|
66
66
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
67
67
|
}
|
|
68
68
|
return context;
|
|
69
|
-
}
|
|
69
|
+
}
|
|
70
70
|
|
|
71
71
|
function Accordion({ children, expanded = "all", defaultValue, selectValue, }) {
|
|
72
72
|
// const { dataTheme } = useTheme();
|
package/dist/esm/index.js
CHANGED
|
@@ -53,18 +53,18 @@ function recursiveToggle(children, toggleArray = {}, i = 0, props) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
const AccordionContext = createContext(undefined);
|
|
56
|
-
|
|
56
|
+
function AccordionProvider({ children, expanded = "all" }) {
|
|
57
57
|
const newChildren = useMemo(() => recursiveChildren(children, 0), []);
|
|
58
58
|
const [toggle, setToggle] = useState(recursiveToggle(newChildren, {}, 0, { expanded }));
|
|
59
59
|
return (jsx(AccordionContext.Provider, { value: { toggle, setToggle }, children: jsx("div", { className: "accordion", children: newChildren }) }));
|
|
60
|
-
}
|
|
61
|
-
|
|
60
|
+
}
|
|
61
|
+
function useAccordion() {
|
|
62
62
|
const context = useContext(AccordionContext);
|
|
63
63
|
if (context === undefined) {
|
|
64
64
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
65
65
|
}
|
|
66
66
|
return context;
|
|
67
|
-
}
|
|
67
|
+
}
|
|
68
68
|
|
|
69
69
|
function Accordion({ children, expanded = "all", defaultValue, selectValue, }) {
|
|
70
70
|
// const { dataTheme } = useTheme();
|
|
Binary file
|