@eightshift/ui-components 1.3.2 → 1.4.1
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/{Button-DTARR6Ff.js → Button-uYE9D_E3.js} +6 -5
- package/dist/{ColorSwatch-5bZ_yIMB.js → ColorSwatch-Bev-9Vbr.js} +4 -4
- package/dist/{Dialog-DJgS0mAg.js → Dialog-CGE2ficT.js} +17 -15
- package/dist/{FieldError-CviphIN5.js → FieldError-CBPJ4Xx8.js} +2 -2
- package/dist/{FocusScope-BjM5iOQC.js → FocusScope-CVd6C65L.js} +24 -8
- package/dist/{GridList-DjRnMEae.js → GridList-PBJsm70G.js} +156 -116
- package/dist/{Group-BQu67pVS.js → Group-WZgNv9RE.js} +3 -3
- package/dist/Hidden-YSmyVF_5.js +45 -0
- package/dist/{Input-DWRQF0ro.js → Input-CaS4qmLb.js} +10 -9
- package/dist/{Label-BXvY41yE.js → Label-yZgqvhXc.js} +3 -2
- package/dist/ListBox-MZyPpwvj.js +567 -0
- package/dist/{Select-49a62830.esm-BnlXlUnT.js → Select-49a62830.esm-CqLHaIei.js} +1 -1
- package/dist/{SelectionManager-JxXmb3-k.js → SelectionManager-CvRaua4m.js} +1580 -1484
- package/dist/{Separator-CX64zwq8.js → Separator-C7Few7L6.js} +80 -62
- package/dist/{Slider-Clme2C36.js → Slider-D8a63VhT.js} +14 -12
- package/dist/{Text-qjognpzK.js → Text-D8qh3_U7.js} +1 -1
- package/dist/{VisuallyHidden-BZPezMV5.js → VisuallyHidden-DD480kAb.js} +2 -2
- package/dist/_commonjsHelpers-CUmg6egw.js +6 -0
- package/dist/{ariaHideOutside-BZ5z6iCD.js → ariaHideOutside-BzxkODNq.js} +1 -9
- package/dist/assets/style.css +1 -1
- package/dist/assets/wp-ui-enhancements.css +1 -1
- package/dist/components/animated-visibility/animated-visibility.js +311 -198
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/button/button.js +274 -9
- package/dist/components/checkbox/checkbox.js +171 -1
- package/dist/components/color-pickers/color-picker.js +1 -1
- package/dist/components/color-pickers/color-swatch.js +3 -3
- package/dist/components/color-pickers/gradient-editor.js +3 -3
- package/dist/components/color-pickers/solid-color-picker.js +46 -32
- package/dist/components/component-toggle/component-toggle.js +2 -2
- package/dist/components/container-panel/container-panel.js +2 -2
- package/dist/components/draggable-list/draggable-list-item.js +3 -3
- package/dist/components/draggable-list/draggable-list.js +3671 -6
- package/dist/components/expandable/expandable.js +7 -4
- package/dist/components/index.js +4 -4
- package/dist/components/input-field/input-field.js +7 -7
- package/dist/components/link-input/link-input.js +1519 -489
- package/dist/components/list-box/list-box.js +2 -2
- package/dist/components/matrix-align/matrix-align.js +3 -3
- package/dist/components/menu/menu.js +164 -466
- package/dist/components/modal/modal.js +7 -7
- package/dist/components/number-picker/number-picker.js +22 -17
- package/dist/components/option-select/option-select.js +2 -2
- package/dist/components/placeholders/file-placeholder.js +1 -1
- package/dist/components/popover/popover.js +3 -3
- package/dist/components/radio/radio.js +13 -13
- package/dist/components/repeater/repeater-context.js +5 -0
- package/dist/components/repeater/repeater-item.js +46 -91
- package/dist/components/repeater/repeater.js +5130 -175
- package/dist/components/responsive/responsive-legacy.js +3 -3
- package/dist/components/responsive/responsive.js +3 -3
- package/dist/components/responsive-preview/responsive-preview.js +1 -1
- package/dist/components/select/async-multi-select.js +3 -3
- package/dist/components/select/async-single-select.js +2 -2
- package/dist/components/select/custom-select-default-components.js +1 -1
- package/dist/components/select/multi-select-components.js +1 -1
- package/dist/components/select/multi-select.js +5 -5
- package/dist/components/select/react-select-component-wrappers.js +1 -1
- package/dist/components/select/single-select.js +2 -2
- package/dist/components/select/styles.js +1 -1
- package/dist/components/slider/column-config-slider.js +3 -3
- package/dist/components/slider/slider.js +3 -3
- package/dist/components/slider/utils.js +1 -1
- package/dist/components/tabs/tabs.js +46 -71
- package/dist/components/toggle/switch.js +6 -6
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +7 -7
- package/dist/components/tooltip/tooltip.js +3 -3
- package/dist/{context-BG_1RnbC.js → context-Bon2Gyx5.js} +1 -1
- package/dist/{default-i18n-BqwLkgZv.js → default-i18n-BqWys-1G.js} +1 -1
- package/dist/{focusSafely-DGZ4R5fj.js → focusSafely-PMGZgZ9-.js} +33 -26
- package/dist/getScrollParent-B3XgpXBL.js +10 -0
- package/dist/icons/icons.js +205 -0
- package/dist/icons/jsx-svg.js +2 -2
- package/dist/{index-CAPcSs9K.js → index-BTCzc3zb.js} +1 -1
- package/dist/{index-a301f526.esm-ByOfDxiG.js → index-a301f526.esm-B9tWL9yi.js} +80 -603
- package/dist/index.js +4 -4
- package/dist/{intlStrings-CkuKCPkT.js → intlStrings-KQxgp5tS.js} +14 -9
- package/dist/{multi-select-components-7vKCF8dG.js → multi-select-components-DTvEidE3.js} +1 -1
- package/dist/react-jsx-parser.min-CAGfntg1.js +13425 -0
- package/dist/{react-select-async.esm-5zW9Dv9E.js → react-select-async.esm-8Rba_3KV.js} +3 -3
- package/dist/{react-select.esm-Bi6uzjbT.js → react-select.esm-DkSeQzOP.js} +3 -3
- package/dist/{textSelection-BLyBtNe2.js → textSelection-DS7-670U.js} +1 -1
- package/dist/{tooltip-DSk8I1SO.js → tooltip-C9mg1CP5.js} +54 -18
- package/dist/{useButton-EJ9c8fmq.js → useButton-BPY4yXUo.js} +3 -3
- package/dist/{useEvent-Cxq_BzP_.js → useEvent-DDLT851Z.js} +1 -1
- package/dist/{useFocusRing-Dg5Y_10S.js → useFocusRing-DsxEaA2J.js} +1 -1
- package/dist/{useFocusable-CQZyQp4q.js → useFocusable-BFKHuYS9.js} +2 -2
- package/dist/{useFormReset-DJMtIgSL.js → useFormReset-BCPbwfnH.js} +1 -1
- package/dist/{useFormValidationState-DDC_nImg.js → useFormValidationState-DC5jbhBW.js} +2 -2
- package/dist/{useHasTabbableChild-M3O3VIil.js → useHasTabbableChild-Byd7ylXD.js} +2 -2
- package/dist/{useLabel-6NqYraET.js → useLabel-DuJhImKc.js} +2 -2
- package/dist/{useLabels-D2RG7TdI.js → useLabels-JaBafrnV.js} +1 -1
- package/dist/{useListData-BpYQj7kK.js → useListData-B5Pk32vd.js} +6 -3
- package/dist/{useListState-IllYYnXV.js → useListState-Csx05BmT.js} +6 -3
- package/dist/{useLocalizedStringFormatter-Cwm_siat.js → useLocalizedStringFormatter-CVIIVTgz.js} +1 -1
- package/dist/useMenuTrigger-CMgzyMKW.js +246 -0
- package/dist/{useNumberFieldState-CVJOJnF1.js → useNumberFieldState-BVFqhboT.js} +12 -11
- package/dist/{useNumberFormatter-DVZRQXk3.js → useNumberFormatter-BEeBSV-N.js} +1 -1
- package/dist/{usePress-CiXj8dLE.js → usePress-CY8MpqYD.js} +58 -16
- package/dist/useSingleSelectListState-CzZUgAt0.js +37 -0
- package/dist/{useToggle-CV-IX6nL.js → useToggle-CJp2Fh_L.js} +4 -4
- package/dist/{useToggleState-DHIdITtQ.js → useToggleState-B4--Ski0.js} +1 -1
- package/dist/{utils-DC-UMp1n.js → utils-B4IdLYb8.js} +48 -85
- package/package.json +24 -21
- package/dist/Checkbox-CiJIVbAP.js +0 -174
- package/dist/ListBox-DTKMdjQC.js +0 -4216
- package/dist/_commonjsHelpers-DWwsNxpa.js +0 -8
- package/dist/button-IxfzzzbP.js +0 -277
- package/dist/react-jsx-parser.min-DhrYeqLL.js +0 -4563
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { forwardRef, useContext, useLayoutEffect, useRef, useState, useMemo, useCallback, createContext } from "react";
|
|
3
|
-
import { r as reactDomExports } from "./index-
|
|
3
|
+
import { r as reactDomExports } from "./index-BTCzc3zb.js";
|
|
4
4
|
function _typeof(o) {
|
|
5
5
|
"@babel/helpers - typeof";
|
|
6
6
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
@@ -98,7 +98,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
98
98
|
if (null == r) return {};
|
|
99
99
|
var t = {};
|
|
100
100
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
101
|
-
if (e.
|
|
101
|
+
if (e.includes(n)) continue;
|
|
102
102
|
t[n] = r[n];
|
|
103
103
|
}
|
|
104
104
|
return t;
|
|
@@ -107,8 +107,8 @@ function _objectWithoutProperties(e, t) {
|
|
|
107
107
|
if (null == e) return {};
|
|
108
108
|
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
109
109
|
if (Object.getOwnPropertySymbols) {
|
|
110
|
-
var
|
|
111
|
-
for (r = 0; r <
|
|
110
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
111
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
112
112
|
}
|
|
113
113
|
return i;
|
|
114
114
|
}
|
|
@@ -121,6 +121,7 @@ function _extends() {
|
|
|
121
121
|
return n;
|
|
122
122
|
}, _extends.apply(null, arguments);
|
|
123
123
|
}
|
|
124
|
+
var isDevelopment$2 = false;
|
|
124
125
|
function sheetForTag(tag) {
|
|
125
126
|
if (tag.sheet) {
|
|
126
127
|
return tag.sheet;
|
|
@@ -130,6 +131,7 @@ function sheetForTag(tag) {
|
|
|
130
131
|
return document.styleSheets[i];
|
|
131
132
|
}
|
|
132
133
|
}
|
|
134
|
+
return void 0;
|
|
133
135
|
}
|
|
134
136
|
function createStyleElement(options2) {
|
|
135
137
|
var tag = document.createElement("style");
|
|
@@ -160,7 +162,7 @@ var StyleSheet = /* @__PURE__ */ function() {
|
|
|
160
162
|
_this.container.insertBefore(tag, before);
|
|
161
163
|
_this.tags.push(tag);
|
|
162
164
|
};
|
|
163
|
-
this.isSpeedy = options2.speedy === void 0 ?
|
|
165
|
+
this.isSpeedy = options2.speedy === void 0 ? !isDevelopment$2 : options2.speedy;
|
|
164
166
|
this.tags = [];
|
|
165
167
|
this.ctr = 0;
|
|
166
168
|
this.nonce = options2.nonce;
|
|
@@ -179,21 +181,11 @@ var StyleSheet = /* @__PURE__ */ function() {
|
|
|
179
181
|
this._insertTag(createStyleElement(this));
|
|
180
182
|
}
|
|
181
183
|
var tag = this.tags[this.tags.length - 1];
|
|
182
|
-
if (process.env.NODE_ENV !== "production") {
|
|
183
|
-
var isImportRule3 = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
|
|
184
|
-
if (isImportRule3 && this._alreadyInsertedOrderInsensitiveRule) {
|
|
185
|
-
console.error("You're attempting to insert the following rule:\n" + rule + "\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.");
|
|
186
|
-
}
|
|
187
|
-
this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule3;
|
|
188
|
-
}
|
|
189
184
|
if (this.isSpeedy) {
|
|
190
185
|
var sheet = sheetForTag(tag);
|
|
191
186
|
try {
|
|
192
187
|
sheet.insertRule(rule, sheet.cssRules.length);
|
|
193
188
|
} catch (e) {
|
|
194
|
-
if (process.env.NODE_ENV !== "production" && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {
|
|
195
|
-
console.error('There was a problem inserting the following rule: "' + rule + '"', e);
|
|
196
|
-
}
|
|
197
189
|
}
|
|
198
190
|
} else {
|
|
199
191
|
tag.appendChild(document.createTextNode(rule));
|
|
@@ -202,13 +194,11 @@ var StyleSheet = /* @__PURE__ */ function() {
|
|
|
202
194
|
};
|
|
203
195
|
_proto.flush = function flush() {
|
|
204
196
|
this.tags.forEach(function(tag) {
|
|
205
|
-
|
|
197
|
+
var _tag$parentNode;
|
|
198
|
+
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
|
|
206
199
|
});
|
|
207
200
|
this.tags = [];
|
|
208
201
|
this.ctr = 0;
|
|
209
|
-
if (process.env.NODE_ENV !== "production") {
|
|
210
|
-
this._alreadyInsertedOrderInsensitiveRule = false;
|
|
211
|
-
}
|
|
212
202
|
};
|
|
213
203
|
return StyleSheet2;
|
|
214
204
|
}();
|
|
@@ -645,68 +635,6 @@ var removeLabel = function removeLabel2(element) {
|
|
|
645
635
|
}
|
|
646
636
|
}
|
|
647
637
|
};
|
|
648
|
-
var ignoreFlag = "emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason";
|
|
649
|
-
var isIgnoringComment = function isIgnoringComment2(element) {
|
|
650
|
-
return element.type === "comm" && element.children.indexOf(ignoreFlag) > -1;
|
|
651
|
-
};
|
|
652
|
-
var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm2(cache) {
|
|
653
|
-
return function(element, index2, children) {
|
|
654
|
-
if (element.type !== "rule" || cache.compat) return;
|
|
655
|
-
var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
|
|
656
|
-
if (unsafePseudoClasses) {
|
|
657
|
-
var isNested = !!element.parent;
|
|
658
|
-
var commentContainer = isNested ? element.parent.children : (
|
|
659
|
-
// global rule at the root level
|
|
660
|
-
children
|
|
661
|
-
);
|
|
662
|
-
for (var i = commentContainer.length - 1; i >= 0; i--) {
|
|
663
|
-
var node2 = commentContainer[i];
|
|
664
|
-
if (node2.line < element.line) {
|
|
665
|
-
break;
|
|
666
|
-
}
|
|
667
|
-
if (node2.column < element.column) {
|
|
668
|
-
if (isIgnoringComment(node2)) {
|
|
669
|
-
return;
|
|
670
|
-
}
|
|
671
|
-
break;
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
unsafePseudoClasses.forEach(function(unsafePseudoClass) {
|
|
675
|
-
console.error('The pseudo class "' + unsafePseudoClass + '" is potentially unsafe when doing server-side rendering. Try changing it to "' + unsafePseudoClass.split("-child")[0] + '-of-type".');
|
|
676
|
-
});
|
|
677
|
-
}
|
|
678
|
-
};
|
|
679
|
-
};
|
|
680
|
-
var isImportRule = function isImportRule2(element) {
|
|
681
|
-
return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
|
|
682
|
-
};
|
|
683
|
-
var isPrependedWithRegularRules = function isPrependedWithRegularRules2(index2, children) {
|
|
684
|
-
for (var i = index2 - 1; i >= 0; i--) {
|
|
685
|
-
if (!isImportRule(children[i])) {
|
|
686
|
-
return true;
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
return false;
|
|
690
|
-
};
|
|
691
|
-
var nullifyElement = function nullifyElement2(element) {
|
|
692
|
-
element.type = "";
|
|
693
|
-
element.value = "";
|
|
694
|
-
element["return"] = "";
|
|
695
|
-
element.children = "";
|
|
696
|
-
element.props = "";
|
|
697
|
-
};
|
|
698
|
-
var incorrectImportAlarm = function incorrectImportAlarm2(element, index2, children) {
|
|
699
|
-
if (!isImportRule(element)) {
|
|
700
|
-
return;
|
|
701
|
-
}
|
|
702
|
-
if (element.parent) {
|
|
703
|
-
console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
|
|
704
|
-
nullifyElement(element);
|
|
705
|
-
} else if (isPrependedWithRegularRules(index2, children)) {
|
|
706
|
-
console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
|
|
707
|
-
nullifyElement(element);
|
|
708
|
-
}
|
|
709
|
-
};
|
|
710
638
|
function prefix(value, length2) {
|
|
711
639
|
switch (hash(value, length2)) {
|
|
712
640
|
case 5103:
|
|
@@ -853,9 +781,6 @@ var prefixer = function prefixer2(element, index2, children, callback) {
|
|
|
853
781
|
var defaultStylisPlugins = [prefixer];
|
|
854
782
|
var createCache = function createCache2(options2) {
|
|
855
783
|
var key = options2.key;
|
|
856
|
-
if (process.env.NODE_ENV !== "production" && !key) {
|
|
857
|
-
throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\nIf multiple caches share the same key they might \"fight\" for each other's style elements.");
|
|
858
|
-
}
|
|
859
784
|
if (key === "css") {
|
|
860
785
|
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
|
|
861
786
|
Array.prototype.forEach.call(ssrStyles, function(node2) {
|
|
@@ -868,11 +793,6 @@ var createCache = function createCache2(options2) {
|
|
|
868
793
|
});
|
|
869
794
|
}
|
|
870
795
|
var stylisPlugins = options2.stylisPlugins || defaultStylisPlugins;
|
|
871
|
-
if (process.env.NODE_ENV !== "production") {
|
|
872
|
-
if (/[^a-z-]/.test(key)) {
|
|
873
|
-
throw new Error('Emotion key must only contain lower case alphabetical characters and - but "' + key + '" was passed');
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
796
|
var inserted = {};
|
|
877
797
|
var container;
|
|
878
798
|
var nodesToHydrate = [];
|
|
@@ -893,24 +813,9 @@ var createCache = function createCache2(options2) {
|
|
|
893
813
|
}
|
|
894
814
|
var _insert;
|
|
895
815
|
var omnipresentPlugins = [compat, removeLabel];
|
|
896
|
-
if (process.env.NODE_ENV !== "production") {
|
|
897
|
-
omnipresentPlugins.push(createUnsafeSelectorsAlarm({
|
|
898
|
-
get compat() {
|
|
899
|
-
return cache.compat;
|
|
900
|
-
}
|
|
901
|
-
}), incorrectImportAlarm);
|
|
902
|
-
}
|
|
903
816
|
{
|
|
904
817
|
var currentSheet;
|
|
905
|
-
var finalizingPlugins = [stringify,
|
|
906
|
-
if (!element.root) {
|
|
907
|
-
if (element["return"]) {
|
|
908
|
-
currentSheet.insert(element["return"]);
|
|
909
|
-
} else if (element.value && element.type !== COMMENT) {
|
|
910
|
-
currentSheet.insert(element.value + "{}");
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
} : rulesheet(function(rule) {
|
|
818
|
+
var finalizingPlugins = [stringify, rulesheet(function(rule) {
|
|
914
819
|
currentSheet.insert(rule);
|
|
915
820
|
})];
|
|
916
821
|
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
@@ -919,13 +824,6 @@ var createCache = function createCache2(options2) {
|
|
|
919
824
|
};
|
|
920
825
|
_insert = function insert(selector, serialized, sheet, shouldCache) {
|
|
921
826
|
currentSheet = sheet;
|
|
922
|
-
if (process.env.NODE_ENV !== "production" && serialized.map !== void 0) {
|
|
923
|
-
currentSheet = {
|
|
924
|
-
insert: function insert2(rule) {
|
|
925
|
-
sheet.insert(rule + serialized.map);
|
|
926
|
-
}
|
|
927
|
-
};
|
|
928
|
-
}
|
|
929
827
|
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
930
828
|
if (shouldCache) {
|
|
931
829
|
cache.inserted[serialized.name] = true;
|
|
@@ -1241,7 +1139,7 @@ var MEMO_STATICS = {
|
|
|
1241
1139
|
var TYPE_STATICS = {};
|
|
1242
1140
|
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
1243
1141
|
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
1244
|
-
var isBrowser
|
|
1142
|
+
var isBrowser = true;
|
|
1245
1143
|
function getRegisteredStyles(registered, registeredStyles, classNames2) {
|
|
1246
1144
|
var rawClassName = "";
|
|
1247
1145
|
classNames2.split(" ").forEach(function(className) {
|
|
@@ -1265,7 +1163,7 @@ var registerStyles = function registerStyles2(cache, serialized, isStringTag) {
|
|
|
1265
1163
|
// in node since emotion-server relies on whether a style is in
|
|
1266
1164
|
// the registered cache to know whether a style is global or not
|
|
1267
1165
|
// also, note that this check will be dead code eliminated in the browser
|
|
1268
|
-
isBrowser
|
|
1166
|
+
isBrowser === false) && cache.registered[className] === void 0
|
|
1269
1167
|
) {
|
|
1270
1168
|
cache.registered[className] = serialized.styles;
|
|
1271
1169
|
}
|
|
@@ -1358,11 +1256,7 @@ var unitlessKeys = {
|
|
|
1358
1256
|
strokeOpacity: 1,
|
|
1359
1257
|
strokeWidth: 1
|
|
1360
1258
|
};
|
|
1361
|
-
var
|
|
1362
|
-
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
|
|
1363
|
-
You can read more about this here:
|
|
1364
|
-
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`;
|
|
1365
|
-
var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
|
|
1259
|
+
var isDevelopment$1 = false;
|
|
1366
1260
|
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
1367
1261
|
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
1368
1262
|
var isCustomProperty = function isCustomProperty2(property) {
|
|
@@ -1395,55 +1289,32 @@ var processStyleValue = function processStyleValue2(key, value) {
|
|
|
1395
1289
|
}
|
|
1396
1290
|
return value;
|
|
1397
1291
|
};
|
|
1398
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1399
|
-
var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
|
|
1400
|
-
var contentValues = ["normal", "none", "initial", "inherit", "unset"];
|
|
1401
|
-
var oldProcessStyleValue = processStyleValue;
|
|
1402
|
-
var msPattern = /^-ms-/;
|
|
1403
|
-
var hyphenPattern = /-(.)/g;
|
|
1404
|
-
var hyphenatedCache = {};
|
|
1405
|
-
processStyleValue = function processStyleValue3(key, value) {
|
|
1406
|
-
if (key === "content") {
|
|
1407
|
-
if (typeof value !== "string" || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
|
|
1408
|
-
throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
|
|
1409
|
-
}
|
|
1410
|
-
}
|
|
1411
|
-
var processed = oldProcessStyleValue(key, value);
|
|
1412
|
-
if (processed !== "" && !isCustomProperty(key) && key.indexOf("-") !== -1 && hyphenatedCache[key] === void 0) {
|
|
1413
|
-
hyphenatedCache[key] = true;
|
|
1414
|
-
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, "ms-").replace(hyphenPattern, function(str, _char) {
|
|
1415
|
-
return _char.toUpperCase();
|
|
1416
|
-
}) + "?");
|
|
1417
|
-
}
|
|
1418
|
-
return processed;
|
|
1419
|
-
};
|
|
1420
|
-
}
|
|
1421
1292
|
var noComponentSelectorMessage = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";
|
|
1422
1293
|
function handleInterpolation(mergedProps, registered, interpolation) {
|
|
1423
1294
|
if (interpolation == null) {
|
|
1424
1295
|
return "";
|
|
1425
1296
|
}
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
}
|
|
1430
|
-
return interpolation;
|
|
1297
|
+
var componentSelector = interpolation;
|
|
1298
|
+
if (componentSelector.__emotion_styles !== void 0) {
|
|
1299
|
+
return componentSelector;
|
|
1431
1300
|
}
|
|
1432
1301
|
switch (typeof interpolation) {
|
|
1433
1302
|
case "boolean": {
|
|
1434
1303
|
return "";
|
|
1435
1304
|
}
|
|
1436
1305
|
case "object": {
|
|
1437
|
-
|
|
1306
|
+
var keyframes3 = interpolation;
|
|
1307
|
+
if (keyframes3.anim === 1) {
|
|
1438
1308
|
cursor = {
|
|
1439
|
-
name:
|
|
1440
|
-
styles:
|
|
1309
|
+
name: keyframes3.name,
|
|
1310
|
+
styles: keyframes3.styles,
|
|
1441
1311
|
next: cursor
|
|
1442
1312
|
};
|
|
1443
|
-
return
|
|
1313
|
+
return keyframes3.name;
|
|
1444
1314
|
}
|
|
1445
|
-
|
|
1446
|
-
|
|
1315
|
+
var serializedStyles = interpolation;
|
|
1316
|
+
if (serializedStyles.styles !== void 0) {
|
|
1317
|
+
var next2 = serializedStyles.next;
|
|
1447
1318
|
if (next2 !== void 0) {
|
|
1448
1319
|
while (next2 !== void 0) {
|
|
1449
1320
|
cursor = {
|
|
@@ -1454,10 +1325,7 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
1454
1325
|
next2 = next2.next;
|
|
1455
1326
|
}
|
|
1456
1327
|
}
|
|
1457
|
-
var styles =
|
|
1458
|
-
if (process.env.NODE_ENV !== "production" && interpolation.map !== void 0) {
|
|
1459
|
-
styles += interpolation.map;
|
|
1460
|
-
}
|
|
1328
|
+
var styles = serializedStyles.styles + ";";
|
|
1461
1329
|
return styles;
|
|
1462
1330
|
}
|
|
1463
1331
|
return createStringFromObject(mergedProps, registered, interpolation);
|
|
@@ -1468,30 +1336,14 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
1468
1336
|
var result = interpolation(mergedProps);
|
|
1469
1337
|
cursor = previousCursor;
|
|
1470
1338
|
return handleInterpolation(mergedProps, registered, result);
|
|
1471
|
-
} else if (process.env.NODE_ENV !== "production") {
|
|
1472
|
-
console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");
|
|
1473
1339
|
}
|
|
1474
1340
|
break;
|
|
1475
1341
|
}
|
|
1476
|
-
case "string":
|
|
1477
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1478
|
-
var matched = [];
|
|
1479
|
-
var replaced = interpolation.replace(animationRegex, function(match2, p1, p2) {
|
|
1480
|
-
var fakeVarName = "animation" + matched.length;
|
|
1481
|
-
matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, "") + "`");
|
|
1482
|
-
return "${" + fakeVarName + "}";
|
|
1483
|
-
});
|
|
1484
|
-
if (matched.length) {
|
|
1485
|
-
console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n" + [].concat(matched, ["`" + replaced + "`"]).join("\n") + "\n\nYou should wrap it with `css` like this:\n\n" + ("css`" + replaced + "`"));
|
|
1486
|
-
}
|
|
1487
|
-
}
|
|
1488
|
-
break;
|
|
1489
1342
|
}
|
|
1490
|
-
|
|
1491
|
-
|
|
1343
|
+
var asString = interpolation;
|
|
1344
|
+
{
|
|
1345
|
+
return asString;
|
|
1492
1346
|
}
|
|
1493
|
-
var cached = registered[interpolation];
|
|
1494
|
-
return cached !== void 0 ? cached : interpolation;
|
|
1495
1347
|
}
|
|
1496
1348
|
function createStringFromObject(mergedProps, registered, obj) {
|
|
1497
1349
|
var string = "";
|
|
@@ -1500,37 +1352,33 @@ function createStringFromObject(mergedProps, registered, obj) {
|
|
|
1500
1352
|
string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
|
|
1501
1353
|
}
|
|
1502
1354
|
} else {
|
|
1503
|
-
for (var
|
|
1504
|
-
var value = obj[
|
|
1355
|
+
for (var key in obj) {
|
|
1356
|
+
var value = obj[key];
|
|
1505
1357
|
if (typeof value !== "object") {
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
|
|
1358
|
+
var asString = value;
|
|
1359
|
+
if (isProcessableValue(asString)) {
|
|
1360
|
+
string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
|
|
1510
1361
|
}
|
|
1511
1362
|
} else {
|
|
1512
|
-
if (
|
|
1363
|
+
if (key === "NO_COMPONENT_SELECTOR" && isDevelopment$1) {
|
|
1513
1364
|
throw new Error(noComponentSelectorMessage);
|
|
1514
1365
|
}
|
|
1515
|
-
if (Array.isArray(value) && typeof value[0] === "string" &&
|
|
1366
|
+
if (Array.isArray(value) && typeof value[0] === "string" && registered == null) {
|
|
1516
1367
|
for (var _i = 0; _i < value.length; _i++) {
|
|
1517
1368
|
if (isProcessableValue(value[_i])) {
|
|
1518
|
-
string += processStyleName(
|
|
1369
|
+
string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
|
|
1519
1370
|
}
|
|
1520
1371
|
}
|
|
1521
1372
|
} else {
|
|
1522
1373
|
var interpolated = handleInterpolation(mergedProps, registered, value);
|
|
1523
|
-
switch (
|
|
1374
|
+
switch (key) {
|
|
1524
1375
|
case "animation":
|
|
1525
1376
|
case "animationName": {
|
|
1526
|
-
string += processStyleName(
|
|
1377
|
+
string += processStyleName(key) + ":" + interpolated + ";";
|
|
1527
1378
|
break;
|
|
1528
1379
|
}
|
|
1529
1380
|
default: {
|
|
1530
|
-
|
|
1531
|
-
console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
|
|
1532
|
-
}
|
|
1533
|
-
string += _key + "{" + interpolated + "}";
|
|
1381
|
+
string += key + "{" + interpolated + "}";
|
|
1534
1382
|
}
|
|
1535
1383
|
}
|
|
1536
1384
|
}
|
|
@@ -1540,12 +1388,8 @@ function createStringFromObject(mergedProps, registered, obj) {
|
|
|
1540
1388
|
return string;
|
|
1541
1389
|
}
|
|
1542
1390
|
var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
|
|
1543
|
-
var sourceMapPattern;
|
|
1544
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1545
|
-
sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
|
|
1546
|
-
}
|
|
1547
1391
|
var cursor;
|
|
1548
|
-
|
|
1392
|
+
function serializeStyles(args, registered, mergedProps) {
|
|
1549
1393
|
if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) {
|
|
1550
1394
|
return args[0];
|
|
1551
1395
|
}
|
|
@@ -1557,59 +1401,35 @@ var serializeStyles = function serializeStyles2(args, registered, mergedProps) {
|
|
|
1557
1401
|
stringMode = false;
|
|
1558
1402
|
styles += handleInterpolation(mergedProps, registered, strings);
|
|
1559
1403
|
} else {
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
}
|
|
1563
|
-
styles += strings[0];
|
|
1404
|
+
var asTemplateStringsArr = strings;
|
|
1405
|
+
styles += asTemplateStringsArr[0];
|
|
1564
1406
|
}
|
|
1565
1407
|
for (var i = 1; i < args.length; i++) {
|
|
1566
1408
|
styles += handleInterpolation(mergedProps, registered, args[i]);
|
|
1567
1409
|
if (stringMode) {
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
}
|
|
1571
|
-
styles += strings[i];
|
|
1410
|
+
var templateStringsArr = strings;
|
|
1411
|
+
styles += templateStringsArr[i];
|
|
1572
1412
|
}
|
|
1573
1413
|
}
|
|
1574
|
-
var sourceMap;
|
|
1575
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1576
|
-
styles = styles.replace(sourceMapPattern, function(match3) {
|
|
1577
|
-
sourceMap = match3;
|
|
1578
|
-
return "";
|
|
1579
|
-
});
|
|
1580
|
-
}
|
|
1581
1414
|
labelPattern.lastIndex = 0;
|
|
1582
1415
|
var identifierName = "";
|
|
1583
1416
|
var match2;
|
|
1584
1417
|
while ((match2 = labelPattern.exec(styles)) !== null) {
|
|
1585
|
-
identifierName += "-" +
|
|
1586
|
-
match2[1];
|
|
1418
|
+
identifierName += "-" + match2[1];
|
|
1587
1419
|
}
|
|
1588
1420
|
var name = murmur2(styles) + identifierName;
|
|
1589
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1590
|
-
return {
|
|
1591
|
-
name,
|
|
1592
|
-
styles,
|
|
1593
|
-
map: sourceMap,
|
|
1594
|
-
next: cursor,
|
|
1595
|
-
toString: function toString() {
|
|
1596
|
-
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
|
|
1597
|
-
}
|
|
1598
|
-
};
|
|
1599
|
-
}
|
|
1600
1421
|
return {
|
|
1601
1422
|
name,
|
|
1602
1423
|
styles,
|
|
1603
1424
|
next: cursor
|
|
1604
1425
|
};
|
|
1605
|
-
}
|
|
1426
|
+
}
|
|
1606
1427
|
var syncFallback = function syncFallback2(create) {
|
|
1607
1428
|
return create();
|
|
1608
1429
|
};
|
|
1609
1430
|
var useInsertionEffect = React["useInsertionEffect"] ? React["useInsertionEffect"] : false;
|
|
1610
1431
|
var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
|
|
1611
|
-
var
|
|
1612
|
-
var hasOwn = {}.hasOwnProperty;
|
|
1432
|
+
var isDevelopment = false;
|
|
1613
1433
|
var EmotionCacheContext = /* @__PURE__ */ React.createContext(
|
|
1614
1434
|
// we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
1615
1435
|
// because this module is primarily intended for the browser and node
|
|
@@ -1621,9 +1441,6 @@ var EmotionCacheContext = /* @__PURE__ */ React.createContext(
|
|
|
1621
1441
|
key: "css"
|
|
1622
1442
|
}) : null
|
|
1623
1443
|
);
|
|
1624
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1625
|
-
EmotionCacheContext.displayName = "EmotionCacheContext";
|
|
1626
|
-
}
|
|
1627
1444
|
EmotionCacheContext.Provider;
|
|
1628
1445
|
var withEmotionCache = function withEmotionCache2(func) {
|
|
1629
1446
|
return /* @__PURE__ */ forwardRef(function(props, ref) {
|
|
@@ -1632,42 +1449,9 @@ var withEmotionCache = function withEmotionCache2(func) {
|
|
|
1632
1449
|
});
|
|
1633
1450
|
};
|
|
1634
1451
|
var ThemeContext = /* @__PURE__ */ React.createContext({});
|
|
1635
|
-
|
|
1636
|
-
ThemeContext.displayName = "EmotionThemeContext";
|
|
1637
|
-
}
|
|
1638
|
-
var getLastPart = function getLastPart2(functionName) {
|
|
1639
|
-
var parts = functionName.split(".");
|
|
1640
|
-
return parts[parts.length - 1];
|
|
1641
|
-
};
|
|
1642
|
-
var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine2(line2) {
|
|
1643
|
-
var match2 = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line2);
|
|
1644
|
-
if (match2) return getLastPart(match2[1]);
|
|
1645
|
-
match2 = /^([A-Za-z0-9$.]+)@/.exec(line2);
|
|
1646
|
-
if (match2) return getLastPart(match2[1]);
|
|
1647
|
-
return void 0;
|
|
1648
|
-
};
|
|
1649
|
-
var internalReactFunctionNames = /* @__PURE__ */ new Set(["renderWithHooks", "processChild", "finishClassComponent", "renderToString"]);
|
|
1650
|
-
var sanitizeIdentifier = function sanitizeIdentifier2(identifier2) {
|
|
1651
|
-
return identifier2.replace(/\$/g, "-");
|
|
1652
|
-
};
|
|
1653
|
-
var getLabelFromStackTrace = function getLabelFromStackTrace2(stackTrace) {
|
|
1654
|
-
if (!stackTrace) return void 0;
|
|
1655
|
-
var lines = stackTrace.split("\n");
|
|
1656
|
-
for (var i = 0; i < lines.length; i++) {
|
|
1657
|
-
var functionName = getFunctionNameFromStackTraceLine(lines[i]);
|
|
1658
|
-
if (!functionName) continue;
|
|
1659
|
-
if (internalReactFunctionNames.has(functionName)) break;
|
|
1660
|
-
if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);
|
|
1661
|
-
}
|
|
1662
|
-
return void 0;
|
|
1663
|
-
};
|
|
1452
|
+
var hasOwn = {}.hasOwnProperty;
|
|
1664
1453
|
var typePropName = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__";
|
|
1665
|
-
var labelPropName = "__EMOTION_LABEL_PLEASE_DO_NOT_USE__";
|
|
1666
1454
|
var createEmotionProps = function createEmotionProps2(type, props) {
|
|
1667
|
-
if (process.env.NODE_ENV !== "production" && typeof props.css === "string" && // check if there is a css declaration
|
|
1668
|
-
props.css.indexOf(":") !== -1) {
|
|
1669
|
-
throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`" + props.css + "`");
|
|
1670
|
-
}
|
|
1671
1455
|
var newProps = {};
|
|
1672
1456
|
for (var key in props) {
|
|
1673
1457
|
if (hasOwn.call(props, key)) {
|
|
@@ -1675,13 +1459,9 @@ var createEmotionProps = function createEmotionProps2(type, props) {
|
|
|
1675
1459
|
}
|
|
1676
1460
|
}
|
|
1677
1461
|
newProps[typePropName] = type;
|
|
1678
|
-
if (process.env.NODE_ENV !== "production" && !!props.css && (typeof props.css !== "object" || typeof props.css.name !== "string" || props.css.name.indexOf("-") === -1)) {
|
|
1679
|
-
var label = getLabelFromStackTrace(new Error().stack);
|
|
1680
|
-
if (label) newProps[labelPropName] = label;
|
|
1681
|
-
}
|
|
1682
1462
|
return newProps;
|
|
1683
1463
|
};
|
|
1684
|
-
var Insertion
|
|
1464
|
+
var Insertion = function Insertion2(_ref) {
|
|
1685
1465
|
var cache = _ref.cache, serialized = _ref.serialized, isStringTag = _ref.isStringTag;
|
|
1686
1466
|
registerStyles(cache, serialized, isStringTag);
|
|
1687
1467
|
useInsertionEffectAlwaysWithSyncFallback(function() {
|
|
@@ -1689,176 +1469,41 @@ var Insertion$1 = function Insertion(_ref) {
|
|
|
1689
1469
|
});
|
|
1690
1470
|
return null;
|
|
1691
1471
|
};
|
|
1692
|
-
var Emotion = /* @__PURE__ */ withEmotionCache(
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
cssProp =
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
className =
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
var
|
|
1708
|
-
|
|
1709
|
-
|
|
1472
|
+
var Emotion = /* @__PURE__ */ withEmotionCache(
|
|
1473
|
+
/* <any, any> */
|
|
1474
|
+
function(props, cache, ref) {
|
|
1475
|
+
var cssProp = props.css;
|
|
1476
|
+
if (typeof cssProp === "string" && cache.registered[cssProp] !== void 0) {
|
|
1477
|
+
cssProp = cache.registered[cssProp];
|
|
1478
|
+
}
|
|
1479
|
+
var WrappedComponent = props[typePropName];
|
|
1480
|
+
var registeredStyles = [cssProp];
|
|
1481
|
+
var className = "";
|
|
1482
|
+
if (typeof props.className === "string") {
|
|
1483
|
+
className = getRegisteredStyles(cache.registered, registeredStyles, props.className);
|
|
1484
|
+
} else if (props.className != null) {
|
|
1485
|
+
className = props.className + " ";
|
|
1486
|
+
}
|
|
1487
|
+
var serialized = serializeStyles(registeredStyles, void 0, React.useContext(ThemeContext));
|
|
1488
|
+
className += cache.key + "-" + serialized.name;
|
|
1489
|
+
var newProps = {};
|
|
1490
|
+
for (var key in props) {
|
|
1491
|
+
if (hasOwn.call(props, key) && key !== "css" && key !== typePropName && !isDevelopment) {
|
|
1492
|
+
newProps[key] = props[key];
|
|
1493
|
+
}
|
|
1710
1494
|
}
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
for (var key in props) {
|
|
1715
|
-
if (hasOwn.call(props, key) && key !== "css" && key !== typePropName && (process.env.NODE_ENV === "production" || key !== labelPropName)) {
|
|
1716
|
-
newProps[key] = props[key];
|
|
1495
|
+
newProps.className = className;
|
|
1496
|
+
if (ref) {
|
|
1497
|
+
newProps.ref = ref;
|
|
1717
1498
|
}
|
|
1499
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Insertion, {
|
|
1500
|
+
cache,
|
|
1501
|
+
serialized,
|
|
1502
|
+
isStringTag: typeof WrappedComponent === "string"
|
|
1503
|
+
}), /* @__PURE__ */ React.createElement(WrappedComponent, newProps));
|
|
1718
1504
|
}
|
|
1719
|
-
|
|
1720
|
-
newProps.className = className;
|
|
1721
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Insertion$1, {
|
|
1722
|
-
cache,
|
|
1723
|
-
serialized,
|
|
1724
|
-
isStringTag: typeof WrappedComponent === "string"
|
|
1725
|
-
}), /* @__PURE__ */ React.createElement(WrappedComponent, newProps));
|
|
1726
|
-
});
|
|
1727
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1728
|
-
Emotion.displayName = "EmotionCssPropInternal";
|
|
1729
|
-
}
|
|
1505
|
+
);
|
|
1730
1506
|
var Emotion$1 = Emotion;
|
|
1731
|
-
var pkg = {
|
|
1732
|
-
name: "@emotion/react",
|
|
1733
|
-
version: "11.11.4",
|
|
1734
|
-
main: "dist/emotion-react.cjs.js",
|
|
1735
|
-
module: "dist/emotion-react.esm.js",
|
|
1736
|
-
browser: {
|
|
1737
|
-
"./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js"
|
|
1738
|
-
},
|
|
1739
|
-
exports: {
|
|
1740
|
-
".": {
|
|
1741
|
-
module: {
|
|
1742
|
-
worker: "./dist/emotion-react.worker.esm.js",
|
|
1743
|
-
browser: "./dist/emotion-react.browser.esm.js",
|
|
1744
|
-
"default": "./dist/emotion-react.esm.js"
|
|
1745
|
-
},
|
|
1746
|
-
"import": "./dist/emotion-react.cjs.mjs",
|
|
1747
|
-
"default": "./dist/emotion-react.cjs.js"
|
|
1748
|
-
},
|
|
1749
|
-
"./jsx-runtime": {
|
|
1750
|
-
module: {
|
|
1751
|
-
worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
|
|
1752
|
-
browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
|
|
1753
|
-
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
|
|
1754
|
-
},
|
|
1755
|
-
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
|
|
1756
|
-
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
|
|
1757
|
-
},
|
|
1758
|
-
"./_isolated-hnrs": {
|
|
1759
|
-
module: {
|
|
1760
|
-
worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
|
|
1761
|
-
browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
|
|
1762
|
-
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
|
|
1763
|
-
},
|
|
1764
|
-
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
|
|
1765
|
-
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
|
|
1766
|
-
},
|
|
1767
|
-
"./jsx-dev-runtime": {
|
|
1768
|
-
module: {
|
|
1769
|
-
worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
|
|
1770
|
-
browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
|
|
1771
|
-
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
|
|
1772
|
-
},
|
|
1773
|
-
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
|
|
1774
|
-
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
|
|
1775
|
-
},
|
|
1776
|
-
"./package.json": "./package.json",
|
|
1777
|
-
"./types/css-prop": "./types/css-prop.d.ts",
|
|
1778
|
-
"./macro": {
|
|
1779
|
-
types: {
|
|
1780
|
-
"import": "./macro.d.mts",
|
|
1781
|
-
"default": "./macro.d.ts"
|
|
1782
|
-
},
|
|
1783
|
-
"default": "./macro.js"
|
|
1784
|
-
}
|
|
1785
|
-
},
|
|
1786
|
-
types: "types/index.d.ts",
|
|
1787
|
-
files: [
|
|
1788
|
-
"src",
|
|
1789
|
-
"dist",
|
|
1790
|
-
"jsx-runtime",
|
|
1791
|
-
"jsx-dev-runtime",
|
|
1792
|
-
"_isolated-hnrs",
|
|
1793
|
-
"types/*.d.ts",
|
|
1794
|
-
"macro.*"
|
|
1795
|
-
],
|
|
1796
|
-
sideEffects: false,
|
|
1797
|
-
author: "Emotion Contributors",
|
|
1798
|
-
license: "MIT",
|
|
1799
|
-
scripts: {
|
|
1800
|
-
"test:typescript": "dtslint types"
|
|
1801
|
-
},
|
|
1802
|
-
dependencies: {
|
|
1803
|
-
"@babel/runtime": "^7.18.3",
|
|
1804
|
-
"@emotion/babel-plugin": "^11.11.0",
|
|
1805
|
-
"@emotion/cache": "^11.11.0",
|
|
1806
|
-
"@emotion/serialize": "^1.1.3",
|
|
1807
|
-
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
|
|
1808
|
-
"@emotion/utils": "^1.2.1",
|
|
1809
|
-
"@emotion/weak-memoize": "^0.3.1",
|
|
1810
|
-
"hoist-non-react-statics": "^3.3.1"
|
|
1811
|
-
},
|
|
1812
|
-
peerDependencies: {
|
|
1813
|
-
react: ">=16.8.0"
|
|
1814
|
-
},
|
|
1815
|
-
peerDependenciesMeta: {
|
|
1816
|
-
"@types/react": {
|
|
1817
|
-
optional: true
|
|
1818
|
-
}
|
|
1819
|
-
},
|
|
1820
|
-
devDependencies: {
|
|
1821
|
-
"@definitelytyped/dtslint": "0.0.112",
|
|
1822
|
-
"@emotion/css": "11.11.2",
|
|
1823
|
-
"@emotion/css-prettifier": "1.1.3",
|
|
1824
|
-
"@emotion/server": "11.11.0",
|
|
1825
|
-
"@emotion/styled": "11.11.0",
|
|
1826
|
-
"html-tag-names": "^1.1.2",
|
|
1827
|
-
react: "16.14.0",
|
|
1828
|
-
"svg-tag-names": "^1.1.1",
|
|
1829
|
-
typescript: "^4.5.5"
|
|
1830
|
-
},
|
|
1831
|
-
repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
|
|
1832
|
-
publishConfig: {
|
|
1833
|
-
access: "public"
|
|
1834
|
-
},
|
|
1835
|
-
"umd:main": "dist/emotion-react.umd.min.js",
|
|
1836
|
-
preconstruct: {
|
|
1837
|
-
entrypoints: [
|
|
1838
|
-
"./index.js",
|
|
1839
|
-
"./jsx-runtime.js",
|
|
1840
|
-
"./jsx-dev-runtime.js",
|
|
1841
|
-
"./_isolated-hnrs.js"
|
|
1842
|
-
],
|
|
1843
|
-
umdName: "emotionReact",
|
|
1844
|
-
exports: {
|
|
1845
|
-
envConditions: [
|
|
1846
|
-
"browser",
|
|
1847
|
-
"worker"
|
|
1848
|
-
],
|
|
1849
|
-
extra: {
|
|
1850
|
-
"./types/css-prop": "./types/css-prop.d.ts",
|
|
1851
|
-
"./macro": {
|
|
1852
|
-
types: {
|
|
1853
|
-
"import": "./macro.d.mts",
|
|
1854
|
-
"default": "./macro.d.ts"
|
|
1855
|
-
},
|
|
1856
|
-
"default": "./macro.js"
|
|
1857
|
-
}
|
|
1858
|
-
}
|
|
1859
|
-
}
|
|
1860
|
-
}
|
|
1861
|
-
};
|
|
1862
1507
|
var jsx = function jsx2(type, props) {
|
|
1863
1508
|
var args = arguments;
|
|
1864
1509
|
if (props == null || !hasOwn.call(props, "css")) {
|
|
@@ -1873,64 +1518,6 @@ var jsx = function jsx2(type, props) {
|
|
|
1873
1518
|
}
|
|
1874
1519
|
return React.createElement.apply(null, createElementArgArray);
|
|
1875
1520
|
};
|
|
1876
|
-
var warnedAboutCssPropForGlobal = false;
|
|
1877
|
-
var Global = /* @__PURE__ */ withEmotionCache(function(props, cache) {
|
|
1878
|
-
if (process.env.NODE_ENV !== "production" && !warnedAboutCssPropForGlobal && // check for className as well since the user is
|
|
1879
|
-
// probably using the custom createElement which
|
|
1880
|
-
// means it will be turned into a className prop
|
|
1881
|
-
// $FlowFixMe I don't really want to add it to the type since it shouldn't be used
|
|
1882
|
-
(props.className || props.css)) {
|
|
1883
|
-
console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
|
|
1884
|
-
warnedAboutCssPropForGlobal = true;
|
|
1885
|
-
}
|
|
1886
|
-
var styles = props.styles;
|
|
1887
|
-
var serialized = serializeStyles([styles], void 0, React.useContext(ThemeContext));
|
|
1888
|
-
var sheetRef = React.useRef();
|
|
1889
|
-
useInsertionEffectWithLayoutFallback(function() {
|
|
1890
|
-
var key = cache.key + "-global";
|
|
1891
|
-
var sheet = new cache.sheet.constructor({
|
|
1892
|
-
key,
|
|
1893
|
-
nonce: cache.sheet.nonce,
|
|
1894
|
-
container: cache.sheet.container,
|
|
1895
|
-
speedy: cache.sheet.isSpeedy
|
|
1896
|
-
});
|
|
1897
|
-
var rehydrating = false;
|
|
1898
|
-
var node2 = document.querySelector('style[data-emotion="' + key + " " + serialized.name + '"]');
|
|
1899
|
-
if (cache.sheet.tags.length) {
|
|
1900
|
-
sheet.before = cache.sheet.tags[0];
|
|
1901
|
-
}
|
|
1902
|
-
if (node2 !== null) {
|
|
1903
|
-
rehydrating = true;
|
|
1904
|
-
node2.setAttribute("data-emotion", key);
|
|
1905
|
-
sheet.hydrate([node2]);
|
|
1906
|
-
}
|
|
1907
|
-
sheetRef.current = [sheet, rehydrating];
|
|
1908
|
-
return function() {
|
|
1909
|
-
sheet.flush();
|
|
1910
|
-
};
|
|
1911
|
-
}, [cache]);
|
|
1912
|
-
useInsertionEffectWithLayoutFallback(function() {
|
|
1913
|
-
var sheetRefCurrent = sheetRef.current;
|
|
1914
|
-
var sheet = sheetRefCurrent[0], rehydrating = sheetRefCurrent[1];
|
|
1915
|
-
if (rehydrating) {
|
|
1916
|
-
sheetRefCurrent[1] = false;
|
|
1917
|
-
return;
|
|
1918
|
-
}
|
|
1919
|
-
if (serialized.next !== void 0) {
|
|
1920
|
-
insertStyles(cache, serialized.next, true);
|
|
1921
|
-
}
|
|
1922
|
-
if (sheet.tags.length) {
|
|
1923
|
-
var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
|
|
1924
|
-
sheet.before = element;
|
|
1925
|
-
sheet.flush();
|
|
1926
|
-
}
|
|
1927
|
-
cache.insert("", serialized, sheet, false);
|
|
1928
|
-
}, [cache, serialized.name]);
|
|
1929
|
-
return null;
|
|
1930
|
-
});
|
|
1931
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1932
|
-
Global.displayName = "EmotionGlobal";
|
|
1933
|
-
}
|
|
1934
1521
|
function css$2() {
|
|
1935
1522
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1936
1523
|
args[_key] = arguments[_key];
|
|
@@ -1949,116 +1536,6 @@ var keyframes = function keyframes2() {
|
|
|
1949
1536
|
}
|
|
1950
1537
|
};
|
|
1951
1538
|
};
|
|
1952
|
-
var classnames = function classnames2(args) {
|
|
1953
|
-
var len = args.length;
|
|
1954
|
-
var i = 0;
|
|
1955
|
-
var cls = "";
|
|
1956
|
-
for (; i < len; i++) {
|
|
1957
|
-
var arg = args[i];
|
|
1958
|
-
if (arg == null) continue;
|
|
1959
|
-
var toAdd = void 0;
|
|
1960
|
-
switch (typeof arg) {
|
|
1961
|
-
case "boolean":
|
|
1962
|
-
break;
|
|
1963
|
-
case "object": {
|
|
1964
|
-
if (Array.isArray(arg)) {
|
|
1965
|
-
toAdd = classnames2(arg);
|
|
1966
|
-
} else {
|
|
1967
|
-
if (process.env.NODE_ENV !== "production" && arg.styles !== void 0 && arg.name !== void 0) {
|
|
1968
|
-
console.error("You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from <ClassNames/> component.");
|
|
1969
|
-
}
|
|
1970
|
-
toAdd = "";
|
|
1971
|
-
for (var k in arg) {
|
|
1972
|
-
if (arg[k] && k) {
|
|
1973
|
-
toAdd && (toAdd += " ");
|
|
1974
|
-
toAdd += k;
|
|
1975
|
-
}
|
|
1976
|
-
}
|
|
1977
|
-
}
|
|
1978
|
-
break;
|
|
1979
|
-
}
|
|
1980
|
-
default: {
|
|
1981
|
-
toAdd = arg;
|
|
1982
|
-
}
|
|
1983
|
-
}
|
|
1984
|
-
if (toAdd) {
|
|
1985
|
-
cls && (cls += " ");
|
|
1986
|
-
cls += toAdd;
|
|
1987
|
-
}
|
|
1988
|
-
}
|
|
1989
|
-
return cls;
|
|
1990
|
-
};
|
|
1991
|
-
function merge(registered, css4, className) {
|
|
1992
|
-
var registeredStyles = [];
|
|
1993
|
-
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
|
|
1994
|
-
if (registeredStyles.length < 2) {
|
|
1995
|
-
return className;
|
|
1996
|
-
}
|
|
1997
|
-
return rawClassName + css4(registeredStyles);
|
|
1998
|
-
}
|
|
1999
|
-
var Insertion2 = function Insertion3(_ref) {
|
|
2000
|
-
var cache = _ref.cache, serializedArr = _ref.serializedArr;
|
|
2001
|
-
useInsertionEffectAlwaysWithSyncFallback(function() {
|
|
2002
|
-
for (var i = 0; i < serializedArr.length; i++) {
|
|
2003
|
-
insertStyles(cache, serializedArr[i], false);
|
|
2004
|
-
}
|
|
2005
|
-
});
|
|
2006
|
-
return null;
|
|
2007
|
-
};
|
|
2008
|
-
var ClassNames = /* @__PURE__ */ withEmotionCache(function(props, cache) {
|
|
2009
|
-
var hasRendered = false;
|
|
2010
|
-
var serializedArr = [];
|
|
2011
|
-
var css4 = function css5() {
|
|
2012
|
-
if (hasRendered && process.env.NODE_ENV !== "production") {
|
|
2013
|
-
throw new Error("css can only be used during render");
|
|
2014
|
-
}
|
|
2015
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2016
|
-
args[_key] = arguments[_key];
|
|
2017
|
-
}
|
|
2018
|
-
var serialized = serializeStyles(args, cache.registered);
|
|
2019
|
-
serializedArr.push(serialized);
|
|
2020
|
-
registerStyles(cache, serialized, false);
|
|
2021
|
-
return cache.key + "-" + serialized.name;
|
|
2022
|
-
};
|
|
2023
|
-
var cx = function cx2() {
|
|
2024
|
-
if (hasRendered && process.env.NODE_ENV !== "production") {
|
|
2025
|
-
throw new Error("cx can only be used during render");
|
|
2026
|
-
}
|
|
2027
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
2028
|
-
args[_key2] = arguments[_key2];
|
|
2029
|
-
}
|
|
2030
|
-
return merge(cache.registered, css4, classnames(args));
|
|
2031
|
-
};
|
|
2032
|
-
var content = {
|
|
2033
|
-
css: css4,
|
|
2034
|
-
cx,
|
|
2035
|
-
theme: React.useContext(ThemeContext)
|
|
2036
|
-
};
|
|
2037
|
-
var ele = props.children(content);
|
|
2038
|
-
hasRendered = true;
|
|
2039
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Insertion2, {
|
|
2040
|
-
cache,
|
|
2041
|
-
serializedArr
|
|
2042
|
-
}), ele);
|
|
2043
|
-
});
|
|
2044
|
-
if (process.env.NODE_ENV !== "production") {
|
|
2045
|
-
ClassNames.displayName = "EmotionClassNames";
|
|
2046
|
-
}
|
|
2047
|
-
if (process.env.NODE_ENV !== "production") {
|
|
2048
|
-
var isBrowser = true;
|
|
2049
|
-
var isTestEnv = typeof jest !== "undefined" || typeof vi !== "undefined";
|
|
2050
|
-
if (isBrowser && !isTestEnv) {
|
|
2051
|
-
var globalContext = (
|
|
2052
|
-
// $FlowIgnore
|
|
2053
|
-
typeof globalThis !== "undefined" ? globalThis : isBrowser ? window : global
|
|
2054
|
-
);
|
|
2055
|
-
var globalKey = "__EMOTION_REACT_" + pkg.version.split(".")[0] + "__";
|
|
2056
|
-
if (globalContext[globalKey]) {
|
|
2057
|
-
console.warn("You are loading @emotion/react when it is already loaded. Running multiple instances may cause problems. This can happen if multiple versions are used, or if multiple builds of the same version are used.");
|
|
2058
|
-
}
|
|
2059
|
-
globalContext[globalKey] = true;
|
|
2060
|
-
}
|
|
2061
|
-
}
|
|
2062
1539
|
function _taggedTemplateLiteral(e, t) {
|
|
2063
1540
|
return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {
|
|
2064
1541
|
raw: {
|