@redsift/design-system 12.6.6-alpha.2 → 13.0.0

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 (64) hide show
  1. package/CONTRIBUTING.md +20 -8
  2. package/_internal/AppContainer.js +1 -1
  3. package/_internal/AppContainer.js.map +1 -1
  4. package/_internal/Button2.js +1 -1
  5. package/_internal/Button2.js.map +1 -1
  6. package/_internal/Checkbox2.js +8 -3
  7. package/_internal/Checkbox2.js.map +1 -1
  8. package/_internal/DetailedCard.js +17 -1352
  9. package/_internal/DetailedCard.js.map +1 -1
  10. package/_internal/DetailedCardCollapsibleSectionItems.js +14 -4
  11. package/_internal/DetailedCardCollapsibleSectionItems.js.map +1 -1
  12. package/_internal/DetailedCardSection.js +4 -2
  13. package/_internal/DetailedCardSection.js.map +1 -1
  14. package/_internal/IconButton.js +1 -1
  15. package/_internal/IconButton.js.map +1 -1
  16. package/_internal/Item2.js +2 -2
  17. package/_internal/Item2.js.map +1 -1
  18. package/_internal/LinkButton.js +1 -1
  19. package/_internal/LinkButton.js.map +1 -1
  20. package/_internal/Listbox2.js +5 -5
  21. package/_internal/Listbox2.js.map +1 -1
  22. package/_internal/NumberField.js +2 -0
  23. package/_internal/NumberField.js.map +1 -1
  24. package/_internal/Radio2.js +14 -7
  25. package/_internal/Radio2.js.map +1 -1
  26. package/_internal/RadioGroup.js +6 -1
  27. package/_internal/RadioGroup.js.map +1 -1
  28. package/_internal/SideNavigationMenu.js +9 -4
  29. package/_internal/SideNavigationMenu.js.map +1 -1
  30. package/_internal/SideNavigationMenuItem.js +2 -2
  31. package/_internal/SideNavigationMenuItem.js.map +1 -1
  32. package/_internal/Switch2.js +8 -3
  33. package/_internal/Switch2.js.map +1 -1
  34. package/_internal/Tabs2.js.map +1 -1
  35. package/_internal/TextArea.js +5 -1
  36. package/_internal/TextArea.js.map +1 -1
  37. package/_internal/TextField.js +5 -1
  38. package/_internal/TextField.js.map +1 -1
  39. package/_internal/context.js.map +1 -1
  40. package/_internal/filterComponents.js +3 -0
  41. package/_internal/filterComponents.js.map +1 -1
  42. package/_internal/getElementRef.js +25 -0
  43. package/_internal/getElementRef.js.map +1 -0
  44. package/_internal/getTextWidth.js +32 -0
  45. package/_internal/getTextWidth.js.map +1 -0
  46. package/_internal/isComponent.js +3 -0
  47. package/_internal/isComponent.js.map +1 -1
  48. package/_internal/reactVersion.js +14 -0
  49. package/_internal/reactVersion.js.map +1 -0
  50. package/_internal/styles4.js +72 -72
  51. package/_internal/styles4.js.map +1 -1
  52. package/_internal/types.js.map +1 -1
  53. package/_internal/useFocusOnListItem.js +1 -1
  54. package/_internal/useFocusOnListItem.js.map +1 -1
  55. package/_internal/useId.js +1 -1
  56. package/_internal/useId.js.map +1 -1
  57. package/_internal/useListboxItem.js.map +1 -1
  58. package/_internal/useSideNavigationMenuBar.js +2 -2
  59. package/_internal/useSideNavigationMenuBar.js.map +1 -1
  60. package/_internal/warnIfNoAccessibleLabelFound.js.map +1 -1
  61. package/index.d.ts +48 -24
  62. package/index.js +3 -31
  63. package/index.js.map +1 -1
  64. package/package.json +18 -26
@@ -11,9 +11,11 @@ import { D as DetailedCardSection } from './DetailedCardSection.js';
11
11
  import { D as DetailedCardSectionItem } from './DetailedCardSectionItem.js';
12
12
  import { u as useMessageFormatter } from './useMessageFormatter.js';
13
13
  import { a as warnOnUnknownChildren } from './warnCompoundMisuse.js';
14
+ import { jsxs, jsx } from 'react/jsx-runtime';
14
15
  import * as ReactDOM from 'react-dom';
15
16
  import { u as useId$1 } from './useId.js';
16
17
  import { u as useTheme, a as ThemeProvider } from './useTheme.js';
18
+ import { g as getElementRef } from './getElementRef.js';
17
19
  import { i as getContainerStylingTransientProps, f as getStylingTransientProps } from './styles.js';
18
20
  import { A as AppContainerContext } from './context2.js';
19
21
  import { p as partitionComponents } from './partitionComponents.js';
@@ -492,1344 +494,6 @@ function rectToClientRect(rect) {
492
494
  };
493
495
  }
494
496
 
