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