@helpdice/ui 1.8.4 → 2.0.5

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 (113) hide show
  1. package/dist/CurrencyInput/components/CurrencyInput.d.ts +4 -0
  2. package/dist/CurrencyInput/components/CurrencyInputProps.d.ts +160 -0
  3. package/dist/CurrencyInput/components/utils/cleanValue.d.ts +8 -0
  4. package/dist/CurrencyInput/components/utils/escapeRegExp.d.ts +6 -0
  5. package/dist/CurrencyInput/components/utils/fixedDecimalValue.d.ts +1 -0
  6. package/dist/CurrencyInput/components/utils/formatValue.d.ts +49 -0
  7. package/dist/CurrencyInput/components/utils/getLocaleConfig.d.ts +13 -0
  8. package/dist/CurrencyInput/components/utils/getSuffix.d.ts +6 -0
  9. package/dist/CurrencyInput/components/utils/index.d.ts +8 -0
  10. package/dist/CurrencyInput/components/utils/isNumber.d.ts +1 -0
  11. package/dist/CurrencyInput/components/utils/padTrimValue.d.ts +1 -0
  12. package/dist/CurrencyInput/components/utils/parseAbbrValue.d.ts +10 -0
  13. package/dist/CurrencyInput/components/utils/removeInvalidChars.d.ts +4 -0
  14. package/dist/CurrencyInput/components/utils/removeSeparators.d.ts +4 -0
  15. package/dist/CurrencyInput/components/utils/repositionCursor.d.ts +16 -0
  16. package/dist/CurrencyInput/index.d.ts +5 -0
  17. package/dist/CurrencyInput/index.js +3 -2122
  18. package/dist/ITooltip/index.d.ts +13 -0
  19. package/dist/Loadable/index.js +29 -3
  20. package/dist/PhoneInput/index.js +21 -2140
  21. package/dist/Placeholder/index.js +5 -2124
  22. package/dist/auto-complete/index.js +73 -12092
  23. package/dist/avatar/index.js +15 -2134
  24. package/dist/badge/index.js +8 -2127
  25. package/dist/breadcrumbs/index.js +19 -2138
  26. package/dist/button/index.js +36 -2229
  27. package/dist/button-dropdown/index.js +28 -2147
  28. package/dist/button-group/index.js +9 -2128
  29. package/dist/capacity/index.js +10 -2129
  30. package/dist/card/index.js +46 -2165
  31. package/dist/carousal/index.js +644 -12666
  32. package/dist/checkbox/index.js +10 -2129
  33. package/dist/code/index.js +14 -2133
  34. package/dist/collapse/index.js +16 -2135
  35. package/dist/description/index.js +9 -2128
  36. package/dist/display/index.js +11 -2130
  37. package/dist/divider/index.js +12 -2131
  38. package/dist/dot/index.js +6 -2125
  39. package/dist/drawer/index.js +21 -2139
  40. package/dist/fieldset/index.js +22 -2141
  41. package/dist/grid/index.js +8 -2127
  42. package/dist/image/index.js +31 -2150
  43. package/dist/index.d.ts +4 -0
  44. package/dist/index.js +2065 -23539
  45. package/dist/input/index.js +42 -2158
  46. package/dist/keyboard/index.js +11 -2130
  47. package/dist/link/index.js +11 -2130
  48. package/dist/list/index.js +25 -2143
  49. package/dist/list/list-item.d.ts +1 -0
  50. package/dist/loading/index.js +14 -2133
  51. package/dist/menu/index.js +2 -10245
  52. package/dist/modal/index.js +59 -2177
  53. package/dist/note/index.js +10 -2129
  54. package/dist/page/index.js +6 -2125
  55. package/dist/pagination/index.js +11 -2130
  56. package/dist/popover/index.js +23 -2141
  57. package/dist/progress/index.js +10 -2129
  58. package/dist/radio/index.js +17 -2136
  59. package/dist/rating/index.js +7 -2126
  60. package/dist/row/index.js +5 -2124
  61. package/dist/select/index.js +54 -2173
  62. package/dist/slider/index.js +21 -2140
  63. package/dist/snippet/index.js +12 -2131
  64. package/dist/spacer/index.js +2 -2121
  65. package/dist/spinner/index.js +5 -2124
  66. package/dist/table/index.js +910 -12918
  67. package/dist/tabs/index.js +16 -2135
  68. package/dist/tag/index.js +5 -2124
  69. package/dist/text/index.js +5 -2124
  70. package/dist/textarea/index.js +10 -2129
  71. package/dist/toggle/index.js +14 -2133
  72. package/dist/tooltip/index.js +17 -2135
  73. package/dist/tree/index.js +39 -2158
  74. package/dist/use-input/index.js +2 -2122
  75. package/dist/use-modal/index.js +2 -2122
  76. package/dist/use-scale/index.js +2 -2121
  77. package/dist/use-tabs/index.js +2 -2122
  78. package/dist/user/index.js +31 -2150
  79. package/esm/CurrencyInput/components/CurrencyInput.d.ts +4 -0
  80. package/esm/CurrencyInput/components/CurrencyInputProps.d.ts +160 -0
  81. package/esm/CurrencyInput/components/utils/cleanValue.d.ts +8 -0
  82. package/esm/CurrencyInput/components/utils/escapeRegExp.d.ts +6 -0
  83. package/esm/CurrencyInput/components/utils/fixedDecimalValue.d.ts +1 -0
  84. package/esm/CurrencyInput/components/utils/formatValue.d.ts +49 -0
  85. package/esm/CurrencyInput/components/utils/getLocaleConfig.d.ts +13 -0
  86. package/esm/CurrencyInput/components/utils/getSuffix.d.ts +6 -0
  87. package/esm/CurrencyInput/components/utils/index.d.ts +8 -0
  88. package/esm/CurrencyInput/components/utils/isNumber.d.ts +1 -0
  89. package/esm/CurrencyInput/components/utils/padTrimValue.d.ts +1 -0
  90. package/esm/CurrencyInput/components/utils/parseAbbrValue.d.ts +10 -0
  91. package/esm/CurrencyInput/components/utils/removeInvalidChars.d.ts +4 -0
  92. package/esm/CurrencyInput/components/utils/removeSeparators.d.ts +4 -0
  93. package/esm/CurrencyInput/components/utils/repositionCursor.d.ts +16 -0
  94. package/esm/CurrencyInput/index.d.ts +5 -0
  95. package/esm/ITooltip/index.d.ts +13 -0
  96. package/esm/ITooltip/index.js +97 -0
  97. package/esm/Loadable/loader.js +13 -0
  98. package/esm/button/button.compact.js +13 -86
  99. package/esm/index.d.ts +4 -0
  100. package/esm/index.js +4 -1
  101. package/esm/input/input.js +13 -10
  102. package/esm/link/link.js +3 -3
  103. package/esm/list/list-item.d.ts +1 -0
  104. package/esm/list/list-item.js +4 -2
  105. package/esm/login-with/LoginSocialAmazon/index.js +1 -1
  106. package/esm/login-with/LoginSocialApple/index.js +1 -1
  107. package/esm/login-with/LoginSocialFacebook/index.js +1 -1
  108. package/esm/login-with/LoginSocialGoogle/index.js +1 -1
  109. package/esm/table/table-body.js +14 -4
  110. package/esm/table/table-cell.js +1 -1
  111. package/esm/table/table-head.js +13 -13
  112. package/esm/table/table.js +8 -8
  113. package/package.json +5 -5
@@ -3,7 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var require$$1 = require('react-dom');
6
+ var reactDom = require('react-dom');
7
+ var theme = require('@helpdice/theme');
7
8
 
