@mui/base
Advanced tools
Comparing version 5.0.0-alpha.79 to 5.0.0-alpha.80
@@ -522,3 +522,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
const handleValue = (event, newValue, reason, details) => { | ||
if (Array.isArray(value)) { | ||
if (multiple) { | ||
if (value.length === newValue.length && value.every((val, i) => val === newValue[i])) { | ||
@@ -607,3 +607,6 @@ return; | ||
handleClose(event, 'toggleInput'); | ||
if (inputValue === '') { | ||
handleClose(event, 'toggleInput'); | ||
} | ||
let nextTag = focusedTag; | ||
@@ -610,0 +613,0 @@ |
@@ -0,0 +0,0 @@ export interface BadgeUnstyledClasses { |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -116,5 +116,7 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
* Either a string to use a HTML element or a component. | ||
* @default 'button' | ||
* This is equivalent to `components.Root`. If both are provided, the `component` is used. | ||
*/ | ||
component: PropTypes.elementType, | ||
component: PropTypes | ||
/* @typescript-to-proptypes-ignore */ | ||
.elementType, | ||
@@ -121,0 +123,0 @@ /** |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ export interface ButtonUnstyledClasses { |
@@ -0,0 +0,0 @@ export { default } from './ButtonUnstyled'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -7,3 +7,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
const { | ||
component = 'button', | ||
disabled = false, | ||
@@ -34,2 +33,3 @@ focusableWhenDisabled, | ||
}, [focusVisible, isFocusVisibleRef]); | ||
const [hostElementName, setHostElementName] = React.useState(''); | ||
@@ -78,5 +78,5 @@ const createHandleMouseLeave = otherHandlers => event => { | ||
const isNonNativeButton = () => { | ||
const isNativeButton = () => { | ||
const button = buttonRef.current; | ||
return component !== 'button' && !((button == null ? void 0 : button.tagName) === 'A' && button != null && button.href); | ||
return hostElementName === 'BUTTON' || hostElementName === 'INPUT' && ['button', 'submit', 'reset'].includes(button == null ? void 0 : button.type) || hostElementName === 'A' && (button == null ? void 0 : button.href); | ||
}; | ||
@@ -121,3 +121,3 @@ | ||
if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') { | ||
if (event.target === event.currentTarget && !isNativeButton() && event.key === ' ') { | ||
event.preventDefault(); | ||
@@ -131,3 +131,3 @@ } | ||
if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) { | ||
if (event.target === event.currentTarget && !isNativeButton() && event.key === 'Enter' && !disabled) { | ||
var _otherHandlers$onClic2; | ||
@@ -151,3 +151,3 @@ | ||
if (event.target === event.currentTarget && isNonNativeButton() && !disabled && event.key === ' ' && !event.defaultPrevented) { | ||
if (event.target === event.currentTarget && !isNativeButton() && !disabled && event.key === ' ' && !event.defaultPrevented) { | ||
var _otherHandlers$onClic3; | ||
@@ -161,3 +161,2 @@ | ||
const handleRef = useForkRef(ref, handleOwnRef); | ||
const [hostElementName, setHostElementName] = React.useState(''); | ||
@@ -164,0 +163,0 @@ const updateRef = instance => { |
@@ -20,8 +20,2 @@ import * as React from 'react'; | ||
/** | ||
* The component used for the Root slot. | ||
* Either a string to use a HTML element or a component. | ||
* @default 'button' | ||
*/ | ||
component?: React.ElementType; | ||
/** | ||
* If `true`, the component is disabled. | ||
@@ -28,0 +22,0 @@ * @default false |
@@ -1,1 +0,1 @@ | ||
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator'; | ||
export { unstable_ClassNameGenerator } from '@mui/private-classnames'; |
// eslint-disable-next-line import/prefer-default-export | ||
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator'; | ||
export { unstable_ClassNameGenerator } from '@mui/private-classnames'; |
import * as React from 'react'; | ||
declare type ClickAwayMouseEventHandler = 'onClick' | 'onMouseDown' | 'onMouseUp'; | ||
declare type ClickAwayMouseEventHandler = 'onClick' | 'onMouseDown' | 'onMouseUp' | 'onPointerDown' | 'onPointerUp'; | ||
declare type ClickAwayTouchEventHandler = 'onTouchStart' | 'onTouchEnd'; | ||
@@ -4,0 +4,0 @@ export interface ClickAwayListenerProps { |
@@ -173,3 +173,3 @@ import * as React from 'react'; | ||
*/ | ||
mouseEvent: PropTypes.oneOf(['onClick', 'onMouseDown', 'onMouseUp', false]), | ||
mouseEvent: PropTypes.oneOf(['onClick', 'onMouseDown', 'onMouseUp', 'onPointerDown', 'onPointerUp', false]), | ||
@@ -176,0 +176,0 @@ /** |
export { default } from './ClickAwayListener'; | ||
export * from './ClickAwayListener'; |
@@ -1,1 +0,1 @@ | ||
export { default } from './composeClasses'; | ||
export { unstable_composeClasses as default } from '@mui/private-classnames'; |
@@ -1,1 +0,1 @@ | ||
export { default } from './composeClasses'; | ||
export { unstable_composeClasses as default } from '@mui/private-classnames'; |
@@ -0,0 +0,0 @@ import { OverridableComponent } from '@mui/types'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ export interface FormControlUnstyledClasses { |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ export { default } from './FormControlUnstyled'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -1,2 +0,2 @@ | ||
export { default } from './generateUtilityClass'; | ||
export * from './generateUtilityClass'; | ||
export { generateUtilityClass as default } from '@mui/private-classnames'; | ||
export type { GlobalStateSlot } from '@mui/private-classnames'; |
@@ -1,2 +0,1 @@ | ||
export { default } from './generateUtilityClass'; | ||
export * from './generateUtilityClass'; | ||
export { generateUtilityClass as default } from '@mui/private-classnames'; |
@@ -1,1 +0,1 @@ | ||
export { default } from './generateUtilityClasses'; | ||
export { generateUtilityClasses as default } from '@mui/private-classnames'; |
@@ -1,1 +0,1 @@ | ||
export { default } from './generateUtilityClasses'; | ||
export { generateUtilityClasses as default } from '@mui/private-classnames'; |
@@ -1,2 +0,2 @@ | ||
/** @license MUI v5.0.0-alpha.79 | ||
/** @license MUI v5.0.0-alpha.80 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
@@ -0,0 +0,0 @@ export { default } from './InputUnstyled'; |
@@ -0,0 +0,0 @@ import { OverridableComponent } from '@mui/types'; |
@@ -0,0 +0,0 @@ export interface InputUnstyledClasses { |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -588,3 +588,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
var handleValue = function handleValue(event, newValue, reason, details) { | ||
if (Array.isArray(value)) { | ||
if (multiple) { | ||
if (value.length === newValue.length && value.every(function (val, i) { | ||
@@ -681,3 +681,6 @@ return val === newValue[i]; | ||
handleClose(event, 'toggleInput'); | ||
if (inputValue === '') { | ||
handleClose(event, 'toggleInput'); | ||
} | ||
var nextTag = focusedTag; | ||
@@ -684,0 +687,0 @@ |
@@ -125,5 +125,7 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
* Either a string to use a HTML element or a component. | ||
* @default 'button' | ||
* This is equivalent to `components.Root`. If both are provided, the `component` is used. | ||
*/ | ||
component: PropTypes.elementType, | ||
component: PropTypes | ||
/* @typescript-to-proptypes-ignore */ | ||
.elementType, | ||
@@ -130,0 +132,0 @@ /** |
@@ -6,5 +6,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
export default function useButton(parameters) { | ||
var _parameters$component = parameters.component, | ||
component = _parameters$component === void 0 ? 'button' : _parameters$component, | ||
_parameters$disabled = parameters.disabled, | ||
var _parameters$disabled = parameters.disabled, | ||
disabled = _parameters$disabled === void 0 ? false : _parameters$disabled, | ||
@@ -41,2 +39,6 @@ focusableWhenDisabled = parameters.focusableWhenDisabled, | ||
var _React$useState3 = React.useState(''), | ||
hostElementName = _React$useState3[0], | ||
setHostElementName = _React$useState3[1]; | ||
var createHandleMouseLeave = function createHandleMouseLeave(otherHandlers) { | ||
@@ -90,5 +92,5 @@ return function (event) { | ||
var isNonNativeButton = function isNonNativeButton() { | ||
var isNativeButton = function isNativeButton() { | ||
var button = buttonRef.current; | ||
return component !== 'button' && !((button == null ? void 0 : button.tagName) === 'A' && button != null && button.href); | ||
return hostElementName === 'BUTTON' || hostElementName === 'INPUT' && ['button', 'submit', 'reset'].includes(button == null ? void 0 : button.type) || hostElementName === 'A' && (button == null ? void 0 : button.href); | ||
}; | ||
@@ -140,3 +142,3 @@ | ||
if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') { | ||
if (event.target === event.currentTarget && !isNativeButton() && event.key === ' ') { | ||
event.preventDefault(); | ||
@@ -150,3 +152,3 @@ } | ||
if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) { | ||
if (event.target === event.currentTarget && !isNativeButton() && event.key === 'Enter' && !disabled) { | ||
var _otherHandlers$onClic2; | ||
@@ -172,3 +174,3 @@ | ||
if (event.target === event.currentTarget && isNonNativeButton() && !disabled && event.key === ' ' && !event.defaultPrevented) { | ||
if (event.target === event.currentTarget && !isNativeButton() && !disabled && event.key === ' ' && !event.defaultPrevented) { | ||
var _otherHandlers$onClic3; | ||
@@ -184,6 +186,2 @@ | ||
var _React$useState3 = React.useState(''), | ||
hostElementName = _React$useState3[0], | ||
setHostElementName = _React$useState3[1]; | ||
var updateRef = function updateRef(instance) { | ||
@@ -190,0 +188,0 @@ var _instance$tagName; |
// eslint-disable-next-line import/prefer-default-export | ||
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator'; | ||
export { unstable_ClassNameGenerator } from '@mui/private-classnames'; |
@@ -176,3 +176,3 @@ import * as React from 'react'; | ||
*/ | ||
mouseEvent: PropTypes.oneOf(['onClick', 'onMouseDown', 'onMouseUp', false]), | ||
mouseEvent: PropTypes.oneOf(['onClick', 'onMouseDown', 'onMouseUp', 'onPointerDown', 'onPointerUp', false]), | ||
@@ -179,0 +179,0 @@ /** |
@@ -1,1 +0,1 @@ | ||
export { default } from './composeClasses'; | ||
export { unstable_composeClasses as default } from '@mui/private-classnames'; |
@@ -1,2 +0,1 @@ | ||
export { default } from './generateUtilityClass'; | ||
export * from './generateUtilityClass'; | ||
export { generateUtilityClass as default } from '@mui/private-classnames'; |
@@ -1,1 +0,1 @@ | ||
export { default } from './generateUtilityClasses'; | ||
export { generateUtilityClasses as default } from '@mui/private-classnames'; |
@@ -1,2 +0,2 @@ | ||
/** @license MUI v5.0.0-alpha.79 | ||
/** @license MUI v5.0.0-alpha.80 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
@@ -50,3 +50,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
var _useMenuItem = useMenuItem({ | ||
component: Root, | ||
disabled: disabled, | ||
@@ -53,0 +52,0 @@ ref: ref, |
@@ -7,4 +7,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
export default function useMenuItem(props) { | ||
var component = props.component, | ||
_props$disabled = props.disabled, | ||
var _props$disabled = props.disabled, | ||
disabled = _props$disabled === void 0 ? false : _props$disabled, | ||
@@ -42,3 +41,2 @@ ref = props.ref, | ||
var _useButton = useButton({ | ||
component: component, | ||
disabled: disabled, | ||
@@ -45,0 +43,0 @@ focusableWhenDisabled: true, |
@@ -121,3 +121,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
var _useSelect = useSelect({ | ||
buttonComponent: Button, | ||
buttonRef: handleButtonRef, | ||
@@ -124,0 +123,0 @@ defaultValue: defaultValue, |
@@ -119,3 +119,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
var _useSelect = useSelect({ | ||
buttonComponent: Button, | ||
buttonRef: handleButtonRef, | ||
@@ -122,0 +121,0 @@ defaultValue: defaultValue, |
@@ -25,4 +25,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
function useSelect(props) { | ||
var buttonComponent = props.buttonComponent, | ||
buttonRefProp = props.buttonRef, | ||
var buttonRefProp = props.buttonRef, | ||
defaultValue = props.defaultValue, | ||
@@ -204,3 +203,2 @@ _props$disabled = props.disabled, | ||
var _useButton = useButton({ | ||
component: buttonComponent, | ||
disabled: disabled, | ||
@@ -207,0 +205,0 @@ ref: handleButtonRef |
import { ListboxState, ListboxAction } from './useListbox.types'; | ||
export default function defaultListboxReducer<TOption>(state: Readonly<ListboxState<TOption>>, action: ListboxAction<TOption>): Readonly<ListboxState<TOption>>; |
export { default as useListbox } from './useListbox'; | ||
export { default as defaultListboxReducer } from './defaultListboxReducer'; | ||
export * from './useListbox.types'; |
import { ListboxAction, ListboxReducer, ListboxState, UseListboxStrictProps } from './useListbox.types'; | ||
export default function useControllableReducer<TOption>(internalReducer: ListboxReducer<TOption>, externalReducer: ListboxReducer<TOption> | undefined, props: UseListboxStrictProps<TOption>): [ListboxState<TOption>, (action: ListboxAction<TOption>) => void]; |
@@ -0,0 +0,0 @@ import { UseListboxParameters, OptionState, UseListboxOptionSlotProps, UseListboxRootSlotProps } from './useListbox.types'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ export { default } from './MenuItemUnstyled'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -55,3 +55,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
} = useMenuItem({ | ||
component: Root, | ||
disabled, | ||
@@ -58,0 +57,0 @@ ref, |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ export interface MenuItemUnstyledClasses { |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -8,3 +8,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
const { | ||
component, | ||
disabled = false, | ||
@@ -45,3 +44,2 @@ ref, | ||
} = useButton({ | ||
component, | ||
disabled, | ||
@@ -48,0 +46,0 @@ focusableWhenDisabled: true, |
/// <reference types="react" /> | ||
export interface UseMenuItemParameters { | ||
component: React.ElementType; | ||
disabled?: boolean; | ||
@@ -5,0 +4,0 @@ onClick?: React.MouseEventHandler<any>; |
@@ -0,0 +0,0 @@ export { default } from './MenuUnstyled'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ export interface MenuUnstyledClasses { |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ export interface ManagedModalProps { |
@@ -0,0 +0,0 @@ export interface ModalUnstyledClasses { |
@@ -518,3 +518,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
const handleValue = (event, newValue, reason, details) => { | ||
if (Array.isArray(value)) { | ||
if (multiple) { | ||
if (value.length === newValue.length && value.every((val, i) => val === newValue[i])) { | ||
@@ -603,3 +603,6 @@ return; | ||
handleClose(event, 'toggleInput'); | ||
if (inputValue === '') { | ||
handleClose(event, 'toggleInput'); | ||
} | ||
let nextTag = focusedTag; | ||
@@ -606,0 +609,0 @@ |
@@ -114,5 +114,7 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
* Either a string to use a HTML element or a component. | ||
* @default 'button' | ||
* This is equivalent to `components.Root`. If both are provided, the `component` is used. | ||
*/ | ||
component: PropTypes.elementType, | ||
component: PropTypes | ||
/* @typescript-to-proptypes-ignore */ | ||
.elementType, | ||
@@ -119,0 +121,0 @@ /** |
@@ -7,3 +7,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
const { | ||
component = 'button', | ||
disabled = false, | ||
@@ -34,2 +33,3 @@ focusableWhenDisabled, | ||
}, [focusVisible, isFocusVisibleRef]); | ||
const [hostElementName, setHostElementName] = React.useState(''); | ||
@@ -70,5 +70,5 @@ const createHandleMouseLeave = otherHandlers => event => { | ||
const isNonNativeButton = () => { | ||
const isNativeButton = () => { | ||
const button = buttonRef.current; | ||
return component !== 'button' && !(button?.tagName === 'A' && button?.href); | ||
return hostElementName === 'BUTTON' || hostElementName === 'INPUT' && ['button', 'submit', 'reset'].includes(button?.type) || hostElementName === 'A' && button?.href; | ||
}; | ||
@@ -105,3 +105,3 @@ | ||
if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') { | ||
if (event.target === event.currentTarget && !isNativeButton() && event.key === ' ') { | ||
event.preventDefault(); | ||
@@ -115,3 +115,3 @@ } | ||
if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) { | ||
if (event.target === event.currentTarget && !isNativeButton() && event.key === 'Enter' && !disabled) { | ||
otherHandlers.onClick?.(event); | ||
@@ -131,3 +131,3 @@ event.preventDefault(); | ||
if (event.target === event.currentTarget && isNonNativeButton() && !disabled && event.key === ' ' && !event.defaultPrevented) { | ||
if (event.target === event.currentTarget && !isNativeButton() && !disabled && event.key === ' ' && !event.defaultPrevented) { | ||
otherHandlers.onClick?.(event); | ||
@@ -139,3 +139,2 @@ } | ||
const handleRef = useForkRef(ref, handleOwnRef); | ||
const [hostElementName, setHostElementName] = React.useState(''); | ||
@@ -142,0 +141,0 @@ const updateRef = instance => { |
// eslint-disable-next-line import/prefer-default-export | ||
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator'; | ||
export { unstable_ClassNameGenerator } from '@mui/private-classnames'; |
@@ -173,3 +173,3 @@ import * as React from 'react'; | ||
*/ | ||
mouseEvent: PropTypes.oneOf(['onClick', 'onMouseDown', 'onMouseUp', false]), | ||
mouseEvent: PropTypes.oneOf(['onClick', 'onMouseDown', 'onMouseUp', 'onPointerDown', 'onPointerUp', false]), | ||
@@ -176,0 +176,0 @@ /** |
@@ -1,1 +0,1 @@ | ||
export { default } from './composeClasses'; | ||
export { unstable_composeClasses as default } from '@mui/private-classnames'; |
@@ -1,2 +0,1 @@ | ||
export { default } from './generateUtilityClass'; | ||
export * from './generateUtilityClass'; | ||
export { generateUtilityClass as default } from '@mui/private-classnames'; |
@@ -1,1 +0,1 @@ | ||
export { default } from './generateUtilityClasses'; | ||
export { generateUtilityClasses as default } from '@mui/private-classnames'; |
@@ -1,2 +0,2 @@ | ||
/** @license MUI v5.0.0-alpha.79 | ||
/** @license MUI v5.0.0-alpha.80 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
@@ -53,3 +53,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
} = useMenuItem({ | ||
component: Root, | ||
disabled, | ||
@@ -56,0 +55,0 @@ ref, |
@@ -8,3 +8,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
const { | ||
component, | ||
disabled = false, | ||
@@ -45,3 +44,2 @@ ref, | ||
} = useButton({ | ||
component, | ||
disabled, | ||
@@ -48,0 +46,0 @@ focusableWhenDisabled: true, |
@@ -111,3 +111,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
} = useSelect({ | ||
buttonComponent: Button, | ||
buttonRef: handleButtonRef, | ||
@@ -114,0 +113,0 @@ defaultValue, |
@@ -110,3 +110,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
} = useSelect({ | ||
buttonComponent: Button, | ||
buttonRef: handleButtonRef, | ||
@@ -113,0 +112,0 @@ defaultValue, |
@@ -27,3 +27,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
const { | ||
buttonComponent, | ||
buttonRef: buttonRefProp, | ||
@@ -173,3 +172,2 @@ defaultValue, | ||
} = useButton({ | ||
component: buttonComponent, | ||
disabled, | ||
@@ -176,0 +174,0 @@ ref: handleButtonRef |
export { default } from './MultiSelectUnstyled'; | ||
export * from './MultiSelectUnstyled.types'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -113,3 +113,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
} = useSelect({ | ||
buttonComponent: Button, | ||
buttonRef: handleButtonRef, | ||
@@ -116,0 +115,0 @@ defaultValue, |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -540,3 +540,3 @@ "use strict"; | ||
const handleValue = (event, newValue, reason, details) => { | ||
if (Array.isArray(value)) { | ||
if (multiple) { | ||
if (value.length === newValue.length && value.every((val, i) => val === newValue[i])) { | ||
@@ -625,3 +625,6 @@ return; | ||
handleClose(event, 'toggleInput'); | ||
if (inputValue === '') { | ||
handleClose(event, 'toggleInput'); | ||
} | ||
let nextTag = focusedTag; | ||
@@ -628,0 +631,0 @@ |
@@ -137,5 +137,7 @@ "use strict"; | ||
* Either a string to use a HTML element or a component. | ||
* @default 'button' | ||
* This is equivalent to `components.Root`. If both are provided, the `component` is used. | ||
*/ | ||
component: _propTypes.default.elementType, | ||
component: _propTypes.default | ||
/* @typescript-to-proptypes-ignore */ | ||
.elementType, | ||
@@ -142,0 +144,0 @@ /** |
@@ -24,3 +24,2 @@ "use strict"; | ||
const { | ||
component = 'button', | ||
disabled = false, | ||
@@ -51,2 +50,3 @@ focusableWhenDisabled, | ||
}, [focusVisible, isFocusVisibleRef]); | ||
const [hostElementName, setHostElementName] = React.useState(''); | ||
@@ -95,5 +95,5 @@ const createHandleMouseLeave = otherHandlers => event => { | ||
const isNonNativeButton = () => { | ||
const isNativeButton = () => { | ||
const button = buttonRef.current; | ||
return component !== 'button' && !((button == null ? void 0 : button.tagName) === 'A' && button != null && button.href); | ||
return hostElementName === 'BUTTON' || hostElementName === 'INPUT' && ['button', 'submit', 'reset'].includes(button == null ? void 0 : button.type) || hostElementName === 'A' && (button == null ? void 0 : button.href); | ||
}; | ||
@@ -138,3 +138,3 @@ | ||
if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') { | ||
if (event.target === event.currentTarget && !isNativeButton() && event.key === ' ') { | ||
event.preventDefault(); | ||
@@ -148,3 +148,3 @@ } | ||
if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) { | ||
if (event.target === event.currentTarget && !isNativeButton() && event.key === 'Enter' && !disabled) { | ||
var _otherHandlers$onClic2; | ||
@@ -168,3 +168,3 @@ | ||
if (event.target === event.currentTarget && isNonNativeButton() && !disabled && event.key === ' ' && !event.defaultPrevented) { | ||
if (event.target === event.currentTarget && !isNativeButton() && !disabled && event.key === ' ' && !event.defaultPrevented) { | ||
var _otherHandlers$onClic3; | ||
@@ -178,3 +178,2 @@ | ||
const handleRef = (0, _utils.unstable_useForkRef)(ref, handleOwnRef); | ||
const [hostElementName, setHostElementName] = React.useState(''); | ||
@@ -181,0 +180,0 @@ const updateRef = instance => { |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -11,6 +9,6 @@ value: true | ||
get: function () { | ||
return _ClassNameGenerator.default; | ||
return _privateClassnames.unstable_ClassNameGenerator; | ||
} | ||
}); | ||
var _ClassNameGenerator = _interopRequireDefault(require("./ClassNameGenerator")); | ||
var _privateClassnames = require("@mui/private-classnames"); |
@@ -189,3 +189,3 @@ "use strict"; | ||
*/ | ||
mouseEvent: _propTypes.default.oneOf(['onClick', 'onMouseDown', 'onMouseUp', false]), | ||
mouseEvent: _propTypes.default.oneOf(['onClick', 'onMouseDown', 'onMouseUp', 'onPointerDown', 'onPointerUp', false]), | ||
@@ -192,0 +192,0 @@ /** |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -11,6 +9,6 @@ value: true | ||
get: function () { | ||
return _composeClasses.default; | ||
return _privateClassnames.unstable_composeClasses; | ||
} | ||
}); | ||
var _composeClasses = _interopRequireDefault(require("./composeClasses")); | ||
var _privateClassnames = require("@mui/private-classnames"); |
@@ -6,26 +6,9 @@ "use strict"; | ||
}); | ||
var _exportNames = {}; | ||
Object.defineProperty(exports, "default", { | ||
enumerable: true, | ||
get: function () { | ||
return _generateUtilityClass.default; | ||
return _privateClassnames.generateUtilityClass; | ||
} | ||
}); | ||
var _generateUtilityClass = _interopRequireWildcard(require("./generateUtilityClass")); | ||
Object.keys(_generateUtilityClass).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _generateUtilityClass[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _generateUtilityClass[key]; | ||
} | ||
}); | ||
}); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var _privateClassnames = require("@mui/private-classnames"); |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -11,6 +9,6 @@ value: true | ||
get: function () { | ||
return _generateUtilityClasses.default; | ||
return _privateClassnames.generateUtilityClasses; | ||
} | ||
}); | ||
var _generateUtilityClasses = _interopRequireDefault(require("./generateUtilityClasses")); | ||
var _privateClassnames = require("@mui/private-classnames"); |
@@ -1,2 +0,2 @@ | ||
/** @license MUI v5.0.0-alpha.79 | ||
/** @license MUI v5.0.0-alpha.80 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
@@ -77,3 +77,2 @@ "use strict"; | ||
} = (0, _useMenuItem.default)({ | ||
component: Root, | ||
disabled, | ||
@@ -80,0 +79,0 @@ ref, |
@@ -26,3 +26,2 @@ "use strict"; | ||
const { | ||
component, | ||
disabled = false, | ||
@@ -63,3 +62,2 @@ ref, | ||
} = (0, _ButtonUnstyled.useButton)({ | ||
component, | ||
disabled, | ||
@@ -66,0 +64,0 @@ focusableWhenDisabled: true, |
@@ -138,3 +138,2 @@ "use strict"; | ||
} = (0, _useSelect.default)({ | ||
buttonComponent: Button, | ||
buttonRef: handleButtonRef, | ||
@@ -141,0 +140,0 @@ defaultValue, |
@@ -139,3 +139,2 @@ "use strict"; | ||
} = (0, _useSelect.default)({ | ||
buttonComponent: Button, | ||
buttonRef: handleButtonRef, | ||
@@ -142,0 +141,0 @@ defaultValue, |
@@ -44,3 +44,2 @@ "use strict"; | ||
const { | ||
buttonComponent, | ||
buttonRef: buttonRefProp, | ||
@@ -204,3 +203,2 @@ defaultValue, | ||
} = (0, _ButtonUnstyled.useButton)({ | ||
component: buttonComponent, | ||
disabled, | ||
@@ -207,0 +205,0 @@ ref: handleButtonRef |
@@ -0,0 +0,0 @@ export { default } from './OptionGroupUnstyled'; |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ export interface OptionGroupUnstyledClasses { |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ export { default } from './OptionUnstyled'; |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ export interface OptionUnstyledClasses { |
@@ -0,0 +0,0 @@ import React from 'react'; |
{ | ||
"name": "@mui/base", | ||
"version": "5.0.0-alpha.79", | ||
"version": "5.0.0-alpha.80", | ||
"private": false, | ||
@@ -42,7 +42,8 @@ "author": "MUI Team", | ||
"@emotion/is-prop-valid": "^1.1.2", | ||
"@mui/private-classnames": "^5.7.0", | ||
"@mui/types": "^7.1.3", | ||
"@mui/utils": "^5.6.1", | ||
"@mui/utils": "^5.7.0", | ||
"@popperjs/core": "^2.11.5", | ||
"clsx": "^1.1.1", | ||
"prop-types": "^15.7.2", | ||
"prop-types": "^15.8.1", | ||
"react-is": "^17.0.2" | ||
@@ -49,0 +50,0 @@ }, |
@@ -0,0 +0,0 @@ export { default } from './SelectUnstyled'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -114,3 +114,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
} = useSelect({ | ||
buttonComponent: Button, | ||
buttonRef: handleButtonRef, | ||
@@ -117,0 +116,0 @@ defaultValue, |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ export interface SelectUnstyledClasses { |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ import { UseSelectMultiParameters, UseSelectMultiResult, UseSelectSingleParameters, UseSelectSingleResult } from './useSelect.types'; |
@@ -27,3 +27,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
const { | ||
buttonComponent, | ||
buttonRef: buttonRefProp, | ||
@@ -187,3 +186,2 @@ defaultValue, | ||
} = useButton({ | ||
component: buttonComponent, | ||
disabled, | ||
@@ -190,0 +188,0 @@ ref: handleButtonRef |
@@ -18,3 +18,2 @@ import React from 'react'; | ||
interface UseSelectCommonProps<TValue> { | ||
buttonComponent?: React.ElementType; | ||
buttonRef?: React.Ref<Element>; | ||
@@ -21,0 +20,0 @@ disabled?: boolean; |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ export interface SliderUnstyledClasses { |
@@ -0,0 +0,0 @@ /// <reference types="react" /> |
@@ -0,0 +0,0 @@ export { default } from './SwitchUnstyled'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ export interface SwitchUnstyledClasses { |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ export { default } from './TablePaginationUnstyled'; |
@@ -0,0 +0,0 @@ import { OverridableComponent } from '@mui/types'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ import { OverridableComponent } from '@mui/types'; |
@@ -0,0 +0,0 @@ export interface TablePaginationUnstyledClasses { |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ export { default } from './TabPanelUnstyled'; |
@@ -0,0 +0,0 @@ import { OverridableComponent } from '@mui/types'; |
@@ -0,0 +0,0 @@ export interface TabPanelUnstyledClasses { |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ export interface UseTabPanelProps { |
@@ -0,0 +0,0 @@ export { default } from './TabsListUnstyled'; |
@@ -0,0 +0,0 @@ import { OverridableComponent } from '@mui/types'; |
@@ -0,0 +0,0 @@ export interface TabsListUnstyledClasses { |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ export { default } from './TabsUnstyled'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ import { OverridableComponent } from '@mui/types'; |
@@ -0,0 +0,0 @@ export interface TabsUnstyledClasses { |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ export { default } from './TabUnstyled'; |
@@ -0,0 +0,0 @@ import { OverridableComponent } from '@mui/types'; |
@@ -0,0 +0,0 @@ export interface TabUnstyledClasses { |
@@ -0,0 +0,0 @@ /// <reference types="react" /> |
@@ -0,0 +0,0 @@ /// <reference types="react" /> |
@@ -0,0 +0,0 @@ /// <reference types="react" /> |
declare type ItemComparer<T> = (a: T, b: T) => boolean; | ||
export default function areArraysEqual<T>(array1: T[], array2: T[], itemComparer?: ItemComparer<T>): boolean; | ||
export {}; |
@@ -0,0 +0,0 @@ import { EventHandlers } from './types'; |
@@ -0,0 +0,0 @@ export { default as appendOwnerState } from './appendOwnerState'; |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ /// <reference types="react" /> |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2064125
12
660
40903
187
+ Added@mui/private-classnames@5.7.0(transitive)
Updated@mui/utils@^5.7.0
Updatedprop-types@^15.8.1