@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/es/index.js CHANGED
@@ -5,39 +5,12 @@
5
5
  import * as React from 'react';
6
6
  import React__default, { createContext, useState, useEffect, useContext, useId, useLayoutEffect, useRef, useMemo, useCallback } from 'react';
7
7
  import { useTransitionMap } from 'react-transition-state';
8
- import { ChevronDown, WarningSolid, Search as Search$1, Close, User as User$1, Home, CalendarAltRegular, ArrowRight, WfpLogoStandardBlackEn, WfpLogoVerticalEn, Twitter, Facebook, Instagram, LinkedIn, YouTube, TikTok, InfoSolid, Cross, Check, ChevronUp, Error as Error$1, CheckmarkCircle, InfoCircle, CaretDown, CaretUp, ChevronLeft, ChevronRight, Ellipsis, WarningOutline, Locked, OverflowMenu, Checkmark, Menu } from '@progressiveui/icons-react';
8
+ import { ChevronDown, WarningSolid, Search as Search$1, Close, User as User$1, Home, CalendarAltRegular, ArrowRight, Twitter, Facebook, Instagram, LinkedIn, YouTube, TikTok, InfoSolid, Cross, Check, Error as Error$1, CheckmarkCircle, InfoCircle, CaretDown, CaretUp, ChevronLeft, ChevronRight, ChevronUp, Ellipsis, WarningOutline, Locked, OverflowMenu, Checkmark, Menu } from '@progressiveui/icons-react';
9
9
  import classNames from 'classnames';
10
10
  import PropTypes, { oneOf } from 'prop-types';
11
11
  import ReactDOM from 'react-dom';
12
12
  import { usePopperTooltip } from 'react-popper-tooltip';
13
13
 
