@progressiveui/react 1.22.1 → 2.0.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.
Files changed (47) hide show
  1. package/.storybook/WfpTheme.js +1 -1
  2. package/.storybook/main.ts +10 -7
  3. package/.storybook/preview.tsx +0 -25
  4. package/es/dist/components/Accordion/hooks/useAccordionItemEffect.d.ts +1 -1
  5. package/es/dist/components/Footer/Footer.d.ts +0 -8
  6. package/es/dist/components/Footer/index.d.ts +2 -2
  7. package/es/dist/components/Input/useInput.d.ts +2 -0
  8. package/es/dist/components/MainNavigation/index.d.ts +3 -4
  9. package/es/dist/hooks/useHeightTransition.d.ts +1 -1
  10. package/es/dist/index.d.ts +1 -1
  11. package/es/index.js +231 -1316
  12. package/lib/dist/components/Accordion/hooks/useAccordionItemEffect.d.ts +1 -1
  13. package/lib/dist/components/Footer/Footer.d.ts +0 -8
  14. package/lib/dist/components/Footer/index.d.ts +2 -2
  15. package/lib/dist/components/Input/useInput.d.ts +2 -0
  16. package/lib/dist/components/MainNavigation/index.d.ts +3 -4
  17. package/lib/dist/hooks/useHeightTransition.d.ts +1 -1
  18. package/lib/dist/index.d.ts +1 -1
  19. package/lib/index.js +256 -1353
  20. package/package.json +69 -79
  21. package/src/components/Accordion/hooks/useAccordion.ts +13 -9
  22. package/src/components/BannerNavigation/BannerNavigation.stories.tsx +0 -2
  23. package/src/components/Button/Button.stories.tsx +0 -16
  24. package/src/components/Button/Button.tsx +14 -11
  25. package/src/components/ContextMenu/ContextMenu.stories.tsx +0 -2
  26. package/src/components/Empty/Empty.stories.tsx +1 -2
  27. package/src/components/Footer/Footer.tsx +2 -42
  28. package/src/components/Footer/index.ts +2 -2
  29. package/src/components/Hero/Hero.stories.tsx +0 -2
  30. package/src/components/MainNavigation/MainNavigation.stories.tsx +1 -4
  31. package/src/components/MainNavigation/MainNavigation.tsx +1 -23
  32. package/src/components/MainNavigation/index.ts +3 -4
  33. package/src/components/Pagination/Pagination.stories.tsx +0 -2
  34. package/src/components/Search/Search.tsx +1 -1
  35. package/src/components/Text/Text.tsx +7 -4
  36. package/src/components/Toggle/Toggle.tsx +4 -4
  37. package/src/index.ts +0 -1
  38. package/umd/dist/components/Accordion/hooks/useAccordionItemEffect.d.ts +1 -1
  39. package/umd/dist/components/Footer/Footer.d.ts +0 -8
  40. package/umd/dist/components/Footer/index.d.ts +2 -2
  41. package/umd/dist/components/Input/useInput.d.ts +2 -0
  42. package/umd/dist/components/MainNavigation/index.d.ts +3 -4
  43. package/umd/dist/hooks/useHeightTransition.d.ts +1 -1
  44. package/umd/dist/index.d.ts +1 -1
  45. package/umd/index.js +231 -1316
  46. package/umd/index.min.js +1 -1
  47. package/src/components/MainNavigation/MainNavigationExternal.tsx +0 -338
package/lib/index.js CHANGED
@@ -36,33 +36,6 @@ var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
36
36
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
37
37
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
38
38
 
