@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,7 @@
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 theme = require('@helpdice/theme');
7
7
 
8
8
  function _arrayLikeToArray(r, a) {
9
9
  (null == a || a > r.length) && (a = r.length);
@@ -674,2137 +674,18 @@ function requireStyle () {
674
674
  var styleExports = requireStyle();
675
675
  var _JSXStyle = /*@__PURE__*/getDefaultExportFromCjs(styleExports);
676
676
 
677
- var dist = {};
678
-
679
- var hasRequiredDist;
680
-
681
- function requireDist () {
682
- if (hasRequiredDist) return dist;
683
- hasRequiredDist = 1;
684
-
685
- var React$1 = React;
686
- var reactDom = require$$1;
687
-
688
- function _arrayLikeToArray(r, a) {
689
- (null == a || a > r.length) && (a = r.length);
690
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
691
- return n;
692
- }
693
- function _arrayWithHoles(r) {
694
- if (Array.isArray(r)) return r;
695
- }
696
- function _arrayWithoutHoles(r) {
697
- if (Array.isArray(r)) return _arrayLikeToArray(r);
698
- }
699
- function _defineProperty(e, r, t) {
700
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
701
- value: t,
702
- enumerable: true,
703
- configurable: true,
704
- writable: true
705
- }) : e[r] = t, e;
706
- }
707
- function _extends() {
708
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
709
- for (var e = 1; e < arguments.length; e++) {
710
- var t = arguments[e];
711
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
712
- }
713
- return n;
714
- }, _extends.apply(null, arguments);
715
- }
716
- function _iterableToArray(r) {
717
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
718
- }
719
- function _iterableToArrayLimit(r, l) {
720
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
721
- if (null != t) {
722
- var e,
723
- n,
724
- i,
725
- u,
726
- a = [],
727
- f = true,
728
- o = false;
729
- try {
730
- if (i = (t = t.call(r)).next, 0 === l) {
731
- if (Object(t) !== t) return;
732
- f = !1;
733
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
734
- } catch (r) {
735
- o = true, n = r;
736
- } finally {
737
- try {
738
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
739
- } finally {
740
- if (o) throw n;
741
- }
742
- }
743
- return a;
744
- }
745
- }
746
- function _nonIterableRest() {
747
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
748
- }
749
- function _nonIterableSpread() {
750
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
751
- }
752
- function ownKeys(e, r) {
753
- var t = Object.keys(e);
754
- if (Object.getOwnPropertySymbols) {
755
- var o = Object.getOwnPropertySymbols(e);
756
- r && (o = o.filter(function (r) {
757
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
758
- })), t.push.apply(t, o);
759
- }
760
- return t;
761
- }
762
- function _objectSpread2(e) {
763
- for (var r = 1; r < arguments.length; r++) {
764
- var t = null != arguments[r] ? arguments[r] : {};
765
- r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
766
- _defineProperty(e, r, t[r]);
767
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
768
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
769
- });
770
- }
771
- return e;
772
- }
773
- function _objectWithoutProperties(e, t) {
774
- if (null == e) return {};
775
- var o,
776
- r,
777
- i = _objectWithoutPropertiesLoose(e, t);
778
- if (Object.getOwnPropertySymbols) {
779
- var n = Object.getOwnPropertySymbols(e);
780
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
781
- }
782
- return i;
783
- }
784
- function _objectWithoutPropertiesLoose(r, e) {
785
- if (null == r) return {};
786
- var t = {};
787
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
788
- if (-1 !== e.indexOf(n)) continue;
789
- t[n] = r[n];
790
- }
791
- return t;
792
- }
793
- function _slicedToArray(r, e) {
794
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
795
- }
796
- function _toConsumableArray(r) {
797
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
798
- }
799
- function _toPrimitive(t, r) {
800
- if ("object" != typeof t || !t) return t;
801
- var e = t[Symbol.toPrimitive];
802
- if (void 0 !== e) {
803
- var i = e.call(t, r);
804
- if ("object" != typeof i) return i;
805
- throw new TypeError("@@toPrimitive must return a primitive value.");
806
- }
807
- return ("string" === r ? String : Number)(t);
808
- }
809
- function _toPropertyKey(t) {
810
- var i = _toPrimitive(t, "string");
811
- return "symbol" == typeof i ? i : i + "";
812
- }
813
- function _typeof(o) {
814
- "@babel/helpers - typeof";
815
-
816
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
817
- return typeof o;
818
- } : function (o) {
819
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
820
- }, _typeof(o);
821
- }
822
- function _unsupportedIterableToArray(r, a) {
823
- if (r) {
824
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
825
- var t = {}.toString.call(r).slice(8, -1);
826
- 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;
827
- }
828
- }
829
-
830
- var defaultToastLayout = {
831
- padding: '12px 16px',
832
- margin: '8px 0',
833
- width: '420px',
834
- maxWidth: '90vw',
835
- maxHeight: '75px',
836
- placement: 'bottomRight'
837
- };
838
- var defaultParams = {
839
- toasts: [],
840
- toastLayout: defaultToastLayout,
841
- updateToastLayout: function updateToastLayout(t) {
842
- return t;
843
- },
844
- updateToasts: function updateToasts(t) {
845
- return t;
846
- },
847
- lastUpdateToastId: null,
848
- updateLastToastId: function updateLastToastId() {
849
- return null;
850
- }
851
- };
852
- var HUIContent = /*#__PURE__*/React$1.createContext(defaultParams);
853
- var useHUIContext = function useHUIContext() {
854
- return React$1.useContext(HUIContent);
855
- };
856
-
857
- var defaultFont = {
858
- sans: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
859
- mono: 'Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace',
860
- prism: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,"Liberation Mono", "Courier New", monospace'
861
- };
862
- var defaultBreakpoints = {
863
- xs: {
864
- min: '0',
865
- max: '650px'
866
- },
867
- sm: {
868
- min: '650px',
869
- max: '900px'
870
- },
871
- md: {
872
- min: '900px',
873
- max: '1280px'
874
- },
875
- lg: {
876
- min: '1280px',
877
- max: '1920px'
878
- },
879
- xl: {
880
- min: '1920px',
881
- max: '10000px'
882
- }
883
- };
884
- var defaultLayout = {
885
- gap: '16pt',
886
- gapNegative: '-16pt',
887
- gapHalf: '8pt',
888
- gapHalfNegative: '-8pt',
889
- gapQuarter: '4pt',
890
- gapQuarterNegative: '-4pt',
891
- pageMargin: '16pt',
892
- pageWidth: '750pt',
893
- pageWidthWithMargin: '782pt',
894
- breakpointMobile: defaultBreakpoints.xs.max,
895
- breakpointTablet: defaultBreakpoints.sm.max,
896
- radius: '6px',
897
- unit: '16px'
898
- };
899
-
900
- var palette$1 = {
901
- accents_1: '#fafafa',
902
- accents_2: '#eaeaea',
903
- accents_3: '#999',
904
- accents_4: '#888',
905
- accents_5: '#666',
906
- accents_6: '#444',
907
- accents_7: '#333',
908
- accents_8: '#111',
909
- background: '#fff',
910
- foreground: '#000',
911
- selection: '#79ffe1',
912
- secondary: '#666',
913
- code: '#f81ce5',
914
- border: '#eaeaea',
915
- error: '#e00',
916
- errorLight: '#ff1a1a',
917
- errorLighter: '#f7d4d6',
918
- errorDark: '#c50000',
919
- success: '#0070f3',
920
- successLight: '#3291ff',
921
- successLighter: '#d3e5ff',
922
- successDark: '#0761d1',
923
- warning: '#f5a623',
924
- warningLight: '#f7b955',
925
- warningLighter: '#ffefcf',
926
- warningDark: '#ab570a',
927
- cyan: '#50e3c2',
928
- cyanLighter: '#aaffec',
929
- cyanLight: '#79ffe1',
930
- cyanDark: '#29bc9b',
931
- violet: '#7928ca',
932
- violetLighter: '#e3d7fc',
933
- violetLight: '#8a63d2',
934
- violetDark: '#4c2889',
935
- purple: '#f81ce5',
936
- alert: '#ff0080',
937
- magenta: '#eb367f',
938
- link: '#0070f3'
939
- };
940
- var expressiveness$1 = {
941
- linkStyle: 'none',
942
- linkHoverStyle: 'none',
943
- dropdownBoxShadow: '0 4px 4px 0 rgba(0, 0, 0, 0.02)',
944
- scrollerStart: 'rgba(255, 255, 255, 1)',
945
- scrollerEnd: 'rgba(255, 255, 255, 0)',
946
- shadowSmall: '0 5px 10px rgba(0, 0, 0, 0.12)',
947
- shadowMedium: '0 8px 30px rgba(0, 0, 0, 0.12)',
948
- shadowLarge: '0 30px 60px rgba(0, 0, 0, 0.12)',
949
- portalOpacity: 0.25
950
- };
951
- var font$1 = defaultFont;
952
- var breakpoints$1 = defaultBreakpoints;
953
- var layout$1 = defaultLayout;
954
- var themes$1 = {
955
- type: 'light',
956
- font: font$1,
957
- layout: layout$1,
958
- palette: palette$1,
959
- breakpoints: breakpoints$1,
960
- expressiveness: expressiveness$1
961
- };
962
-
963
- var palette = {
964
- accents_1: '#111',
965
- accents_2: '#333',
966
- accents_3: '#444',
967
- accents_4: '#666',
968
- accents_5: '#888',
969
- accents_6: '#999',
970
- accents_7: '#eaeaea',
971
- accents_8: '#fafafa',
972
- background: '#000',
973
- foreground: '#fff',
974
- selection: '#f81ce5',
975
- secondary: '#888',
976
- code: '#79ffe1',
977
- border: '#333',
978
- error: '#e00',
979
- errorLighter: '#f7d4d6',
980
- errorLight: '#ff1a1a',
981
- errorDark: '#c50000',
982
- success: '#0070f3',
983
- successLighter: '#d3e5ff',
984
- successLight: '#3291ff',
985
- successDark: '#0761d1',
986
- warning: '#f5a623',
987
- warningLighter: '#ffefcf',
988
- warningLight: '#f7b955',
989
- warningDark: '#ab570a',
990
- cyan: '#50e3c2',
991
- cyanLighter: '#aaffec',
992
- cyanLight: '#79ffe1',
993
- cyanDark: '#29bc9b',
994
- violet: '#7928ca',
995
- violetLighter: '#e3d7fc',
996
- violetLight: '#8a63d2',
997
- violetDark: '#4c2889',
998
- purple: '#f81ce5',
999
- alert: '#ff0080',
1000
- magenta: '#eb367f',
1001
- link: '#3291ff'
1002
- };
1003
- var expressiveness = {
1004
- linkStyle: 'none',
1005
- linkHoverStyle: 'none',
1006
- dropdownBoxShadow: '0 0 0 1px #333',
1007
- scrollerStart: 'rgba(255, 255, 255, 1)',
1008
- scrollerEnd: 'rgba(255, 255, 255, 0)',
1009
- shadowSmall: '0 0 0 1px #333',
1010
- shadowMedium: '0 0 0 1px #333',
1011
- shadowLarge: '0 0 0 1px #333',
1012
- portalOpacity: 0.75
1013
- };
1014
- var font = defaultFont;
1015
- var breakpoints = defaultBreakpoints;
1016
- var layout = defaultLayout;
1017
- var themes = {
1018
- type: 'dark',
1019
- font: font,
1020
- layout: layout,
1021
- palette: palette,
1022
- breakpoints: breakpoints,
1023
- expressiveness: expressiveness
1024
- };
1025
-
1026
- var isObject = function isObject(target) {
1027
- return target && _typeof(target) === 'object';
1028
- };
1029
- var _deepDuplicable = function deepDuplicable(source, target) {
1030
- if (!isObject(target) || !isObject(source)) return source;
1031
- var sourceKeys = Object.keys(source);
1032
- var result = {};
1033
- for (var _i = 0, _sourceKeys = sourceKeys; _i < _sourceKeys.length; _i++) {
1034
- var key = _sourceKeys[_i];
1035
- var sourceValue = source[key];
1036
- var targetValue = target[key];
1037
- if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
1038
- result[key] = targetValue.concat(sourceValue);
1039
- } else if (isObject(sourceValue) && isObject(targetValue)) {
1040
- result[key] = _deepDuplicable(sourceValue, _objectSpread2({}, targetValue));
1041
- } else if (targetValue) {
1042
- result[key] = targetValue;
1043
- } else {
1044
- result[key] = sourceValue;
1045
- }
1046
- }
1047
- return result;
1048
- };
1049
- var getPresets = function getPresets() {
1050
- return [themes$1, themes];
1051
- };
1052
- var getPresetStaticTheme = function getPresetStaticTheme() {
1053
- return themes$1;
1054
- };
1055
- var isAvailableThemeType = function isAvailableThemeType(type) {
1056
- if (!type) return false;
1057
- var presetThemes = getPresets();
1058
- var hasType = presetThemes.find(function (theme) {
1059
- return theme.type === type;
1060
- });
1061
- return !hasType;
1062
- };
1063
- var isPresetTheme = function isPresetTheme(themeOrType) {
1064
- if (!themeOrType) return false;
1065
- var isType = typeof themeOrType === 'string';
1066
- var type = isType ? themeOrType : themeOrType.type;
1067
- return !isAvailableThemeType(type);
1068
- };
1069
- var hasUserCustomTheme = function hasUserCustomTheme() {
1070
- var themes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1071
- return !!themes.find(function (item) {
1072
- return isAvailableThemeType(item.type);
1073
- });
1074
- };
1075
- var create = function create(base, custom) {
1076
- if (!isAvailableThemeType(custom.type)) {
1077
- throw new Error('Duplicate or unavailable theme type');
1078
- }
1079
- return _deepDuplicable(base, custom);
1080
- };
1081
- var createFromDark = function createFromDark(custom) {
1082
- return create(themes, custom);
1083
- };
1084
- var createFromLight = function createFromLight(custom) {
1085
- return create(themes$1, custom);
1086
- };
1087
- var Themes = {
1088
- isPresetTheme: isPresetTheme,
1089
- isAvailableThemeType: isAvailableThemeType,
1090
- hasUserCustomTheme: hasUserCustomTheme,
1091
- getPresets: getPresets,
1092
- getPresetStaticTheme: getPresetStaticTheme,
1093
- create: create,
1094
- createFromDark: createFromDark,
1095
- createFromLight: createFromLight
1096
- };
1097
-
1098
- /* "use client" */
1099
-
1100
- var defaultTheme = Themes.getPresetStaticTheme();
1101
- var ThemeContext = /*#__PURE__*/React$1.createContext(defaultTheme);
1102
- var useTheme = function useTheme() {
1103
- return React$1.useContext(ThemeContext);
1104
- };
1105
-
1106
- /* "use client" */
1107
-
1108
- var defaultAllThemesConfig = {
1109
- themes: Themes.getPresets()
1110
- };
1111
- var AllThemesContext = /*#__PURE__*/React$1.createContext(defaultAllThemesConfig);
1112
- var useAllThemes = function useAllThemes() {
1113
- return React$1.useContext(AllThemesContext);
1114
- };
1115
-
1116
- var ThemeProvider = function ThemeProvider(_ref) {
1117
- var children = _ref.children,
1118
- themeType = _ref.themeType,
1119
- _ref$themes = _ref.themes,
1120
- themes = _ref$themes === void 0 ? [] : _ref$themes;
1121
- var _React$useState = React$1.useState({
1122
- themes: Themes.getPresets()
1123
- }),
1124
- _React$useState2 = _slicedToArray(_React$useState, 2),
1125
- allThemes = _React$useState2[0],
1126
- setAllThemes = _React$useState2[1];
1127
- var currentTheme = React$1.useMemo(function () {
1128
- var theme = allThemes.themes.find(function (item) {
1129
- return item.type === themeType;
1130
- });
1131
- if (theme) return theme;
1132
- return Themes.getPresetStaticTheme();
1133
- }, [allThemes, themeType]);
1134
- React$1.useEffect(function () {
1135
- if (!(themes !== null && themes !== void 0 && themes.length)) return;
1136
- setAllThemes(function (last) {
1137
- var safeThemes = themes.filter(function (item) {
1138
- return Themes.isAvailableThemeType(item.type);
1139
- });
1140
- var nextThemes = Themes.getPresets().concat(safeThemes);
1141
- return _objectSpread2(_objectSpread2({}, last), {}, {
1142
- themes: nextThemes
1143
- });
1144
- });
1145
- }, [themes]);
1146
- return /*#__PURE__*/React$1.createElement(AllThemesContext.Provider, {
1147
- value: allThemes
1148
- }, /*#__PURE__*/React$1.createElement(ThemeContext.Provider, {
1149
- value: currentTheme
1150
- }, children));
1151
- };
1152
-
1153
- var useCurrentState = function useCurrentState(initialState) {
1154
- var _useState = React$1.useState(function () {
1155
- return typeof initialState === 'function' ? initialState() : initialState;
1156
- }),
1157
- _useState2 = _slicedToArray(_useState, 2),
1158
- state = _useState2[0],
1159
- setState = _useState2[1];
1160
- var ref = React$1.useRef(initialState);
1161
- React$1.useEffect(function () {
1162
- ref.current = state;
1163
- }, [state]);
1164
- var setValue = function setValue(val) {
1165
- var result = typeof val === 'function' ? val(ref.current) : val;
1166
- ref.current = result;
1167
- setState(result);
1168
- };
1169
- return [state, setValue, ref];
1170
- };
1171
-
1172
- function getDefaultExportFromCjs (x) {
1173
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1174
- }
1175
-
1176
- var index = {};
1177
-
1178
- var hasRequiredIndex;
1179
-
1180
- function requireIndex () {
1181
- if (hasRequiredIndex) return index;
1182
- hasRequiredIndex = 1;
1183
- var React$1$1 = React$1;
1184
-
1185
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
1186
-
1187
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1$1);
1188
-
1189
- /*
1190
- Based on Glamor's sheet
1191
- https://github.com/threepointone/glamor/blob/667b480d31b3721a905021b26e1290ce92ca2879/src/sheet.js
1192
- */ function _defineProperties(target, props) {
1193
- for(var i = 0; i < props.length; i++){
1194
- var descriptor = props[i];
1195
- descriptor.enumerable = descriptor.enumerable || false;
1196
- descriptor.configurable = true;
1197
- if ("value" in descriptor) descriptor.writable = true;
1198
- Object.defineProperty(target, descriptor.key, descriptor);
1199
- }
1200
- }
1201
- function _createClass(Constructor, protoProps, staticProps) {
1202
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1203
- return Constructor;
1204
- }
1205
- var isProd = typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production";
1206
- var isString = function(o) {
1207
- return Object.prototype.toString.call(o) === "[object String]";
1208
- };
1209
- var StyleSheet = /*#__PURE__*/ function() {
1210
- function StyleSheet(param) {
1211
- var ref = param === void 0 ? {} : param, _name = ref.name, name = _name === void 0 ? "stylesheet" : _name, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? isProd : _optimizeForSpeed;
1212
- invariant$1(isString(name), "`name` must be a string");
1213
- this._name = name;
1214
- this._deletedRulePlaceholder = "#" + name + "-deleted-rule____{}";
1215
- invariant$1(typeof optimizeForSpeed === "boolean", "`optimizeForSpeed` must be a boolean");
1216
- this._optimizeForSpeed = optimizeForSpeed;
1217
- this._serverSheet = undefined;
1218
- this._tags = [];
1219
- this._injected = false;
1220
- this._rulesCount = 0;
1221
- var node = typeof window !== "undefined" && document.querySelector('meta[property="csp-nonce"]');
1222
- this._nonce = node ? node.getAttribute("content") : null;
1223
- }
1224
- var _proto = StyleSheet.prototype;
1225
- _proto.setOptimizeForSpeed = function setOptimizeForSpeed(bool) {
1226
- invariant$1(typeof bool === "boolean", "`setOptimizeForSpeed` accepts a boolean");
1227
- invariant$1(this._rulesCount === 0, "optimizeForSpeed cannot be when rules have already been inserted");
1228
- this.flush();
1229
- this._optimizeForSpeed = bool;
1230
- this.inject();
1231
- };
1232
- _proto.isOptimizeForSpeed = function isOptimizeForSpeed() {
1233
- return this._optimizeForSpeed;
1234
- };
1235
- _proto.inject = function inject() {
1236
- var _this = this;
1237
- invariant$1(!this._injected, "sheet already injected");
1238
- this._injected = true;
1239
- if (typeof window !== "undefined" && this._optimizeForSpeed) {
1240
- this._tags[0] = this.makeStyleTag(this._name);
1241
- this._optimizeForSpeed = "insertRule" in this.getSheet();
1242
- if (!this._optimizeForSpeed) {
1243
- if (!isProd) {
1244
- console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode.");
1245
- }
1246
- this.flush();
1247
- this._injected = true;
1248
- }
1249
- return;
1250
- }
1251
- this._serverSheet = {
1252
- cssRules: [],
1253
- insertRule: function(rule, index) {
1254
- if (typeof index === "number") {
1255
- _this._serverSheet.cssRules[index] = {
1256
- cssText: rule
1257
- };
1258
- } else {
1259
- _this._serverSheet.cssRules.push({
1260
- cssText: rule
1261
- });
1262
- }
1263
- return index;
1264
- },
1265
- deleteRule: function(index) {
1266
- _this._serverSheet.cssRules[index] = null;
1267
- }
1268
- };
1269
- };
1270
- _proto.getSheetForTag = function getSheetForTag(tag) {
1271
- if (tag.sheet) {
1272
- return tag.sheet;
1273
- }
1274
- // this weirdness brought to you by firefox
1275
- for(var i = 0; i < document.styleSheets.length; i++){
1276
- if (document.styleSheets[i].ownerNode === tag) {
1277
- return document.styleSheets[i];
1278
- }
1279
- }
1280
- };
1281
- _proto.getSheet = function getSheet() {
1282
- return this.getSheetForTag(this._tags[this._tags.length - 1]);
1283
- };
1284
- _proto.insertRule = function insertRule(rule, index) {
1285
- invariant$1(isString(rule), "`insertRule` accepts only strings");
1286
- if (typeof window === "undefined") {
1287
- if (typeof index !== "number") {
1288
- index = this._serverSheet.cssRules.length;
1289
- }
1290
- this._serverSheet.insertRule(rule, index);
1291
- return this._rulesCount++;
1292
- }
1293
- if (this._optimizeForSpeed) {
1294
- var sheet = this.getSheet();
1295
- if (typeof index !== "number") {
1296
- index = sheet.cssRules.length;
1297
- }
1298
- // this weirdness for perf, and chrome's weird bug
1299
- // https://stackoverflow.com/questions/20007992/chrome-suddenly-stopped-accepting-insertrule
1300
- try {
1301
- sheet.insertRule(rule, index);
1302
- } catch (error) {
1303
- if (!isProd) {
1304
- console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
1305
- }
1306
- return -1;
1307
- }
1308
- } else {
1309
- var insertionPoint = this._tags[index];
1310
- this._tags.push(this.makeStyleTag(this._name, rule, insertionPoint));
1311
- }
1312
- return this._rulesCount++;
1313
- };
1314
- _proto.replaceRule = function replaceRule(index, rule) {
1315
- if (this._optimizeForSpeed || typeof window === "undefined") {
1316
- var sheet = typeof window !== "undefined" ? this.getSheet() : this._serverSheet;
1317
- if (!rule.trim()) {
1318
- rule = this._deletedRulePlaceholder;
1319
- }
1320
- if (!sheet.cssRules[index]) {
1321
- // @TBD Should we throw an error?
1322
- return index;
1323
- }
1324
- sheet.deleteRule(index);
1325
- try {
1326
- sheet.insertRule(rule, index);
1327
- } catch (error) {
1328
- if (!isProd) {
1329
- console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
1330
- }
1331
- // In order to preserve the indices we insert a deleteRulePlaceholder
1332
- sheet.insertRule(this._deletedRulePlaceholder, index);
1333
- }
1334
- } else {
1335
- var tag = this._tags[index];
1336
- invariant$1(tag, "old rule at index `" + index + "` not found");
1337
- tag.textContent = rule;
1338
- }
1339
- return index;
1340
- };
1341
- _proto.deleteRule = function deleteRule(index) {
1342
- if (typeof window === "undefined") {
1343
- this._serverSheet.deleteRule(index);
1344
- return;
1345
- }
1346
- if (this._optimizeForSpeed) {
1347
- this.replaceRule(index, "");
1348
- } else {
1349
- var tag = this._tags[index];
1350
- invariant$1(tag, "rule at index `" + index + "` not found");
1351
- tag.parentNode.removeChild(tag);
1352
- this._tags[index] = null;
1353
- }
1354
- };
1355
- _proto.flush = function flush() {
1356
- this._injected = false;
1357
- this._rulesCount = 0;
1358
- if (typeof window !== "undefined") {
1359
- this._tags.forEach(function(tag) {
1360
- return tag && tag.parentNode.removeChild(tag);
1361
- });
1362
- this._tags = [];
1363
- } else {
1364
- // simpler on server
1365
- this._serverSheet.cssRules = [];
1366
- }
1367
- };
1368
- _proto.cssRules = function cssRules() {
1369
- var _this = this;
1370
- if (typeof window === "undefined") {
1371
- return this._serverSheet.cssRules;
1372
- }
1373
- return this._tags.reduce(function(rules, tag) {
1374
- if (tag) {
1375
- rules = rules.concat(Array.prototype.map.call(_this.getSheetForTag(tag).cssRules, function(rule) {
1376
- return rule.cssText === _this._deletedRulePlaceholder ? null : rule;
1377
- }));
1378
- } else {
1379
- rules.push(null);
1380
- }
1381
- return rules;
1382
- }, []);
1383
- };
1384
- _proto.makeStyleTag = function makeStyleTag(name, cssString, relativeToTag) {
1385
- if (cssString) {
1386
- invariant$1(isString(cssString), "makeStyleTag accepts only strings as second parameter");
1387
- }
1388
- var tag = document.createElement("style");
1389
- if (this._nonce) tag.setAttribute("nonce", this._nonce);
1390
- tag.type = "text/css";
1391
- tag.setAttribute("data-" + name, "");
1392
- if (cssString) {
1393
- tag.appendChild(document.createTextNode(cssString));
1394
- }
1395
- var head = document.head || document.getElementsByTagName("head")[0];
1396
- if (relativeToTag) {
1397
- head.insertBefore(tag, relativeToTag);
1398
- } else {
1399
- head.appendChild(tag);
1400
- }
1401
- return tag;
1402
- };
1403
- _createClass(StyleSheet, [
1404
- {
1405
- key: "length",
1406
- get: function get() {
1407
- return this._rulesCount;
1408
- }
1409
- }
1410
- ]);
1411
- return StyleSheet;
1412
- }();
1413
- function invariant$1(condition, message) {
1414
- if (!condition) {
1415
- throw new Error("StyleSheet: " + message + ".");
1416
- }
1417
- }
1418
-
1419
- function hash(str) {
1420
- var _$hash = 5381, i = str.length;
1421
- while(i){
1422
- _$hash = _$hash * 33 ^ str.charCodeAt(--i);
1423
- }
1424
- /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
1425
- * integers. Since we want the results to be always positive, convert the
1426
- * signed int to an unsigned by doing an unsigned bitshift. */ return _$hash >>> 0;
1427
- }
1428
- var stringHash = hash;
1429
-
1430
- var sanitize = function(rule) {
1431
- return rule.replace(/\/style/gi, "\\/style");
1432
- };
1433
- var cache = {};
1434
- /**
1435
- * computeId
1436
- *
1437
- * Compute and memoize a jsx id from a basedId and optionally props.
1438
- */ function computeId(baseId, props) {
1439
- if (!props) {
1440
- return "jsx-" + baseId;
1441
- }
1442
- var propsToString = String(props);
1443
- var key = baseId + propsToString;
1444
- if (!cache[key]) {
1445
- cache[key] = "jsx-" + stringHash(baseId + "-" + propsToString);
1446
- }
1447
- return cache[key];
1448
- }
1449
- /**
1450
- * computeSelector
1451
- *
1452
- * Compute and memoize dynamic selectors.
1453
- */ function computeSelector(id, css) {
1454
- var selectoPlaceholderRegexp = /__jsx-style-dynamic-selector/g;
1455
- // Sanitize SSR-ed CSS.
1456
- // Client side code doesn't need to be sanitized since we use
1457
- // document.createTextNode (dev) and the CSSOM api sheet.insertRule (prod).
1458
- if (typeof window === "undefined") {
1459
- css = sanitize(css);
1460
- }
1461
- var idcss = id + css;
1462
- if (!cache[idcss]) {
1463
- cache[idcss] = css.replace(selectoPlaceholderRegexp, id);
1464
- }
1465
- return cache[idcss];
1466
- }
1467
-
1468
- function mapRulesToStyle(cssRules, options) {
1469
- if (options === void 0) options = {};
1470
- return cssRules.map(function(args) {
1471
- var id = args[0];
1472
- var css = args[1];
1473
- return /*#__PURE__*/ React__default["default"].createElement("style", {
1474
- id: "__" + id,
1475
- // Avoid warnings upon render with a key
1476
- key: "__" + id,
1477
- nonce: options.nonce ? options.nonce : undefined,
1478
- dangerouslySetInnerHTML: {
1479
- __html: css
1480
- }
1481
- });
1482
- });
1483
- }
1484
- var StyleSheetRegistry = /*#__PURE__*/ function() {
1485
- function StyleSheetRegistry(param) {
1486
- var ref = param === void 0 ? {} : param, _styleSheet = ref.styleSheet, styleSheet = _styleSheet === void 0 ? null : _styleSheet, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? false : _optimizeForSpeed;
1487
- this._sheet = styleSheet || new StyleSheet({
1488
- name: "styled-jsx",
1489
- optimizeForSpeed: optimizeForSpeed
1490
- });
1491
- this._sheet.inject();
1492
- if (styleSheet && typeof optimizeForSpeed === "boolean") {
1493
- this._sheet.setOptimizeForSpeed(optimizeForSpeed);
1494
- this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
1495
- }
1496
- this._fromServer = undefined;
1497
- this._indices = {};
1498
- this._instancesCounts = {};
1499
- }
1500
- var _proto = StyleSheetRegistry.prototype;
1501
- _proto.add = function add(props) {
1502
- var _this = this;
1503
- if (undefined === this._optimizeForSpeed) {
1504
- this._optimizeForSpeed = Array.isArray(props.children);
1505
- this._sheet.setOptimizeForSpeed(this._optimizeForSpeed);
1506
- this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
1507
- }
1508
- if (typeof window !== "undefined" && !this._fromServer) {
1509
- this._fromServer = this.selectFromServer();
1510
- this._instancesCounts = Object.keys(this._fromServer).reduce(function(acc, tagName) {
1511
- acc[tagName] = 0;
1512
- return acc;
1513
- }, {});
1514
- }
1515
- var ref = this.getIdAndRules(props), styleId = ref.styleId, rules = ref.rules;
1516
- // Deduping: just increase the instances count.
1517
- if (styleId in this._instancesCounts) {
1518
- this._instancesCounts[styleId] += 1;
1519
- return;
1520
- }
1521
- var indices = rules.map(function(rule) {
1522
- return _this._sheet.insertRule(rule);
1523
- })// Filter out invalid rules
1524
- .filter(function(index) {
1525
- return index !== -1;
1526
- });
1527
- this._indices[styleId] = indices;
1528
- this._instancesCounts[styleId] = 1;
1529
- };
1530
- _proto.remove = function remove(props) {
1531
- var _this = this;
1532
- var styleId = this.getIdAndRules(props).styleId;
1533
- invariant(styleId in this._instancesCounts, "styleId: `" + styleId + "` not found");
1534
- this._instancesCounts[styleId] -= 1;
1535
- if (this._instancesCounts[styleId] < 1) {
1536
- var tagFromServer = this._fromServer && this._fromServer[styleId];
1537
- if (tagFromServer) {
1538
- tagFromServer.parentNode.removeChild(tagFromServer);
1539
- delete this._fromServer[styleId];
1540
- } else {
1541
- this._indices[styleId].forEach(function(index) {
1542
- return _this._sheet.deleteRule(index);
1543
- });
1544
- delete this._indices[styleId];
1545
- }
1546
- delete this._instancesCounts[styleId];
1547
- }
1548
- };
1549
- _proto.update = function update(props, nextProps) {
1550
- this.add(nextProps);
1551
- this.remove(props);
1552
- };
1553
- _proto.flush = function flush() {
1554
- this._sheet.flush();
1555
- this._sheet.inject();
1556
- this._fromServer = undefined;
1557
- this._indices = {};
1558
- this._instancesCounts = {};
1559
- };
1560
- _proto.cssRules = function cssRules() {
1561
- var _this = this;
1562
- var fromServer = this._fromServer ? Object.keys(this._fromServer).map(function(styleId) {
1563
- return [
1564
- styleId,
1565
- _this._fromServer[styleId]
1566
- ];
1567
- }) : [];
1568
- var cssRules = this._sheet.cssRules();
1569
- return fromServer.concat(Object.keys(this._indices).map(function(styleId) {
1570
- return [
1571
- styleId,
1572
- _this._indices[styleId].map(function(index) {
1573
- return cssRules[index].cssText;
1574
- }).join(_this._optimizeForSpeed ? "" : "\n")
1575
- ];
1576
- })// filter out empty rules
1577
- .filter(function(rule) {
1578
- return Boolean(rule[1]);
1579
- }));
1580
- };
1581
- _proto.styles = function styles(options) {
1582
- return mapRulesToStyle(this.cssRules(), options);
1583
- };
1584
- _proto.getIdAndRules = function getIdAndRules(props) {
1585
- var css = props.children, dynamic = props.dynamic, id = props.id;
1586
- if (dynamic) {
1587
- var styleId = computeId(id, dynamic);
1588
- return {
1589
- styleId: styleId,
1590
- rules: Array.isArray(css) ? css.map(function(rule) {
1591
- return computeSelector(styleId, rule);
1592
- }) : [
1593
- computeSelector(styleId, css)
1594
- ]
1595
- };
1596
- }
1597
- return {
1598
- styleId: computeId(id),
1599
- rules: Array.isArray(css) ? css : [
1600
- css
1601
- ]
1602
- };
1603
- };
1604
- /**
1605
- * selectFromServer
1606
- *
1607
- * Collects style tags from the document with id __jsx-XXX
1608
- */ _proto.selectFromServer = function selectFromServer() {
1609
- var elements = Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]'));
1610
- return elements.reduce(function(acc, element) {
1611
- var id = element.id.slice(2);
1612
- acc[id] = element;
1613
- return acc;
1614
- }, {});
1615
- };
1616
- return StyleSheetRegistry;
1617
- }();
1618
- function invariant(condition, message) {
1619
- if (!condition) {
1620
- throw new Error("StyleSheetRegistry: " + message + ".");
1621
- }
1622
- }
1623
- var StyleSheetContext = /*#__PURE__*/ React$1$1.createContext(null);
1624
- StyleSheetContext.displayName = "StyleSheetContext";
1625
- function createStyleRegistry() {
1626
- return new StyleSheetRegistry();
1627
- }
1628
- function StyleRegistry(param) {
1629
- var configuredRegistry = param.registry, children = param.children;
1630
- var rootRegistry = React$1$1.useContext(StyleSheetContext);
1631
- var ref = React$1$1.useState(function() {
1632
- return rootRegistry || configuredRegistry || createStyleRegistry();
1633
- }), registry = ref[0];
1634
- return /*#__PURE__*/ React__default["default"].createElement(StyleSheetContext.Provider, {
1635
- value: registry
1636
- }, children);
1637
- }
1638
- function useStyleRegistry() {
1639
- return React$1$1.useContext(StyleSheetContext);
1640
- }
1641
-
1642
- // Opt-into the new `useInsertionEffect` API in React 18, fallback to `useLayoutEffect`.
1643
- // https://github.com/reactwg/react-18/discussions/110
1644
- var useInsertionEffect = React__default["default"].useInsertionEffect || React$1$1.useLayoutEffect;
1645
- var defaultRegistry = typeof window !== "undefined" ? createStyleRegistry() : undefined;
1646
- function JSXStyle(props) {
1647
- var registry = defaultRegistry ? defaultRegistry : useStyleRegistry();
1648
- var insertionEffectCalled = React$1$1.useRef(false);
1649
- // `registry` might not exist while server-side rendering
1650
- if (!registry) {
1651
- return null;
1652
- }
1653
- if (typeof window === "undefined") {
1654
- registry.add(props);
1655
- return null;
1656
- }
1657
- useInsertionEffect(function() {
1658
- // ReactDOM removes all DOM during hydration in certain cases
1659
- if (!document.head) {
1660
- return;
1661
- }
1662
- registry.add(props);
1663
- insertionEffectCalled.current = true;
1664
- return function() {
1665
- insertionEffectCalled.current = false;
1666
- registry.remove(props);
1667
- };
1668
- }, [
1669
- props.id,
1670
- String(props.dynamic)
1671
- ]);
1672
- React$1$1.useLayoutEffect(function() {
1673
- if (!document.head || insertionEffectCalled.current) {
1674
- return;
1675
- }
1676
- registry.add(props);
1677
- return function() {
1678
- registry.remove(props);
1679
- };
1680
- // props.children can be string[], will be striped since id is identical
1681
- }, [
1682
- props.id,
1683
- String(props.dynamic)
1684
- ]);
1685
- return null;
1686
- }
1687
- JSXStyle.dynamic = function(info) {
1688
- return info.map(function(tagInfo) {
1689
- var baseId = tagInfo[0];
1690
- var props = tagInfo[1];
1691
- return computeId(baseId, props);
1692
- }).join(" ");
1693
- };
1694
-
1695
- index.StyleRegistry = StyleRegistry;
1696
- index.createStyleRegistry = createStyleRegistry;
1697
- index.style = JSXStyle;
1698
- index.useStyleRegistry = useStyleRegistry;
1699
- return index;
1700
- }
1701
-
1702
- var style;
1703
- var hasRequiredStyle;
1704
-
1705
- function requireStyle () {
1706
- if (hasRequiredStyle) return style;
1707
- hasRequiredStyle = 1;
1708
- style = requireIndex().style;
1709
- return style;
1710
- }
1711
-
1712
- var styleExports = requireStyle();
1713
- var _JSXStyle = /*@__PURE__*/getDefaultExportFromCjs(styleExports);
1714
-
1715
- /* "use client" */
1716
-
1717
- var getId = function getId() {
1718
- return Math.random().toString(32).slice(2, 10);
1719
- };
1720
- var isBrowser = function isBrowser() {
1721
- return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
1722
- };
1723
-
1724
- var useSSR = function useSSR() {
1725
- var _useState = React$1.useState(false),
1726
- _useState2 = _slicedToArray(_useState, 2),
1727
- browser = _useState2[0],
1728
- setBrowser = _useState2[1];
1729
- React$1.useEffect(function () {
1730
- setBrowser(isBrowser());
1731
- }, []);
1732
- return {
1733
- isBrowser: browser,
1734
- isServer: !browser
1735
- };
1736
- };
1737
-
1738
- var createElement = function createElement(id) {
1739
- var el = document.createElement('div');
1740
- el.setAttribute('id', id);
1741
- return el;
1742
- };
1743
- var usePortal = function usePortal() {
1744
- var selectId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getId();
1745
- var getContainer = arguments.length > 1 ? arguments[1] : undefined;
1746
- var id = "helpdice-ui-".concat(selectId);
1747
- var _useSSR = useSSR(),
1748
- isBrowser = _useSSR.isBrowser;
1749
- var _useState = React$1.useState(isBrowser ? createElement(id) : null),
1750
- _useState2 = _slicedToArray(_useState, 2),
1751
- elSnapshot = _useState2[0],
1752
- setElSnapshot = _useState2[1];
1753
- React$1.useEffect(function () {
1754
- var customContainer = getContainer ? getContainer() : null;
1755
- var parentElement = customContainer || document.body;
1756
- var hasElement = parentElement.querySelector("#".concat(id));
1757
- var el = hasElement || createElement(id);
1758
- if (!hasElement) {
1759
- parentElement.appendChild(el);
1760
- }
1761
- setElSnapshot(el);
1762
- }, []);
1763
- return elSnapshot;
1764
- };
1765
-
1766
- var _excluded$2 = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
1767
- var CssTransition = function CssTransition(_ref) {
1768
- var children = _ref.children,
1769
- _ref$className = _ref.className,
1770
- className = _ref$className === void 0 ? '' : _ref$className,
1771
- _ref$visible = _ref.visible,
1772
- visible = _ref$visible === void 0 ? false : _ref$visible,
1773
- _ref$enterTime = _ref.enterTime,
1774
- enterTime = _ref$enterTime === void 0 ? 60 : _ref$enterTime,
1775
- _ref$leaveTime = _ref.leaveTime,
1776
- leaveTime = _ref$leaveTime === void 0 ? 60 : _ref$leaveTime,
1777
- _ref$clearTime = _ref.clearTime,
1778
- clearTime = _ref$clearTime === void 0 ? 60 : _ref$clearTime,
1779
- _ref$name = _ref.name,
1780
- name = _ref$name === void 0 ? 'transition' : _ref$name,
1781
- props = _objectWithoutProperties(_ref, _excluded$2);
1782
- var _useState = React$1.useState(''),
1783
- _useState2 = _slicedToArray(_useState, 2),
1784
- classes = _useState2[0],
1785
- setClasses = _useState2[1];
1786
- var _useState3 = React$1.useState(visible),
1787
- _useState4 = _slicedToArray(_useState3, 2),
1788
- renderable = _useState4[0],
1789
- setRenderable = _useState4[1];
1790
- React$1.useEffect(function () {
1791
- var statusClassName = visible ? 'enter' : 'leave';
1792
- var time = visible ? enterTime : leaveTime;
1793
- if (visible && !renderable) {
1794
- setRenderable(true);
1795
- }
1796
- setClasses("".concat(name, "-").concat(statusClassName));
1797
-
1798
- // set class to active
1799
- var timer = setTimeout(function () {
1800
- setClasses("".concat(name, "-").concat(statusClassName, " ").concat(name, "-").concat(statusClassName, "-active"));
1801
- clearTimeout(timer);
1802
- }, time);
1803
-
1804
- // remove classess when animation over
1805
- var clearClassesTimer = setTimeout(function () {
1806
- if (!visible) {
1807
- setClasses('');
1808
- setRenderable(false);
1809
- }
1810
- clearTimeout(clearClassesTimer);
1811
- }, time + clearTime);
1812
- return function () {
1813
- clearTimeout(timer);
1814
- clearTimeout(clearClassesTimer);
1815
- };
1816
- }, [visible, renderable]);
1817
- if (! /*#__PURE__*/React$1.isValidElement(children) || !renderable) return null;
1818
- var propsTransition = _objectSpread2(_objectSpread2({}, props), {}, {
1819
- className: "".concat(children.props.className, " ").concat(className, " ").concat(classes)
1820
- });
1821
- return /*#__PURE__*/React$1.cloneElement(children, propsTransition);
1822
- };
1823
- CssTransition.displayName = 'CssTransition';
1824
-
1825
- var tuple = function tuple() {
1826
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1827
- args[_key] = arguments[_key];
1828
- }
1829
- return args;
1830
- };
1831
- tuple('default', 'secondary', 'success', 'warning', 'error', 'abort', 'secondary-light', 'success-light', 'warning-light', 'error-light');
1832
- tuple('default', 'secondary', 'success', 'warning', 'error');
1833
- tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite');
1834
- tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite', 'alert', 'purple', 'violet', 'cyan');
1835
- tuple('default', 'silent', 'prevent');
1836
- tuple('hover', 'click');
1837
- tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
1838
- tuple('start', 'center', 'end', 'left', 'right');
1839
-
1840
- var makeToastActions = function makeToastActions(actions, cancelHandle) {
1841
- var handler = function handler(event, userHandler) {
1842
- userHandler && userHandler(event, cancelHandle);
1843
- };
1844
- if (!actions || !actions.length) return null;
1845
- return actions.map(function (action, index) {
1846
- return /*#__PURE__*/React$1.createElement("button", {
1847
- color: action.passive ? 'default' : 'secondary',
1848
- key: "action-".concat(index),
1849
- onClick: function onClick(event) {
1850
- return handler(event, action.handler);
1851
- }
1852
- }, action.name);
1853
- });
1854
- };
1855
- var getColors = function getColors(palette, type) {
1856
- var colors = {
1857
- "default": palette.background,
1858
- secondary: palette.secondary,
1859
- success: palette.success,
1860
- warning: palette.warning,
1861
- error: palette.error
1862
- };
1863
- var isDefault = !type || type === 'default';
1864
- if (isDefault) return {
1865
- bgColor: colors["default"],
1866
- color: palette.foreground
1867
- };
1868
- /**
1869
- * Prevent main color change in special types.
1870
- * The color will only follow the theme when it is in the default type.
1871
- */
1872
- return {
1873
- bgColor: colors[type],
1874
- color: 'white'
1875
- };
1876
- };
1877
- tuple('topLeft', 'topRight', 'bottomLeft', 'bottomRight');
1878
- var isTopPlacement = function isTopPlacement(placement) {
1879
- return "".concat(placement).toLowerCase().startsWith('top');
1880
- };
1881
- var isLeftPlacement = function isLeftPlacement(placement) {
1882
- return "".concat(placement).toLowerCase().endsWith('left');
1883
- };
1884
- var getTranslateByPlacement = function getTranslateByPlacement(placement) {
1885
- var translateInByPlacement = {
1886
- topLeft: 'translate(-60px, -60px)',
1887
- topRight: 'translate(60px, -60px)',
1888
- bottomLeft: 'translate(-60px, 60px)',
1889
- bottomRight: 'translate(60px, 60px)'
1890
- };
1891
- var translateOutByPlacement = {
1892
- topLeft: 'translate(-50px, 15px) scale(0.85)',
1893
- topRight: 'translate(50px, 15px) scale(0.85)',
1894
- bottomLeft: 'translate(-50px, -15px) scale(0.85)',
1895
- bottomRight: 'translate(50px, -15px) scale(0.85)'
1896
- };
1897
- return {
1898
- enter: translateInByPlacement[placement],
1899
- leave: translateOutByPlacement[placement]
1900
- };
1901
- };
1902
-
1903
- var ToastItem = /*#__PURE__*/React$1.memo(function (_ref) {
1904
- var toast = _ref.toast,
1905
- layout = _ref.layout;
1906
- var theme = useTheme();
1907
- var _useMemo = React$1.useMemo(function () {
1908
- return getColors(theme.palette, toast.type);
1909
- }, [theme.palette, toast.type]),
1910
- color = _useMemo.color,
1911
- bgColor = _useMemo.bgColor;
1912
- var isReactNode = typeof toast.text !== 'string';
1913
- var padding = layout.padding,
1914
- margin = layout.margin,
1915
- maxHeight = layout.maxHeight,
1916
- maxWidth = layout.maxWidth,
1917
- width = layout.width,
1918
- placement = layout.placement;
1919
- var _useMemo2 = React$1.useMemo(function () {
1920
- return getTranslateByPlacement(placement);
1921
- }, [placement]),
1922
- enter = _useMemo2.enter,
1923
- leave = _useMemo2.leave;
1924
- return /*#__PURE__*/React$1.createElement(CssTransition, {
1925
- name: "toast",
1926
- visible: toast.visible,
1927
- clearTime: 350
1928
- }, /*#__PURE__*/React$1.createElement("div", {
1929
- key: toast.id,
1930
- 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"
1931
- }, isReactNode ? toast.text : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("div", {
1932
- 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"
1933
- }, toast.text), /*#__PURE__*/React$1.createElement("div", {
1934
- 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"
1935
- }, makeToastActions(toast.actions, toast.cancel))), /*#__PURE__*/React$1.createElement(_JSXStyle, {
1936
- id: "1407001838",
1937
- dynamic: [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]
1938
- }, ".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, ";}"))));
1939
- });
1940
-
1941
- /* "use client" */
1942
-
1943
- var classObjectToString = function classObjectToString(className) {
1944
- var keys = Object.keys(className);
1945
- var len = keys.length;
1946
- var str = '';
1947
- for (var index = 0; index < len; index++) {
1948
- var key = keys[index];
1949
- var val = className[keys[index]];
1950
- if (!val) continue;
1951
- str = str ? "".concat(str, " ").concat(String(key)) : String(key);
1952
- }
1953
- return str;
1954
- };
1955
- var isObjectClassName = function isObjectClassName(value) {
1956
- return _typeof(value) === 'object' && !Array.isArray(value);
1957
- };
1958
- var useClasses = function useClasses() {
1959
- var len = arguments.length;
1960
- var classes = '';
1961
- if (len === 0) return classes;
1962
- for (var index = 0; index < len; index++) {
1963
- var val = index < 0 || arguments.length <= index ? undefined : arguments[index];
1964
- if (!val) continue;
1965
- if (isObjectClassName(val)) {
1966
- classes += " ".concat(classObjectToString(val));
1967
- } else {
1968
- classes += " ".concat(String(val).trim());
1969
- }
1970
- }
1971
- return classes.trim();
1972
- };
1973
-
1974
- var ToastContainer = function ToastContainer() {
1975
- var theme = useTheme();
1976
- var portal = usePortal('toast');
1977
- var _useCurrentState = useCurrentState(false),
1978
- _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
1979
- setHovering = _useCurrentState2[1],
1980
- hoveringRef = _useCurrentState2[2];
1981
- var _useHUIContext = useHUIContext(),
1982
- toasts = _useHUIContext.toasts,
1983
- updateToasts = _useHUIContext.updateToasts,
1984
- toastLayout = _useHUIContext.toastLayout,
1985
- lastUpdateToastId = _useHUIContext.lastUpdateToastId;
1986
- var memoizedLayout = React$1.useMemo(function () {
1987
- return toastLayout;
1988
- }, [toastLayout]);
1989
- var toastElements = React$1.useMemo(function () {
1990
- return toasts.map(function (toast) {
1991
- return /*#__PURE__*/React$1.createElement(ToastItem, {
1992
- toast: toast,
1993
- layout: memoizedLayout,
1994
- key: toast._internalIdent
1995
- });
1996
- });
1997
- }, [toasts, memoizedLayout]);
1998
- var classNames = React$1.useMemo(function () {
1999
- return useClasses('toasts', {
2000
- top: isTopPlacement(toastLayout.placement),
2001
- left: isLeftPlacement(toastLayout.placement)
2002
- });
2003
- }, [memoizedLayout]);
2004
- var hoverHandler = function hoverHandler(isHovering) {
2005
- setHovering(isHovering);
2006
- if (isHovering) {
2007
- return updateToasts(function (last) {
2008
- return last.map(function (toast) {
2009
- if (!toast.visible) return toast;
2010
- toast._timeout && window.clearTimeout(toast._timeout);
2011
- return _objectSpread2(_objectSpread2({}, toast), {}, {
2012
- timeout: null
2013
- });
2014
- });
2015
- });
2016
- }
2017
- updateToasts(function (last) {
2018
- return last.map(function (toast, index) {
2019
- if (!toast.visible) return toast;
2020
- toast._timeout && window.clearTimeout(toast._timeout);
2021
- return _objectSpread2(_objectSpread2({}, toast), {}, {
2022
- _timeout: function () {
2023
- var timer = window.setTimeout(function () {
2024
- toast.cancel();
2025
- window.clearTimeout(timer);
2026
- }, toast.delay + index * 100);
2027
- return timer;
2028
- }()
2029
- });
2030
- });
2031
- });
2032
- };
2033
- React$1.useEffect(function () {
2034
- var index = toasts.findIndex(function (r) {
2035
- return r._internalIdent === lastUpdateToastId;
2036
- });
2037
- var toast = toasts[index];
2038
- if (!toast || toast.visible || !hoveringRef.current) return;
2039
- var hasVisible = toasts.find(function (r, i) {
2040
- return i < index && r.visible;
2041
- });
2042
- if (hasVisible || !hoveringRef.current) return;
2043
- hoverHandler(false);
2044
- }, [toasts, lastUpdateToastId]);
2045
- React$1.useEffect(function () {
2046
- var timeout = null;
2047
- var timer = window.setInterval(function () {
2048
- if (toasts.length === 0) return;
2049
- timeout = window.setTimeout(function () {
2050
- var allInvisible = !toasts.find(function (r) {
2051
- return r.visible;
2052
- });
2053
- allInvisible && updateToasts(function () {
2054
- return [];
2055
- });
2056
- timeout && clearTimeout(timeout);
2057
- }, 350);
2058
- }, 5000);
2059
- return function () {
2060
- timer && clearInterval(timer);
2061
- timeout && clearTimeout(timeout);
2062
- };
2063
- }, [toasts]);
2064
- if (!portal) return null;
2065
- if (!toasts || toasts.length === 0) return null;
2066
- return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React$1.createElement("div", {
2067
- onMouseEnter: function onMouseEnter() {
2068
- return hoverHandler(true);
2069
- },
2070
- onMouseLeave: function onMouseLeave() {
2071
- return hoverHandler(false);
2072
- },
2073
- className: _JSXStyle.dynamic([["622610754", [theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.layout.gap]]]) + " " + (classNames || "")
2074
- }, toastElements, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2075
- id: "622610754",
2076
- dynamic: [theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.layout.gap]
2077
- }, ".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);
2078
- };
2079
-
2080
- var HuiProvider = function HuiProvider(_ref) {
2081
- var themes = _ref.themes,
2082
- themeType = _ref.themeType,
2083
- children = _ref.children;
2084
- var _React$useState = React$1.useState(''),
2085
- _React$useState2 = _slicedToArray(_React$useState, 2),
2086
- lastUpdateToastId = _React$useState2[0],
2087
- setLastUpdateToastId = _React$useState2[1];
2088
- var _useCurrentState = useCurrentState([]),
2089
- _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
2090
- toasts = _useCurrentState2[0],
2091
- setToasts = _useCurrentState2[1],
2092
- toastsRef = _useCurrentState2[2];
2093
- var _useCurrentState3 = useCurrentState(defaultToastLayout),
2094
- _useCurrentState4 = _slicedToArray(_useCurrentState3, 3),
2095
- toastLayout = _useCurrentState4[0],
2096
- setToastLayout = _useCurrentState4[1],
2097
- toastLayoutRef = _useCurrentState4[2];
2098
- var updateToasts = function updateToasts(fn) {
2099
- var nextToasts = fn(toastsRef.current);
2100
- setToasts(nextToasts);
2101
- };
2102
- var updateToastLayout = function updateToastLayout(fn) {
2103
- var nextLayout = fn(toastLayoutRef.current);
2104
- setToastLayout(nextLayout);
2105
- };
2106
- var updateLastToastId = function updateLastToastId(fn) {
2107
- setLastUpdateToastId(fn());
2108
- };
2109
- var initialValue = React$1.useMemo(function () {
2110
- return {
2111
- toasts: toasts,
2112
- toastLayout: toastLayout,
2113
- updateToasts: updateToasts,
2114
- lastUpdateToastId: lastUpdateToastId,
2115
- updateToastLayout: updateToastLayout,
2116
- updateLastToastId: updateLastToastId
2117
- };
2118
- }, [toasts, toastLayout, lastUpdateToastId]);
2119
- return /*#__PURE__*/React$1.createElement(HUIContent.Provider, {
2120
- value: initialValue
2121
- }, /*#__PURE__*/React$1.createElement(ThemeProvider, {
2122
- themes: themes,
2123
- themeType: themeType
2124
- }, children, /*#__PURE__*/React$1.createElement(ToastContainer, null)));
2125
- };
2126
-
2127
- // import flush from 'styled-jsx'
2128
-
2129
- // export type FlushToReact = <T>(opts?: { nonce?: string }) => Array<ReactElement<T>>
2130
-
2131
- // export type FlushToHTML = (opts?: { nonce?: string }) => string
2132
-
2133
- var CssBaseline = function CssBaseline(_ref) {
2134
- var children = _ref.children;
2135
- var theme = useTheme();
2136
- return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2137
- id: "3647548829",
2138
- 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]
2139
- }, "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, ";}")));
2140
- };
2141
- var MemoCssBaseline = /*#__PURE__*/React$1.memo(CssBaseline);
2142
-
2143
- var getElementOffset = function getElementOffset(el) {
2144
- if (!el) return {
2145
- top: 0,
2146
- left: 0
2147
- };
2148
- var _el$getBoundingClient = el.getBoundingClientRect(),
2149
- top = _el$getBoundingClient.top,
2150
- left = _el$getBoundingClient.left;
2151
- return {
2152
- top: top,
2153
- left: left
2154
- };
2155
- };
2156
- var defaultRect$1 = {
2157
- top: -1e3,
2158
- left: -1e3,
2159
- right: -1e3,
2160
- width: 0,
2161
- height: 0,
2162
- elementTop: -1e3
2163
- };
2164
- var getRectFromDOMWithContainer = function getRectFromDOMWithContainer(domRect, getContainer) {
2165
- if (!domRect) return defaultRect$1;
2166
- var container = getContainer ? getContainer() : null;
2167
- var scrollElement = container || document.documentElement;
2168
- var _getElementOffset = getElementOffset(container),
2169
- offsetTop = _getElementOffset.top,
2170
- offsetLeft = _getElementOffset.left;
2171
- return _objectSpread2(_objectSpread2({}, domRect), {}, {
2172
- width: domRect.width || domRect.right - domRect.left,
2173
- height: domRect.height || domRect.top - domRect.bottom,
2174
- top: domRect.bottom + scrollElement.scrollTop - offsetTop,
2175
- left: domRect.left + scrollElement.scrollLeft - offsetLeft,
2176
- elementTop: domRect.top + scrollElement.scrollTop - offsetTop
2177
- });
2178
- };
2179
- var isUnplacedRect = function isUnplacedRect(rect) {
2180
- if (!rect) return true;
2181
- return rect.top === defaultRect$1.top && rect.left === defaultRect$1.left;
2182
- };
2183
- var getRefRect = function getRefRect(ref, getContainer) {
2184
- if (!ref || !ref.current) return defaultRect$1;
2185
- var rect = ref.current.getBoundingClientRect();
2186
- return getRectFromDOMWithContainer(rect, getContainer);
2187
- };
2188
- var getEventRect = function getEventRect(event, getContainer) {
2189
- var _event$target;
2190
- var rect = event === null || event === void 0 || (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.getBoundingClientRect();
2191
- if (!rect) return defaultRect$1;
2192
- return getRectFromDOMWithContainer(rect, getContainer);
2193
- };
2194
- var isRefTarget = function isRefTarget(eventOrRef) {
2195
- return typeof (eventOrRef === null || eventOrRef === void 0 ? void 0 : eventOrRef.target) === 'undefined';
2196
- };
2197
- var useRect = function useRect(initialState) {
2198
- var _useState = React$1.useState(initialState || defaultRect$1),
2199
- _useState2 = _slicedToArray(_useState, 2),
2200
- rect = _useState2[0],
2201
- setRect = _useState2[1];
2202
- var updateRect = function updateRect(eventOrRef, getContainer) {
2203
- if (isRefTarget(eventOrRef)) return setRect(getRefRect(eventOrRef, getContainer));
2204
- setRect(getEventRect(eventOrRef, getContainer));
2205
- };
2206
- return {
2207
- rect: rect,
2208
- setRect: updateRect
2209
- };
2210
- };
2211
-
2212
- var defaultToast = {
2213
- delay: 2000,
2214
- type: 'default'
2215
- };
2216
- var useToasts = function useToasts(layout) {
2217
- var _useHUIContext = useHUIContext(),
2218
- updateToasts = _useHUIContext.updateToasts,
2219
- toasts = _useHUIContext.toasts,
2220
- updateToastLayout = _useHUIContext.updateToastLayout,
2221
- updateLastToastId = _useHUIContext.updateLastToastId;
2222
- React$1.useEffect(function () {
2223
- if (!layout) return;
2224
- updateToastLayout(function () {
2225
- return layout ? _objectSpread2(_objectSpread2({}, defaultToastLayout), layout) : defaultToastLayout;
2226
- });
2227
- }, []);
2228
- var _cancel = function cancel(internalId) {
2229
- updateToasts(function (currentToasts) {
2230
- return currentToasts.map(function (item) {
2231
- if (item._internalIdent !== internalId) return item;
2232
- return _objectSpread2(_objectSpread2({}, item), {}, {
2233
- visible: false
2234
- });
2235
- });
2236
- });
2237
- updateLastToastId(function () {
2238
- return internalId;
2239
- });
2240
- };
2241
- var removeAll = function removeAll() {
2242
- updateToasts(function (last) {
2243
- return last.map(function (toast) {
2244
- return _objectSpread2(_objectSpread2({}, toast), {}, {
2245
- visible: false
2246
- });
2247
- });
2248
- });
2249
- };
2250
- var findToastOneByID = function findToastOneByID(id) {
2251
- return toasts.find(function (t) {
2252
- return t.id === id;
2253
- });
2254
- };
2255
- var removeToastOneByID = function removeToastOneByID(id) {
2256
- updateToasts(function (last) {
2257
- return last.map(function (toast) {
2258
- if (toast.id !== id) return toast;
2259
- return _objectSpread2(_objectSpread2({}, toast), {}, {
2260
- visible: false
2261
- });
2262
- });
2263
- });
2264
- };
2265
- var setToast = function setToast(toast) {
2266
- var internalIdent = "toast-".concat(getId());
2267
- var delay = toast.delay || defaultToast.delay;
2268
- if (toast.id) {
2269
- var hasIdent = toasts.find(function (t) {
2270
- return t.id === toast.id;
2271
- });
2272
- if (hasIdent) {
2273
- throw new Error('Toast: Already have the same key: "ident"');
2274
- }
2275
- }
2276
- updateToasts(function (last) {
2277
- var newToast = {
2278
- delay: delay,
2279
- text: toast.text,
2280
- visible: true,
2281
- type: toast.type || defaultToast.type,
2282
- id: toast.id || internalIdent,
2283
- actions: toast.actions || [],
2284
- _internalIdent: internalIdent,
2285
- _timeout: window.setTimeout(function () {
2286
- _cancel(internalIdent);
2287
- if (newToast._timeout) {
2288
- window.clearTimeout(newToast._timeout);
2289
- newToast._timeout = null;
2290
- }
2291
- }, delay),
2292
- cancel: function cancel() {
2293
- return _cancel(internalIdent);
2294
- }
2295
- };
2296
- return [].concat(_toConsumableArray(last), [newToast]);
2297
- });
2298
- };
2299
- return {
2300
- toasts: toasts,
2301
- setToast: setToast,
2302
- removeAll: removeAll,
2303
- findToastOneByID: findToastOneByID,
2304
- removeToastOneByID: removeToastOneByID
2305
- };
2306
- };
2307
-
2308
- tuple('xs', 'sm', 'md', 'lg', 'xl', 'mobile');
2309
- tuple('up', 'down', 'default');
2310
- var defaultResponsiveOptions = {
2311
- match: 'default'
2312
- };
2313
- var makeQueries = function makeQueries(bp, up, down) {
2314
- var queryString = function queryString(item) {
2315
- var upQuery = "(min-width: ".concat(item.min, ")");
2316
- var downQuery = "(max-width: ".concat(item.max, ")");
2317
- return up ? upQuery : down ? downQuery : "".concat(upQuery, " and ").concat(downQuery);
2318
- };
2319
- var xs = queryString(bp.xs);
2320
- return {
2321
- xs: xs,
2322
- mobile: xs,
2323
- sm: queryString(bp.sm),
2324
- md: queryString(bp.md),
2325
- lg: queryString(bp.lg),
2326
- xl: queryString(bp.xl)
2327
- };
2328
- };
2329
- var useMediaQuery = function useMediaQuery(breakpoint) {
2330
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultResponsiveOptions;
2331
- var _options$match = options.match,
2332
- matchType = _options$match === void 0 ? 'default' : _options$match,
2333
- _options$ssrMatchMedi = options.ssrMatchMedia,
2334
- ssrMatchMedia = _options$ssrMatchMedi === void 0 ? null : _options$ssrMatchMedi;
2335
- var supportMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
2336
- var theme = useTheme();
2337
- var mediaQueries = React$1.useMemo(function () {
2338
- var up = matchType === 'up';
2339
- var down = matchType === 'down';
2340
- return makeQueries(theme.breakpoints, up, down);
2341
- }, [theme.breakpoints, options]);
2342
- var query = React$1.useMemo(function () {
2343
- return mediaQueries[breakpoint];
2344
- }, [mediaQueries, breakpoint]);
2345
- var matchQuery = function matchQuery(q) {
2346
- return window.matchMedia(q);
2347
- };
2348
-
2349
- /**
2350
- * Do nothing in the server-side rendering.
2351
- * If server match query fucntion is simulated, return user-defined value first.
2352
- */
2353
- var _useState = React$1.useState(function () {
2354
- if (supportMedia) return matchQuery(query).matches;
2355
- if (ssrMatchMedia && typeof ssrMatchMedia === 'function') {
2356
- return ssrMatchMedia(query).matches;
2357
- }
2358
- return false;
2359
- }),
2360
- _useState2 = _slicedToArray(_useState, 2),
2361
- state = _useState2[0],
2362
- setState = _useState2[1];
2363
- React$1.useEffect(function () {
2364
- if (!supportMedia) return;
2365
- var queryList = matchQuery(query);
2366
- var update = function update() {
2367
- return setState(matchQuery(query).matches);
2368
- };
2369
- update();
2370
-
2371
- /**
2372
- * addListener is deprecated. EventTarget.addEventListener is recommended.
2373
- * But in some old browsers, MediaQueryList does not inherit from EventTarget.
2374
- */
2375
- queryList.addListener(update);
2376
- return function () {
2377
- queryList.removeListener(update);
2378
- };
2379
- }, [supportMedia]);
2380
- return state;
2381
- };
2382
-
2383
- /* "use client" */
2384
-
2385
- var usePrevious = function usePrevious(state) {
2386
- var ref = React$1.useRef(null);
2387
- React$1.useEffect(function () {
2388
- ref.current = state;
2389
- });
2390
- return ref ? ref.current : null;
2391
- };
2392
-
2393
- var _excluded$1 = ["rect", "visible", "hoverHeightRatio", "hoverWidthRatio", "activeOpacity", "className"];
2394
- var Highlight = function Highlight(_ref) {
2395
- var rect = _ref.rect,
2396
- visible = _ref.visible,
2397
- _ref$hoverHeightRatio = _ref.hoverHeightRatio,
2398
- hoverHeightRatio = _ref$hoverHeightRatio === void 0 ? 1 : _ref$hoverHeightRatio,
2399
- _ref$hoverWidthRatio = _ref.hoverWidthRatio,
2400
- hoverWidthRatio = _ref$hoverWidthRatio === void 0 ? 1 : _ref$hoverWidthRatio,
2401
- _ref$activeOpacity = _ref.activeOpacity,
2402
- activeOpacity = _ref$activeOpacity === void 0 ? 0.8 : _ref$activeOpacity,
2403
- className = _ref.className,
2404
- props = _objectWithoutProperties(_ref, _excluded$1);
2405
- var theme = useTheme();
2406
- var ref = React$1.useRef(null);
2407
- var isFirstVisible = usePrevious(isUnplacedRect(rect));
2408
- var position = React$1.useMemo(function () {
2409
- var width = rect.width * hoverWidthRatio;
2410
- var height = rect.height * hoverHeightRatio;
2411
- return {
2412
- width: "".concat(width, "px"),
2413
- left: "".concat(rect.left + (rect.width - width) / 2, "px"),
2414
- height: "".concat(height, "px"),
2415
- top: "".concat(rect.elementTop + (rect.height - height) / 2, "px"),
2416
- transition: isFirstVisible ? 'opacity' : 'opacity, width, left, top'
2417
- };
2418
- }, [rect, hoverWidthRatio, hoverHeightRatio]);
2419
- return /*#__PURE__*/React$1.createElement("div", _extends({
2420
- ref: ref
2421
- }, props, {
2422
- 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) || "")
2423
- }), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2424
- id: "603024321",
2425
- dynamic: [theme.palette.accents_2, position.width, position.left, position.height, position.top, visible ? activeOpacity : 0, position.transition]
2426
- }, ".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, ";}")));
2427
- };
2428
-
2429
- var Ellipsis = function Ellipsis(_ref) {
2430
- var children = _ref.children,
2431
- height = _ref.height;
2432
- return /*#__PURE__*/React$1.createElement("span", {
2433
- className: _JSXStyle.dynamic([["822089635", [height]]])
2434
- }, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2435
- id: "822089635",
2436
- dynamic: [height]
2437
- }, "span.__jsx-style-dynamic-selector{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:".concat(height, ";min-width:0;}")));
2438
- };
2439
- var ellipsis = /*#__PURE__*/React$1.memo(Ellipsis);
2440
-
2441
- var getRealShape = function getRealShape(el) {
2442
- var defaultShape = {
2443
- width: 0,
2444
- height: 0
2445
- };
2446
- if (!el || typeof window === 'undefined') return defaultShape;
2447
- var rect = el.getBoundingClientRect();
2448
- var _window$getComputedSt = window.getComputedStyle(el),
2449
- width = _window$getComputedSt.width,
2450
- height = _window$getComputedSt.height;
2451
- var getCSSStyleVal = function getCSSStyleVal(str, parentNum) {
2452
- if (!str) return 0;
2453
- var strVal = str.includes('px') ? +str.split('px')[0] : str.includes('%') ? +str.split('%')[0] * parentNum * 0.01 : str;
2454
- return Number.isNaN(+strVal) ? 0 : +strVal;
2455
- };
2456
- return {
2457
- width: getCSSStyleVal("".concat(width), rect.width),
2458
- height: getCSSStyleVal("".concat(height), rect.height)
2459
- };
2460
- };
2461
- var useRealShape = function useRealShape(ref) {
2462
- var _useState = React$1.useState({
2463
- width: 0,
2464
- height: 0
2465
- }),
2466
- _useState2 = _slicedToArray(_useState, 2),
2467
- state = _useState2[0],
2468
- setState = _useState2[1];
2469
- var update = function update() {
2470
- var _getRealShape = getRealShape(ref.current),
2471
- width = _getRealShape.width,
2472
- height = _getRealShape.height;
2473
- setState({
2474
- width: width,
2475
- height: height
2476
- });
2477
- };
2478
- React$1.useEffect(function () {
2479
- return update();
2480
- }, [ref.current]);
2481
- return [state, update];
2482
- };
2483
-
2484
- var Expand = function Expand(_ref) {
2485
- var _ref$isExpanded = _ref.isExpanded,
2486
- isExpanded = _ref$isExpanded === void 0 ? false : _ref$isExpanded,
2487
- _ref$delay = _ref.delay,
2488
- delay = _ref$delay === void 0 ? 200 : _ref$delay,
2489
- children = _ref.children;
2490
- var _useState = React$1.useState(isExpanded ? 'auto' : '0'),
2491
- _useState2 = _slicedToArray(_useState, 2),
2492
- height = _useState2[0],
2493
- setHeight = _useState2[1];
2494
- var _useState3 = React$1.useState(isExpanded),
2495
- _useState4 = _slicedToArray(_useState3, 2),
2496
- selfExpanded = _useState4[0],
2497
- setSelfExpanded = _useState4[1];
2498
- var _useState5 = React$1.useState(isExpanded),
2499
- _useState6 = _slicedToArray(_useState5, 2),
2500
- visible = _useState6[0],
2501
- setVisible = _useState6[1];
2502
- var contentRef = React$1.useRef(null);
2503
- var entryTimer = React$1.useRef();
2504
- var leaveTimer = React$1.useRef();
2505
- var resetTimer = React$1.useRef();
2506
- var _useRealShape = useRealShape(contentRef),
2507
- _useRealShape2 = _slicedToArray(_useRealShape, 2),
2508
- state = _useRealShape2[0],
2509
- updateShape = _useRealShape2[1];
2510
- var classes = useClasses('container', {
2511
- expanded: selfExpanded
2512
- });
2513
- React$1.useEffect(function () {
2514
- return setHeight("".concat(state.height, "px"));
2515
- }, [state.height]);
2516
- React$1.useEffect(function () {
2517
- // show element or reset height.
2518
- // force an update once manually, even if the element does not change.
2519
- // (the height of the element might be "auto")
2520
- if (isExpanded) {
2521
- setVisible(isExpanded);
2522
- } else {
2523
- updateShape();
2524
- setHeight("".concat(state.height, "px"));
2525
- }
2526
-
2527
- // show expand animation
2528
- entryTimer.current = window.setTimeout(function () {
2529
- setSelfExpanded(isExpanded);
2530
- clearTimeout(entryTimer.current);
2531
- }, 30);
2532
-
2533
- // Reset height after animation
2534
- if (isExpanded) {
2535
- resetTimer.current = window.setTimeout(function () {
2536
- setHeight('auto');
2537
- clearTimeout(resetTimer.current);
2538
- }, delay);
2539
- } else {
2540
- leaveTimer.current = window.setTimeout(function () {
2541
- setVisible(isExpanded);
2542
- clearTimeout(leaveTimer.current);
2543
- }, delay / 2);
2544
- }
2545
- return function () {
2546
- clearTimeout(entryTimer.current);
2547
- clearTimeout(leaveTimer.current);
2548
- clearTimeout(resetTimer.current);
2549
- };
2550
- }, [isExpanded]);
2551
- return /*#__PURE__*/React$1.createElement("div", {
2552
- className: _JSXStyle.dynamic([["1918690829", [visible ? 'visible' : 'hidden', delay, height]]]) + " " + (classes || "")
2553
- }, /*#__PURE__*/React$1.createElement("div", {
2554
- ref: contentRef,
2555
- className: _JSXStyle.dynamic([["1918690829", [visible ? 'visible' : 'hidden', delay, height]]]) + " " + "content"
2556
- }, children), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2557
- id: "1918690829",
2558
- dynamic: [visible ? 'visible' : 'hidden', delay, height]
2559
- }, ".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;}")));
2560
- };
2561
- Expand.displayName = 'Expand';
2562
-
2563
- /* "use client" */
2564
-
2565
- var useResize = function useResize(callback) {
2566
- var immediatelyInvoke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2567
- React$1.useEffect(function () {
2568
- var fn = function fn() {
2569
- return callback();
2570
- };
2571
- if (immediatelyInvoke) {
2572
- fn();
2573
- }
2574
- window.addEventListener('resize', fn);
2575
- return function () {
2576
- return window.removeEventListener('resize', fn);
2577
- };
2578
- }, []);
2579
- };
2580
-
2581
- /* "use client" */
2582
-
2583
- var useClickAnyWhere = function useClickAnyWhere(handler) {
2584
- React$1.useEffect(function () {
2585
- var callback = function callback(event) {
2586
- return handler(event);
2587
- };
2588
- document.addEventListener('click', callback);
2589
- return function () {
2590
- return document.removeEventListener('click', callback);
2591
- };
2592
- }, [handler]);
2593
- };
2594
-
2595
- /* "use client" */
2596
-
2597
- var useDOMObserver = function useDOMObserver(ref) {
2598
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
2599
- var config = {
2600
- attributes: false,
2601
- childList: true,
2602
- subtree: true
2603
- };
2604
- React$1.useEffect(function () {
2605
- if (!ref || !ref.current) return;
2606
- var unmount = false;
2607
- var done = function done() {
2608
- if (unmount) return;
2609
- callback.apply(void 0, arguments);
2610
- };
2611
- var observer = new MutationObserver(done);
2612
- observer.observe(ref.current, config);
2613
- return function () {
2614
- unmount = true;
2615
- observer.disconnect();
2616
- };
2617
- }, [ref]);
2618
- };
2619
-
2620
- var warningStack = {};
2621
- var useWarning = function useWarning(message, component) {
2622
- var tag = ' ';
2623
- var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
2624
- if (typeof console === 'undefined') return;
2625
- if (warningStack[log]) return;
2626
- warningStack[log] = true;
2627
- if (process.env.NODE_ENV !== 'production') {
2628
- return console.error(log);
2629
- }
2630
- console.warn(log);
2631
- };
2632
-
2633
- var defaultRect = {
2634
- top: -1e3,
2635
- left: -1e3,
2636
- right: -1e3,
2637
- width: 0
2638
- };
2639
- var Dropdown = /*#__PURE__*/React$1.memo(function (_ref) {
2640
- var children = _ref.children,
2641
- parent = _ref.parent,
2642
- visible = _ref.visible,
2643
- disableMatchWidth = _ref.disableMatchWidth,
2644
- getPopupContainer = _ref.getPopupContainer;
2645
- var el = usePortal('dropdown', getPopupContainer);
2646
- var _useState = React$1.useState(defaultRect),
2647
- _useState2 = _slicedToArray(_useState, 2),
2648
- rect = _useState2[0],
2649
- setRect = _useState2[1];
2650
- var classes = useClasses('dropdown', disableMatchWidth ? 'disable-match' : 'width-match');
2651
- if (!parent) return null;
2652
-
2653
- /* istanbul ignore next */
2654
- if (process.env.NODE_ENV !== 'production') {
2655
- if (getPopupContainer && getPopupContainer()) {
2656
- var _el = getPopupContainer();
2657
- var style = window.getComputedStyle(_el);
2658
- if (style.position === 'static') {
2659
- useWarning('The element specified by "getPopupContainer" must have "position" set.');
2660
- }
2661
- }
2662
- }
2663
- var updateRect = function updateRect() {
2664
- var _getRefRect = getRefRect(parent, getPopupContainer),
2665
- top = _getRefRect.top,
2666
- left = _getRefRect.left,
2667
- right = _getRefRect.right,
2668
- nativeWidth = _getRefRect.width;
2669
- setRect({
2670
- top: top,
2671
- left: left,
2672
- right: right,
2673
- width: nativeWidth
2674
- });
2675
- };
2676
- useResize(updateRect);
2677
- useClickAnyWhere(function () {
2678
- var _getRefRect2 = getRefRect(parent, getPopupContainer),
2679
- top = _getRefRect2.top,
2680
- left = _getRefRect2.left;
2681
- var shouldUpdatePosition = top !== rect.top || left !== rect.left;
2682
- if (!shouldUpdatePosition) return;
2683
- updateRect();
2684
- });
2685
- useDOMObserver(parent, function () {
2686
- updateRect();
2687
- });
2688
- React$1.useEffect(function () {
2689
- if (!parent || !parent.current) return;
2690
- parent.current.addEventListener('mouseenter', updateRect);
2691
- /* istanbul ignore next */
2692
- return function () {
2693
- if (!parent || !parent.current) return;
2694
- parent.current.removeEventListener('mouseenter', updateRect);
2695
- };
2696
- }, [parent]);
2697
- var clickHandler = function clickHandler(event) {
2698
- event.stopPropagation();
2699
- event.nativeEvent.stopImmediatePropagation();
2700
- event.preventDefault();
2701
- };
2702
- var mouseDownHandler = function mouseDownHandler(event) {
2703
- event.preventDefault();
2704
- };
2705
- if (!el) return null;
2706
- return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React$1.createElement(CssTransition, {
2707
- visible: visible
2708
- }, /*#__PURE__*/React$1.createElement("div", {
2709
- onClick: clickHandler,
2710
- onMouseDown: mouseDownHandler,
2711
- className: _JSXStyle.dynamic([["1644673105", [rect.top + 2, rect.left, rect.width, rect.width]]]) + " " + (classes || "")
2712
- }, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2713
- id: "1644673105",
2714
- dynamic: [rect.top + 2, rect.left, rect.width, rect.width]
2715
- }, ".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);
2716
- });
2717
-
2718
- var _excluded = ["children", "onClick", "visible", "width", "onContentClick", "backdropClassName", "positionClassName", "layerClassName"];
2719
- var Backdrop = /*#__PURE__*/React$1.memo(function (_ref) {
2720
- var children = _ref.children,
2721
- _ref$onClick = _ref.onClick,
2722
- onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
2723
- _ref$visible = _ref.visible,
2724
- visible = _ref$visible === void 0 ? false : _ref$visible,
2725
- width = _ref.width,
2726
- _ref$onContentClick = _ref.onContentClick,
2727
- onContentClick = _ref$onContentClick === void 0 ? function () {} : _ref$onContentClick,
2728
- _ref$backdropClassNam = _ref.backdropClassName,
2729
- backdropClassName = _ref$backdropClassNam === void 0 ? '' : _ref$backdropClassNam,
2730
- _ref$positionClassNam = _ref.positionClassName,
2731
- positionClassName = _ref$positionClassNam === void 0 ? '' : _ref$positionClassNam,
2732
- _ref$layerClassName = _ref.layerClassName,
2733
- layerClassName = _ref$layerClassName === void 0 ? '' : _ref$layerClassName,
2734
- props = _objectWithoutProperties(_ref, _excluded);
2735
- var theme = useTheme();
2736
- var _useCurrentState = useCurrentState(false),
2737
- _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
2738
- setIsContentMouseDown = _useCurrentState2[1],
2739
- IsContentMouseDownRef = _useCurrentState2[2];
2740
- var clickHandler = function clickHandler(event) {
2741
- if (IsContentMouseDownRef.current) return;
2742
- onClick && onClick(event);
2743
- };
2744
- var mouseUpHandler = function mouseUpHandler() {
2745
- if (!IsContentMouseDownRef.current) return;
2746
- var timer = setTimeout(function () {
2747
- setIsContentMouseDown(false);
2748
- clearTimeout(timer);
2749
- }, 0);
2750
- };
2751
- return /*#__PURE__*/React$1.createElement(CssTransition, {
2752
- name: "backdrop-wrapper",
2753
- visible: visible,
2754
- clearTime: 300
2755
- }, /*#__PURE__*/React$1.createElement("div", _extends({
2756
- onClick: clickHandler,
2757
- onMouseUp: mouseUpHandler
2758
- }, props, {
2759
- className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (props && props.className != null && props.className || useClasses('backdrop', backdropClassName) || "")
2760
- }), /*#__PURE__*/React$1.createElement("div", {
2761
- className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (useClasses('layer', layerClassName) || "")
2762
- }), /*#__PURE__*/React$1.createElement("div", {
2763
- onClick: onContentClick,
2764
- onMouseDown: function onMouseDown() {
2765
- return setIsContentMouseDown(true);
2766
- },
2767
- className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (useClasses('position', positionClassName) || "")
2768
- }, children), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2769
- id: "2021762493",
2770
- dynamic: [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]
2771
- }, ".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;}"))));
2772
- });
2773
- Backdrop.displayName = 'Backdrop';
2774
-
2775
- dist.Backdrop = Backdrop;
2776
- dist.CssBaseline = MemoCssBaseline;
2777
- dist.CssTransition = CssTransition;
2778
- dist.Dropdown = Dropdown;
2779
- dist.Ellipsis = ellipsis;
2780
- dist.Expand = Expand;
2781
- dist.Highlight = Highlight;
2782
- dist.Themes = Themes;
2783
- dist.UiProvider = HuiProvider;
2784
- dist.useAllThemes = useAllThemes;
2785
- dist.useClasses = useClasses;
2786
- dist.useCurrentState = useCurrentState;
2787
- dist.useMediaQuery = useMediaQuery;
2788
- dist.useRect = useRect;
2789
- dist.useTheme = useTheme;
2790
- dist.useToasts = useToasts;
2791
- return dist;
2792
- }
2793
-
2794
- var distExports = /*@__PURE__*/ requireDist();
2795
-
2796
677
  var _excluded$4 = ["opacity"];
