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