@teamturing/react-kit 2.5.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Button/index.d.ts +1 -1
- package/dist/core/GradientText/index.d.ts +11 -12
- package/dist/core/Grid/index.d.ts +2 -2
- package/dist/core/IconButton/index.d.ts +1 -1
- package/dist/core/ItemList/index.d.ts +2 -2
- package/dist/core/Spinner/index.d.ts +116 -116
- package/dist/core/Stack/index.d.ts +2 -2
- package/dist/core/TextInput/index.d.ts +39 -0
- package/dist/core/Textarea/index.d.ts +9 -0
- package/dist/enigma/types/index.d.ts +2 -6
- package/dist/index.d.ts +4 -0
- package/dist/index.js +709 -8
- package/esm/_virtual/index.js +3 -0
- package/esm/_virtual/react-is.development.js +3 -0
- package/esm/_virtual/react-is.production.min.js +3 -0
- package/esm/core/TextInput/index.js +220 -0
- package/esm/core/Textarea/index.js +158 -0
- package/esm/enigma/View/ImageView/index.js +1 -0
- package/esm/index.js +2 -0
- package/esm/node_modules/react-is/cjs/react-is.development.js +211 -0
- package/esm/node_modules/react-is/cjs/react-is.production.min.js +123 -0
- package/esm/node_modules/react-is/index.js +12 -0
- package/package.json +4 -2
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import color from '../../packages/token-studio/esm/token/color/index.js';
|
|
2
|
+
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
3
|
+
import { forwardRef, cloneElement } from 'react';
|
|
4
|
+
import { r as reactIsExports } from '../../node_modules/react-is/index.js';
|
|
5
|
+
import styled, { css } from 'styled-components';
|
|
6
|
+
import useProvidedOrCreatedRef from '../../hook/useProvidedOrCreatedRef.js';
|
|
7
|
+
import { forcePixelValue } from '../../utils/forcePixelValue.js';
|
|
8
|
+
import { isFunction } from '../../utils/isFunction.js';
|
|
9
|
+
import { isNullable } from '../../utils/isNullable.js';
|
|
10
|
+
import View from '../View/index.js';
|
|
11
|
+
import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
|
|
12
|
+
|
|
13
|
+
const TextInput = /*#__PURE__*/forwardRef(({
|
|
14
|
+
type = 'text',
|
|
15
|
+
disabled,
|
|
16
|
+
validationStatus,
|
|
17
|
+
leadingVisual: LeadingVisual,
|
|
18
|
+
trailingVisual: TrailingVisual,
|
|
19
|
+
trailingAction,
|
|
20
|
+
...props
|
|
21
|
+
}, ref) => {
|
|
22
|
+
const inputRef = useProvidedOrCreatedRef(ref);
|
|
23
|
+
const focusInput = () => {
|
|
24
|
+
inputRef.current?.focus();
|
|
25
|
+
};
|
|
26
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs(TextInputWrapper, {
|
|
27
|
+
disabled: disabled,
|
|
28
|
+
onClick: focusInput,
|
|
29
|
+
hasLeadingVisual: !isNullable(LeadingVisual),
|
|
30
|
+
hasTrailingVisual: !isNullable(TrailingVisual),
|
|
31
|
+
hasTrailingAction: !isNullable(trailingAction),
|
|
32
|
+
validationStatus: validationStatus,
|
|
33
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsx(View, {
|
|
34
|
+
sx: {
|
|
35
|
+
'flexShrink': 0,
|
|
36
|
+
'fontSize': 'xxs',
|
|
37
|
+
'fontWeight': 'medium',
|
|
38
|
+
'color': color['text/neutral'],
|
|
39
|
+
'& > svg': {
|
|
40
|
+
display: 'block',
|
|
41
|
+
width: 24,
|
|
42
|
+
height: 24,
|
|
43
|
+
color: color['icon/neutral/bold']
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
children: typeof LeadingVisual !== 'string' && reactIsExports.isValidElementType(LeadingVisual) ? /*#__PURE__*/jsxRuntimeExports.jsx(LeadingVisual, {}) : LeadingVisual
|
|
47
|
+
}), /*#__PURE__*/jsxRuntimeExports.jsx(BaseInput, {
|
|
48
|
+
ref: e => {
|
|
49
|
+
isFunction(ref) ? ref(e) : null;
|
|
50
|
+
inputRef.current = e;
|
|
51
|
+
},
|
|
52
|
+
type: type,
|
|
53
|
+
disabled: disabled,
|
|
54
|
+
...props
|
|
55
|
+
}), /*#__PURE__*/jsxRuntimeExports.jsxs(View, {
|
|
56
|
+
sx: {
|
|
57
|
+
'display': 'flex',
|
|
58
|
+
'alignItems': 'center',
|
|
59
|
+
'columnGap': 2,
|
|
60
|
+
'flexShrink': 0,
|
|
61
|
+
'fontSize': 'xxs',
|
|
62
|
+
'fontWeight': 'medium',
|
|
63
|
+
'color': color['text/neutral'],
|
|
64
|
+
'& > svg': {
|
|
65
|
+
display: 'block',
|
|
66
|
+
width: 24,
|
|
67
|
+
height: 24,
|
|
68
|
+
color: color['icon/neutral/bold']
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
children: [typeof TrailingVisual !== 'string' && reactIsExports.isValidElementType(TrailingVisual) ? /*#__PURE__*/jsxRuntimeExports.jsx(TrailingVisual, {}) : TrailingVisual, trailingAction ? /*#__PURE__*/cloneElement(trailingAction, {
|
|
72
|
+
disabled: disabled
|
|
73
|
+
}) : null]
|
|
74
|
+
})]
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
const TextInputWrapper = styled.div`
|
|
78
|
+
position: relative;
|
|
79
|
+
width: ${forcePixelValue('100%')};
|
|
80
|
+
border-width: ${forcePixelValue(1)};
|
|
81
|
+
border-style: solid;
|
|
82
|
+
border-radius: ${({
|
|
83
|
+
theme
|
|
84
|
+
}) => forcePixelValue(theme.radii.s)};
|
|
85
|
+
border-color: ${({
|
|
86
|
+
theme
|
|
87
|
+
}) => theme.colors['border/input']};
|
|
88
|
+
background-color: ${({
|
|
89
|
+
theme
|
|
90
|
+
}) => theme.colors['bg/input']};
|
|
91
|
+
cursor: text;
|
|
92
|
+
display: inline-flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
|
|
95
|
+
font-size: ${({
|
|
96
|
+
theme
|
|
97
|
+
}) => forcePixelValue(theme.fontSizes.xs)};
|
|
98
|
+
font-weight: ${({
|
|
99
|
+
theme
|
|
100
|
+
}) => theme.fontWeights.medium};
|
|
101
|
+
line-height: ${({
|
|
102
|
+
theme
|
|
103
|
+
}) => theme.lineHeights[2]};
|
|
104
|
+
color: ${({
|
|
105
|
+
theme
|
|
106
|
+
}) => theme.colors['text/neutral']};
|
|
107
|
+
input::placeholder {
|
|
108
|
+
color: ${({
|
|
109
|
+
theme
|
|
110
|
+
}) => theme.colors['text/neutral/subtlest']};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&:after {
|
|
114
|
+
content: '';
|
|
115
|
+
position: absolute;
|
|
116
|
+
top: ${forcePixelValue(-1)};
|
|
117
|
+
right: ${forcePixelValue(-1)};
|
|
118
|
+
bottom: ${forcePixelValue(-1)};
|
|
119
|
+
left: ${forcePixelValue(-1)};
|
|
120
|
+
|
|
121
|
+
border: ${forcePixelValue(2)} solid transparent;
|
|
122
|
+
border-radius: ${({
|
|
123
|
+
theme
|
|
124
|
+
}) => forcePixelValue(theme.radii.s)};
|
|
125
|
+
pointer-events: none;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
${props => props.validationStatus !== 'error' && !props.disabled && css`
|
|
129
|
+
&:hover:not(:focus-within) {
|
|
130
|
+
&:after {
|
|
131
|
+
border-color: ${({
|
|
132
|
+
theme
|
|
133
|
+
}) => theme.colors['border/hovered']};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
`}
|
|
137
|
+
|
|
138
|
+
${props => props.validationStatus === 'error' && css`
|
|
139
|
+
&:after {
|
|
140
|
+
border-color: ${({
|
|
141
|
+
theme
|
|
142
|
+
}) => theme.colors['border/danger']};
|
|
143
|
+
}
|
|
144
|
+
`}
|
|
145
|
+
|
|
146
|
+
${props => props.validationStatus !== 'error' && css`
|
|
147
|
+
&:focus-within {
|
|
148
|
+
&:after {
|
|
149
|
+
border-color: ${({
|
|
150
|
+
theme
|
|
151
|
+
}) => theme.colors['border/focused']};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
`}
|
|
155
|
+
|
|
156
|
+
${props => props.disabled && css`
|
|
157
|
+
border-color: ${props.theme.colors['border/input']};
|
|
158
|
+
background-color: ${props.theme.colors['bg/disabled']};
|
|
159
|
+
color: ${props.theme.colors['text/disabled']};
|
|
160
|
+
|
|
161
|
+
input::placeholder {
|
|
162
|
+
color: ${props.theme.colors['text/disabled']};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
input {
|
|
166
|
+
cursor: not-allowed;
|
|
167
|
+
}
|
|
168
|
+
`};
|
|
169
|
+
|
|
170
|
+
${props => props.hasLeadingVisual && css`
|
|
171
|
+
padding-left: ${forcePixelValue(props.theme.space[5])};
|
|
172
|
+
input {
|
|
173
|
+
padding-left: ${forcePixelValue(props.theme.space[3])};
|
|
174
|
+
}
|
|
175
|
+
`}
|
|
176
|
+
|
|
177
|
+
${props => (props.hasTrailingVisual || props.hasTrailingAction) && css`
|
|
178
|
+
padding-right: ${forcePixelValue(props.theme.space[3])};
|
|
179
|
+
input {
|
|
180
|
+
padding-right: ${forcePixelValue(props.theme.space[3])};
|
|
181
|
+
}
|
|
182
|
+
`}
|
|
183
|
+
|
|
184
|
+
transition: color 100ms, background-color 100ms;
|
|
185
|
+
&:after {
|
|
186
|
+
transition: border-color 100ms;
|
|
187
|
+
}
|
|
188
|
+
`;
|
|
189
|
+
const UnstyledInput = styled.input`
|
|
190
|
+
font-size: inherit;
|
|
191
|
+
font-weight: inherit;
|
|
192
|
+
line-height: inherit;
|
|
193
|
+
font-family: inherit;
|
|
194
|
+
border-radius: inherit;
|
|
195
|
+
color: inherit;
|
|
196
|
+
transition: inherit;
|
|
197
|
+
|
|
198
|
+
border: 0;
|
|
199
|
+
background-color: transparent;
|
|
200
|
+
width: 100%;
|
|
201
|
+
&:focus {
|
|
202
|
+
outline: 0;
|
|
203
|
+
}
|
|
204
|
+
`;
|
|
205
|
+
const BaseInput = styled(UnstyledInput)`
|
|
206
|
+
padding-top: ${({
|
|
207
|
+
theme
|
|
208
|
+
}) => forcePixelValue(theme.space['4'])};
|
|
209
|
+
padding-right: ${({
|
|
210
|
+
theme
|
|
211
|
+
}) => forcePixelValue(theme.space['4'])};
|
|
212
|
+
padding-bottom: ${({
|
|
213
|
+
theme
|
|
214
|
+
}) => forcePixelValue(theme.space['4'])};
|
|
215
|
+
padding-left: ${({
|
|
216
|
+
theme
|
|
217
|
+
}) => forcePixelValue(theme.space['5'])};
|
|
218
|
+
`;
|
|
219
|
+
|
|
220
|
+
export { TextInput as default };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import useProvidedOrCreatedRef from '../../hook/useProvidedOrCreatedRef.js';
|
|
4
|
+
import { forcePixelValue } from '../../utils/forcePixelValue.js';
|
|
5
|
+
import { isFunction } from '../../utils/isFunction.js';
|
|
6
|
+
import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
|
|
7
|
+
|
|
8
|
+
const Textarea = /*#__PURE__*/forwardRef(({
|
|
9
|
+
disabled,
|
|
10
|
+
...props
|
|
11
|
+
}, ref) => {
|
|
12
|
+
const inputRef = useProvidedOrCreatedRef(ref);
|
|
13
|
+
const focusInput = () => {
|
|
14
|
+
inputRef.current?.focus();
|
|
15
|
+
};
|
|
16
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(TextareaWrapper, {
|
|
17
|
+
disabled: disabled,
|
|
18
|
+
onClick: focusInput,
|
|
19
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(BaseTextarea, {
|
|
20
|
+
ref: e => {
|
|
21
|
+
isFunction(ref) ? ref(e) : null;
|
|
22
|
+
inputRef.current = e;
|
|
23
|
+
},
|
|
24
|
+
disabled: disabled,
|
|
25
|
+
...props
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
const TextareaWrapper = styled.div`
|
|
30
|
+
position: relative;
|
|
31
|
+
width: ${forcePixelValue('100%')};
|
|
32
|
+
border-width: ${forcePixelValue(1)};
|
|
33
|
+
border-style: solid;
|
|
34
|
+
border-radius: ${({
|
|
35
|
+
theme
|
|
36
|
+
}) => forcePixelValue(theme.radii.s)};
|
|
37
|
+
border-color: ${({
|
|
38
|
+
theme
|
|
39
|
+
}) => theme.colors['border/input']};
|
|
40
|
+
background-color: ${({
|
|
41
|
+
theme
|
|
42
|
+
}) => theme.colors['bg/input']};
|
|
43
|
+
cursor: text;
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
|
|
47
|
+
padding-top: ${({
|
|
48
|
+
theme
|
|
49
|
+
}) => forcePixelValue(theme.space['4'])};
|
|
50
|
+
padding-right: ${({
|
|
51
|
+
theme
|
|
52
|
+
}) => forcePixelValue(theme.space['4'])};
|
|
53
|
+
padding-bottom: ${({
|
|
54
|
+
theme
|
|
55
|
+
}) => forcePixelValue(theme.space['4'])};
|
|
56
|
+
padding-left: ${({
|
|
57
|
+
theme
|
|
58
|
+
}) => forcePixelValue(theme.space['5'])};
|
|
59
|
+
|
|
60
|
+
font-size: ${({
|
|
61
|
+
theme
|
|
62
|
+
}) => forcePixelValue(theme.fontSizes.xs)};
|
|
63
|
+
font-weight: ${({
|
|
64
|
+
theme
|
|
65
|
+
}) => theme.fontWeights.medium};
|
|
66
|
+
line-height: ${({
|
|
67
|
+
theme
|
|
68
|
+
}) => theme.lineHeights[2]};
|
|
69
|
+
color: ${({
|
|
70
|
+
theme
|
|
71
|
+
}) => theme.colors['text/neutral']};
|
|
72
|
+
input::placeholder {
|
|
73
|
+
color: ${({
|
|
74
|
+
theme
|
|
75
|
+
}) => theme.colors['text/neutral/subtlest']};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
height: 74px;
|
|
79
|
+
|
|
80
|
+
&:after {
|
|
81
|
+
content: '';
|
|
82
|
+
position: absolute;
|
|
83
|
+
top: ${forcePixelValue(-1)};
|
|
84
|
+
right: ${forcePixelValue(-1)};
|
|
85
|
+
bottom: ${forcePixelValue(-1)};
|
|
86
|
+
left: ${forcePixelValue(-1)};
|
|
87
|
+
|
|
88
|
+
border: ${forcePixelValue(2)} solid transparent;
|
|
89
|
+
border-radius: ${({
|
|
90
|
+
theme
|
|
91
|
+
}) => forcePixelValue(theme.radii.s)};
|
|
92
|
+
pointer-events: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
${props => props.validationStatus !== 'error' && !props.disabled && css`
|
|
96
|
+
&:hover:not(:focus-within) {
|
|
97
|
+
&:after {
|
|
98
|
+
border-color: ${({
|
|
99
|
+
theme
|
|
100
|
+
}) => theme.colors['border/hovered']};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
`}
|
|
104
|
+
|
|
105
|
+
${props => props.validationStatus === 'error' && css`
|
|
106
|
+
&:after {
|
|
107
|
+
border-color: ${({
|
|
108
|
+
theme
|
|
109
|
+
}) => theme.colors['border/danger']};
|
|
110
|
+
}
|
|
111
|
+
`}
|
|
112
|
+
|
|
113
|
+
${props => props.validationStatus !== 'error' && css`
|
|
114
|
+
&:focus-within {
|
|
115
|
+
&:after {
|
|
116
|
+
border-color: ${({
|
|
117
|
+
theme
|
|
118
|
+
}) => theme.colors['border/focused']};
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
`}
|
|
122
|
+
|
|
123
|
+
${props => props.disabled && css`
|
|
124
|
+
border-color: ${props.theme.colors['border/input']};
|
|
125
|
+
background-color: ${props.theme.colors['bg/disabled']};
|
|
126
|
+
color: ${props.theme.colors['text/disabled']};
|
|
127
|
+
|
|
128
|
+
textarea::placeholder {
|
|
129
|
+
color: ${props.theme.colors['text/disabled']};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&,
|
|
133
|
+
textarea {
|
|
134
|
+
cursor: not-allowed;
|
|
135
|
+
}
|
|
136
|
+
`};
|
|
137
|
+
`;
|
|
138
|
+
const UnstyledTextarea = styled.textarea`
|
|
139
|
+
font-size: inherit;
|
|
140
|
+
font-weight: inherit;
|
|
141
|
+
line-height: inherit;
|
|
142
|
+
font-family: inherit;
|
|
143
|
+
border-radius: inherit;
|
|
144
|
+
color: inherit;
|
|
145
|
+
transition: inherit;
|
|
146
|
+
|
|
147
|
+
border: 0;
|
|
148
|
+
background-color: transparent;
|
|
149
|
+
width: 100%;
|
|
150
|
+
&:focus {
|
|
151
|
+
outline: 0;
|
|
152
|
+
}
|
|
153
|
+
`;
|
|
154
|
+
const BaseTextarea = styled(UnstyledTextarea)`
|
|
155
|
+
resize: none;
|
|
156
|
+
`;
|
|
157
|
+
|
|
158
|
+
export { Textarea as default };
|
package/esm/index.js
CHANGED
|
@@ -14,6 +14,8 @@ export { default as Spinner } from './core/Spinner/index.js';
|
|
|
14
14
|
export { default as Stack } from './core/Stack/index.js';
|
|
15
15
|
export { default as StyledIcon } from './core/StyledIcon/index.js';
|
|
16
16
|
export { default as Text } from './core/Text/index.js';
|
|
17
|
+
export { default as Textarea } from './core/Textarea/index.js';
|
|
18
|
+
export { default as TextInput } from './core/TextInput/index.js';
|
|
17
19
|
export { default as ThemeProvider } from './core/ThemeProvider/index.js';
|
|
18
20
|
export { default as View } from './core/View/index.js';
|
|
19
21
|
export { default as UnstyledButton } from './core/_UnstyledButton.js';
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { __exports as reactIs_development } from '../../../_virtual/react-is.development.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-is.development.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var hasRequiredReactIs_development;
|
|
13
|
+
function requireReactIs_development() {
|
|
14
|
+
if (hasRequiredReactIs_development) return reactIs_development;
|
|
15
|
+
hasRequiredReactIs_development = 1;
|
|
16
|
+
if (process.env.NODE_ENV !== "production") {
|
|
17
|
+
(function () {
|
|
18
|
+
|
|
19
|
+
// ATTENTION
|
|
20
|
+
// When adding new symbols to this file,
|
|
21
|
+
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
22
|
+
// The Symbol used to tag the ReactElement-like types.
|
|
23
|
+
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
24
|
+
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
25
|
+
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
26
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
27
|
+
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
28
|
+
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
29
|
+
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
30
|
+
var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
|
|
31
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
32
|
+
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
33
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
34
|
+
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
35
|
+
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
36
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
37
|
+
|
|
38
|
+
// -----------------------------------------------------------------------------
|
|
39
|
+
|
|
40
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
41
|
+
var enableCacheElement = false;
|
|
42
|
+
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
43
|
+
|
|
44
|
+
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
45
|
+
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
46
|
+
// issues in DEV builds.
|
|
47
|
+
|
|
48
|
+
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
49
|
+
|
|
50
|
+
var REACT_MODULE_REFERENCE;
|
|
51
|
+
{
|
|
52
|
+
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
53
|
+
}
|
|
54
|
+
function isValidElementType(type) {
|
|
55
|
+
if (typeof type === 'string' || typeof type === 'function') {
|
|
56
|
+
return true;
|
|
57
|
+
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
58
|
+
|
|
59
|
+
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
if (typeof type === 'object' && type !== null) {
|
|
63
|
+
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
|
64
|
+
// This needs to include all possible module reference object
|
|
65
|
+
// types supported by any Flight configuration anywhere since
|
|
66
|
+
// we don't know which Flight build this will end up being used
|
|
67
|
+
// with.
|
|
68
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
function typeOf(object) {
|
|
75
|
+
if (typeof object === 'object' && object !== null) {
|
|
76
|
+
var $$typeof = object.$$typeof;
|
|
77
|
+
switch ($$typeof) {
|
|
78
|
+
case REACT_ELEMENT_TYPE:
|
|
79
|
+
var type = object.type;
|
|
80
|
+
switch (type) {
|
|
81
|
+
case REACT_FRAGMENT_TYPE:
|
|
82
|
+
case REACT_PROFILER_TYPE:
|
|
83
|
+
case REACT_STRICT_MODE_TYPE:
|
|
84
|
+
case REACT_SUSPENSE_TYPE:
|
|
85
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
86
|
+
return type;
|
|
87
|
+
default:
|
|
88
|
+
var $$typeofType = type && type.$$typeof;
|
|
89
|
+
switch ($$typeofType) {
|
|
90
|
+
case REACT_SERVER_CONTEXT_TYPE:
|
|
91
|
+
case REACT_CONTEXT_TYPE:
|
|
92
|
+
case REACT_FORWARD_REF_TYPE:
|
|
93
|
+
case REACT_LAZY_TYPE:
|
|
94
|
+
case REACT_MEMO_TYPE:
|
|
95
|
+
case REACT_PROVIDER_TYPE:
|
|
96
|
+
return $$typeofType;
|
|
97
|
+
default:
|
|
98
|
+
return $$typeof;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
case REACT_PORTAL_TYPE:
|
|
102
|
+
return $$typeof;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
108
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
109
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
110
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
111
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
112
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
113
|
+
var Memo = REACT_MEMO_TYPE;
|
|
114
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
115
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
116
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
117
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
118
|
+
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
119
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
120
|
+
var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
|
|
121
|
+
|
|
122
|
+
function isAsyncMode(object) {
|
|
123
|
+
{
|
|
124
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
125
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
126
|
+
|
|
127
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
function isConcurrentMode(object) {
|
|
133
|
+
{
|
|
134
|
+
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
135
|
+
hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
136
|
+
|
|
137
|
+
console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
function isContextConsumer(object) {
|
|
143
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
144
|
+
}
|
|
145
|
+
function isContextProvider(object) {
|
|
146
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
147
|
+
}
|
|
148
|
+
function isElement(object) {
|
|
149
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
150
|
+
}
|
|
151
|
+
function isForwardRef(object) {
|
|
152
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
153
|
+
}
|
|
154
|
+
function isFragment(object) {
|
|
155
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
156
|
+
}
|
|
157
|
+
function isLazy(object) {
|
|
158
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
159
|
+
}
|
|
160
|
+
function isMemo(object) {
|
|
161
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
162
|
+
}
|
|
163
|
+
function isPortal(object) {
|
|
164
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
165
|
+
}
|
|
166
|
+
function isProfiler(object) {
|
|
167
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
168
|
+
}
|
|
169
|
+
function isStrictMode(object) {
|
|
170
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
171
|
+
}
|
|
172
|
+
function isSuspense(object) {
|
|
173
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
174
|
+
}
|
|
175
|
+
function isSuspenseList(object) {
|
|
176
|
+
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
177
|
+
}
|
|
178
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
179
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
180
|
+
reactIs_development.Element = Element;
|
|
181
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
182
|
+
reactIs_development.Fragment = Fragment;
|
|
183
|
+
reactIs_development.Lazy = Lazy;
|
|
184
|
+
reactIs_development.Memo = Memo;
|
|
185
|
+
reactIs_development.Portal = Portal;
|
|
186
|
+
reactIs_development.Profiler = Profiler;
|
|
187
|
+
reactIs_development.StrictMode = StrictMode;
|
|
188
|
+
reactIs_development.Suspense = Suspense;
|
|
189
|
+
reactIs_development.SuspenseList = SuspenseList;
|
|
190
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
191
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
192
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
193
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
194
|
+
reactIs_development.isElement = isElement;
|
|
195
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
196
|
+
reactIs_development.isFragment = isFragment;
|
|
197
|
+
reactIs_development.isLazy = isLazy;
|
|
198
|
+
reactIs_development.isMemo = isMemo;
|
|
199
|
+
reactIs_development.isPortal = isPortal;
|
|
200
|
+
reactIs_development.isProfiler = isProfiler;
|
|
201
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
202
|
+
reactIs_development.isSuspense = isSuspense;
|
|
203
|
+
reactIs_development.isSuspenseList = isSuspenseList;
|
|
204
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
205
|
+
reactIs_development.typeOf = typeOf;
|
|
206
|
+
})();
|
|
207
|
+
}
|
|
208
|
+
return reactIs_development;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export { requireReactIs_development as __require };
|