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