14
- function _iterableToArrayLimit(r, l) {
15
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
16
- if (null != t) {
17
- var e,
18
- n,
19
- i,
20
- u,
21
- a = [],
22
- f = !0,
23
- o = !1;
24
- try {
25
- if (i = (t = t.call(r)).next, 0 === l) {
26
- if (Object(t) !== t) return;
27
- f = !1;
28
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
29
- } catch (r) {
30
- o = !0, n = r;
31
- } finally {
32
- try {
33
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
34
- } finally {
35
- if (o) throw n;
36
- }
37
- }
38
- return a;
39
- }
40
- }
41
14
  function _typeof(o) {
42
15
  "@babel/helpers - typeof";
43
16
 
@@ -47,28 +20,6 @@ function _typeof(o) {
47
20
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
48
21
  }, _typeof(o);
49
22
  }
50
- function _slicedToArray(arr, i) {
51
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
52
- }
53
- function _arrayWithHoles(arr) {
54
- if (Array.isArray(arr)) return arr;
55
- }
56
- function _unsupportedIterableToArray(o, minLen) {
57
- if (!o) return;
58
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
59
- var n = Object.prototype.toString.call(o).slice(8, -1);
60
- if (n === "Object" && o.constructor) n = o.constructor.name;
61
- if (n === "Map" || n === "Set") return Array.from(o);
62
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
63
- }
64
- function _arrayLikeToArray(arr, len) {
65
- if (len == null || len > arr.length) len = arr.length;
66
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
67
- return arr2;
68
- }
69
- function _nonIterableRest() {
70
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
71
- }
72
23
 
73
24
  function __rest(s, e) {
74
25
  var t = {};
@@ -91,1122 +42,220 @@ var hasRequiredReactJsxRuntime_development;
91
42
  function requireReactJsxRuntime_development() {
92
43
  if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
93
44
  hasRequiredReactJsxRuntime_development = 1;
94
- {
95
- (function () {
96
-
97
- var React = React__default;
98
-
99
- // ATTENTION
100
- // When adding new symbols to this file,
101
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
102
- // The Symbol used to tag the ReactElement-like types.
103
- var REACT_ELEMENT_TYPE = Symbol.for('react.element');
104
- var REACT_PORTAL_TYPE = Symbol.for('react.portal');
105
- var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
106
- var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
107
- var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
108
- var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
109
- var REACT_CONTEXT_TYPE = Symbol.for('react.context');
110
- var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
111
- var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
112
- var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
113
- var REACT_MEMO_TYPE = Symbol.for('react.memo');
114
- var REACT_LAZY_TYPE = Symbol.for('react.lazy');
115
- var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
116
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
117
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
118
- function getIteratorFn(maybeIterable) {
119
- if (maybeIterable === null || _typeof(maybeIterable) !== 'object') {
120
- return null;
121
- }
122
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
123
- if (typeof maybeIterator === 'function') {
124
- return maybeIterator;
125
- }
126
- return null;
127
- }
128
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
129
- function error(format) {
130
- {
131
- {
132
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
133
- args[_key2 - 1] = arguments[_key2];
134
- }
135
- printWarning('error', format, args);
136
- }
137
- }
45
+ (function () {
46
+ function getComponentNameFromType(type) {
47
+ if (null == type) return null;
48
+ if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
49
+ if ("string" === typeof type) return type;
50
+ switch (type) {
51
+ case REACT_FRAGMENT_TYPE:
52
+ return "Fragment";
53
+ case REACT_PROFILER_TYPE:
54
+ return "Profiler";
55
+ case REACT_STRICT_MODE_TYPE:
56
+ return "StrictMode";
57
+ case REACT_SUSPENSE_TYPE:
58
+ return "Suspense";
59
+ case REACT_SUSPENSE_LIST_TYPE:
60
+ return "SuspenseList";
61
+ case REACT_ACTIVITY_TYPE:
62
+ return "Activity";
138
63
  }
139
- function printWarning(level, format, args) {
140
- // When changing this logic, you might want to also
141
- // update consoleWithStackDev.www.js as well.
142
- {
143
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
144
- var stack = ReactDebugCurrentFrame.getStackAddendum();
145
- if (stack !== '') {
146
- format += '%s';
147
- args = args.concat([stack]);
148
- } // eslint-disable-next-line react-internal/safe-string-coercion
149
-
150
- var argsWithFormat = args.map(function (item) {
151
- return String(item);
152
- }); // Careful: RN currently depends on this prefix
153
-
154
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
155
- // breaks IE9: https://github.com/facebook/react/issues/13610
156
- // eslint-disable-next-line react-internal/no-production-logging
157
-
158
- Function.prototype.apply.call(console[level], console, argsWithFormat);
159
- }
160
- }
161
-
162
- // -----------------------------------------------------------------------------
163
-
164
- var enableScopeAPI = false; // Experimental Create Event Handle API.
165
- var enableCacheElement = false;
166
- var enableTransitionTracing = false; // No known bugs, but needs performance testing
167
-
168
- var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
169
- // stuff. Intended to enable React core members to more easily debug scheduling
170
- // issues in DEV builds.
171
-
172
- var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
173
-
174
- var REACT_MODULE_REFERENCE;
175
- {
176
- REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
177
- }
178
- function isValidElementType(type) {
179
- if (typeof type === 'string' || typeof type === 'function') {
180
- return true;
181
- } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
182
-
183
- 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) {
184
- return true;
185
- }
186
- if (_typeof(type) === 'object' && type !== null) {
187
- 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 ||
188
- // This needs to include all possible module reference object
189
- // types supported by any Flight configuration anywhere since
190
- // we don't know which Flight build this will end up being used
191
- // with.
192
- type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
193
- return true;
194
- }
195
- }
196
- return false;
197
- }
198
- function getWrappedName(outerType, innerType, wrapperName) {
199
- var displayName = outerType.displayName;
200
- if (displayName) {
201
- return displayName;
202
- }
203
- var functionName = innerType.displayName || innerType.name || '';
204
- return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
205
- } // Keep in sync with react-reconciler/getComponentNameFromFiber
206
-
207
- function getContextName(type) {
208
- return type.displayName || 'Context';
209
- } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
210
-
211
- function getComponentNameFromType(type) {
212
- if (type == null) {
213
- // Host root, text node or just invalid type.
214
- return null;
215
- }
216
- {
217
- if (typeof type.tag === 'number') {
218
- error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
219
- }
220
- }
221
- if (typeof type === 'function') {
222
- return type.displayName || type.name || null;
223
- }
224
- if (typeof type === 'string') {
64
+ 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) {
65
+ case REACT_PORTAL_TYPE:
66
+ return "Portal";
67
+ case REACT_CONTEXT_TYPE:
68
+ return (type.displayName || "Context") + ".Provider";
69
+ case REACT_CONSUMER_TYPE:
70
+ return (type._context.displayName || "Context") + ".Consumer";
71
+ case REACT_FORWARD_REF_TYPE:
72
+ var innerType = type.render;
73
+ type = type.displayName;
74
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
225
75
  return type;
226
- }
227
- switch (type) {
228
- case REACT_FRAGMENT_TYPE:
229
- return 'Fragment';
230
- case REACT_PORTAL_TYPE:
231
- return 'Portal';
232
- case REACT_PROFILER_TYPE:
233
- return 'Profiler';
234
- case REACT_STRICT_MODE_TYPE:
235
- return 'StrictMode';
236
- case REACT_SUSPENSE_TYPE:
237
- return 'Suspense';
238
- case REACT_SUSPENSE_LIST_TYPE:
239
- return 'SuspenseList';
240
- }
241
- if (_typeof(type) === 'object') {
242
- switch (type.$$typeof) {
243
- case REACT_CONTEXT_TYPE:
244
- var context = type;
245
- return getContextName(context) + '.Consumer';
246
- case REACT_PROVIDER_TYPE:
247
- var provider = type;
248
- return getContextName(provider._context) + '.Provider';
249
- case REACT_FORWARD_REF_TYPE:
250
- return getWrappedName(type, type.render, 'ForwardRef');
251
- case REACT_MEMO_TYPE:
252
- var outerName = type.displayName || null;
253
- if (outerName !== null) {
254
- return outerName;
255
- }
256
- return getComponentNameFromType(type.type) || 'Memo';
257
- case REACT_LAZY_TYPE:
258
- {
259
- var lazyComponent = type;
260
- var payload = lazyComponent._payload;
261
- var init = lazyComponent._init;
262
- try {
263
- return getComponentNameFromType(init(payload));
264
- } catch (x) {
265
- return null;
266
- }
267
- }
268
-
269
- // eslint-disable-next-line no-fallthrough
270
- }
271
- }
272
- return null;
273
- }
274
- var assign = Object.assign;
275
-
276
- // Helpers to patch console.logs to avoid logging during side-effect free
277
- // replaying on render function. This currently only patches the object
278
- // lazily which won't cover if the log function was extracted eagerly.
279
- // We could also eagerly patch the method.
280
- var disabledDepth = 0;
281
- var prevLog;
282
- var prevInfo;
283
- var prevWarn;
284
- var prevError;
285
- var prevGroup;
286
- var prevGroupCollapsed;
287
- var prevGroupEnd;
288
- function disabledLog() {}
289
- disabledLog.__reactDisabledLog = true;
290
- function disableLogs() {
291
- {
292
- if (disabledDepth === 0) {
293
- /* eslint-disable react-internal/no-production-logging */
294
- prevLog = console.log;
295
- prevInfo = console.info;
296
- prevWarn = console.warn;
297
- prevError = console.error;
298
- prevGroup = console.group;
299
- prevGroupCollapsed = console.groupCollapsed;
300
- prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
301
-
302
- var props = {
303
- configurable: true,
304
- enumerable: true,
305
- value: disabledLog,
306
- writable: true
307
- }; // $FlowFixMe Flow thinks console is immutable.
308
-
309
- Object.defineProperties(console, {
310
- info: props,
311
- log: props,
312
- warn: props,
313
- error: props,
314
- group: props,
315
- groupCollapsed: props,
316
- groupEnd: props
317
- });
318
- /* eslint-enable react-internal/no-production-logging */
319
- }
320
- disabledDepth++;
321
- }
322
- }
323
- function reenableLogs() {
324
- {
325
- disabledDepth--;
326
- if (disabledDepth === 0) {
327
- /* eslint-disable react-internal/no-production-logging */
328
- var props = {
329
- configurable: true,
330
- enumerable: true,
331
- writable: true
332
- }; // $FlowFixMe Flow thinks console is immutable.
333
-
334
- Object.defineProperties(console, {
335
- log: assign({}, props, {
336
- value: prevLog
337
- }),
338
- info: assign({}, props, {
339
- value: prevInfo
340
- }),
341
- warn: assign({}, props, {
342
- value: prevWarn
343
- }),
344
- error: assign({}, props, {
345
- value: prevError
346
- }),
347
- group: assign({}, props, {
348
- value: prevGroup
349
- }),
350
- groupCollapsed: assign({}, props, {
351
- value: prevGroupCollapsed
352
- }),
353
- groupEnd: assign({}, props, {
354
- value: prevGroupEnd
355
- })
356
- });
357
- /* eslint-enable react-internal/no-production-logging */
358
- }
359
- if (disabledDepth < 0) {
360
- error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
361
- }
362
- }
363
- }
364
- var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
365
- var prefix;
366
- function describeBuiltInComponentFrame(name, source, ownerFn) {
367
- {
368
- if (prefix === undefined) {
369
- // Extract the VM specific prefix used by each line.
370
- try {
371
- throw Error();
372
- } catch (x) {
373
- var match = x.stack.trim().match(/\n( *(at )?)/);
374
- prefix = match && match[1] || '';
375
- }
376
- } // We use the prefix to ensure our stacks line up with native stack frames.
377
-
378
- return '\n' + prefix + name;
379
- }
380
- }
381
- var reentry = false;
382
- var componentFrameCache;
383
- {
384
- var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
385
- componentFrameCache = new PossiblyWeakMap();
386
- }
387
- function describeNativeComponentFrame(fn, construct) {
388
- // If something asked for a stack inside a fake render, it should get ignored.
389
- if (!fn || reentry) {
390
- return '';
391
- }
392
- {
393
- var frame = componentFrameCache.get(fn);
394
- if (frame !== undefined) {
395
- return frame;
396
- }
397
- }
398
- var control;
399
- reentry = true;
400
- var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
401
-
402
- Error.prepareStackTrace = undefined;
403
- var previousDispatcher;
404
- {
405
- previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
406
- // for warnings.
407
-
408
- ReactCurrentDispatcher.current = null;
409
- disableLogs();
410
- }
411
- try {
412
- // This should throw.
413
- if (construct) {
414
- // Something should be setting the props in the constructor.
415
- var Fake = function Fake() {
416
- throw Error();
417
- }; // $FlowFixMe
418
-
419
- Object.defineProperty(Fake.prototype, 'props', {
420
- set: function set() {
421
- // We use a throwing setter instead of frozen or non-writable props
422
- // because that won't throw in a non-strict mode function.
423
- throw Error();
424
- }
425
- });
426
- if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === 'object' && Reflect.construct) {
427
- // We construct a different control for this case to include any extra
428
- // frames added by the construct call.
429
- try {
430
- Reflect.construct(Fake, []);
431
- } catch (x) {
432
- control = x;
433
- }
434
- Reflect.construct(fn, [], Fake);
435
- } else {
436
- try {
437
- Fake.call();
438
- } catch (x) {
439
- control = x;
440
- }
441
- fn.call(Fake.prototype);
442
- }
443
- } else {
444
- try {
445
- throw Error();
446
- } catch (x) {
447
- control = x;
448
- }
449
- fn();
450
- }
451
- } catch (sample) {
452
- // This is inlined manually because closure doesn't do it for us.
453
- if (sample && control && typeof sample.stack === 'string') {
454
- // This extracts the first frame from the sample that isn't also in the control.
455
- // Skipping one frame that we assume is the frame that calls the two.
456
- var sampleLines = sample.stack.split('\n');
457
- var controlLines = control.stack.split('\n');
458
- var s = sampleLines.length - 1;
459
- var c = controlLines.length - 1;
460
- while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
461
- // We expect at least one stack frame to be shared.
462
- // Typically this will be the root most one. However, stack frames may be
463
- // cut off due to maximum stack limits. In this case, one maybe cut off
464
- // earlier than the other. We assume that the sample is longer or the same
465
- // and there for cut off earlier. So we should find the root most frame in
466
- // the sample somewhere in the control.
467
- c--;
468
- }
469
- for (; s >= 1 && c >= 0; s--, c--) {
470
- // Next we find the first one that isn't the same which should be the
471
- // frame that called our sample function and the control.
472
- if (sampleLines[s] !== controlLines[c]) {
473
- // In V8, the first line is describing the message but other VMs don't.
474
- // If we're about to return the first line, and the control is also on the same
475
- // line, that's a pretty good indicator that our sample threw at same line as
476
- // the control. I.e. before we entered the sample frame. So we ignore this result.
477
- // This can happen if you passed a class to function component, or non-function.
478
- if (s !== 1 || c !== 1) {
479
- do {
480
- s--;
481
- c--; // We may still have similar intermediate frames from the construct call.
482
- // The next one that isn't the same should be our match though.
483
-
484
- if (c < 0 || sampleLines[s] !== controlLines[c]) {
485
- // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
486
- var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
487
- // but we have a user-provided "displayName"
488
- // splice it in to make the stack more readable.
489
-
490
- if (fn.displayName && _frame.includes('<anonymous>')) {
491
- _frame = _frame.replace('<anonymous>', fn.displayName);
492
- }
493
- {
494
- if (typeof fn === 'function') {
495
- componentFrameCache.set(fn, _frame);
496
- }
497
- } // Return the line we found.
498
-
499
- return _frame;
500
- }
501
- } while (s >= 1 && c >= 0);
502
- }
503
- break;
504
- }
505
- }
506
- }
507
- } finally {
508
- reentry = false;
509
- {
510
- ReactCurrentDispatcher.current = previousDispatcher;
511
- reenableLogs();
512
- }
513
- Error.prepareStackTrace = previousPrepareStackTrace;
514
- } // Fallback to just using the name if we couldn't make it throw.
515
-
516
- var name = fn ? fn.displayName || fn.name : '';
517
- var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
518
- {
519
- if (typeof fn === 'function') {
520
- componentFrameCache.set(fn, syntheticFrame);
521
- }
522
- }
523
- return syntheticFrame;
524
- }
525
- function describeFunctionComponentFrame(fn, source, ownerFn) {
526
- {
527
- return describeNativeComponentFrame(fn, false);
528
- }
529
- }
530
- function shouldConstruct(Component) {
531
- var prototype = Component.prototype;
532
- return !!(prototype && prototype.isReactComponent);
533
- }
534
- function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
535
- if (type == null) {
536
- return '';
537
- }
538
- if (typeof type === 'function') {
539
- {
540
- return describeNativeComponentFrame(type, shouldConstruct(type));
541
- }
542
- }
543
- if (typeof type === 'string') {
544
- return describeBuiltInComponentFrame(type);
545
- }
546
- switch (type) {
547
- case REACT_SUSPENSE_TYPE:
548
- return describeBuiltInComponentFrame('Suspense');
549
- case REACT_SUSPENSE_LIST_TYPE:
550
- return describeBuiltInComponentFrame('SuspenseList');
551
- }
552
- if (_typeof(type) === 'object') {
553
- switch (type.$$typeof) {
554
- case REACT_FORWARD_REF_TYPE:
555
- return describeFunctionComponentFrame(type.render);
556
- case REACT_MEMO_TYPE:
557
- // Memo may contain any component type so we recursively resolve it.
558
- return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
559
- case REACT_LAZY_TYPE:
560
- {
561
- var lazyComponent = type;
562
- var payload = lazyComponent._payload;
563
- var init = lazyComponent._init;
564
- try {
565
- // Lazy may contain any component type so we recursively resolve it.
566
- return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
567
- } catch (x) {}
568
- }
569
- }
570
- }
571
- return '';
572
- }
573
- var hasOwnProperty = Object.prototype.hasOwnProperty;
574
- var loggedTypeFailures = {};
575
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
576
- function setCurrentlyValidatingElement(element) {
577
- {
578
- if (element) {
579
- var owner = element._owner;
580
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
581
- ReactDebugCurrentFrame.setExtraStackFrame(stack);
582
- } else {
583
- ReactDebugCurrentFrame.setExtraStackFrame(null);
584
- }
585
- }
586
- }
587
- function checkPropTypes(typeSpecs, values, location, componentName, element) {
588
- {
589
- // $FlowFixMe This is okay but Flow doesn't know it.
590
- var has = Function.call.bind(hasOwnProperty);
591
- for (var typeSpecName in typeSpecs) {
592
- if (has(typeSpecs, typeSpecName)) {
593
- var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
594
- // fail the render phase where it didn't fail before. So we log it.
595
- // After these have been cleaned up, we'll let them throw.
596
-
597
- try {
598
- // This is intentionally an invariant that gets caught. It's the same
599
- // behavior as without this statement except with a better message.
600
- if (typeof typeSpecs[typeSpecName] !== 'function') {
601
- // eslint-disable-next-line react-internal/prod-error-codes
602
- 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`.');
603
- err.name = 'Invariant Violation';
604
- throw err;
605
- }
606
- error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
607
- } catch (ex) {
608
- error$1 = ex;
609
- }
610
- if (error$1 && !(error$1 instanceof Error)) {
611
- setCurrentlyValidatingElement(element);
612
- 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));
613
- setCurrentlyValidatingElement(null);
614
- }
615
- if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
616
- // Only monitor this failure once because there tends to be a lot of the
617
- // same error.
618
- loggedTypeFailures[error$1.message] = true;
619
- setCurrentlyValidatingElement(element);
620
- error('Failed %s type: %s', location, error$1.message);
621
- setCurrentlyValidatingElement(null);
622
- }
623
- }
624
- }
625
- }
626
- }
627
- var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
628
-
629
- function isArray(a) {
630
- return isArrayImpl(a);
631
- }
632
-
633
- /*
634
- * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
635
- * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
636
- *
637
- * The functions in this module will throw an easier-to-understand,
638
- * easier-to-debug exception with a clear errors message message explaining the
639
- * problem. (Instead of a confusing exception thrown inside the implementation
640
- * of the `value` object).
641
- */
642
- // $FlowFixMe only called in DEV, so void return is not possible.
643
- function typeName(value) {
644
- {
645
- // toStringTag is needed for namespaced types like Temporal.Instant
646
- var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
647
- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
648
- return type;
649
- }
650
- } // $FlowFixMe only called in DEV, so void return is not possible.
651
-
652
- function willCoercionThrow(value) {
653
- {
76
+ case REACT_MEMO_TYPE:
77
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
78
+ case REACT_LAZY_TYPE:
79
+ innerType = type._payload;
80
+ type = type._init;
654
81
  try {
655
- testStringCoercion(value);
656
- return false;
657
- } catch (e) {
658
- return true;
659
- }
660
- }
82
+ return getComponentNameFromType(type(innerType));
83
+ } catch (x) {}
661
84
  }
662
- function testStringCoercion(value) {
663
- // If you ended up here by following an exception call stack, here's what's
664
- // happened: you supplied an object or symbol value to React (as a prop, key,
665
- // DOM attribute, CSS property, string ref, etc.) and when React tried to
666
- // coerce it to a string using `'' + value`, an exception was thrown.
667
- //
668
- // The most common types that will cause this exception are `Symbol` instances
669
- // and Temporal objects like `Temporal.Instant`. But any object that has a
670
- // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
671
- // exception. (Library authors do this to prevent users from using built-in
672
- // numeric operators like `+` or comparison operators like `>=` because custom
673
- // methods are needed to perform accurate arithmetic or comparison.)
674
- //
675
- // To fix the problem, coerce this object or symbol value to a string before
676
- // passing it to React. The most reliable way is usually `String(value)`.
677
- //
678
- // To find which value is throwing, check the browser or debugger console.
679
- // Before this exception was thrown, there should be `console.error` output
680
- // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
681
- // problem and how that type was used: key, atrribute, input value prop, etc.
682
- // In most cases, this console output also shows the component and its
683
- // ancestor components where the exception happened.
684
- //
685
- // eslint-disable-next-line react-internal/safe-string-coercion
686
- return '' + value;
687
- }
688
- function checkKeyStringCoercion(value) {
689
- {
690
- if (willCoercionThrow(value)) {
691
- error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
692
- return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
693
- }
694
- }
695
- }
696
- var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
697
- var RESERVED_PROPS = {
698
- key: true,
699
- ref: true,
700
- __self: true,
701
- __source: true
702
- };
703
- var specialPropKeyWarningShown;
704
- var specialPropRefWarningShown;
705
- var didWarnAboutStringRefs;
706
- {
707
- didWarnAboutStringRefs = {};
708
- }
709
- function hasValidRef(config) {
710
- {
711
- if (hasOwnProperty.call(config, 'ref')) {
712
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
713
- if (getter && getter.isReactWarning) {
714
- return false;
715
- }
716
- }
717
- }
718
- return config.ref !== undefined;
85
+ return null;
86
+ }
87
+ function testStringCoercion(value) {
88
+ return "" + value;
89
+ }
90
+ function checkKeyStringCoercion(value) {
91
+ try {
92
+ testStringCoercion(value);
93
+ var JSCompiler_inline_result = !1;
94
+ } catch (e) {
95
+ JSCompiler_inline_result = !0;
719
96
  }
720
- function hasValidKey(config) {
721
- {
722
- if (hasOwnProperty.call(config, 'key')) {
723
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
724
- if (getter && getter.isReactWarning) {
725
- return false;
726
- }
727
- }
728
- }
729
- return config.key !== undefined;
97
+ if (JSCompiler_inline_result) {
98
+ JSCompiler_inline_result = console;
99
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
100
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
101
+ 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);
102
+ return testStringCoercion(value);
730
103
  }
731
- function warnIfStringRefCannotBeAutoConverted(config, self) {
732
- {
733
- if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
734
- var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
735
- if (!didWarnAboutStringRefs[componentName]) {
736
- 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);
737
- didWarnAboutStringRefs[componentName] = true;
738
- }
739
- }
740
- }
104
+ }
105
+ function getTaskName(type) {
106
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
107
+ if ("object" === _typeof(type) && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
108
+ try {
109
+ var name = getComponentNameFromType(type);
110
+ return name ? "<" + name + ">" : "<...>";
111
+ } catch (x) {
112
+ return "<...>";
741
113
  }
742
- function defineKeyPropWarningGetter(props, displayName) {
743
- {
744
- var warnAboutAccessingKey = function warnAboutAccessingKey() {
745
- if (!specialPropKeyWarningShown) {
746
- specialPropKeyWarningShown = true;
747
- 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);
748
- }
749
- };
750
- warnAboutAccessingKey.isReactWarning = true;
751
- Object.defineProperty(props, 'key', {
752
- get: warnAboutAccessingKey,
753
- configurable: true
754
- });
755
- }
114
+ }
115
+ function getOwner() {
116
+ var dispatcher = ReactSharedInternals.A;
117
+ return null === dispatcher ? null : dispatcher.getOwner();
118
+ }
119
+ function UnknownOwner() {
120
+ return Error("react-stack-top-frame");
121
+ }
122
+ function hasValidKey(config) {
123
+ if (hasOwnProperty.call(config, "key")) {
124
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
125
+ if (getter && getter.isReactWarning) return !1;
756
126
  }
757
- function defineRefPropWarningGetter(props, displayName) {
758
- {
759
- var warnAboutAccessingRef = function warnAboutAccessingRef() {
760
- if (!specialPropRefWarningShown) {
761
- specialPropRefWarningShown = true;
762
- 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);
763
- }
764
- };
765
- warnAboutAccessingRef.isReactWarning = true;
766
- Object.defineProperty(props, 'ref', {
767
- get: warnAboutAccessingRef,
768
- configurable: true
769
- });
770
- }
127
+ return void 0 !== config.key;
128
+ }
129
+ function defineKeyPropWarningGetter(props, displayName) {
130
+ function warnAboutAccessingKey() {
131
+ 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));
771
132
  }
772
- /**
773
- * Factory method to create a new React element. This no longer adheres to
774
- * the class pattern, so do not use new to call it. Also, instanceof check
775
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
776
- * if something is a React Element.
777
- *
778
- * @param {*} type
779
- * @param {*} props
780
- * @param {*} key
781
- * @param {string|object} ref
782
- * @param {*} owner
783
- * @param {*} self A *temporary* helper to detect places where `this` is
784
- * different from the `owner` when React.createElement is called, so that we
785
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
786
- * functions, and as long as `this` and owner are the same, there will be no
787
- * change in behavior.
788
- * @param {*} source An annotation object (added by a transpiler or otherwise)
789
- * indicating filename, line number, and/or other information.
790
- * @internal
791
- */
792
-
793
- var ReactElement = function ReactElement(type, key, ref, self, source, owner, props) {
794
- var element = {
795
- // This tag allows us to uniquely identify this as a React Element
796
- $$typeof: REACT_ELEMENT_TYPE,
797
- // Built-in properties that belong on the element
798
- type: type,
799
- key: key,
800
- ref: ref,
801
- props: props,
802
- // Record the component responsible for creating this element.
803
- _owner: owner
804
- };
805
- {
806
- // The validation flag is currently mutative. We put it on
807
- // an external backing store so that we can freeze the whole object.
808
- // This can be replaced with a WeakMap once they are implemented in
809
- // commonly used development environments.
810
- element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
811
- // the validation flag non-enumerable (where possible, which should
812
- // include every environment we run tests in), so the test framework
813
- // ignores it.
814
-
815
- Object.defineProperty(element._store, 'validated', {
816
- configurable: false,
817
- enumerable: false,
818
- writable: true,
819
- value: false
820
- }); // self and source are DEV only properties.
821
-
822
- Object.defineProperty(element, '_self', {
823
- configurable: false,
824
- enumerable: false,
825
- writable: false,
826
- value: self
827
- }); // Two elements created in two different places should be considered
828
- // equal for testing purposes and therefore we hide it from enumeration.
829
-
830
- Object.defineProperty(element, '_source', {
831
- configurable: false,
832
- enumerable: false,
833
- writable: false,
834
- value: source
835
- });
836
- if (Object.freeze) {
837
- Object.freeze(element.props);
838
- Object.freeze(element);
839
- }
840
- }
841
- return element;
133
+ warnAboutAccessingKey.isReactWarning = !0;
134
+ Object.defineProperty(props, "key", {
135
+ get: warnAboutAccessingKey,
136
+ configurable: !0
137
+ });
138
+ }
139
+ function elementRefGetterWithDeprecationWarning() {
140
+ var componentName = getComponentNameFromType(this.type);
141
+ 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."));
142
+ componentName = this.props.ref;
143
+ return void 0 !== componentName ? componentName : null;
144
+ }
145
+ function ReactElement(type, key, self, source, owner, props, debugStack, debugTask) {
146
+ self = props.ref;
147
+ type = {
148
+ $$typeof: REACT_ELEMENT_TYPE,
149
+ type: type,
150
+ key: key,
151
+ props: props,
152
+ _owner: owner
842
153
  };
843
- /**
844
- * https://github.com/reactjs/rfcs/pull/107
845
- * @param {*} type
846
- * @param {object} props
847
- * @param {string} key
848
- */
849
-
850
- function jsxDEV(type, config, maybeKey, source, self) {
851
- {
852
- var propName; // Reserved names are extracted
853
-
854
- var props = {};
855
- var key = null;
856
- var ref = null; // Currently, key can be spread in as a prop. This causes a potential
857
- // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
858
- // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
859
- // but as an intermediary step, we will use jsxDEV for everything except
860
- // <div {...props} key="Hi" />, because we aren't currently able to tell if
861
- // key is explicitly declared to be undefined or not.
862
-
863
- if (maybeKey !== undefined) {
864
- {
865
- checkKeyStringCoercion(maybeKey);
866
- }
867
- key = '' + maybeKey;
868
- }
869
- if (hasValidKey(config)) {
870
- {
871
- checkKeyStringCoercion(config.key);
872
- }
873
- key = '' + config.key;
874
- }
875
- if (hasValidRef(config)) {
876
- ref = config.ref;
877
- warnIfStringRefCannotBeAutoConverted(config, self);
878
- } // Remaining properties are added to a new props object
879
-
880
- for (propName in config) {
881
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
882
- props[propName] = config[propName];
883
- }
884
- } // Resolve default props
885
-
886
- if (type && type.defaultProps) {
887
- var defaultProps = type.defaultProps;
888
- for (propName in defaultProps) {
889
- if (props[propName] === undefined) {
890
- props[propName] = defaultProps[propName];
891
- }
892
- }
893
- }
894
- if (key || ref) {
895
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
896
- if (key) {
897
- defineKeyPropWarningGetter(props, displayName);
898
- }
899
- if (ref) {
900
- defineRefPropWarningGetter(props, displayName);
901
- }
902
- }
903
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
904
- }
905
- }
906
- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
907
- var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
908
- function setCurrentlyValidatingElement$1(element) {
909
- {
910
- if (element) {
911
- var owner = element._owner;
912
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
913
- ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
914
- } else {
915
- ReactDebugCurrentFrame$1.setExtraStackFrame(null);
916
- }
917
- }
918
- }
919
- var propTypesMisspellWarningShown;
920
- {
921
- propTypesMisspellWarningShown = false;
922
- }
923
- /**
924
- * Verifies the object is a ReactElement.
925
- * See https://reactjs.org/docs/react-api.html#isvalidelement
926
- * @param {?object} object
927
- * @return {boolean} True if `object` is a ReactElement.
928
- * @final
929
- */
930
-
931
- function isValidElement(object) {
932
- {
933
- return _typeof(object) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
934
- }
935
- }
936
- function getDeclarationErrorAddendum() {
937
- {
938
- if (ReactCurrentOwner$1.current) {
939
- var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
940
- if (name) {
941
- return '\n\nCheck the render method of `' + name + '`.';
942
- }
943
- }
944
- return '';
945
- }
946
- }
947
- function getSourceInfoErrorAddendum(source) {
948
- {
949
- if (source !== undefined) {
950
- var fileName = source.fileName.replace(/^.*[\\\/]/, '');
951
- var lineNumber = source.lineNumber;
952
- return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
953
- }
954
- return '';
955
- }
956
- }
957
- /**
958
- * Warn if there's no key explicitly set on dynamic arrays of children or
959
- * object keys are not valid. This allows us to keep track of children between
960
- * updates.
961
- */
962
-
963
- var ownerHasKeyUseWarning = {};
964
- function getCurrentComponentErrorInfo(parentType) {
965
- {
966
- var info = getDeclarationErrorAddendum();
967
- if (!info) {
968
- var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
969
- if (parentName) {
970
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
971
- }
972
- }
973
- return info;
974
- }
975
- }
976
- /**
977
- * Warn if the element doesn't have an explicit key assigned to it.
978
- * This element is in an array. The array could grow and shrink or be
979
- * reordered. All children that haven't already been validated are required to
980
- * have a "key" property assigned to it. Error statuses are cached so a warning
981
- * will only be shown once.
982
- *
983
- * @internal
984
- * @param {ReactElement} element Element that requires a key.
985
- * @param {*} parentType element's parent's type.
986
- */
987
-
988
- function validateExplicitKey(element, parentType) {
989
- {
990
- if (!element._store || element._store.validated || element.key != null) {
991
- return;
992
- }
993
- element._store.validated = true;
994
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
995
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
996
- return;
997
- }
998
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
999
- // property, it may be the creator of the child that's responsible for
1000
- // assigning it a key.
1001
-
1002
- var childOwner = '';
1003
- if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
1004
- // Give the component that originally created this child.
1005
- childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
1006
- }
1007
- setCurrentlyValidatingElement$1(element);
1008
- 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);
1009
- setCurrentlyValidatingElement$1(null);
1010
- }
1011
- }
1012
- /**
1013
- * Ensure that every element either is passed in a static location, in an
1014
- * array with an explicit keys property defined, or in an object literal
1015
- * with valid key property.
1016
- *
1017
- * @internal
1018
- * @param {ReactNode} node Statically passed child of any type.
1019
- * @param {*} parentType node's parent's type.
1020
- */
1021
-
1022
- function validateChildKeys(node, parentType) {
1023
- {
1024
- if (_typeof(node) !== 'object') {
1025
- return;
1026
- }
1027
- if (isArray(node)) {
1028
- for (var i = 0; i < node.length; i++) {
1029
- var child = node[i];
1030
- if (isValidElement(child)) {
1031
- validateExplicitKey(child, parentType);
1032
- }
1033
- }
1034
- } else if (isValidElement(node)) {
1035
- // This element was passed in a valid location.
1036
- if (node._store) {
1037
- node._store.validated = true;
1038
- }
1039
- } else if (node) {
1040
- var iteratorFn = getIteratorFn(node);
1041
- if (typeof iteratorFn === 'function') {
1042
- // Entry iterators used to provide implicit keys,
1043
- // but now we print a separate warning for them later.
1044
- if (iteratorFn !== node.entries) {
1045
- var iterator = iteratorFn.call(node);
1046
- var step;
1047
- while (!(step = iterator.next()).done) {
1048
- if (isValidElement(step.value)) {
1049
- validateExplicitKey(step.value, parentType);
1050
- }
1051
- }
1052
- }
1053
- }
1054
- }
1055
- }
1056
- }
1057
- /**
1058
- * Given an element, validate that its props follow the propTypes definition,
1059
- * provided by the type.
1060
- *
1061
- * @param {ReactElement} element
1062
- */
1063
-
1064
- function validatePropTypes(element) {
1065
- {
1066
- var type = element.type;
1067
- if (type === null || type === undefined || typeof type === 'string') {
1068
- return;
1069
- }
1070
- var propTypes;
1071
- if (typeof type === 'function') {
1072
- propTypes = type.propTypes;
1073
- } else if (_typeof(type) === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
1074
- // Note: Memo only checks outer props here.
1075
- // Inner props are checked in the reconciler.
1076
- type.$$typeof === REACT_MEMO_TYPE)) {
1077
- propTypes = type.propTypes;
1078
- } else {
1079
- return;
1080
- }
1081
- if (propTypes) {
1082
- // Intentionally inside to avoid triggering lazy initializers:
1083
- var name = getComponentNameFromType(type);
1084
- checkPropTypes(propTypes, element.props, 'prop', name, element);
1085
- } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
1086
- propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
1087
-
1088
- var _name = getComponentNameFromType(type);
1089
- error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
1090
- }
1091
- if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
1092
- error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
1093
- }
1094
- }
1095
- }
1096
- /**
1097
- * Given a fragment, validate that it can only be provided with fragment props
1098
- * @param {ReactElement} fragment
1099
- */
1100
-
1101
- function validateFragmentProps(fragment) {
1102
- {
1103
- var keys = Object.keys(fragment.props);
1104
- for (var i = 0; i < keys.length; i++) {
1105
- var key = keys[i];
1106
- if (key !== 'children' && key !== 'key') {
1107
- setCurrentlyValidatingElement$1(fragment);
1108
- error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
1109
- setCurrentlyValidatingElement$1(null);
1110
- break;
1111
- }
1112
- }
1113
- if (fragment.ref !== null) {
1114
- setCurrentlyValidatingElement$1(fragment);
1115
- error('Invalid attribute `ref` supplied to `React.Fragment`.');
1116
- setCurrentlyValidatingElement$1(null);
1117
- }
1118
- }
1119
- }
1120
- function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
1121
- {
1122
- var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
1123
- // succeed and there will likely be errors in render.
1124
-
1125
- if (!validType) {
1126
- var info = '';
1127
- if (type === undefined || _typeof(type) === 'object' && type !== null && Object.keys(type).length === 0) {
1128
- 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.";
1129
- }
1130
- var sourceInfo = getSourceInfoErrorAddendum(source);
1131
- if (sourceInfo) {
1132
- info += sourceInfo;
1133
- } else {
1134
- info += getDeclarationErrorAddendum();
1135
- }
1136
- var typeString;
1137
- if (type === null) {
1138
- typeString = 'null';
1139
- } else if (isArray(type)) {
1140
- typeString = 'array';
1141
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
1142
- typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
1143
- info = ' Did you accidentally export a JSX literal instead of a component?';
1144
- } else {
1145
- typeString = _typeof(type);
1146
- }
1147
- 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);
1148
- }
1149
- var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
1150
- // TODO: Drop this when these are no longer allowed as the type argument.
1151
-
1152
- if (element == null) {
1153
- return element;
1154
- } // Skip key warning if the type isn't valid since our key validation logic
1155
- // doesn't expect a non-string/function type and can throw confusing errors.
1156
- // We don't want exception behavior to differ between dev and prod.
1157
- // (Rendering will throw with a helpful message and as soon as the type is
1158
- // fixed, the key warnings will appear.)
1159
-
1160
- if (validType) {
1161
- var children = props.children;
1162
- if (children !== undefined) {
1163
- if (isStaticChildren) {
1164
- if (isArray(children)) {
1165
- for (var i = 0; i < children.length; i++) {
1166
- validateChildKeys(children[i], type);
1167
- }
1168
- if (Object.freeze) {
1169
- Object.freeze(children);
1170
- }
1171
- } else {
1172
- 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.');
1173
- }
1174
- } else {
1175
- validateChildKeys(children, type);
1176
- }
1177
- }
1178
- }
1179
- if (type === REACT_FRAGMENT_TYPE) {
1180
- validateFragmentProps(element);
1181
- } else {
1182
- validatePropTypes(element);
1183
- }
1184
- return element;
1185
- }
1186
- } // These two functions exist to still get child warnings in dev
1187
- // even with the prod transform. This means that jsxDEV is purely
1188
- // opt-in behavior for better messages but that we won't stop
1189
- // giving you warnings if you use production apis.
1190
-
1191
- function jsxWithValidationStatic(type, props, key) {
1192
- {
1193
- return jsxWithValidation(type, props, key, true);
1194
- }
154
+ null !== (void 0 !== self ? self : null) ? Object.defineProperty(type, "ref", {
155
+ enumerable: !1,
156
+ get: elementRefGetterWithDeprecationWarning
157
+ }) : Object.defineProperty(type, "ref", {
158
+ enumerable: !1,
159
+ value: null
160
+ });
161
+ type._store = {};
162
+ Object.defineProperty(type._store, "validated", {
163
+ configurable: !1,
164
+ enumerable: !1,
165
+ writable: !0,
166
+ value: 0
167
+ });
168
+ Object.defineProperty(type, "_debugInfo", {
169
+ configurable: !1,
170
+ enumerable: !1,
171
+ writable: !0,
172
+ value: null
173
+ });
174
+ Object.defineProperty(type, "_debugStack", {
175
+ configurable: !1,
176
+ enumerable: !1,
177
+ writable: !0,
178
+ value: debugStack
179
+ });
180
+ Object.defineProperty(type, "_debugTask", {
181
+ configurable: !1,
182
+ enumerable: !1,
183
+ writable: !0,
184
+ value: debugTask
185
+ });
186
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
187
+ return type;
188
+ }
189
+ function jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self, debugStack, debugTask) {
190
+ var children = config.children;
191
+ if (void 0 !== children) if (isStaticChildren) {
192
+ if (isArrayImpl(children)) {
193
+ for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++) validateChildKeys(children[isStaticChildren]);
194
+ Object.freeze && Object.freeze(children);
195
+ } 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.");
196
+ } else validateChildKeys(children);
197
+ if (hasOwnProperty.call(config, "key")) {
198
+ children = getComponentNameFromType(type);
199
+ var keys = Object.keys(config).filter(function (k) {
200
+ return "key" !== k;
201
+ });
202
+ isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
203
+ 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);
1195
204
  }
1196
- function jsxWithValidationDynamic(type, props, key) {
1197
- {
1198
- return jsxWithValidation(type, props, key, false);
1199
- }
205
+ children = null;
206
+ void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
207
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
208
+ if ("key" in config) {
209
+ maybeKey = {};
210
+ for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
211
+ } else maybeKey = config;
212
+ children && defineKeyPropWarningGetter(maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
213
+ return ReactElement(type, children, self, source, getOwner(), maybeKey, debugStack, debugTask);
214
+ }
215
+ function validateChildKeys(node) {
216
+ "object" === _typeof(node) && null !== node && node.$$typeof === REACT_ELEMENT_TYPE && node._store && (node._store.validated = 1);
217
+ }
218
+ var React = React__default,
219
+ REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
220
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
221
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
222
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
223
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler");
224
+ var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
225
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
226
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
227
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
228
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
229
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
230
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
231
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
232
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
233
+ ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
234
+ hasOwnProperty = Object.prototype.hasOwnProperty,
235
+ isArrayImpl = Array.isArray,
236
+ createTask = console.createTask ? console.createTask : function () {
237
+ return null;
238
+ };
239
+ React = {
240
+ "react-stack-bottom-frame": function reactStackBottomFrame(callStackForError) {
241
+ return callStackForError();
1200
242
  }
1201
- var jsx = jsxWithValidationDynamic; // we may want to special case jsxs internally to take advantage of static children.
1202
- // for now we can ship identical prod functions
1203
-
1204
- var jsxs = jsxWithValidationStatic;
1205
- reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
1206
- reactJsxRuntime_development.jsx = jsx;
1207
- reactJsxRuntime_development.jsxs = jsxs;
1208
- })();
1209
- }
243
+ };
244
+ var specialPropKeyWarningShown;
245
+ var didWarnAboutElementRef = {};
246
+ var unknownOwnerDebugStack = React["react-stack-bottom-frame"].bind(React, UnknownOwner)();
247
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
248
+ var didWarnAboutKeySpread = {};
249
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
250
+ reactJsxRuntime_development.jsx = function (type, config, maybeKey, source, self) {
251
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
252
+ return jsxDEVImpl(type, config, maybeKey, !1, source, self, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
253
+ };
254
+ reactJsxRuntime_development.jsxs = function (type, config, maybeKey, source, self) {
255
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
256
+ return jsxDEVImpl(type, config, maybeKey, !0, source, self, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
257
+ };
258
+ })();
1210
259
  return reactJsxRuntime_development;
1211
260
  }
1212
261
 
@@ -1697,14 +746,14 @@ const Input = (_a) => {
1697
746
  var { additional, addonBefore, addonAfter, labelText, children, components: componentsOverride = {},
1698
747
  //className,
1699
748
  // iconDescription,
1700
- id, className, calculatedId, inputWrapperClassName,
749
+ id, className, inputWrapperClassName,
1701
750
  //placeholder,
1702
751
  //type,
1703
752
  //onChange,
1704
753
  //onClick,
1705
- 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"]);
754
+ 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"]);
1706
755
  const { prefix } = useSettings();
1707
- // const calculatedId = id ? id : name;
756
+ const calculatedId = id ? id : name;
1708
757
  /* const inputProps = {
1709
758
  id: calculatedId,
1710
759
  onChange: (evt) => {
@@ -1784,9 +833,10 @@ const useInput = (_a) => {
1784
833
  }, placeholder,
1785
834
  value,
1786
835
  type });
1787
- console.log("useInput", { calculatedId });
1788
836
  const wrapperProps = {
1789
837
  calculatedId,
838
+ id,
839
+ name,
1790
840
  className,
1791
841
  addonAfter,
1792
842
  labelText,
@@ -1839,7 +889,7 @@ const Search = React.forwardRef((props, ref) => {
1839
889
  onChange(evt, evt.target.value); //TODO: why are we passing evt as second arg
1840
890
  }
1841
891
  };
1842
- const clearSearch = () => {
892
+ const clearSearch = (evt) => {
1843
893
  setValue("");
1844
894
  // setTimeout(() => {
1845
895
  // console.log("value", value);
@@ -2434,10 +1484,10 @@ const ContextMenuItem = (_a) => {
2434
1484
  return jsxRuntimeExports.jsx("div", Object.assign({ className: classes }, other));
2435
1485
  };
2436
1486
 
2437
- const Footer = ({ className, children, labelOne, linkTextOne, linkHrefOne, labelTwo, linkTextTwo, linkHrefTwo, logo, logoExtended, metaContent, metaLinks, secondary, pageWidth = "lg", }) => {
1487
+ const Footer = ({ className, children, labelOne, linkTextOne, linkHrefOne, labelTwo, linkTextTwo, linkHrefTwo, logo, metaContent, metaLinks, secondary, pageWidth = "lg", }) => {
2438
1488
  const { prefix } = useSettings();
2439
1489
  const classes = classNames(`${prefix}--footer`, className);
2440
- 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(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(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 })))] }))] })));
1490
+ 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 })))] }))] })));
2441
1491
  };
2442
1492
  Footer.displayName = "Footer";
2443
1493
 
@@ -2628,163 +1678,10 @@ const MainNavigation = ({ children, components: componentsOverride = {}, classNa
2628
1678
  toggleMenu,
2629
1679
  onChangeSub,
2630
1680
  setOpenMobileMenu,
2631
- } }, { 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(WfpLogoVerticalEn, { description: "WFP" }) })), logo] }))) : logoRibbon === "offShelf" ? (jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation__logo__offShelf` }, { children: [jsxRuntimeExports.jsx(WfpLogoStandardBlackEn, { description: "WFP" }), logo] }))) : (logo) }))] })), jsxRuntimeExports.jsx("ul", Object.assign({ className: listClasses }, { children: children }))] })) })) })));
1681
+ } }, { 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 }))] })) })) })));
2632
1682
  };