39
- function _iterableToArrayLimit(r, l) {
40
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
41
- if (null != t) {
42
- var e,
43
- n,
44
- i,
45
- u,
46
- a = [],
47
- f = !0,
48
- o = !1;
49
- try {
50
- if (i = (t = t.call(r)).next, 0 === l) {
51
- if (Object(t) !== t) return;
52
- f = !1;
53
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
54
- } catch (r) {
55
- o = !0, n = r;
56
- } finally {
57
- try {
58
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
59
- } finally {
60
- if (o) throw n;
61
- }
62
- }
63
- return a;
64
- }
65
- }
66
39
  function _typeof(o) {
67
40
  "@babel/helpers - typeof";
68
41
 
@@ -72,28 +45,6 @@ function _typeof(o) {
72
45
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
73
46
  }, _typeof(o);
74
47
  }
75
- function _slicedToArray(arr, i) {
76
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
77
- }
78
- function _arrayWithHoles(arr) {
79
- if (Array.isArray(arr)) return arr;
80
- }
81
- function _unsupportedIterableToArray(o, minLen) {
82
- if (!o) return;
83
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
84
- var n = Object.prototype.toString.call(o).slice(8, -1);
85
- if (n === "Object" && o.constructor) n = o.constructor.name;
86
- if (n === "Map" || n === "Set") return Array.from(o);
87
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
88
- }
89
- function _arrayLikeToArray(arr, len) {
90
- if (len == null || len > arr.length) len = arr.length;
91
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
92
- return arr2;
93
- }
94
- function _nonIterableRest() {
95
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
96
- }
97
48
 
98
49
  function __rest(s, e) {
99
50
  var t = {};
@@ -110,46 +61,35 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
110
61
 
111
62
  var jsxRuntime = {exports: {}};
112
63
 
113
- var reactJsxRuntime_production_min = {};
114
-
115
- var hasRequiredReactJsxRuntime_production_min;
116
- function requireReactJsxRuntime_production_min() {
117
- if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
118
- hasRequiredReactJsxRuntime_production_min = 1;
119
- var f = React__default["default"],
120
- k = Symbol.for("react.element"),
121
- l = Symbol.for("react.fragment"),
122
- m = Object.prototype.hasOwnProperty,
123
- n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
124
- p = {
125
- key: !0,
126
- ref: !0,
127
- __self: !0,
128
- __source: !0
129
- };
130
- function q(c, a, g) {
131
- var b,
132
- d = {},
133
- e = null,
134
- h = null;
135
- void 0 !== g && (e = "" + g);
136
- void 0 !== a.key && (e = "" + a.key);
137
- void 0 !== a.ref && (h = a.ref);
138
- for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
139
- if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
64
+ var reactJsxRuntime_production = {};
65
+
66
+ var hasRequiredReactJsxRuntime_production;
67
+ function requireReactJsxRuntime_production() {
68
+ if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
69
+ hasRequiredReactJsxRuntime_production = 1;
70
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
71
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
72
+ function jsxProd(type, config, maybeKey) {
73
+ var key = null;
74
+ void 0 !== maybeKey && (key = "" + maybeKey);
75
+ void 0 !== config.key && (key = "" + config.key);
76
+ if ("key" in config) {
77
+ maybeKey = {};
78
+ for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
79
+ } else maybeKey = config;
80
+ config = maybeKey.ref;
140
81
  return {
141
- $$typeof: k,
142
- type: c,
143
- key: e,
144
- ref: h,
145
- props: d,
146
- _owner: n.current
82
+ $$typeof: REACT_ELEMENT_TYPE,
83
+ type: type,
84
+ key: key,
85
+ ref: void 0 !== config ? config : null,
86
+ props: maybeKey
147
87
  };
148
88
  }
149
- reactJsxRuntime_production_min.Fragment = l;
150
- reactJsxRuntime_production_min.jsx = q;
151
- reactJsxRuntime_production_min.jsxs = q;
152
- return reactJsxRuntime_production_min;
89
+ reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
90
+ reactJsxRuntime_production.jsx = jsxProd;
91
+ reactJsxRuntime_production.jsxs = jsxProd;
92
+ return reactJsxRuntime_production;
153
93
  }
154
94
 
155
95
  var reactJsxRuntime_development = {};
@@ -158,1127 +98,225 @@ var hasRequiredReactJsxRuntime_development;
158
98
  function requireReactJsxRuntime_development() {
159
99
  if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
160
100
  hasRequiredReactJsxRuntime_development = 1;
161
- if (process.env.NODE_ENV !== "production") {
162
- (function () {
163
-
164
- var React = React__default["default"];
165
-
166
- // ATTENTION
167
- // When adding new symbols to this file,
168
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
169
- // The Symbol used to tag the ReactElement-like types.
170
- var REACT_ELEMENT_TYPE = Symbol.for('react.element');
171
- var REACT_PORTAL_TYPE = Symbol.for('react.portal');
172
- var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
173
- var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
174
- var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
175
- var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
176
- var REACT_CONTEXT_TYPE = Symbol.for('react.context');
177
- var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
178
- var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
179
- var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
180
- var REACT_MEMO_TYPE = Symbol.for('react.memo');
181
- var REACT_LAZY_TYPE = Symbol.for('react.lazy');
182
- var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
183
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
184
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
185
- function getIteratorFn(maybeIterable) {
186
- if (maybeIterable === null || _typeof(maybeIterable) !== 'object') {
187
- return null;
188
- }
189
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
190
- if (typeof maybeIterator === 'function') {
191
- return maybeIterator;
192
- }
193
- return null;
194
- }
195
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
196
- function error(format) {
197
- {
198
- {
199
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
200
- args[_key2 - 1] = arguments[_key2];
201
- }
202
- printWarning('error', format, args);
203
- }
204
- }
205
- }
206
- function printWarning(level, format, args) {
207
- // When changing this logic, you might want to also
208
- // update consoleWithStackDev.www.js as well.
209
- {
210
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
211
- var stack = ReactDebugCurrentFrame.getStackAddendum();
212
- if (stack !== '') {
213
- format += '%s';
214
- args = args.concat([stack]);
215
- } // eslint-disable-next-line react-internal/safe-string-coercion
216
-
217
- var argsWithFormat = args.map(function (item) {
218
- return String(item);
219
- }); // Careful: RN currently depends on this prefix
220
-
221
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
222
- // breaks IE9: https://github.com/facebook/react/issues/13610
223
- // eslint-disable-next-line react-internal/no-production-logging
224
-
225
- Function.prototype.apply.call(console[level], console, argsWithFormat);
226
- }
227
- }
228
-
229
- // -----------------------------------------------------------------------------
230
-
231
- var enableScopeAPI = false; // Experimental Create Event Handle API.
232
- var enableCacheElement = false;
233
- var enableTransitionTracing = false; // No known bugs, but needs performance testing
234
-
235
- var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
236
- // stuff. Intended to enable React core members to more easily debug scheduling
237
- // issues in DEV builds.
238
-
239
- var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
240
-
241
- var REACT_MODULE_REFERENCE;
242
- {
243
- REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
244
- }
245
- function isValidElementType(type) {
246
- if (typeof type === 'string' || typeof type === 'function') {
247
- return true;
248
- } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
249
-
250
- 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) {
251
- return true;
252
- }
253
- if (_typeof(type) === 'object' && type !== null) {
254
- 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 ||
255
- // This needs to include all possible module reference object
256
- // types supported by any Flight configuration anywhere since
257
- // we don't know which Flight build this will end up being used
258
- // with.
259
- type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
260
- return true;
261
- }
262
- }
263
- return false;
264
- }
265
- function getWrappedName(outerType, innerType, wrapperName) {
266
- var displayName = outerType.displayName;
267
- if (displayName) {
268
- return displayName;
269
- }
270
- var functionName = innerType.displayName || innerType.name || '';
271
- return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
272
- } // Keep in sync with react-reconciler/getComponentNameFromFiber
273
-
274
- function getContextName(type) {
275
- return type.displayName || 'Context';
276
- } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
277
-
278
- function getComponentNameFromType(type) {
279
- if (type == null) {
280
- // Host root, text node or just invalid type.
281
- return null;
282
- }
283
- {
284
- if (typeof type.tag === 'number') {
285
- error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
286
- }
287
- }
288
- if (typeof type === 'function') {
289
- return type.displayName || type.name || null;
290
- }
291
- if (typeof type === 'string') {
292
- return type;
293
- }
294
- switch (type) {
295
- case REACT_FRAGMENT_TYPE:
296
- return 'Fragment';
297
- case REACT_PORTAL_TYPE:
298
- return 'Portal';
299
- case REACT_PROFILER_TYPE:
300
- return 'Profiler';
301
- case REACT_STRICT_MODE_TYPE:
302
- return 'StrictMode';
303
- case REACT_SUSPENSE_TYPE:
304
- return 'Suspense';
305
- case REACT_SUSPENSE_LIST_TYPE:
306
- return 'SuspenseList';
307
- }
308
- if (_typeof(type) === 'object') {
309
- switch (type.$$typeof) {
310
- case REACT_CONTEXT_TYPE:
311
- var context = type;
312
- return getContextName(context) + '.Consumer';
313
- case REACT_PROVIDER_TYPE:
314
- var provider = type;
315
- return getContextName(provider._context) + '.Provider';
316
- case REACT_FORWARD_REF_TYPE:
317
- return getWrappedName(type, type.render, 'ForwardRef');
318
- case REACT_MEMO_TYPE:
319
- var outerName = type.displayName || null;
320
- if (outerName !== null) {
321
- return outerName;
322
- }
323
- return getComponentNameFromType(type.type) || 'Memo';
324
- case REACT_LAZY_TYPE:
325
- {
326
- var lazyComponent = type;
327
- var payload = lazyComponent._payload;
328
- var init = lazyComponent._init;
329
- try {
330
- return getComponentNameFromType(init(payload));
331
- } catch (x) {
332
- return null;
333
- }
334
- }
335
-
336
- // eslint-disable-next-line no-fallthrough
337
- }
338
- }
339
- return null;
340
- }
341
- var assign = Object.assign;
342
-
343
- // Helpers to patch console.logs to avoid logging during side-effect free
344
- // replaying on render function. This currently only patches the object
345
- // lazily which won't cover if the log function was extracted eagerly.
346
- // We could also eagerly patch the method.
347
- var disabledDepth = 0;
348
- var prevLog;
349
- var prevInfo;
350
- var prevWarn;
351
- var prevError;
352
- var prevGroup;
353
- var prevGroupCollapsed;
354
- var prevGroupEnd;
355
- function disabledLog() {}
356
- disabledLog.__reactDisabledLog = true;
357
- function disableLogs() {
358
- {
359
- if (disabledDepth === 0) {
360
- /* eslint-disable react-internal/no-production-logging */
361
- prevLog = console.log;
362
- prevInfo = console.info;
363
- prevWarn = console.warn;
364
- prevError = console.error;
365
- prevGroup = console.group;
366
- prevGroupCollapsed = console.groupCollapsed;
367
- prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
368
-
369
- var props = {
370
- configurable: true,
371
- enumerable: true,
372
- value: disabledLog,
373
- writable: true
374
- }; // $FlowFixMe Flow thinks console is immutable.
375
-
376
- Object.defineProperties(console, {
377
- info: props,
378
- log: props,
379
- warn: props,
380
- error: props,
381
- group: props,
382
- groupCollapsed: props,
383
- groupEnd: props
384
- });
385
- /* eslint-enable react-internal/no-production-logging */
386
- }
387
- disabledDepth++;
388
- }
389
- }
390
- function reenableLogs() {
391
- {
392
- disabledDepth--;
393
- if (disabledDepth === 0) {
394
- /* eslint-disable react-internal/no-production-logging */
395
- var props = {
396
- configurable: true,
397
- enumerable: true,
398
- writable: true
399
- }; // $FlowFixMe Flow thinks console is immutable.
400
-
401
- Object.defineProperties(console, {
402
- log: assign({}, props, {
403
- value: prevLog
404
- }),
405
- info: assign({}, props, {
406
- value: prevInfo
407
- }),
408
- warn: assign({}, props, {
409
- value: prevWarn
410
- }),
411
- error: assign({}, props, {
412
- value: prevError
413
- }),
414
- group: assign({}, props, {
415
- value: prevGroup
416
- }),
417
- groupCollapsed: assign({}, props, {
418
- value: prevGroupCollapsed
419
- }),
420
- groupEnd: assign({}, props, {
421
- value: prevGroupEnd
422
- })
423
- });
424
- /* eslint-enable react-internal/no-production-logging */
425
- }
426
- if (disabledDepth < 0) {
427
- error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
428
- }
429
- }
430
- }
431
- var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
432
- var prefix;
433
- function describeBuiltInComponentFrame(name, source, ownerFn) {
434
- {
435
- if (prefix === undefined) {
436
- // Extract the VM specific prefix used by each line.
437
- try {
438
- throw Error();
439
- } catch (x) {
440
- var match = x.stack.trim().match(/\n( *(at )?)/);
441
- prefix = match && match[1] || '';
442
- }
443
- } // We use the prefix to ensure our stacks line up with native stack frames.
444
-
445
- return '\n' + prefix + name;
446
- }
447
- }
448
- var reentry = false;
449
- var componentFrameCache;
450
- {
451
- var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
452
- componentFrameCache = new PossiblyWeakMap();
453
- }
454
- function describeNativeComponentFrame(fn, construct) {
455
- // If something asked for a stack inside a fake render, it should get ignored.
456
- if (!fn || reentry) {
457
- return '';
458
- }
459
- {
460
- var frame = componentFrameCache.get(fn);
461
- if (frame !== undefined) {
462
- return frame;
463
- }
464
- }
465
- var control;
466
- reentry = true;
467
- var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
468
-
469
- Error.prepareStackTrace = undefined;
470
- var previousDispatcher;
471
- {
472
- previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
473
- // for warnings.
474
-
475
- ReactCurrentDispatcher.current = null;
476
- disableLogs();
477
- }
478
- try {
479
- // This should throw.
480
- if (construct) {
481
- // Something should be setting the props in the constructor.
482
- var Fake = function Fake() {
483
- throw Error();
484
- }; // $FlowFixMe
485
-
486
- Object.defineProperty(Fake.prototype, 'props', {
487
- set: function set() {
488
- // We use a throwing setter instead of frozen or non-writable props
489
- // because that won't throw in a non-strict mode function.
490
- throw Error();
491
- }
492
- });
493
- if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === 'object' && Reflect.construct) {
494
- // We construct a different control for this case to include any extra
495
- // frames added by the construct call.
496
- try {
497
- Reflect.construct(Fake, []);
498
- } catch (x) {
499
- control = x;
500
- }
501
- Reflect.construct(fn, [], Fake);
502
- } else {
503
- try {
504
- Fake.call();
505
- } catch (x) {
506
- control = x;
507
- }
508
- fn.call(Fake.prototype);
509
- }
510
- } else {
511
- try {
512
- throw Error();
513
- } catch (x) {
514
- control = x;
515
- }
516
- fn();
517
- }
518
- } catch (sample) {
519
- // This is inlined manually because closure doesn't do it for us.
520
- if (sample && control && typeof sample.stack === 'string') {
521
- // This extracts the first frame from the sample that isn't also in the control.
522
- // Skipping one frame that we assume is the frame that calls the two.
523
- var sampleLines = sample.stack.split('\n');
524
- var controlLines = control.stack.split('\n');
525
- var s = sampleLines.length - 1;
526
- var c = controlLines.length - 1;
527
- while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
528
- // We expect at least one stack frame to be shared.
529
- // Typically this will be the root most one. However, stack frames may be
530
- // cut off due to maximum stack limits. In this case, one maybe cut off
531
- // earlier than the other. We assume that the sample is longer or the same
532
- // and there for cut off earlier. So we should find the root most frame in
533
- // the sample somewhere in the control.
534
- c--;
535
- }
536
- for (; s >= 1 && c >= 0; s--, c--) {
537
- // Next we find the first one that isn't the same which should be the
538
- // frame that called our sample function and the control.
539
- if (sampleLines[s] !== controlLines[c]) {
540
- // In V8, the first line is describing the message but other VMs don't.
541
- // If we're about to return the first line, and the control is also on the same
542
- // line, that's a pretty good indicator that our sample threw at same line as
543
- // the control. I.e. before we entered the sample frame. So we ignore this result.
544
- // This can happen if you passed a class to function component, or non-function.
545
- if (s !== 1 || c !== 1) {
546
- do {
547
- s--;
548
- c--; // We may still have similar intermediate frames from the construct call.
549
- // The next one that isn't the same should be our match though.
550
-
551
- if (c < 0 || sampleLines[s] !== controlLines[c]) {
552
- // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
553
- var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
554
- // but we have a user-provided "displayName"
555
- // splice it in to make the stack more readable.
556
-
557
- if (fn.displayName && _frame.includes('<anonymous>')) {
558
- _frame = _frame.replace('<anonymous>', fn.displayName);
559
- }
560
- {
561
- if (typeof fn === 'function') {
562
- componentFrameCache.set(fn, _frame);
563
- }
564
- } // Return the line we found.
565
-
566
- return _frame;
567
- }
568
- } while (s >= 1 && c >= 0);
569
- }
570
- break;
571
- }
572
- }
573
- }
574
- } finally {
575
- reentry = false;
576
- {
577
- ReactCurrentDispatcher.current = previousDispatcher;
578
- reenableLogs();
579
- }
580
- Error.prepareStackTrace = previousPrepareStackTrace;
581
- } // Fallback to just using the name if we couldn't make it throw.
582
-
583
- var name = fn ? fn.displayName || fn.name : '';
584
- var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
585
- {
586
- if (typeof fn === 'function') {
587
- componentFrameCache.set(fn, syntheticFrame);
588
- }
589
- }
590
- return syntheticFrame;
591
- }
592
- function describeFunctionComponentFrame(fn, source, ownerFn) {
593
- {
594
- return describeNativeComponentFrame(fn, false);
595
- }
596
- }
597
- function shouldConstruct(Component) {
598
- var prototype = Component.prototype;
599
- return !!(prototype && prototype.isReactComponent);
600
- }
601
- function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
602
- if (type == null) {
603
- return '';
604
- }
605
- if (typeof type === 'function') {
606
- {
607
- return describeNativeComponentFrame(type, shouldConstruct(type));
608
- }
609
- }
610
- if (typeof type === 'string') {
611
- return describeBuiltInComponentFrame(type);
612
- }
613
- switch (type) {
614
- case REACT_SUSPENSE_TYPE:
615
- return describeBuiltInComponentFrame('Suspense');
616
- case REACT_SUSPENSE_LIST_TYPE:
617
- return describeBuiltInComponentFrame('SuspenseList');
618
- }
619
- if (_typeof(type) === 'object') {
620
- switch (type.$$typeof) {
621
- case REACT_FORWARD_REF_TYPE:
622
- return describeFunctionComponentFrame(type.render);
623
- case REACT_MEMO_TYPE:
624
- // Memo may contain any component type so we recursively resolve it.
625
- return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
626
- case REACT_LAZY_TYPE:
627
- {
628
- var lazyComponent = type;
629
- var payload = lazyComponent._payload;
630
- var init = lazyComponent._init;
631
- try {
632
- // Lazy may contain any component type so we recursively resolve it.
633
- return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
634
- } catch (x) {}
635
- }
636
- }
637
- }
638
- return '';
639
- }
640
- var hasOwnProperty = Object.prototype.hasOwnProperty;
641
- var loggedTypeFailures = {};
642
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
643
- function setCurrentlyValidatingElement(element) {
644
- {
645
- if (element) {
646
- var owner = element._owner;
647
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
648
- ReactDebugCurrentFrame.setExtraStackFrame(stack);
649
- } else {
650
- ReactDebugCurrentFrame.setExtraStackFrame(null);
651
- }
652
- }
101
+ "production" !== process.env.NODE_ENV && function () {
102
+ function getComponentNameFromType(type) {
103
+ if (null == type) return null;
104
+ if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
105
+ if ("string" === typeof type) return type;
106
+ switch (type) {
107
+ case REACT_FRAGMENT_TYPE:
108
+ return "Fragment";
109
+ case REACT_PROFILER_TYPE:
110
+ return "Profiler";
111
+ case REACT_STRICT_MODE_TYPE:
112
+ return "StrictMode";
113
+ case REACT_SUSPENSE_TYPE:
114
+ return "Suspense";
115
+ case REACT_SUSPENSE_LIST_TYPE:
116
+ return "SuspenseList";
117
+ case REACT_ACTIVITY_TYPE:
118
+ return "Activity";
653
119
  }
654
- function checkPropTypes(typeSpecs, values, location, componentName, element) {
655
- {
656
- // $FlowFixMe This is okay but Flow doesn't know it.
657
- var has = Function.call.bind(hasOwnProperty);
658
- for (var typeSpecName in typeSpecs) {
659
- if (has(typeSpecs, typeSpecName)) {
660
- var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
661
- // fail the render phase where it didn't fail before. So we log it.
662
- // After these have been cleaned up, we'll let them throw.
663
-
664
- try {
665
- // This is intentionally an invariant that gets caught. It's the same
666
- // behavior as without this statement except with a better message.
667
- if (typeof typeSpecs[typeSpecName] !== 'function') {
668
- // eslint-disable-next-line react-internal/prod-error-codes
669
- 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`.');
670
- err.name = 'Invariant Violation';
671
- throw err;
672
- }
673
- error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
674
- } catch (ex) {
675
- error$1 = ex;
676
- }
677
- if (error$1 && !(error$1 instanceof Error)) {
678
- setCurrentlyValidatingElement(element);
679
- 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));
680
- setCurrentlyValidatingElement(null);
681
- }
682
- if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
683
- // Only monitor this failure once because there tends to be a lot of the
684
- // same error.
685
- loggedTypeFailures[error$1.message] = true;
686
- setCurrentlyValidatingElement(element);
687
- error('Failed %s type: %s', location, error$1.message);
688
- setCurrentlyValidatingElement(null);
689
- }
690
- }
691
- }
692
- }
693
- }
694
- var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
695
-
696
- function isArray(a) {
697
- return isArrayImpl(a);
698
- }
699
-
700
- /*
701
- * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
702
- * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
703
- *
704
- * The functions in this module will throw an easier-to-understand,
705
- * easier-to-debug exception with a clear errors message message explaining the
706
- * problem. (Instead of a confusing exception thrown inside the implementation
707
- * of the `value` object).
708
- */
709
- // $FlowFixMe only called in DEV, so void return is not possible.
710
- function typeName(value) {
711
- {
712
- // toStringTag is needed for namespaced types like Temporal.Instant
713
- var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
714
- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
120
+ if ("object" === _typeof(type)) switch ("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
121
+ case REACT_PORTAL_TYPE:
122
+ return "Portal";
123
+ case REACT_CONTEXT_TYPE:
124
+ return (type.displayName || "Context") + ".Provider";
125
+ case REACT_CONSUMER_TYPE:
126
+ return (type._context.displayName || "Context") + ".Consumer";
127
+ case REACT_FORWARD_REF_TYPE:
128
+ var innerType = type.render;
129
+ type = type.displayName;
130
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
715
131
  return type;
716
- }
717
- } // $FlowFixMe only called in DEV, so void return is not possible.
718
-
719
- function willCoercionThrow(value) {
720
- {
132
+ case REACT_MEMO_TYPE:
133
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
134
+ case REACT_LAZY_TYPE:
135
+ innerType = type._payload;
136
+ type = type._init;
721
137
  try {
722
- testStringCoercion(value);
723
- return false;
724
- } catch (e) {
725
- return true;
726
- }
727
- }
728
- }
729
- function testStringCoercion(value) {
730
- // If you ended up here by following an exception call stack, here's what's
731
- // happened: you supplied an object or symbol value to React (as a prop, key,
732
- // DOM attribute, CSS property, string ref, etc.) and when React tried to
733
- // coerce it to a string using `'' + value`, an exception was thrown.
734
- //
735
- // The most common types that will cause this exception are `Symbol` instances
736
- // and Temporal objects like `Temporal.Instant`. But any object that has a
737
- // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
738
- // exception. (Library authors do this to prevent users from using built-in
739
- // numeric operators like `+` or comparison operators like `>=` because custom
740
- // methods are needed to perform accurate arithmetic or comparison.)
741
- //
742
- // To fix the problem, coerce this object or symbol value to a string before
743
- // passing it to React. The most reliable way is usually `String(value)`.
744
- //
745
- // To find which value is throwing, check the browser or debugger console.
746
- // Before this exception was thrown, there should be `console.error` output
747
- // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
748
- // problem and how that type was used: key, atrribute, input value prop, etc.
749
- // In most cases, this console output also shows the component and its
750
- // ancestor components where the exception happened.
751
- //
752
- // eslint-disable-next-line react-internal/safe-string-coercion
753
- return '' + value;
138
+ return getComponentNameFromType(type(innerType));
139
+ } catch (x) {}
754
140
  }
755
- function checkKeyStringCoercion(value) {
756
- {
757
- if (willCoercionThrow(value)) {
758
- error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
759
- return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
760
- }
761
- }
762
- }
763
- var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
764
- var RESERVED_PROPS = {
765
- key: true,
766
- ref: true,
767
- __self: true,
768
- __source: true
769
- };
770
- var specialPropKeyWarningShown;
771
- var specialPropRefWarningShown;
772
- var didWarnAboutStringRefs;
773
- {
774
- didWarnAboutStringRefs = {};
775
- }
776
- function hasValidRef(config) {
777
- {
778
- if (hasOwnProperty.call(config, 'ref')) {
779
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
780
- if (getter && getter.isReactWarning) {
781
- return false;
782
- }
783
- }
784
- }
785
- return config.ref !== undefined;
141
+ return null;
142
+ }
143
+ function testStringCoercion(value) {
144
+ return "" + value;
145
+ }
146
+ function checkKeyStringCoercion(value) {
147
+ try {
148
+ testStringCoercion(value);
149
+ var JSCompiler_inline_result = !1;
150
+ } catch (e) {
151
+ JSCompiler_inline_result = !0;
786
152
  }
787
- function hasValidKey(config) {
788
- {
789
- if (hasOwnProperty.call(config, 'key')) {
790
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
791
- if (getter && getter.isReactWarning) {
792
- return false;
793
- }
794
- }
795
- }
796
- return config.key !== undefined;
153
+ if (JSCompiler_inline_result) {
154
+ JSCompiler_inline_result = console;
155
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
156
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
157
+ JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
158
+ return testStringCoercion(value);
797
159
  }
798
- function warnIfStringRefCannotBeAutoConverted(config, self) {
799
- {
800
- if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
801
- var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
802
- if (!didWarnAboutStringRefs[componentName]) {
803
- 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);
804
- didWarnAboutStringRefs[componentName] = true;
805
- }
806
- }
807
- }
160
+ }
161
+ function getTaskName(type) {
162
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
163
+ if ("object" === _typeof(type) && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
164
+ try {
165
+ var name = getComponentNameFromType(type);
166
+ return name ? "<" + name + ">" : "<...>";
167
+ } catch (x) {
168
+ return "<...>";
808
169
  }
809
- function defineKeyPropWarningGetter(props, displayName) {
810
- {
811
- var warnAboutAccessingKey = function warnAboutAccessingKey() {
812
- if (!specialPropKeyWarningShown) {
813
- specialPropKeyWarningShown = true;
814
- 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);
815
- }
816
- };
817
- warnAboutAccessingKey.isReactWarning = true;
818
- Object.defineProperty(props, 'key', {
819
- get: warnAboutAccessingKey,
820
- configurable: true
821
- });
822
- }
170
+ }
171
+ function getOwner() {
172
+ var dispatcher = ReactSharedInternals.A;
173
+ return null === dispatcher ? null : dispatcher.getOwner();
174
+ }
175
+ function UnknownOwner() {
176
+ return Error("react-stack-top-frame");
177
+ }
178
+ function hasValidKey(config) {
179
+ if (hasOwnProperty.call(config, "key")) {
180
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
181
+ if (getter && getter.isReactWarning) return !1;
823
182
  }
824
- function defineRefPropWarningGetter(props, displayName) {
825
- {
826
- var warnAboutAccessingRef = function warnAboutAccessingRef() {
827
- if (!specialPropRefWarningShown) {
828
- specialPropRefWarningShown = true;
829
- 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);
830
- }
831
- };
832
- warnAboutAccessingRef.isReactWarning = true;
833
- Object.defineProperty(props, 'ref', {
834
- get: warnAboutAccessingRef,
835
- configurable: true
836
- });
837
- }
183
+ return void 0 !== config.key;
184
+ }
185
+ function defineKeyPropWarningGetter(props, displayName) {
186
+ function warnAboutAccessingKey() {
187
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.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://react.dev/link/special-props)", displayName));
838
188
  }
839
- /**
840
- * Factory method to create a new React element. This no longer adheres to
841
- * the class pattern, so do not use new to call it. Also, instanceof check
842
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
843
- * if something is a React Element.
844
- *
845
- * @param {*} type
846
- * @param {*} props
847
- * @param {*} key
848
- * @param {string|object} ref
849
- * @param {*} owner
850
- * @param {*} self A *temporary* helper to detect places where `this` is
851
- * different from the `owner` when React.createElement is called, so that we
852
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
853
- * functions, and as long as `this` and owner are the same, there will be no
854
- * change in behavior.
855
- * @param {*} source An annotation object (added by a transpiler or otherwise)
856
- * indicating filename, line number, and/or other information.
857
- * @internal
858
- */
859
-
860
- var ReactElement = function ReactElement(type, key, ref, self, source, owner, props) {
861
- var element = {
862
- // This tag allows us to uniquely identify this as a React Element
863
- $$typeof: REACT_ELEMENT_TYPE,
864
- // Built-in properties that belong on the element
865
- type: type,
866
- key: key,
867
- ref: ref,
868
- props: props,
869
- // Record the component responsible for creating this element.
870
- _owner: owner
871
- };
872
- {
873
- // The validation flag is currently mutative. We put it on
874
- // an external backing store so that we can freeze the whole object.
875
- // This can be replaced with a WeakMap once they are implemented in
876
- // commonly used development environments.
877
- element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
878
- // the validation flag non-enumerable (where possible, which should
879
- // include every environment we run tests in), so the test framework
880
- // ignores it.
881
-
882
- Object.defineProperty(element._store, 'validated', {
883
- configurable: false,
884
- enumerable: false,
885
- writable: true,
886
- value: false
887
- }); // self and source are DEV only properties.
888
-
889
- Object.defineProperty(element, '_self', {
890
- configurable: false,
891
- enumerable: false,
892
- writable: false,
893
- value: self
894
- }); // Two elements created in two different places should be considered
895
- // equal for testing purposes and therefore we hide it from enumeration.
896
-
897
- Object.defineProperty(element, '_source', {
898
- configurable: false,
899
- enumerable: false,
900
- writable: false,
901
- value: source
902
- });
903
- if (Object.freeze) {
904
- Object.freeze(element.props);
905
- Object.freeze(element);
906
- }
907
- }
908
- return element;
189
+ warnAboutAccessingKey.isReactWarning = !0;
190
+ Object.defineProperty(props, "key", {
191
+ get: warnAboutAccessingKey,
192
+ configurable: !0
193
+ });
194
+ }
195
+ function elementRefGetterWithDeprecationWarning() {
196
+ var componentName = getComponentNameFromType(this.type);
197
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
198
+ componentName = this.props.ref;
199
+ return void 0 !== componentName ? componentName : null;
200
+ }
201
+ function ReactElement(type, key, self, source, owner, props, debugStack, debugTask) {
202
+ self = props.ref;
203
+ type = {
204
+ $$typeof: REACT_ELEMENT_TYPE,
205
+ type: type,
206
+ key: key,
207
+ props: props,
208
+ _owner: owner
909
209
  };
910
- /**
911
- * https://github.com/reactjs/rfcs/pull/107
912
- * @param {*} type
913
- * @param {object} props
914
- * @param {string} key
915
- */
916
-
917
- function jsxDEV(type, config, maybeKey, source, self) {
918
- {
919
- var propName; // Reserved names are extracted
920
-
921
- var props = {};
922
- var key = null;
923
- var ref = null; // Currently, key can be spread in as a prop. This causes a potential
924
- // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
925
- // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
926
- // but as an intermediary step, we will use jsxDEV for everything except
927
- // <div {...props} key="Hi" />, because we aren't currently able to tell if
928
- // key is explicitly declared to be undefined or not.
929
-
930
- if (maybeKey !== undefined) {
931
- {
932
- checkKeyStringCoercion(maybeKey);
933
- }
934
- key = '' + maybeKey;
935
- }
936
- if (hasValidKey(config)) {
937
- {
938
- checkKeyStringCoercion(config.key);
939
- }
940
- key = '' + config.key;
941
- }
942
- if (hasValidRef(config)) {
943
- ref = config.ref;
944
- warnIfStringRefCannotBeAutoConverted(config, self);
945
- } // Remaining properties are added to a new props object
946
-
947
- for (propName in config) {
948
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
949
- props[propName] = config[propName];
950
- }
951
- } // Resolve default props
952
-
953
- if (type && type.defaultProps) {
954
- var defaultProps = type.defaultProps;
955
- for (propName in defaultProps) {
956
- if (props[propName] === undefined) {
957
- props[propName] = defaultProps[propName];
958
- }
959
- }
960
- }
961
- if (key || ref) {
962
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
963
- if (key) {
964
- defineKeyPropWarningGetter(props, displayName);
965
- }
966
- if (ref) {
967
- defineRefPropWarningGetter(props, displayName);
968
- }
969
- }
970
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
971
- }
972
- }
973
- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
974
- var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
975
- function setCurrentlyValidatingElement$1(element) {
976
- {
977
- if (element) {
978
- var owner = element._owner;
979
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
980
- ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
981
- } else {
982
- ReactDebugCurrentFrame$1.setExtraStackFrame(null);
983
- }
984
- }
985
- }
986
- var propTypesMisspellWarningShown;
987
- {
988
- propTypesMisspellWarningShown = false;
989
- }
990
- /**
991
- * Verifies the object is a ReactElement.
992
- * See https://reactjs.org/docs/react-api.html#isvalidelement
993
- * @param {?object} object
994
- * @return {boolean} True if `object` is a ReactElement.
995
- * @final
996
- */
997
-
998
- function isValidElement(object) {
999
- {
1000
- return _typeof(object) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1001
- }
1002
- }
1003
- function getDeclarationErrorAddendum() {
1004
- {
1005
- if (ReactCurrentOwner$1.current) {
1006
- var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
1007
- if (name) {
1008
- return '\n\nCheck the render method of `' + name + '`.';
1009
- }
1010
- }
1011
- return '';
1012
- }
1013
- }
1014
- function getSourceInfoErrorAddendum(source) {
1015
- {
1016
- if (source !== undefined) {
1017
- var fileName = source.fileName.replace(/^.*[\\\/]/, '');
1018
- var lineNumber = source.lineNumber;
1019
- return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
1020
- }
1021
- return '';
1022
- }
1023
- }
1024
- /**
1025
- * Warn if there's no key explicitly set on dynamic arrays of children or
1026
- * object keys are not valid. This allows us to keep track of children between
1027
- * updates.
1028
- */
1029
-
1030
- var ownerHasKeyUseWarning = {};
1031
- function getCurrentComponentErrorInfo(parentType) {
1032
- {
1033
- var info = getDeclarationErrorAddendum();
1034
- if (!info) {
1035
- var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
1036
- if (parentName) {
1037
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
1038
- }
1039
- }
1040
- return info;
1041
- }
1042
- }
1043
- /**
1044
- * Warn if the element doesn't have an explicit key assigned to it.
1045
- * This element is in an array. The array could grow and shrink or be
1046
- * reordered. All children that haven't already been validated are required to
1047
- * have a "key" property assigned to it. Error statuses are cached so a warning
1048
- * will only be shown once.
1049
- *
1050
- * @internal
1051
- * @param {ReactElement} element Element that requires a key.
1052
- * @param {*} parentType element's parent's type.
1053
- */
1054
-
1055
- function validateExplicitKey(element, parentType) {
1056
- {
1057
- if (!element._store || element._store.validated || element.key != null) {
1058
- return;
1059
- }
1060
- element._store.validated = true;
1061
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1062
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
1063
- return;
1064
- }
1065
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
1066
- // property, it may be the creator of the child that's responsible for
1067
- // assigning it a key.
1068
-
1069
- var childOwner = '';
1070
- if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
1071
- // Give the component that originally created this child.
1072
- childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
1073
- }
1074
- setCurrentlyValidatingElement$1(element);
1075
- 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);
1076
- setCurrentlyValidatingElement$1(null);
1077
- }
1078
- }
1079
- /**
1080
- * Ensure that every element either is passed in a static location, in an
1081
- * array with an explicit keys property defined, or in an object literal
1082
- * with valid key property.
1083
- *
1084
- * @internal
1085
- * @param {ReactNode} node Statically passed child of any type.
1086
- * @param {*} parentType node's parent's type.
1087
- */
1088
-
1089
- function validateChildKeys(node, parentType) {
1090
- {
1091
- if (_typeof(node) !== 'object') {
1092
- return;
1093
- }
1094
- if (isArray(node)) {
1095
- for (var i = 0; i < node.length; i++) {
1096
- var child = node[i];
1097
- if (isValidElement(child)) {
1098
- validateExplicitKey(child, parentType);
1099
- }
1100
- }
1101
- } else if (isValidElement(node)) {
1102
- // This element was passed in a valid location.
1103
- if (node._store) {
1104
- node._store.validated = true;
1105
- }
1106
- } else if (node) {
1107
- var iteratorFn = getIteratorFn(node);
1108
- if (typeof iteratorFn === 'function') {
1109
- // Entry iterators used to provide implicit keys,
1110
- // but now we print a separate warning for them later.
1111
- if (iteratorFn !== node.entries) {
1112
- var iterator = iteratorFn.call(node);
1113
- var step;
1114
- while (!(step = iterator.next()).done) {
1115
- if (isValidElement(step.value)) {
1116
- validateExplicitKey(step.value, parentType);
1117
- }
1118
- }
1119
- }
1120
- }
1121
- }
1122
- }
1123
- }
1124
- /**
1125
- * Given an element, validate that its props follow the propTypes definition,
1126
- * provided by the type.
1127
- *
1128
- * @param {ReactElement} element
1129
- */
1130
-
1131
- function validatePropTypes(element) {
1132
- {
1133
- var type = element.type;
1134
- if (type === null || type === undefined || typeof type === 'string') {
1135
- return;
1136
- }
1137
- var propTypes;
1138
- if (typeof type === 'function') {
1139
- propTypes = type.propTypes;
1140
- } else if (_typeof(type) === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
1141
- // Note: Memo only checks outer props here.
1142
- // Inner props are checked in the reconciler.
1143
- type.$$typeof === REACT_MEMO_TYPE)) {
1144
- propTypes = type.propTypes;
1145
- } else {
1146
- return;
1147
- }
1148
- if (propTypes) {
1149
- // Intentionally inside to avoid triggering lazy initializers:
1150
- var name = getComponentNameFromType(type);
1151
- checkPropTypes(propTypes, element.props, 'prop', name, element);
1152
- } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
1153
- propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
1154
-
1155
- var _name = getComponentNameFromType(type);
1156
- error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
1157
- }
1158
- if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
1159
- error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
1160
- }
1161
- }
1162
- }
1163
- /**
1164
- * Given a fragment, validate that it can only be provided with fragment props
1165
- * @param {ReactElement} fragment
1166
- */
1167
-
1168
- function validateFragmentProps(fragment) {
1169
- {
1170
- var keys = Object.keys(fragment.props);
1171
- for (var i = 0; i < keys.length; i++) {
1172
- var key = keys[i];
1173
- if (key !== 'children' && key !== 'key') {
1174
- setCurrentlyValidatingElement$1(fragment);
1175
- error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
1176
- setCurrentlyValidatingElement$1(null);
1177
- break;
1178
- }
1179
- }
1180
- if (fragment.ref !== null) {
1181
- setCurrentlyValidatingElement$1(fragment);
1182
- error('Invalid attribute `ref` supplied to `React.Fragment`.');
1183
- setCurrentlyValidatingElement$1(null);
1184
- }
1185
- }
1186
- }
1187
- function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
1188
- {
1189
- var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
1190
- // succeed and there will likely be errors in render.
1191
-
1192
- if (!validType) {
1193
- var info = '';
1194
- if (type === undefined || _typeof(type) === 'object' && type !== null && Object.keys(type).length === 0) {
1195
- 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.";
1196
- }
1197
- var sourceInfo = getSourceInfoErrorAddendum(source);
1198
- if (sourceInfo) {
1199
- info += sourceInfo;
1200
- } else {
1201
- info += getDeclarationErrorAddendum();
1202
- }
1203
- var typeString;
1204
- if (type === null) {
1205
- typeString = 'null';
1206
- } else if (isArray(type)) {
1207
- typeString = 'array';
1208
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
1209
- typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
1210
- info = ' Did you accidentally export a JSX literal instead of a component?';
1211
- } else {
1212
- typeString = _typeof(type);
1213
- }
1214
- 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);
1215
- }
1216
- var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
1217
- // TODO: Drop this when these are no longer allowed as the type argument.
1218
-
1219
- if (element == null) {
1220
- return element;
1221
- } // Skip key warning if the type isn't valid since our key validation logic
1222
- // doesn't expect a non-string/function type and can throw confusing errors.
1223
- // We don't want exception behavior to differ between dev and prod.
1224
- // (Rendering will throw with a helpful message and as soon as the type is
1225
- // fixed, the key warnings will appear.)
1226
-
1227
- if (validType) {
1228
- var children = props.children;
1229
- if (children !== undefined) {
1230
- if (isStaticChildren) {
1231
- if (isArray(children)) {
1232
- for (var i = 0; i < children.length; i++) {
1233
- validateChildKeys(children[i], type);
1234
- }
1235
- if (Object.freeze) {
1236
- Object.freeze(children);
1237
- }
1238
- } else {
1239
- 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.');
1240
- }
1241
- } else {
1242
- validateChildKeys(children, type);
1243
- }
1244
- }
1245
- }
1246
- if (type === REACT_FRAGMENT_TYPE) {
1247
- validateFragmentProps(element);
1248
- } else {
1249
- validatePropTypes(element);
1250
- }
1251
- return element;
1252
- }
1253
- } // These two functions exist to still get child warnings in dev
1254
- // even with the prod transform. This means that jsxDEV is purely
1255
- // opt-in behavior for better messages but that we won't stop
1256
- // giving you warnings if you use production apis.
1257
-
1258
- function jsxWithValidationStatic(type, props, key) {
1259
- {
1260
- return jsxWithValidation(type, props, key, true);
1261
- }
210
+ null !== (void 0 !== self ? self : null) ? Object.defineProperty(type, "ref", {
211
+ enumerable: !1,
212
+ get: elementRefGetterWithDeprecationWarning
213
+ }) : Object.defineProperty(type, "ref", {
214
+ enumerable: !1,
215
+ value: null
216
+ });
217
+ type._store = {};
218
+ Object.defineProperty(type._store, "validated", {
219
+ configurable: !1,
220
+ enumerable: !1,
221
+ writable: !0,
222
+ value: 0
223
+ });
224
+ Object.defineProperty(type, "_debugInfo", {
225
+ configurable: !1,
226
+ enumerable: !1,
227
+ writable: !0,
228
+ value: null
229
+ });
230
+ Object.defineProperty(type, "_debugStack", {
231
+ configurable: !1,
232
+ enumerable: !1,
233
+ writable: !0,
234
+ value: debugStack
235
+ });
236
+ Object.defineProperty(type, "_debugTask", {
237
+ configurable: !1,
238
+ enumerable: !1,
239
+ writable: !0,
240
+ value: debugTask
241
+ });
242
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
243
+ return type;
244
+ }
245
+ function jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self, debugStack, debugTask) {
246
+ var children = config.children;
247
+ if (void 0 !== children) if (isStaticChildren) {
248
+ if (isArrayImpl(children)) {
249
+ for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++) validateChildKeys(children[isStaticChildren]);
250
+ Object.freeze && Object.freeze(children);
251
+ } else console.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.");
252
+ } else validateChildKeys(children);
253
+ if (hasOwnProperty.call(config, "key")) {
254
+ children = getComponentNameFromType(type);
255
+ var keys = Object.keys(config).filter(function (k) {
256
+ return "key" !== k;
257
+ });
258
+ isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
259
+ didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = !0);
1262
260
  }
1263
- function jsxWithValidationDynamic(type, props, key) {
1264
- {
1265
- return jsxWithValidation(type, props, key, false);
1266
- }
261
+ children = null;
262
+ void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
263
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
264
+ if ("key" in config) {
265
+ maybeKey = {};
266
+ for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
267
+ } else maybeKey = config;
268
+ children && defineKeyPropWarningGetter(maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
269
+ return ReactElement(type, children, self, source, getOwner(), maybeKey, debugStack, debugTask);
270
+ }
271
+ function validateChildKeys(node) {
272
+ "object" === _typeof(node) && null !== node && node.$$typeof === REACT_ELEMENT_TYPE && node._store && (node._store.validated = 1);
273
+ }
274
+ var React = React__default["default"],
275
+ REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
276
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
277
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
278
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
279
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler");
280
+ var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
281
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
282
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
283
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
284
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
285
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
286
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
287
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
288
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
289
+ ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
290
+ hasOwnProperty = Object.prototype.hasOwnProperty,
291
+ isArrayImpl = Array.isArray,
292
+ createTask = console.createTask ? console.createTask : function () {
293
+ return null;
294
+ };
295
+ React = {
296
+ "react-stack-bottom-frame": function reactStackBottomFrame(callStackForError) {
297
+ return callStackForError();
1267
298
  }
1268
- var jsx = jsxWithValidationDynamic; // we may want to special case jsxs internally to take advantage of static children.
1269
- // for now we can ship identical prod functions
1270
-
1271
- var jsxs = jsxWithValidationStatic;
1272
- reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
1273
- reactJsxRuntime_development.jsx = jsx;
1274
- reactJsxRuntime_development.jsxs = jsxs;
1275
- })();
1276
- }
299
+ };
300
+ var specialPropKeyWarningShown;
301
+ var didWarnAboutElementRef = {};
302
+ var unknownOwnerDebugStack = React["react-stack-bottom-frame"].bind(React, UnknownOwner)();
303
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
304
+ var didWarnAboutKeySpread = {};
305
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
306
+ reactJsxRuntime_development.jsx = function (type, config, maybeKey, source, self) {
307
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
308
+ return jsxDEVImpl(type, config, maybeKey, !1, source, self, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
309
+ };
310
+ reactJsxRuntime_development.jsxs = function (type, config, maybeKey, source, self) {
311
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
312
+ return jsxDEVImpl(type, config, maybeKey, !0, source, self, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
313
+ };
314
+ }();
1277
315
  return reactJsxRuntime_development;
1278
316
  }
1279
317
 
1280
318
  if (process.env.NODE_ENV === 'production') {
1281
- jsxRuntime.exports = requireReactJsxRuntime_production_min();
319
+ jsxRuntime.exports = requireReactJsxRuntime_production();
1282
320
  } else {
1283
321
  jsxRuntime.exports = requireReactJsxRuntime_development();
1284
322
  }
@@ -1766,14 +804,14 @@ const Input = (_a) => {
1766
804
  var { additional, addonBefore, addonAfter, labelText, children, components: componentsOverride = {},
1767
805
  //className,
1768
806
  // iconDescription,
1769
- id, className, calculatedId, inputWrapperClassName,
807
+ id, className, inputWrapperClassName,
1770
808
  //placeholder,
1771
809
  //type,
1772
810
  //onChange,
1773
811
  //onClick,
1774
- hideLabel, name, invalid, invalidText, helperText, required } = _a, other = __rest(_a, ["additional", "addonBefore", "addonAfter", "labelText", "children", "components", "id", "className", "calculatedId", "inputWrapperClassName", "hideLabel", "name", "invalid", "invalidText", "helperText", "required"]);
812
+ hideLabel, name, invalid, invalidText, helperText, required } = _a, other = __rest(_a, ["additional", "addonBefore", "addonAfter", "labelText", "children", "components", "id", "className", "inputWrapperClassName", "hideLabel", "name", "invalid", "invalidText", "helperText", "required"]);
1775
813
  const { prefix } = useSettings();
1776
- // const calculatedId = id ? id : name;
814
+ const calculatedId = id ? id : name;
1777
815
  /* const inputProps = {
1778
816
  id: calculatedId,
1779
817
  onChange: (evt) => {
@@ -1853,9 +891,10 @@ const useInput = (_a) => {
1853
891
  }, placeholder,
1854
892
  value,
1855
893
  type });
1856
- console.log("useInput", { calculatedId });
1857
894
  const wrapperProps = {
1858
895
  calculatedId,
896
+ id,
897
+ name,
1859
898
  className,
1860
899
  addonAfter,
1861
900
  labelText,
@@ -1908,7 +947,7 @@ const Search = React__namespace.forwardRef((props, ref) => {
1908
947
  onChange(evt, evt.target.value); //TODO: why are we passing evt as second arg
1909
948
  }
1910
949
  };
1911
- const clearSearch = () => {
950
+ const clearSearch = (evt) => {
1912
951
  setValue("");
1913
952
  // setTimeout(() => {
1914
953
  // console.log("value", value);
@@ -2503,10 +1542,10 @@ const ContextMenuItem = (_a) => {
2503
1542
  return jsxRuntimeExports.jsx("div", Object.assign({ className: classes }, other));
2504
1543
  };
2505
1544
 
2506
- const Footer = ({ className, children, labelOne, linkTextOne, linkHrefOne, labelTwo, linkTextTwo, linkHrefTwo, logo, logoExtended, metaContent, metaLinks, secondary, pageWidth = "lg", }) => {
1545
+ const Footer = ({ className, children, labelOne, linkTextOne, linkHrefOne, labelTwo, linkTextTwo, linkHrefTwo, logo, metaContent, metaLinks, secondary, pageWidth = "lg", }) => {
2507
1546
  const { prefix } = useSettings();
2508
1547
  const classes = classNames__default["default"](`${prefix}--footer`, className);
2509
- return (jsxRuntimeExports.jsxs("footer", Object.assign({ className: classes }, { children: [jsxRuntimeExports.jsx(Wrapper, Object.assign({ pageWidth: pageWidth }, { children: jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__content` }, { children: [children ? (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--footer__info` }, { children: children }))) : (jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__info` }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__info__item` }, { children: [jsxRuntimeExports.jsx("p", Object.assign({ className: `${prefix}--footer__label` }, { children: labelOne })), jsxRuntimeExports.jsx("ul", Object.assign({ className: `${prefix}--footer__list` }, { children: jsxRuntimeExports.jsx("li", { children: jsxRuntimeExports.jsx(Link, Object.assign({ href: linkHrefOne }, { children: linkTextOne })) }) }))] })), jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__info__item` }, { children: [jsxRuntimeExports.jsx("p", Object.assign({ className: `${prefix}--footer__label` }, { children: labelTwo })), jsxRuntimeExports.jsx("ul", Object.assign({ className: `${prefix}--footer__list` }, { children: jsxRuntimeExports.jsx("li", { children: jsxRuntimeExports.jsx(Link, Object.assign({ href: linkHrefTwo }, { children: linkTextTwo })) }) }))] }))] }))), jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__cta` }, { children: [logoExtended && typeof logoExtended === "string" ? (jsxRuntimeExports.jsx("img", { className: `${prefix}--footer__cta-logo`, src: logoExtended, alt: "World Food Programme Logo" })) : logoExtended ? (logoExtended) : (jsxRuntimeExports.jsx(iconsReact.WfpLogoStandardBlackEn, { className: `${prefix}--footer__cta-logo`, alt: "WFP" })), logo && typeof logo === "string" ? (jsxRuntimeExports.jsx("img", { className: `${prefix}--footer__cta-logo-small`, src: logo, alt: "WFP Logo" })) : logo ? (logo) : (jsxRuntimeExports.jsx(iconsReact.WfpLogoVerticalEn, { description: "WFP", className: `${prefix}--footer__cta-logo-small` })), secondary && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--footer__secondary` }, { children: secondary })))] }))] })) })), jsxRuntimeExports.jsxs(Wrapper, Object.assign({ className: `${prefix}--footer__meta`, pageWidth: pageWidth }, { children: [metaLinks && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--footer__meta__links` }, { children: metaLinks }))), metaContent && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--footer__meta__content` }, { children: metaContent })))] }))] })));
1548
+ return (jsxRuntimeExports.jsxs("footer", Object.assign({ className: classes }, { children: [jsxRuntimeExports.jsx(Wrapper, Object.assign({ pageWidth: pageWidth }, { children: jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__content` }, { children: [children ? (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--footer__info` }, { children: children }))) : (jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__info` }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__info__item` }, { children: [jsxRuntimeExports.jsx("p", Object.assign({ className: `${prefix}--footer__label` }, { children: labelOne })), jsxRuntimeExports.jsx("ul", Object.assign({ className: `${prefix}--footer__list` }, { children: jsxRuntimeExports.jsx("li", { children: jsxRuntimeExports.jsx(Link, Object.assign({ href: linkHrefOne }, { children: linkTextOne })) }) }))] })), jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__info__item` }, { children: [jsxRuntimeExports.jsx("p", Object.assign({ className: `${prefix}--footer__label` }, { children: labelTwo })), jsxRuntimeExports.jsx("ul", Object.assign({ className: `${prefix}--footer__list` }, { children: jsxRuntimeExports.jsx("li", { children: jsxRuntimeExports.jsx(Link, Object.assign({ href: linkHrefTwo }, { children: linkTextTwo })) }) }))] }))] }))), jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__cta` }, { children: [logo, secondary && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--footer__secondary` }, { children: secondary })))] }))] })) })), jsxRuntimeExports.jsxs(Wrapper, Object.assign({ className: `${prefix}--footer__meta`, pageWidth: pageWidth }, { children: [metaLinks && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--footer__meta__links` }, { children: metaLinks }))), metaContent && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--footer__meta__content` }, { children: metaContent })))] }))] })));
2510
1549
  };
2511
1550
  Footer.displayName = "Footer";
2512
1551
 
@@ -2697,163 +1736,10 @@ const MainNavigation = ({ children, components: componentsOverride = {}, classNa
2697
1736
  toggleMenu,
2698
1737
  onChangeSub,
2699
1738
  setOpenMobileMenu,
2700
- } }, { children: jsxRuntimeExports.jsxs(Wrapper$1, Object.assign({ pageWidth: pageWidth, mobilePageWidth: mobilePageWidth, className: `${prefix}--main-navigation__wrapper` }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation__logo-wrapper` }, { children: [jsxRuntimeExports.jsx(MobileButton$1, Object.assign({ toggleMenu: toggleMenu, prefix: prefix, openMobileMenu: openMobileMenu }, { children: "Menu" })), jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--main-navigation__logo` }, { children: logoRibbon === "default" ? (jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation__logo__default` }, { children: [jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--main-navigation__logo__default__ribbon` }, { children: jsxRuntimeExports.jsx(iconsReact.WfpLogoVerticalEn, { description: "WFP" }) })), logo] }))) : logoRibbon === "offShelf" ? (jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation__logo__offShelf` }, { children: [jsxRuntimeExports.jsx(iconsReact.WfpLogoStandardBlackEn, { description: "WFP" }), logo] }))) : (logo) }))] })), jsxRuntimeExports.jsx("ul", Object.assign({ className: listClasses }, { children: children }))] })) })) })));
1739
+ } }, { children: jsxRuntimeExports.jsxs(Wrapper$1, Object.assign({ pageWidth: pageWidth, mobilePageWidth: mobilePageWidth, className: `${prefix}--main-navigation__wrapper` }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation__logo-wrapper` }, { children: [jsxRuntimeExports.jsx(MobileButton$1, Object.assign({ toggleMenu: toggleMenu, prefix: prefix, openMobileMenu: openMobileMenu }, { children: "Menu" })), jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--main-navigation__logo` }, { children: logo }))] })), jsxRuntimeExports.jsx("ul", Object.assign({ className: listClasses }, { children: children }))] })) })) })));
2701
1740
  };
