1 | 'use client';
|
2 |
|
3 | import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4 | import _extends from "@babel/runtime/helpers/esm/extends";
|
5 | var _span;
|
6 | import * as React from 'react';
|
7 | import PropTypes from 'prop-types';
|
8 | import styled, { rootShouldForwardProp } from '../styles/styled';
|
9 | import { jsx as _jsx } from "react/jsx-runtime";
|
10 | var NotchedOutlineRoot = styled('fieldset', {
|
11 | shouldForwardProp: rootShouldForwardProp
|
12 | })({
|
13 | textAlign: 'left',
|
14 | position: 'absolute',
|
15 | bottom: 0,
|
16 | right: 0,
|
17 | top: -5,
|
18 | left: 0,
|
19 | margin: 0,
|
20 | padding: '0 8px',
|
21 | pointerEvents: 'none',
|
22 | borderRadius: 'inherit',
|
23 | borderStyle: 'solid',
|
24 | borderWidth: 1,
|
25 | overflow: 'hidden',
|
26 | minWidth: '0%'
|
27 | });
|
28 | var NotchedOutlineLegend = styled('legend', {
|
29 | shouldForwardProp: rootShouldForwardProp
|
30 | })(function (_ref) {
|
31 | var ownerState = _ref.ownerState,
|
32 | theme = _ref.theme;
|
33 | return _extends({
|
34 | float: 'unset',
|
35 |
|
36 | width: 'auto',
|
37 |
|
38 | overflow: 'hidden'
|
39 | }, !ownerState.withLabel && {
|
40 | padding: 0,
|
41 | lineHeight: '11px',
|
42 |
|
43 | transition: theme.transitions.create('width', {
|
44 | duration: 150,
|
45 | easing: theme.transitions.easing.easeOut
|
46 | })
|
47 | }, ownerState.withLabel && _extends({
|
48 | display: 'block',
|
49 |
|
50 | padding: 0,
|
51 | height: 11,
|
52 |
|
53 | fontSize: '0.75em',
|
54 | visibility: 'hidden',
|
55 | maxWidth: 0.01,
|
56 | transition: theme.transitions.create('max-width', {
|
57 | duration: 50,
|
58 | easing: theme.transitions.easing.easeOut
|
59 | }),
|
60 | whiteSpace: 'nowrap',
|
61 | '& > span': {
|
62 | paddingLeft: 5,
|
63 | paddingRight: 5,
|
64 | display: 'inline-block',
|
65 | opacity: 0,
|
66 | visibility: 'visible'
|
67 | }
|
68 | }, ownerState.notched && {
|
69 | maxWidth: '100%',
|
70 | transition: theme.transitions.create('max-width', {
|
71 | duration: 100,
|
72 | easing: theme.transitions.easing.easeOut,
|
73 | delay: 50
|
74 | })
|
75 | }));
|
76 | });
|
77 |
|
78 |
|
79 |
|
80 |
|
81 | export default function NotchedOutline(props) {
|
82 | var children = props.children,
|
83 | classes = props.classes,
|
84 | className = props.className,
|
85 | label = props.label,
|
86 | notched = props.notched,
|
87 | other = _objectWithoutProperties(props, ["children", "classes", "className", "label", "notched"]);
|
88 | var withLabel = label != null && label !== '';
|
89 | var ownerState = _extends({}, props, {
|
90 | notched: notched,
|
91 | withLabel: withLabel
|
92 | });
|
93 | return _jsx(NotchedOutlineRoot, _extends({
|
94 | "aria-hidden": true,
|
95 | className: className,
|
96 | ownerState: ownerState
|
97 | }, other, {
|
98 | children: _jsx(NotchedOutlineLegend, {
|
99 | ownerState: ownerState,
|
100 | children: withLabel ? _jsx("span", {
|
101 | children: label
|
102 | }) :
|
103 | _span || (_span = _jsx("span", {
|
104 | className: "notranslate",
|
105 | children: "\u200B"
|
106 | }))
|
107 | })
|
108 | }));
|
109 | }
|
110 | process.env.NODE_ENV !== "production" ? NotchedOutline.propTypes = {
|
111 | |
112 |
|
113 |
|
114 | children: PropTypes.node,
|
115 | |
116 |
|
117 |
|
118 | classes: PropTypes.object,
|
119 | |
120 |
|
121 |
|
122 | className: PropTypes.string,
|
123 | |
124 |
|
125 |
|
126 | label: PropTypes.node,
|
127 | |
128 |
|
129 |
|
130 | notched: PropTypes.bool.isRequired,
|
131 | |
132 |
|
133 |
|
134 | style: PropTypes.object
|
135 | } : void 0; |
\ | No newline at end of file |