2633
1683
  MainNavigation.displayName = "MainNavigation";
2634
1684
 
2635
- /** The User is used inside the MainNavigation and form, and can display an avatar and username. */
2636
- const User = (props) => {
2637
- 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"]);
2638
- const { prefix } = useSettings();
2639
- const defaultComponents = { Avatar };
2640
- const allComponents = Object.assign(Object.assign({}, defaultComponents), components);
2641
- const classes = classNames(`${prefix}--user`, className, {
2642
- [`${prefix}--user--has-description`]: description,
2643
- [`${prefix}--user--has-extended-description`]: extendedDescription,
2644
- });
2645
- const titleClasses = classNames({
2646
- [`${prefix}--user__title`]: true,
2647
- [`${prefix}--user__title--ellipsis`]: ellipsis,
2648
- [`${prefix}--user__title--small`]: small,
2649
- });
2650
- 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 })))] })));
2651
- };
2652
-
2653
- /**
2654
- * useTogglable(): hook used to open/close boolean state.
2655
- */
2656
- var useTogglable = function useTogglable() {
2657
- var _useState = useState(false),
2658
- _useState2 = _slicedToArray(_useState, 2),
2659
- isOpen = _useState2[0],
2660
- setState = _useState2[1];
2661
- var open = function open() {
2662
- return setState(true);
2663
- };
2664
- var close = function close() {
2665
- return setState(false);
2666
- };
2667
- return {
2668
- isOpen: isOpen,
2669
- open: open,
2670
- close: close
2671
- };
2672
- };
2673
-
2674
- const LanguageExternal = ({ children, primaryLanguage }) => {
2675
- const { prefix } = useSettings();
2676
- const ref = useRef(null);
2677
- const languageTogglable = useTogglable();
2678
- useEffect(() => {
2679
- const checkIfClickedOutside = (e) => {
2680
- // If the menu is open and the clicked target is not within the menu,
2681
- // then close the menu
2682
- if (languageTogglable.isOpen &&
2683
- ref.current &&
2684
- !ref.current.contains(e.target)) {
2685
- languageTogglable.close();
2686
- }
2687
- };
2688
- document.addEventListener("mousedown", checkIfClickedOutside);
2689
- return () => {
2690
- // Cleanup the event listener
2691
- document.removeEventListener("mousedown", checkIfClickedOutside);
2692
- };
2693
- }, [languageTogglable.isOpen]);
2694
- 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
2695
- ? languageTogglable.close()
2696
- : languageTogglable.open() }, { children: [jsxRuntimeExports.jsx("span", { children: primaryLanguage }), languageTogglable.isOpen ? jsxRuntimeExports.jsx(ChevronUp, {}) : jsxRuntimeExports.jsx(ChevronDown, {})] })), jsxRuntimeExports.jsx("ul", Object.assign({ className: `${prefix}--language-ext__dropdown ${languageTogglable.isOpen
2697
- ? `${prefix}--language-ext__dropdown--is-shown`
2698
- : ""}` }, { children: children }))] })));
2699
- };
2700
- const UserExternal = ({ username, children, userImage }) => {
2701
- const { prefix } = useSettings();
2702
- const ref = useRef(null);
2703
- const userTogglable = useTogglable();
2704
- useEffect(() => {
2705
- const checkIfClickedOutside = (e) => {
2706
- // If the menu is open and the clicked target is not within the menu,
2707
- // then close the menu
2708
- if (userTogglable.isOpen &&
2709
- (ref === null || ref === void 0 ? void 0 : ref.current) &&
2710
- !ref.current.contains(e.target)) {
2711
- userTogglable.close();
2712
- }
2713
- };
2714
- document.addEventListener("mousedown", checkIfClickedOutside);
2715
- return () => {
2716
- // Cleanup the event listener
2717
- document.removeEventListener("mousedown", checkIfClickedOutside);
2718
- };
2719
- }, [userTogglable.isOpen]);
2720
- 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(ChevronUp, {}) : jsxRuntimeExports.jsx(ChevronDown, {})] })), jsxRuntimeExports.jsx("ul", Object.assign({ className: `${prefix}--user-ext__dropdown ${userTogglable.isOpen ? `${prefix}--user-ext__dropdown--is-shown` : ""}` }, { children: children }))] })));
2721
- };
2722
- const MainNavigationExternal = ({ productName, primaryLanguage, languageList, username, pageWidth = "full", components = {}, userImage, userDetails, children, }) => {
2723
- const { prefix } = useSettings();
2724
- const ref = useRef(null);
2725
- const navTogglable = useTogglable();
2726
- useEffect(() => {
2727
- const checkIfClickedOutside = (e) => {
2728
- // If the menu is open and the clicked target is not within the menu,
2729
- // then close the menu
2730
- if (navTogglable.isOpen &&
2731
- ref.current &&
2732
- !ref.current.contains(e.target)) {
2733
- navTogglable.close();
2734
- }
2735
- };
2736
- document.addEventListener("mousedown", checkIfClickedOutside);
2737
- return () => {
2738
- // Cleanup the event listener
2739
- document.removeEventListener("mousedown", checkIfClickedOutside);
2740
- };
2741
- }, [navTogglable.isOpen]);
2742
- const defaultComponents = {
2743
- LanguageExternal,
2744
- UserExternal,
2745
- };
2746
- const c = Object.assign(Object.assign({}, defaultComponents), components);
2747
- 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(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
2748
- ? navTogglable.close()
2749
- : navTogglable.open() }, { children: "Menu" })) })), jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--main-navigation-ext__nav-wrapper
2750
- ${navTogglable.isOpen ? "wfp--main-navigation-ext--is-shown" : ""}` }, { children: jsxRuntimeExports.jsx("nav", Object.assign({ className: `${prefix}--main-navigation-ext__site-nav ${navTogglable.isOpen
2751
- ? "wfp--main-navigation-ext--is-shown"
2752
- : ""}` }, { 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 })) }))] }))] })) })) }))] }))] }))] })) })));
2753
- };
2754
- MainNavigationExternal.propTypes = {
2755
- /**
2756
- * The name of your product can be applied to this prop
2757
- */
2758
- productName: PropTypes.node,
2759
- /**
2760
- * The CSS class name to be placed on the wrapping element.
2761
- */
2762
- className: PropTypes.string,
2763
- /**
2764
- * List of laguages your site support
2765
- */
2766
- languageList: PropTypes.node,
2767
- /**
2768
- * The name of signed in user can be applied to this prop
2769
- */
2770
- username: PropTypes.node,
2771
- /**
2772
- * The image of signed in user can be applied to this prop
2773
- */
2774
- userImage: PropTypes.string,
2775
- /**
2776
- * The dropdown details of user can be applied to this prop
2777
- */
2778
- userDetails: PropTypes.node,
2779
- /**
2780
- * This prop accepts the first language your website is in. Default: English
2781
- */
2782
- primaryLanguage: PropTypes.string,
2783
- };
2784
- MainNavigationExternal.defaultProps = {
2785
- primaryLanguage: "English",
2786
- };
2787
-
2788
1685
  /** The useMainNavigation() is a hook to access the current state of the MainNavigation and manipulate it. */
2789
1686
  function useMainNavigation() {
2790
1687
  const settings = useContext(MainNavigationContext);
@@ -4290,6 +3187,24 @@ const Toggle = React.forwardRef((props, ref) => {
4290
3187
  });
4291
3188
  Toggle.displayName = "Toggle";
4292
3189
 
3190
+ /** The User is used inside the MainNavigation and form, and can display an avatar and username. */
3191
+ const User = (props) => {
3192
+ 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"]);
3193
+ const { prefix } = useSettings();
3194
+ const defaultComponents = { Avatar };
3195
+ const allComponents = Object.assign(Object.assign({}, defaultComponents), components);
3196
+ const classes = classNames(`${prefix}--user`, className, {
3197
+ [`${prefix}--user--has-description`]: description,
3198
+ [`${prefix}--user--has-extended-description`]: extendedDescription,
3199
+ });
3200
+ const titleClasses = classNames({
3201
+ [`${prefix}--user__title`]: true,
3202
+ [`${prefix}--user__title--ellipsis`]: ellipsis,
3203
+ [`${prefix}--user__title--small`]: small,
3204
+ });
3205
+ 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 })))] })));
3206
+ };
3207
+
4293
3208
  const scaleLookup = {
4294
3209
  thousand: {
4295
3210
  pow: 1000,
@@ -5469,4 +4384,4 @@ function useMediaQuery(query, options) {
5469
4384
  return matches;
5470
4385
  }
5471
4386
 
5472
- export { Accordion, AccordionItem, AddonAfter, AddonBefore, AuthLayout, Avatar, BackgroundContent, BannerNavigation, BannerNavigationItem, BannerNavigationWithContent, Callout as BlockNotification, Breadcrumb, BreadcrumbHome, BreadcrumbItem, Button, Callout, Card, CardExternal, Checkbox, ContentSwitcher, ContextMenu, ContextMenuGroup, ContextMenuItem, Credits, DatePicker, DatePickerInput, DateRangePicker, DateRangePickerInput, Empty, Footer, FooterExternal, FooterMetaLink, Form, FormGroup, FormHint, FormItem, FormLabel, Helper, Hero, HeroExternal, InfoBar, InlineErrorMessage, InlineLoading, Input, InputGroup, Item, Label, Link, LinksColumn, List, ListItem, Loading, MainNavigation, MainNavigationContext, MainNavigationExternal, MainNavigationItem, Modal, ModalFooter, ModalWrapper, Module, ModuleBody, ModuleFooter, ModuleHeader, NotificationActionButton, NotificationButton, NotificationTextDetails, NumberInput, Pagination, RadioButton, ReadMore, Search, SecondaryNavigation, SecondaryNavigationTitle, Select, SelectItem, SelectItemGroup, Sidebar, SidebarBackButton, SidebarContentBody, SidebarContentHeader, SidebarHeader, SidebarScroll, SkeletonText, Slider, StepNavigation, StepNavigationItem, Story, SubNavigation, SubNavigationContent, SubNavigationFilter, SubNavigationGroup, SubNavigationHeader, SubNavigationItem, SubNavigationLink, SubNavigationList, SubNavigationTitle, Tab, TabContent, Table, ReactTablePagination as TablePagination, TableSorting$1 as TableSorting, Tabs, Tag, Text, TextArea, TextInput, ToastNotification, Toggle, Tooltip, Unit, User, Value, WFPCoreContext, WFPCoreProvider, Wrapper, buttonKinds, colors, settings as defaultWFPContext, mdxComponents, notificationtypes, pageWidths, tooltipStyle, tooltipStyleDark, uniqueId, useInput, useIsomorphicLayoutEffect, useMainNavigation, useMediaQuery, useTab, useTheme, withWFPCoreSettings };
4387
+ export { Accordion, AccordionItem, AddonAfter, AddonBefore, AuthLayout, Avatar, BackgroundContent, BannerNavigation, BannerNavigationItem, BannerNavigationWithContent, Callout as BlockNotification, Breadcrumb, BreadcrumbHome, BreadcrumbItem, Button, Callout, Card, CardExternal, Checkbox, ContentSwitcher, ContextMenu, ContextMenuGroup, ContextMenuItem, Credits, DatePicker, DatePickerInput, DateRangePicker, DateRangePickerInput, Empty, Footer, FooterExternal, FooterMetaLink, Form, FormGroup, FormHint, FormItem, FormLabel, Helper, Hero, HeroExternal, InfoBar, InlineErrorMessage, InlineLoading, Input, InputGroup, Item, Label, Link, LinksColumn, List, ListItem, Loading, MainNavigation, MainNavigationContext, MainNavigationItem, Modal, ModalFooter, ModalWrapper, Module, ModuleBody, ModuleFooter, ModuleHeader, NotificationActionButton, NotificationButton, NotificationTextDetails, NumberInput, Pagination, RadioButton, ReadMore, Search, SecondaryNavigation, SecondaryNavigationTitle, Select, SelectItem, SelectItemGroup, Sidebar, SidebarBackButton, SidebarContentBody, SidebarContentHeader, SidebarHeader, SidebarScroll, SkeletonText, Slider, StepNavigation, StepNavigationItem, Story, SubNavigation, SubNavigationContent, SubNavigationFilter, SubNavigationGroup, SubNavigationHeader, SubNavigationItem, SubNavigationLink, SubNavigationList, SubNavigationTitle, Tab, TabContent, Table, ReactTablePagination as TablePagination, TableSorting$1 as TableSorting, Tabs, Tag, Text, TextArea, TextInput, ToastNotification, Toggle, Tooltip, Unit, User, Value, WFPCoreContext, WFPCoreProvider, Wrapper, buttonKinds, colors, settings as defaultWFPContext, mdxComponents, notificationtypes, pageWidths, tooltipStyle, tooltipStyleDark, uniqueId, useInput, useIsomorphicLayoutEffect, useMainNavigation, useMediaQuery, useTab, useTheme, withWFPCoreSettings };