@itcase/ui 1.1.16 → 1.1.18
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/{Accordion-DF2lqrVA.js → Accordion-uWRXripc.js} +2 -2
- package/dist/{Avatar-DLNS2LBo.js → Avatar-APOOlMd3.js} +2 -2
- package/dist/{Badge-BBbMdbjo.js → Badge-DtYgQu3L.js} +2 -3
- package/dist/{Breadcrumbs-Dz-WcAoT.js → Breadcrumbs-rRMuYnWJ.js} +2 -2
- package/dist/{Button-ULZVVxWC.js → Button-DxZUKQ8I.js} +7 -7
- package/dist/{Card-DPGgzPuD.js → Card-DEs1Rr88.js} +1 -1
- package/dist/{Cell-D9Wa7coO.js → Cell-BJThS4YS.js} +3 -3
- package/dist/{Checkbox-i0qZk0sb.js → Checkbox-BmQo6ByV.js} +1 -1
- package/dist/{Chips-BdK4kVmq.js → Chips-CBPMHkdw.js} +15 -13
- package/dist/{Choice-BT6xwc_a.js → Choice-DVU4k0tu.js} +11 -14
- package/dist/{Code-DkWVSDOy.js → Code-1WUXVzfb.js} +0 -1
- package/dist/{ContextMenuItem--304_MdY.js → ContextMenuItem-xssbnviQ.js} +2 -2
- package/dist/{CookiesWarning-CDlz4Rfl.js → CookiesWarning-Dcon4SS4.js} +3 -3
- package/dist/{DatePicker-CAgJ_CIz.js → DatePicker-D9UgOcue.js} +5 -5
- package/dist/{Drawer-CgJX3Utw.js → Drawer-DkLkFSmD.js} +3 -3
- package/dist/{DropdownItem-Cf5vBgDu.js → DropdownItem-DB5nPIdl.js} +1 -1
- package/dist/{Group-C2kJKhWJ.js → Group-DuHn_z2p.js} +1 -2
- package/dist/HTMLContent-CgbJTAy4.js +85 -0
- package/dist/{Icon-DWnG-4KG.js → Icon-C0gtkmdU.js} +1 -1
- package/dist/{InputPassword-BOdsE_Yd.js → InputPassword-D6OLQrVC.js} +2 -4
- package/dist/{Label-VHbRKztj.js → Label-0lMH0-AK.js} +4 -4
- package/dist/{LanguageSelector-CzIV_gnd.js → LanguageSelector-uOmIj9mJ.js} +1 -1
- package/dist/{Loader-YZrWGaNy.js → Loader-DhgIcSY1.js} +2 -3
- package/dist/Logo-dRWwDqj-.js +37 -0
- package/dist/{Menu-Cd-XlUmJ.js → Menu-9u6BoWRL.js} +1 -1
- package/dist/{MenuItem-COZ-C9K2.js → MenuItem-CXxL099U.js} +3 -3
- package/dist/{ModalLoader-D17lZhS7.js → ModalLoader-DHOpJqE3.js} +1 -3
- package/dist/{NotificationList-C2OCJkY5.js → NotificationList-B48jz206.js} +5 -8
- package/dist/{Pagination-QfVqvSbE.js → Pagination-Ch75clod.js} +3 -3
- package/dist/{Radio-Ca2-2PPF.js → Radio-CmejVeSJ.js} +2 -3
- package/dist/{Response-m-8zeYeD.js → Response-CgE3B1JS.js} +5 -5
- package/dist/{SearchResult-DbhHiNmy.js → SearchResult-vA2t-ZGx.js} +4 -4
- package/dist/{Segmented-pa7MGnor.js → Segmented-BoROz9LW.js} +3 -2
- package/dist/{SiteMenuButton-BwyPO-2_.js → SiteMenuButton-CFPtqh_i.js} +2 -2
- package/dist/{Swiper-CL9zCKXE.js → Swiper-CP2ph4S3.js} +20 -5
- package/dist/{SwitchField-nmu255b8.js → SwitchField-Cj0B7JdE.js} +3 -3
- package/dist/{TabGroup-CK6ndAuh.js → TabGroup-C4CbZgr7.js} +5 -5
- package/dist/{Text-CxrzHFN1.js → Text-Dn0X1zxN.js} +1 -2
- package/dist/{Textarea-Cie6SPyp.js → Textarea-D3XSuMEm.js} +1 -1
- package/dist/{Tile-qiXVUf-t.js → Tile-B2HwgBDH.js} +3 -3
- package/dist/{Title-BhJcCgdK.js → Title-BAdU2oW_.js} +1 -1
- package/dist/{Tooltip-CpEQOh9v.js → Tooltip-D46EmkZq.js} +4 -4
- package/dist/cjs/{Accordion-rCFDAon3.js → Accordion-OI5oLjJY.js} +2 -2
- package/dist/cjs/{Avatar-Bj5BiStx.js → Avatar-BBAt1cKM.js} +2 -2
- package/dist/cjs/{Badge-D7W3B9G5.js → Badge-Cn73E3GI.js} +2 -3
- package/dist/cjs/{Breadcrumbs-xj-c6cUH.js → Breadcrumbs-DLTpOh1T.js} +2 -2
- package/dist/cjs/{Button-DfUQ11Hs.js → Button-C-K_KVjd.js} +6 -6
- package/dist/cjs/{Card--te6xVsm.js → Card-D9Eh3qLN.js} +1 -1
- package/dist/cjs/{Cell-DEBk3Rbp.js → Cell-DpzvSs16.js} +3 -3
- package/dist/cjs/{Checkbox-BIvndDsy.js → Checkbox-BE9LWRTC.js} +1 -1
- package/dist/cjs/{Chips-i7zrI9aU.js → Chips-cdORW7eM.js} +15 -13
- package/dist/cjs/{Choice-Cm_1ke3H.js → Choice-nMRlWkpF.js} +11 -14
- package/dist/cjs/{Code-ByEr4h2R.js → Code-BJFoJBYh.js} +0 -1
- package/dist/cjs/{ContextMenuItem-D6dUiYw7.js → ContextMenuItem-D2wjhhzg.js} +2 -2
- package/dist/cjs/{CookiesWarning-BfkNifW2.js → CookiesWarning--Edz7Gcv.js} +3 -3
- package/dist/cjs/{DatePicker-e4-8mC1N.js → DatePicker-vgeb1SWe.js} +5 -5
- package/dist/cjs/{Drawer-BGZBaR2Q.js → Drawer-AQqI18ra.js} +3 -3
- package/dist/cjs/{DropdownItem-BhpFr7Z0.js → DropdownItem-CCuDjUjH.js} +1 -1
- package/dist/cjs/{Group-C9BxTKs-.js → Group-CtseVj34.js} +1 -2
- package/dist/cjs/HTMLContent-4vI2pdQC.js +91 -0
- package/dist/cjs/{Icon-2rv_L0yY.js → Icon-BUwWk_dS.js} +1 -1
- package/dist/cjs/{InputPassword-BXCwerW2.js → InputPassword-BqbSnWDE.js} +2 -4
- package/dist/cjs/{Label-EFoxH21m.js → Label-Bc4u2NRI.js} +3 -3
- package/dist/cjs/{LanguageSelector-CFKki1Sr.js → LanguageSelector-BswZL8dZ.js} +1 -1
- package/dist/cjs/{Loader-2vQxF_aO.js → Loader-2CPNhu-4.js} +2 -3
- package/dist/cjs/Logo-BjDQjs3w.js +44 -0
- package/dist/cjs/{Menu-rXCCn52A.js → Menu-Bn0hqLr-.js} +1 -1
- package/dist/cjs/{MenuItem-C__OMtEI.js → MenuItem-C-0vQBaj.js} +2 -2
- package/dist/cjs/{ModalLoader-Cddzca-W.js → ModalLoader-DJWtjEvf.js} +1 -3
- package/dist/cjs/{NotificationList-CKd0PxLU.js → NotificationList-D7rD4PAW.js} +5 -8
- package/dist/cjs/{Pagination-D6thfJMP.js → Pagination-XAVYtca1.js} +3 -3
- package/dist/cjs/{Radio-Cvbuwkx3.js → Radio-BH3uHZDb.js} +2 -3
- package/dist/cjs/{Response-CwdUpO-8.js → Response-BmR09awR.js} +5 -5
- package/dist/cjs/{SearchResult-BnIZD8lL.js → SearchResult-gHEwq0ay.js} +3 -3
- package/dist/cjs/{Segmented-BHblcvck.js → Segmented-BtzSR0xB.js} +3 -2
- package/dist/cjs/{SiteMenuButton-B2wBLVOJ.js → SiteMenuButton-B6QISdea.js} +2 -2
- package/dist/cjs/{Swiper-DrXdHybn.js → Swiper--idB5Ci6.js} +20 -5
- package/dist/cjs/{SwitchField-B0N-28Ne.js → SwitchField-CCHC2ZHS.js} +3 -3
- package/dist/cjs/{TabGroup-BCw7IKuz.js → TabGroup-CYaefMap.js} +4 -4
- package/dist/cjs/{Text-C8vlKWNN.js → Text-D2YDVhGJ.js} +1 -2
- package/dist/cjs/{Textarea-WIGhhrgu.js → Textarea-tng0D_n7.js} +1 -1
- package/dist/cjs/{Tile-2VY0LzsE.js → Tile-By9iqne7.js} +3 -3
- package/dist/cjs/{Title-DZn77tSl.js → Title-BzopkHQY.js} +1 -1
- package/dist/cjs/{Tooltip-DRsL77n1.js → Tooltip-VrKQ8W1G.js} +3 -3
- package/dist/cjs/components/Accordion.js +5 -5
- package/dist/cjs/components/Avatar.js +5 -5
- package/dist/cjs/components/Badge.js +2 -2
- package/dist/cjs/components/Breadcrumbs.js +5 -5
- package/dist/cjs/components/Button/Button.interface.d.ts +1 -0
- package/dist/cjs/components/Button.js +6 -6
- package/dist/cjs/components/Card.js +2 -2
- package/dist/cjs/components/Cell.js +6 -6
- package/dist/cjs/components/Checkbox/Checkbox.interface.d.ts +3 -3
- package/dist/cjs/components/Checkbox.js +2 -2
- package/dist/cjs/components/Chips/Chips.d.ts +3 -8
- package/dist/cjs/components/Chips/Chips.interface.d.ts +12 -13
- package/dist/cjs/components/Chips.js +2 -2
- package/dist/cjs/components/Choice/Choice.d.ts +3 -3
- package/dist/cjs/components/Choice/Choice.interface.d.ts +14 -14
- package/dist/cjs/components/Choice.js +6 -5
- package/dist/cjs/components/Code/Code.d.ts +0 -1
- package/dist/cjs/components/Code.js +1 -1
- package/dist/cjs/components/ContextMenu.js +5 -5
- package/dist/cjs/components/CookiesWarning.js +8 -8
- package/dist/cjs/components/DatePicker.js +9 -9
- package/dist/cjs/components/Drawer/Drawer.d.ts +2 -2
- package/dist/cjs/components/Drawer/Drawer.interface.d.ts +6 -6
- package/dist/cjs/components/Drawer.js +1 -1
- package/dist/cjs/components/Dropdown.js +2 -2
- package/dist/cjs/components/FormField.js +9 -9
- package/dist/cjs/components/Group/Group.interface.d.ts +3 -3
- package/dist/cjs/components/Group.js +1 -1
- package/dist/cjs/components/HTMLContent/HTMLContent.d.ts +3 -0
- package/dist/cjs/components/HTMLContent/HTMLContent.interface.d.ts +30 -0
- package/dist/cjs/components/HTMLContent/index.d.ts +1 -0
- package/dist/cjs/components/HTMLContent.js +21 -0
- package/dist/cjs/components/Icon.js +4 -4
- package/dist/cjs/components/Input/Input.interface.d.ts +4 -4
- package/dist/cjs/components/InputMask.js +1 -1
- package/dist/cjs/components/InputPassword.js +5 -5
- package/dist/cjs/components/Label.js +4 -4
- package/dist/cjs/components/LanguageSelector.js +5 -5
- package/dist/cjs/components/Loader.js +2 -2
- package/dist/cjs/components/Logo/Logo.d.ts +3 -2
- package/dist/cjs/components/Logo/Logo.interface.d.ts +16 -2
- package/dist/cjs/components/Logo/index.d.ts +1 -1
- package/dist/cjs/components/Logo.js +4 -3
- package/dist/cjs/components/Menu.js +3 -3
- package/dist/cjs/components/MenuItem.js +2 -2
- package/dist/cjs/components/Modal.js +3 -3
- package/dist/cjs/components/Notification.js +3 -3
- package/dist/cjs/components/Pagination.js +6 -6
- package/dist/cjs/components/Panel/Panel.interface.d.ts +3 -3
- package/dist/cjs/components/Panel.js +4 -4
- package/dist/cjs/components/Radio.js +2 -2
- package/dist/cjs/components/Response.js +8 -8
- package/dist/cjs/components/SVGContent/SVGContent.d.ts +3 -0
- package/dist/cjs/components/SVGContent/SVGContent.interface.d.ts +11 -0
- package/dist/cjs/components/SVGContent/index.d.ts +1 -0
- package/dist/cjs/components/SVGContent.js +37 -0
- package/dist/cjs/components/Search.js +5 -5
- package/dist/cjs/components/Segmented.js +2 -2
- package/dist/cjs/components/Select.js +223 -836
- package/dist/cjs/components/SiteMenu.js +5 -5
- package/dist/cjs/components/Swiper.js +2 -2
- package/dist/cjs/components/Tab/Tab.d.ts +3 -3
- package/dist/cjs/components/Tab/Tab.interface.d.ts +20 -21
- package/dist/cjs/components/Tab/TabGroup.d.ts +2 -2
- package/dist/cjs/components/Tab.js +3 -3
- package/dist/cjs/components/Text/Text.d.ts +3 -3
- package/dist/cjs/components/Text/Text.interface.d.ts +27 -28
- package/dist/cjs/components/Text.js +1 -1
- package/dist/cjs/components/Textarea.js +1 -1
- package/dist/cjs/components/Tile.js +4 -4
- package/dist/cjs/components/Title/Title.interface.d.ts +3 -3
- package/dist/cjs/components/Title.js +1 -1
- package/dist/cjs/components/Tooltip.js +3 -3
- package/dist/cjs/components/index.d.ts +2 -1
- package/dist/cjs/components.js +45 -42
- package/dist/cjs/{floating-ui.dom-D1St6qnn.js → floating-ui.dom-ma2MDAMT.js} +4 -5
- package/dist/cjs/types/componentProps/appearanceKeys.d.ts +1 -1
- package/dist/cjs/types/componentProps/fill.d.ts +1 -1
- package/dist/cjs/types/componentProps/fillHover.d.ts +1 -1
- package/dist/cjs/types/componentProps/textColor.d.ts +1 -1
- package/dist/cjs/types/componentProps/textColorActive.d.ts +2 -1
- package/dist/components/Accordion.js +5 -5
- package/dist/components/Avatar.js +5 -5
- package/dist/components/Badge.js +2 -2
- package/dist/components/Breadcrumbs.js +5 -5
- package/dist/components/Button/Button.interface.d.ts +1 -0
- package/dist/components/Button.js +6 -6
- package/dist/components/Card.js +2 -2
- package/dist/components/Cell.js +6 -6
- package/dist/components/Checkbox/Checkbox.interface.d.ts +3 -3
- package/dist/components/Checkbox.js +2 -2
- package/dist/components/Chips/Chips.d.ts +3 -8
- package/dist/components/Chips/Chips.interface.d.ts +12 -13
- package/dist/components/Chips.js +2 -2
- package/dist/components/Choice/Choice.d.ts +3 -3
- package/dist/components/Choice/Choice.interface.d.ts +14 -14
- package/dist/components/Choice.js +6 -5
- package/dist/components/Code/Code.d.ts +0 -1
- package/dist/components/Code.js +1 -1
- package/dist/components/ContextMenu.js +5 -5
- package/dist/components/CookiesWarning.js +8 -8
- package/dist/components/DatePicker.js +9 -9
- package/dist/components/Drawer/Drawer.d.ts +2 -2
- package/dist/components/Drawer/Drawer.interface.d.ts +6 -6
- package/dist/components/Drawer.js +1 -1
- package/dist/components/Dropdown.js +2 -2
- package/dist/components/FormField.js +9 -9
- package/dist/components/Group/Group.interface.d.ts +3 -3
- package/dist/components/Group.js +1 -1
- package/dist/components/HTMLContent/HTMLContent.d.ts +3 -0
- package/dist/components/HTMLContent/HTMLContent.interface.d.ts +30 -0
- package/dist/components/HTMLContent/index.d.ts +1 -0
- package/dist/components/HTMLContent.js +15 -0
- package/dist/components/Icon.js +4 -4
- package/dist/components/Input/Input.interface.d.ts +4 -4
- package/dist/components/InputMask.js +1 -1
- package/dist/components/InputPassword.js +5 -5
- package/dist/components/Label.js +4 -4
- package/dist/components/LanguageSelector.js +5 -5
- package/dist/components/Loader.js +2 -2
- package/dist/components/Logo/Logo.d.ts +3 -2
- package/dist/components/Logo/Logo.interface.d.ts +16 -2
- package/dist/components/Logo/index.d.ts +1 -1
- package/dist/components/Logo.js +3 -3
- package/dist/components/Menu.js +3 -3
- package/dist/components/MenuItem.js +2 -2
- package/dist/components/Modal.js +3 -3
- package/dist/components/Notification.js +3 -3
- package/dist/components/Pagination.js +6 -6
- package/dist/components/Panel/Panel.interface.d.ts +3 -3
- package/dist/components/Panel.js +4 -4
- package/dist/components/Radio.js +2 -2
- package/dist/components/Response.js +8 -8
- package/dist/components/SVGContent/SVGContent.d.ts +3 -0
- package/dist/components/SVGContent/SVGContent.interface.d.ts +11 -0
- package/dist/components/SVGContent/index.d.ts +1 -0
- package/dist/components/SVGContent.js +31 -0
- package/dist/components/Search.js +5 -5
- package/dist/components/Segmented.js +2 -2
- package/dist/components/Select.js +223 -836
- package/dist/components/SiteMenu.js +5 -5
- package/dist/components/Swiper.js +2 -2
- package/dist/components/Tab/Tab.d.ts +3 -3
- package/dist/components/Tab/Tab.interface.d.ts +20 -21
- package/dist/components/Tab/TabGroup.d.ts +2 -2
- package/dist/components/Tab.js +3 -3
- package/dist/components/Text/Text.d.ts +3 -3
- package/dist/components/Text/Text.interface.d.ts +27 -28
- package/dist/components/Text.js +1 -1
- package/dist/components/Textarea.js +1 -1
- package/dist/components/Tile.js +4 -4
- package/dist/components/Title/Title.interface.d.ts +3 -3
- package/dist/components/Title.js +1 -1
- package/dist/components/Tooltip.js +3 -3
- package/dist/components/index.d.ts +2 -1
- package/dist/components.js +43 -42
- package/dist/css/components/Accordion/Accordion.css +8 -8
- package/dist/css/components/Code/Code.css +4 -0
- package/dist/css/components/HTMLContent/HTMLContent.css +98 -0
- package/dist/css/components/RangeSlider/RangeSlider.css +1 -0
- package/dist/css/components/SVGContent/SVGContent.css +2 -0
- package/dist/css/components/Swiper/Swiper.css +2 -2
- package/dist/{floating-ui.dom-_PBQLJcF.js → floating-ui.dom-BV5qw-HP.js} +4 -5
- package/dist/types/componentProps/appearanceKeys.d.ts +1 -1
- package/dist/types/componentProps/fill.d.ts +1 -1
- package/dist/types/componentProps/fillHover.d.ts +1 -1
- package/dist/types/componentProps/textColor.d.ts +1 -1
- package/dist/types/componentProps/textColorActive.d.ts +2 -1
- package/package.json +16 -31
- package/dist/Logo-D4NFjeqd.js +0 -30
- package/dist/cjs/Logo-CcEF4P2z.js +0 -36
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var PropTypes = require('prop-types');
|
|
5
5
|
var Select$1 = require('react-select');
|
|
6
|
-
var Icon = require('../Icon-
|
|
6
|
+
var Icon = require('../Icon-BUwWk_dS.js');
|
|
7
7
|
var clsx = require('clsx');
|
|
8
8
|
var ReactDOM = require('react-dom');
|
|
9
|
-
var floatingUi_dom = require('../floating-ui.dom-
|
|
9
|
+
var floatingUi_dom = require('../floating-ui.dom-ma2MDAMT.js');
|
|
10
10
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
11
|
-
var Text = require('../Text-
|
|
12
|
-
var Badge = require('../Badge-
|
|
13
|
-
var Group$2 = require('../Group-
|
|
11
|
+
var Text = require('../Text-D2YDVhGJ.js');
|
|
12
|
+
var Badge = require('../Badge-Cn73E3GI.js');
|
|
13
|
+
var Group$2 = require('../Group-CtseVj34.js');
|
|
14
14
|
var Divider = require('../Divider-D92wY8Fn.js');
|
|
15
15
|
require('../_tslib-CKiUdo7p.js');
|
|
16
16
|
require('../jsx-runtime-BBxmckJR.js');
|
|
@@ -24,8 +24,8 @@ require('../context/UIContext.js');
|
|
|
24
24
|
require('../hooks/useMediaQueries.js');
|
|
25
25
|
require('react-responsive');
|
|
26
26
|
require('../Link-B6Xq7PWn.js');
|
|
27
|
-
require('../Tooltip-
|
|
28
|
-
require('../Title-
|
|
27
|
+
require('../Tooltip-VrKQ8W1G.js');
|
|
28
|
+
require('../Title-BzopkHQY.js');
|
|
29
29
|
require('lodash/castArray');
|
|
30
30
|
|
|
31
31
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -293,6 +293,8 @@ function _toConsumableArray(r) {
|
|
|
293
293
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
var isDevelopment$2 = false;
|
|
297
|
+
|
|
296
298
|
/*
|
|
297
299
|
|
|
298
300
|
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
@@ -315,10 +317,9 @@ styleSheet.flush()
|
|
|
315
317
|
- empties the stylesheet of all its contents
|
|
316
318
|
|
|
317
319
|
*/
|
|
318
|
-
|
|
320
|
+
|
|
319
321
|
function sheetForTag(tag) {
|
|
320
322
|
if (tag.sheet) {
|
|
321
|
-
// $FlowFixMe
|
|
322
323
|
return tag.sheet;
|
|
323
324
|
} // this weirdness brought to you by firefox
|
|
324
325
|
|
|
@@ -327,10 +328,13 @@ function sheetForTag(tag) {
|
|
|
327
328
|
|
|
328
329
|
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
329
330
|
if (document.styleSheets[i].ownerNode === tag) {
|
|
330
|
-
// $FlowFixMe
|
|
331
331
|
return document.styleSheets[i];
|
|
332
332
|
}
|
|
333
|
-
}
|
|
333
|
+
} // this function should always return with a value
|
|
334
|
+
// TS can't understand it though so we make it stop complaining here
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
return undefined;
|
|
334
338
|
}
|
|
335
339
|
|
|
336
340
|
function createStyleElement(options) {
|
|
@@ -371,7 +375,7 @@ var StyleSheet = /*#__PURE__*/function () {
|
|
|
371
375
|
_this.tags.push(tag);
|
|
372
376
|
};
|
|
373
377
|
|
|
374
|
-
this.isSpeedy = options.speedy === undefined ?
|
|
378
|
+
this.isSpeedy = options.speedy === undefined ? !isDevelopment$2 : options.speedy;
|
|
375
379
|
this.tags = [];
|
|
376
380
|
this.ctr = 0;
|
|
377
381
|
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
|
|
@@ -399,18 +403,6 @@ var StyleSheet = /*#__PURE__*/function () {
|
|
|
399
403
|
|
|
400
404
|
var tag = this.tags[this.tags.length - 1];
|
|
401
405
|
|
|
402
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
403
|
-
var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
|
|
404
|
-
|
|
405
|
-
if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
|
|
406
|
-
// this would only cause problem in speedy mode
|
|
407
|
-
// but we don't want enabling speedy to affect the observable behavior
|
|
408
|
-
// so we report this error at all times
|
|
409
|
-
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.');
|
|
410
|
-
}
|
|
411
|
-
this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
406
|
if (this.isSpeedy) {
|
|
415
407
|
var sheet = sheetForTag(tag);
|
|
416
408
|
|
|
@@ -419,9 +411,6 @@ var StyleSheet = /*#__PURE__*/function () {
|
|
|
419
411
|
// the big drawback is that the css won't be editable in devtools
|
|
420
412
|
sheet.insertRule(rule, sheet.cssRules.length);
|
|
421
413
|
} catch (e) {
|
|
422
|
-
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)) {
|
|
423
|
-
console.error("There was a problem inserting the following rule: \"" + rule + "\"", e);
|
|
424
|
-
}
|
|
425
414
|
}
|
|
426
415
|
} else {
|
|
427
416
|
tag.appendChild(document.createTextNode(rule));
|
|
@@ -431,16 +420,13 @@ var StyleSheet = /*#__PURE__*/function () {
|
|
|
431
420
|
};
|
|
432
421
|
|
|
433
422
|
_proto.flush = function flush() {
|
|
434
|
-
// $FlowFixMe
|
|
435
423
|
this.tags.forEach(function (tag) {
|
|
436
|
-
|
|
424
|
+
var _tag$parentNode;
|
|
425
|
+
|
|
426
|
+
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
|
|
437
427
|
});
|
|
438
428
|
this.tags = [];
|
|
439
429
|
this.ctr = 0;
|
|
440
|
-
|
|
441
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
442
|
-
this._alreadyInsertedOrderInsensitiveRule = false;
|
|
443
|
-
}
|
|
444
430
|
};
|
|
445
431
|
|
|
446
432
|
return StyleSheet;
|
|
@@ -1045,11 +1031,11 @@ function rulesheet (callback) {
|
|
|
1045
1031
|
}
|
|
1046
1032
|
|
|
1047
1033
|
var weakMemoize = function weakMemoize(func) {
|
|
1048
|
-
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
|
|
1049
1034
|
var cache = new WeakMap();
|
|
1050
1035
|
return function (arg) {
|
|
1051
1036
|
if (cache.has(arg)) {
|
|
1052
|
-
//
|
|
1037
|
+
// Use non-null assertion because we just checked that the cache `has` it
|
|
1038
|
+
// This allows us to remove `undefined` from the return value
|
|
1053
1039
|
return cache.get(arg);
|
|
1054
1040
|
}
|
|
1055
1041
|
|
|
@@ -1067,6 +1053,8 @@ function memoize(fn) {
|
|
|
1067
1053
|
};
|
|
1068
1054
|
}
|
|
1069
1055
|
|
|
1056
|
+
var isBrowser$3 = typeof document !== 'undefined';
|
|
1057
|
+
|
|
1070
1058
|
var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
|
|
1071
1059
|
var previous = 0;
|
|
1072
1060
|
var character = 0;
|
|
@@ -1191,114 +1179,6 @@ var removeLabel = function removeLabel(element) {
|
|
|
1191
1179
|
}
|
|
1192
1180
|
}
|
|
1193
1181
|
};
|
|
1194
|
-
var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
|
|
1195
|
-
|
|
1196
|
-
var isIgnoringComment = function isIgnoringComment(element) {
|
|
1197
|
-
return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
|
|
1198
|
-
};
|
|
1199
|
-
|
|
1200
|
-
var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
|
|
1201
|
-
return function (element, index, children) {
|
|
1202
|
-
if (element.type !== 'rule' || cache.compat) return;
|
|
1203
|
-
var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
|
|
1204
|
-
|
|
1205
|
-
if (unsafePseudoClasses) {
|
|
1206
|
-
var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent`
|
|
1207
|
-
//
|
|
1208
|
-
// considering this input:
|
|
1209
|
-
// .a {
|
|
1210
|
-
// .b /* comm */ {}
|
|
1211
|
-
// color: hotpink;
|
|
1212
|
-
// }
|
|
1213
|
-
// we get output corresponding to this:
|
|
1214
|
-
// .a {
|
|
1215
|
-
// & {
|
|
1216
|
-
// /* comm */
|
|
1217
|
-
// color: hotpink;
|
|
1218
|
-
// }
|
|
1219
|
-
// .b {}
|
|
1220
|
-
// }
|
|
1221
|
-
|
|
1222
|
-
var commentContainer = isNested ? element.parent.children : // global rule at the root level
|
|
1223
|
-
children;
|
|
1224
|
-
|
|
1225
|
-
for (var i = commentContainer.length - 1; i >= 0; i--) {
|
|
1226
|
-
var node = commentContainer[i];
|
|
1227
|
-
|
|
1228
|
-
if (node.line < element.line) {
|
|
1229
|
-
break;
|
|
1230
|
-
} // it is quite weird but comments are *usually* put at `column: element.column - 1`
|
|
1231
|
-
// so we seek *from the end* for the node that is earlier than the rule's `element` and check that
|
|
1232
|
-
// this will also match inputs like this:
|
|
1233
|
-
// .a {
|
|
1234
|
-
// /* comm */
|
|
1235
|
-
// .b {}
|
|
1236
|
-
// }
|
|
1237
|
-
//
|
|
1238
|
-
// but that is fine
|
|
1239
|
-
//
|
|
1240
|
-
// it would be the easiest to change the placement of the comment to be the first child of the rule:
|
|
1241
|
-
// .a {
|
|
1242
|
-
// .b { /* comm */ }
|
|
1243
|
-
// }
|
|
1244
|
-
// with such inputs we wouldn't have to search for the comment at all
|
|
1245
|
-
// TODO: consider changing this comment placement in the next major version
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
if (node.column < element.column) {
|
|
1249
|
-
if (isIgnoringComment(node)) {
|
|
1250
|
-
return;
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
|
-
break;
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
|
|
1257
|
-
unsafePseudoClasses.forEach(function (unsafePseudoClass) {
|
|
1258
|
-
console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
|
|
1259
|
-
});
|
|
1260
|
-
}
|
|
1261
|
-
};
|
|
1262
|
-
};
|
|
1263
|
-
|
|
1264
|
-
var isImportRule = function isImportRule(element) {
|
|
1265
|
-
return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
|
|
1266
|
-
};
|
|
1267
|
-
|
|
1268
|
-
var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
|
|
1269
|
-
for (var i = index - 1; i >= 0; i--) {
|
|
1270
|
-
if (!isImportRule(children[i])) {
|
|
1271
|
-
return true;
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
return false;
|
|
1276
|
-
}; // use this to remove incorrect elements from further processing
|
|
1277
|
-
// so they don't get handed to the `sheet` (or anything else)
|
|
1278
|
-
// as that could potentially lead to additional logs which in turn could be overhelming to the user
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
var nullifyElement = function nullifyElement(element) {
|
|
1282
|
-
element.type = '';
|
|
1283
|
-
element.value = '';
|
|
1284
|
-
element["return"] = '';
|
|
1285
|
-
element.children = '';
|
|
1286
|
-
element.props = '';
|
|
1287
|
-
};
|
|
1288
|
-
|
|
1289
|
-
var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
|
|
1290
|
-
if (!isImportRule(element)) {
|
|
1291
|
-
return;
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
if (element.parent) {
|
|
1295
|
-
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.");
|
|
1296
|
-
nullifyElement(element);
|
|
1297
|
-
} else if (isPrependedWithRegularRules(index, children)) {
|
|
1298
|
-
console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
|
|
1299
|
-
nullifyElement(element);
|
|
1300
|
-
}
|
|
1301
|
-
};
|
|
1302
1182
|
|
|
1303
1183
|
/* eslint-disable no-fallthrough */
|
|
1304
1184
|
|
|
@@ -1512,8 +1392,21 @@ var prefixer = function prefixer(element, index, children, callback) {
|
|
|
1512
1392
|
}
|
|
1513
1393
|
};
|
|
1514
1394
|
|
|
1515
|
-
|
|
1516
|
-
|
|
1395
|
+
/* import type { StylisPlugin } from './types' */
|
|
1396
|
+
|
|
1397
|
+
/*
|
|
1398
|
+
export type Options = {
|
|
1399
|
+
nonce?: string,
|
|
1400
|
+
stylisPlugins?: StylisPlugin[],
|
|
1401
|
+
key: string,
|
|
1402
|
+
container?: HTMLElement,
|
|
1403
|
+
speedy?: boolean,
|
|
1404
|
+
prepend?: boolean,
|
|
1405
|
+
insertionPoint?: HTMLElement
|
|
1406
|
+
}
|
|
1407
|
+
*/
|
|
1408
|
+
|
|
1409
|
+
var getServerStylisCache = isBrowser$3 ? undefined : weakMemoize(function () {
|
|
1517
1410
|
return memoize(function () {
|
|
1518
1411
|
var cache = {};
|
|
1519
1412
|
return function (name) {
|
|
@@ -1523,20 +1416,22 @@ var getServerStylisCache = isBrowser$4 ? undefined : weakMemoize(function () {
|
|
|
1523
1416
|
});
|
|
1524
1417
|
var defaultStylisPlugins = [prefixer];
|
|
1525
1418
|
|
|
1526
|
-
var createCache = function
|
|
1419
|
+
var createCache = function
|
|
1420
|
+
/*: EmotionCache */
|
|
1421
|
+
createCache(options
|
|
1422
|
+
/*: Options */
|
|
1423
|
+
) {
|
|
1527
1424
|
var key = options.key;
|
|
1528
1425
|
|
|
1529
|
-
if (
|
|
1530
|
-
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.\n" + "If multiple caches share the same key they might \"fight\" for each other's style elements.");
|
|
1531
|
-
}
|
|
1532
|
-
|
|
1533
|
-
if (isBrowser$4 && key === 'css') {
|
|
1426
|
+
if (isBrowser$3 && key === 'css') {
|
|
1534
1427
|
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
|
|
1535
1428
|
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
|
|
1536
1429
|
// note this very very intentionally targets all style elements regardless of the key to ensure
|
|
1537
1430
|
// that creating a cache works inside of render of a React component
|
|
1538
1431
|
|
|
1539
|
-
Array.prototype.forEach.call(ssrStyles, function (node
|
|
1432
|
+
Array.prototype.forEach.call(ssrStyles, function (node
|
|
1433
|
+
/*: HTMLStyleElement */
|
|
1434
|
+
) {
|
|
1540
1435
|
// we want to only move elements which have a space in the data-emotion attribute value
|
|
1541
1436
|
// because that indicates that it is an Emotion 11 server-side rendered style elements
|
|
1542
1437
|
// while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
|
|
@@ -1548,6 +1443,7 @@ var createCache = function createCache(options) {
|
|
|
1548
1443
|
if (dataEmotionAttribute.indexOf(' ') === -1) {
|
|
1549
1444
|
return;
|
|
1550
1445
|
}
|
|
1446
|
+
|
|
1551
1447
|
document.head.appendChild(node);
|
|
1552
1448
|
node.setAttribute('data-s', '');
|
|
1553
1449
|
});
|
|
@@ -1555,23 +1451,20 @@ var createCache = function createCache(options) {
|
|
|
1555
1451
|
|
|
1556
1452
|
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
1557
1453
|
|
|
1558
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1559
|
-
// $FlowFixMe
|
|
1560
|
-
if (/[^a-z-]/.test(key)) {
|
|
1561
|
-
throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
|
|
1562
|
-
}
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
1454
|
var inserted = {};
|
|
1566
1455
|
var container;
|
|
1456
|
+
/* : Node */
|
|
1457
|
+
|
|
1567
1458
|
var nodesToHydrate = [];
|
|
1568
1459
|
|
|
1569
|
-
if (isBrowser$
|
|
1460
|
+
if (isBrowser$3) {
|
|
1570
1461
|
container = options.container || document.head;
|
|
1571
1462
|
Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
|
|
1572
1463
|
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
1573
|
-
document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node
|
|
1574
|
-
|
|
1464
|
+
document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node
|
|
1465
|
+
/*: HTMLStyleElement */
|
|
1466
|
+
) {
|
|
1467
|
+
var attrib = node.getAttribute("data-emotion").split(' ');
|
|
1575
1468
|
|
|
1576
1469
|
for (var i = 1; i < attrib.length; i++) {
|
|
1577
1470
|
inserted[attrib[i]] = true;
|
|
@@ -1582,31 +1475,19 @@ var createCache = function createCache(options) {
|
|
|
1582
1475
|
}
|
|
1583
1476
|
|
|
1584
1477
|
var _insert;
|
|
1478
|
+
/*: (
|
|
1479
|
+
selector: string,
|
|
1480
|
+
serialized: SerializedStyles,
|
|
1481
|
+
sheet: StyleSheet,
|
|
1482
|
+
shouldCache: boolean
|
|
1483
|
+
) => string | void */
|
|
1585
1484
|
|
|
1586
|
-
var omnipresentPlugins = [compat, removeLabel];
|
|
1587
1485
|
|
|
1588
|
-
|
|
1589
|
-
omnipresentPlugins.push(createUnsafeSelectorsAlarm({
|
|
1590
|
-
get compat() {
|
|
1591
|
-
return cache.compat;
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
}), incorrectImportAlarm);
|
|
1595
|
-
}
|
|
1486
|
+
var omnipresentPlugins = [compat, removeLabel];
|
|
1596
1487
|
|
|
1597
|
-
if (isBrowser$
|
|
1488
|
+
if (isBrowser$3) {
|
|
1598
1489
|
var currentSheet;
|
|
1599
|
-
var finalizingPlugins = [stringify,
|
|
1600
|
-
if (!element.root) {
|
|
1601
|
-
if (element["return"]) {
|
|
1602
|
-
currentSheet.insert(element["return"]);
|
|
1603
|
-
} else if (element.value && element.type !== COMMENT) {
|
|
1604
|
-
// insert empty rule in non-production environments
|
|
1605
|
-
// so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
|
|
1606
|
-
currentSheet.insert(element.value + "{}");
|
|
1607
|
-
}
|
|
1608
|
-
}
|
|
1609
|
-
} : rulesheet(function (rule) {
|
|
1490
|
+
var finalizingPlugins = [stringify, rulesheet(function (rule) {
|
|
1610
1491
|
currentSheet.insert(rule);
|
|
1611
1492
|
})];
|
|
1612
1493
|
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
@@ -1615,17 +1496,19 @@ var createCache = function createCache(options) {
|
|
|
1615
1496
|
return serialize(compile(styles), serializer);
|
|
1616
1497
|
};
|
|
1617
1498
|
|
|
1618
|
-
_insert = function
|
|
1499
|
+
_insert = function
|
|
1500
|
+
/*: void */
|
|
1501
|
+
insert(selector
|
|
1502
|
+
/*: string */
|
|
1503
|
+
, serialized
|
|
1504
|
+
/*: SerializedStyles */
|
|
1505
|
+
, sheet
|
|
1506
|
+
/*: StyleSheet */
|
|
1507
|
+
, shouldCache
|
|
1508
|
+
/*: boolean */
|
|
1509
|
+
) {
|
|
1619
1510
|
currentSheet = sheet;
|
|
1620
1511
|
|
|
1621
|
-
if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {
|
|
1622
|
-
currentSheet = {
|
|
1623
|
-
insert: function insert(rule) {
|
|
1624
|
-
sheet.insert(rule + serialized.map);
|
|
1625
|
-
}
|
|
1626
|
-
};
|
|
1627
|
-
}
|
|
1628
|
-
|
|
1629
1512
|
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
1630
1513
|
|
|
1631
1514
|
if (shouldCache) {
|
|
@@ -1639,12 +1522,17 @@ var createCache = function createCache(options) {
|
|
|
1639
1522
|
|
|
1640
1523
|
var _stylis = function _stylis(styles) {
|
|
1641
1524
|
return serialize(compile(styles), _serializer);
|
|
1642
|
-
};
|
|
1643
|
-
|
|
1525
|
+
};
|
|
1644
1526
|
|
|
1645
1527
|
var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
|
|
1646
1528
|
|
|
1647
|
-
var getRules = function
|
|
1529
|
+
var getRules = function
|
|
1530
|
+
/*: string */
|
|
1531
|
+
getRules(selector
|
|
1532
|
+
/*: string */
|
|
1533
|
+
, serialized
|
|
1534
|
+
/*: SerializedStyles */
|
|
1535
|
+
) {
|
|
1648
1536
|
var name = serialized.name;
|
|
1649
1537
|
|
|
1650
1538
|
if (serverStylisCache[name] === undefined) {
|
|
@@ -1654,7 +1542,17 @@ var createCache = function createCache(options) {
|
|
|
1654
1542
|
return serverStylisCache[name];
|
|
1655
1543
|
};
|
|
1656
1544
|
|
|
1657
|
-
_insert = function
|
|
1545
|
+
_insert = function
|
|
1546
|
+
/*: string | void */
|
|
1547
|
+
_insert(selector
|
|
1548
|
+
/*: string */
|
|
1549
|
+
, serialized
|
|
1550
|
+
/*: SerializedStyles */
|
|
1551
|
+
, sheet
|
|
1552
|
+
/*: StyleSheet */
|
|
1553
|
+
, shouldCache
|
|
1554
|
+
/*: boolean */
|
|
1555
|
+
) {
|
|
1658
1556
|
var name = serialized.name;
|
|
1659
1557
|
var rules = getRules(selector, serialized);
|
|
1660
1558
|
|
|
@@ -1666,12 +1564,6 @@ var createCache = function createCache(options) {
|
|
|
1666
1564
|
cache.inserted[name] = true;
|
|
1667
1565
|
}
|
|
1668
1566
|
|
|
1669
|
-
if ( // using === development instead of !== production
|
|
1670
|
-
// because if people do ssr in tests, the source maps showing up would be annoying
|
|
1671
|
-
process.env.NODE_ENV === 'development' && serialized.map !== undefined) {
|
|
1672
|
-
return rules + serialized.map;
|
|
1673
|
-
}
|
|
1674
|
-
|
|
1675
1567
|
return rules;
|
|
1676
1568
|
} else {
|
|
1677
1569
|
// in compat mode, we put the styles on the inserted cache so
|
|
@@ -1690,7 +1582,9 @@ var createCache = function createCache(options) {
|
|
|
1690
1582
|
};
|
|
1691
1583
|
}
|
|
1692
1584
|
|
|
1693
|
-
var cache
|
|
1585
|
+
var cache
|
|
1586
|
+
/*: EmotionCache */
|
|
1587
|
+
= {
|
|
1694
1588
|
key: key,
|
|
1695
1589
|
sheet: new StyleSheet({
|
|
1696
1590
|
key: key,
|
|
@@ -1953,7 +1847,8 @@ var TYPE_STATICS = {};
|
|
|
1953
1847
|
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
1954
1848
|
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
1955
1849
|
|
|
1956
|
-
var isBrowser$
|
|
1850
|
+
var isBrowser$2 = typeof document !== 'undefined';
|
|
1851
|
+
|
|
1957
1852
|
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
1958
1853
|
var rawClassName = '';
|
|
1959
1854
|
classNames.split(' ').forEach(function (className) {
|
|
@@ -1977,7 +1872,7 @@ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
|
|
1977
1872
|
// in node since emotion-server relies on whether a style is in
|
|
1978
1873
|
// the registered cache to know whether a style is global or not
|
|
1979
1874
|
// also, note that this check will be dead code eliminated in the browser
|
|
1980
|
-
isBrowser$
|
|
1875
|
+
isBrowser$2 === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
|
|
1981
1876
|
cache.registered[className] = serialized.styles;
|
|
1982
1877
|
}
|
|
1983
1878
|
};
|
|
@@ -1992,14 +1887,14 @@ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
|
1992
1887
|
do {
|
|
1993
1888
|
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
|
1994
1889
|
|
|
1995
|
-
if (!isBrowser$
|
|
1890
|
+
if (!isBrowser$2 && maybeStyles !== undefined) {
|
|
1996
1891
|
stylesForSSR += maybeStyles;
|
|
1997
1892
|
}
|
|
1998
1893
|
|
|
1999
1894
|
current = current.next;
|
|
2000
1895
|
} while (current !== undefined);
|
|
2001
1896
|
|
|
2002
|
-
if (!isBrowser$
|
|
1897
|
+
if (!isBrowser$2 && stylesForSSR.length !== 0) {
|
|
2003
1898
|
return stylesForSSR;
|
|
2004
1899
|
}
|
|
2005
1900
|
}
|
|
@@ -2109,8 +2004,8 @@ var unitlessKeys = {
|
|
|
2109
2004
|
strokeWidth: 1
|
|
2110
2005
|
};
|
|
2111
2006
|
|
|
2112
|
-
var
|
|
2113
|
-
|
|
2007
|
+
var isDevelopment$1 = false;
|
|
2008
|
+
|
|
2114
2009
|
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
2115
2010
|
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
2116
2011
|
|
|
@@ -2151,34 +2046,6 @@ var processStyleValue = function processStyleValue(key, value) {
|
|
|
2151
2046
|
return value;
|
|
2152
2047
|
};
|
|
2153
2048
|
|
|
2154
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2155
|
-
var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
|
|
2156
|
-
var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];
|
|
2157
|
-
var oldProcessStyleValue = processStyleValue;
|
|
2158
|
-
var msPattern = /^-ms-/;
|
|
2159
|
-
var hyphenPattern = /-(.)/g;
|
|
2160
|
-
var hyphenatedCache = {};
|
|
2161
|
-
|
|
2162
|
-
processStyleValue = function processStyleValue(key, value) {
|
|
2163
|
-
if (key === 'content') {
|
|
2164
|
-
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) !== "'")) {
|
|
2165
|
-
throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
|
|
2166
|
-
}
|
|
2167
|
-
}
|
|
2168
|
-
|
|
2169
|
-
var processed = oldProcessStyleValue(key, value);
|
|
2170
|
-
|
|
2171
|
-
if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {
|
|
2172
|
-
hyphenatedCache[key] = true;
|
|
2173
|
-
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) {
|
|
2174
|
-
return _char.toUpperCase();
|
|
2175
|
-
}) + "?");
|
|
2176
|
-
}
|
|
2177
|
-
|
|
2178
|
-
return processed;
|
|
2179
|
-
};
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
2049
|
var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';
|
|
2183
2050
|
|
|
2184
2051
|
function handleInterpolation(mergedProps, registered, interpolation) {
|
|
@@ -2186,12 +2053,11 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
2186
2053
|
return '';
|
|
2187
2054
|
}
|
|
2188
2055
|
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
}
|
|
2056
|
+
var componentSelector = interpolation;
|
|
2057
|
+
|
|
2058
|
+
if (componentSelector.__emotion_styles !== undefined) {
|
|
2193
2059
|
|
|
2194
|
-
return
|
|
2060
|
+
return componentSelector;
|
|
2195
2061
|
}
|
|
2196
2062
|
|
|
2197
2063
|
switch (typeof interpolation) {
|
|
@@ -2202,17 +2068,21 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
2202
2068
|
|
|
2203
2069
|
case 'object':
|
|
2204
2070
|
{
|
|
2205
|
-
|
|
2071
|
+
var keyframes = interpolation;
|
|
2072
|
+
|
|
2073
|
+
if (keyframes.anim === 1) {
|
|
2206
2074
|
cursor = {
|
|
2207
|
-
name:
|
|
2208
|
-
styles:
|
|
2075
|
+
name: keyframes.name,
|
|
2076
|
+
styles: keyframes.styles,
|
|
2209
2077
|
next: cursor
|
|
2210
2078
|
};
|
|
2211
|
-
return
|
|
2079
|
+
return keyframes.name;
|
|
2212
2080
|
}
|
|
2213
2081
|
|
|
2214
|
-
|
|
2215
|
-
|
|
2082
|
+
var serializedStyles = interpolation;
|
|
2083
|
+
|
|
2084
|
+
if (serializedStyles.styles !== undefined) {
|
|
2085
|
+
var next = serializedStyles.next;
|
|
2216
2086
|
|
|
2217
2087
|
if (next !== undefined) {
|
|
2218
2088
|
// not the most efficient thing ever but this is a pretty rare case
|
|
@@ -2227,11 +2097,7 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
2227
2097
|
}
|
|
2228
2098
|
}
|
|
2229
2099
|
|
|
2230
|
-
var styles =
|
|
2231
|
-
|
|
2232
|
-
if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {
|
|
2233
|
-
styles += interpolation.map;
|
|
2234
|
-
}
|
|
2100
|
+
var styles = serializedStyles.styles + ";";
|
|
2235
2101
|
|
|
2236
2102
|
return styles;
|
|
2237
2103
|
}
|
|
@@ -2246,37 +2112,18 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
2246
2112
|
var result = interpolation(mergedProps);
|
|
2247
2113
|
cursor = previousCursor;
|
|
2248
2114
|
return handleInterpolation(mergedProps, registered, result);
|
|
2249
|
-
} else if (process.env.NODE_ENV !== 'production') {
|
|
2250
|
-
console.error('Functions that are interpolated in css calls will be stringified.\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\n' + 'It can be called directly with props or interpolated in a styled call like this\n' + "let SomeComponent = styled('div')`${dynamicStyle}`");
|
|
2251
2115
|
}
|
|
2252
2116
|
|
|
2253
2117
|
break;
|
|
2254
2118
|
}
|
|
2255
|
-
|
|
2256
|
-
case 'string':
|
|
2257
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2258
|
-
var matched = [];
|
|
2259
|
-
var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {
|
|
2260
|
-
var fakeVarName = "animation" + matched.length;
|
|
2261
|
-
matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`");
|
|
2262
|
-
return "${" + fakeVarName + "}";
|
|
2263
|
-
});
|
|
2264
|
-
|
|
2265
|
-
if (matched.length) {
|
|
2266
|
-
console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\n' + 'Instead of doing this:\n\n' + [].concat(matched, ["`" + replaced + "`"]).join('\n') + '\n\nYou should wrap it with `css` like this:\n\n' + ("css`" + replaced + "`"));
|
|
2267
|
-
}
|
|
2268
|
-
}
|
|
2269
|
-
|
|
2270
|
-
break;
|
|
2271
2119
|
} // finalize string values (regular strings and functions interpolated into css calls)
|
|
2272
2120
|
|
|
2273
2121
|
|
|
2274
|
-
|
|
2275
|
-
return interpolation;
|
|
2276
|
-
}
|
|
2122
|
+
var asString = interpolation;
|
|
2277
2123
|
|
|
2278
|
-
|
|
2279
|
-
|
|
2124
|
+
{
|
|
2125
|
+
return asString;
|
|
2126
|
+
}
|
|
2280
2127
|
}
|
|
2281
2128
|
|
|
2282
2129
|
function createStringFromObject(mergedProps, registered, obj) {
|
|
@@ -2287,44 +2134,41 @@ function createStringFromObject(mergedProps, registered, obj) {
|
|
|
2287
2134
|
string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
|
|
2288
2135
|
}
|
|
2289
2136
|
} else {
|
|
2290
|
-
for (var
|
|
2291
|
-
var value = obj[
|
|
2137
|
+
for (var key in obj) {
|
|
2138
|
+
var value = obj[key];
|
|
2292
2139
|
|
|
2293
2140
|
if (typeof value !== 'object') {
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
string += processStyleName(
|
|
2141
|
+
var asString = value;
|
|
2142
|
+
|
|
2143
|
+
if (isProcessableValue(asString)) {
|
|
2144
|
+
string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
|
|
2298
2145
|
}
|
|
2299
2146
|
} else {
|
|
2300
|
-
if (
|
|
2147
|
+
if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment$1) {
|
|
2301
2148
|
throw new Error(noComponentSelectorMessage);
|
|
2302
2149
|
}
|
|
2303
2150
|
|
|
2304
|
-
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null
|
|
2151
|
+
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null)) {
|
|
2305
2152
|
for (var _i = 0; _i < value.length; _i++) {
|
|
2306
2153
|
if (isProcessableValue(value[_i])) {
|
|
2307
|
-
string += processStyleName(
|
|
2154
|
+
string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
|
|
2308
2155
|
}
|
|
2309
2156
|
}
|
|
2310
2157
|
} else {
|
|
2311
2158
|
var interpolated = handleInterpolation(mergedProps, registered, value);
|
|
2312
2159
|
|
|
2313
|
-
switch (
|
|
2160
|
+
switch (key) {
|
|
2314
2161
|
case 'animation':
|
|
2315
2162
|
case 'animationName':
|
|
2316
2163
|
{
|
|
2317
|
-
string += processStyleName(
|
|
2164
|
+
string += processStyleName(key) + ":" + interpolated + ";";
|
|
2318
2165
|
break;
|
|
2319
2166
|
}
|
|
2320
2167
|
|
|
2321
2168
|
default:
|
|
2322
2169
|
{
|
|
2323
|
-
if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {
|
|
2324
|
-
console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
|
|
2325
|
-
}
|
|
2326
2170
|
|
|
2327
|
-
string +=
|
|
2171
|
+
string += key + "{" + interpolated + "}";
|
|
2328
2172
|
}
|
|
2329
2173
|
}
|
|
2330
2174
|
}
|
|
@@ -2336,16 +2180,11 @@ function createStringFromObject(mergedProps, registered, obj) {
|
|
|
2336
2180
|
}
|
|
2337
2181
|
|
|
2338
2182
|
var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
|
|
2339
|
-
var sourceMapPattern;
|
|
2340
|
-
|
|
2341
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2342
|
-
sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
|
|
2343
|
-
} // this is the cursor for keyframes
|
|
2344
2183
|
// keyframes are stored on the SerializedStyles object as a linked list
|
|
2345
2184
|
|
|
2346
2185
|
|
|
2347
2186
|
var cursor;
|
|
2348
|
-
|
|
2187
|
+
function serializeStyles(args, registered, mergedProps) {
|
|
2349
2188
|
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
|
|
2350
2189
|
return args[0];
|
|
2351
2190
|
}
|
|
@@ -2359,11 +2198,9 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
|
|
2359
2198
|
stringMode = false;
|
|
2360
2199
|
styles += handleInterpolation(mergedProps, registered, strings);
|
|
2361
2200
|
} else {
|
|
2362
|
-
|
|
2363
|
-
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
2364
|
-
}
|
|
2201
|
+
var asTemplateStringsArr = strings;
|
|
2365
2202
|
|
|
2366
|
-
styles +=
|
|
2203
|
+
styles += asTemplateStringsArr[0];
|
|
2367
2204
|
} // we start at 1 since we've already handled the first arg
|
|
2368
2205
|
|
|
2369
2206
|
|
|
@@ -2371,69 +2208,47 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
|
|
2371
2208
|
styles += handleInterpolation(mergedProps, registered, args[i]);
|
|
2372
2209
|
|
|
2373
2210
|
if (stringMode) {
|
|
2374
|
-
|
|
2375
|
-
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
2376
|
-
}
|
|
2211
|
+
var templateStringsArr = strings;
|
|
2377
2212
|
|
|
2378
|
-
styles +=
|
|
2213
|
+
styles += templateStringsArr[i];
|
|
2379
2214
|
}
|
|
2380
2215
|
}
|
|
2381
2216
|
|
|
2382
|
-
var sourceMap;
|
|
2383
|
-
|
|
2384
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2385
|
-
styles = styles.replace(sourceMapPattern, function (match) {
|
|
2386
|
-
sourceMap = match;
|
|
2387
|
-
return '';
|
|
2388
|
-
});
|
|
2389
|
-
} // using a global regex with .exec is stateful so lastIndex has to be reset each time
|
|
2390
|
-
|
|
2391
2217
|
|
|
2392
2218
|
labelPattern.lastIndex = 0;
|
|
2393
2219
|
var identifierName = '';
|
|
2394
2220
|
var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
|
|
2395
2221
|
|
|
2396
2222
|
while ((match = labelPattern.exec(styles)) !== null) {
|
|
2397
|
-
identifierName += '-' +
|
|
2398
|
-
match[1];
|
|
2223
|
+
identifierName += '-' + match[1];
|
|
2399
2224
|
}
|
|
2400
2225
|
|
|
2401
2226
|
var name = murmur2(styles) + identifierName;
|
|
2402
2227
|
|
|
2403
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2404
|
-
// $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)
|
|
2405
|
-
return {
|
|
2406
|
-
name: name,
|
|
2407
|
-
styles: styles,
|
|
2408
|
-
map: sourceMap,
|
|
2409
|
-
next: cursor,
|
|
2410
|
-
toString: function toString() {
|
|
2411
|
-
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).";
|
|
2412
|
-
}
|
|
2413
|
-
};
|
|
2414
|
-
}
|
|
2415
|
-
|
|
2416
2228
|
return {
|
|
2417
2229
|
name: name,
|
|
2418
2230
|
styles: styles,
|
|
2419
2231
|
next: cursor
|
|
2420
2232
|
};
|
|
2421
|
-
}
|
|
2233
|
+
}
|
|
2422
2234
|
|
|
2423
|
-
var isBrowser$
|
|
2235
|
+
var isBrowser$1 = typeof document !== 'undefined';
|
|
2424
2236
|
|
|
2425
2237
|
var syncFallback = function syncFallback(create) {
|
|
2426
2238
|
return create();
|
|
2427
2239
|
};
|
|
2428
2240
|
|
|
2429
2241
|
var useInsertionEffect = React__namespace['useInsertion' + 'Effect'] ? React__namespace['useInsertion' + 'Effect'] : false;
|
|
2430
|
-
var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$
|
|
2431
|
-
var useInsertionEffectWithLayoutFallback = useInsertionEffect || React__namespace.useLayoutEffect;
|
|
2242
|
+
var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$1 ? syncFallback : useInsertionEffect || syncFallback;
|
|
2432
2243
|
|
|
2433
|
-
var
|
|
2434
|
-
var hasOwn = {}.hasOwnProperty;
|
|
2244
|
+
var isDevelopment = false;
|
|
2435
2245
|
|
|
2436
|
-
var
|
|
2246
|
+
var isBrowser = typeof document !== 'undefined';
|
|
2247
|
+
|
|
2248
|
+
/* import { type EmotionCache } from '@emotion/utils' */
|
|
2249
|
+
var EmotionCacheContext
|
|
2250
|
+
/*: React.Context<EmotionCache | null> */
|
|
2251
|
+
= /* #__PURE__ */React__namespace.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
2437
2252
|
// because this module is primarily intended for the browser and node
|
|
2438
2253
|
// but it's also required in react native and similar environments sometimes
|
|
2439
2254
|
// and we could have a special build just for that
|
|
@@ -2443,24 +2258,37 @@ typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
|
|
|
2443
2258
|
key: 'css'
|
|
2444
2259
|
}) : null);
|
|
2445
2260
|
|
|
2446
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2447
|
-
EmotionCacheContext.displayName = 'EmotionCacheContext';
|
|
2448
|
-
}
|
|
2449
|
-
|
|
2450
2261
|
EmotionCacheContext.Provider;
|
|
2451
2262
|
|
|
2452
|
-
var withEmotionCache = function withEmotionCache
|
|
2453
|
-
|
|
2454
|
-
|
|
2263
|
+
var withEmotionCache = function withEmotionCache
|
|
2264
|
+
/* <Props, Ref: React.Ref<*>> */
|
|
2265
|
+
(func
|
|
2266
|
+
/*: (props: Props, cache: EmotionCache, ref: Ref) => React.Node */
|
|
2267
|
+
)
|
|
2268
|
+
/*: React.AbstractComponent<Props> */
|
|
2269
|
+
{
|
|
2270
|
+
return /*#__PURE__*/React.forwardRef(function (props
|
|
2271
|
+
/*: Props */
|
|
2272
|
+
, ref
|
|
2273
|
+
/*: Ref */
|
|
2274
|
+
) {
|
|
2455
2275
|
// the cache will never be null in the browser
|
|
2456
2276
|
var cache = React.useContext(EmotionCacheContext);
|
|
2457
2277
|
return func(props, cache, ref);
|
|
2458
2278
|
});
|
|
2459
2279
|
};
|
|
2460
2280
|
|
|
2461
|
-
if (!isBrowser
|
|
2462
|
-
withEmotionCache = function withEmotionCache
|
|
2463
|
-
|
|
2281
|
+
if (!isBrowser) {
|
|
2282
|
+
withEmotionCache = function withEmotionCache
|
|
2283
|
+
/* <Props> */
|
|
2284
|
+
(func
|
|
2285
|
+
/*: (props: Props, cache: EmotionCache) => React.Node */
|
|
2286
|
+
)
|
|
2287
|
+
/*: React.StatelessFunctionalComponent<Props> */
|
|
2288
|
+
{
|
|
2289
|
+
return function (props
|
|
2290
|
+
/*: Props */
|
|
2291
|
+
) {
|
|
2464
2292
|
var cache = React.useContext(EmotionCacheContext);
|
|
2465
2293
|
|
|
2466
2294
|
if (cache === null) {
|
|
@@ -2484,62 +2312,18 @@ if (!isBrowser$1) {
|
|
|
2484
2312
|
|
|
2485
2313
|
var ThemeContext = /* #__PURE__ */React__namespace.createContext({});
|
|
2486
2314
|
|
|
2487
|
-
|
|
2488
|
-
ThemeContext.displayName = 'EmotionThemeContext';
|
|
2489
|
-
}
|
|
2490
|
-
|
|
2491
|
-
var getLastPart = function getLastPart(functionName) {
|
|
2492
|
-
// The match may be something like 'Object.createEmotionProps' or
|
|
2493
|
-
// 'Loader.prototype.render'
|
|
2494
|
-
var parts = functionName.split('.');
|
|
2495
|
-
return parts[parts.length - 1];
|
|
2496
|
-
};
|
|
2497
|
-
|
|
2498
|
-
var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {
|
|
2499
|
-
// V8
|
|
2500
|
-
var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line);
|
|
2501
|
-
if (match) return getLastPart(match[1]); // Safari / Firefox
|
|
2502
|
-
|
|
2503
|
-
match = /^([A-Za-z0-9$.]+)@/.exec(line);
|
|
2504
|
-
if (match) return getLastPart(match[1]);
|
|
2505
|
-
return undefined;
|
|
2506
|
-
};
|
|
2507
|
-
|
|
2508
|
-
var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS
|
|
2509
|
-
// identifiers, thus we only need to replace what is a valid character for JS,
|
|
2510
|
-
// but not for CSS.
|
|
2511
|
-
|
|
2512
|
-
var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
|
|
2513
|
-
return identifier.replace(/\$/g, '-');
|
|
2514
|
-
};
|
|
2515
|
-
|
|
2516
|
-
var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {
|
|
2517
|
-
if (!stackTrace) return undefined;
|
|
2518
|
-
var lines = stackTrace.split('\n');
|
|
2519
|
-
|
|
2520
|
-
for (var i = 0; i < lines.length; i++) {
|
|
2521
|
-
var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error"
|
|
2522
|
-
|
|
2523
|
-
if (!functionName) continue; // If we reach one of these, we have gone too far and should quit
|
|
2524
|
-
|
|
2525
|
-
if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an
|
|
2526
|
-
// uppercase letter
|
|
2527
|
-
|
|
2528
|
-
if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);
|
|
2529
|
-
}
|
|
2530
|
-
|
|
2531
|
-
return undefined;
|
|
2532
|
-
};
|
|
2315
|
+
var hasOwn = {}.hasOwnProperty;
|
|
2533
2316
|
|
|
2534
2317
|
var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
|
|
2535
|
-
var
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
}
|
|
2318
|
+
var createEmotionProps = function createEmotionProps(type
|
|
2319
|
+
/*: React.ElementType */
|
|
2320
|
+
, props
|
|
2321
|
+
/*: Object */
|
|
2322
|
+
) {
|
|
2541
2323
|
|
|
2542
|
-
var newProps
|
|
2324
|
+
var newProps
|
|
2325
|
+
/*: any */
|
|
2326
|
+
= {};
|
|
2543
2327
|
|
|
2544
2328
|
for (var key in props) {
|
|
2545
2329
|
if (hasOwn.call(props, key)) {
|
|
@@ -2547,18 +2331,12 @@ var createEmotionProps = function createEmotionProps(type, props) {
|
|
|
2547
2331
|
}
|
|
2548
2332
|
}
|
|
2549
2333
|
|
|
2550
|
-
newProps[typePropName] = type; //
|
|
2551
|
-
// the label hasn't already been computed
|
|
2552
|
-
|
|
2553
|
-
if (process.env.NODE_ENV !== 'production' && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {
|
|
2554
|
-
var label = getLabelFromStackTrace(new Error().stack);
|
|
2555
|
-
if (label) newProps[labelPropName] = label;
|
|
2556
|
-
}
|
|
2334
|
+
newProps[typePropName] = type; // Runtime labeling is an opt-in feature because:
|
|
2557
2335
|
|
|
2558
2336
|
return newProps;
|
|
2559
2337
|
};
|
|
2560
2338
|
|
|
2561
|
-
var Insertion
|
|
2339
|
+
var Insertion = function Insertion(_ref) {
|
|
2562
2340
|
var cache = _ref.cache,
|
|
2563
2341
|
serialized = _ref.serialized,
|
|
2564
2342
|
isStringTag = _ref.isStringTag;
|
|
@@ -2567,7 +2345,7 @@ var Insertion$1 = function Insertion(_ref) {
|
|
|
2567
2345
|
return insertStyles(cache, serialized, isStringTag);
|
|
2568
2346
|
});
|
|
2569
2347
|
|
|
2570
|
-
if (!isBrowser
|
|
2348
|
+
if (!isBrowser && rules !== undefined) {
|
|
2571
2349
|
var _ref2;
|
|
2572
2350
|
|
|
2573
2351
|
var serializedNames = serialized.name;
|
|
@@ -2586,7 +2364,9 @@ var Insertion$1 = function Insertion(_ref) {
|
|
|
2586
2364
|
return null;
|
|
2587
2365
|
};
|
|
2588
2366
|
|
|
2589
|
-
var Emotion = /* #__PURE__ */withEmotionCache(
|
|
2367
|
+
var Emotion = /* #__PURE__ */withEmotionCache(
|
|
2368
|
+
/* <any, any> */
|
|
2369
|
+
function (props, cache, ref) {
|
|
2590
2370
|
var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
|
|
2591
2371
|
// not passing the registered cache to serializeStyles because it would
|
|
2592
2372
|
// make certain babel optimisations not possible
|
|
@@ -2607,175 +2387,42 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
|
2607
2387
|
|
|
2608
2388
|
var serialized = serializeStyles(registeredStyles, undefined, React__namespace.useContext(ThemeContext));
|
|
2609
2389
|
|
|
2610
|
-
if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {
|
|
2611
|
-
var labelFromStack = props[labelPropName];
|
|
2612
|
-
|
|
2613
|
-
if (labelFromStack) {
|
|
2614
|
-
serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);
|
|
2615
|
-
}
|
|
2616
|
-
}
|
|
2617
|
-
|
|
2618
2390
|
className += cache.key + "-" + serialized.name;
|
|
2619
2391
|
var newProps = {};
|
|
2620
2392
|
|
|
2621
2393
|
for (var key in props) {
|
|
2622
|
-
if (hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (
|
|
2394
|
+
if (hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (!isDevelopment )) {
|
|
2623
2395
|
newProps[key] = props[key];
|
|
2624
2396
|
}
|
|
2625
2397
|
}
|
|
2626
2398
|
|
|
2627
|
-
newProps.ref = ref;
|
|
2628
2399
|
newProps.className = className;
|
|
2629
|
-
|
|
2400
|
+
|
|
2401
|
+
if (ref) {
|
|
2402
|
+
newProps.ref = ref;
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2405
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Insertion, {
|
|
2630
2406
|
cache: cache,
|
|
2631
2407
|
serialized: serialized,
|
|
2632
2408
|
isStringTag: typeof WrappedComponent === 'string'
|
|
2633
2409
|
}), /*#__PURE__*/React__namespace.createElement(WrappedComponent, newProps));
|
|
2634
2410
|
});
|
|
2635
2411
|
|
|
2636
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2637
|
-
Emotion.displayName = 'EmotionCssPropInternal';
|
|
2638
|
-
}
|
|
2639
|
-
|
|
2640
2412
|
var Emotion$1 = Emotion;
|
|
2641
2413
|
|
|
2642
|
-
var
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
".": {
|
|
2652
|
-
module: {
|
|
2653
|
-
worker: "./dist/emotion-react.worker.esm.js",
|
|
2654
|
-
browser: "./dist/emotion-react.browser.esm.js",
|
|
2655
|
-
"default": "./dist/emotion-react.esm.js"
|
|
2656
|
-
},
|
|
2657
|
-
"import": "./dist/emotion-react.cjs.mjs",
|
|
2658
|
-
"default": "./dist/emotion-react.cjs.js"
|
|
2659
|
-
},
|
|
2660
|
-
"./jsx-runtime": {
|
|
2661
|
-
module: {
|
|
2662
|
-
worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
|
|
2663
|
-
browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
|
|
2664
|
-
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
|
|
2665
|
-
},
|
|
2666
|
-
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
|
|
2667
|
-
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
|
|
2668
|
-
},
|
|
2669
|
-
"./_isolated-hnrs": {
|
|
2670
|
-
module: {
|
|
2671
|
-
worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
|
|
2672
|
-
browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
|
|
2673
|
-
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
|
|
2674
|
-
},
|
|
2675
|
-
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
|
|
2676
|
-
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
|
|
2677
|
-
},
|
|
2678
|
-
"./jsx-dev-runtime": {
|
|
2679
|
-
module: {
|
|
2680
|
-
worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
|
|
2681
|
-
browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
|
|
2682
|
-
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
|
|
2683
|
-
},
|
|
2684
|
-
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
|
|
2685
|
-
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
|
|
2686
|
-
},
|
|
2687
|
-
"./package.json": "./package.json",
|
|
2688
|
-
"./types/css-prop": "./types/css-prop.d.ts",
|
|
2689
|
-
"./macro": {
|
|
2690
|
-
types: {
|
|
2691
|
-
"import": "./macro.d.mts",
|
|
2692
|
-
"default": "./macro.d.ts"
|
|
2693
|
-
},
|
|
2694
|
-
"default": "./macro.js"
|
|
2695
|
-
}
|
|
2696
|
-
},
|
|
2697
|
-
types: "types/index.d.ts",
|
|
2698
|
-
files: [
|
|
2699
|
-
"src",
|
|
2700
|
-
"dist",
|
|
2701
|
-
"jsx-runtime",
|
|
2702
|
-
"jsx-dev-runtime",
|
|
2703
|
-
"_isolated-hnrs",
|
|
2704
|
-
"types/*.d.ts",
|
|
2705
|
-
"macro.*"
|
|
2706
|
-
],
|
|
2707
|
-
sideEffects: false,
|
|
2708
|
-
author: "Emotion Contributors",
|
|
2709
|
-
license: "MIT",
|
|
2710
|
-
scripts: {
|
|
2711
|
-
"test:typescript": "dtslint types"
|
|
2712
|
-
},
|
|
2713
|
-
dependencies: {
|
|
2714
|
-
"@babel/runtime": "^7.18.3",
|
|
2715
|
-
"@emotion/babel-plugin": "^11.11.0",
|
|
2716
|
-
"@emotion/cache": "^11.11.0",
|
|
2717
|
-
"@emotion/serialize": "^1.1.3",
|
|
2718
|
-
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
|
|
2719
|
-
"@emotion/utils": "^1.2.1",
|
|
2720
|
-
"@emotion/weak-memoize": "^0.3.1",
|
|
2721
|
-
"hoist-non-react-statics": "^3.3.1"
|
|
2722
|
-
},
|
|
2723
|
-
peerDependencies: {
|
|
2724
|
-
react: ">=16.8.0"
|
|
2725
|
-
},
|
|
2726
|
-
peerDependenciesMeta: {
|
|
2727
|
-
"@types/react": {
|
|
2728
|
-
optional: true
|
|
2729
|
-
}
|
|
2730
|
-
},
|
|
2731
|
-
devDependencies: {
|
|
2732
|
-
"@definitelytyped/dtslint": "0.0.112",
|
|
2733
|
-
"@emotion/css": "11.11.2",
|
|
2734
|
-
"@emotion/css-prettifier": "1.1.3",
|
|
2735
|
-
"@emotion/server": "11.11.0",
|
|
2736
|
-
"@emotion/styled": "11.11.0",
|
|
2737
|
-
"html-tag-names": "^1.1.2",
|
|
2738
|
-
react: "16.14.0",
|
|
2739
|
-
"svg-tag-names": "^1.1.1",
|
|
2740
|
-
typescript: "^4.5.5"
|
|
2741
|
-
},
|
|
2742
|
-
repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
|
|
2743
|
-
publishConfig: {
|
|
2744
|
-
access: "public"
|
|
2745
|
-
},
|
|
2746
|
-
"umd:main": "dist/emotion-react.umd.min.js",
|
|
2747
|
-
preconstruct: {
|
|
2748
|
-
entrypoints: [
|
|
2749
|
-
"./index.js",
|
|
2750
|
-
"./jsx-runtime.js",
|
|
2751
|
-
"./jsx-dev-runtime.js",
|
|
2752
|
-
"./_isolated-hnrs.js"
|
|
2753
|
-
],
|
|
2754
|
-
umdName: "emotionReact",
|
|
2755
|
-
exports: {
|
|
2756
|
-
envConditions: [
|
|
2757
|
-
"browser",
|
|
2758
|
-
"worker"
|
|
2759
|
-
],
|
|
2760
|
-
extra: {
|
|
2761
|
-
"./types/css-prop": "./types/css-prop.d.ts",
|
|
2762
|
-
"./macro": {
|
|
2763
|
-
types: {
|
|
2764
|
-
"import": "./macro.d.mts",
|
|
2765
|
-
"default": "./macro.d.ts"
|
|
2766
|
-
},
|
|
2767
|
-
"default": "./macro.js"
|
|
2768
|
-
}
|
|
2769
|
-
}
|
|
2770
|
-
}
|
|
2771
|
-
}
|
|
2772
|
-
};
|
|
2773
|
-
|
|
2774
|
-
var jsx = function jsx(type, props) {
|
|
2414
|
+
var jsx
|
|
2415
|
+
/*: typeof React.createElement */
|
|
2416
|
+
= function jsx
|
|
2417
|
+
/*: typeof React.createElement */
|
|
2418
|
+
(type
|
|
2419
|
+
/*: React.ElementType */
|
|
2420
|
+
, props
|
|
2421
|
+
/*: Object */
|
|
2422
|
+
) {
|
|
2775
2423
|
var args = arguments;
|
|
2776
2424
|
|
|
2777
2425
|
if (props == null || !hasOwn.call(props, 'css')) {
|
|
2778
|
-
// $FlowFixMe
|
|
2779
2426
|
return React__namespace.createElement.apply(undefined, args);
|
|
2780
2427
|
}
|
|
2781
2428
|
|
|
@@ -2786,123 +2433,16 @@ var jsx = function jsx(type, props) {
|
|
|
2786
2433
|
|
|
2787
2434
|
for (var i = 2; i < argsLength; i++) {
|
|
2788
2435
|
createElementArgArray[i] = args[i];
|
|
2789
|
-
}
|
|
2790
|
-
|
|
2436
|
+
}
|
|
2791
2437
|
|
|
2792
2438
|
return React__namespace.createElement.apply(null, createElementArgArray);
|
|
2793
2439
|
};
|
|
2794
2440
|
|
|
2795
|
-
|
|
2796
|
-
// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
|
|
2797
|
-
// initial client-side render from SSR, use place of hydrating tag
|
|
2798
|
-
|
|
2799
|
-
var Global = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
2800
|
-
if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is
|
|
2801
|
-
// probably using the custom createElement which
|
|
2802
|
-
// means it will be turned into a className prop
|
|
2803
|
-
// $FlowFixMe I don't really want to add it to the type since it shouldn't be used
|
|
2804
|
-
props.className || props.css)) {
|
|
2805
|
-
console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
|
|
2806
|
-
warnedAboutCssPropForGlobal = true;
|
|
2807
|
-
}
|
|
2808
|
-
|
|
2809
|
-
var styles = props.styles;
|
|
2810
|
-
var serialized = serializeStyles([styles], undefined, React__namespace.useContext(ThemeContext));
|
|
2811
|
-
|
|
2812
|
-
if (!isBrowser$1) {
|
|
2813
|
-
var _ref;
|
|
2814
|
-
|
|
2815
|
-
var serializedNames = serialized.name;
|
|
2816
|
-
var serializedStyles = serialized.styles;
|
|
2817
|
-
var next = serialized.next;
|
|
2818
|
-
|
|
2819
|
-
while (next !== undefined) {
|
|
2820
|
-
serializedNames += ' ' + next.name;
|
|
2821
|
-
serializedStyles += next.styles;
|
|
2822
|
-
next = next.next;
|
|
2823
|
-
}
|
|
2824
|
-
|
|
2825
|
-
var shouldCache = cache.compat === true;
|
|
2826
|
-
var rules = cache.insert("", {
|
|
2827
|
-
name: serializedNames,
|
|
2828
|
-
styles: serializedStyles
|
|
2829
|
-
}, cache.sheet, shouldCache);
|
|
2830
|
-
|
|
2831
|
-
if (shouldCache) {
|
|
2832
|
-
return null;
|
|
2833
|
-
}
|
|
2834
|
-
|
|
2835
|
-
return /*#__PURE__*/React__namespace.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = {
|
|
2836
|
-
__html: rules
|
|
2837
|
-
}, _ref.nonce = cache.sheet.nonce, _ref));
|
|
2838
|
-
} // yes, i know these hooks are used conditionally
|
|
2839
|
-
// but it is based on a constant that will never change at runtime
|
|
2840
|
-
// it's effectively like having two implementations and switching them out
|
|
2841
|
-
// so it's not actually breaking anything
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
var sheetRef = React__namespace.useRef();
|
|
2845
|
-
useInsertionEffectWithLayoutFallback(function () {
|
|
2846
|
-
var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675
|
|
2847
|
-
|
|
2848
|
-
var sheet = new cache.sheet.constructor({
|
|
2849
|
-
key: key,
|
|
2850
|
-
nonce: cache.sheet.nonce,
|
|
2851
|
-
container: cache.sheet.container,
|
|
2852
|
-
speedy: cache.sheet.isSpeedy
|
|
2853
|
-
});
|
|
2854
|
-
var rehydrating = false; // $FlowFixMe
|
|
2855
|
-
|
|
2856
|
-
var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]");
|
|
2857
|
-
|
|
2858
|
-
if (cache.sheet.tags.length) {
|
|
2859
|
-
sheet.before = cache.sheet.tags[0];
|
|
2860
|
-
}
|
|
2861
|
-
|
|
2862
|
-
if (node !== null) {
|
|
2863
|
-
rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s
|
|
2864
|
-
|
|
2865
|
-
node.setAttribute('data-emotion', key);
|
|
2866
|
-
sheet.hydrate([node]);
|
|
2867
|
-
}
|
|
2868
|
-
|
|
2869
|
-
sheetRef.current = [sheet, rehydrating];
|
|
2870
|
-
return function () {
|
|
2871
|
-
sheet.flush();
|
|
2872
|
-
};
|
|
2873
|
-
}, [cache]);
|
|
2874
|
-
useInsertionEffectWithLayoutFallback(function () {
|
|
2875
|
-
var sheetRefCurrent = sheetRef.current;
|
|
2876
|
-
var sheet = sheetRefCurrent[0],
|
|
2877
|
-
rehydrating = sheetRefCurrent[1];
|
|
2878
|
-
|
|
2879
|
-
if (rehydrating) {
|
|
2880
|
-
sheetRefCurrent[1] = false;
|
|
2881
|
-
return;
|
|
2882
|
-
}
|
|
2883
|
-
|
|
2884
|
-
if (serialized.next !== undefined) {
|
|
2885
|
-
// insert keyframes
|
|
2886
|
-
insertStyles(cache, serialized.next, true);
|
|
2887
|
-
}
|
|
2888
|
-
|
|
2889
|
-
if (sheet.tags.length) {
|
|
2890
|
-
// if this doesn't exist then it will be null so the style element will be appended
|
|
2891
|
-
var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
|
|
2892
|
-
sheet.before = element;
|
|
2893
|
-
sheet.flush();
|
|
2894
|
-
}
|
|
2441
|
+
/* import type { Interpolation, SerializedStyles } from '@emotion/utils' */
|
|
2895
2442
|
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
});
|
|
2900
|
-
|
|
2901
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2902
|
-
Global.displayName = 'EmotionGlobal';
|
|
2903
|
-
}
|
|
2904
|
-
|
|
2905
|
-
function css$2() {
|
|
2443
|
+
function css$2()
|
|
2444
|
+
/*: SerializedStyles */
|
|
2445
|
+
{
|
|
2906
2446
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2907
2447
|
args[_key] = arguments[_key];
|
|
2908
2448
|
}
|
|
@@ -2910,10 +2450,20 @@ function css$2() {
|
|
|
2910
2450
|
return serializeStyles(args);
|
|
2911
2451
|
}
|
|
2912
2452
|
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2453
|
+
/*
|
|
2454
|
+
type Keyframes = {|
|
|
2455
|
+
name: string,
|
|
2456
|
+
styles: string,
|
|
2457
|
+
anim: 1,
|
|
2458
|
+
toString: () => string
|
|
2459
|
+
|} & string
|
|
2460
|
+
*/
|
|
2916
2461
|
|
|
2462
|
+
var keyframes = function
|
|
2463
|
+
/*: Keyframes */
|
|
2464
|
+
keyframes() {
|
|
2465
|
+
var insertable = css$2.apply(void 0, arguments);
|
|
2466
|
+
var name = "animation-" + insertable.name;
|
|
2917
2467
|
return {
|
|
2918
2468
|
name: name,
|
|
2919
2469
|
styles: "@keyframes " + name + "{" + insertable.styles + "}",
|
|
@@ -2924,169 +2474,6 @@ var keyframes = function keyframes() {
|
|
|
2924
2474
|
};
|
|
2925
2475
|
};
|
|
2926
2476
|
|
|
2927
|
-
var classnames = function classnames(args) {
|
|
2928
|
-
var len = args.length;
|
|
2929
|
-
var i = 0;
|
|
2930
|
-
var cls = '';
|
|
2931
|
-
|
|
2932
|
-
for (; i < len; i++) {
|
|
2933
|
-
var arg = args[i];
|
|
2934
|
-
if (arg == null) continue;
|
|
2935
|
-
var toAdd = void 0;
|
|
2936
|
-
|
|
2937
|
-
switch (typeof arg) {
|
|
2938
|
-
case 'boolean':
|
|
2939
|
-
break;
|
|
2940
|
-
|
|
2941
|
-
case 'object':
|
|
2942
|
-
{
|
|
2943
|
-
if (Array.isArray(arg)) {
|
|
2944
|
-
toAdd = classnames(arg);
|
|
2945
|
-
} else {
|
|
2946
|
-
if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {
|
|
2947
|
-
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.');
|
|
2948
|
-
}
|
|
2949
|
-
|
|
2950
|
-
toAdd = '';
|
|
2951
|
-
|
|
2952
|
-
for (var k in arg) {
|
|
2953
|
-
if (arg[k] && k) {
|
|
2954
|
-
toAdd && (toAdd += ' ');
|
|
2955
|
-
toAdd += k;
|
|
2956
|
-
}
|
|
2957
|
-
}
|
|
2958
|
-
}
|
|
2959
|
-
|
|
2960
|
-
break;
|
|
2961
|
-
}
|
|
2962
|
-
|
|
2963
|
-
default:
|
|
2964
|
-
{
|
|
2965
|
-
toAdd = arg;
|
|
2966
|
-
}
|
|
2967
|
-
}
|
|
2968
|
-
|
|
2969
|
-
if (toAdd) {
|
|
2970
|
-
cls && (cls += ' ');
|
|
2971
|
-
cls += toAdd;
|
|
2972
|
-
}
|
|
2973
|
-
}
|
|
2974
|
-
|
|
2975
|
-
return cls;
|
|
2976
|
-
};
|
|
2977
|
-
|
|
2978
|
-
function merge(registered, css, className) {
|
|
2979
|
-
var registeredStyles = [];
|
|
2980
|
-
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
|
|
2981
|
-
|
|
2982
|
-
if (registeredStyles.length < 2) {
|
|
2983
|
-
return className;
|
|
2984
|
-
}
|
|
2985
|
-
|
|
2986
|
-
return rawClassName + css(registeredStyles);
|
|
2987
|
-
}
|
|
2988
|
-
|
|
2989
|
-
var Insertion = function Insertion(_ref) {
|
|
2990
|
-
var cache = _ref.cache,
|
|
2991
|
-
serializedArr = _ref.serializedArr;
|
|
2992
|
-
var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
|
|
2993
|
-
var rules = '';
|
|
2994
|
-
|
|
2995
|
-
for (var i = 0; i < serializedArr.length; i++) {
|
|
2996
|
-
var res = insertStyles(cache, serializedArr[i], false);
|
|
2997
|
-
|
|
2998
|
-
if (!isBrowser$1 && res !== undefined) {
|
|
2999
|
-
rules += res;
|
|
3000
|
-
}
|
|
3001
|
-
}
|
|
3002
|
-
|
|
3003
|
-
if (!isBrowser$1) {
|
|
3004
|
-
return rules;
|
|
3005
|
-
}
|
|
3006
|
-
});
|
|
3007
|
-
|
|
3008
|
-
if (!isBrowser$1 && rules.length !== 0) {
|
|
3009
|
-
var _ref2;
|
|
3010
|
-
|
|
3011
|
-
return /*#__PURE__*/React__namespace.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedArr.map(function (serialized) {
|
|
3012
|
-
return serialized.name;
|
|
3013
|
-
}).join(' '), _ref2.dangerouslySetInnerHTML = {
|
|
3014
|
-
__html: rules
|
|
3015
|
-
}, _ref2.nonce = cache.sheet.nonce, _ref2));
|
|
3016
|
-
}
|
|
3017
|
-
|
|
3018
|
-
return null;
|
|
3019
|
-
};
|
|
3020
|
-
|
|
3021
|
-
var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
3022
|
-
var hasRendered = false;
|
|
3023
|
-
var serializedArr = [];
|
|
3024
|
-
|
|
3025
|
-
var css = function css() {
|
|
3026
|
-
if (hasRendered && process.env.NODE_ENV !== 'production') {
|
|
3027
|
-
throw new Error('css can only be used during render');
|
|
3028
|
-
}
|
|
3029
|
-
|
|
3030
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3031
|
-
args[_key] = arguments[_key];
|
|
3032
|
-
}
|
|
3033
|
-
|
|
3034
|
-
var serialized = serializeStyles(args, cache.registered);
|
|
3035
|
-
serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`
|
|
3036
|
-
|
|
3037
|
-
registerStyles(cache, serialized, false);
|
|
3038
|
-
return cache.key + "-" + serialized.name;
|
|
3039
|
-
};
|
|
3040
|
-
|
|
3041
|
-
var cx = function cx() {
|
|
3042
|
-
if (hasRendered && process.env.NODE_ENV !== 'production') {
|
|
3043
|
-
throw new Error('cx can only be used during render');
|
|
3044
|
-
}
|
|
3045
|
-
|
|
3046
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
3047
|
-
args[_key2] = arguments[_key2];
|
|
3048
|
-
}
|
|
3049
|
-
|
|
3050
|
-
return merge(cache.registered, css, classnames(args));
|
|
3051
|
-
};
|
|
3052
|
-
|
|
3053
|
-
var content = {
|
|
3054
|
-
css: css,
|
|
3055
|
-
cx: cx,
|
|
3056
|
-
theme: React__namespace.useContext(ThemeContext)
|
|
3057
|
-
};
|
|
3058
|
-
var ele = props.children(content);
|
|
3059
|
-
hasRendered = true;
|
|
3060
|
-
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Insertion, {
|
|
3061
|
-
cache: cache,
|
|
3062
|
-
serializedArr: serializedArr
|
|
3063
|
-
}), ele);
|
|
3064
|
-
});
|
|
3065
|
-
|
|
3066
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3067
|
-
ClassNames.displayName = 'EmotionClassNames';
|
|
3068
|
-
}
|
|
3069
|
-
|
|
3070
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3071
|
-
var isBrowser = typeof document !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked
|
|
3072
|
-
|
|
3073
|
-
var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined';
|
|
3074
|
-
|
|
3075
|
-
if (isBrowser && !isTestEnv) {
|
|
3076
|
-
// globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later
|
|
3077
|
-
var globalContext = // $FlowIgnore
|
|
3078
|
-
typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef
|
|
3079
|
-
: isBrowser ? window : global;
|
|
3080
|
-
var globalKey = "__EMOTION_REACT_" + pkg.version.split('.')[0] + "__";
|
|
3081
|
-
|
|
3082
|
-
if (globalContext[globalKey]) {
|
|
3083
|
-
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.');
|
|
3084
|
-
}
|
|
3085
|
-
|
|
3086
|
-
globalContext[globalKey] = true;
|
|
3087
|
-
}
|
|
3088
|
-
}
|
|
3089
|
-
|
|
3090
2477
|
function _arrayWithHoles(r) {
|
|
3091
2478
|
if (Array.isArray(r)) return r;
|
|
3092
2479
|
}
|