@sector.siit/mlz-components 1.0.11 → 1.0.13
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/README.md +1 -14
- package/dist/index.d.ts +23 -3
- package/dist/index.esm.js +59 -1395
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +69 -1404
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,1382 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
import { createContext, useContext, useState, useCallback } from 'react';
|
|
4
5
|
import toast from 'react-hot-toast';
|
|
5
6
|
export { Toaster, toast } from 'react-hot-toast';
|
|
6
7
|
|
|
7
|
-
var jsxRuntime = {exports: {}};
|
|
8
|
-
|
|
9
|
-
var reactJsxRuntime_development = {};
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @license React
|
|
13
|
-
* react-jsx-runtime.development.js
|
|
14
|
-
*
|
|
15
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the MIT license found in the
|
|
18
|
-
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
var hasRequiredReactJsxRuntime_development;
|
|
22
|
-
|
|
23
|
-
function requireReactJsxRuntime_development () {
|
|
24
|
-
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
25
|
-
hasRequiredReactJsxRuntime_development = 1;
|
|
26
|
-
|
|
27
|
-
if (process.env.NODE_ENV !== "production") {
|
|
28
|
-
(function() {
|
|
29
|
-
|
|
30
|
-
var React = require$$0;
|
|
31
|
-
|
|
32
|
-
// ATTENTION
|
|
33
|
-
// When adding new symbols to this file,
|
|
34
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
35
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
36
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
37
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
38
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
39
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
40
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
41
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
42
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
43
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
44
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
45
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
46
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
47
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
48
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
49
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
50
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
51
|
-
function getIteratorFn(maybeIterable) {
|
|
52
|
-
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
57
|
-
|
|
58
|
-
if (typeof maybeIterator === 'function') {
|
|
59
|
-
return maybeIterator;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
66
|
-
|
|
67
|
-
function error(format) {
|
|
68
|
-
{
|
|
69
|
-
{
|
|
70
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
71
|
-
args[_key2 - 1] = arguments[_key2];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
printWarning('error', format, args);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function printWarning(level, format, args) {
|
|
80
|
-
// When changing this logic, you might want to also
|
|
81
|
-
// update consoleWithStackDev.www.js as well.
|
|
82
|
-
{
|
|
83
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
84
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
85
|
-
|
|
86
|
-
if (stack !== '') {
|
|
87
|
-
format += '%s';
|
|
88
|
-
args = args.concat([stack]);
|
|
89
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
var argsWithFormat = args.map(function (item) {
|
|
93
|
-
return String(item);
|
|
94
|
-
}); // Careful: RN currently depends on this prefix
|
|
95
|
-
|
|
96
|
-
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
97
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
98
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
|
99
|
-
|
|
100
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// -----------------------------------------------------------------------------
|
|
105
|
-
|
|
106
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
107
|
-
var enableCacheElement = false;
|
|
108
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
109
|
-
|
|
110
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
111
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
112
|
-
// issues in DEV builds.
|
|
113
|
-
|
|
114
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
115
|
-
|
|
116
|
-
var REACT_MODULE_REFERENCE;
|
|
117
|
-
|
|
118
|
-
{
|
|
119
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function isValidElementType(type) {
|
|
123
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
124
|
-
return true;
|
|
125
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
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 ) {
|
|
129
|
-
return true;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (typeof type === 'object' && type !== null) {
|
|
133
|
-
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 || // This needs to include all possible module reference object
|
|
134
|
-
// types supported by any Flight configuration anywhere since
|
|
135
|
-
// we don't know which Flight build this will end up being used
|
|
136
|
-
// with.
|
|
137
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
138
|
-
return true;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return false;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
146
|
-
var displayName = outerType.displayName;
|
|
147
|
-
|
|
148
|
-
if (displayName) {
|
|
149
|
-
return displayName;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
var functionName = innerType.displayName || innerType.name || '';
|
|
153
|
-
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
154
|
-
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
function getContextName(type) {
|
|
158
|
-
return type.displayName || 'Context';
|
|
159
|
-
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
function getComponentNameFromType(type) {
|
|
163
|
-
if (type == null) {
|
|
164
|
-
// Host root, text node or just invalid type.
|
|
165
|
-
return null;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
{
|
|
169
|
-
if (typeof type.tag === 'number') {
|
|
170
|
-
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
if (typeof type === 'function') {
|
|
175
|
-
return type.displayName || type.name || null;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
if (typeof type === 'string') {
|
|
179
|
-
return type;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
switch (type) {
|
|
183
|
-
case REACT_FRAGMENT_TYPE:
|
|
184
|
-
return 'Fragment';
|
|
185
|
-
|
|
186
|
-
case REACT_PORTAL_TYPE:
|
|
187
|
-
return 'Portal';
|
|
188
|
-
|
|
189
|
-
case REACT_PROFILER_TYPE:
|
|
190
|
-
return 'Profiler';
|
|
191
|
-
|
|
192
|
-
case REACT_STRICT_MODE_TYPE:
|
|
193
|
-
return 'StrictMode';
|
|
194
|
-
|
|
195
|
-
case REACT_SUSPENSE_TYPE:
|
|
196
|
-
return 'Suspense';
|
|
197
|
-
|
|
198
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
199
|
-
return 'SuspenseList';
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
if (typeof type === 'object') {
|
|
204
|
-
switch (type.$$typeof) {
|
|
205
|
-
case REACT_CONTEXT_TYPE:
|
|
206
|
-
var context = type;
|
|
207
|
-
return getContextName(context) + '.Consumer';
|
|
208
|
-
|
|
209
|
-
case REACT_PROVIDER_TYPE:
|
|
210
|
-
var provider = type;
|
|
211
|
-
return getContextName(provider._context) + '.Provider';
|
|
212
|
-
|
|
213
|
-
case REACT_FORWARD_REF_TYPE:
|
|
214
|
-
return getWrappedName(type, type.render, 'ForwardRef');
|
|
215
|
-
|
|
216
|
-
case REACT_MEMO_TYPE:
|
|
217
|
-
var outerName = type.displayName || null;
|
|
218
|
-
|
|
219
|
-
if (outerName !== null) {
|
|
220
|
-
return outerName;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
return getComponentNameFromType(type.type) || 'Memo';
|
|
224
|
-
|
|
225
|
-
case REACT_LAZY_TYPE:
|
|
226
|
-
{
|
|
227
|
-
var lazyComponent = type;
|
|
228
|
-
var payload = lazyComponent._payload;
|
|
229
|
-
var init = lazyComponent._init;
|
|
230
|
-
|
|
231
|
-
try {
|
|
232
|
-
return getComponentNameFromType(init(payload));
|
|
233
|
-
} catch (x) {
|
|
234
|
-
return null;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// eslint-disable-next-line no-fallthrough
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return null;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
var assign = Object.assign;
|
|
246
|
-
|
|
247
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
248
|
-
// replaying on render function. This currently only patches the object
|
|
249
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
|
250
|
-
// We could also eagerly patch the method.
|
|
251
|
-
var disabledDepth = 0;
|
|
252
|
-
var prevLog;
|
|
253
|
-
var prevInfo;
|
|
254
|
-
var prevWarn;
|
|
255
|
-
var prevError;
|
|
256
|
-
var prevGroup;
|
|
257
|
-
var prevGroupCollapsed;
|
|
258
|
-
var prevGroupEnd;
|
|
259
|
-
|
|
260
|
-
function disabledLog() {}
|
|
261
|
-
|
|
262
|
-
disabledLog.__reactDisabledLog = true;
|
|
263
|
-
function disableLogs() {
|
|
264
|
-
{
|
|
265
|
-
if (disabledDepth === 0) {
|
|
266
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
267
|
-
prevLog = console.log;
|
|
268
|
-
prevInfo = console.info;
|
|
269
|
-
prevWarn = console.warn;
|
|
270
|
-
prevError = console.error;
|
|
271
|
-
prevGroup = console.group;
|
|
272
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
273
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
274
|
-
|
|
275
|
-
var props = {
|
|
276
|
-
configurable: true,
|
|
277
|
-
enumerable: true,
|
|
278
|
-
value: disabledLog,
|
|
279
|
-
writable: true
|
|
280
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
281
|
-
|
|
282
|
-
Object.defineProperties(console, {
|
|
283
|
-
info: props,
|
|
284
|
-
log: props,
|
|
285
|
-
warn: props,
|
|
286
|
-
error: props,
|
|
287
|
-
group: props,
|
|
288
|
-
groupCollapsed: props,
|
|
289
|
-
groupEnd: props
|
|
290
|
-
});
|
|
291
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
disabledDepth++;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
function reenableLogs() {
|
|
298
|
-
{
|
|
299
|
-
disabledDepth--;
|
|
300
|
-
|
|
301
|
-
if (disabledDepth === 0) {
|
|
302
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
303
|
-
var props = {
|
|
304
|
-
configurable: true,
|
|
305
|
-
enumerable: true,
|
|
306
|
-
writable: true
|
|
307
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
308
|
-
|
|
309
|
-
Object.defineProperties(console, {
|
|
310
|
-
log: assign({}, props, {
|
|
311
|
-
value: prevLog
|
|
312
|
-
}),
|
|
313
|
-
info: assign({}, props, {
|
|
314
|
-
value: prevInfo
|
|
315
|
-
}),
|
|
316
|
-
warn: assign({}, props, {
|
|
317
|
-
value: prevWarn
|
|
318
|
-
}),
|
|
319
|
-
error: assign({}, props, {
|
|
320
|
-
value: prevError
|
|
321
|
-
}),
|
|
322
|
-
group: assign({}, props, {
|
|
323
|
-
value: prevGroup
|
|
324
|
-
}),
|
|
325
|
-
groupCollapsed: assign({}, props, {
|
|
326
|
-
value: prevGroupCollapsed
|
|
327
|
-
}),
|
|
328
|
-
groupEnd: assign({}, props, {
|
|
329
|
-
value: prevGroupEnd
|
|
330
|
-
})
|
|
331
|
-
});
|
|
332
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
if (disabledDepth < 0) {
|
|
336
|
-
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
342
|
-
var prefix;
|
|
343
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
344
|
-
{
|
|
345
|
-
if (prefix === undefined) {
|
|
346
|
-
// Extract the VM specific prefix used by each line.
|
|
347
|
-
try {
|
|
348
|
-
throw Error();
|
|
349
|
-
} catch (x) {
|
|
350
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
351
|
-
prefix = match && match[1] || '';
|
|
352
|
-
}
|
|
353
|
-
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
return '\n' + prefix + name;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
var reentry = false;
|
|
360
|
-
var componentFrameCache;
|
|
361
|
-
|
|
362
|
-
{
|
|
363
|
-
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
364
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
368
|
-
// If something asked for a stack inside a fake render, it should get ignored.
|
|
369
|
-
if ( !fn || reentry) {
|
|
370
|
-
return '';
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
{
|
|
374
|
-
var frame = componentFrameCache.get(fn);
|
|
375
|
-
|
|
376
|
-
if (frame !== undefined) {
|
|
377
|
-
return frame;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
var control;
|
|
382
|
-
reentry = true;
|
|
383
|
-
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
384
|
-
|
|
385
|
-
Error.prepareStackTrace = undefined;
|
|
386
|
-
var previousDispatcher;
|
|
387
|
-
|
|
388
|
-
{
|
|
389
|
-
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
390
|
-
// for warnings.
|
|
391
|
-
|
|
392
|
-
ReactCurrentDispatcher.current = null;
|
|
393
|
-
disableLogs();
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
try {
|
|
397
|
-
// This should throw.
|
|
398
|
-
if (construct) {
|
|
399
|
-
// Something should be setting the props in the constructor.
|
|
400
|
-
var Fake = function () {
|
|
401
|
-
throw Error();
|
|
402
|
-
}; // $FlowFixMe
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
Object.defineProperty(Fake.prototype, 'props', {
|
|
406
|
-
set: function () {
|
|
407
|
-
// We use a throwing setter instead of frozen or non-writable props
|
|
408
|
-
// because that won't throw in a non-strict mode function.
|
|
409
|
-
throw Error();
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
|
|
413
|
-
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
414
|
-
// We construct a different control for this case to include any extra
|
|
415
|
-
// frames added by the construct call.
|
|
416
|
-
try {
|
|
417
|
-
Reflect.construct(Fake, []);
|
|
418
|
-
} catch (x) {
|
|
419
|
-
control = x;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
Reflect.construct(fn, [], Fake);
|
|
423
|
-
} else {
|
|
424
|
-
try {
|
|
425
|
-
Fake.call();
|
|
426
|
-
} catch (x) {
|
|
427
|
-
control = x;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
fn.call(Fake.prototype);
|
|
431
|
-
}
|
|
432
|
-
} else {
|
|
433
|
-
try {
|
|
434
|
-
throw Error();
|
|
435
|
-
} catch (x) {
|
|
436
|
-
control = x;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
fn();
|
|
440
|
-
}
|
|
441
|
-
} catch (sample) {
|
|
442
|
-
// This is inlined manually because closure doesn't do it for us.
|
|
443
|
-
if (sample && control && typeof sample.stack === 'string') {
|
|
444
|
-
// This extracts the first frame from the sample that isn't also in the control.
|
|
445
|
-
// Skipping one frame that we assume is the frame that calls the two.
|
|
446
|
-
var sampleLines = sample.stack.split('\n');
|
|
447
|
-
var controlLines = control.stack.split('\n');
|
|
448
|
-
var s = sampleLines.length - 1;
|
|
449
|
-
var c = controlLines.length - 1;
|
|
450
|
-
|
|
451
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
452
|
-
// We expect at least one stack frame to be shared.
|
|
453
|
-
// Typically this will be the root most one. However, stack frames may be
|
|
454
|
-
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
455
|
-
// earlier than the other. We assume that the sample is longer or the same
|
|
456
|
-
// and there for cut off earlier. So we should find the root most frame in
|
|
457
|
-
// the sample somewhere in the control.
|
|
458
|
-
c--;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
462
|
-
// Next we find the first one that isn't the same which should be the
|
|
463
|
-
// frame that called our sample function and the control.
|
|
464
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
465
|
-
// In V8, the first line is describing the message but other VMs don't.
|
|
466
|
-
// If we're about to return the first line, and the control is also on the same
|
|
467
|
-
// line, that's a pretty good indicator that our sample threw at same line as
|
|
468
|
-
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
469
|
-
// This can happen if you passed a class to function component, or non-function.
|
|
470
|
-
if (s !== 1 || c !== 1) {
|
|
471
|
-
do {
|
|
472
|
-
s--;
|
|
473
|
-
c--; // We may still have similar intermediate frames from the construct call.
|
|
474
|
-
// The next one that isn't the same should be our match though.
|
|
475
|
-
|
|
476
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
477
|
-
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
478
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
479
|
-
// but we have a user-provided "displayName"
|
|
480
|
-
// splice it in to make the stack more readable.
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
484
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
{
|
|
488
|
-
if (typeof fn === 'function') {
|
|
489
|
-
componentFrameCache.set(fn, _frame);
|
|
490
|
-
}
|
|
491
|
-
} // Return the line we found.
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
return _frame;
|
|
495
|
-
}
|
|
496
|
-
} while (s >= 1 && c >= 0);
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
break;
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
} finally {
|
|
504
|
-
reentry = false;
|
|
505
|
-
|
|
506
|
-
{
|
|
507
|
-
ReactCurrentDispatcher.current = previousDispatcher;
|
|
508
|
-
reenableLogs();
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
512
|
-
} // Fallback to just using the name if we couldn't make it throw.
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
var name = fn ? fn.displayName || fn.name : '';
|
|
516
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
517
|
-
|
|
518
|
-
{
|
|
519
|
-
if (typeof fn === 'function') {
|
|
520
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
return syntheticFrame;
|
|
525
|
-
}
|
|
526
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
527
|
-
{
|
|
528
|
-
return describeNativeComponentFrame(fn, false);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
function shouldConstruct(Component) {
|
|
533
|
-
var prototype = Component.prototype;
|
|
534
|
-
return !!(prototype && prototype.isReactComponent);
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
538
|
-
|
|
539
|
-
if (type == null) {
|
|
540
|
-
return '';
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
if (typeof type === 'function') {
|
|
544
|
-
{
|
|
545
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
if (typeof type === 'string') {
|
|
550
|
-
return describeBuiltInComponentFrame(type);
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
switch (type) {
|
|
554
|
-
case REACT_SUSPENSE_TYPE:
|
|
555
|
-
return describeBuiltInComponentFrame('Suspense');
|
|
556
|
-
|
|
557
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
558
|
-
return describeBuiltInComponentFrame('SuspenseList');
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
if (typeof type === 'object') {
|
|
562
|
-
switch (type.$$typeof) {
|
|
563
|
-
case REACT_FORWARD_REF_TYPE:
|
|
564
|
-
return describeFunctionComponentFrame(type.render);
|
|
565
|
-
|
|
566
|
-
case REACT_MEMO_TYPE:
|
|
567
|
-
// Memo may contain any component type so we recursively resolve it.
|
|
568
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
569
|
-
|
|
570
|
-
case REACT_LAZY_TYPE:
|
|
571
|
-
{
|
|
572
|
-
var lazyComponent = type;
|
|
573
|
-
var payload = lazyComponent._payload;
|
|
574
|
-
var init = lazyComponent._init;
|
|
575
|
-
|
|
576
|
-
try {
|
|
577
|
-
// Lazy may contain any component type so we recursively resolve it.
|
|
578
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
579
|
-
} catch (x) {}
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
return '';
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
588
|
-
|
|
589
|
-
var loggedTypeFailures = {};
|
|
590
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
591
|
-
|
|
592
|
-
function setCurrentlyValidatingElement(element) {
|
|
593
|
-
{
|
|
594
|
-
if (element) {
|
|
595
|
-
var owner = element._owner;
|
|
596
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
597
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
598
|
-
} else {
|
|
599
|
-
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
605
|
-
{
|
|
606
|
-
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
607
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
608
|
-
|
|
609
|
-
for (var typeSpecName in typeSpecs) {
|
|
610
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
611
|
-
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
|
|
612
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
613
|
-
// After these have been cleaned up, we'll let them throw.
|
|
614
|
-
|
|
615
|
-
try {
|
|
616
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
617
|
-
// behavior as without this statement except with a better message.
|
|
618
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
619
|
-
// eslint-disable-next-line react-internal/prod-error-codes
|
|
620
|
-
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
|
|
621
|
-
err.name = 'Invariant Violation';
|
|
622
|
-
throw err;
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
626
|
-
} catch (ex) {
|
|
627
|
-
error$1 = ex;
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
631
|
-
setCurrentlyValidatingElement(element);
|
|
632
|
-
|
|
633
|
-
error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
|
|
634
|
-
|
|
635
|
-
setCurrentlyValidatingElement(null);
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
639
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
640
|
-
// same error.
|
|
641
|
-
loggedTypeFailures[error$1.message] = true;
|
|
642
|
-
setCurrentlyValidatingElement(element);
|
|
643
|
-
|
|
644
|
-
error('Failed %s type: %s', location, error$1.message);
|
|
645
|
-
|
|
646
|
-
setCurrentlyValidatingElement(null);
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
654
|
-
|
|
655
|
-
function isArray(a) {
|
|
656
|
-
return isArrayImpl(a);
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
/*
|
|
660
|
-
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
661
|
-
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
662
|
-
*
|
|
663
|
-
* The functions in this module will throw an easier-to-understand,
|
|
664
|
-
* easier-to-debug exception with a clear errors message message explaining the
|
|
665
|
-
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
666
|
-
* of the `value` object).
|
|
667
|
-
*/
|
|
668
|
-
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
669
|
-
function typeName(value) {
|
|
670
|
-
{
|
|
671
|
-
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
672
|
-
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
673
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
674
|
-
return type;
|
|
675
|
-
}
|
|
676
|
-
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
function willCoercionThrow(value) {
|
|
680
|
-
{
|
|
681
|
-
try {
|
|
682
|
-
testStringCoercion(value);
|
|
683
|
-
return false;
|
|
684
|
-
} catch (e) {
|
|
685
|
-
return true;
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
function testStringCoercion(value) {
|
|
691
|
-
// If you ended up here by following an exception call stack, here's what's
|
|
692
|
-
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
693
|
-
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
694
|
-
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
695
|
-
//
|
|
696
|
-
// The most common types that will cause this exception are `Symbol` instances
|
|
697
|
-
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
698
|
-
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
699
|
-
// exception. (Library authors do this to prevent users from using built-in
|
|
700
|
-
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
701
|
-
// methods are needed to perform accurate arithmetic or comparison.)
|
|
702
|
-
//
|
|
703
|
-
// To fix the problem, coerce this object or symbol value to a string before
|
|
704
|
-
// passing it to React. The most reliable way is usually `String(value)`.
|
|
705
|
-
//
|
|
706
|
-
// To find which value is throwing, check the browser or debugger console.
|
|
707
|
-
// Before this exception was thrown, there should be `console.error` output
|
|
708
|
-
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
709
|
-
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
710
|
-
// In most cases, this console output also shows the component and its
|
|
711
|
-
// ancestor components where the exception happened.
|
|
712
|
-
//
|
|
713
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
714
|
-
return '' + value;
|
|
715
|
-
}
|
|
716
|
-
function checkKeyStringCoercion(value) {
|
|
717
|
-
{
|
|
718
|
-
if (willCoercionThrow(value)) {
|
|
719
|
-
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
720
|
-
|
|
721
|
-
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
727
|
-
var RESERVED_PROPS = {
|
|
728
|
-
key: true,
|
|
729
|
-
ref: true,
|
|
730
|
-
__self: true,
|
|
731
|
-
__source: true
|
|
732
|
-
};
|
|
733
|
-
var specialPropKeyWarningShown;
|
|
734
|
-
var specialPropRefWarningShown;
|
|
735
|
-
var didWarnAboutStringRefs;
|
|
736
|
-
|
|
737
|
-
{
|
|
738
|
-
didWarnAboutStringRefs = {};
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
function hasValidRef(config) {
|
|
742
|
-
{
|
|
743
|
-
if (hasOwnProperty.call(config, 'ref')) {
|
|
744
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
745
|
-
|
|
746
|
-
if (getter && getter.isReactWarning) {
|
|
747
|
-
return false;
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
return config.ref !== undefined;
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
function hasValidKey(config) {
|
|
756
|
-
{
|
|
757
|
-
if (hasOwnProperty.call(config, 'key')) {
|
|
758
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
759
|
-
|
|
760
|
-
if (getter && getter.isReactWarning) {
|
|
761
|
-
return false;
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
return config.key !== undefined;
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
770
|
-
{
|
|
771
|
-
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
|
772
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
773
|
-
|
|
774
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
775
|
-
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
|
776
|
-
|
|
777
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
784
|
-
{
|
|
785
|
-
var warnAboutAccessingKey = function () {
|
|
786
|
-
if (!specialPropKeyWarningShown) {
|
|
787
|
-
specialPropKeyWarningShown = true;
|
|
788
|
-
|
|
789
|
-
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
790
|
-
}
|
|
791
|
-
};
|
|
792
|
-
|
|
793
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
794
|
-
Object.defineProperty(props, 'key', {
|
|
795
|
-
get: warnAboutAccessingKey,
|
|
796
|
-
configurable: true
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
802
|
-
{
|
|
803
|
-
var warnAboutAccessingRef = function () {
|
|
804
|
-
if (!specialPropRefWarningShown) {
|
|
805
|
-
specialPropRefWarningShown = true;
|
|
806
|
-
|
|
807
|
-
error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
808
|
-
}
|
|
809
|
-
};
|
|
810
|
-
|
|
811
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
812
|
-
Object.defineProperty(props, 'ref', {
|
|
813
|
-
get: warnAboutAccessingRef,
|
|
814
|
-
configurable: true
|
|
815
|
-
});
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
/**
|
|
819
|
-
* Factory method to create a new React element. This no longer adheres to
|
|
820
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
821
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
822
|
-
* if something is a React Element.
|
|
823
|
-
*
|
|
824
|
-
* @param {*} type
|
|
825
|
-
* @param {*} props
|
|
826
|
-
* @param {*} key
|
|
827
|
-
* @param {string|object} ref
|
|
828
|
-
* @param {*} owner
|
|
829
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
830
|
-
* different from the `owner` when React.createElement is called, so that we
|
|
831
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
832
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
|
833
|
-
* change in behavior.
|
|
834
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
835
|
-
* indicating filename, line number, and/or other information.
|
|
836
|
-
* @internal
|
|
837
|
-
*/
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
841
|
-
var element = {
|
|
842
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
843
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
844
|
-
// Built-in properties that belong on the element
|
|
845
|
-
type: type,
|
|
846
|
-
key: key,
|
|
847
|
-
ref: ref,
|
|
848
|
-
props: props,
|
|
849
|
-
// Record the component responsible for creating this element.
|
|
850
|
-
_owner: owner
|
|
851
|
-
};
|
|
852
|
-
|
|
853
|
-
{
|
|
854
|
-
// The validation flag is currently mutative. We put it on
|
|
855
|
-
// an external backing store so that we can freeze the whole object.
|
|
856
|
-
// This can be replaced with a WeakMap once they are implemented in
|
|
857
|
-
// commonly used development environments.
|
|
858
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
859
|
-
// the validation flag non-enumerable (where possible, which should
|
|
860
|
-
// include every environment we run tests in), so the test framework
|
|
861
|
-
// ignores it.
|
|
862
|
-
|
|
863
|
-
Object.defineProperty(element._store, 'validated', {
|
|
864
|
-
configurable: false,
|
|
865
|
-
enumerable: false,
|
|
866
|
-
writable: true,
|
|
867
|
-
value: false
|
|
868
|
-
}); // self and source are DEV only properties.
|
|
869
|
-
|
|
870
|
-
Object.defineProperty(element, '_self', {
|
|
871
|
-
configurable: false,
|
|
872
|
-
enumerable: false,
|
|
873
|
-
writable: false,
|
|
874
|
-
value: self
|
|
875
|
-
}); // Two elements created in two different places should be considered
|
|
876
|
-
// equal for testing purposes and therefore we hide it from enumeration.
|
|
877
|
-
|
|
878
|
-
Object.defineProperty(element, '_source', {
|
|
879
|
-
configurable: false,
|
|
880
|
-
enumerable: false,
|
|
881
|
-
writable: false,
|
|
882
|
-
value: source
|
|
883
|
-
});
|
|
884
|
-
|
|
885
|
-
if (Object.freeze) {
|
|
886
|
-
Object.freeze(element.props);
|
|
887
|
-
Object.freeze(element);
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
return element;
|
|
892
|
-
};
|
|
893
|
-
/**
|
|
894
|
-
* https://github.com/reactjs/rfcs/pull/107
|
|
895
|
-
* @param {*} type
|
|
896
|
-
* @param {object} props
|
|
897
|
-
* @param {string} key
|
|
898
|
-
*/
|
|
899
|
-
|
|
900
|
-
function jsxDEV(type, config, maybeKey, source, self) {
|
|
901
|
-
{
|
|
902
|
-
var propName; // Reserved names are extracted
|
|
903
|
-
|
|
904
|
-
var props = {};
|
|
905
|
-
var key = null;
|
|
906
|
-
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
|
907
|
-
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
908
|
-
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
909
|
-
// but as an intermediary step, we will use jsxDEV for everything except
|
|
910
|
-
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
911
|
-
// key is explicitly declared to be undefined or not.
|
|
912
|
-
|
|
913
|
-
if (maybeKey !== undefined) {
|
|
914
|
-
{
|
|
915
|
-
checkKeyStringCoercion(maybeKey);
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
key = '' + maybeKey;
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
if (hasValidKey(config)) {
|
|
922
|
-
{
|
|
923
|
-
checkKeyStringCoercion(config.key);
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
key = '' + config.key;
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
if (hasValidRef(config)) {
|
|
930
|
-
ref = config.ref;
|
|
931
|
-
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
932
|
-
} // Remaining properties are added to a new props object
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
for (propName in config) {
|
|
936
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
937
|
-
props[propName] = config[propName];
|
|
938
|
-
}
|
|
939
|
-
} // Resolve default props
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
if (type && type.defaultProps) {
|
|
943
|
-
var defaultProps = type.defaultProps;
|
|
944
|
-
|
|
945
|
-
for (propName in defaultProps) {
|
|
946
|
-
if (props[propName] === undefined) {
|
|
947
|
-
props[propName] = defaultProps[propName];
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
if (key || ref) {
|
|
953
|
-
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
954
|
-
|
|
955
|
-
if (key) {
|
|
956
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
if (ref) {
|
|
960
|
-
defineRefPropWarningGetter(props, displayName);
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
969
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
970
|
-
|
|
971
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
972
|
-
{
|
|
973
|
-
if (element) {
|
|
974
|
-
var owner = element._owner;
|
|
975
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
976
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
977
|
-
} else {
|
|
978
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
var propTypesMisspellWarningShown;
|
|
984
|
-
|
|
985
|
-
{
|
|
986
|
-
propTypesMisspellWarningShown = false;
|
|
987
|
-
}
|
|
988
|
-
/**
|
|
989
|
-
* Verifies the object is a ReactElement.
|
|
990
|
-
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
991
|
-
* @param {?object} object
|
|
992
|
-
* @return {boolean} True if `object` is a ReactElement.
|
|
993
|
-
* @final
|
|
994
|
-
*/
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
function isValidElement(object) {
|
|
998
|
-
{
|
|
999
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
function getDeclarationErrorAddendum() {
|
|
1004
|
-
{
|
|
1005
|
-
if (ReactCurrentOwner$1.current) {
|
|
1006
|
-
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
1007
|
-
|
|
1008
|
-
if (name) {
|
|
1009
|
-
return '\n\nCheck the render method of `' + name + '`.';
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
return '';
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
function getSourceInfoErrorAddendum(source) {
|
|
1018
|
-
{
|
|
1019
|
-
if (source !== undefined) {
|
|
1020
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
1021
|
-
var lineNumber = source.lineNumber;
|
|
1022
|
-
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
return '';
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
/**
|
|
1029
|
-
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
1030
|
-
* object keys are not valid. This allows us to keep track of children between
|
|
1031
|
-
* updates.
|
|
1032
|
-
*/
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
var ownerHasKeyUseWarning = {};
|
|
1036
|
-
|
|
1037
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
1038
|
-
{
|
|
1039
|
-
var info = getDeclarationErrorAddendum();
|
|
1040
|
-
|
|
1041
|
-
if (!info) {
|
|
1042
|
-
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
1043
|
-
|
|
1044
|
-
if (parentName) {
|
|
1045
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
return info;
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
/**
|
|
1053
|
-
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1054
|
-
* This element is in an array. The array could grow and shrink or be
|
|
1055
|
-
* reordered. All children that haven't already been validated are required to
|
|
1056
|
-
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
1057
|
-
* will only be shown once.
|
|
1058
|
-
*
|
|
1059
|
-
* @internal
|
|
1060
|
-
* @param {ReactElement} element Element that requires a key.
|
|
1061
|
-
* @param {*} parentType element's parent's type.
|
|
1062
|
-
*/
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
function validateExplicitKey(element, parentType) {
|
|
1066
|
-
{
|
|
1067
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
1068
|
-
return;
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
element._store.validated = true;
|
|
1072
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1073
|
-
|
|
1074
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1075
|
-
return;
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
1079
|
-
// property, it may be the creator of the child that's responsible for
|
|
1080
|
-
// assigning it a key.
|
|
1081
|
-
|
|
1082
|
-
var childOwner = '';
|
|
1083
|
-
|
|
1084
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
1085
|
-
// Give the component that originally created this child.
|
|
1086
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
setCurrentlyValidatingElement$1(element);
|
|
1090
|
-
|
|
1091
|
-
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1092
|
-
|
|
1093
|
-
setCurrentlyValidatingElement$1(null);
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
/**
|
|
1097
|
-
* Ensure that every element either is passed in a static location, in an
|
|
1098
|
-
* array with an explicit keys property defined, or in an object literal
|
|
1099
|
-
* with valid key property.
|
|
1100
|
-
*
|
|
1101
|
-
* @internal
|
|
1102
|
-
* @param {ReactNode} node Statically passed child of any type.
|
|
1103
|
-
* @param {*} parentType node's parent's type.
|
|
1104
|
-
*/
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
function validateChildKeys(node, parentType) {
|
|
1108
|
-
{
|
|
1109
|
-
if (typeof node !== 'object') {
|
|
1110
|
-
return;
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
|
-
if (isArray(node)) {
|
|
1114
|
-
for (var i = 0; i < node.length; i++) {
|
|
1115
|
-
var child = node[i];
|
|
1116
|
-
|
|
1117
|
-
if (isValidElement(child)) {
|
|
1118
|
-
validateExplicitKey(child, parentType);
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
} else if (isValidElement(node)) {
|
|
1122
|
-
// This element was passed in a valid location.
|
|
1123
|
-
if (node._store) {
|
|
1124
|
-
node._store.validated = true;
|
|
1125
|
-
}
|
|
1126
|
-
} else if (node) {
|
|
1127
|
-
var iteratorFn = getIteratorFn(node);
|
|
1128
|
-
|
|
1129
|
-
if (typeof iteratorFn === 'function') {
|
|
1130
|
-
// Entry iterators used to provide implicit keys,
|
|
1131
|
-
// but now we print a separate warning for them later.
|
|
1132
|
-
if (iteratorFn !== node.entries) {
|
|
1133
|
-
var iterator = iteratorFn.call(node);
|
|
1134
|
-
var step;
|
|
1135
|
-
|
|
1136
|
-
while (!(step = iterator.next()).done) {
|
|
1137
|
-
if (isValidElement(step.value)) {
|
|
1138
|
-
validateExplicitKey(step.value, parentType);
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
/**
|
|
1147
|
-
* Given an element, validate that its props follow the propTypes definition,
|
|
1148
|
-
* provided by the type.
|
|
1149
|
-
*
|
|
1150
|
-
* @param {ReactElement} element
|
|
1151
|
-
*/
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
function validatePropTypes(element) {
|
|
1155
|
-
{
|
|
1156
|
-
var type = element.type;
|
|
1157
|
-
|
|
1158
|
-
if (type === null || type === undefined || typeof type === 'string') {
|
|
1159
|
-
return;
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
var propTypes;
|
|
1163
|
-
|
|
1164
|
-
if (typeof type === 'function') {
|
|
1165
|
-
propTypes = type.propTypes;
|
|
1166
|
-
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1167
|
-
// Inner props are checked in the reconciler.
|
|
1168
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1169
|
-
propTypes = type.propTypes;
|
|
1170
|
-
} else {
|
|
1171
|
-
return;
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
if (propTypes) {
|
|
1175
|
-
// Intentionally inside to avoid triggering lazy initializers:
|
|
1176
|
-
var name = getComponentNameFromType(type);
|
|
1177
|
-
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
1178
|
-
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1179
|
-
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
1180
|
-
|
|
1181
|
-
var _name = getComponentNameFromType(type);
|
|
1182
|
-
|
|
1183
|
-
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1186
|
-
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
1187
|
-
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
/**
|
|
1192
|
-
* Given a fragment, validate that it can only be provided with fragment props
|
|
1193
|
-
* @param {ReactElement} fragment
|
|
1194
|
-
*/
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
function validateFragmentProps(fragment) {
|
|
1198
|
-
{
|
|
1199
|
-
var keys = Object.keys(fragment.props);
|
|
1200
|
-
|
|
1201
|
-
for (var i = 0; i < keys.length; i++) {
|
|
1202
|
-
var key = keys[i];
|
|
1203
|
-
|
|
1204
|
-
if (key !== 'children' && key !== 'key') {
|
|
1205
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1206
|
-
|
|
1207
|
-
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
1208
|
-
|
|
1209
|
-
setCurrentlyValidatingElement$1(null);
|
|
1210
|
-
break;
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
if (fragment.ref !== null) {
|
|
1215
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1216
|
-
|
|
1217
|
-
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
1218
|
-
|
|
1219
|
-
setCurrentlyValidatingElement$1(null);
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
var didWarnAboutKeySpread = {};
|
|
1225
|
-
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1226
|
-
{
|
|
1227
|
-
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
1228
|
-
// succeed and there will likely be errors in render.
|
|
1229
|
-
|
|
1230
|
-
if (!validType) {
|
|
1231
|
-
var info = '';
|
|
1232
|
-
|
|
1233
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1234
|
-
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
1238
|
-
|
|
1239
|
-
if (sourceInfo) {
|
|
1240
|
-
info += sourceInfo;
|
|
1241
|
-
} else {
|
|
1242
|
-
info += getDeclarationErrorAddendum();
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
var typeString;
|
|
1246
|
-
|
|
1247
|
-
if (type === null) {
|
|
1248
|
-
typeString = 'null';
|
|
1249
|
-
} else if (isArray(type)) {
|
|
1250
|
-
typeString = 'array';
|
|
1251
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1252
|
-
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
1253
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1254
|
-
} else {
|
|
1255
|
-
typeString = typeof type;
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
|
|
1262
|
-
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
1263
|
-
|
|
1264
|
-
if (element == null) {
|
|
1265
|
-
return element;
|
|
1266
|
-
} // Skip key warning if the type isn't valid since our key validation logic
|
|
1267
|
-
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1268
|
-
// We don't want exception behavior to differ between dev and prod.
|
|
1269
|
-
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1270
|
-
// fixed, the key warnings will appear.)
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
if (validType) {
|
|
1274
|
-
var children = props.children;
|
|
1275
|
-
|
|
1276
|
-
if (children !== undefined) {
|
|
1277
|
-
if (isStaticChildren) {
|
|
1278
|
-
if (isArray(children)) {
|
|
1279
|
-
for (var i = 0; i < children.length; i++) {
|
|
1280
|
-
validateChildKeys(children[i], type);
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
if (Object.freeze) {
|
|
1284
|
-
Object.freeze(children);
|
|
1285
|
-
}
|
|
1286
|
-
} else {
|
|
1287
|
-
error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
|
1288
|
-
}
|
|
1289
|
-
} else {
|
|
1290
|
-
validateChildKeys(children, type);
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
{
|
|
1296
|
-
if (hasOwnProperty.call(props, 'key')) {
|
|
1297
|
-
var componentName = getComponentNameFromType(type);
|
|
1298
|
-
var keys = Object.keys(props).filter(function (k) {
|
|
1299
|
-
return k !== 'key';
|
|
1300
|
-
});
|
|
1301
|
-
var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
|
|
1302
|
-
|
|
1303
|
-
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
1304
|
-
var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
|
|
1305
|
-
|
|
1306
|
-
error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
|
1307
|
-
|
|
1308
|
-
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
1314
|
-
validateFragmentProps(element);
|
|
1315
|
-
} else {
|
|
1316
|
-
validatePropTypes(element);
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
|
-
return element;
|
|
1320
|
-
}
|
|
1321
|
-
} // These two functions exist to still get child warnings in dev
|
|
1322
|
-
// even with the prod transform. This means that jsxDEV is purely
|
|
1323
|
-
// opt-in behavior for better messages but that we won't stop
|
|
1324
|
-
// giving you warnings if you use production apis.
|
|
1325
|
-
|
|
1326
|
-
function jsxWithValidationStatic(type, props, key) {
|
|
1327
|
-
{
|
|
1328
|
-
return jsxWithValidation(type, props, key, true);
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
function jsxWithValidationDynamic(type, props, key) {
|
|
1332
|
-
{
|
|
1333
|
-
return jsxWithValidation(type, props, key, false);
|
|
1334
|
-
}
|
|
1335
|
-
}
|
|
1336
|
-
|
|
1337
|
-
var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
|
|
1338
|
-
// for now we can ship identical prod functions
|
|
1339
|
-
|
|
1340
|
-
var jsxs = jsxWithValidationStatic ;
|
|
1341
|
-
|
|
1342
|
-
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
1343
|
-
reactJsxRuntime_development.jsx = jsx;
|
|
1344
|
-
reactJsxRuntime_development.jsxs = jsxs;
|
|
1345
|
-
})();
|
|
1346
|
-
}
|
|
1347
|
-
return reactJsxRuntime_development;
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
var reactJsxRuntime_production_min = {};
|
|
1351
|
-
|
|
1352
|
-
/**
|
|
1353
|
-
* @license React
|
|
1354
|
-
* react-jsx-runtime.production.min.js
|
|
1355
|
-
*
|
|
1356
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1357
|
-
*
|
|
1358
|
-
* This source code is licensed under the MIT license found in the
|
|
1359
|
-
* LICENSE file in the root directory of this source tree.
|
|
1360
|
-
*/
|
|
1361
|
-
|
|
1362
|
-
var hasRequiredReactJsxRuntime_production_min;
|
|
1363
|
-
|
|
1364
|
-
function requireReactJsxRuntime_production_min () {
|
|
1365
|
-
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
1366
|
-
hasRequiredReactJsxRuntime_production_min = 1;
|
|
1367
|
-
var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
1368
|
-
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
|
|
1369
|
-
return reactJsxRuntime_production_min;
|
|
1370
|
-
}
|
|
1371
|
-
|
|
1372
|
-
if (process.env.NODE_ENV === 'production') {
|
|
1373
|
-
jsxRuntime.exports = requireReactJsxRuntime_production_min();
|
|
1374
|
-
} else {
|
|
1375
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
|
-
var jsxRuntimeExports = jsxRuntime.exports;
|
|
1379
|
-
|
|
1380
8
|
const buttonVariants = {
|
|
1381
9
|
primary: 'mlz-btn-primary',
|
|
1382
10
|
secondary: 'mlz-btn-secondary',
|
|
@@ -1393,10 +21,10 @@ const Button = ({ children, variant = 'primary', size = 'md', disabled = false,
|
|
|
1393
21
|
const variantClasses = buttonVariants[variant];
|
|
1394
22
|
const sizeClasses = buttonSizes[size];
|
|
1395
23
|
const classes = `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`.trim();
|
|
1396
|
-
return (
|
|
24
|
+
return (jsx("button", { type: type, className: classes, disabled: disabled, onClick: onClick, ...props, children: children }));
|
|
1397
25
|
};
|
|
1398
26
|
|
|
1399
|
-
const CheckIcon = (props) => (
|
|
27
|
+
const CheckIcon = (props) => (jsx("svg", { width: "12", height: "10", viewBox: "0 0 12 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M4 9.4L0 5.4L1.4 4L4 6.6L10.6 0L12 1.4L4 9.4Z", fill: "#2ABB5B" }) }));
|
|
1400
28
|
|
|
1401
29
|
const inputClasses = (hasError, fullWidth) => {
|
|
1402
30
|
const colorClass = hasError ? "semantic-error-600" : "primary-600";
|
|
@@ -1421,16 +49,52 @@ const inputClasses = (hasError, fullWidth) => {
|
|
|
1421
49
|
};
|
|
1422
50
|
const Input = ({ labelProps, helperTextProps, containerProps, errorText, helperText, hasError = false, disabled, label, placeholder, fullWidth, checkedIcon, ...props }) => {
|
|
1423
51
|
const classes = inputClasses(hasError, fullWidth);
|
|
1424
|
-
return (
|
|
52
|
+
return (jsxs("div", { className: classes.containerStyle, children: [jsx("label", { ...labelProps, className: classes.labelStyle, children: label }), jsx("input", { ...props, disabled: disabled, placeholder: placeholder, className: classes.inputStyle }), checkedIcon && (jsx("div", { className: "absolute right-4 top-1/2 -translate-y-1/2", children: jsx(CheckIcon, {}) })), jsx("p", { ...helperTextProps, className: classes.helperTextStyle, children: errorText ? errorText : helperText })] }));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const textAreaClasses = (hasError, fullWidth) => {
|
|
56
|
+
const labelColorClass = hasError ? "mlz-error-color" : "text-primary-600";
|
|
57
|
+
const borderClass = hasError ? "mlz-error-border" : "border-primary-400";
|
|
58
|
+
const textColorClass = hasError ? "mlz-error-color" : "text-primary-600";
|
|
59
|
+
const focusBorderClass = hasError ? "focus:border-semantic-error-600" : "focus:border-primary-600";
|
|
60
|
+
const focusRingClass = hasError ? "focus:ring-semantic-error-600" : "focus:ring-primary-600";
|
|
61
|
+
const activeBorderClass = hasError ? "active:border-semantic-error-600" : "active:border-primary-600";
|
|
62
|
+
const placeholderClass = hasError ? "placeholder:text-semantic-error-600" : "placeholder:text-primary-400";
|
|
63
|
+
return {
|
|
64
|
+
containerStyle: "flex flex-col relative gap-1" + (fullWidth ? " w-full" : ""),
|
|
65
|
+
labelStyle: `mlz-label-textarea block ${labelColorClass}`,
|
|
66
|
+
textAreaStyle: [
|
|
67
|
+
"disabled:bg-primary-100 disabled:cursor-not-allowed disabled:text-primary-300",
|
|
68
|
+
"text-primary-600",
|
|
69
|
+
"block w-full border border-solid",
|
|
70
|
+
"rounded-[4px]",
|
|
71
|
+
"px-4 py-2",
|
|
72
|
+
"placeholder:text-base",
|
|
73
|
+
"focus:outline-none focus:ring-2",
|
|
74
|
+
"active:ring-2",
|
|
75
|
+
"resize-y",
|
|
76
|
+
"min-w-[498px] min-h-[123px]",
|
|
77
|
+
borderClass,
|
|
78
|
+
placeholderClass,
|
|
79
|
+
focusBorderClass,
|
|
80
|
+
focusRingClass,
|
|
81
|
+
activeBorderClass,
|
|
82
|
+
].join(" "),
|
|
83
|
+
helperTextStyle: `mt-1 text-base ${textColorClass}`,
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
const TextArea = ({ labelProps, helperTextProps, containerProps, errorText, helperText, hasError = false, disabled, label, placeholder, fullWidth, ...props }) => {
|
|
87
|
+
const classes = textAreaClasses(hasError, fullWidth);
|
|
88
|
+
return (jsxs("div", { ...containerProps, className: classes.containerStyle, children: [jsx("label", { ...labelProps, className: classes.labelStyle, children: label }), jsx("textarea", { ...props, disabled: disabled, placeholder: placeholder, className: classes.textAreaStyle }), jsx("p", { ...helperTextProps, className: classes.helperTextStyle, children: errorText ? errorText : helperText })] }));
|
|
1425
89
|
};
|
|
1426
90
|
|
|
1427
|
-
const CheckCircleIcon = (props) => (
|
|
91
|
+
const CheckCircleIcon = (props) => (jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M8.6 14.6L15.65 7.55L14.25 6.15L8.6 11.8L5.75 8.95L4.35 10.35L8.6 14.6ZM10 20C8.61667 20 7.31667 19.7375 6.1 19.2125C4.88333 18.6875 3.825 17.975 2.925 17.075C2.025 16.175 1.3125 15.1167 0.7875 13.9C0.2625 12.6833 0 11.3833 0 10C0 8.61667 0.2625 7.31667 0.7875 6.1C1.3125 4.88333 2.025 3.825 2.925 2.925C3.825 2.025 4.88333 1.3125 6.1 0.7875C7.31667 0.2625 8.61667 0 10 0C11.3833 0 12.6833 0.2625 13.9 0.7875C15.1167 1.3125 16.175 2.025 17.075 2.925C17.975 3.825 18.6875 4.88333 19.2125 6.1C19.7375 7.31667 20 8.61667 20 10C20 11.3833 19.7375 12.6833 19.2125 13.9C18.6875 15.1167 17.975 16.175 17.075 17.075C16.175 17.975 15.1167 18.6875 13.9 19.2125C12.6833 19.7375 11.3833 20 10 20ZM10 18C12.2333 18 14.125 17.225 15.675 15.675C17.225 14.125 18 12.2333 18 10C18 7.76667 17.225 5.875 15.675 4.325C14.125 2.775 12.2333 2 10 2C7.76667 2 5.875 2.775 4.325 4.325C2.775 5.875 2 7.76667 2 10C2 12.2333 2.775 14.125 4.325 15.675C5.875 17.225 7.76667 18 10 18Z", fill: "currentColor" }) }));
|
|
1428
92
|
|
|
1429
|
-
const ErrorCircleIcon = (props) => (
|
|
93
|
+
const ErrorCircleIcon = (props) => (jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [jsx("circle", { cx: "10", cy: "10", r: "10", fill: "currentColor" }), jsx("path", { d: "M7 7L13 13M13 7L7 13", stroke: "white", strokeWidth: "2", strokeLinecap: "round" })] }));
|
|
1430
94
|
|
|
1431
|
-
const InfoCircleIcon = (props) => (
|
|
95
|
+
const InfoCircleIcon = (props) => (jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M10 15C10.2833 15 10.5208 14.9042 10.7125 14.7125C10.9042 14.5208 11 14.2833 11 14C11 13.7167 10.9042 13.4792 10.7125 13.2875C10.5208 13.0958 10.2833 13 10 13C9.71667 13 9.47917 13.0958 9.2875 13.2875C9.09583 13.4792 9 13.7167 9 14C9 14.2833 9.09583 14.5208 9.2875 14.7125C9.47917 14.9042 9.71667 15 10 15ZM9 11H11V5H9V11ZM10 20C8.61667 20 7.31667 19.7375 6.1 19.2125C4.88333 18.6875 3.825 17.975 2.925 17.075C2.025 16.175 1.3125 15.1167 0.7875 13.9C0.2625 12.6833 0 11.3833 0 10C0 8.61667 0.2625 7.31667 0.7875 6.1C1.3125 4.88333 2.025 3.825 2.925 2.925C3.825 2.025 4.88333 1.3125 6.1 0.7875C7.31667 0.2625 8.61667 0 10 0C11.3833 0 12.6833 0.2625 13.9 0.7875C15.1167 1.3125 16.175 2.025 17.075 2.925C17.975 3.825 18.6875 4.88333 19.2125 6.1C19.7375 7.31667 20 8.61667 20 10C20 11.3833 19.7375 12.6833 19.2125 13.9C18.6875 15.1167 17.975 16.175 17.075 17.075C16.175 17.975 15.1167 18.6875 13.9 19.2125C12.6833 19.7375 11.3833 20 10 20ZM10 18C12.2333 18 14.125 17.225 15.675 15.675C17.225 14.125 18 12.2333 18 10C18 7.76667 17.225 5.875 15.675 4.325C14.125 2.775 12.2333 2 10 2C7.76667 2 5.875 2.775 4.325 4.325C2.775 5.875 2 7.76667 2 10C2 12.2333 2.775 14.125 4.325 15.675C5.875 17.225 7.76667 18 10 18Z", fill: "currentColor" }) }));
|
|
1432
96
|
|
|
1433
|
-
const WarningTriangleIcon = (props) => (
|
|
97
|
+
const WarningTriangleIcon = (props) => (jsx("svg", { width: "22", height: "19", viewBox: "0 0 22 19", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M0 19L11 0L22 19H0ZM3.45 17H18.55L11 4L3.45 17ZM11 16C11.2833 16 11.5208 15.9042 11.7125 15.7125C11.9042 15.5208 12 15.2833 12 15C12 14.7167 11.9042 14.4792 11.7125 14.2875C11.5208 14.0958 11.2833 14 11 14C10.7167 14 10.4792 14.0958 10.2875 14.2875C10.0958 14.4792 10 14.7167 10 15C10 15.2833 10.0958 15.5208 10.2875 15.7125C10.4792 15.9042 10.7167 16 11 16ZM10 13H12V8H10V13Z", fill: "currentColor" }) }));
|
|
1434
98
|
|
|
1435
99
|
const toastClasses$1 = (variant) => {
|
|
1436
100
|
const variants = {
|
|
@@ -1472,7 +136,7 @@ const toastClasses$1 = (variant) => {
|
|
|
1472
136
|
const Toast = ({ title, description, variant = "info", onClose, }) => {
|
|
1473
137
|
const classes = toastClasses$1(variant);
|
|
1474
138
|
const IconComponent = classes.iconComponent;
|
|
1475
|
-
return (
|
|
139
|
+
return (jsxs("div", { className: [
|
|
1476
140
|
"flex items-start",
|
|
1477
141
|
"w-[400px] min-h-[88px]",
|
|
1478
142
|
"rounded-lg",
|
|
@@ -1482,26 +146,26 @@ const Toast = ({ title, description, variant = "info", onClose, }) => {
|
|
|
1482
146
|
"shadow-[0px_3px_6px_0px_rgba(0,0,0,0.16)]",
|
|
1483
147
|
classes.bg,
|
|
1484
148
|
classes.border,
|
|
1485
|
-
].join(" "), children: [
|
|
149
|
+
].join(" "), children: [jsx("div", { className: [
|
|
1486
150
|
"flex items-center justify-center",
|
|
1487
151
|
"w-10 h-10",
|
|
1488
152
|
"rounded-lg",
|
|
1489
153
|
"p-2",
|
|
1490
154
|
"flex-none",
|
|
1491
155
|
classes.iconBg,
|
|
1492
|
-
].join(" "), children:
|
|
156
|
+
].join(" "), children: jsx("div", { className: classes.icon, children: jsx(IconComponent, {}) }) }), jsxs("div", { className: "flex-1 flex flex-col gap-2", children: [jsx("div", { className: [
|
|
1493
157
|
"font-bold",
|
|
1494
158
|
"text-[20px]",
|
|
1495
159
|
"leading-[100%]",
|
|
1496
160
|
"tracking-normal",
|
|
1497
161
|
classes.text,
|
|
1498
|
-
].join(" "), children: title }), description && (
|
|
162
|
+
].join(" "), children: title }), description && (jsx("div", { className: [
|
|
1499
163
|
"font-normal",
|
|
1500
164
|
"text-[18px]",
|
|
1501
165
|
"leading-[100%]",
|
|
1502
166
|
"tracking-normal",
|
|
1503
167
|
classes.text,
|
|
1504
|
-
].join(" "), children: description }))] }), onClose && (
|
|
168
|
+
].join(" "), children: description }))] }), onClose && (jsx("button", { type: "button", onClick: onClose, className: "text-gray-400 hover:text-gray-600", "aria-label": "Cerrar", children: "\u00D7" }))] }));
|
|
1505
169
|
};
|
|
1506
170
|
|
|
1507
171
|
const ToastContext = createContext(undefined);
|
|
@@ -1543,7 +207,7 @@ const ToastProvider = ({ children, position = "top-right", }) => {
|
|
|
1543
207
|
"top-center": "top-4 left-1/2 -translate-x-1/2",
|
|
1544
208
|
"bottom-center": "bottom-4 left-1/2 -translate-x-1/2",
|
|
1545
209
|
};
|
|
1546
|
-
return (
|
|
210
|
+
return (jsxs(ToastContext.Provider, { value: { toasts, showToast, removeToast, clearToasts }, children: [children, toasts.length > 0 && (jsx("div", { className: `fixed z-50 flex flex-col gap-2 ${positionClasses[position]}`, children: toasts.map((toast) => (jsx(Toast, { ...toast, onClose: () => removeToast(toast.id) }, toast.id))) }))] }));
|
|
1547
211
|
};
|
|
1548
212
|
|
|
1549
213
|
const toastClasses = (variant) => {
|
|
@@ -1586,7 +250,7 @@ const toastClasses = (variant) => {
|
|
|
1586
250
|
const CustomToast = ({ t, title, description, variant = "info" }) => {
|
|
1587
251
|
const classes = toastClasses(variant);
|
|
1588
252
|
const IconComponent = classes.iconComponent;
|
|
1589
|
-
return (
|
|
253
|
+
return (jsxs("div", { className: [
|
|
1590
254
|
"flex items-start",
|
|
1591
255
|
"w-[400px] min-h-[88px]",
|
|
1592
256
|
"rounded-lg",
|
|
@@ -1596,29 +260,29 @@ const CustomToast = ({ t, title, description, variant = "info" }) => {
|
|
|
1596
260
|
"shadow-[0px_3px_6px_0px_rgba(0,0,0,0.16)]",
|
|
1597
261
|
classes.bg,
|
|
1598
262
|
classes.border,
|
|
1599
|
-
].join(" "), children: [
|
|
263
|
+
].join(" "), children: [jsx("div", { className: [
|
|
1600
264
|
"flex items-center justify-center",
|
|
1601
265
|
"w-10 h-10",
|
|
1602
266
|
"rounded-lg",
|
|
1603
267
|
"p-2",
|
|
1604
268
|
"flex-none",
|
|
1605
269
|
classes.iconBg,
|
|
1606
|
-
].join(" "), children:
|
|
270
|
+
].join(" "), children: jsx("div", { className: classes.icon, children: jsx(IconComponent, {}) }) }), jsxs("div", { className: "flex-1 flex flex-col gap-2", children: [jsx("div", { className: [
|
|
1607
271
|
"font-bold",
|
|
1608
272
|
"text-[20px]",
|
|
1609
273
|
"leading-[100%]",
|
|
1610
274
|
"tracking-normal",
|
|
1611
275
|
classes.text,
|
|
1612
|
-
].join(" "), children: title }), description && (
|
|
276
|
+
].join(" "), children: title }), description && (jsx("div", { className: [
|
|
1613
277
|
"font-normal",
|
|
1614
278
|
"text-[18px]",
|
|
1615
279
|
"leading-[100%]",
|
|
1616
280
|
"tracking-normal",
|
|
1617
281
|
classes.text,
|
|
1618
|
-
].join(" "), children: description }))] }),
|
|
282
|
+
].join(" "), children: description }))] }), jsx("button", { type: "button", onClick: () => toast.dismiss(t.id), className: "text-gray-400 hover:text-gray-600", "aria-label": "Cerrar", children: "\u00D7" })] }));
|
|
1619
283
|
};
|
|
1620
284
|
const showToast = ({ title, description, variant = "info", duration = 5000, }) => {
|
|
1621
|
-
return toast.custom((t) => (
|
|
285
|
+
return toast.custom((t) => (jsx(CustomToast, { t: t, title: title, description: description, variant: variant })), {
|
|
1622
286
|
duration,
|
|
1623
287
|
position: "top-right",
|
|
1624
288
|
});
|
|
@@ -1629,8 +293,8 @@ const toastWarning = (title, description, duration) => showToast({ title, descri
|
|
|
1629
293
|
const toastError = (title, description, duration) => showToast({ title, description, variant: "error", duration });
|
|
1630
294
|
|
|
1631
295
|
function UserCard({ name, email, changeUser, editUser }) {
|
|
1632
|
-
return (
|
|
296
|
+
return (jsxs("div", { children: [jsx("h2", { children: name }), jsx("p", { children: email }), jsx("button", { type: "button", onClick: changeUser, children: "Change User" }), jsx("button", { type: "button", onClick: editUser, children: "Edit User" })] }));
|
|
1633
297
|
}
|
|
1634
298
|
|
|
1635
|
-
export { Button, Input, Toast, ToastProvider, UserCard, showToast, toastError, toastInfo, toastSuccess, toastWarning, useToast };
|
|
299
|
+
export { Button, Input, TextArea, Toast, ToastProvider, UserCard, showToast, toastError, toastInfo, toastSuccess, toastWarning, useToast };
|
|
1636
300
|
//# sourceMappingURL=index.esm.js.map
|