1 | 'use client';
|
2 |
|
3 | import * as React from 'react';
|
4 | import PropTypes from 'prop-types';
|
5 | import { exactProp } from '@mui/utils';
|
6 | import { DropdownContext } from '../useDropdown/DropdownContext';
|
7 | import { useDropdown } from '../useDropdown/useDropdown';
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | import { jsx as _jsx } from "react/jsx-runtime";
|
19 | function Dropdown(props) {
|
20 | const {
|
21 | children,
|
22 | open,
|
23 | defaultOpen,
|
24 | onOpenChange
|
25 | } = props;
|
26 | const {
|
27 | contextValue
|
28 | } = useDropdown({
|
29 | defaultOpen,
|
30 | onOpenChange,
|
31 | open
|
32 | });
|
33 | return _jsx(DropdownContext.Provider, {
|
34 | value: contextValue,
|
35 | children: children
|
36 | });
|
37 | }
|
38 | process.env.NODE_ENV !== "production" ? Dropdown.propTypes = {
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | |
44 |
|
45 |
|
46 | children: PropTypes.node,
|
47 | |
48 |
|
49 |
|
50 | defaultOpen: PropTypes.bool,
|
51 | |
52 |
|
53 |
|
54 | onOpenChange: PropTypes.func,
|
55 | |
56 |
|
57 |
|
58 |
|
59 | open: PropTypes.bool
|
60 | } : void 0;
|
61 | if (process.env.NODE_ENV !== 'production') {
|
62 |
|
63 | Dropdown['propTypes' + ''] = exactProp(Dropdown.propTypes);
|
64 | }
|
65 | export { Dropdown }; |
\ | No newline at end of file |