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