2702
1741
  MainNavigation.displayName = "MainNavigation";
2703
1742
 
2704
- /** The User is used inside the MainNavigation and form, and can display an avatar and username. */
2705
- const User = (props) => {
2706
- const { className, children, components = {}, description, ellipsis, extendedDescription, showName, small, name, missingImage } = props, other = __rest(props, ["className", "children", "components", "description", "ellipsis", "extendedDescription", "showName", "small", "name", "missingImage"]);
2707
- const { prefix } = useSettings();
2708
- const defaultComponents = { Avatar };
2709
- const allComponents = Object.assign(Object.assign({}, defaultComponents), components);
2710
- const classes = classNames__default["default"](`${prefix}--user`, className, {
2711
- [`${prefix}--user--has-description`]: description,
2712
- [`${prefix}--user--has-extended-description`]: extendedDescription,
2713
- });
2714
- const titleClasses = classNames__default["default"]({
2715
- [`${prefix}--user__title`]: true,
2716
- [`${prefix}--user__title--ellipsis`]: ellipsis,
2717
- [`${prefix}--user__title--small`]: small,
2718
- });
2719
- return (jsxRuntimeExports.jsxs("div", Object.assign({ className: classes }, other, { children: [jsxRuntimeExports.jsx(allComponents.Avatar, Object.assign({}, props, { missingImage: missingImage })), showName && (jsxRuntimeExports.jsxs("span", Object.assign({ className: titleClasses }, { children: [jsxRuntimeExports.jsx("span", { children: name }), description && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--user__description` }, { children: description })))] }))), children, extendedDescription && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--user__extended-description` }, { children: extendedDescription })))] })));
2720
- };
2721
-
2722
- /**
2723
- * useTogglable(): hook used to open/close boolean state.
2724
- */
2725
- var useTogglable = function useTogglable() {
2726
- var _useState = React.useState(false),
2727
- _useState2 = _slicedToArray(_useState, 2),
2728
- isOpen = _useState2[0],
2729
- setState = _useState2[1];
2730
- var open = function open() {
2731
- return setState(true);
2732
- };
2733
- var close = function close() {
2734
- return setState(false);
2735
- };
2736
- return {
2737
- isOpen: isOpen,
2738
- open: open,
2739
- close: close
2740
- };
2741
- };
2742
-
2743
- const LanguageExternal = ({ children, primaryLanguage }) => {
2744
- const { prefix } = useSettings();
2745
- const ref = React.useRef(null);
2746
- const languageTogglable = useTogglable();
2747
- React.useEffect(() => {
2748
- const checkIfClickedOutside = (e) => {
2749
- // If the menu is open and the clicked target is not within the menu,
2750
- // then close the menu
2751
- if (languageTogglable.isOpen &&
2752
- ref.current &&
2753
- !ref.current.contains(e.target)) {
2754
- languageTogglable.close();
2755
- }
2756
- };
2757
- document.addEventListener("mousedown", checkIfClickedOutside);
2758
- return () => {
2759
- // Cleanup the event listener
2760
- document.removeEventListener("mousedown", checkIfClickedOutside);
2761
- };
2762
- }, [languageTogglable.isOpen]);
2763
- return (jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--language-ext`, ref: ref }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--language-ext__trigger`, role: "presentation", onClick: () => languageTogglable.isOpen
2764
- ? languageTogglable.close()
2765
- : languageTogglable.open() }, { children: [jsxRuntimeExports.jsx("span", { children: primaryLanguage }), languageTogglable.isOpen ? jsxRuntimeExports.jsx(iconsReact.ChevronUp, {}) : jsxRuntimeExports.jsx(iconsReact.ChevronDown, {})] })), jsxRuntimeExports.jsx("ul", Object.assign({ className: `${prefix}--language-ext__dropdown ${languageTogglable.isOpen
2766
- ? `${prefix}--language-ext__dropdown--is-shown`
2767
- : ""}` }, { children: children }))] })));
2768
- };
2769
- const UserExternal = ({ username, children, userImage }) => {
2770
- const { prefix } = useSettings();
2771
- const ref = React.useRef(null);
2772
- const userTogglable = useTogglable();
2773
- React.useEffect(() => {
2774
- const checkIfClickedOutside = (e) => {
2775
- // If the menu is open and the clicked target is not within the menu,
2776
- // then close the menu
2777
- if (userTogglable.isOpen &&
2778
- (ref === null || ref === void 0 ? void 0 : ref.current) &&
2779
- !ref.current.contains(e.target)) {
2780
- userTogglable.close();
2781
- }
2782
- };
2783
- document.addEventListener("mousedown", checkIfClickedOutside);
2784
- return () => {
2785
- // Cleanup the event listener
2786
- document.removeEventListener("mousedown", checkIfClickedOutside);
2787
- };
2788
- }, [userTogglable.isOpen]);
2789
- return (jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--user-ext`, ref: ref }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--user-ext__trigger`, role: "presentation", onClick: () => userTogglable.isOpen ? userTogglable.close() : userTogglable.open() }, { children: [jsxRuntimeExports.jsx(User, { alt: "User avatar", name: username, image: userImage }), userTogglable.isOpen ? jsxRuntimeExports.jsx(iconsReact.ChevronUp, {}) : jsxRuntimeExports.jsx(iconsReact.ChevronDown, {})] })), jsxRuntimeExports.jsx("ul", Object.assign({ className: `${prefix}--user-ext__dropdown ${userTogglable.isOpen ? `${prefix}--user-ext__dropdown--is-shown` : ""}` }, { children: children }))] })));
2790
- };
2791
- const MainNavigationExternal = ({ productName, primaryLanguage, languageList, username, pageWidth = "full", components = {}, userImage, userDetails, children, }) => {
2792
- const { prefix } = useSettings();
2793
- const ref = React.useRef(null);
2794
- const navTogglable = useTogglable();
2795
- React.useEffect(() => {
2796
- const checkIfClickedOutside = (e) => {
2797
- // If the menu is open and the clicked target is not within the menu,
2798
- // then close the menu
2799
- if (navTogglable.isOpen &&
2800
- ref.current &&
2801
- !ref.current.contains(e.target)) {
2802
- navTogglable.close();
2803
- }
2804
- };
2805
- document.addEventListener("mousedown", checkIfClickedOutside);
2806
- return () => {
2807
- // Cleanup the event listener
2808
- document.removeEventListener("mousedown", checkIfClickedOutside);
2809
- };
2810
- }, [navTogglable.isOpen]);
2811
- const defaultComponents = {
2812
- LanguageExternal,
2813
- UserExternal,
2814
- };
2815
- const c = Object.assign(Object.assign({}, defaultComponents), components);
2816
- return (jsxRuntimeExports.jsx("header", Object.assign({ className: `${prefix}--main-navigation-ext` }, { children: jsxRuntimeExports.jsxs(Wrapper, Object.assign({ pageWidth: pageWidth, className: `${prefix}--main-navigation-ext__wrapper` }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation-ext__branding` }, { children: [jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--main-navigation-ext__wfp-logo` }, { children: jsxRuntimeExports.jsx(iconsReact.WfpLogoVerticalEn, { className: `${prefix}--main-navigation-ext__wfp-logo-svg`, alt: "WFP", width: "100%" }) })), jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--main-navigation-ext__product-name` }, { children: productName }))] })), jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation-ext__main` }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation-ext__settings` }, { children: [jsxRuntimeExports.jsx(c.LanguageExternal, Object.assign({ primaryLanguage: primaryLanguage }, { children: languageList })), jsxRuntimeExports.jsx(c.UserExternal, Object.assign({ username: username, userImage: userImage }, { children: userDetails }))] })), jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation-ext__nav`, ref: ref }, { children: [jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--main-navigation-ext__mobile-menu-button` }, { children: jsxRuntimeExports.jsx(Button, Object.assign({ kind: "secondary", small: true, onClick: () => navTogglable.isOpen
2817
- ? navTogglable.close()
2818
- : navTogglable.open() }, { children: "Menu" })) })), jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--main-navigation-ext__nav-wrapper
2819
- ${navTogglable.isOpen ? "wfp--main-navigation-ext--is-shown" : ""}` }, { children: jsxRuntimeExports.jsx("nav", Object.assign({ className: `${prefix}--main-navigation-ext__site-nav ${navTogglable.isOpen
2820
- ? "wfp--main-navigation-ext--is-shown"
2821
- : ""}` }, { children: jsxRuntimeExports.jsxs("ul", Object.assign({ className: `${prefix}--main-navigation-ext__site-nav-list` }, { children: [children, jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation-ext__mobile-settings` }, { children: [jsxRuntimeExports.jsx("li", Object.assign({ className: `${prefix}--main-navigation-ext__site-link` }, { children: jsxRuntimeExports.jsx(LanguageExternal, Object.assign({ primaryLanguage: primaryLanguage }, { children: languageList })) })), jsxRuntimeExports.jsx("li", Object.assign({ className: `${prefix}--main-navigation-ext__site-link` }, { children: jsxRuntimeExports.jsx(UserExternal, Object.assign({ username: username, userImage: userImage }, { children: userDetails })) }))] }))] })) })) }))] }))] }))] })) })));
2822
- };
2823
- MainNavigationExternal.propTypes = {
2824
- /**
2825
- * The name of your product can be applied to this prop
2826
- */
2827
- productName: PropTypes__default["default"].node,
2828
- /**
2829
- * The CSS class name to be placed on the wrapping element.
2830
- */
2831
- className: PropTypes__default["default"].string,
2832
- /**
2833
- * List of laguages your site support
2834
- */
2835
- languageList: PropTypes__default["default"].node,
2836
- /**
2837
- * The name of signed in user can be applied to this prop
2838
- */
2839
- username: PropTypes__default["default"].node,
2840
- /**
2841
- * The image of signed in user can be applied to this prop
2842
- */
2843
- userImage: PropTypes__default["default"].string,
2844
- /**
2845
- * The dropdown details of user can be applied to this prop
2846
- */
2847
- userDetails: PropTypes__default["default"].node,
2848
- /**
2849
- * This prop accepts the first language your website is in. Default: English
2850
- */
2851
- primaryLanguage: PropTypes__default["default"].string,
2852
- };
2853
- MainNavigationExternal.defaultProps = {
2854
- primaryLanguage: "English",
2855
- };
2856
-
2857
1743
  /** The useMainNavigation() is a hook to access the current state of the MainNavigation and manipulate it. */
2858
1744
  function useMainNavigation() {
2859
1745
  const settings = React.useContext(MainNavigationContext);
@@ -4360,6 +3246,24 @@ const Toggle = React__namespace.forwardRef((props, ref) => {
4360
3246
  });
4361
3247
  Toggle.displayName = "Toggle";
4362
3248
 
3249
+ /** The User is used inside the MainNavigation and form, and can display an avatar and username. */
3250
+ const User = (props) => {
3251
+ const { className, children, components = {}, description, ellipsis, extendedDescription, showName, small, name, missingImage } = props, other = __rest(props, ["className", "children", "components", "description", "ellipsis", "extendedDescription", "showName", "small", "name", "missingImage"]);
3252
+ const { prefix } = useSettings();
3253
+ const defaultComponents = { Avatar };
3254
+ const allComponents = Object.assign(Object.assign({}, defaultComponents), components);
3255
+ const classes = classNames__default["default"](`${prefix}--user`, className, {
3256
+ [`${prefix}--user--has-description`]: description,
3257
+ [`${prefix}--user--has-extended-description`]: extendedDescription,
3258
+ });
3259
+ const titleClasses = classNames__default["default"]({
3260
+ [`${prefix}--user__title`]: true,
3261
+ [`${prefix}--user__title--ellipsis`]: ellipsis,
3262
+ [`${prefix}--user__title--small`]: small,
3263
+ });
3264
+ return (jsxRuntimeExports.jsxs("div", Object.assign({ className: classes }, other, { children: [jsxRuntimeExports.jsx(allComponents.Avatar, Object.assign({}, props, { missingImage: missingImage })), showName && (jsxRuntimeExports.jsxs("span", Object.assign({ className: titleClasses }, { children: [jsxRuntimeExports.jsx("span", { children: name }), description && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--user__description` }, { children: description })))] }))), children, extendedDescription && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--user__extended-description` }, { children: extendedDescription })))] })));
3265
+ };
3266
+
4363
3267
  const scaleLookup = {
4364
3268
  thousand: {
4365
3269
  pow: 1000,
@@ -5593,7 +4497,6 @@ exports.ListItem = ListItem;
5593
4497
  exports.Loading = Loading;
5594
4498
  exports.MainNavigation = MainNavigation;
5595
4499
  exports.MainNavigationContext = MainNavigationContext;
5596
- exports.MainNavigationExternal = MainNavigationExternal;
5597
4500
  exports.MainNavigationItem = MainNavigationItem;
5598
4501
  exports.Modal = Modal;
5599
4502
  exports.ModalFooter = ModalFooter;