UNPKG

2.56 kBJavaScriptView Raw
1'use client';
2
3import * as React from 'react';
4import PropTypes from 'prop-types';
5import { emphasize } from '@mui/system/colorManipulator';
6import { styled } from "../zero-styled/index.js";
7import memoTheme from "../utils/memoTheme.js";
8import MoreHorizIcon from "../internal/svg-icons/MoreHoriz.js";
9import ButtonBase from "../ButtonBase/index.js";
10import { jsx as _jsx } from "react/jsx-runtime";
11const BreadcrumbCollapsedButton = styled(ButtonBase)(memoTheme(({
12 theme
13}) => ({
14 display: 'flex',
15 marginLeft: `calc(${theme.spacing(1)} * 0.5)`,
16 marginRight: `calc(${theme.spacing(1)} * 0.5)`,
17 ...(theme.palette.mode === 'light' ? {
18 backgroundColor: theme.palette.grey[100],
19 color: theme.palette.grey[700]
20 } : {
21 backgroundColor: theme.palette.grey[700],
22 color: theme.palette.grey[100]
23 }),
24 borderRadius: 2,
25 '&:hover, &:focus': {
26 ...(theme.palette.mode === 'light' ? {
27 backgroundColor: theme.palette.grey[200]
28 } : {
29 backgroundColor: theme.palette.grey[600]
30 })
31 },
32 '&:active': {
33 boxShadow: theme.shadows[0],
34 ...(theme.palette.mode === 'light' ? {
35 backgroundColor: emphasize(theme.palette.grey[200], 0.12)
36 } : {
37 backgroundColor: emphasize(theme.palette.grey[600], 0.12)
38 })
39 }
40})));
41const BreadcrumbCollapsedIcon = styled(MoreHorizIcon)({
42 width: 24,
43 height: 16
44});
45
46/**
47 * @ignore - internal component.
48 */
49function BreadcrumbCollapsed(props) {
50 const {
51 slots = {},
52 slotProps = {},
53 ...otherProps
54 } = props;
55 const ownerState = props;
56 return /*#__PURE__*/_jsx("li", {
57 children: /*#__PURE__*/_jsx(BreadcrumbCollapsedButton, {
58 focusRipple: true,
59 ...otherProps,
60 ownerState: ownerState,
61 children: /*#__PURE__*/_jsx(BreadcrumbCollapsedIcon, {
62 as: slots.CollapsedIcon,
63 ownerState: ownerState,
64 ...slotProps.collapsedIcon
65 })
66 })
67 });
68}
69process.env.NODE_ENV !== "production" ? BreadcrumbCollapsed.propTypes = {
70 /**
71 * The props used for the CollapsedIcon slot.
72 * @default {}
73 */
74 slotProps: PropTypes.shape({
75 collapsedIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
76 }),
77 /**
78 * The components used for each slot inside the BreadcumbCollapsed.
79 * Either a string to use a HTML element or a component.
80 * @default {}
81 */
82 slots: PropTypes.shape({
83 CollapsedIcon: PropTypes.elementType
84 }),
85 /**
86 * The system prop that allows defining system overrides as well as additional CSS styles.
87 */
88 sx: PropTypes.object
89} : void 0;
90export default BreadcrumbCollapsed;
\No newline at end of file