pre-installations and preparations

This commit is contained in:
MuhammadKhalilzadeh committed 2024-05-05 11:21:00 +03:30
1 parent 3e5a0329cb
commit 201d621ac3
6977 files changed
+742826

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
import * as React from 'react';
import { DropdownProps } from './Dropdown.types';
/**
*
* Demos:
*
* - [Menu](https://mui.com/base-ui/react-menu/)
*
* API:
*
* - [Dropdown API](https://mui.com/base-ui/react-menu/components-api/#dropdown)
*/
declare function Dropdown(props: DropdownProps): React.JSX.Element;
declare namespace Dropdown {
var propTypes: any;
}
export { Dropdown };
+65
View File
@@ -0,0 +1,65 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import { exactProp } from '@mui/utils';
import { DropdownContext } from '../useDropdown/DropdownContext';
import { useDropdown } from '../useDropdown/useDropdown';
/**
*
* Demos:
*
* - [Menu](https://mui.com/base-ui/react-menu/)
*
* API:
*
* - [Dropdown API](https://mui.com/base-ui/react-menu/components-api/#dropdown)
*/
import { jsx as _jsx } from "react/jsx-runtime";
function Dropdown(props) {
const {
children,
open,
defaultOpen,
onOpenChange
} = props;
const {
contextValue
} = useDropdown({
defaultOpen,
onOpenChange,
open
});
return /*#__PURE__*/_jsx(DropdownContext.Provider, {
value: contextValue,
children: children
});
}
process.env.NODE_ENV !== "production" ? Dropdown.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* @ignore
*/
children: PropTypes.node,
/**
* If `true`, the dropdown is initially open.
*/
defaultOpen: PropTypes.bool,
/**
* Callback fired when the component requests to be opened or closed.
*/
onOpenChange: PropTypes.func,
/**
* Allows to control whether the dropdown is open.
* This is a controlled counterpart of `defaultOpen`.
*/
open: PropTypes.bool
} : void 0;
if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line
Dropdown['propTypes' + ''] = exactProp(Dropdown.propTypes);
}
export { Dropdown };
+17
View File
@@ -0,0 +1,17 @@
/// <reference types="react" />
export interface DropdownProps {
children: React.ReactNode;
/**
* If `true`, the dropdown is initially open.
*/
defaultOpen?: boolean;
/**
* Callback fired when the component requests to be opened or closed.
*/
onOpenChange?: (event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null, open: boolean) => void;
/**
* Allows to control whether the dropdown is open.
* This is a controlled counterpart of `defaultOpen`.
*/
open?: boolean;
}
+1
View File
@@ -0,0 +1 @@
export {};
+2
View File
@@ -0,0 +1,2 @@
export * from './Dropdown';
export * from './Dropdown.types';
+2
View File
@@ -0,0 +1,2 @@
export * from './Dropdown';
export * from './Dropdown.types';
+6
View File
@@ -0,0 +1,6 @@
{
"sideEffects": false,
"module": "./index.js",
"main": "../node/Dropdown/index.js",
"types": "./index.d.ts"
}