8
9
  function _arrayLikeToArray(r, a) {
9
10
  (null == a || a > r.length) && (a = r.length);
@@ -487,2125 +488,6 @@ function getDefaultExportFromCjs (x) {
487
488
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
488
489
  }
489
490
 
490
- var dist = {};
491
-
492
- var hasRequiredDist;
493
-
494
- function requireDist () {
495
- if (hasRequiredDist) return dist;
496
- hasRequiredDist = 1;
497
-
498
- var React$1 = React;
499
- var reactDom = require$$1;
500
-
501
- function _arrayLikeToArray(r, a) {
502
- (null == a || a > r.length) && (a = r.length);
503
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
504
- return n;
505
- }
506
- function _arrayWithHoles(r) {
507
- if (Array.isArray(r)) return r;
508
- }
509
- function _arrayWithoutHoles(r) {
510
- if (Array.isArray(r)) return _arrayLikeToArray(r);
511
- }
512
- function _defineProperty(e, r, t) {
513
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
514
- value: t,
515
- enumerable: true,
516
- configurable: true,
517
- writable: true
518
- }) : e[r] = t, e;
519
- }
520
- function _extends() {
521
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
522
- for (var e = 1; e < arguments.length; e++) {
523
- var t = arguments[e];
524
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
525
- }
526
- return n;
527
- }, _extends.apply(null, arguments);
528
- }
529
- function _iterableToArray(r) {
530
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
531
- }
532
- function _iterableToArrayLimit(r, l) {
533
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
534
- if (null != t) {
535
- var e,
536
- n,
537
- i,
538
- u,
539
- a = [],
540
- f = true,
541
- o = false;
542
- try {
543
- if (i = (t = t.call(r)).next, 0 === l) {
544
- if (Object(t) !== t) return;
545
- f = !1;
546
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
547
- } catch (r) {
548
- o = true, n = r;
549
- } finally {
550
- try {
551
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
552
- } finally {
553
- if (o) throw n;
554
- }
555
- }
556
- return a;
557
- }
558
- }
559
- function _nonIterableRest() {
560
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
561
- }
562
- function _nonIterableSpread() {
563
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
564
- }
565
- function ownKeys(e, r) {
566
- var t = Object.keys(e);
567
- if (Object.getOwnPropertySymbols) {
568
- var o = Object.getOwnPropertySymbols(e);
569
- r && (o = o.filter(function (r) {
570
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
571
- })), t.push.apply(t, o);
572
- }
573
- return t;
574
- }
575
- function _objectSpread2(e) {
576
- for (var r = 1; r < arguments.length; r++) {
577
- var t = null != arguments[r] ? arguments[r] : {};
578
- r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
579
- _defineProperty(e, r, t[r]);
580
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
581
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
582
- });
583
- }
584
- return e;
585
- }
586
- function _objectWithoutProperties(e, t) {
587
- if (null == e) return {};
588
- var o,
589
- r,
590
- i = _objectWithoutPropertiesLoose(e, t);
591
- if (Object.getOwnPropertySymbols) {
592
- var n = Object.getOwnPropertySymbols(e);
593
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
594
- }
595
- return i;
596
- }
597
- function _objectWithoutPropertiesLoose(r, e) {
598
- if (null == r) return {};
599
- var t = {};
600
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
601
- if (-1 !== e.indexOf(n)) continue;
602
- t[n] = r[n];
603
- }
604
- return t;
605
- }
606
- function _slicedToArray(r, e) {
607
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
608
- }
609
- function _toConsumableArray(r) {
610
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
611
- }
612
- function _toPrimitive(t, r) {
613
- if ("object" != typeof t || !t) return t;
614
- var e = t[Symbol.toPrimitive];
615
- if (void 0 !== e) {
616
- var i = e.call(t, r);
617
- if ("object" != typeof i) return i;
618
- throw new TypeError("@@toPrimitive must return a primitive value.");
619
- }
620
- return ("string" === r ? String : Number)(t);
621
- }
622
- function _toPropertyKey(t) {
623
- var i = _toPrimitive(t, "string");
624
- return "symbol" == typeof i ? i : i + "";
625
- }
626
- function _typeof(o) {
627
- "@babel/helpers - typeof";
628
-
629
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
630
- return typeof o;
631
- } : function (o) {
632
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
633
- }, _typeof(o);
634
- }
635
- function _unsupportedIterableToArray(r, a) {
636
- if (r) {
637
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
638
- var t = {}.toString.call(r).slice(8, -1);
639
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
640
- }
641
- }
642
-
643
- var defaultToastLayout = {
644
- padding: '12px 16px',
645
- margin: '8px 0',
646
- width: '420px',
647
- maxWidth: '90vw',
648
- maxHeight: '75px',
649
- placement: 'bottomRight'
650
- };
651
- var defaultParams = {
652
- toasts: [],
653
- toastLayout: defaultToastLayout,
654
- updateToastLayout: function updateToastLayout(t) {
655
- return t;
656
- },
657
- updateToasts: function updateToasts(t) {
658
- return t;
659
- },
660
- lastUpdateToastId: null,
661
- updateLastToastId: function updateLastToastId() {
662
- return null;
663
- }
664
- };
665
- var HUIContent = /*#__PURE__*/React$1.createContext(defaultParams);
666
- var useHUIContext = function useHUIContext() {
667
- return React$1.useContext(HUIContent);
668
- };
669
-
670
- var defaultFont = {
671
- sans: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
672
- mono: 'Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace',
673
- prism: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,"Liberation Mono", "Courier New", monospace'
674
- };
675
- var defaultBreakpoints = {
676
- xs: {
677
- min: '0',
678
- max: '650px'
679
- },
680
- sm: {
681
- min: '650px',
682
- max: '900px'
683
- },
684
- md: {
685
- min: '900px',
686
- max: '1280px'
687
- },
688
- lg: {
689
- min: '1280px',
690
- max: '1920px'
691
- },
692
- xl: {
693
- min: '1920px',
694
- max: '10000px'
695
- }
696
- };
697
- var defaultLayout = {
698
- gap: '16pt',
699
- gapNegative: '-16pt',
700
- gapHalf: '8pt',
701
- gapHalfNegative: '-8pt',
702
- gapQuarter: '4pt',
703
- gapQuarterNegative: '-4pt',
704
- pageMargin: '16pt',
705
- pageWidth: '750pt',
706
- pageWidthWithMargin: '782pt',
707
- breakpointMobile: defaultBreakpoints.xs.max,
708
- breakpointTablet: defaultBreakpoints.sm.max,
709
- radius: '6px',
710
- unit: '16px'
711
- };
712
-
713
- var palette$1 = {
714
- accents_1: '#fafafa',
715
- accents_2: '#eaeaea',
716
- accents_3: '#999',
717
- accents_4: '#888',
718
- accents_5: '#666',
719
- accents_6: '#444',
720
- accents_7: '#333',
721
- accents_8: '#111',
722
- background: '#fff',
723
- foreground: '#000',
724
- selection: '#79ffe1',
725
- secondary: '#666',
726
- code: '#f81ce5',
727
- border: '#eaeaea',
728
- error: '#e00',
729
- errorLight: '#ff1a1a',
730
- errorLighter: '#f7d4d6',
731
- errorDark: '#c50000',
732
- success: '#0070f3',
733
- successLight: '#3291ff',
734
- successLighter: '#d3e5ff',
735
- successDark: '#0761d1',
736
- warning: '#f5a623',
737
- warningLight: '#f7b955',
738
- warningLighter: '#ffefcf',
739
- warningDark: '#ab570a',
740
- cyan: '#50e3c2',
741
- cyanLighter: '#aaffec',
742
- cyanLight: '#79ffe1',
743
- cyanDark: '#29bc9b',
744
- violet: '#7928ca',
745
- violetLighter: '#e3d7fc',
746
- violetLight: '#8a63d2',
747
- violetDark: '#4c2889',
748
- purple: '#f81ce5',
749
- alert: '#ff0080',
750
- magenta: '#eb367f',
751
- link: '#0070f3'
752
- };
753
- var expressiveness$1 = {
754
- linkStyle: 'none',
755
- linkHoverStyle: 'none',
756
- dropdownBoxShadow: '0 4px 4px 0 rgba(0, 0, 0, 0.02)',
757
- scrollerStart: 'rgba(255, 255, 255, 1)',
758
- scrollerEnd: 'rgba(255, 255, 255, 0)',
759
- shadowSmall: '0 5px 10px rgba(0, 0, 0, 0.12)',
760
- shadowMedium: '0 8px 30px rgba(0, 0, 0, 0.12)',
761
- shadowLarge: '0 30px 60px rgba(0, 0, 0, 0.12)',
762
- portalOpacity: 0.25
763
- };
764
- var font$1 = defaultFont;
765
- var breakpoints$1 = defaultBreakpoints;
766
- var layout$1 = defaultLayout;
767
- var themes$1 = {
768
- type: 'light',
769
- font: font$1,
770
- layout: layout$1,
771
- palette: palette$1,
772
- breakpoints: breakpoints$1,
773
- expressiveness: expressiveness$1
774
- };
775
-
776
- var palette = {
777
- accents_1: '#111',
778
- accents_2: '#333',
779
- accents_3: '#444',
780
- accents_4: '#666',
781
- accents_5: '#888',
782
- accents_6: '#999',
783
- accents_7: '#eaeaea',
784
- accents_8: '#fafafa',
785
- background: '#000',
786
- foreground: '#fff',
787
- selection: '#f81ce5',
788
- secondary: '#888',
789
- code: '#79ffe1',
790
- border: '#333',
791
- error: '#e00',
792
- errorLighter: '#f7d4d6',
793
- errorLight: '#ff1a1a',
794
- errorDark: '#c50000',
795
- success: '#0070f3',
796
- successLighter: '#d3e5ff',
797
- successLight: '#3291ff',
798
- successDark: '#0761d1',
799
- warning: '#f5a623',
800
- warningLighter: '#ffefcf',
801
- warningLight: '#f7b955',
802
- warningDark: '#ab570a',
803
- cyan: '#50e3c2',
804
- cyanLighter: '#aaffec',
805
- cyanLight: '#79ffe1',
806
- cyanDark: '#29bc9b',
807
- violet: '#7928ca',
808
- violetLighter: '#e3d7fc',
809
- violetLight: '#8a63d2',
810
- violetDark: '#4c2889',
811
- purple: '#f81ce5',
812
- alert: '#ff0080',
813
- magenta: '#eb367f',
814
- link: '#3291ff'
815
- };
816
- var expressiveness = {
817
- linkStyle: 'none',
818
- linkHoverStyle: 'none',
819
- dropdownBoxShadow: '0 0 0 1px #333',
820
- scrollerStart: 'rgba(255, 255, 255, 1)',
821
- scrollerEnd: 'rgba(255, 255, 255, 0)',
822
- shadowSmall: '0 0 0 1px #333',
823
- shadowMedium: '0 0 0 1px #333',
824
- shadowLarge: '0 0 0 1px #333',
825
- portalOpacity: 0.75
826
- };
827
- var font = defaultFont;
828
- var breakpoints = defaultBreakpoints;
829
- var layout = defaultLayout;
830
- var themes = {
831
- type: 'dark',
832
- font: font,
833
- layout: layout,
834
- palette: palette,
835
- breakpoints: breakpoints,
836
- expressiveness: expressiveness
837
- };
838
-
839
- var isObject = function isObject(target) {
840
- return target && _typeof(target) === 'object';
841
- };
842
- var _deepDuplicable = function deepDuplicable(source, target) {
843
- if (!isObject(target) || !isObject(source)) return source;
844
- var sourceKeys = Object.keys(source);
845
- var result = {};
846
- for (var _i = 0, _sourceKeys = sourceKeys; _i < _sourceKeys.length; _i++) {
847
- var key = _sourceKeys[_i];
848
- var sourceValue = source[key];
849
- var targetValue = target[key];
850
- if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
851
- result[key] = targetValue.concat(sourceValue);
852
- } else if (isObject(sourceValue) && isObject(targetValue)) {
853
- result[key] = _deepDuplicable(sourceValue, _objectSpread2({}, targetValue));
854
- } else if (targetValue) {
855
- result[key] = targetValue;
856
- } else {
857
- result[key] = sourceValue;
858
- }
859
- }
860
- return result;
861
- };
862
- var getPresets = function getPresets() {
863
- return [themes$1, themes];
864
- };
865
- var getPresetStaticTheme = function getPresetStaticTheme() {
866
- return themes$1;
867
- };
868
- var isAvailableThemeType = function isAvailableThemeType(type) {
869
- if (!type) return false;
870
- var presetThemes = getPresets();
871
- var hasType = presetThemes.find(function (theme) {
872
- return theme.type === type;
873
- });
874
- return !hasType;
875
- };
876
- var isPresetTheme = function isPresetTheme(themeOrType) {
877
- if (!themeOrType) return false;
878
- var isType = typeof themeOrType === 'string';
879
- var type = isType ? themeOrType : themeOrType.type;
880
- return !isAvailableThemeType(type);
881
- };
882
- var hasUserCustomTheme = function hasUserCustomTheme() {
883
- var themes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
884
- return !!themes.find(function (item) {
885
- return isAvailableThemeType(item.type);
886
- });
887
- };
888
- var create = function create(base, custom) {
889
- if (!isAvailableThemeType(custom.type)) {
890
- throw new Error('Duplicate or unavailable theme type');
891
- }
892
- return _deepDuplicable(base, custom);
893
- };
894
- var createFromDark = function createFromDark(custom) {
895
- return create(themes, custom);
896
- };
897
- var createFromLight = function createFromLight(custom) {
898
- return create(themes$1, custom);
899
- };
900
- var Themes = {
901
- isPresetTheme: isPresetTheme,
902
- isAvailableThemeType: isAvailableThemeType,
903
- hasUserCustomTheme: hasUserCustomTheme,
904
- getPresets: getPresets,
905
- getPresetStaticTheme: getPresetStaticTheme,
906
- create: create,
907
- createFromDark: createFromDark,
908
- createFromLight: createFromLight
909
- };
910
-
911
- /* "use client" */
912
-
913
- var defaultTheme = Themes.getPresetStaticTheme();
914
- var ThemeContext = /*#__PURE__*/React$1.createContext(defaultTheme);
915
- var useTheme = function useTheme() {
916
- return React$1.useContext(ThemeContext);
917
- };
918
-
919
- /* "use client" */
920
-
921
- var defaultAllThemesConfig = {
922
- themes: Themes.getPresets()
923
- };
924
- var AllThemesContext = /*#__PURE__*/React$1.createContext(defaultAllThemesConfig);
925
- var useAllThemes = function useAllThemes() {
926
- return React$1.useContext(AllThemesContext);
927
- };
928
-
929
- var ThemeProvider = function ThemeProvider(_ref) {
930
- var children = _ref.children,
931
- themeType = _ref.themeType,
932
- _ref$themes = _ref.themes,
933
- themes = _ref$themes === void 0 ? [] : _ref$themes;
934
- var _React$useState = React$1.useState({
935
- themes: Themes.getPresets()
936
- }),
937
- _React$useState2 = _slicedToArray(_React$useState, 2),
938
- allThemes = _React$useState2[0],
939
- setAllThemes = _React$useState2[1];
940
- var currentTheme = React$1.useMemo(function () {
941
- var theme = allThemes.themes.find(function (item) {
942
- return item.type === themeType;
943
- });
944
- if (theme) return theme;
945
- return Themes.getPresetStaticTheme();
946
- }, [allThemes, themeType]);
947
- React$1.useEffect(function () {
948
- if (!(themes !== null && themes !== void 0 && themes.length)) return;
949
- setAllThemes(function (last) {
950
- var safeThemes = themes.filter(function (item) {
951
- return Themes.isAvailableThemeType(item.type);
952
- });
953
- var nextThemes = Themes.getPresets().concat(safeThemes);
954
- return _objectSpread2(_objectSpread2({}, last), {}, {
955
- themes: nextThemes
956
- });
957
- });
958
- }, [themes]);
959
- return /*#__PURE__*/React$1.createElement(AllThemesContext.Provider, {
960
- value: allThemes
961
- }, /*#__PURE__*/React$1.createElement(ThemeContext.Provider, {
962
- value: currentTheme
963
- }, children));
964
- };
965
-
966
- var useCurrentState = function useCurrentState(initialState) {
967
- var _useState = React$1.useState(function () {
968
- return typeof initialState === 'function' ? initialState() : initialState;
969
- }),
970
- _useState2 = _slicedToArray(_useState, 2),
971
- state = _useState2[0],
972
- setState = _useState2[1];
973
- var ref = React$1.useRef(initialState);
974
- React$1.useEffect(function () {
975
- ref.current = state;
976
- }, [state]);
977
- var setValue = function setValue(val) {
978
- var result = typeof val === 'function' ? val(ref.current) : val;
979
- ref.current = result;
980
- setState(result);
981
- };
982
- return [state, setValue, ref];
983
- };
984
-
985
- function getDefaultExportFromCjs (x) {
986
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
987
- }
988
-
989
- var index = {};
990
-
991
- var hasRequiredIndex;
992
-
993
- function requireIndex () {
994
- if (hasRequiredIndex) return index;
995
- hasRequiredIndex = 1;
996
- var React$1$1 = React$1;
997
-
998
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
999
-
1000
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1$1);
1001
-
1002
- /*
1003
- Based on Glamor's sheet
1004
- https://github.com/threepointone/glamor/blob/667b480d31b3721a905021b26e1290ce92ca2879/src/sheet.js
1005
- */ function _defineProperties(target, props) {
1006
- for(var i = 0; i < props.length; i++){
1007
- var descriptor = props[i];
1008
- descriptor.enumerable = descriptor.enumerable || false;
1009
- descriptor.configurable = true;
1010
- if ("value" in descriptor) descriptor.writable = true;
1011
- Object.defineProperty(target, descriptor.key, descriptor);
1012
- }
1013
- }
1014
- function _createClass(Constructor, protoProps, staticProps) {
1015
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1016
- return Constructor;
1017
- }
1018
- var isProd = typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production";
1019
- var isString = function(o) {
1020
- return Object.prototype.toString.call(o) === "[object String]";
1021
- };
1022
- var StyleSheet = /*#__PURE__*/ function() {
1023
- function StyleSheet(param) {
1024
- var ref = param === void 0 ? {} : param, _name = ref.name, name = _name === void 0 ? "stylesheet" : _name, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? isProd : _optimizeForSpeed;
1025
- invariant$1(isString(name), "`name` must be a string");
1026
- this._name = name;
1027
- this._deletedRulePlaceholder = "#" + name + "-deleted-rule____{}";
1028
- invariant$1(typeof optimizeForSpeed === "boolean", "`optimizeForSpeed` must be a boolean");
1029
- this._optimizeForSpeed = optimizeForSpeed;
1030
- this._serverSheet = undefined;
1031
- this._tags = [];
1032
- this._injected = false;
1033
- this._rulesCount = 0;
1034
- var node = typeof window !== "undefined" && document.querySelector('meta[property="csp-nonce"]');
1035
- this._nonce = node ? node.getAttribute("content") : null;
1036
- }
1037
- var _proto = StyleSheet.prototype;
1038
- _proto.setOptimizeForSpeed = function setOptimizeForSpeed(bool) {
1039
- invariant$1(typeof bool === "boolean", "`setOptimizeForSpeed` accepts a boolean");
1040
- invariant$1(this._rulesCount === 0, "optimizeForSpeed cannot be when rules have already been inserted");
1041
- this.flush();
1042
- this._optimizeForSpeed = bool;
1043
- this.inject();
1044
- };
1045
- _proto.isOptimizeForSpeed = function isOptimizeForSpeed() {
1046
- return this._optimizeForSpeed;
1047
- };
1048
- _proto.inject = function inject() {
1049
- var _this = this;
1050
- invariant$1(!this._injected, "sheet already injected");
1051
- this._injected = true;
1052
- if (typeof window !== "undefined" && this._optimizeForSpeed) {
1053
- this._tags[0] = this.makeStyleTag(this._name);
1054
- this._optimizeForSpeed = "insertRule" in this.getSheet();
1055
- if (!this._optimizeForSpeed) {
1056
- if (!isProd) {
1057
- console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode.");
1058
- }
1059
- this.flush();
1060
- this._injected = true;
1061
- }
1062
- return;
1063
- }
1064
- this._serverSheet = {
1065
- cssRules: [],
1066
- insertRule: function(rule, index) {
1067
- if (typeof index === "number") {
1068
- _this._serverSheet.cssRules[index] = {
1069
- cssText: rule
1070
- };
1071
- } else {
1072
- _this._serverSheet.cssRules.push({
1073
- cssText: rule
1074
- });
1075
- }
1076
- return index;
1077
- },
1078
- deleteRule: function(index) {
1079
- _this._serverSheet.cssRules[index] = null;
1080
- }
1081
- };
1082
- };
1083
- _proto.getSheetForTag = function getSheetForTag(tag) {
1084
- if (tag.sheet) {
1085
- return tag.sheet;
1086
- }
1087
- // this weirdness brought to you by firefox
1088
- for(var i = 0; i < document.styleSheets.length; i++){
1089
- if (document.styleSheets[i].ownerNode === tag) {
1090
- return document.styleSheets[i];
1091
- }
1092
- }
1093
- };
1094
- _proto.getSheet = function getSheet() {
1095
- return this.getSheetForTag(this._tags[this._tags.length - 1]);
1096
- };
1097
- _proto.insertRule = function insertRule(rule, index) {
1098
- invariant$1(isString(rule), "`insertRule` accepts only strings");
1099
- if (typeof window === "undefined") {
1100
- if (typeof index !== "number") {
1101
- index = this._serverSheet.cssRules.length;
1102
- }
1103
- this._serverSheet.insertRule(rule, index);
1104
- return this._rulesCount++;
1105
- }
1106
- if (this._optimizeForSpeed) {
1107
- var sheet = this.getSheet();
1108
- if (typeof index !== "number") {
1109
- index = sheet.cssRules.length;
1110
- }
1111
- // this weirdness for perf, and chrome's weird bug
1112
- // https://stackoverflow.com/questions/20007992/chrome-suddenly-stopped-accepting-insertrule
1113
- try {
1114
- sheet.insertRule(rule, index);
1115
- } catch (error) {
1116
- if (!isProd) {
1117
- console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
1118
- }
1119
- return -1;
1120
- }
1121
- } else {
1122
- var insertionPoint = this._tags[index];
1123
- this._tags.push(this.makeStyleTag(this._name, rule, insertionPoint));
1124
- }
1125
- return this._rulesCount++;
1126
- };
1127
- _proto.replaceRule = function replaceRule(index, rule) {
1128
- if (this._optimizeForSpeed || typeof window === "undefined") {
1129
- var sheet = typeof window !== "undefined" ? this.getSheet() : this._serverSheet;
1130
- if (!rule.trim()) {
1131
- rule = this._deletedRulePlaceholder;
1132
- }
1133
- if (!sheet.cssRules[index]) {
1134
- // @TBD Should we throw an error?
1135
- return index;
1136
- }
1137
- sheet.deleteRule(index);
1138
- try {
1139
- sheet.insertRule(rule, index);
1140
- } catch (error) {
1141
- if (!isProd) {
1142
- console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
1143
- }
1144
- // In order to preserve the indices we insert a deleteRulePlaceholder
1145
- sheet.insertRule(this._deletedRulePlaceholder, index);
1146
- }
1147
- } else {
1148
- var tag = this._tags[index];
1149
- invariant$1(tag, "old rule at index `" + index + "` not found");
1150
- tag.textContent = rule;
1151
- }
1152
- return index;
1153
- };
1154
- _proto.deleteRule = function deleteRule(index) {
1155
- if (typeof window === "undefined") {
1156
- this._serverSheet.deleteRule(index);
1157
- return;
1158
- }
1159
- if (this._optimizeForSpeed) {
1160
- this.replaceRule(index, "");
1161
- } else {
1162
- var tag = this._tags[index];
1163
- invariant$1(tag, "rule at index `" + index + "` not found");
1164
- tag.parentNode.removeChild(tag);
1165
- this._tags[index] = null;
1166
- }
1167
- };
1168
- _proto.flush = function flush() {
1169
- this._injected = false;
1170
- this._rulesCount = 0;
1171
- if (typeof window !== "undefined") {
1172
- this._tags.forEach(function(tag) {
1173
- return tag && tag.parentNode.removeChild(tag);
1174
- });
1175
- this._tags = [];
1176
- } else {
1177
- // simpler on server
1178
- this._serverSheet.cssRules = [];
1179
- }
1180
- };
1181
- _proto.cssRules = function cssRules() {
1182
- var _this = this;
1183
- if (typeof window === "undefined") {
1184
- return this._serverSheet.cssRules;
1185
- }
1186
- return this._tags.reduce(function(rules, tag) {
1187
- if (tag) {
1188
- rules = rules.concat(Array.prototype.map.call(_this.getSheetForTag(tag).cssRules, function(rule) {
1189
- return rule.cssText === _this._deletedRulePlaceholder ? null : rule;
1190
- }));
1191
- } else {
1192
- rules.push(null);
1193
- }
1194
- return rules;
1195
- }, []);
1196
- };
1197
- _proto.makeStyleTag = function makeStyleTag(name, cssString, relativeToTag) {
1198
- if (cssString) {
1199
- invariant$1(isString(cssString), "makeStyleTag accepts only strings as second parameter");
1200
- }
1201
- var tag = document.createElement("style");
1202
- if (this._nonce) tag.setAttribute("nonce", this._nonce);
1203
- tag.type = "text/css";
1204
- tag.setAttribute("data-" + name, "");
1205
- if (cssString) {
1206
- tag.appendChild(document.createTextNode(cssString));
1207
- }
1208
- var head = document.head || document.getElementsByTagName("head")[0];
1209
- if (relativeToTag) {
1210
- head.insertBefore(tag, relativeToTag);
1211
- } else {
1212
- head.appendChild(tag);
1213
- }
1214
- return tag;
1215
- };
1216
- _createClass(StyleSheet, [
1217
- {
1218
- key: "length",
1219
- get: function get() {
1220
- return this._rulesCount;
1221
- }
1222
- }
1223
- ]);
1224
- return StyleSheet;
1225
- }();
1226
- function invariant$1(condition, message) {
1227
- if (!condition) {
1228
- throw new Error("StyleSheet: " + message + ".");
1229
- }
1230
- }
1231
-
1232
- function hash(str) {
1233
- var _$hash = 5381, i = str.length;
1234
- while(i){
1235
- _$hash = _$hash * 33 ^ str.charCodeAt(--i);
1236
- }
1237
- /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
1238
- * integers. Since we want the results to be always positive, convert the
1239
- * signed int to an unsigned by doing an unsigned bitshift. */ return _$hash >>> 0;
1240
- }
1241
- var stringHash = hash;
1242
-
1243
- var sanitize = function(rule) {
1244
- return rule.replace(/\/style/gi, "\\/style");
1245
- };
1246
- var cache = {};
1247
- /**
1248
- * computeId
1249
- *
1250
- * Compute and memoize a jsx id from a basedId and optionally props.
1251
- */ function computeId(baseId, props) {
1252
- if (!props) {
1253
- return "jsx-" + baseId;
1254
- }
1255
- var propsToString = String(props);
1256
- var key = baseId + propsToString;
1257
- if (!cache[key]) {
1258
- cache[key] = "jsx-" + stringHash(baseId + "-" + propsToString);
1259
- }
1260
- return cache[key];
1261
- }
1262
- /**
1263
- * computeSelector
1264
- *
1265
- * Compute and memoize dynamic selectors.
1266
- */ function computeSelector(id, css) {
1267
- var selectoPlaceholderRegexp = /__jsx-style-dynamic-selector/g;
1268
- // Sanitize SSR-ed CSS.
1269
- // Client side code doesn't need to be sanitized since we use
1270
- // document.createTextNode (dev) and the CSSOM api sheet.insertRule (prod).
1271
- if (typeof window === "undefined") {
1272
- css = sanitize(css);
1273
- }
1274
- var idcss = id + css;
1275
- if (!cache[idcss]) {
1276
- cache[idcss] = css.replace(selectoPlaceholderRegexp, id);
1277
- }
1278
- return cache[idcss];
1279
- }
1280
-
1281
- function mapRulesToStyle(cssRules, options) {
1282
- if (options === void 0) options = {};
1283
- return cssRules.map(function(args) {
1284
- var id = args[0];
1285
- var css = args[1];
1286
- return /*#__PURE__*/ React__default["default"].createElement("style", {
1287
- id: "__" + id,
1288
- // Avoid warnings upon render with a key
1289
- key: "__" + id,
1290
- nonce: options.nonce ? options.nonce : undefined,
1291
- dangerouslySetInnerHTML: {
1292
- __html: css
1293
- }
1294
- });
1295
- });
1296
- }
1297
- var StyleSheetRegistry = /*#__PURE__*/ function() {
1298
- function StyleSheetRegistry(param) {
1299
- var ref = param === void 0 ? {} : param, _styleSheet = ref.styleSheet, styleSheet = _styleSheet === void 0 ? null : _styleSheet, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? false : _optimizeForSpeed;
1300
- this._sheet = styleSheet || new StyleSheet({
1301
- name: "styled-jsx",
1302
- optimizeForSpeed: optimizeForSpeed
1303
- });
1304
- this._sheet.inject();
1305
- if (styleSheet && typeof optimizeForSpeed === "boolean") {
1306
- this._sheet.setOptimizeForSpeed(optimizeForSpeed);
1307
- this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
1308
- }
1309
- this._fromServer = undefined;
1310
- this._indices = {};
1311
- this._instancesCounts = {};
1312
- }
1313
- var _proto = StyleSheetRegistry.prototype;
1314
- _proto.add = function add(props) {
1315
- var _this = this;
1316
- if (undefined === this._optimizeForSpeed) {
1317
- this._optimizeForSpeed = Array.isArray(props.children);
1318
- this._sheet.setOptimizeForSpeed(this._optimizeForSpeed);
1319
- this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
1320
- }
1321
- if (typeof window !== "undefined" && !this._fromServer) {
1322
- this._fromServer = this.selectFromServer();
1323
- this._instancesCounts = Object.keys(this._fromServer).reduce(function(acc, tagName) {
1324
- acc[tagName] = 0;
1325
- return acc;
1326
- }, {});
1327
- }
1328
- var ref = this.getIdAndRules(props), styleId = ref.styleId, rules = ref.rules;
1329
- // Deduping: just increase the instances count.
1330
- if (styleId in this._instancesCounts) {
1331
- this._instancesCounts[styleId] += 1;
1332
- return;
1333
- }
1334
- var indices = rules.map(function(rule) {
1335
- return _this._sheet.insertRule(rule);
1336
- })// Filter out invalid rules
1337
- .filter(function(index) {
1338
- return index !== -1;
1339
- });
1340
- this._indices[styleId] = indices;
1341
- this._instancesCounts[styleId] = 1;
1342
- };
1343
- _proto.remove = function remove(props) {
1344
- var _this = this;
1345
- var styleId = this.getIdAndRules(props).styleId;
1346
- invariant(styleId in this._instancesCounts, "styleId: `" + styleId + "` not found");
1347
- this._instancesCounts[styleId] -= 1;
1348
- if (this._instancesCounts[styleId] < 1) {
1349
- var tagFromServer = this._fromServer && this._fromServer[styleId];
1350
- if (tagFromServer) {
1351
- tagFromServer.parentNode.removeChild(tagFromServer);
1352
- delete this._fromServer[styleId];
1353
- } else {
1354
- this._indices[styleId].forEach(function(index) {
1355
- return _this._sheet.deleteRule(index);
1356
- });
1357
- delete this._indices[styleId];
1358
- }
1359
- delete this._instancesCounts[styleId];
1360
- }
1361
- };
1362
- _proto.update = function update(props, nextProps) {
1363
- this.add(nextProps);
1364
- this.remove(props);
1365
- };
1366
- _proto.flush = function flush() {
1367
- this._sheet.flush();
1368
- this._sheet.inject();
1369
- this._fromServer = undefined;
1370
- this._indices = {};
1371
- this._instancesCounts = {};
1372
- };
1373
- _proto.cssRules = function cssRules() {
1374
- var _this = this;
1375
- var fromServer = this._fromServer ? Object.keys(this._fromServer).map(function(styleId) {
1376
- return [
1377
- styleId,
1378
- _this._fromServer[styleId]
1379
- ];
1380
- }) : [];
1381
- var cssRules = this._sheet.cssRules();
1382
- return fromServer.concat(Object.keys(this._indices).map(function(styleId) {
1383
- return [
1384
- styleId,
1385
- _this._indices[styleId].map(function(index) {
1386
- return cssRules[index].cssText;
1387
- }).join(_this._optimizeForSpeed ? "" : "\n")
1388
- ];
1389
- })// filter out empty rules
1390
- .filter(function(rule) {
1391
- return Boolean(rule[1]);
1392
- }));
1393
- };
1394
- _proto.styles = function styles(options) {
1395
- return mapRulesToStyle(this.cssRules(), options);
1396
- };
1397
- _proto.getIdAndRules = function getIdAndRules(props) {
1398
- var css = props.children, dynamic = props.dynamic, id = props.id;
1399
- if (dynamic) {
1400
- var styleId = computeId(id, dynamic);
1401
- return {
1402
- styleId: styleId,
1403
- rules: Array.isArray(css) ? css.map(function(rule) {
1404
- return computeSelector(styleId, rule);
1405
- }) : [
1406
- computeSelector(styleId, css)
1407
- ]
1408
- };
1409
- }
1410
- return {
1411
- styleId: computeId(id),
1412
- rules: Array.isArray(css) ? css : [
1413
- css
1414
- ]
1415
- };
1416
- };
1417
- /**
1418
- * selectFromServer
1419
- *
1420
- * Collects style tags from the document with id __jsx-XXX
1421
- */ _proto.selectFromServer = function selectFromServer() {
1422
- var elements = Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]'));
1423
- return elements.reduce(function(acc, element) {
1424
- var id = element.id.slice(2);
1425
- acc[id] = element;
1426
- return acc;
1427
- }, {});
1428
- };
1429
- return StyleSheetRegistry;
1430
- }();
1431
- function invariant(condition, message) {
1432
- if (!condition) {
1433
- throw new Error("StyleSheetRegistry: " + message + ".");
1434
- }
1435
- }
1436
- var StyleSheetContext = /*#__PURE__*/ React$1$1.createContext(null);
1437
- StyleSheetContext.displayName = "StyleSheetContext";
1438
- function createStyleRegistry() {
1439
- return new StyleSheetRegistry();
1440
- }
1441
- function StyleRegistry(param) {
1442
- var configuredRegistry = param.registry, children = param.children;
1443
- var rootRegistry = React$1$1.useContext(StyleSheetContext);
1444
- var ref = React$1$1.useState(function() {
1445
- return rootRegistry || configuredRegistry || createStyleRegistry();
1446
- }), registry = ref[0];
1447
- return /*#__PURE__*/ React__default["default"].createElement(StyleSheetContext.Provider, {
1448
- value: registry
1449
- }, children);
1450
- }
1451
- function useStyleRegistry() {
1452
- return React$1$1.useContext(StyleSheetContext);
1453
- }
1454
-
1455
- // Opt-into the new `useInsertionEffect` API in React 18, fallback to `useLayoutEffect`.
1456
- // https://github.com/reactwg/react-18/discussions/110
1457
- var useInsertionEffect = React__default["default"].useInsertionEffect || React$1$1.useLayoutEffect;
1458
- var defaultRegistry = typeof window !== "undefined" ? createStyleRegistry() : undefined;
1459
- function JSXStyle(props) {
1460
- var registry = defaultRegistry ? defaultRegistry : useStyleRegistry();
1461
- var insertionEffectCalled = React$1$1.useRef(false);
1462
- // `registry` might not exist while server-side rendering
1463
- if (!registry) {
1464
- return null;
1465
- }
1466
- if (typeof window === "undefined") {
1467
- registry.add(props);
1468
- return null;
1469
- }
1470
- useInsertionEffect(function() {
1471
- // ReactDOM removes all DOM during hydration in certain cases
1472
- if (!document.head) {
1473
- return;
1474
- }
1475
- registry.add(props);
1476
- insertionEffectCalled.current = true;
1477
- return function() {
1478
- insertionEffectCalled.current = false;
1479
- registry.remove(props);
1480
- };
1481
- }, [
1482
- props.id,
1483
- String(props.dynamic)
1484
- ]);
1485
- React$1$1.useLayoutEffect(function() {
1486
- if (!document.head || insertionEffectCalled.current) {
1487
- return;
1488
- }
1489
- registry.add(props);
1490
- return function() {
1491
- registry.remove(props);
1492
- };
1493
- // props.children can be string[], will be striped since id is identical
1494
- }, [
1495
- props.id,
1496
- String(props.dynamic)
1497
- ]);
1498
- return null;
1499
- }
1500
- JSXStyle.dynamic = function(info) {
1501
- return info.map(function(tagInfo) {
1502
- var baseId = tagInfo[0];
1503
- var props = tagInfo[1];
1504
- return computeId(baseId, props);
1505
- }).join(" ");
1506
- };
1507
-
1508
- index.StyleRegistry = StyleRegistry;
1509
- index.createStyleRegistry = createStyleRegistry;
1510
- index.style = JSXStyle;
1511
- index.useStyleRegistry = useStyleRegistry;
1512
- return index;
1513
- }
1514
-
1515
- var style;
1516
- var hasRequiredStyle;
1517
-
1518
- function requireStyle () {
1519
- if (hasRequiredStyle) return style;
1520
- hasRequiredStyle = 1;
1521
- style = requireIndex().style;
1522
- return style;
1523
- }
1524
-
1525
- var styleExports = requireStyle();
1526
- var _JSXStyle = /*@__PURE__*/getDefaultExportFromCjs(styleExports);
1527
-
1528
- /* "use client" */
1529
-
1530
- var getId = function getId() {
1531
- return Math.random().toString(32).slice(2, 10);
1532
- };
1533
- var isBrowser = function isBrowser() {
1534
- return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
1535
- };
1536
-
1537
- var useSSR = function useSSR() {
1538
- var _useState = React$1.useState(false),
1539
- _useState2 = _slicedToArray(_useState, 2),
1540
- browser = _useState2[0],
1541
- setBrowser = _useState2[1];
1542
- React$1.useEffect(function () {
1543
- setBrowser(isBrowser());
1544
- }, []);
1545
- return {
1546
- isBrowser: browser,
1547
- isServer: !browser
1548
- };
1549
- };
1550
-
1551
- var createElement = function createElement(id) {
1552
- var el = document.createElement('div');
1553
- el.setAttribute('id', id);
1554
- return el;
1555
- };
1556
- var usePortal = function usePortal() {
1557
- var selectId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getId();
1558
- var getContainer = arguments.length > 1 ? arguments[1] : undefined;
1559
- var id = "helpdice-ui-".concat(selectId);
1560
- var _useSSR = useSSR(),
1561
- isBrowser = _useSSR.isBrowser;
1562
- var _useState = React$1.useState(isBrowser ? createElement(id) : null),
1563
- _useState2 = _slicedToArray(_useState, 2),
1564
- elSnapshot = _useState2[0],
1565
- setElSnapshot = _useState2[1];
1566
- React$1.useEffect(function () {
1567
- var customContainer = getContainer ? getContainer() : null;
1568
- var parentElement = customContainer || document.body;
1569
- var hasElement = parentElement.querySelector("#".concat(id));
1570
- var el = hasElement || createElement(id);
1571
- if (!hasElement) {
1572
- parentElement.appendChild(el);
1573
- }
1574
- setElSnapshot(el);
1575
- }, []);
1576
- return elSnapshot;
1577
- };
1578
-
1579
- var _excluded$2 = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
1580
- var CssTransition = function CssTransition(_ref) {
1581
- var children = _ref.children,
1582
- _ref$className = _ref.className,
1583
- className = _ref$className === void 0 ? '' : _ref$className,
1584
- _ref$visible = _ref.visible,
1585
- visible = _ref$visible === void 0 ? false : _ref$visible,
1586
- _ref$enterTime = _ref.enterTime,
1587
- enterTime = _ref$enterTime === void 0 ? 60 : _ref$enterTime,
1588
- _ref$leaveTime = _ref.leaveTime,
1589
- leaveTime = _ref$leaveTime === void 0 ? 60 : _ref$leaveTime,
1590
- _ref$clearTime = _ref.clearTime,
1591
- clearTime = _ref$clearTime === void 0 ? 60 : _ref$clearTime,
1592
- _ref$name = _ref.name,
1593
- name = _ref$name === void 0 ? 'transition' : _ref$name,
1594
- props = _objectWithoutProperties(_ref, _excluded$2);
1595
- var _useState = React$1.useState(''),
1596
- _useState2 = _slicedToArray(_useState, 2),
1597
- classes = _useState2[0],
1598
- setClasses = _useState2[1];
1599
- var _useState3 = React$1.useState(visible),
1600
- _useState4 = _slicedToArray(_useState3, 2),
1601
- renderable = _useState4[0],
1602
- setRenderable = _useState4[1];
1603
- React$1.useEffect(function () {
1604
- var statusClassName = visible ? 'enter' : 'leave';
1605
- var time = visible ? enterTime : leaveTime;
1606
- if (visible && !renderable) {
1607
- setRenderable(true);
1608
- }
1609
- setClasses("".concat(name, "-").concat(statusClassName));
1610
-
1611
- // set class to active
1612
- var timer = setTimeout(function () {
1613
- setClasses("".concat(name, "-").concat(statusClassName, " ").concat(name, "-").concat(statusClassName, "-active"));
1614
- clearTimeout(timer);
1615
- }, time);
1616
-
1617
- // remove classess when animation over
1618
- var clearClassesTimer = setTimeout(function () {
1619
- if (!visible) {
1620
- setClasses('');
1621
- setRenderable(false);
1622
- }
1623
- clearTimeout(clearClassesTimer);
1624
- }, time + clearTime);
1625
- return function () {
1626
- clearTimeout(timer);
1627
- clearTimeout(clearClassesTimer);
1628
- };
1629
- }, [visible, renderable]);
1630
- if (! /*#__PURE__*/React$1.isValidElement(children) || !renderable) return null;
1631
- var propsTransition = _objectSpread2(_objectSpread2({}, props), {}, {
1632
- className: "".concat(children.props.className, " ").concat(className, " ").concat(classes)
1633
- });
1634
- return /*#__PURE__*/React$1.cloneElement(children, propsTransition);
1635
- };
1636
- CssTransition.displayName = 'CssTransition';
1637
-
1638
- var tuple = function tuple() {
1639
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1640
- args[_key] = arguments[_key];
1641
- }
1642
- return args;
1643
- };
1644
- tuple('default', 'secondary', 'success', 'warning', 'error', 'abort', 'secondary-light', 'success-light', 'warning-light', 'error-light');
1645
- tuple('default', 'secondary', 'success', 'warning', 'error');
1646
- tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite');
1647
- tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite', 'alert', 'purple', 'violet', 'cyan');
1648
- tuple('default', 'silent', 'prevent');
1649
- tuple('hover', 'click');
1650
- tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
1651
- tuple('start', 'center', 'end', 'left', 'right');
1652
-
1653
- var makeToastActions = function makeToastActions(actions, cancelHandle) {
1654
- var handler = function handler(event, userHandler) {
1655
- userHandler && userHandler(event, cancelHandle);
1656
- };
1657
- if (!actions || !actions.length) return null;
1658
- return actions.map(function (action, index) {
1659
- return /*#__PURE__*/React$1.createElement("button", {
1660
- color: action.passive ? 'default' : 'secondary',
1661
- key: "action-".concat(index),
1662
- onClick: function onClick(event) {
1663
- return handler(event, action.handler);
1664
- }
1665
- }, action.name);
1666
- });
1667
- };
1668
- var getColors = function getColors(palette, type) {
1669
- var colors = {
1670
- "default": palette.background,
1671
- secondary: palette.secondary,
1672
- success: palette.success,
1673
- warning: palette.warning,
1674
- error: palette.error
1675
- };
1676
- var isDefault = !type || type === 'default';
1677
- if (isDefault) return {
1678
- bgColor: colors["default"],
1679
- color: palette.foreground
1680
- };
1681
- /**
1682
- * Prevent main color change in special types.
1683
- * The color will only follow the theme when it is in the default type.
1684
- */
1685
- return {
1686
- bgColor: colors[type],
1687
- color: 'white'
1688
- };
1689
- };
1690
- tuple('topLeft', 'topRight', 'bottomLeft', 'bottomRight');
1691
- var isTopPlacement = function isTopPlacement(placement) {
1692
- return "".concat(placement).toLowerCase().startsWith('top');
1693
- };
1694
- var isLeftPlacement = function isLeftPlacement(placement) {
1695
- return "".concat(placement).toLowerCase().endsWith('left');
1696
- };
1697
- var getTranslateByPlacement = function getTranslateByPlacement(placement) {
1698
- var translateInByPlacement = {
1699
- topLeft: 'translate(-60px, -60px)',
1700
- topRight: 'translate(60px, -60px)',
1701
- bottomLeft: 'translate(-60px, 60px)',
1702
- bottomRight: 'translate(60px, 60px)'
1703
- };
1704
- var translateOutByPlacement = {
1705
- topLeft: 'translate(-50px, 15px) scale(0.85)',
1706
- topRight: 'translate(50px, 15px) scale(0.85)',
1707
- bottomLeft: 'translate(-50px, -15px) scale(0.85)',
1708
- bottomRight: 'translate(50px, -15px) scale(0.85)'
1709
- };
1710
- return {
1711
- enter: translateInByPlacement[placement],
1712
- leave: translateOutByPlacement[placement]
1713
- };
1714
- };
1715
-
1716
- var ToastItem = /*#__PURE__*/React$1.memo(function (_ref) {
1717
- var toast = _ref.toast,
1718
- layout = _ref.layout;
1719
- var theme = useTheme();
1720
- var _useMemo = React$1.useMemo(function () {
1721
- return getColors(theme.palette, toast.type);
1722
- }, [theme.palette, toast.type]),
1723
- color = _useMemo.color,
1724
- bgColor = _useMemo.bgColor;
1725
- var isReactNode = typeof toast.text !== 'string';
1726
- var padding = layout.padding,
1727
- margin = layout.margin,
1728
- maxHeight = layout.maxHeight,
1729
- maxWidth = layout.maxWidth,
1730
- width = layout.width,
1731
- placement = layout.placement;
1732
- var _useMemo2 = React$1.useMemo(function () {
1733
- return getTranslateByPlacement(placement);
1734
- }, [placement]),
1735
- enter = _useMemo2.enter,
1736
- leave = _useMemo2.leave;
1737
- return /*#__PURE__*/React$1.createElement(CssTransition, {
1738
- name: "toast",
1739
- visible: toast.visible,
1740
- clearTime: 350
1741
- }, /*#__PURE__*/React$1.createElement("div", {
1742
- key: toast.id,
1743
- className: _JSXStyle.dynamic([["1407001838", [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]]]) + " " + "toast"
1744
- }, isReactNode ? toast.text : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("div", {
1745
- className: _JSXStyle.dynamic([["1407001838", [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]]]) + " " + "message"
1746
- }, toast.text), /*#__PURE__*/React$1.createElement("div", {
1747
- className: _JSXStyle.dynamic([["1407001838", [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]]]) + " " + "action"
1748
- }, makeToastActions(toast.actions, toast.cancel))), /*#__PURE__*/React$1.createElement(_JSXStyle, {
1749
- id: "1407001838",
1750
- dynamic: [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]
1751
- }, ".toast.__jsx-style-dynamic-selector{width:".concat(width, ";max-width:").concat(maxWidth, ";max-height:").concat(maxHeight, ";display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:").concat(theme.palette.foreground, ";background-color:").concat(bgColor, ";color:").concat(color, ";border:0;border-radius:").concat(theme.layout.radius, ";opacity:1;box-shadow:").concat(theme.expressiveness.shadowSmall, ";-webkit-transition:all 350ms cubic-bezier(0.1,0.2,0.1,1);transition:all 350ms cubic-bezier(0.1,0.2,0.1,1);overflow:hidden;}.message.__jsx-style-dynamic-selector{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;font-size:0.875em;display:-webkit-box;word-break:break-all;padding-right:").concat(theme.layout.gapHalf, ";overflow:hidden;max-height:100%;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-height:1.1rem;}.toast-enter.__jsx-style-dynamic-selector{opacity:0;height:0;padding:0;margin:0;-webkit-transform:").concat(enter, ";-ms-transform:").concat(enter, ";transform:").concat(enter, ";}.toast-enter-active.__jsx-style-dynamic-selector{opacity:1;height:auto;margin:").concat(margin, ";padding:").concat(padding, ";-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0);}.toast-leave.__jsx-style-dynamic-selector{opacity:1;-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0);height:auto;margin:").concat(margin, ";padding:").concat(padding, ";}.toast-leave-active.__jsx-style-dynamic-selector{opacity:0;-webkit-transform:").concat(leave, ";-ms-transform:").concat(leave, ";transform:").concat(leave, ";}"))));
1752
- });
1753
-
1754
- /* "use client" */
1755
-
1756
- var classObjectToString = function classObjectToString(className) {
1757
- var keys = Object.keys(className);
1758
- var len = keys.length;
1759
- var str = '';
1760
- for (var index = 0; index < len; index++) {
1761
- var key = keys[index];
1762
- var val = className[keys[index]];
1763
- if (!val) continue;
1764
- str = str ? "".concat(str, " ").concat(String(key)) : String(key);
1765
- }
1766
- return str;
1767
- };
1768
- var isObjectClassName = function isObjectClassName(value) {
1769
- return _typeof(value) === 'object' && !Array.isArray(value);
1770
- };
1771
- var useClasses = function useClasses() {
1772
- var len = arguments.length;
1773
- var classes = '';
1774
- if (len === 0) return classes;
1775
- for (var index = 0; index < len; index++) {
1776
- var val = index < 0 || arguments.length <= index ? undefined : arguments[index];
1777
- if (!val) continue;
1778
- if (isObjectClassName(val)) {
1779
- classes += " ".concat(classObjectToString(val));
1780
- } else {
1781
- classes += " ".concat(String(val).trim());
1782
- }
1783
- }
1784
- return classes.trim();
1785
- };
1786
-
1787
- var ToastContainer = function ToastContainer() {
1788
- var theme = useTheme();
1789
- var portal = usePortal('toast');
1790
- var _useCurrentState = useCurrentState(false),
1791
- _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
1792
- setHovering = _useCurrentState2[1],
1793
- hoveringRef = _useCurrentState2[2];
1794
- var _useHUIContext = useHUIContext(),
1795
- toasts = _useHUIContext.toasts,
1796
- updateToasts = _useHUIContext.updateToasts,
1797
- toastLayout = _useHUIContext.toastLayout,
1798
- lastUpdateToastId = _useHUIContext.lastUpdateToastId;
1799
- var memoizedLayout = React$1.useMemo(function () {
1800
- return toastLayout;
1801
- }, [toastLayout]);
1802
- var toastElements = React$1.useMemo(function () {
1803
- return toasts.map(function (toast) {
1804
- return /*#__PURE__*/React$1.createElement(ToastItem, {
1805
- toast: toast,
1806
- layout: memoizedLayout,
1807
- key: toast._internalIdent
1808
- });
1809
- });
1810
- }, [toasts, memoizedLayout]);
1811
- var classNames = React$1.useMemo(function () {
1812
- return useClasses('toasts', {
1813
- top: isTopPlacement(toastLayout.placement),
1814
- left: isLeftPlacement(toastLayout.placement)
1815
- });
1816
- }, [memoizedLayout]);
1817
- var hoverHandler = function hoverHandler(isHovering) {
1818
- setHovering(isHovering);
1819
- if (isHovering) {
1820
- return updateToasts(function (last) {
1821
- return last.map(function (toast) {
1822
- if (!toast.visible) return toast;
1823
- toast._timeout && window.clearTimeout(toast._timeout);
1824
- return _objectSpread2(_objectSpread2({}, toast), {}, {
1825
- timeout: null
1826
- });
1827
- });
1828
- });
1829
- }
1830
- updateToasts(function (last) {
1831
- return last.map(function (toast, index) {
1832
- if (!toast.visible) return toast;
1833
- toast._timeout && window.clearTimeout(toast._timeout);
1834
- return _objectSpread2(_objectSpread2({}, toast), {}, {
1835
- _timeout: function () {
1836
- var timer = window.setTimeout(function () {
1837
- toast.cancel();
1838
- window.clearTimeout(timer);
1839
- }, toast.delay + index * 100);
1840
- return timer;
1841
- }()
1842
- });
1843
- });
1844
- });
1845
- };
1846
- React$1.useEffect(function () {
1847
- var index = toasts.findIndex(function (r) {
1848
- return r._internalIdent === lastUpdateToastId;
1849
- });
1850
- var toast = toasts[index];
1851
- if (!toast || toast.visible || !hoveringRef.current) return;
1852
- var hasVisible = toasts.find(function (r, i) {
1853
- return i < index && r.visible;
1854
- });
1855
- if (hasVisible || !hoveringRef.current) return;
1856
- hoverHandler(false);
1857
- }, [toasts, lastUpdateToastId]);
1858
- React$1.useEffect(function () {
1859
- var timeout = null;
1860
- var timer = window.setInterval(function () {
1861
- if (toasts.length === 0) return;
1862
- timeout = window.setTimeout(function () {
1863
- var allInvisible = !toasts.find(function (r) {
1864
- return r.visible;
1865
- });
1866
- allInvisible && updateToasts(function () {
1867
- return [];
1868
- });
1869
- timeout && clearTimeout(timeout);
1870
- }, 350);
1871
- }, 5000);
1872
- return function () {
1873
- timer && clearInterval(timer);
1874
- timeout && clearTimeout(timeout);
1875
- };
1876
- }, [toasts]);
1877
- if (!portal) return null;
1878
- if (!toasts || toasts.length === 0) return null;
1879
- return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React$1.createElement("div", {
1880
- onMouseEnter: function onMouseEnter() {
1881
- return hoverHandler(true);
1882
- },
1883
- onMouseLeave: function onMouseLeave() {
1884
- return hoverHandler(false);
1885
- },
1886
- className: _JSXStyle.dynamic([["622610754", [theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.layout.gap]]]) + " " + (classNames || "")
1887
- }, toastElements, /*#__PURE__*/React$1.createElement(_JSXStyle, {
1888
- id: "622610754",
1889
- dynamic: [theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.layout.gap]
1890
- }, ".toasts.__jsx-style-dynamic-selector{position:fixed;width:auto;max-width:100%;right:".concat(theme.layout.gap, ";bottom:").concat(theme.layout.gap, ";z-index:2000;-webkit-transition:all 400ms ease;transition:all 400ms ease;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.top.__jsx-style-dynamic-selector{bottom:unset;-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse;top:").concat(theme.layout.gap, ";}.left.__jsx-style-dynamic-selector{right:unset;left:").concat(theme.layout.gap, ";}"))), portal);
1891
- };
1892
-
1893
- var HuiProvider = function HuiProvider(_ref) {
1894
- var themes = _ref.themes,
1895
- themeType = _ref.themeType,
1896
- children = _ref.children;
1897
- var _React$useState = React$1.useState(''),
1898
- _React$useState2 = _slicedToArray(_React$useState, 2),
1899
- lastUpdateToastId = _React$useState2[0],
1900
- setLastUpdateToastId = _React$useState2[1];
1901
- var _useCurrentState = useCurrentState([]),
1902
- _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
1903
- toasts = _useCurrentState2[0],
1904
- setToasts = _useCurrentState2[1],
1905
- toastsRef = _useCurrentState2[2];
1906
- var _useCurrentState3 = useCurrentState(defaultToastLayout),
1907
- _useCurrentState4 = _slicedToArray(_useCurrentState3, 3),
1908
- toastLayout = _useCurrentState4[0],
1909
- setToastLayout = _useCurrentState4[1],
1910
- toastLayoutRef = _useCurrentState4[2];
1911
- var updateToasts = function updateToasts(fn) {
1912
- var nextToasts = fn(toastsRef.current);
1913
- setToasts(nextToasts);
1914
- };
1915
- var updateToastLayout = function updateToastLayout(fn) {
1916
- var nextLayout = fn(toastLayoutRef.current);
1917
- setToastLayout(nextLayout);
1918
- };
1919
- var updateLastToastId = function updateLastToastId(fn) {
1920
- setLastUpdateToastId(fn());
1921
- };
1922
- var initialValue = React$1.useMemo(function () {
1923
- return {
1924
- toasts: toasts,
1925
- toastLayout: toastLayout,
1926
- updateToasts: updateToasts,
1927
- lastUpdateToastId: lastUpdateToastId,
1928
- updateToastLayout: updateToastLayout,
1929
- updateLastToastId: updateLastToastId
1930
- };
1931
- }, [toasts, toastLayout, lastUpdateToastId]);
1932
- return /*#__PURE__*/React$1.createElement(HUIContent.Provider, {
1933
- value: initialValue
1934
- }, /*#__PURE__*/React$1.createElement(ThemeProvider, {
1935
- themes: themes,
1936
- themeType: themeType
1937
- }, children, /*#__PURE__*/React$1.createElement(ToastContainer, null)));
1938
- };
1939
-
1940
- // import flush from 'styled-jsx'
1941
-
1942
- // export type FlushToReact = <T>(opts?: { nonce?: string }) => Array<ReactElement<T>>
1943
-
1944
- // export type FlushToHTML = (opts?: { nonce?: string }) => string
1945
-
1946
- var CssBaseline = function CssBaseline(_ref) {
1947
- var children = _ref.children;
1948
- var theme = useTheme();
1949
- return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
1950
- id: "3647548829",
1951
- dynamic: [theme.palette.background, theme.palette.foreground, theme.palette.background, theme.font.sans, theme.font.sans, theme.palette.link, theme.expressiveness.linkStyle, theme.expressiveness.linkHoverStyle, theme.layout.gapHalf, theme.layout.gapHalf, theme.layout.gapHalf, theme.layout.gap, theme.palette.foreground, theme.palette.code, theme.font.mono, theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.palette.accents_2, theme.layout.radius, theme.font.mono, theme.palette.foreground, theme.palette.accents_2, theme.palette.accents_1, theme.layout.gap, theme.layout.gap, theme.palette.accents_5, theme.palette.accents_1, theme.layout.radius, theme.palette.border, theme.palette.selection, theme.palette.foreground]
1952
- }, "html,body{background-color:".concat(theme.palette.background, ";color:").concat(theme.palette.foreground, ";}html{font-size:16px;--helpdice-icons-background:").concat(theme.palette.background, ";}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-size:1rem;line-height:1.5;margin:0;padding:0;min-height:100%;position:relative;overflow-x:hidden;font-family:").concat(theme.font.sans, ";}#__next{overflow-x:hidden;}*,*:before,*:after{box-sizing:inherit;text-rendering:geometricPrecision;-webkit-tap-highlight-color:transparent;}p,small{font-weight:400;color:inherit;-webkit-letter-spacing:-0.005625em;-moz-letter-spacing:-0.005625em;-ms-letter-spacing:-0.005625em;letter-spacing:-0.005625em;font-family:").concat(theme.font.sans, ";}p{margin:1em 0;font-size:1em;line-height:1.625em;}small{margin:0;line-height:1.5;font-size:0.875em;}b{font-weight:600;}span{font-size:inherit;color:inherit;font-weight:inherit;}img{max-width:100%;}a{cursor:pointer;font-size:inherit;-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:").concat(theme.palette.link, ";-webkit-text-decoration:").concat(theme.expressiveness.linkStyle, ";text-decoration:").concat(theme.expressiveness.linkStyle, ";}a:hover{-webkit-text-decoration:").concat(theme.expressiveness.linkHoverStyle, ";text-decoration:").concat(theme.expressiveness.linkHoverStyle, ";}ul,ol{padding:0;list-style-type:none;margin:").concat(theme.layout.gapHalf, " ").concat(theme.layout.gapHalf, " ").concat(theme.layout.gapHalf, " ").concat(theme.layout.gap, ";color:").concat(theme.palette.foreground, ";}ol{list-style-type:decimal;}li{margin-bottom:0.625em;font-size:1em;line-height:1.625em;}h1,h2,h3,h4,h5,h6{color:inherit;margin:0 0 0.7rem 0;}h1{font-size:3rem;-webkit-letter-spacing:-0.02em;-moz-letter-spacing:-0.02em;-ms-letter-spacing:-0.02em;letter-spacing:-0.02em;line-height:1.5;font-weight:700;}h2{font-size:2.25rem;-webkit-letter-spacing:-0.02em;-moz-letter-spacing:-0.02em;-ms-letter-spacing:-0.02em;letter-spacing:-0.02em;font-weight:600;}h3{font-size:1.5rem;-webkit-letter-spacing:-0.02em;-moz-letter-spacing:-0.02em;-ms-letter-spacing:-0.02em;letter-spacing:-0.02em;font-weight:600;}h4{font-size:1.25rem;-webkit-letter-spacing:-0.02em;-moz-letter-spacing:-0.02em;-ms-letter-spacing:-0.02em;letter-spacing:-0.02em;font-weight:600;}h5{font-size:1rem;-webkit-letter-spacing:-0.01em;-moz-letter-spacing:-0.01em;-ms-letter-spacing:-0.01em;letter-spacing:-0.01em;font-weight:600;}h6{font-size:0.875rem;-webkit-letter-spacing:-0.005em;-moz-letter-spacing:-0.005em;-ms-letter-spacing:-0.005em;letter-spacing:-0.005em;font-weight:600;}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit;color:inherit;margin:0;}button:focus,input:focus,select:focus,textarea:focus{outline:none;}code{color:").concat(theme.palette.code, ";font-family:").concat(theme.font.mono, ";font-size:0.9em;white-space:pre-wrap;}code:before,code:after{content:'\\`';}pre{padding:calc(").concat(theme.layout.gap, " * 0.9) ").concat(theme.layout.gap, ";margin:").concat(theme.layout.gap, " 0;border:1px solid ").concat(theme.palette.accents_2, ";border-radius:").concat(theme.layout.radius, ";font-family:").concat(theme.font.mono, ";white-space:pre;overflow:auto;line-height:1.5;text-align:left;font-size:14px;-webkit-overflow-scrolling:touch;}pre code{color:").concat(theme.palette.foreground, ";font-size:1em;line-height:1.25em;white-space:pre;}pre code:before,pre code:after{display:none;}pre p{margin:0;}pre::-webkit-scrollbar{display:none;width:0;height:0;background:transparent;}hr{border-color:").concat(theme.palette.accents_2, ";}details{background-color:").concat(theme.palette.accents_1, ";border:none;}details:focus,details:hover,details:active{outline:none;}summary{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;outline:none;}summary::marker,summary::before,summary::-webkit-details-marker{display:none;}summary::-moz-list-bullet{font-size:0;}summary:focus,summary:hover,summary:active{outline:none;list-style:none;}blockquote{padding:calc(0.667 * ").concat(theme.layout.gap, ") ").concat(theme.layout.gap, ";color:").concat(theme.palette.accents_5, ";background-color:").concat(theme.palette.accents_1, ";border-radius:").concat(theme.layout.radius, ";margin:1.5em 0;border:1px solid ").concat(theme.palette.border, ";}blockquote *:first-child{margin-top:0;}blockquote *:last-child{margin-bottom:0;}::selection{background-color:").concat(theme.palette.selection, ";color:").concat(theme.palette.foreground, ";}")));
1953
- };
1954
- var MemoCssBaseline = /*#__PURE__*/React$1.memo(CssBaseline);
1955
-
1956
- var getElementOffset = function getElementOffset(el) {
1957
- if (!el) return {
1958
- top: 0,
1959
- left: 0
1960
- };
1961
- var _el$getBoundingClient = el.getBoundingClientRect(),
1962
- top = _el$getBoundingClient.top,
1963
- left = _el$getBoundingClient.left;
1964
- return {
1965
- top: top,
1966
- left: left
1967
- };
1968
- };
1969
- var defaultRect$1 = {
1970
- top: -1e3,
1971
- left: -1e3,
1972
- right: -1e3,
1973
- width: 0,
1974
- height: 0,
1975
- elementTop: -1e3
1976
- };
1977
- var getRectFromDOMWithContainer = function getRectFromDOMWithContainer(domRect, getContainer) {
1978
- if (!domRect) return defaultRect$1;
1979
- var container = getContainer ? getContainer() : null;
1980
- var scrollElement = container || document.documentElement;
1981
- var _getElementOffset = getElementOffset(container),
1982
- offsetTop = _getElementOffset.top,
1983
- offsetLeft = _getElementOffset.left;
1984
- return _objectSpread2(_objectSpread2({}, domRect), {}, {
1985
- width: domRect.width || domRect.right - domRect.left,
1986
- height: domRect.height || domRect.top - domRect.bottom,
1987
- top: domRect.bottom + scrollElement.scrollTop - offsetTop,
1988
- left: domRect.left + scrollElement.scrollLeft - offsetLeft,
1989
- elementTop: domRect.top + scrollElement.scrollTop - offsetTop
1990
- });
1991
- };
1992
- var isUnplacedRect = function isUnplacedRect(rect) {
1993
- if (!rect) return true;
1994
- return rect.top === defaultRect$1.top && rect.left === defaultRect$1.left;
1995
- };
1996
- var getRefRect = function getRefRect(ref, getContainer) {
1997
- if (!ref || !ref.current) return defaultRect$1;
1998
- var rect = ref.current.getBoundingClientRect();
1999
- return getRectFromDOMWithContainer(rect, getContainer);
2000
- };
2001
- var getEventRect = function getEventRect(event, getContainer) {
2002
- var _event$target;
2003
- var rect = event === null || event === void 0 || (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.getBoundingClientRect();
2004
- if (!rect) return defaultRect$1;
2005
- return getRectFromDOMWithContainer(rect, getContainer);
2006
- };
2007
- var isRefTarget = function isRefTarget(eventOrRef) {
2008
- return typeof (eventOrRef === null || eventOrRef === void 0 ? void 0 : eventOrRef.target) === 'undefined';
2009
- };
2010
- var useRect = function useRect(initialState) {
2011
- var _useState = React$1.useState(initialState || defaultRect$1),
2012
- _useState2 = _slicedToArray(_useState, 2),
2013
- rect = _useState2[0],
2014
- setRect = _useState2[1];
2015
- var updateRect = function updateRect(eventOrRef, getContainer) {
2016
- if (isRefTarget(eventOrRef)) return setRect(getRefRect(eventOrRef, getContainer));
2017
- setRect(getEventRect(eventOrRef, getContainer));
2018
- };
2019
- return {
2020
- rect: rect,
2021
- setRect: updateRect
2022
- };
2023
- };
2024
-
2025
- var defaultToast = {
2026
- delay: 2000,
2027
- type: 'default'
2028
- };
2029
- var useToasts = function useToasts(layout) {
2030
- var _useHUIContext = useHUIContext(),
2031
- updateToasts = _useHUIContext.updateToasts,
2032
- toasts = _useHUIContext.toasts,
2033
- updateToastLayout = _useHUIContext.updateToastLayout,
2034
- updateLastToastId = _useHUIContext.updateLastToastId;
2035
- React$1.useEffect(function () {
2036
- if (!layout) return;
2037
- updateToastLayout(function () {
2038
- return layout ? _objectSpread2(_objectSpread2({}, defaultToastLayout), layout) : defaultToastLayout;
2039
- });
2040
- }, []);
2041
- var _cancel = function cancel(internalId) {
2042
- updateToasts(function (currentToasts) {
2043
- return currentToasts.map(function (item) {
2044
- if (item._internalIdent !== internalId) return item;
2045
- return _objectSpread2(_objectSpread2({}, item), {}, {
2046
- visible: false
2047
- });
2048
- });
2049
- });
2050
- updateLastToastId(function () {
2051
- return internalId;
2052
- });
2053
- };
2054
- var removeAll = function removeAll() {
2055
- updateToasts(function (last) {
2056
- return last.map(function (toast) {
2057
- return _objectSpread2(_objectSpread2({}, toast), {}, {
2058
- visible: false
2059
- });
2060
- });
2061
- });
2062
- };
2063
- var findToastOneByID = function findToastOneByID(id) {
2064
- return toasts.find(function (t) {
2065
- return t.id === id;
2066
- });
2067
- };
2068
- var removeToastOneByID = function removeToastOneByID(id) {
2069
- updateToasts(function (last) {
2070
- return last.map(function (toast) {
2071
- if (toast.id !== id) return toast;
2072
- return _objectSpread2(_objectSpread2({}, toast), {}, {
2073
- visible: false
2074
- });
2075
- });
2076
- });
2077
- };
2078
- var setToast = function setToast(toast) {
2079
- var internalIdent = "toast-".concat(getId());
2080
- var delay = toast.delay || defaultToast.delay;
2081
- if (toast.id) {
2082
- var hasIdent = toasts.find(function (t) {
2083
- return t.id === toast.id;
2084
- });
2085
- if (hasIdent) {
2086
- throw new Error('Toast: Already have the same key: "ident"');
2087
- }
2088
- }
2089
- updateToasts(function (last) {
2090
- var newToast = {
2091
- delay: delay,
2092
- text: toast.text,
2093
- visible: true,
2094
- type: toast.type || defaultToast.type,
2095
- id: toast.id || internalIdent,
2096
- actions: toast.actions || [],
2097
- _internalIdent: internalIdent,
2098
- _timeout: window.setTimeout(function () {
2099
- _cancel(internalIdent);
2100
- if (newToast._timeout) {
2101
- window.clearTimeout(newToast._timeout);
2102
- newToast._timeout = null;
2103
- }
2104
- }, delay),
2105
- cancel: function cancel() {
2106
- return _cancel(internalIdent);
2107
- }
2108
- };
2109
- return [].concat(_toConsumableArray(last), [newToast]);
2110
- });
2111
- };
2112
- return {
2113
- toasts: toasts,
2114
- setToast: setToast,
2115
- removeAll: removeAll,
2116
- findToastOneByID: findToastOneByID,
2117
- removeToastOneByID: removeToastOneByID
2118
- };
2119
- };
2120
-
2121
- tuple('xs', 'sm', 'md', 'lg', 'xl', 'mobile');
2122
- tuple('up', 'down', 'default');
2123
- var defaultResponsiveOptions = {
2124
- match: 'default'
2125
- };
2126
- var makeQueries = function makeQueries(bp, up, down) {
2127
- var queryString = function queryString(item) {
2128
- var upQuery = "(min-width: ".concat(item.min, ")");
2129
- var downQuery = "(max-width: ".concat(item.max, ")");
2130
- return up ? upQuery : down ? downQuery : "".concat(upQuery, " and ").concat(downQuery);
2131
- };
2132
- var xs = queryString(bp.xs);
2133
- return {
2134
- xs: xs,
2135
- mobile: xs,
2136
- sm: queryString(bp.sm),
2137
- md: queryString(bp.md),
2138
- lg: queryString(bp.lg),
2139
- xl: queryString(bp.xl)
2140
- };
2141
- };
2142
- var useMediaQuery = function useMediaQuery(breakpoint) {
2143
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultResponsiveOptions;
2144
- var _options$match = options.match,
2145
- matchType = _options$match === void 0 ? 'default' : _options$match,
2146
- _options$ssrMatchMedi = options.ssrMatchMedia,
2147
- ssrMatchMedia = _options$ssrMatchMedi === void 0 ? null : _options$ssrMatchMedi;
2148
- var supportMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
2149
- var theme = useTheme();
2150
- var mediaQueries = React$1.useMemo(function () {
2151
- var up = matchType === 'up';
2152
- var down = matchType === 'down';
2153
- return makeQueries(theme.breakpoints, up, down);
2154
- }, [theme.breakpoints, options]);
2155
- var query = React$1.useMemo(function () {
2156
- return mediaQueries[breakpoint];
2157
- }, [mediaQueries, breakpoint]);
2158
- var matchQuery = function matchQuery(q) {
2159
- return window.matchMedia(q);
2160
- };
2161
-
2162
- /**
2163
- * Do nothing in the server-side rendering.
2164
- * If server match query fucntion is simulated, return user-defined value first.
2165
- */
2166
- var _useState = React$1.useState(function () {
2167
- if (supportMedia) return matchQuery(query).matches;
2168
- if (ssrMatchMedia && typeof ssrMatchMedia === 'function') {
2169
- return ssrMatchMedia(query).matches;
2170
- }
2171
- return false;
2172
- }),
2173
- _useState2 = _slicedToArray(_useState, 2),
2174
- state = _useState2[0],
2175
- setState = _useState2[1];
2176
- React$1.useEffect(function () {
2177
- if (!supportMedia) return;
2178
- var queryList = matchQuery(query);
2179
- var update = function update() {
2180
- return setState(matchQuery(query).matches);
2181
- };
2182
- update();
2183
-
2184
- /**
2185
- * addListener is deprecated. EventTarget.addEventListener is recommended.
2186
- * But in some old browsers, MediaQueryList does not inherit from EventTarget.
2187
- */
2188
- queryList.addListener(update);
2189
- return function () {
2190
- queryList.removeListener(update);
2191
- };
2192
- }, [supportMedia]);
2193
- return state;
2194
- };
2195
-
2196
- /* "use client" */
2197
-
2198
- var usePrevious = function usePrevious(state) {
2199
- var ref = React$1.useRef(null);
2200
- React$1.useEffect(function () {
2201
- ref.current = state;
2202
- });
2203
- return ref ? ref.current : null;
2204
- };
2205
-
2206
- var _excluded$1 = ["rect", "visible", "hoverHeightRatio", "hoverWidthRatio", "activeOpacity", "className"];
2207
- var Highlight = function Highlight(_ref) {
2208
- var rect = _ref.rect,
2209
- visible = _ref.visible,
2210
- _ref$hoverHeightRatio = _ref.hoverHeightRatio,
2211
- hoverHeightRatio = _ref$hoverHeightRatio === void 0 ? 1 : _ref$hoverHeightRatio,
2212
- _ref$hoverWidthRatio = _ref.hoverWidthRatio,
2213
- hoverWidthRatio = _ref$hoverWidthRatio === void 0 ? 1 : _ref$hoverWidthRatio,
2214
- _ref$activeOpacity = _ref.activeOpacity,
2215
- activeOpacity = _ref$activeOpacity === void 0 ? 0.8 : _ref$activeOpacity,
2216
- className = _ref.className,
2217
- props = _objectWithoutProperties(_ref, _excluded$1);
2218
- var theme = useTheme();
2219
- var ref = React$1.useRef(null);
2220
- var isFirstVisible = usePrevious(isUnplacedRect(rect));
2221
- var position = React$1.useMemo(function () {
2222
- var width = rect.width * hoverWidthRatio;
2223
- var height = rect.height * hoverHeightRatio;
2224
- return {
2225
- width: "".concat(width, "px"),
2226
- left: "".concat(rect.left + (rect.width - width) / 2, "px"),
2227
- height: "".concat(height, "px"),
2228
- top: "".concat(rect.elementTop + (rect.height - height) / 2, "px"),
2229
- transition: isFirstVisible ? 'opacity' : 'opacity, width, left, top'
2230
- };
2231
- }, [rect, hoverWidthRatio, hoverHeightRatio]);
2232
- return /*#__PURE__*/React$1.createElement("div", _extends({
2233
- ref: ref
2234
- }, props, {
2235
- className: _JSXStyle.dynamic([["603024321", [theme.palette.accents_2, position.width, position.left, position.height, position.top, visible ? activeOpacity : 0, position.transition]]]) + " " + (props && props.className != null && props.className || useClasses('highlight', className) || "")
2236
- }), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2237
- id: "603024321",
2238
- dynamic: [theme.palette.accents_2, position.width, position.left, position.height, position.top, visible ? activeOpacity : 0, position.transition]
2239
- }, ".highlight.__jsx-style-dynamic-selector{background:".concat(theme.palette.accents_2, ";position:absolute;border-radius:5px;width:").concat(position.width, ";left:").concat(position.left, ";height:").concat(position.height, ";top:").concat(position.top, ";opacity:").concat(visible ? activeOpacity : 0, ";-webkit-transition:0.15s ease;transition:0.15s ease;-webkit-transition-property:").concat(position.transition, ";transition-property:").concat(position.transition, ";}")));
2240
- };
2241
-
2242
- var Ellipsis = function Ellipsis(_ref) {
2243
- var children = _ref.children,
2244
- height = _ref.height;
2245
- return /*#__PURE__*/React$1.createElement("span", {
2246
- className: _JSXStyle.dynamic([["822089635", [height]]])
2247
- }, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2248
- id: "822089635",
2249
- dynamic: [height]
2250
- }, "span.__jsx-style-dynamic-selector{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:".concat(height, ";min-width:0;}")));
2251
- };
2252
- var ellipsis = /*#__PURE__*/React$1.memo(Ellipsis);
2253
-
2254
- var getRealShape = function getRealShape(el) {
2255
- var defaultShape = {
2256
- width: 0,
2257
- height: 0
2258
- };
2259
- if (!el || typeof window === 'undefined') return defaultShape;
2260
- var rect = el.getBoundingClientRect();
2261
- var _window$getComputedSt = window.getComputedStyle(el),
2262
- width = _window$getComputedSt.width,
2263
- height = _window$getComputedSt.height;
2264
- var getCSSStyleVal = function getCSSStyleVal(str, parentNum) {
2265
- if (!str) return 0;
2266
- var strVal = str.includes('px') ? +str.split('px')[0] : str.includes('%') ? +str.split('%')[0] * parentNum * 0.01 : str;
2267
- return Number.isNaN(+strVal) ? 0 : +strVal;
2268
- };
2269
- return {
2270
- width: getCSSStyleVal("".concat(width), rect.width),
2271
- height: getCSSStyleVal("".concat(height), rect.height)
2272
- };
2273
- };
2274
- var useRealShape = function useRealShape(ref) {
2275
- var _useState = React$1.useState({
2276
- width: 0,
2277
- height: 0
2278
- }),
2279
- _useState2 = _slicedToArray(_useState, 2),
2280
- state = _useState2[0],
2281
- setState = _useState2[1];
2282
- var update = function update() {
2283
- var _getRealShape = getRealShape(ref.current),
2284
- width = _getRealShape.width,
2285
- height = _getRealShape.height;
2286
- setState({
2287
- width: width,
2288
- height: height
2289
- });
2290
- };
2291
- React$1.useEffect(function () {
2292
- return update();
2293
- }, [ref.current]);
2294
- return [state, update];
2295
- };
2296
-
2297
- var Expand = function Expand(_ref) {
2298
- var _ref$isExpanded = _ref.isExpanded,
2299
- isExpanded = _ref$isExpanded === void 0 ? false : _ref$isExpanded,
2300
- _ref$delay = _ref.delay,
2301
- delay = _ref$delay === void 0 ? 200 : _ref$delay,
2302
- children = _ref.children;
2303
- var _useState = React$1.useState(isExpanded ? 'auto' : '0'),
2304
- _useState2 = _slicedToArray(_useState, 2),
2305
- height = _useState2[0],
2306
- setHeight = _useState2[1];
2307
- var _useState3 = React$1.useState(isExpanded),
2308
- _useState4 = _slicedToArray(_useState3, 2),
2309
- selfExpanded = _useState4[0],
2310
- setSelfExpanded = _useState4[1];
2311
- var _useState5 = React$1.useState(isExpanded),
2312
- _useState6 = _slicedToArray(_useState5, 2),
2313
- visible = _useState6[0],
2314
- setVisible = _useState6[1];
2315
- var contentRef = React$1.useRef(null);
2316
- var entryTimer = React$1.useRef();
2317
- var leaveTimer = React$1.useRef();
2318
- var resetTimer = React$1.useRef();
2319
- var _useRealShape = useRealShape(contentRef),
2320
- _useRealShape2 = _slicedToArray(_useRealShape, 2),
2321
- state = _useRealShape2[0],
2322
- updateShape = _useRealShape2[1];
2323
- var classes = useClasses('container', {
2324
- expanded: selfExpanded
2325
- });
2326
- React$1.useEffect(function () {
2327
- return setHeight("".concat(state.height, "px"));
2328
- }, [state.height]);
2329
- React$1.useEffect(function () {
2330
- // show element or reset height.
2331
- // force an update once manually, even if the element does not change.
2332
- // (the height of the element might be "auto")
2333
- if (isExpanded) {
2334
- setVisible(isExpanded);
2335
- } else {
2336
- updateShape();
2337
- setHeight("".concat(state.height, "px"));
2338
- }
2339
-
2340
- // show expand animation
2341
- entryTimer.current = window.setTimeout(function () {
2342
- setSelfExpanded(isExpanded);
2343
- clearTimeout(entryTimer.current);
2344
- }, 30);
2345
-
2346
- // Reset height after animation
2347
- if (isExpanded) {
2348
- resetTimer.current = window.setTimeout(function () {
2349
- setHeight('auto');
2350
- clearTimeout(resetTimer.current);
2351
- }, delay);
2352
- } else {
2353
- leaveTimer.current = window.setTimeout(function () {
2354
- setVisible(isExpanded);
2355
- clearTimeout(leaveTimer.current);
2356
- }, delay / 2);
2357
- }
2358
- return function () {
2359
- clearTimeout(entryTimer.current);
2360
- clearTimeout(leaveTimer.current);
2361
- clearTimeout(resetTimer.current);
2362
- };
2363
- }, [isExpanded]);
2364
- return /*#__PURE__*/React$1.createElement("div", {
2365
- className: _JSXStyle.dynamic([["1918690829", [visible ? 'visible' : 'hidden', delay, height]]]) + " " + (classes || "")
2366
- }, /*#__PURE__*/React$1.createElement("div", {
2367
- ref: contentRef,
2368
- className: _JSXStyle.dynamic([["1918690829", [visible ? 'visible' : 'hidden', delay, height]]]) + " " + "content"
2369
- }, children), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2370
- id: "1918690829",
2371
- dynamic: [visible ? 'visible' : 'hidden', delay, height]
2372
- }, ".container.__jsx-style-dynamic-selector{padding:0;margin:0;height:0;overflow:hidden;visibility:".concat(visible ? 'visible' : 'hidden', ";-webkit-transition:height ").concat(delay, "ms ease;transition:height ").concat(delay, "ms ease;}.expanded.__jsx-style-dynamic-selector{height:").concat(height, ";visibility:visible;}")));
2373
- };
2374
- Expand.displayName = 'Expand';
2375
-
2376
- /* "use client" */
2377
-
2378
- var useResize = function useResize(callback) {
2379
- var immediatelyInvoke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2380
- React$1.useEffect(function () {
2381
- var fn = function fn() {
2382
- return callback();
2383
- };
2384
- if (immediatelyInvoke) {
2385
- fn();
2386
- }
2387
- window.addEventListener('resize', fn);
2388
- return function () {
2389
- return window.removeEventListener('resize', fn);
2390
- };
2391
- }, []);
2392
- };
2393
-
2394
- /* "use client" */
2395
-
2396
- var useClickAnyWhere = function useClickAnyWhere(handler) {
2397
- React$1.useEffect(function () {
2398
- var callback = function callback(event) {
2399
- return handler(event);
2400
- };
2401
- document.addEventListener('click', callback);
2402
- return function () {
2403
- return document.removeEventListener('click', callback);
2404
- };
2405
- }, [handler]);
2406
- };
2407
-
2408
- /* "use client" */
2409
-
2410
- var useDOMObserver = function useDOMObserver(ref) {
2411
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
2412
- var config = {
2413
- attributes: false,
2414
- childList: true,
2415
- subtree: true
2416
- };
2417
- React$1.useEffect(function () {
2418
- if (!ref || !ref.current) return;
2419
- var unmount = false;
2420
- var done = function done() {
2421
- if (unmount) return;
2422
- callback.apply(void 0, arguments);
2423
- };
2424
- var observer = new MutationObserver(done);
2425
- observer.observe(ref.current, config);
2426
- return function () {
2427
- unmount = true;
2428
- observer.disconnect();
2429
- };
2430
- }, [ref]);
2431
- };
2432
-
2433
- var warningStack = {};
2434
- var useWarning = function useWarning(message, component) {
2435
- var tag = ' ';
2436
- var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
2437
- if (typeof console === 'undefined') return;
2438
- if (warningStack[log]) return;
2439
- warningStack[log] = true;
2440
- if (process.env.NODE_ENV !== 'production') {
2441
- return console.error(log);
2442
- }
2443
- console.warn(log);
2444
- };
2445
-
2446
- var defaultRect = {
2447
- top: -1e3,
2448
- left: -1e3,
2449
- right: -1e3,
2450
- width: 0
2451
- };
2452
- var Dropdown = /*#__PURE__*/React$1.memo(function (_ref) {
2453
- var children = _ref.children,
2454
- parent = _ref.parent,
2455
- visible = _ref.visible,
2456
- disableMatchWidth = _ref.disableMatchWidth,
2457
- getPopupContainer = _ref.getPopupContainer;
2458
- var el = usePortal('dropdown', getPopupContainer);
2459
- var _useState = React$1.useState(defaultRect),
2460
- _useState2 = _slicedToArray(_useState, 2),
2461
- rect = _useState2[0],
2462
- setRect = _useState2[1];
2463
- var classes = useClasses('dropdown', disableMatchWidth ? 'disable-match' : 'width-match');
2464
- if (!parent) return null;
2465
-
2466
- /* istanbul ignore next */
2467
- if (process.env.NODE_ENV !== 'production') {
2468
- if (getPopupContainer && getPopupContainer()) {
2469
- var _el = getPopupContainer();
2470
- var style = window.getComputedStyle(_el);
2471
- if (style.position === 'static') {
2472
- useWarning('The element specified by "getPopupContainer" must have "position" set.');
2473
- }
2474
- }
2475
- }
2476
- var updateRect = function updateRect() {
2477
- var _getRefRect = getRefRect(parent, getPopupContainer),
2478
- top = _getRefRect.top,
2479
- left = _getRefRect.left,
2480
- right = _getRefRect.right,
2481
- nativeWidth = _getRefRect.width;
2482
- setRect({
2483
- top: top,
2484
- left: left,
2485
- right: right,
2486
- width: nativeWidth
2487
- });
2488
- };
2489
- useResize(updateRect);
2490
- useClickAnyWhere(function () {
2491
- var _getRefRect2 = getRefRect(parent, getPopupContainer),
2492
- top = _getRefRect2.top,
2493
- left = _getRefRect2.left;
2494
- var shouldUpdatePosition = top !== rect.top || left !== rect.left;
2495
- if (!shouldUpdatePosition) return;
2496
- updateRect();
2497
- });
2498
- useDOMObserver(parent, function () {
2499
- updateRect();
2500
- });
2501
- React$1.useEffect(function () {
2502
- if (!parent || !parent.current) return;
2503
- parent.current.addEventListener('mouseenter', updateRect);
2504
- /* istanbul ignore next */
2505
- return function () {
2506
- if (!parent || !parent.current) return;
2507
- parent.current.removeEventListener('mouseenter', updateRect);
2508
- };
2509
- }, [parent]);
2510
- var clickHandler = function clickHandler(event) {
2511
- event.stopPropagation();
2512
- event.nativeEvent.stopImmediatePropagation();
2513
- event.preventDefault();
2514
- };
2515
- var mouseDownHandler = function mouseDownHandler(event) {
2516
- event.preventDefault();
2517
- };
2518
- if (!el) return null;
2519
- return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React$1.createElement(CssTransition, {
2520
- visible: visible
2521
- }, /*#__PURE__*/React$1.createElement("div", {
2522
- onClick: clickHandler,
2523
- onMouseDown: mouseDownHandler,
2524
- className: _JSXStyle.dynamic([["1644673105", [rect.top + 2, rect.left, rect.width, rect.width]]]) + " " + (classes || "")
2525
- }, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2526
- id: "1644673105",
2527
- dynamic: [rect.top + 2, rect.left, rect.width, rect.width]
2528
- }, ".dropdown.__jsx-style-dynamic-selector{position:absolute;top:".concat(rect.top + 2, "px;left:").concat(rect.left, "px;z-index:1100;}.width-match.__jsx-style-dynamic-selector{width:").concat(rect.width, "px;}.disable-match.__jsx-style-dynamic-selector{min-width:").concat(rect.width, "px;}")))), el);
2529
- });
2530
-
2531
- var _excluded = ["children", "onClick", "visible", "width", "onContentClick", "backdropClassName", "positionClassName", "layerClassName"];
2532
- var Backdrop = /*#__PURE__*/React$1.memo(function (_ref) {
2533
- var children = _ref.children,
2534
- _ref$onClick = _ref.onClick,
2535
- onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
2536
- _ref$visible = _ref.visible,
2537
- visible = _ref$visible === void 0 ? false : _ref$visible,
2538
- width = _ref.width,
2539
- _ref$onContentClick = _ref.onContentClick,
2540
- onContentClick = _ref$onContentClick === void 0 ? function () {} : _ref$onContentClick,
2541
- _ref$backdropClassNam = _ref.backdropClassName,
2542
- backdropClassName = _ref$backdropClassNam === void 0 ? '' : _ref$backdropClassNam,
2543
- _ref$positionClassNam = _ref.positionClassName,
2544
- positionClassName = _ref$positionClassNam === void 0 ? '' : _ref$positionClassNam,
2545
- _ref$layerClassName = _ref.layerClassName,
2546
- layerClassName = _ref$layerClassName === void 0 ? '' : _ref$layerClassName,
2547
- props = _objectWithoutProperties(_ref, _excluded);
2548
- var theme = useTheme();
2549
- var _useCurrentState = useCurrentState(false),
2550
- _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
2551
- setIsContentMouseDown = _useCurrentState2[1],
2552
- IsContentMouseDownRef = _useCurrentState2[2];
2553
- var clickHandler = function clickHandler(event) {
2554
- if (IsContentMouseDownRef.current) return;
2555
- onClick && onClick(event);
2556
- };
2557
- var mouseUpHandler = function mouseUpHandler() {
2558
- if (!IsContentMouseDownRef.current) return;
2559
- var timer = setTimeout(function () {
2560
- setIsContentMouseDown(false);
2561
- clearTimeout(timer);
2562
- }, 0);
2563
- };
2564
- return /*#__PURE__*/React$1.createElement(CssTransition, {
2565
- name: "backdrop-wrapper",
2566
- visible: visible,
2567
- clearTime: 300
2568
- }, /*#__PURE__*/React$1.createElement("div", _extends({
2569
- onClick: clickHandler,
2570
- onMouseUp: mouseUpHandler
2571
- }, props, {
2572
- className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (props && props.className != null && props.className || useClasses('backdrop', backdropClassName) || "")
2573
- }), /*#__PURE__*/React$1.createElement("div", {
2574
- className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (useClasses('layer', layerClassName) || "")
2575
- }), /*#__PURE__*/React$1.createElement("div", {
2576
- onClick: onContentClick,
2577
- onMouseDown: function onMouseDown() {
2578
- return setIsContentMouseDown(true);
2579
- },
2580
- className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (useClasses('position', positionClassName) || "")
2581
- }, children), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2582
- id: "2021762493",
2583
- dynamic: [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]
2584
- }, ".backdrop.__jsx-style-dynamic-selector{position:fixed;top:0;left:0;right:0;bottom:0;overflow:auto;z-index:1000;-webkit-overflow-scrolling:touch;box-sizing:border-box;text-align:center;}.position.__jsx-style-dynamic-selector{position:relative;z-index:1001;outline:none;max-width:90%;width:".concat(width, ";margin:20px auto;vertical-align:middle;display:inline-block;}.backdrop.__jsx-style-dynamic-selector:before{display:inline-block;width:0;height:100%;vertical-align:middle;content:'';}.layer.__jsx-style-dynamic-selector{position:fixed;top:0;left:0;right:0;bottom:0;width:100%;height:100%;opacity:").concat(theme.expressiveness.portalOpacity, ";background-color:black;-webkit-transition:opacity 0.35s cubic-bezier(0.4,0,0.2,1);transition:opacity 0.35s cubic-bezier(0.4,0,0.2,1);pointer-events:none;z-index:1000;}.backdrop-wrapper-enter.__jsx-style-dynamic-selector .layer.__jsx-style-dynamic-selector{opacity:0;}.backdrop-wrapper-enter-active.__jsx-style-dynamic-selector .layer.__jsx-style-dynamic-selector{opacity:").concat(theme.expressiveness.portalOpacity, ";}.backdrop-wrapper-leave.__jsx-style-dynamic-selector .layer.__jsx-style-dynamic-selector{opacity:").concat(theme.expressiveness.portalOpacity, ";}.backdrop-wrapper-leave-active.__jsx-style-dynamic-selector .layer.__jsx-style-dynamic-selector{opacity:0;}"))));
2585
- });
2586
- Backdrop.displayName = 'Backdrop';
2587
-
2588
- dist.Backdrop = Backdrop;
2589
- dist.CssBaseline = MemoCssBaseline;
2590
- dist.CssTransition = CssTransition;
2591
- dist.Dropdown = Dropdown;
2592
- dist.Ellipsis = ellipsis;
2593
- dist.Expand = Expand;
2594
- dist.Highlight = Highlight;
2595
- dist.Themes = Themes;
2596
- dist.UiProvider = HuiProvider;
2597
- dist.useAllThemes = useAllThemes;
2598
- dist.useClasses = useClasses;
2599
- dist.useCurrentState = useCurrentState;
2600
- dist.useMediaQuery = useMediaQuery;
2601
- dist.useRect = useRect;
2602
- dist.useTheme = useTheme;
2603
- dist.useToasts = useToasts;
2604
- return dist;
2605
- }
2606
-
2607
- var distExports = /*@__PURE__*/ requireDist();
2608
-
2609
491
  var index = {};