2797
678
  var ImageSkeleton = /*#__PURE__*/React.memo(function (_ref) {
2798
679
  var _ref$opacity = _ref.opacity,
2799
680
  opacity = _ref$opacity === void 0 ? 0.5 : _ref$opacity,
2800
681
  props = _objectWithoutProperties(_ref, _excluded$4);
2801
- var theme = distExports.useTheme();
682
+ var theme$1 = theme.useTheme();
2802
683
  return /*#__PURE__*/React.createElement("div", _extends({}, props, {
2803
- className: _JSXStyle.dynamic([["2946022605", [theme.palette.accents_1, theme.palette.accents_2, theme.palette.accents_2, theme.palette.accents_1, opacity]]]) + " " + (props && props.className != null && props.className || "skeleton")
684
+ className: _JSXStyle.dynamic([["2946022605", [theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_2, theme$1.palette.accents_1, opacity]]]) + " " + (props && props.className != null && props.className || "skeleton")
2804
685
  }), /*#__PURE__*/React.createElement(_JSXStyle, {
2805
686
  id: "2946022605",
2806
- dynamic: [theme.palette.accents_1, theme.palette.accents_2, theme.palette.accents_2, theme.palette.accents_1, opacity]
2807
- }, ".skeleton.__jsx-style-dynamic-selector{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;background-image:linear-gradient( 270deg, ".concat(theme.palette.accents_1, ", ").concat(theme.palette.accents_2, ", ").concat(theme.palette.accents_2, ", ").concat(theme.palette.accents_1, " );background-size:400% 100%;-webkit-animation:loading-__jsx-style-dynamic-selector 3s ease-in-out infinite;animation:loading-__jsx-style-dynamic-selector 3s ease-in-out infinite;opacity:").concat(opacity, ";-webkit-transition:opacity 300ms ease-out;transition:opacity 300ms ease-out;}@-webkit-keyframes loading-__jsx-style-dynamic-selector{0%{background-position:200% 0;}to{background-position:-200% 0;}}@keyframes loading-__jsx-style-dynamic-selector{0%{background-position:200% 0;}to{background-position:-200% 0;}}")));
687
+ dynamic: [theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_2, theme$1.palette.accents_1, opacity]
688
+ }, ".skeleton.__jsx-style-dynamic-selector{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;background-image:linear-gradient( 270deg, ".concat(theme$1.palette.accents_1, ", ").concat(theme$1.palette.accents_2, ", ").concat(theme$1.palette.accents_2, ", ").concat(theme$1.palette.accents_1, " );background-size:400% 100%;-webkit-animation:loading-__jsx-style-dynamic-selector 3s ease-in-out infinite;animation:loading-__jsx-style-dynamic-selector 3s ease-in-out infinite;opacity:").concat(opacity, ";-webkit-transition:opacity 300ms ease-out;transition:opacity 300ms ease-out;}@-webkit-keyframes loading-__jsx-style-dynamic-selector{0%{background-position:200% 0;}to{background-position:-200% 0;}}@keyframes loading-__jsx-style-dynamic-selector{0%{background-position:200% 0;}to{background-position:-200% 0;}}")));
2808
689
  });