495
- var jsxRuntime = {exports: {}};
496
-
497
- var reactJsxRuntime_production_min = {};
498
-
499
- /**
500
- * @license React
501
- * react-jsx-runtime.production.min.js
502
- *
503
- * Copyright (c) Facebook, Inc. and its affiliates.
504
- *
505
- * This source code is licensed under the MIT license found in the
506
- * LICENSE file in the root directory of this source tree.
507
- */
508
- var f=React__default,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
509
- function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
510
-
511
- var reactJsxRuntime_development = {};
512
-
513
- /**
514
- * @license React
515
- * react-jsx-runtime.development.js
516
- *
517
- * Copyright (c) Facebook, Inc. and its affiliates.
518
- *
519
- * This source code is licensed under the MIT license found in the
520
- * LICENSE file in the root directory of this source tree.
521
- */
522
-
523
- if (process.env.NODE_ENV !== "production") {
524
- (function() {
525
-
526
- var React = React__default;
527
-
528
- // ATTENTION
529
- // When adding new symbols to this file,
530
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
531
- // The Symbol used to tag the ReactElement-like types.
532
- var REACT_ELEMENT_TYPE = Symbol.for('react.element');
533
- var REACT_PORTAL_TYPE = Symbol.for('react.portal');
534
- var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
535
- var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
536
- var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
537
- var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
538
- var REACT_CONTEXT_TYPE = Symbol.for('react.context');
539
- var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
540
- var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
541
- var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
542
- var REACT_MEMO_TYPE = Symbol.for('react.memo');
543
- var REACT_LAZY_TYPE = Symbol.for('react.lazy');
544
- var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
545
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
546
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
547
- function getIteratorFn(maybeIterable) {
548
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
549
- return null;
550
- }
551
-
552
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
553
-
554
- if (typeof maybeIterator === 'function') {
555
- return maybeIterator;
556
- }
557
-
558
- return null;
559
- }
560
-
561
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
562
-
563
- function error(format) {
564
- {
565
- {
566
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
567
- args[_key2 - 1] = arguments[_key2];
568
- }
569
-
570
- printWarning('error', format, args);
571
- }
572
- }
573
- }
574
-
575
- function printWarning(level, format, args) {
576
- // When changing this logic, you might want to also
577
- // update consoleWithStackDev.www.js as well.
578
- {
579
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
580
- var stack = ReactDebugCurrentFrame.getStackAddendum();
581
-
582
- if (stack !== '') {
583
- format += '%s';
584
- args = args.concat([stack]);
585
- } // eslint-disable-next-line react-internal/safe-string-coercion
586
-
587
-
588
- var argsWithFormat = args.map(function (item) {
589
- return String(item);
590
- }); // Careful: RN currently depends on this prefix
591
-
592
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
593
- // breaks IE9: https://github.com/facebook/react/issues/13610
594
- // eslint-disable-next-line react-internal/no-production-logging
595
-
596
- Function.prototype.apply.call(console[level], console, argsWithFormat);
597
- }
598
- }
599
-
600
- // -----------------------------------------------------------------------------
601
-
602
- var enableScopeAPI = false; // Experimental Create Event Handle API.
603
- var enableCacheElement = false;
604
- var enableTransitionTracing = false; // No known bugs, but needs performance testing
605
-
606
- var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
607
- // stuff. Intended to enable React core members to more easily debug scheduling
608
- // issues in DEV builds.
609
-
610
- var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
611
-
612
- var REACT_MODULE_REFERENCE;
613
-
614
- {
615
- REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
616
- }
617
-
618
- function isValidElementType(type) {
619
- if (typeof type === 'string' || typeof type === 'function') {
620
- return true;
621
- } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
622
-
623
-
624
- 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 ) {
625
- return true;
626
- }
627
-
628
- if (typeof type === 'object' && type !== null) {
629
- if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
630
- // types supported by any Flight configuration anywhere since
631
- // we don't know which Flight build this will end up being used
632
- // with.
633
- type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
634
- return true;
635
- }
636
- }
637
-
638
- return false;
639
- }
640
-
641
- function getWrappedName(outerType, innerType, wrapperName) {
642
- var displayName = outerType.displayName;
643
-
644
- if (displayName) {
645
- return displayName;
646
- }
647
-
648
- var functionName = innerType.displayName || innerType.name || '';
649
- return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
650
- } // Keep in sync with react-reconciler/getComponentNameFromFiber
651
-
652
-
653
- function getContextName(type) {
654
- return type.displayName || 'Context';
655
- } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
656
-
657
-
658
- function getComponentNameFromType(type) {
659
- if (type == null) {
660
- // Host root, text node or just invalid type.
661
- return null;
662
- }
663
-
664
- {
665
- if (typeof type.tag === 'number') {
666
- error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
667
- }
668
- }
669
-
670
- if (typeof type === 'function') {
671
- return type.displayName || type.name || null;
672
- }
673
-
674
- if (typeof type === 'string') {
675
- return type;
676
- }
677
-
678
- switch (type) {
679
- case REACT_FRAGMENT_TYPE:
680
- return 'Fragment';
681
-
682
- case REACT_PORTAL_TYPE:
683
- return 'Portal';
684
-
685
- case REACT_PROFILER_TYPE:
686
- return 'Profiler';
687
-
688
- case REACT_STRICT_MODE_TYPE:
689
- return 'StrictMode';
690
-
691
- case REACT_SUSPENSE_TYPE:
692
- return 'Suspense';
693
-
694
- case REACT_SUSPENSE_LIST_TYPE:
695
- return 'SuspenseList';
696
-
697
- }
698
-
699
- if (typeof type === 'object') {
700
- switch (type.$$typeof) {
701
- case REACT_CONTEXT_TYPE:
702
- var context = type;
703
- return getContextName(context) + '.Consumer';
704
-
705
- case REACT_PROVIDER_TYPE:
706
- var provider = type;
707
- return getContextName(provider._context) + '.Provider';
708
-
709
- case REACT_FORWARD_REF_TYPE:
710
- return getWrappedName(type, type.render, 'ForwardRef');
711
-
712
- case REACT_MEMO_TYPE:
713
- var outerName = type.displayName || null;
714
-
715
- if (outerName !== null) {
716
- return outerName;
717
- }
718
-
719
- return getComponentNameFromType(type.type) || 'Memo';
720
-
721
- case REACT_LAZY_TYPE:
722
- {
723
- var lazyComponent = type;
724
- var payload = lazyComponent._payload;
725
- var init = lazyComponent._init;
726
-
727
- try {
728
- return getComponentNameFromType(init(payload));
729
- } catch (x) {
730
- return null;
731
- }
732
- }
733
-
734
- // eslint-disable-next-line no-fallthrough
735
- }
736
- }
737
-
738
- return null;
739
- }
740
-
741
- var assign = Object.assign;
742
-
743
- // Helpers to patch console.logs to avoid logging during side-effect free
744
- // replaying on render function. This currently only patches the object
745
- // lazily which won't cover if the log function was extracted eagerly.
746
- // We could also eagerly patch the method.
747
- var disabledDepth = 0;
748
- var prevLog;
749
- var prevInfo;
750
- var prevWarn;
751
- var prevError;
752
- var prevGroup;
753
- var prevGroupCollapsed;
754
- var prevGroupEnd;
755
-
756
- function disabledLog() {}
757
-
758
- disabledLog.__reactDisabledLog = true;
759
- function disableLogs() {
760
- {
761
- if (disabledDepth === 0) {
762
- /* eslint-disable react-internal/no-production-logging */
763
- prevLog = console.log;
764
- prevInfo = console.info;
765
- prevWarn = console.warn;
766
- prevError = console.error;
767
- prevGroup = console.group;
768
- prevGroupCollapsed = console.groupCollapsed;
769
- prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
770
-
771
- var props = {
772
- configurable: true,
773
- enumerable: true,
774
- value: disabledLog,
775
- writable: true
776
- }; // $FlowFixMe Flow thinks console is immutable.
777
-
778
- Object.defineProperties(console, {
779
- info: props,
780
- log: props,
781
- warn: props,
782
- error: props,
783
- group: props,
784
- groupCollapsed: props,
785
- groupEnd: props
786
- });
787
- /* eslint-enable react-internal/no-production-logging */
788
- }
789
-
790
- disabledDepth++;
791
- }
792
- }
793
- function reenableLogs() {
794
- {
795
- disabledDepth--;
796
-
797
- if (disabledDepth === 0) {
798
- /* eslint-disable react-internal/no-production-logging */
799
- var props = {
800
- configurable: true,
801
- enumerable: true,
802
- writable: true
803
- }; // $FlowFixMe Flow thinks console is immutable.
804
-
805
- Object.defineProperties(console, {
806
- log: assign({}, props, {
807
- value: prevLog
808
- }),
809
- info: assign({}, props, {
810
- value: prevInfo
811
- }),
812
- warn: assign({}, props, {
813
- value: prevWarn
814
- }),
815
- error: assign({}, props, {
816
- value: prevError
817
- }),
818
- group: assign({}, props, {
819
- value: prevGroup
820
- }),
821
- groupCollapsed: assign({}, props, {
822
- value: prevGroupCollapsed
823
- }),
824
- groupEnd: assign({}, props, {
825
- value: prevGroupEnd
826
- })
827
- });
828
- /* eslint-enable react-internal/no-production-logging */
829
- }
830
-
831
- if (disabledDepth < 0) {
832
- error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
833
- }
834
- }
835
- }
836
-
837
- var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
838
- var prefix;
839
- function describeBuiltInComponentFrame(name, source, ownerFn) {
840
- {
841
- if (prefix === undefined) {
842
- // Extract the VM specific prefix used by each line.
843
- try {
844
- throw Error();
845
- } catch (x) {
846
- var match = x.stack.trim().match(/\n( *(at )?)/);
847
- prefix = match && match[1] || '';
848
- }
849
- } // We use the prefix to ensure our stacks line up with native stack frames.
850
-
851
-
852
- return '\n' + prefix + name;
853
- }
854
- }
855
- var reentry = false;
856
- var componentFrameCache;
857
-
858
- {
859
- var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
860
- componentFrameCache = new PossiblyWeakMap();
861
- }
862
-
863
- function describeNativeComponentFrame(fn, construct) {
864
- // If something asked for a stack inside a fake render, it should get ignored.
865
- if ( !fn || reentry) {
866
- return '';
867
- }
868
-
869
- {
870
- var frame = componentFrameCache.get(fn);
871
-
872
- if (frame !== undefined) {
873
- return frame;
874
- }
875
- }
876
-
877
- var control;
878
- reentry = true;
879
- var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
880
-
881
- Error.prepareStackTrace = undefined;
882
- var previousDispatcher;
883
-
884
- {
885
- previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
886
- // for warnings.
887
-
888
- ReactCurrentDispatcher.current = null;
889
- disableLogs();
890
- }
891
-
892
- try {
893
- // This should throw.
894
- if (construct) {
895
- // Something should be setting the props in the constructor.
896
- var Fake = function () {
897
- throw Error();
898
- }; // $FlowFixMe
899
-
900
-
901
- Object.defineProperty(Fake.prototype, 'props', {
902
- set: function () {
903
- // We use a throwing setter instead of frozen or non-writable props
904
- // because that won't throw in a non-strict mode function.
905
- throw Error();
906
- }
907
- });
908
-
909
- if (typeof Reflect === 'object' && Reflect.construct) {
910
- // We construct a different control for this case to include any extra
911
- // frames added by the construct call.
912
- try {
913
- Reflect.construct(Fake, []);
914
- } catch (x) {
915
- control = x;
916
- }
917
-
918
- Reflect.construct(fn, [], Fake);
919
- } else {
920
- try {
921
- Fake.call();
922
- } catch (x) {
923
- control = x;
924
- }
925
-
926
- fn.call(Fake.prototype);
927
- }
928
- } else {
929
- try {
930
- throw Error();
931
- } catch (x) {
932
- control = x;
933
- }
934
-
935
- fn();
936
- }
937
- } catch (sample) {
938
- // This is inlined manually because closure doesn't do it for us.
939
- if (sample && control && typeof sample.stack === 'string') {
940
- // This extracts the first frame from the sample that isn't also in the control.
941
- // Skipping one frame that we assume is the frame that calls the two.
942
- var sampleLines = sample.stack.split('\n');
943
- var controlLines = control.stack.split('\n');
944
- var s = sampleLines.length - 1;
945
- var c = controlLines.length - 1;
946
-
947
- while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
948
- // We expect at least one stack frame to be shared.
949
- // Typically this will be the root most one. However, stack frames may be
950
- // cut off due to maximum stack limits. In this case, one maybe cut off
951
- // earlier than the other. We assume that the sample is longer or the same
952
- // and there for cut off earlier. So we should find the root most frame in
953
- // the sample somewhere in the control.
954
- c--;
955
- }
956
-
957
- for (; s >= 1 && c >= 0; s--, c--) {
958
- // Next we find the first one that isn't the same which should be the
959
- // frame that called our sample function and the control.
960
- if (sampleLines[s] !== controlLines[c]) {
961
- // In V8, the first line is describing the message but other VMs don't.
962
- // If we're about to return the first line, and the control is also on the same
963
- // line, that's a pretty good indicator that our sample threw at same line as
964
- // the control. I.e. before we entered the sample frame. So we ignore this result.
965
- // This can happen if you passed a class to function component, or non-function.
966
- if (s !== 1 || c !== 1) {
967
- do {
968
- s--;
969
- c--; // We may still have similar intermediate frames from the construct call.
970
- // The next one that isn't the same should be our match though.
971
-
972
- if (c < 0 || sampleLines[s] !== controlLines[c]) {
973
- // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
974
- var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
975
- // but we have a user-provided "displayName"
976
- // splice it in to make the stack more readable.
977
-
978
-
979
- if (fn.displayName && _frame.includes('<anonymous>')) {
980
- _frame = _frame.replace('<anonymous>', fn.displayName);
981
- }
982
-
983
- {
984
- if (typeof fn === 'function') {
985
- componentFrameCache.set(fn, _frame);
986
- }
987
- } // Return the line we found.
988
-
989
-
990
- return _frame;
991
- }
992
- } while (s >= 1 && c >= 0);
993
- }
994
-
995
- break;
996
- }
997
- }
998
- }
999
- } finally {
1000
- reentry = false;
1001
-
1002
- {
1003
- ReactCurrentDispatcher.current = previousDispatcher;
1004
- reenableLogs();
1005
- }
1006
-
1007
- Error.prepareStackTrace = previousPrepareStackTrace;
1008
- } // Fallback to just using the name if we couldn't make it throw.
1009
-
1010
-
1011
- var name = fn ? fn.displayName || fn.name : '';
1012
- var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
1013
-
1014
- {
1015
- if (typeof fn === 'function') {
1016
- componentFrameCache.set(fn, syntheticFrame);
1017
- }
1018
- }
1019
-
1020
- return syntheticFrame;
1021
- }
1022
- function describeFunctionComponentFrame(fn, source, ownerFn) {
1023
- {
1024
- return describeNativeComponentFrame(fn, false);
1025
- }
1026
- }
1027
-
1028
- function shouldConstruct(Component) {
1029
- var prototype = Component.prototype;
1030
- return !!(prototype && prototype.isReactComponent);
1031
- }
1032
-
1033
- function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
1034
-
1035
- if (type == null) {
1036
- return '';
1037
- }
1038
-
1039
- if (typeof type === 'function') {
1040
- {
1041
- return describeNativeComponentFrame(type, shouldConstruct(type));
1042
- }
1043
- }
1044
-
1045
- if (typeof type === 'string') {
1046
- return describeBuiltInComponentFrame(type);
1047
- }
1048
-
1049
- switch (type) {
1050
- case REACT_SUSPENSE_TYPE:
1051
- return describeBuiltInComponentFrame('Suspense');
1052
-
1053
- case REACT_SUSPENSE_LIST_TYPE:
1054
- return describeBuiltInComponentFrame('SuspenseList');
1055
- }
1056
-
1057
- if (typeof type === 'object') {
1058
- switch (type.$$typeof) {
1059
- case REACT_FORWARD_REF_TYPE:
1060
- return describeFunctionComponentFrame(type.render);
1061
-
1062
- case REACT_MEMO_TYPE:
1063
- // Memo may contain any component type so we recursively resolve it.
1064
- return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
1065
-
1066
- case REACT_LAZY_TYPE:
1067
- {
1068
- var lazyComponent = type;
1069
- var payload = lazyComponent._payload;
1070
- var init = lazyComponent._init;
1071
-
1072
- try {
1073
- // Lazy may contain any component type so we recursively resolve it.
1074
- return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
1075
- } catch (x) {}
1076
- }
1077
- }
1078
- }
1079
-
1080
- return '';
1081
- }
1082
-
1083
- var hasOwnProperty = Object.prototype.hasOwnProperty;
1084
-
1085
- var loggedTypeFailures = {};
1086
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
1087
-
1088
- function setCurrentlyValidatingElement(element) {
1089
- {
1090
- if (element) {
1091
- var owner = element._owner;
1092
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
1093
- ReactDebugCurrentFrame.setExtraStackFrame(stack);
1094
- } else {
1095
- ReactDebugCurrentFrame.setExtraStackFrame(null);
1096
- }
1097
- }
1098
- }
1099
-
1100
- function checkPropTypes(typeSpecs, values, location, componentName, element) {
1101
- {
1102
- // $FlowFixMe This is okay but Flow doesn't know it.
1103
- var has = Function.call.bind(hasOwnProperty);
1104
-
1105
- for (var typeSpecName in typeSpecs) {
1106
- if (has(typeSpecs, typeSpecName)) {
1107
- var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
1108
- // fail the render phase where it didn't fail before. So we log it.
1109
- // After these have been cleaned up, we'll let them throw.
1110
-
1111
- try {
1112
- // This is intentionally an invariant that gets caught. It's the same
1113
- // behavior as without this statement except with a better message.
1114
- if (typeof typeSpecs[typeSpecName] !== 'function') {
1115
- // eslint-disable-next-line react-internal/prod-error-codes
1116
- 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`.');
1117
- err.name = 'Invariant Violation';
1118
- throw err;
1119
- }
1120
-
1121
- error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
1122
- } catch (ex) {
1123
- error$1 = ex;
1124
- }
1125
-
1126
- if (error$1 && !(error$1 instanceof Error)) {
1127
- setCurrentlyValidatingElement(element);
1128
-
1129
- 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);
1130
-
1131
- setCurrentlyValidatingElement(null);
1132
- }
1133
-
1134
- if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
1135
- // Only monitor this failure once because there tends to be a lot of the
1136
- // same error.
1137
- loggedTypeFailures[error$1.message] = true;
1138
- setCurrentlyValidatingElement(element);
1139
-
1140
- error('Failed %s type: %s', location, error$1.message);
1141
-
1142
- setCurrentlyValidatingElement(null);
1143
- }
1144
- }
1145
- }
1146
- }
1147
- }
1148
-
1149
- var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
1150
-
1151
- function isArray(a) {
1152
- return isArrayImpl(a);
1153
- }
1154
-
1155
- /*
1156
- * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
1157
- * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
1158
- *
1159
- * The functions in this module will throw an easier-to-understand,
1160
- * easier-to-debug exception with a clear errors message message explaining the
1161
- * problem. (Instead of a confusing exception thrown inside the implementation
1162
- * of the `value` object).
1163
- */
1164
- // $FlowFixMe only called in DEV, so void return is not possible.
1165
- function typeName(value) {
1166
- {
1167
- // toStringTag is needed for namespaced types like Temporal.Instant
1168
- var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
1169
- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
1170
- return type;
1171
- }
1172
- } // $FlowFixMe only called in DEV, so void return is not possible.
1173
-
1174
-
1175
- function willCoercionThrow(value) {
1176
- {
1177
- try {
1178
- testStringCoercion(value);
1179
- return false;
1180
- } catch (e) {
1181
- return true;
1182
- }
1183
- }
1184
- }
1185
-
1186
- function testStringCoercion(value) {
1187
- // If you ended up here by following an exception call stack, here's what's
1188
- // happened: you supplied an object or symbol value to React (as a prop, key,
1189
- // DOM attribute, CSS property, string ref, etc.) and when React tried to
1190
- // coerce it to a string using `'' + value`, an exception was thrown.
1191
- //
1192
- // The most common types that will cause this exception are `Symbol` instances
1193
- // and Temporal objects like `Temporal.Instant`. But any object that has a
1194
- // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
1195
- // exception. (Library authors do this to prevent users from using built-in
1196
- // numeric operators like `+` or comparison operators like `>=` because custom
1197
- // methods are needed to perform accurate arithmetic or comparison.)
1198
- //
1199
- // To fix the problem, coerce this object or symbol value to a string before
1200
- // passing it to React. The most reliable way is usually `String(value)`.
1201
- //
1202
- // To find which value is throwing, check the browser or debugger console.
1203
- // Before this exception was thrown, there should be `console.error` output
1204
- // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
1205
- // problem and how that type was used: key, atrribute, input value prop, etc.
1206
- // In most cases, this console output also shows the component and its
1207
- // ancestor components where the exception happened.
1208
- //
1209
- // eslint-disable-next-line react-internal/safe-string-coercion
1210
- return '' + value;
1211
- }
1212
- function checkKeyStringCoercion(value) {
1213
- {
1214
- if (willCoercionThrow(value)) {
1215
- error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
1216
-
1217
- return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
1218
- }
1219
- }
1220
- }
1221
-
1222
- var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
1223
- var RESERVED_PROPS = {
1224
- key: true,
1225
- ref: true,
1226
- __self: true,
1227
- __source: true
1228
- };
1229
- var specialPropKeyWarningShown;
1230
- var specialPropRefWarningShown;
1231
- var didWarnAboutStringRefs;
1232
-
1233
- {
1234
- didWarnAboutStringRefs = {};
1235
- }
1236
-
1237
- function hasValidRef(config) {
1238
- {
1239
- if (hasOwnProperty.call(config, 'ref')) {
1240
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
1241
-
1242
- if (getter && getter.isReactWarning) {
1243
- return false;
1244
- }
1245
- }
1246
- }
1247
-
1248
- return config.ref !== undefined;
1249
- }
1250
-
1251
- function hasValidKey(config) {
1252
- {
1253
- if (hasOwnProperty.call(config, 'key')) {
1254
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
1255
-
1256
- if (getter && getter.isReactWarning) {
1257
- return false;
1258
- }
1259
- }
1260
- }
1261
-
1262
- return config.key !== undefined;
1263
- }
1264
-
1265
- function warnIfStringRefCannotBeAutoConverted(config, self) {
1266
- {
1267
- if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
1268
- var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
1269
-
1270
- if (!didWarnAboutStringRefs[componentName]) {
1271
- 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);
1272
-
1273
- didWarnAboutStringRefs[componentName] = true;
1274
- }
1275
- }
1276
- }
1277
- }
1278
-
1279
- function defineKeyPropWarningGetter(props, displayName) {
1280
- {
1281
- var warnAboutAccessingKey = function () {
1282
- if (!specialPropKeyWarningShown) {
1283
- specialPropKeyWarningShown = true;
1284
-
1285
- 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);
1286
- }
1287
- };
1288
-
1289
- warnAboutAccessingKey.isReactWarning = true;
1290
- Object.defineProperty(props, 'key', {
1291
- get: warnAboutAccessingKey,
1292
- configurable: true
1293
- });
1294
- }
1295
- }
1296
-
1297
- function defineRefPropWarningGetter(props, displayName) {
1298
- {
1299
- var warnAboutAccessingRef = function () {
1300
- if (!specialPropRefWarningShown) {
1301
- specialPropRefWarningShown = true;
1302
-
1303
- 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);
1304
- }
1305
- };
1306
-
1307
- warnAboutAccessingRef.isReactWarning = true;
1308
- Object.defineProperty(props, 'ref', {
1309
- get: warnAboutAccessingRef,
1310
- configurable: true
1311
- });
1312
- }
1313
- }
1314
- /**
1315
- * Factory method to create a new React element. This no longer adheres to
1316
- * the class pattern, so do not use new to call it. Also, instanceof check
1317
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
1318
- * if something is a React Element.
1319
- *
1320
- * @param {*} type
1321
- * @param {*} props
1322
- * @param {*} key
1323
- * @param {string|object} ref
1324
- * @param {*} owner
1325
- * @param {*} self A *temporary* helper to detect places where `this` is
1326
- * different from the `owner` when React.createElement is called, so that we
1327
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
1328
- * functions, and as long as `this` and owner are the same, there will be no
1329
- * change in behavior.
1330
- * @param {*} source An annotation object (added by a transpiler or otherwise)
1331
- * indicating filename, line number, and/or other information.
1332
- * @internal
1333
- */
1334
-
1335
-
1336
- var ReactElement = function (type, key, ref, self, source, owner, props) {
1337
- var element = {
1338
- // This tag allows us to uniquely identify this as a React Element
1339
- $$typeof: REACT_ELEMENT_TYPE,
1340
- // Built-in properties that belong on the element
1341
- type: type,
1342
- key: key,
1343
- ref: ref,
1344
- props: props,
1345
- // Record the component responsible for creating this element.
1346
- _owner: owner
1347
- };
1348
-
1349
- {
1350
- // The validation flag is currently mutative. We put it on
1351
- // an external backing store so that we can freeze the whole object.
1352
- // This can be replaced with a WeakMap once they are implemented in
1353
- // commonly used development environments.
1354
- element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
1355
- // the validation flag non-enumerable (where possible, which should
1356
- // include every environment we run tests in), so the test framework
1357
- // ignores it.
1358
-
1359
- Object.defineProperty(element._store, 'validated', {
1360
- configurable: false,
1361
- enumerable: false,
1362
- writable: true,
1363
- value: false
1364
- }); // self and source are DEV only properties.
1365
-
1366
- Object.defineProperty(element, '_self', {
1367
- configurable: false,
1368
- enumerable: false,
1369
- writable: false,
1370
- value: self
1371
- }); // Two elements created in two different places should be considered
1372
- // equal for testing purposes and therefore we hide it from enumeration.
1373
-
1374
- Object.defineProperty(element, '_source', {
1375
- configurable: false,
1376
- enumerable: false,
1377
- writable: false,
1378
- value: source
1379
- });
1380
-
1381
- if (Object.freeze) {
1382
- Object.freeze(element.props);
1383
- Object.freeze(element);
1384
- }
1385
- }
1386
-
1387
- return element;
1388
- };
1389
- /**
1390
- * https://github.com/reactjs/rfcs/pull/107
1391
- * @param {*} type
1392
- * @param {object} props
1393
- * @param {string} key
1394
- */
1395
-
1396
- function jsxDEV(type, config, maybeKey, source, self) {
1397
- {
1398
- var propName; // Reserved names are extracted
1399
-
1400
- var props = {};
1401
- var key = null;
1402
- var ref = null; // Currently, key can be spread in as a prop. This causes a potential
1403
- // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
1404
- // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
1405
- // but as an intermediary step, we will use jsxDEV for everything except
1406
- // <div {...props} key="Hi" />, because we aren't currently able to tell if
1407
- // key is explicitly declared to be undefined or not.
1408
-
1409
- if (maybeKey !== undefined) {
1410
- {
1411
- checkKeyStringCoercion(maybeKey);
1412
- }
1413
-
1414
- key = '' + maybeKey;
1415
- }
1416
-
1417
- if (hasValidKey(config)) {
1418
- {
1419
- checkKeyStringCoercion(config.key);
1420
- }
1421
-
1422
- key = '' + config.key;
1423
- }
1424
-
1425
- if (hasValidRef(config)) {
1426
- ref = config.ref;
1427
- warnIfStringRefCannotBeAutoConverted(config, self);
1428
- } // Remaining properties are added to a new props object
1429
-
1430
-
1431
- for (propName in config) {
1432
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
1433
- props[propName] = config[propName];
1434
- }
1435
- } // Resolve default props
1436
-
1437
-
1438
- if (type && type.defaultProps) {
1439
- var defaultProps = type.defaultProps;
1440
-
1441
- for (propName in defaultProps) {
1442
- if (props[propName] === undefined) {
1443
- props[propName] = defaultProps[propName];
1444
- }
1445
- }
1446
- }
1447
-
1448
- if (key || ref) {
1449
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
1450
-
1451
- if (key) {
1452
- defineKeyPropWarningGetter(props, displayName);
1453
- }
1454
-
1455
- if (ref) {
1456
- defineRefPropWarningGetter(props, displayName);
1457
- }
1458
- }
1459
-
1460
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
1461
- }
1462
- }
1463
-
1464
- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
1465
- var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
1466
-
1467
- function setCurrentlyValidatingElement$1(element) {
1468
- {
1469
- if (element) {
1470
- var owner = element._owner;
1471
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
1472
- ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
1473
- } else {
1474
- ReactDebugCurrentFrame$1.setExtraStackFrame(null);
1475
- }
1476
- }
1477
- }
1478
-
1479
- var propTypesMisspellWarningShown;
1480
-
1481
- {
1482
- propTypesMisspellWarningShown = false;
1483
- }
1484
- /**
1485
- * Verifies the object is a ReactElement.
1486
- * See https://reactjs.org/docs/react-api.html#isvalidelement
1487
- * @param {?object} object
1488
- * @return {boolean} True if `object` is a ReactElement.
1489
- * @final
1490
- */
1491
-
1492
-
1493
- function isValidElement(object) {
1494
- {
1495
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1496
- }
1497
- }
1498
-
1499
- function getDeclarationErrorAddendum() {
1500
- {
1501
- if (ReactCurrentOwner$1.current) {
1502
- var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
1503
-
1504
- if (name) {
1505
- return '\n\nCheck the render method of `' + name + '`.';
1506
- }
1507
- }
1508
-
1509
- return '';
1510
- }
1511
- }
1512
-
1513
- function getSourceInfoErrorAddendum(source) {
1514
- {
1515
- if (source !== undefined) {
1516
- var fileName = source.fileName.replace(/^.*[\\\/]/, '');
1517
- var lineNumber = source.lineNumber;
1518
- return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
1519
- }
1520
-
1521
- return '';
1522
- }
1523
- }
1524
- /**
1525
- * Warn if there's no key explicitly set on dynamic arrays of children or
1526
- * object keys are not valid. This allows us to keep track of children between
1527
- * updates.
1528
- */
1529
-
1530
-
1531
- var ownerHasKeyUseWarning = {};
1532
-
1533
- function getCurrentComponentErrorInfo(parentType) {
1534
- {
1535
- var info = getDeclarationErrorAddendum();
1536
-
1537
- if (!info) {
1538
- var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
1539
-
1540
- if (parentName) {
1541
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
1542
- }
1543
- }
1544
-
1545
- return info;
1546
- }
1547
- }
1548
- /**
1549
- * Warn if the element doesn't have an explicit key assigned to it.
1550
- * This element is in an array. The array could grow and shrink or be
1551
- * reordered. All children that haven't already been validated are required to
1552
- * have a "key" property assigned to it. Error statuses are cached so a warning
1553
- * will only be shown once.
1554
- *
1555
- * @internal
1556
- * @param {ReactElement} element Element that requires a key.
1557
- * @param {*} parentType element's parent's type.
1558
- */
1559
-
1560
-
1561
- function validateExplicitKey(element, parentType) {
1562
- {
1563
- if (!element._store || element._store.validated || element.key != null) {
1564
- return;
1565
- }
1566
-
1567
- element._store.validated = true;
1568
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1569
-
1570
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
1571
- return;
1572
- }
1573
-
1574
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
1575
- // property, it may be the creator of the child that's responsible for
1576
- // assigning it a key.
1577
-
1578
- var childOwner = '';
1579
-
1580
- if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
1581
- // Give the component that originally created this child.
1582
- childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
1583
- }
1584
-
1585
- setCurrentlyValidatingElement$1(element);
1586
-
1587
- 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);
1588
-
1589
- setCurrentlyValidatingElement$1(null);
1590
- }
1591
- }
1592
- /**
1593
- * Ensure that every element either is passed in a static location, in an
1594
- * array with an explicit keys property defined, or in an object literal
1595
- * with valid key property.
1596
- *
1597
- * @internal
1598
- * @param {ReactNode} node Statically passed child of any type.
1599
- * @param {*} parentType node's parent's type.
1600
- */
1601
-
1602
-
1603
- function validateChildKeys(node, parentType) {
1604
- {
1605
- if (typeof node !== 'object') {
1606
- return;
1607
- }
1608
-
1609
- if (isArray(node)) {
1610
- for (var i = 0; i < node.length; i++) {
1611
- var child = node[i];
1612
-
1613
- if (isValidElement(child)) {
1614
- validateExplicitKey(child, parentType);
1615
- }
1616
- }
1617
- } else if (isValidElement(node)) {
1618
- // This element was passed in a valid location.
1619
- if (node._store) {
1620
- node._store.validated = true;
1621
- }
1622
- } else if (node) {
1623
- var iteratorFn = getIteratorFn(node);
1624
-
1625
- if (typeof iteratorFn === 'function') {
1626
- // Entry iterators used to provide implicit keys,
1627
- // but now we print a separate warning for them later.
1628
- if (iteratorFn !== node.entries) {
1629
- var iterator = iteratorFn.call(node);
1630
- var step;
1631
-
1632
- while (!(step = iterator.next()).done) {
1633
- if (isValidElement(step.value)) {
1634
- validateExplicitKey(step.value, parentType);
1635
- }
1636
- }
1637
- }
1638
- }
1639
- }
1640
- }
1641
- }
1642
- /**
1643
- * Given an element, validate that its props follow the propTypes definition,
1644
- * provided by the type.
1645
- *
1646
- * @param {ReactElement} element
1647
- */
1648
-
1649
-
1650
- function validatePropTypes(element) {
1651
- {
1652
- var type = element.type;
1653
-
1654
- if (type === null || type === undefined || typeof type === 'string') {
1655
- return;
1656
- }
1657
-
1658
- var propTypes;
1659
-
1660
- if (typeof type === 'function') {
1661
- propTypes = type.propTypes;
1662
- } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
1663
- // Inner props are checked in the reconciler.
1664
- type.$$typeof === REACT_MEMO_TYPE)) {
1665
- propTypes = type.propTypes;
1666
- } else {
1667
- return;
1668
- }
1669
-
1670
- if (propTypes) {
1671
- // Intentionally inside to avoid triggering lazy initializers:
1672
- var name = getComponentNameFromType(type);
1673
- checkPropTypes(propTypes, element.props, 'prop', name, element);
1674
- } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
1675
- propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
1676
-
1677
- var _name = getComponentNameFromType(type);
1678
-
1679
- error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
1680
- }
1681
-
1682
- if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
1683
- error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
1684
- }
1685
- }
1686
- }
1687
- /**
1688
- * Given a fragment, validate that it can only be provided with fragment props
1689
- * @param {ReactElement} fragment
1690
- */
1691
-
1692
-
1693
- function validateFragmentProps(fragment) {
1694
- {
1695
- var keys = Object.keys(fragment.props);
1696
-
1697
- for (var i = 0; i < keys.length; i++) {
1698
- var key = keys[i];
1699
-
1700
- if (key !== 'children' && key !== 'key') {
1701
- setCurrentlyValidatingElement$1(fragment);
1702
-
1703
- error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
1704
-
1705
- setCurrentlyValidatingElement$1(null);
1706
- break;
1707
- }
1708
- }
1709
-
1710
- if (fragment.ref !== null) {
1711
- setCurrentlyValidatingElement$1(fragment);
1712
-
1713
- error('Invalid attribute `ref` supplied to `React.Fragment`.');
1714
-
1715
- setCurrentlyValidatingElement$1(null);
1716
- }
1717
- }
1718
- }
1719
-
1720
- function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
1721
- {
1722
- var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
1723
- // succeed and there will likely be errors in render.
1724
-
1725
- if (!validType) {
1726
- var info = '';
1727
-
1728
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1729
- 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.";
1730
- }
1731
-
1732
- var sourceInfo = getSourceInfoErrorAddendum(source);
1733
-
1734
- if (sourceInfo) {
1735
- info += sourceInfo;
1736
- } else {
1737
- info += getDeclarationErrorAddendum();
1738
- }
1739
-
1740
- var typeString;
1741
-
1742
- if (type === null) {
1743
- typeString = 'null';
1744
- } else if (isArray(type)) {
1745
- typeString = 'array';
1746
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
1747
- typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
1748
- info = ' Did you accidentally export a JSX literal instead of a component?';
1749
- } else {
1750
- typeString = typeof type;
1751
- }
1752
-
1753
- 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);
1754
- }
1755
-
1756
- var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
1757
- // TODO: Drop this when these are no longer allowed as the type argument.
1758
-
1759
- if (element == null) {
1760
- return element;
1761
- } // Skip key warning if the type isn't valid since our key validation logic
1762
- // doesn't expect a non-string/function type and can throw confusing errors.
1763
- // We don't want exception behavior to differ between dev and prod.
1764
- // (Rendering will throw with a helpful message and as soon as the type is
1765
- // fixed, the key warnings will appear.)
1766
-
1767
-
1768
- if (validType) {
1769
- var children = props.children;
1770
-
1771
- if (children !== undefined) {
1772
- if (isStaticChildren) {
1773
- if (isArray(children)) {
1774
- for (var i = 0; i < children.length; i++) {
1775
- validateChildKeys(children[i], type);
1776
- }
1777
-
1778
- if (Object.freeze) {
1779
- Object.freeze(children);
1780
- }
1781
- } else {
1782
- 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.');
1783
- }
1784
- } else {
1785
- validateChildKeys(children, type);
1786
- }
1787
- }
1788
- }
1789
-
1790
- if (type === REACT_FRAGMENT_TYPE) {
1791
- validateFragmentProps(element);
1792
- } else {
1793
- validatePropTypes(element);
1794
- }
1795
-
1796
- return element;
1797
- }
1798
- } // These two functions exist to still get child warnings in dev
1799
- // even with the prod transform. This means that jsxDEV is purely
1800
- // opt-in behavior for better messages but that we won't stop
1801
- // giving you warnings if you use production apis.
1802
-
1803
- function jsxWithValidationStatic(type, props, key) {
1804
- {
1805
- return jsxWithValidation(type, props, key, true);
1806
- }
1807
- }
1808
- function jsxWithValidationDynamic(type, props, key) {
1809
- {
1810
- return jsxWithValidation(type, props, key, false);
1811
- }
1812
- }
1813
-
1814
- var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
1815
- // for now we can ship identical prod functions
1816
-
1817
- var jsxs = jsxWithValidationStatic ;
1818
-
1819
- reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
1820
- reactJsxRuntime_development.jsx = jsx;
1821
- reactJsxRuntime_development.jsxs = jsxs;
1822
- })();
1823
- }
1824
-
1825
- if (process.env.NODE_ENV === 'production') {
1826
- jsxRuntime.exports = reactJsxRuntime_production_min;
1827
- } else {
1828
- jsxRuntime.exports = reactJsxRuntime_development;
1829
- }
1830
-
1831
- var jsxRuntimeExports = jsxRuntime.exports;
1832
-
1833
497
  /*!
1834
498
  * tabbable 6.2.0
1835
499
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
@@ -5041,7 +3705,7 @@ const FocusGuard = /*#__PURE__*/React.forwardRef(function FocusGuard(props, ref)
5041
3705
  [createAttribute('focus-guard')]: '',
5042
3706
  style: HIDDEN_STYLES
5043
3707
  };
5044
- return /*#__PURE__*/jsxRuntimeExports.jsx("span", {
3708
+ return /*#__PURE__*/jsx("span", {
5045
3709
  ...props,
5046
3710
  ...restProps
5047
3711
  });
@@ -5180,7 +3844,7 @@ function FloatingPortal(props) {
5180
3844
  if (open) return;
5181
3845
  enableFocusInside(portalNode);
5182
3846
  }, [open, portalNode]);
5183
- return /*#__PURE__*/jsxRuntimeExports.jsxs(PortalContext.Provider, {
3847
+ return /*#__PURE__*/jsxs(PortalContext.Provider, {
5184
3848
  value: React.useMemo(() => ({
5185
3849
  preserveTabOrder,
5186
3850
  beforeOutsideRef,
@@ -5190,7 +3854,7 @@ function FloatingPortal(props) {
5190
3854
  portalNode,
5191
3855
  setFocusManagerState
5192
3856
  }), [preserveTabOrder, portalNode]),
5193
- children: [shouldRenderGuards && portalNode && /*#__PURE__*/jsxRuntimeExports.jsx(FocusGuard, {
3857
+ children: [shouldRenderGuards && portalNode && /*#__PURE__*/jsx(FocusGuard, {
5194
3858
  "data-type": "outside",
5195
3859
  ref: beforeOutsideRef,
5196
3860
  onFocus: event => {
@@ -5202,10 +3866,10 @@ function FloatingPortal(props) {
5202
3866
  prevTabbable == null || prevTabbable.focus();
5203
3867
  }
5204
3868
  }
5205
- }), shouldRenderGuards && portalNode && /*#__PURE__*/jsxRuntimeExports.jsx("span", {
3869
+ }), shouldRenderGuards && portalNode && /*#__PURE__*/jsx("span", {
5206
3870
  "aria-owns": portalNode.id,
5207
3871
  style: HIDDEN_STYLES
5208
- }), portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode), shouldRenderGuards && portalNode && /*#__PURE__*/jsxRuntimeExports.jsx(FocusGuard, {
3872
+ }), portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode), shouldRenderGuards && portalNode && /*#__PURE__*/jsx(FocusGuard, {
5209
3873
  "data-type": "outside",
5210
3874
  ref: afterOutsideRef,
5211
3875
  onFocus: event => {
@@ -6596,19 +5260,20 @@ const TooltipTrigger = /*#__PURE__*/forwardRef((props, ref) => {
6596
5260
  triggerClassName,
6597
5261
  color
6598
5262
  } = useTooltipContext();
6599
- const childrenRef = children.ref;
5263
+ const childrenRef = getElementRef(children);
6600
5264
  const triggerRef = useMergeRefs([refs.setReference, ref, childrenRef]);
6601
5265
  if ( /*#__PURE__*/React__default.isValidElement(children)) {
6602
- var _children$props$child;
6603
- return /*#__PURE__*/React__default.cloneElement(children, _objectSpread2(_objectSpread2({}, getReferenceProps(_objectSpread2(_objectSpread2(_objectSpread2({
6604
- ref: triggerRef
6605
- }, props), {}, {
5266
+ var _child$props$children;
5267
+ const child = children;
5268
+ return /*#__PURE__*/React__default.cloneElement(child, _objectSpread2(_objectSpread2({}, getReferenceProps(_objectSpread2(_objectSpread2(_objectSpread2({}, props), {}, {
6606
5269
  'aria-describedby': tooltipId
6607
- }, children.props), {}, {
6608
- children: (_children$props$child = children.props.children) !== null && _children$props$child !== void 0 ? _children$props$child : ''
5270
+ }, child.props), {}, {
5271
+ // After the child's props: from React 19 they include its `ref`, merged into triggerRef.
5272
+ ref: triggerRef,
5273
+ children: (_child$props$children = child.props.children) !== null && _child$props$children !== void 0 ? _child$props$children : ''
6609
5274
  }))), {}, {
6610
- className: classNames(children.props.className, triggerClassName),
6611
- color: color !== null && color !== void 0 ? color : children.props.color
5275
+ className: classNames(child.props.className, triggerClassName),
5276
+ color: color !== null && color !== void 0 ? color : child.props.color
6612
5277
  }));
6613
5278
  }
6614
5279
  return /*#__PURE__*/React__default.createElement("span", _extends({