2610
492
 
2611
493
  var hasRequiredIndex;
@@ -3239,7 +1121,7 @@ var withScale = function withScale(Render) {
3239
1121
  var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31;
3240
1122
  var children = _ref.children,
3241
1123
  props = _objectWithoutProperties(_ref, _excluded$5);
3242
- var _useTheme = distExports.useTheme(),
1124
+ var _useTheme = theme.useTheme(),
3243
1125
  layout = _useTheme.layout;
3244
1126
  var paddingLeft = props.paddingLeft,
3245
1127
  pl = props.pl,
@@ -3372,7 +1254,7 @@ var DrawerWrapper = function DrawerWrapper(_ref) {
3372
1254
  visible = _ref$visible === void 0 ? false : _ref$visible,
3373
1255
  placement = _ref.placement,
3374
1256
  props = _objectWithoutProperties(_ref, _excluded$4);
3375
- var theme = distExports.useTheme();
1257
+ var theme$1 = theme.useTheme();
3376
1258
  var _useScale = useScale(),
3377
1259
  SCALES = _useScale.SCALES;
3378
1260
  var modalContent = React.useRef(null);
@@ -3381,7 +1263,7 @@ var DrawerWrapper = function DrawerWrapper(_ref) {
3381
1263
  var transform = React.useMemo(function () {
3382
1264
  return getDrawerTransform(placement);
3383
1265
  }, [placement]);
3384
- var classes = distExports.useClasses('wrapper', placement, className);
1266
+ var classes = theme.useClasses('wrapper', placement, className);
3385
1267
  React.useEffect(function () {
3386
1268
  if (!visible) return;
3387
1269
  var activeElement = document.activeElement;
@@ -3403,7 +1285,7 @@ var DrawerWrapper = function DrawerWrapper(_ref) {
3403
1285
  }
3404
1286
  }
3405
1287
  };
3406
- return /*#__PURE__*/React.createElement(distExports.CssTransition, {
1288
+ return /*#__PURE__*/React.createElement(theme.CssTransition, {
3407
1289
  name: "wrapper",
3408
1290
  visible: visible,
3409
1291
  clearTime: 300
@@ -3413,21 +1295,21 @@ var DrawerWrapper = function DrawerWrapper(_ref) {
3413
1295
  onKeyDown: onKeyDown,
3414
1296
  ref: modalContent
3415
1297
  }, props, {
3416
- className: _JSXStyle.dynamic([["3022633861", [theme.palette.background, theme.palette.foreground, theme.layout.radius, theme.expressiveness.shadowLarge, transform.initial, SCALES.font(1), SCALES.pl(1.3125), SCALES.pr(1.3125), SCALES.pt(1.3125), SCALES.pb(1.3125), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.width(1, 'auto'), SCALES.height(1, '100%'), transform.hidden, transform.visible, transform.visible, transform.hidden]]]) + " " + (props && props.className != null && props.className || classes || "")
1298
+ className: _JSXStyle.dynamic([["3022633861", [theme$1.palette.background, theme$1.palette.foreground, theme$1.layout.radius, theme$1.expressiveness.shadowLarge, transform.initial, SCALES.font(1), SCALES.pl(1.3125), SCALES.pr(1.3125), SCALES.pt(1.3125), SCALES.pb(1.3125), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.width(1, 'auto'), SCALES.height(1, '100%'), transform.hidden, transform.visible, transform.visible, transform.hidden]]]) + " " + (props && props.className != null && props.className || classes || "")
3417
1299
  }), /*#__PURE__*/React.createElement("div", {
3418
1300
  tabIndex: 0,
3419
1301
  "aria-hidden": "true",
3420
1302
  ref: tabStart,
3421
- className: _JSXStyle.dynamic([["3022633861", [theme.palette.background, theme.palette.foreground, theme.layout.radius, theme.expressiveness.shadowLarge, transform.initial, SCALES.font(1), SCALES.pl(1.3125), SCALES.pr(1.3125), SCALES.pt(1.3125), SCALES.pb(1.3125), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.width(1, 'auto'), SCALES.height(1, '100%'), transform.hidden, transform.visible, transform.visible, transform.hidden]]]) + " " + "hide-tab start"
1303
+ className: _JSXStyle.dynamic([["3022633861", [theme$1.palette.background, theme$1.palette.foreground, theme$1.layout.radius, theme$1.expressiveness.shadowLarge, transform.initial, SCALES.font(1), SCALES.pl(1.3125), SCALES.pr(1.3125), SCALES.pt(1.3125), SCALES.pb(1.3125), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.width(1, 'auto'), SCALES.height(1, '100%'), transform.hidden, transform.visible, transform.visible, transform.hidden]]]) + " " + "hide-tab start"
3422
1304
  }), children, /*#__PURE__*/React.createElement("div", {
3423
1305
  tabIndex: 0,
3424
1306
  "aria-hidden": "true",
3425
1307
  ref: tabEnd,
3426
- className: _JSXStyle.dynamic([["3022633861", [theme.palette.background, theme.palette.foreground, theme.layout.radius, theme.expressiveness.shadowLarge, transform.initial, SCALES.font(1), SCALES.pl(1.3125), SCALES.pr(1.3125), SCALES.pt(1.3125), SCALES.pb(1.3125), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.width(1, 'auto'), SCALES.height(1, '100%'), transform.hidden, transform.visible, transform.visible, transform.hidden]]]) + " " + "hide-tab end"
1308
+ className: _JSXStyle.dynamic([["3022633861", [theme$1.palette.background, theme$1.palette.foreground, theme$1.layout.radius, theme$1.expressiveness.shadowLarge, transform.initial, SCALES.font(1), SCALES.pl(1.3125), SCALES.pr(1.3125), SCALES.pt(1.3125), SCALES.pb(1.3125), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.width(1, 'auto'), SCALES.height(1, '100%'), transform.hidden, transform.visible, transform.visible, transform.hidden]]]) + " " + "hide-tab end"
3427
1309
  }), /*#__PURE__*/React.createElement(_JSXStyle, {
3428
1310
  id: "3022633861",
3429
- dynamic: [theme.palette.background, theme.palette.foreground, theme.layout.radius, theme.expressiveness.shadowLarge, transform.initial, SCALES.font(1), SCALES.pl(1.3125), SCALES.pr(1.3125), SCALES.pt(1.3125), SCALES.pb(1.3125), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.width(1, 'auto'), SCALES.height(1, '100%'), transform.hidden, transform.visible, transform.visible, transform.hidden]
3430
- }, ".wrapper.__jsx-style-dynamic-selector{position:fixed;top:0;left:0;right:0;bottom:0;max-width:100%;vertical-align:middle;overflow:auto;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;box-sizing:border-box;background-color:".concat(theme.palette.background, ";color:").concat(theme.palette.foreground, ";border-radius:calc(3 * ").concat(theme.layout.radius, ");box-shadow:").concat(theme.expressiveness.shadowLarge, ";opacity:0;outline:none;-webkit-transform:").concat(transform.initial, ";-ms-transform:").concat(transform.initial, ";transform:").concat(transform.initial, ";-webkit-transition:opacity,-webkit-transform 400ms cubic-bezier(0.1,0.6,0.1,1);-webkit-transition:opacity,transform 400ms cubic-bezier(0.1,0.6,0.1,1);transition:opacity,transform 400ms cubic-bezier(0.1,0.6,0.1,1);font-size:").concat(SCALES.font(1), ";--modal-wrapper-padding-left:").concat(SCALES.pl(1.3125), ";--modal-wrapper-padding-right:").concat(SCALES.pr(1.3125), ";padding:").concat(SCALES.pt(1.3125), " var(--modal-wrapper-padding-right) ").concat(SCALES.pb(1.3125), " var(--modal-wrapper-padding-left);margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.top.__jsx-style-dynamic-selector,.bottom.__jsx-style-dynamic-selector{width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 'auto'), ";}.left.__jsx-style-dynamic-selector,.right.__jsx-style-dynamic-selector{width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, '100%'), ";}.top.__jsx-style-dynamic-selector{bottom:auto;border-top-left-radius:0;border-top-right-radius:0;}.left.__jsx-style-dynamic-selector{right:auto;border-top-left-radius:0;border-bottom-left-radius:0;}.bottom.__jsx-style-dynamic-selector{top:auto;border-bottom-left-radius:0;border-bottom-right-radius:0;}.right.__jsx-style-dynamic-selector{left:auto;border-top-right-radius:0;border-bottom-right-radius:0;}.wrapper-enter.__jsx-style-dynamic-selector{opacity:0;-webkit-transform:").concat(transform.hidden, ";-ms-transform:").concat(transform.hidden, ";transform:").concat(transform.hidden, ";}.wrapper-enter-active.__jsx-style-dynamic-selector{opacity:1;-webkit-transform:").concat(transform.visible, ";-ms-transform:").concat(transform.visible, ";transform:").concat(transform.visible, ";}.wrapper-leave.__jsx-style-dynamic-selector{opacity:1;-webkit-transform:").concat(transform.visible, ";-ms-transform:").concat(transform.visible, ";transform:").concat(transform.visible, ";-webkit-transition:opacity,-webkit-transform 400ms cubic-bezier(0.1,0.2,0.1,1);-webkit-transition:opacity,transform 400ms cubic-bezier(0.1,0.2,0.1,1);transition:opacity,transform 400ms cubic-bezier(0.1,0.2,0.1,1);}.wrapper-leave-active.__jsx-style-dynamic-selector{opacity:0.4;-webkit-transform:").concat(transform.hidden, ";-ms-transform:").concat(transform.hidden, ";transform:").concat(transform.hidden, ";}.hide-tab.__jsx-style-dynamic-selector{outline:none;overflow:hidden;width:0;height:0;opacity:0;}"))));
1311
+ dynamic: [theme$1.palette.background, theme$1.palette.foreground, theme$1.layout.radius, theme$1.expressiveness.shadowLarge, transform.initial, SCALES.font(1), SCALES.pl(1.3125), SCALES.pr(1.3125), SCALES.pt(1.3125), SCALES.pb(1.3125), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.width(1, 'auto'), SCALES.height(1, '100%'), transform.hidden, transform.visible, transform.visible, transform.hidden]
1312
+ }, ".wrapper.__jsx-style-dynamic-selector{position:fixed;top:0;left:0;right:0;bottom:0;max-width:100%;vertical-align:middle;overflow:auto;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;box-sizing:border-box;background-color:".concat(theme$1.palette.background, ";color:").concat(theme$1.palette.foreground, ";border-radius:calc(3 * ").concat(theme$1.layout.radius, ");box-shadow:").concat(theme$1.expressiveness.shadowLarge, ";opacity:0;outline:none;-webkit-transform:").concat(transform.initial, ";-ms-transform:").concat(transform.initial, ";transform:").concat(transform.initial, ";-webkit-transition:opacity,-webkit-transform 400ms cubic-bezier(0.1,0.6,0.1,1);-webkit-transition:opacity,transform 400ms cubic-bezier(0.1,0.6,0.1,1);transition:opacity,transform 400ms cubic-bezier(0.1,0.6,0.1,1);font-size:").concat(SCALES.font(1), ";--modal-wrapper-padding-left:").concat(SCALES.pl(1.3125), ";--modal-wrapper-padding-right:").concat(SCALES.pr(1.3125), ";padding:").concat(SCALES.pt(1.3125), " var(--modal-wrapper-padding-right) ").concat(SCALES.pb(1.3125), " var(--modal-wrapper-padding-left);margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.top.__jsx-style-dynamic-selector,.bottom.__jsx-style-dynamic-selector{width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 'auto'), ";}.left.__jsx-style-dynamic-selector,.right.__jsx-style-dynamic-selector{width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, '100%'), ";}.top.__jsx-style-dynamic-selector{bottom:auto;border-top-left-radius:0;border-top-right-radius:0;}.left.__jsx-style-dynamic-selector{right:auto;border-top-left-radius:0;border-bottom-left-radius:0;}.bottom.__jsx-style-dynamic-selector{top:auto;border-bottom-left-radius:0;border-bottom-right-radius:0;}.right.__jsx-style-dynamic-selector{left:auto;border-top-right-radius:0;border-bottom-right-radius:0;}.wrapper-enter.__jsx-style-dynamic-selector{opacity:0;-webkit-transform:").concat(transform.hidden, ";-ms-transform:").concat(transform.hidden, ";transform:").concat(transform.hidden, ";}.wrapper-enter-active.__jsx-style-dynamic-selector{opacity:1;-webkit-transform:").concat(transform.visible, ";-ms-transform:").concat(transform.visible, ";transform:").concat(transform.visible, ";}.wrapper-leave.__jsx-style-dynamic-selector{opacity:1;-webkit-transform:").concat(transform.visible, ";-ms-transform:").concat(transform.visible, ";transform:").concat(transform.visible, ";-webkit-transition:opacity,-webkit-transform 400ms cubic-bezier(0.1,0.2,0.1,1);-webkit-transition:opacity,transform 400ms cubic-bezier(0.1,0.2,0.1,1);transition:opacity,transform 400ms cubic-bezier(0.1,0.2,0.1,1);}.wrapper-leave-active.__jsx-style-dynamic-selector{opacity:0.4;-webkit-transform:").concat(transform.hidden, ";-ms-transform:").concat(transform.hidden, ";transform:").concat(transform.hidden, ";}.hide-tab.__jsx-style-dynamic-selector{outline:none;overflow:hidden;width:0;height:0;opacity:0;}"))));
3431
1313
  };