2809
690
  ImageSkeleton.displayName = 'ImageSkeleton';
2810
691
 
@@ -2923,7 +804,7 @@ var withScale = function withScale(Render) {
2923
804
  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;
2924
805
  var children = _ref.children,
2925
806
  props = _objectWithoutProperties(_ref, _excluded$3);
2926
- var _useTheme = distExports.useTheme(),
807
+ var _useTheme = theme.useTheme(),
2927
808
  layout = _useTheme.layout;
2928
809
  var paddingLeft = props.paddingLeft,
2929
810
  pl = props.pl,
@@ -3021,7 +902,7 @@ var ImageComponent = function ImageComponent(_ref) {
3021
902
  var width = getScaleProps(['width', 'w']);
3022
903
  var height = getScaleProps(['height', 'h']);
3023
904
  var showAnimation = !disableSkeleton && width && height;
3024
- var theme = distExports.useTheme();
905
+ var theme$1 = theme.useTheme();
3025
906
  var _useState = React.useState(true),
3026
907
  _useState2 = _slicedToArray(_useState, 2),
3027
908
  loading = _useState2[0],
@@ -3058,7 +939,7 @@ var ImageComponent = function ImageComponent(_ref) {
3058
939
  };
3059
940
  }, [loading]);
3060
941
  return /*#__PURE__*/React.createElement("div", {
3061
- className: _JSXStyle.dynamic([["4175752462", [theme.layout.radius, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.width(1, 'auto'), SCALES.height(1, 'auto')]]]) + " " + (distExports.useClasses('image', className) || "")
942
+ className: _JSXStyle.dynamic([["4175752462", [theme$1.layout.radius, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.width(1, 'auto'), SCALES.height(1, 'auto')]]]) + " " + (theme.useClasses('image', className) || "")
3062
943
  }, showSkeleton && showAnimation && /*#__PURE__*/React.createElement(ImageSkeleton, {
3063
944
  opacity: loading ? 0.5 : 0
3064
945
  }), /*#__PURE__*/React.createElement("img", _extends({
@@ -3066,11 +947,11 @@ var ImageComponent = function ImageComponent(_ref) {
3066
947
  onLoad: imageLoaded,
3067
948
  src: url
3068
949
  }, props, {
3069
- className: _JSXStyle.dynamic([["4175752462", [theme.layout.radius, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.width(1, 'auto'), SCALES.height(1, 'auto')]]]) + " " + (props && props.className != null && props.className || "")
950
+ className: _JSXStyle.dynamic([["4175752462", [theme$1.layout.radius, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.width(1, 'auto'), SCALES.height(1, 'auto')]]]) + " " + (props && props.className != null && props.className || "")
3070
951
  })), /*#__PURE__*/React.createElement(_JSXStyle, {
3071
952
  id: "4175752462",
3072
- dynamic: [theme.layout.radius, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.width(1, 'auto'), SCALES.height(1, 'auto')]
3073
- }, ".image.__jsx-style-dynamic-selector{position:relative;border-radius:".concat(theme.layout.radius, ";overflow:hidden;max-width:100%;width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0, 'auto'), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}img.__jsx-style-dynamic-selector{width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";object-fit:scale-down;display:inline-block;}")));
953
+ dynamic: [theme$1.layout.radius, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.width(1, 'auto'), SCALES.height(1, 'auto')]
954
+ }, ".image.__jsx-style-dynamic-selector{position:relative;border-radius:".concat(theme$1.layout.radius, ";overflow:hidden;max-width:100%;width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0, 'auto'), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}img.__jsx-style-dynamic-selector{width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";object-fit:scale-down;display:inline-block;}")));
3074
955
  };
3075
956
  ImageComponent.displayName = 'Image';
3076
957
  var Image = withScale(ImageComponent);
@@ -3155,26 +1036,26 @@ var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
3155
1036
  arrow = _ref$arrow === void 0 ? false : _ref$arrow,
3156
1037
  icon = _ref.icon,
3157
1038
  props = _objectWithoutProperties(_ref, _excluded$1);
3158
- var theme = distExports.useTheme();
1039
+ var theme$1 = theme.useTheme();
3159
1040
  var _useScale = useScale(),
3160
1041
  SCALES = _useScale.SCALES;
3161
- var linkColor = showColor || block ? theme.palette.link : 'inherit';
3162
- var hoverColor = showColor || block ? theme.palette.successLight : 'inherit';
1042
+ var linkColor = showColor || block ? theme$1.palette.link : 'inherit';
1043
+ var hoverColor = showColor || block ? theme$1.palette.successLight : 'inherit';
3163
1044
  var decoration = underline ? 'underline' : 'none';
3164
- var classes = distExports.useClasses('link', {
1045
+ var classes = theme.useClasses('link', {
3165
1046
  block: block
3166
1047
  }, className);
3167
1048
  return /*#__PURE__*/React.createElement("a", _extends({
3168
1049
  href: href
3169
1050
  }, props, {
3170
1051
  ref: ref,
3171
- className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
1052
+ className: _JSXStyle.dynamic([["1962988967", [linkColor, block ? theme$1.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme$1.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
3172
1053
  }), icon && icon, /*#__PURE__*/React.createElement("span", {
3173
- className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra"
1054
+ className: _JSXStyle.dynamic([["1962988967", [linkColor, block ? theme$1.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme$1.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra"
3174
1055
  }, children, arrow && /*#__PURE__*/React.createElement(LinkIcon, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
3175
- id: "2838069667",
3176
- dynamic: [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]
3177
- }, ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
1056
+ id: "1962988967",
1057
+ dynamic: [linkColor, block ? theme$1.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme$1.palette.link, 0.1) : 'unset', hoverColor]
1058
+ }, ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme$1.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme$1.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
3178
1059
  });
3179
1060
  LinkComponent.displayName = 'Link';
3180
1061
  var Link = withScale(LinkComponent);
@@ -3250,12 +1131,12 @@ var ImageBrowserComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
3250
1131
  _ref$className = _ref.className,
3251
1132
  className = _ref$className === void 0 ? '' : _ref$className,
3252
1133
  props = _objectWithoutProperties(_ref, _excluded);
3253
- var theme = distExports.useTheme();
1134
+ var theme$1 = theme.useTheme();
3254
1135
  var _useScale = useScale(),
3255
1136
  SCALES = _useScale.SCALES;
3256
1137
  var colors = React.useMemo(function () {
3257
- return getBrowserColors(invert, theme.palette);
3258
- }, [invert, theme.palette]);
1138
+ return getBrowserColors(invert, theme$1.palette);
1139
+ }, [invert, theme$1.palette]);
3259
1140
  var input = React.useMemo(function () {
3260
1141
  if (url) return getAddressInput(url, showFullLink, colors, anchorProps);
3261
1142
  if (title) return getTitle(title, colors);
@@ -3264,21 +1145,21 @@ var ImageBrowserComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
3264
1145
  return /*#__PURE__*/React.createElement("div", _extends({
3265
1146
  ref: ref
3266
1147
  }, props, {
3267
- className: _JSXStyle.dynamic([["1856409351", [theme.expressiveness.shadowLarge, theme.layout.radius, SCALES.font(1), SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), colors.color, colors.barBgColor, colors.borderColor, theme.layout.gapHalf]]]) + " " + (props && props.className != null && props.className || distExports.useClasses('browser', className) || "")
1148
+ className: _JSXStyle.dynamic([["1856409351", [theme$1.expressiveness.shadowLarge, theme$1.layout.radius, SCALES.font(1), SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), colors.color, colors.barBgColor, colors.borderColor, theme$1.layout.gapHalf]]]) + " " + (props && props.className != null && props.className || theme.useClasses('browser', className) || "")
3268
1149
  }), /*#__PURE__*/React.createElement("header", {
3269
- className: _JSXStyle.dynamic([["1856409351", [theme.expressiveness.shadowLarge, theme.layout.radius, SCALES.font(1), SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), colors.color, colors.barBgColor, colors.borderColor, theme.layout.gapHalf]]])
1150
+ className: _JSXStyle.dynamic([["1856409351", [theme$1.expressiveness.shadowLarge, theme$1.layout.radius, SCALES.font(1), SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), colors.color, colors.barBgColor, colors.borderColor, theme$1.layout.gapHalf]]])
3270
1151
  }, /*#__PURE__*/React.createElement("div", {
3271
- className: _JSXStyle.dynamic([["1856409351", [theme.expressiveness.shadowLarge, theme.layout.radius, SCALES.font(1), SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), colors.color, colors.barBgColor, colors.borderColor, theme.layout.gapHalf]]]) + " " + "traffic"
1152
+ className: _JSXStyle.dynamic([["1856409351", [theme$1.expressiveness.shadowLarge, theme$1.layout.radius, SCALES.font(1), SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), colors.color, colors.barBgColor, colors.borderColor, theme$1.layout.gapHalf]]]) + " " + "traffic"
3272
1153
  }, /*#__PURE__*/React.createElement("span", {
3273
- className: _JSXStyle.dynamic([["1856409351", [theme.expressiveness.shadowLarge, theme.layout.radius, SCALES.font(1), SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), colors.color, colors.barBgColor, colors.borderColor, theme.layout.gapHalf]]]) + " " + "close"
1154
+ className: _JSXStyle.dynamic([["1856409351", [theme$1.expressiveness.shadowLarge, theme$1.layout.radius, SCALES.font(1), SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), colors.color, colors.barBgColor, colors.borderColor, theme$1.layout.gapHalf]]]) + " " + "close"
3274
1155
  }), /*#__PURE__*/React.createElement("span", {
3275
- className: _JSXStyle.dynamic([["1856409351", [theme.expressiveness.shadowLarge, theme.layout.radius, SCALES.font(1), SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), colors.color, colors.barBgColor, colors.borderColor, theme.layout.gapHalf]]]) + " " + "mini"
1156
+ className: _JSXStyle.dynamic([["1856409351", [theme$1.expressiveness.shadowLarge, theme$1.layout.radius, SCALES.font(1), SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), colors.color, colors.barBgColor, colors.borderColor, theme$1.layout.gapHalf]]]) + " " + "mini"
3276
1157
  }), /*#__PURE__*/React.createElement("span", {
3277
- className: _JSXStyle.dynamic([["1856409351", [theme.expressiveness.shadowLarge, theme.layout.radius, SCALES.font(1), SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), colors.color, colors.barBgColor, colors.borderColor, theme.layout.gapHalf]]]) + " " + "full"
1158
+ className: _JSXStyle.dynamic([["1856409351", [theme$1.expressiveness.shadowLarge, theme$1.layout.radius, SCALES.font(1), SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), colors.color, colors.barBgColor, colors.borderColor, theme$1.layout.gapHalf]]]) + " " + "full"
3278
1159
  })), input), children, /*#__PURE__*/React.createElement(_JSXStyle, {
3279
1160
  id: "1856409351",
3280
- dynamic: [theme.expressiveness.shadowLarge, theme.layout.radius, SCALES.font(1), SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), colors.color, colors.barBgColor, colors.borderColor, theme.layout.gapHalf]
3281
- }, ".browser.__jsx-style-dynamic-selector{background-color:transparent;box-shadow:".concat(theme.expressiveness.shadowLarge, ";max-width:100%;border-radius:").concat(theme.layout.radius, ";overflow:hidden;font-size:").concat(SCALES.font(1), ";width:").concat(SCALES.width(1, 'max-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0, 'auto'), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.browser.__jsx-style-dynamic-selector .image{border-top-left-radius:0;border-top-right-radius:0;}header.__jsx-style-dynamic-selector{height:2.5em;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;position:relative;color:").concat(colors.color, ";background-color:").concat(colors.barBgColor, ";border-bottom:1px solid ").concat(colors.borderColor, ";}.traffic.__jsx-style-dynamic-selector{width:auto;position:absolute;left:").concat(theme.layout.gapHalf, ";top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);bottom:0;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:inherit;}.traffic.__jsx-style-dynamic-selector span.__jsx-style-dynamic-selector{border-radius:50%;width:0.75em;height:0.75em;max-width:20px;max-height:20px;display:inline-block;margin-right:0.5em;}.close.__jsx-style-dynamic-selector{background-color:#ff5f56;}.mini.__jsx-style-dynamic-selector{background-color:#ffbd2e;}.full.__jsx-style-dynamic-selector{background-color:#27c93f;}")));
1161
+ dynamic: [theme$1.expressiveness.shadowLarge, theme$1.layout.radius, SCALES.font(1), SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), colors.color, colors.barBgColor, colors.borderColor, theme$1.layout.gapHalf]
1162
+ }, ".browser.__jsx-style-dynamic-selector{background-color:transparent;box-shadow:".concat(theme$1.expressiveness.shadowLarge, ";max-width:100%;border-radius:").concat(theme$1.layout.radius, ";overflow:hidden;font-size:").concat(SCALES.font(1), ";width:").concat(SCALES.width(1, 'max-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0, 'auto'), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.browser.__jsx-style-dynamic-selector .image{border-top-left-radius:0;border-top-right-radius:0;}header.__jsx-style-dynamic-selector{height:2.5em;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;position:relative;color:").concat(colors.color, ";background-color:").concat(colors.barBgColor, ";border-bottom:1px solid ").concat(colors.borderColor, ";}.traffic.__jsx-style-dynamic-selector{width:auto;position:absolute;left:").concat(theme$1.layout.gapHalf, ";top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);bottom:0;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:inherit;}.traffic.__jsx-style-dynamic-selector span.__jsx-style-dynamic-selector{border-radius:50%;width:0.75em;height:0.75em;max-width:20px;max-height:20px;display:inline-block;margin-right:0.5em;}.close.__jsx-style-dynamic-selector{background-color:#ff5f56;}.mini.__jsx-style-dynamic-selector{background-color:#ffbd2e;}.full.__jsx-style-dynamic-selector{background-color:#27c93f;}")));
3282
1163
  });
3283
1164
  ImageBrowserComponent.displayName = 'ImageBrowser';
3284
1165
  var ImageBrowser = withScale(ImageBrowserComponent);