1 | 'use client';
|
2 |
|
3 | var _span;
|
4 | import * as React from 'react';
|
5 | import PropTypes from 'prop-types';
|
6 | import rootShouldForwardProp from "../styles/rootShouldForwardProp.js";
|
7 | import { styled } from "../zero-styled/index.js";
|
8 | import memoTheme from "../utils/memoTheme.js";
|
9 | import { jsx as _jsx } from "react/jsx-runtime";
|
10 | const 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 | const NotchedOutlineLegend = styled('legend', {
|
29 | shouldForwardProp: rootShouldForwardProp
|
30 | })(memoTheme(({
|
31 | theme
|
32 | }) => ({
|
33 | float: 'unset',
|
34 |
|
35 | width: 'auto',
|
36 |
|
37 | overflow: 'hidden',
|
38 |
|
39 | variants: [{
|
40 | props: ({
|
41 | ownerState
|
42 | }) => !ownerState.withLabel,
|
43 | style: {
|
44 | padding: 0,
|
45 | lineHeight: '11px',
|
46 |
|
47 | transition: theme.transitions.create('width', {
|
48 | duration: 150,
|
49 | easing: theme.transitions.easing.easeOut
|
50 | })
|
51 | }
|
52 | }, {
|
53 | props: ({
|
54 | ownerState
|
55 | }) => ownerState.withLabel,
|
56 | style: {
|
57 | display: 'block',
|
58 |
|
59 | padding: 0,
|
60 | height: 11,
|
61 |
|
62 | fontSize: '0.75em',
|
63 | visibility: 'hidden',
|
64 | maxWidth: 0.01,
|
65 | transition: theme.transitions.create('max-width', {
|
66 | duration: 50,
|
67 | easing: theme.transitions.easing.easeOut
|
68 | }),
|
69 | whiteSpace: 'nowrap',
|
70 | '& > span': {
|
71 | paddingLeft: 5,
|
72 | paddingRight: 5,
|
73 | display: 'inline-block',
|
74 | opacity: 0,
|
75 | visibility: 'visible'
|
76 | }
|
77 | }
|
78 | }, {
|
79 | props: ({
|
80 | ownerState
|
81 | }) => ownerState.withLabel && ownerState.notched,
|
82 | style: {
|
83 | maxWidth: '100%',
|
84 | transition: theme.transitions.create('max-width', {
|
85 | duration: 100,
|
86 | easing: theme.transitions.easing.easeOut,
|
87 | delay: 50
|
88 | })
|
89 | }
|
90 | }]
|
91 | })));
|
92 |
|
93 |
|
94 |
|
95 |
|
96 | export default function NotchedOutline(props) {
|
97 | const {
|
98 | children,
|
99 | classes,
|
100 | className,
|
101 | label,
|
102 | notched,
|
103 | ...other
|
104 | } = props;
|
105 | const withLabel = label != null && label !== '';
|
106 | const ownerState = {
|
107 | ...props,
|
108 | notched,
|
109 | withLabel
|
110 | };
|
111 | return _jsx(NotchedOutlineRoot, {
|
112 | "aria-hidden": true,
|
113 | className: className,
|
114 | ownerState: ownerState,
|
115 | ...other,
|
116 | children: _jsx(NotchedOutlineLegend, {
|
117 | ownerState: ownerState,
|
118 | children: withLabel ? _jsx("span", {
|
119 | children: label
|
120 | }) :
|
121 | _span || (_span = _jsx("span", {
|
122 | className: "notranslate",
|
123 | children: "\u200B"
|
124 | }))
|
125 | })
|
126 | });
|
127 | }
|
128 | process.env.NODE_ENV !== "production" ? NotchedOutline.propTypes = {
|
129 | |
130 |
|
131 |
|
132 | children: PropTypes.node,
|
133 | |
134 |
|
135 |
|
136 | classes: PropTypes.object,
|
137 | |
138 |
|
139 |
|
140 | className: PropTypes.string,
|
141 | |
142 |
|
143 |
|
144 | label: PropTypes.node,
|
145 | |
146 |
|
147 |
|
148 | notched: PropTypes.bool.isRequired,
|
149 | |
150 |
|
151 |
|
152 | style: PropTypes.object
|
153 | } : void 0; |
\ | No newline at end of file |