3432
1314
  DrawerWrapper.displayName = 'DrawerWrapper';
3433
1315
 
@@ -3477,7 +1359,7 @@ var DrawerComponent = function DrawerComponent(_ref) {
3477
1359
  closeDrawer();
3478
1360
  };
3479
1361
  if (!portal) return null;
3480
- return /*#__PURE__*/require$$1.createPortal(/*#__PURE__*/React.createElement(distExports.Backdrop, _extends({
1362
+ return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React.createElement(theme.Backdrop, _extends({
3481
1363
  onClick: closeFromBackdrop,
3482
1364
  onContentClick: onContentClick,
3483
1365
  visible: visible,
@@ -3496,15 +1378,15 @@ var ModalTitleComponent = function ModalTitleComponent(_ref) {
3496
1378
  className = _ref$className === void 0 ? '' : _ref$className,
3497
1379
  children = _ref.children,
3498
1380
  props = _objectWithoutProperties(_ref, _excluded$2);
3499
- var theme = distExports.useTheme();
1381
+ var theme$1 = theme.useTheme();
3500
1382
  var _useScale = useScale(),
3501
1383
  SCALES = _useScale.SCALES;
3502
1384
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h2", _extends({}, props, {
3503
- className: _JSXStyle.dynamic([["2865939188", [SCALES.font(1.5), theme.palette.foreground, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || "")
1385
+ className: _JSXStyle.dynamic([["2865939188", [SCALES.font(1.5), theme$1.palette.foreground, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || "")
3504
1386
  }), children), /*#__PURE__*/React.createElement(_JSXStyle, {
3505
1387
  id: "2865939188",
3506
- dynamic: [SCALES.font(1.5), theme.palette.foreground, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
3507
- }, "h2.__jsx-style-dynamic-selector{line-height:1.6;font-weight:normal;text-align:center;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;word-break:break-word;text-transform:capitalize;font-size:".concat(SCALES.font(1.5), ";color:").concat(theme.palette.foreground, ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}")));
1388
+ dynamic: [SCALES.font(1.5), theme$1.palette.foreground, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
1389
+ }, "h2.__jsx-style-dynamic-selector{line-height:1.6;font-weight:normal;text-align:center;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;word-break:break-word;text-transform:capitalize;font-size:".concat(SCALES.font(1.5), ";color:").concat(theme$1.palette.foreground, ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}")));
3508
1390
  };
3509
1391
  ModalTitleComponent.displayName = 'ModalTitle';
3510
1392
  var ModalTitle = withScale(ModalTitleComponent);
@@ -3515,15 +1397,15 @@ var ModalSubtitleComponent = function ModalSubtitleComponent(_ref) {
3515
1397
  className = _ref$className === void 0 ? '' : _ref$className,
3516
1398
  children = _ref.children,
3517
1399
  props = _objectWithoutProperties(_ref, _excluded$1);
3518
- var theme = distExports.useTheme();
1400
+ var theme$1 = theme.useTheme();
3519
1401
  var _useScale = useScale(),
3520
1402
  SCALES = _useScale.SCALES;
3521
1403
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", _extends({}, props, {
3522
- className: _JSXStyle.dynamic([["2550488204", [theme.palette.accents_5, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, '1.5em'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || "")
1404
+ className: _JSXStyle.dynamic([["2550488204", [theme$1.palette.accents_5, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, '1.5em'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || "")
3523
1405
  }), children), /*#__PURE__*/React.createElement(_JSXStyle, {
3524
1406
  id: "2550488204",
3525
- dynamic: [theme.palette.accents_5, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, '1.5em'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
3526
- }, "p.__jsx-style-dynamic-selector{font-weight:normal;display:inline-block;text-align:center;word-break:break-word;text-transform:uppercase;color:".concat(theme.palette.accents_5, ";font-size:").concat(SCALES.font(0.875), ";line-height:1.5em;width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, '1.5em'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}")));
1407
+ dynamic: [theme$1.palette.accents_5, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, '1.5em'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
1408
+ }, "p.__jsx-style-dynamic-selector{font-weight:normal;display:inline-block;text-align:center;word-break:break-word;text-transform:uppercase;color:".concat(theme$1.palette.accents_5, ";font-size:").concat(SCALES.font(0.875), ";line-height:1.5em;width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, '1.5em'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}")));
3527
1409
  };
3528
1410
  ModalSubtitleComponent.displayName = 'ModalSubtitle';
3529
1411
  var ModalSubtitle = withScale(ModalSubtitleComponent);
@@ -3537,7 +1419,7 @@ var ModalContentComponent = function ModalContentComponent(_ref) {
3537
1419
  var _useScale = useScale(),
3538
1420
  SCALES = _useScale.SCALES;
3539
1421
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({}, props, {
3540
- className: _JSXStyle.dynamic([["498745028", [SCALES.font(1), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(1.3125), SCALES.pr(1.3125), SCALES.pb(0.6625), SCALES.pl(1.3125), SCALES.mt(0), SCALES.mr(0, 'calc(var(--modal-wrapper-padding-right) * -1)'), SCALES.mb(0), SCALES.ml(0, 'calc(var(--modal-wrapper-padding-left) * -1)')]]]) + " " + (props && props.className != null && props.className || distExports.useClasses('content', className) || "")
1422
+ className: _JSXStyle.dynamic([["498745028", [SCALES.font(1), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(1.3125), SCALES.pr(1.3125), SCALES.pb(0.6625), SCALES.pl(1.3125), SCALES.mt(0), SCALES.mr(0, 'calc(var(--modal-wrapper-padding-right) * -1)'), SCALES.mb(0), SCALES.ml(0, 'calc(var(--modal-wrapper-padding-left) * -1)')]]]) + " " + (props && props.className != null && props.className || theme.useClasses('content', className) || "")
3541
1423
  }), children), /*#__PURE__*/React.createElement(_JSXStyle, {
3542
1424
  id: "498745028",
3543
1425
  dynamic: [SCALES.font(1), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(1.3125), SCALES.pr(1.3125), SCALES.pb(0.6625), SCALES.pl(1.3125), SCALES.mt(0), SCALES.mr(0, 'calc(var(--modal-wrapper-padding-right) * -1)'), SCALES.mb(0), SCALES.ml(0, 'calc(var(--modal-wrapper-padding-left) * -1)')]