@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.
Files changed (255) hide show
  1. package/dist/{Accordion-DF2lqrVA.js → Accordion-uWRXripc.js} +2 -2
  2. package/dist/{Avatar-DLNS2LBo.js → Avatar-APOOlMd3.js} +2 -2
  3. package/dist/{Badge-BBbMdbjo.js → Badge-DtYgQu3L.js} +2 -3
  4. package/dist/{Breadcrumbs-Dz-WcAoT.js → Breadcrumbs-rRMuYnWJ.js} +2 -2
  5. package/dist/{Button-ULZVVxWC.js → Button-DxZUKQ8I.js} +7 -7
  6. package/dist/{Card-DPGgzPuD.js → Card-DEs1Rr88.js} +1 -1
  7. package/dist/{Cell-D9Wa7coO.js → Cell-BJThS4YS.js} +3 -3
  8. package/dist/{Checkbox-i0qZk0sb.js → Checkbox-BmQo6ByV.js} +1 -1
  9. package/dist/{Chips-BdK4kVmq.js → Chips-CBPMHkdw.js} +15 -13
  10. package/dist/{Choice-BT6xwc_a.js → Choice-DVU4k0tu.js} +11 -14
  11. package/dist/{Code-DkWVSDOy.js → Code-1WUXVzfb.js} +0 -1
  12. package/dist/{ContextMenuItem--304_MdY.js → ContextMenuItem-xssbnviQ.js} +2 -2
  13. package/dist/{CookiesWarning-CDlz4Rfl.js → CookiesWarning-Dcon4SS4.js} +3 -3
  14. package/dist/{DatePicker-CAgJ_CIz.js → DatePicker-D9UgOcue.js} +5 -5
  15. package/dist/{Drawer-CgJX3Utw.js → Drawer-DkLkFSmD.js} +3 -3
  16. package/dist/{DropdownItem-Cf5vBgDu.js → DropdownItem-DB5nPIdl.js} +1 -1
  17. package/dist/{Group-C2kJKhWJ.js → Group-DuHn_z2p.js} +1 -2
  18. package/dist/HTMLContent-CgbJTAy4.js +85 -0
  19. package/dist/{Icon-DWnG-4KG.js → Icon-C0gtkmdU.js} +1 -1
  20. package/dist/{InputPassword-BOdsE_Yd.js → InputPassword-D6OLQrVC.js} +2 -4
  21. package/dist/{Label-VHbRKztj.js → Label-0lMH0-AK.js} +4 -4
  22. package/dist/{LanguageSelector-CzIV_gnd.js → LanguageSelector-uOmIj9mJ.js} +1 -1
  23. package/dist/{Loader-YZrWGaNy.js → Loader-DhgIcSY1.js} +2 -3
  24. package/dist/Logo-dRWwDqj-.js +37 -0
  25. package/dist/{Menu-Cd-XlUmJ.js → Menu-9u6BoWRL.js} +1 -1
  26. package/dist/{MenuItem-COZ-C9K2.js → MenuItem-CXxL099U.js} +3 -3
  27. package/dist/{ModalLoader-D17lZhS7.js → ModalLoader-DHOpJqE3.js} +1 -3
  28. package/dist/{NotificationList-C2OCJkY5.js → NotificationList-B48jz206.js} +5 -8
  29. package/dist/{Pagination-QfVqvSbE.js → Pagination-Ch75clod.js} +3 -3
  30. package/dist/{Radio-Ca2-2PPF.js → Radio-CmejVeSJ.js} +2 -3
  31. package/dist/{Response-m-8zeYeD.js → Response-CgE3B1JS.js} +5 -5
  32. package/dist/{SearchResult-DbhHiNmy.js → SearchResult-vA2t-ZGx.js} +4 -4
  33. package/dist/{Segmented-pa7MGnor.js → Segmented-BoROz9LW.js} +3 -2
  34. package/dist/{SiteMenuButton-BwyPO-2_.js → SiteMenuButton-CFPtqh_i.js} +2 -2
  35. package/dist/{Swiper-CL9zCKXE.js → Swiper-CP2ph4S3.js} +20 -5
  36. package/dist/{SwitchField-nmu255b8.js → SwitchField-Cj0B7JdE.js} +3 -3
  37. package/dist/{TabGroup-CK6ndAuh.js → TabGroup-C4CbZgr7.js} +5 -5
  38. package/dist/{Text-CxrzHFN1.js → Text-Dn0X1zxN.js} +1 -2
  39. package/dist/{Textarea-Cie6SPyp.js → Textarea-D3XSuMEm.js} +1 -1
  40. package/dist/{Tile-qiXVUf-t.js → Tile-B2HwgBDH.js} +3 -3
  41. package/dist/{Title-BhJcCgdK.js → Title-BAdU2oW_.js} +1 -1
  42. package/dist/{Tooltip-CpEQOh9v.js → Tooltip-D46EmkZq.js} +4 -4
  43. package/dist/cjs/{Accordion-rCFDAon3.js → Accordion-OI5oLjJY.js} +2 -2
  44. package/dist/cjs/{Avatar-Bj5BiStx.js → Avatar-BBAt1cKM.js} +2 -2
  45. package/dist/cjs/{Badge-D7W3B9G5.js → Badge-Cn73E3GI.js} +2 -3
  46. package/dist/cjs/{Breadcrumbs-xj-c6cUH.js → Breadcrumbs-DLTpOh1T.js} +2 -2
  47. package/dist/cjs/{Button-DfUQ11Hs.js → Button-C-K_KVjd.js} +6 -6
  48. package/dist/cjs/{Card--te6xVsm.js → Card-D9Eh3qLN.js} +1 -1
  49. package/dist/cjs/{Cell-DEBk3Rbp.js → Cell-DpzvSs16.js} +3 -3
  50. package/dist/cjs/{Checkbox-BIvndDsy.js → Checkbox-BE9LWRTC.js} +1 -1
  51. package/dist/cjs/{Chips-i7zrI9aU.js → Chips-cdORW7eM.js} +15 -13
  52. package/dist/cjs/{Choice-Cm_1ke3H.js → Choice-nMRlWkpF.js} +11 -14
  53. package/dist/cjs/{Code-ByEr4h2R.js → Code-BJFoJBYh.js} +0 -1
  54. package/dist/cjs/{ContextMenuItem-D6dUiYw7.js → ContextMenuItem-D2wjhhzg.js} +2 -2
  55. package/dist/cjs/{CookiesWarning-BfkNifW2.js → CookiesWarning--Edz7Gcv.js} +3 -3
  56. package/dist/cjs/{DatePicker-e4-8mC1N.js → DatePicker-vgeb1SWe.js} +5 -5
  57. package/dist/cjs/{Drawer-BGZBaR2Q.js → Drawer-AQqI18ra.js} +3 -3
  58. package/dist/cjs/{DropdownItem-BhpFr7Z0.js → DropdownItem-CCuDjUjH.js} +1 -1
  59. package/dist/cjs/{Group-C9BxTKs-.js → Group-CtseVj34.js} +1 -2
  60. package/dist/cjs/HTMLContent-4vI2pdQC.js +91 -0
  61. package/dist/cjs/{Icon-2rv_L0yY.js → Icon-BUwWk_dS.js} +1 -1
  62. package/dist/cjs/{InputPassword-BXCwerW2.js → InputPassword-BqbSnWDE.js} +2 -4
  63. package/dist/cjs/{Label-EFoxH21m.js → Label-Bc4u2NRI.js} +3 -3
  64. package/dist/cjs/{LanguageSelector-CFKki1Sr.js → LanguageSelector-BswZL8dZ.js} +1 -1
  65. package/dist/cjs/{Loader-2vQxF_aO.js → Loader-2CPNhu-4.js} +2 -3
  66. package/dist/cjs/Logo-BjDQjs3w.js +44 -0
  67. package/dist/cjs/{Menu-rXCCn52A.js → Menu-Bn0hqLr-.js} +1 -1
  68. package/dist/cjs/{MenuItem-C__OMtEI.js → MenuItem-C-0vQBaj.js} +2 -2
  69. package/dist/cjs/{ModalLoader-Cddzca-W.js → ModalLoader-DJWtjEvf.js} +1 -3
  70. package/dist/cjs/{NotificationList-CKd0PxLU.js → NotificationList-D7rD4PAW.js} +5 -8
  71. package/dist/cjs/{Pagination-D6thfJMP.js → Pagination-XAVYtca1.js} +3 -3
  72. package/dist/cjs/{Radio-Cvbuwkx3.js → Radio-BH3uHZDb.js} +2 -3
  73. package/dist/cjs/{Response-CwdUpO-8.js → Response-BmR09awR.js} +5 -5
  74. package/dist/cjs/{SearchResult-BnIZD8lL.js → SearchResult-gHEwq0ay.js} +3 -3
  75. package/dist/cjs/{Segmented-BHblcvck.js → Segmented-BtzSR0xB.js} +3 -2
  76. package/dist/cjs/{SiteMenuButton-B2wBLVOJ.js → SiteMenuButton-B6QISdea.js} +2 -2
  77. package/dist/cjs/{Swiper-DrXdHybn.js → Swiper--idB5Ci6.js} +20 -5
  78. package/dist/cjs/{SwitchField-B0N-28Ne.js → SwitchField-CCHC2ZHS.js} +3 -3
  79. package/dist/cjs/{TabGroup-BCw7IKuz.js → TabGroup-CYaefMap.js} +4 -4
  80. package/dist/cjs/{Text-C8vlKWNN.js → Text-D2YDVhGJ.js} +1 -2
  81. package/dist/cjs/{Textarea-WIGhhrgu.js → Textarea-tng0D_n7.js} +1 -1
  82. package/dist/cjs/{Tile-2VY0LzsE.js → Tile-By9iqne7.js} +3 -3
  83. package/dist/cjs/{Title-DZn77tSl.js → Title-BzopkHQY.js} +1 -1
  84. package/dist/cjs/{Tooltip-DRsL77n1.js → Tooltip-VrKQ8W1G.js} +3 -3
  85. package/dist/cjs/components/Accordion.js +5 -5
  86. package/dist/cjs/components/Avatar.js +5 -5
  87. package/dist/cjs/components/Badge.js +2 -2
  88. package/dist/cjs/components/Breadcrumbs.js +5 -5
  89. package/dist/cjs/components/Button/Button.interface.d.ts +1 -0
  90. package/dist/cjs/components/Button.js +6 -6
  91. package/dist/cjs/components/Card.js +2 -2
  92. package/dist/cjs/components/Cell.js +6 -6
  93. package/dist/cjs/components/Checkbox/Checkbox.interface.d.ts +3 -3
  94. package/dist/cjs/components/Checkbox.js +2 -2
  95. package/dist/cjs/components/Chips/Chips.d.ts +3 -8
  96. package/dist/cjs/components/Chips/Chips.interface.d.ts +12 -13
  97. package/dist/cjs/components/Chips.js +2 -2
  98. package/dist/cjs/components/Choice/Choice.d.ts +3 -3
  99. package/dist/cjs/components/Choice/Choice.interface.d.ts +14 -14
  100. package/dist/cjs/components/Choice.js +6 -5
  101. package/dist/cjs/components/Code/Code.d.ts +0 -1
  102. package/dist/cjs/components/Code.js +1 -1
  103. package/dist/cjs/components/ContextMenu.js +5 -5
  104. package/dist/cjs/components/CookiesWarning.js +8 -8
  105. package/dist/cjs/components/DatePicker.js +9 -9
  106. package/dist/cjs/components/Drawer/Drawer.d.ts +2 -2
  107. package/dist/cjs/components/Drawer/Drawer.interface.d.ts +6 -6
  108. package/dist/cjs/components/Drawer.js +1 -1
  109. package/dist/cjs/components/Dropdown.js +2 -2
  110. package/dist/cjs/components/FormField.js +9 -9
  111. package/dist/cjs/components/Group/Group.interface.d.ts +3 -3
  112. package/dist/cjs/components/Group.js +1 -1
  113. package/dist/cjs/components/HTMLContent/HTMLContent.d.ts +3 -0
  114. package/dist/cjs/components/HTMLContent/HTMLContent.interface.d.ts +30 -0
  115. package/dist/cjs/components/HTMLContent/index.d.ts +1 -0
  116. package/dist/cjs/components/HTMLContent.js +21 -0
  117. package/dist/cjs/components/Icon.js +4 -4
  118. package/dist/cjs/components/Input/Input.interface.d.ts +4 -4
  119. package/dist/cjs/components/InputMask.js +1 -1
  120. package/dist/cjs/components/InputPassword.js +5 -5
  121. package/dist/cjs/components/Label.js +4 -4
  122. package/dist/cjs/components/LanguageSelector.js +5 -5
  123. package/dist/cjs/components/Loader.js +2 -2
  124. package/dist/cjs/components/Logo/Logo.d.ts +3 -2
  125. package/dist/cjs/components/Logo/Logo.interface.d.ts +16 -2
  126. package/dist/cjs/components/Logo/index.d.ts +1 -1
  127. package/dist/cjs/components/Logo.js +4 -3
  128. package/dist/cjs/components/Menu.js +3 -3
  129. package/dist/cjs/components/MenuItem.js +2 -2
  130. package/dist/cjs/components/Modal.js +3 -3
  131. package/dist/cjs/components/Notification.js +3 -3
  132. package/dist/cjs/components/Pagination.js +6 -6
  133. package/dist/cjs/components/Panel/Panel.interface.d.ts +3 -3
  134. package/dist/cjs/components/Panel.js +4 -4
  135. package/dist/cjs/components/Radio.js +2 -2
  136. package/dist/cjs/components/Response.js +8 -8
  137. package/dist/cjs/components/SVGContent/SVGContent.d.ts +3 -0
  138. package/dist/cjs/components/SVGContent/SVGContent.interface.d.ts +11 -0
  139. package/dist/cjs/components/SVGContent/index.d.ts +1 -0
  140. package/dist/cjs/components/SVGContent.js +37 -0
  141. package/dist/cjs/components/Search.js +5 -5
  142. package/dist/cjs/components/Segmented.js +2 -2
  143. package/dist/cjs/components/Select.js +223 -836
  144. package/dist/cjs/components/SiteMenu.js +5 -5
  145. package/dist/cjs/components/Swiper.js +2 -2
  146. package/dist/cjs/components/Tab/Tab.d.ts +3 -3
  147. package/dist/cjs/components/Tab/Tab.interface.d.ts +20 -21
  148. package/dist/cjs/components/Tab/TabGroup.d.ts +2 -2
  149. package/dist/cjs/components/Tab.js +3 -3
  150. package/dist/cjs/components/Text/Text.d.ts +3 -3
  151. package/dist/cjs/components/Text/Text.interface.d.ts +27 -28
  152. package/dist/cjs/components/Text.js +1 -1
  153. package/dist/cjs/components/Textarea.js +1 -1
  154. package/dist/cjs/components/Tile.js +4 -4
  155. package/dist/cjs/components/Title/Title.interface.d.ts +3 -3
  156. package/dist/cjs/components/Title.js +1 -1
  157. package/dist/cjs/components/Tooltip.js +3 -3
  158. package/dist/cjs/components/index.d.ts +2 -1
  159. package/dist/cjs/components.js +45 -42
  160. package/dist/cjs/{floating-ui.dom-D1St6qnn.js → floating-ui.dom-ma2MDAMT.js} +4 -5
  161. package/dist/cjs/types/componentProps/appearanceKeys.d.ts +1 -1
  162. package/dist/cjs/types/componentProps/fill.d.ts +1 -1
  163. package/dist/cjs/types/componentProps/fillHover.d.ts +1 -1
  164. package/dist/cjs/types/componentProps/textColor.d.ts +1 -1
  165. package/dist/cjs/types/componentProps/textColorActive.d.ts +2 -1
  166. package/dist/components/Accordion.js +5 -5
  167. package/dist/components/Avatar.js +5 -5
  168. package/dist/components/Badge.js +2 -2
  169. package/dist/components/Breadcrumbs.js +5 -5
  170. package/dist/components/Button/Button.interface.d.ts +1 -0
  171. package/dist/components/Button.js +6 -6
  172. package/dist/components/Card.js +2 -2
  173. package/dist/components/Cell.js +6 -6
  174. package/dist/components/Checkbox/Checkbox.interface.d.ts +3 -3
  175. package/dist/components/Checkbox.js +2 -2
  176. package/dist/components/Chips/Chips.d.ts +3 -8
  177. package/dist/components/Chips/Chips.interface.d.ts +12 -13
  178. package/dist/components/Chips.js +2 -2
  179. package/dist/components/Choice/Choice.d.ts +3 -3
  180. package/dist/components/Choice/Choice.interface.d.ts +14 -14
  181. package/dist/components/Choice.js +6 -5
  182. package/dist/components/Code/Code.d.ts +0 -1
  183. package/dist/components/Code.js +1 -1
  184. package/dist/components/ContextMenu.js +5 -5
  185. package/dist/components/CookiesWarning.js +8 -8
  186. package/dist/components/DatePicker.js +9 -9
  187. package/dist/components/Drawer/Drawer.d.ts +2 -2
  188. package/dist/components/Drawer/Drawer.interface.d.ts +6 -6
  189. package/dist/components/Drawer.js +1 -1
  190. package/dist/components/Dropdown.js +2 -2
  191. package/dist/components/FormField.js +9 -9
  192. package/dist/components/Group/Group.interface.d.ts +3 -3
  193. package/dist/components/Group.js +1 -1
  194. package/dist/components/HTMLContent/HTMLContent.d.ts +3 -0
  195. package/dist/components/HTMLContent/HTMLContent.interface.d.ts +30 -0
  196. package/dist/components/HTMLContent/index.d.ts +1 -0
  197. package/dist/components/HTMLContent.js +15 -0
  198. package/dist/components/Icon.js +4 -4
  199. package/dist/components/Input/Input.interface.d.ts +4 -4
  200. package/dist/components/InputMask.js +1 -1
  201. package/dist/components/InputPassword.js +5 -5
  202. package/dist/components/Label.js +4 -4
  203. package/dist/components/LanguageSelector.js +5 -5
  204. package/dist/components/Loader.js +2 -2
  205. package/dist/components/Logo/Logo.d.ts +3 -2
  206. package/dist/components/Logo/Logo.interface.d.ts +16 -2
  207. package/dist/components/Logo/index.d.ts +1 -1
  208. package/dist/components/Logo.js +3 -3
  209. package/dist/components/Menu.js +3 -3
  210. package/dist/components/MenuItem.js +2 -2
  211. package/dist/components/Modal.js +3 -3
  212. package/dist/components/Notification.js +3 -3
  213. package/dist/components/Pagination.js +6 -6
  214. package/dist/components/Panel/Panel.interface.d.ts +3 -3
  215. package/dist/components/Panel.js +4 -4
  216. package/dist/components/Radio.js +2 -2
  217. package/dist/components/Response.js +8 -8
  218. package/dist/components/SVGContent/SVGContent.d.ts +3 -0
  219. package/dist/components/SVGContent/SVGContent.interface.d.ts +11 -0
  220. package/dist/components/SVGContent/index.d.ts +1 -0
  221. package/dist/components/SVGContent.js +31 -0
  222. package/dist/components/Search.js +5 -5
  223. package/dist/components/Segmented.js +2 -2
  224. package/dist/components/Select.js +223 -836
  225. package/dist/components/SiteMenu.js +5 -5
  226. package/dist/components/Swiper.js +2 -2
  227. package/dist/components/Tab/Tab.d.ts +3 -3
  228. package/dist/components/Tab/Tab.interface.d.ts +20 -21
  229. package/dist/components/Tab/TabGroup.d.ts +2 -2
  230. package/dist/components/Tab.js +3 -3
  231. package/dist/components/Text/Text.d.ts +3 -3
  232. package/dist/components/Text/Text.interface.d.ts +27 -28
  233. package/dist/components/Text.js +1 -1
  234. package/dist/components/Textarea.js +1 -1
  235. package/dist/components/Tile.js +4 -4
  236. package/dist/components/Title/Title.interface.d.ts +3 -3
  237. package/dist/components/Title.js +1 -1
  238. package/dist/components/Tooltip.js +3 -3
  239. package/dist/components/index.d.ts +2 -1
  240. package/dist/components.js +43 -42
  241. package/dist/css/components/Accordion/Accordion.css +8 -8
  242. package/dist/css/components/Code/Code.css +4 -0
  243. package/dist/css/components/HTMLContent/HTMLContent.css +98 -0
  244. package/dist/css/components/RangeSlider/RangeSlider.css +1 -0
  245. package/dist/css/components/SVGContent/SVGContent.css +2 -0
  246. package/dist/css/components/Swiper/Swiper.css +2 -2
  247. package/dist/{floating-ui.dom-_PBQLJcF.js → floating-ui.dom-BV5qw-HP.js} +4 -5
  248. package/dist/types/componentProps/appearanceKeys.d.ts +1 -1
  249. package/dist/types/componentProps/fill.d.ts +1 -1
  250. package/dist/types/componentProps/fillHover.d.ts +1 -1
  251. package/dist/types/componentProps/textColor.d.ts +1 -1
  252. package/dist/types/componentProps/textColorActive.d.ts +2 -1
  253. package/package.json +16 -31
  254. package/dist/Logo-D4NFjeqd.js +0 -30
  255. package/dist/cjs/Logo-CcEF4P2z.js +0 -36
@@ -2,14 +2,14 @@ import * as React from 'react';
2
2
  import React__default, { forwardRef, useContext, useLayoutEffect, useEffect, useRef, useState, createContext, useMemo, useCallback, Component, Fragment } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import Select$1, { components as components$1 } from 'react-select';
5
- import { I as Icon } from '../Icon-DWnG-4KG.js';
5
+ import { I as Icon } from '../Icon-C0gtkmdU.js';
6
6
  import clsx from 'clsx';
7
7
  import { createPortal } from 'react-dom';
8
- import { a as autoUpdate } from '../floating-ui.dom-_PBQLJcF.js';
8
+ import { a as autoUpdate } from '../floating-ui.dom-BV5qw-HP.js';
9
9
  import { useDeviceTargetClass } from '../hooks/useDeviceTargetClass.js';
10
- import { T as Text } from '../Text-CxrzHFN1.js';
11
- import { B as Badge } from '../Badge-BBbMdbjo.js';
12
- import { G as Group$2 } from '../Group-C2kJKhWJ.js';
10
+ import { T as Text } from '../Text-Dn0X1zxN.js';
11
+ import { B as Badge } from '../Badge-DtYgQu3L.js';
12
+ import { G as Group$2 } from '../Group-DuHn_z2p.js';
13
13
  import { D as Divider } from '../Divider-Dhj6sMWd.js';
14
14
  import '../_tslib-S-VPg1Cw.js';
15
15
  import '../jsx-runtime-C2uP7l8s.js';
@@ -23,8 +23,8 @@ import '../context/UIContext.js';
23
23
  import '../hooks/useMediaQueries.js';
24
24
  import 'react-responsive';
25
25
  import '../Link-Co6uspFK.js';
26
- import '../Tooltip-CpEQOh9v.js';
27
- import '../Title-BhJcCgdK.js';
26
+ import '../Tooltip-D46EmkZq.js';
27
+ import '../Title-BAdU2oW_.js';
28
28
  import 'lodash/castArray';
29
29
 
30
30
  // For use memo need to check "ClearIndicator" props
@@ -267,6 +267,8 @@ function _toConsumableArray(r) {
267
267
  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
268
268
  }
269
269
 
270
+ var isDevelopment$2 = false;
271
+
270
272
  /*
271
273
 
272
274
  Based off glamor's StyleSheet, thanks Sunil ❤️
@@ -289,10 +291,9 @@ styleSheet.flush()
289
291
  - empties the stylesheet of all its contents
290
292
 
291
293
  */
292
- // $FlowFixMe
294
+
293
295
  function sheetForTag(tag) {
294
296
  if (tag.sheet) {
295
- // $FlowFixMe
296
297
  return tag.sheet;
297
298
  } // this weirdness brought to you by firefox
298
299
 
@@ -301,10 +302,13 @@ function sheetForTag(tag) {
301
302
 
302
303
  for (var i = 0; i < document.styleSheets.length; i++) {
303
304
  if (document.styleSheets[i].ownerNode === tag) {
304
- // $FlowFixMe
305
305
  return document.styleSheets[i];
306
306
  }
307
- }
307
+ } // this function should always return with a value
308
+ // TS can't understand it though so we make it stop complaining here
309
+
310
+
311
+ return undefined;
308
312
  }
309
313
 
310
314
  function createStyleElement(options) {
@@ -345,7 +349,7 @@ var StyleSheet = /*#__PURE__*/function () {
345
349
  _this.tags.push(tag);
346
350
  };
347
351
 
348
- this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;
352
+ this.isSpeedy = options.speedy === undefined ? !isDevelopment$2 : options.speedy;
349
353
  this.tags = [];
350
354
  this.ctr = 0;
351
355
  this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
@@ -373,18 +377,6 @@ var StyleSheet = /*#__PURE__*/function () {
373
377
 
374
378
  var tag = this.tags[this.tags.length - 1];
375
379
 
376
- if (process.env.NODE_ENV !== 'production') {
377
- var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
378
-
379
- if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
380
- // this would only cause problem in speedy mode
381
- // but we don't want enabling speedy to affect the observable behavior
382
- // so we report this error at all times
383
- 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.');
384
- }
385
- this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
386
- }
387
-
388
380
  if (this.isSpeedy) {
389
381
  var sheet = sheetForTag(tag);
390
382
 
@@ -393,9 +385,6 @@ var StyleSheet = /*#__PURE__*/function () {
393
385
  // the big drawback is that the css won't be editable in devtools
394
386
  sheet.insertRule(rule, sheet.cssRules.length);
395
387
  } catch (e) {
396
- 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)) {
397
- console.error("There was a problem inserting the following rule: \"" + rule + "\"", e);
398
- }
399
388
  }
400
389
  } else {
401
390
  tag.appendChild(document.createTextNode(rule));
@@ -405,16 +394,13 @@ var StyleSheet = /*#__PURE__*/function () {
405
394
  };
406
395
 
407
396
  _proto.flush = function flush() {
408
- // $FlowFixMe
409
397
  this.tags.forEach(function (tag) {
410
- return tag.parentNode && tag.parentNode.removeChild(tag);
398
+ var _tag$parentNode;
399
+
400
+ return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
411
401
  });
412
402
  this.tags = [];
413
403
  this.ctr = 0;
414
-
415
- if (process.env.NODE_ENV !== 'production') {
416
- this._alreadyInsertedOrderInsensitiveRule = false;
417
- }
418
404
  };
419
405
 
420
406
  return StyleSheet;
@@ -1019,11 +1005,11 @@ function rulesheet (callback) {
1019
1005
  }
1020
1006
 
1021
1007
  var weakMemoize = function weakMemoize(func) {
1022
- // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
1023
1008
  var cache = new WeakMap();
1024
1009
  return function (arg) {
1025
1010
  if (cache.has(arg)) {
1026
- // $FlowFixMe
1011
+ // Use non-null assertion because we just checked that the cache `has` it
1012
+ // This allows us to remove `undefined` from the return value
1027
1013
  return cache.get(arg);
1028
1014
  }
1029
1015
 
@@ -1041,6 +1027,8 @@ function memoize(fn) {
1041
1027
  };
1042
1028
  }
1043
1029
 
1030
+ var isBrowser$3 = typeof document !== 'undefined';
1031
+
1044
1032
  var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
1045
1033
  var previous = 0;
1046
1034
  var character = 0;
@@ -1165,114 +1153,6 @@ var removeLabel = function removeLabel(element) {
1165
1153
  }
1166
1154
  }
1167
1155
  };
1168
- var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
1169
-
1170
- var isIgnoringComment = function isIgnoringComment(element) {
1171
- return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
1172
- };
1173
-
1174
- var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
1175
- return function (element, index, children) {
1176
- if (element.type !== 'rule' || cache.compat) return;
1177
- var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
1178
-
1179
- if (unsafePseudoClasses) {
1180
- var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent`
1181
- //
1182
- // considering this input:
1183
- // .a {
1184
- // .b /* comm */ {}
1185
- // color: hotpink;
1186
- // }
1187
- // we get output corresponding to this:
1188
- // .a {
1189
- // & {
1190
- // /* comm */
1191
- // color: hotpink;
1192
- // }
1193
- // .b {}
1194
- // }
1195
-
1196
- var commentContainer = isNested ? element.parent.children : // global rule at the root level
1197
- children;
1198
-
1199
- for (var i = commentContainer.length - 1; i >= 0; i--) {
1200
- var node = commentContainer[i];
1201
-
1202
- if (node.line < element.line) {
1203
- break;
1204
- } // it is quite weird but comments are *usually* put at `column: element.column - 1`
1205
- // so we seek *from the end* for the node that is earlier than the rule's `element` and check that
1206
- // this will also match inputs like this:
1207
- // .a {
1208
- // /* comm */
1209
- // .b {}
1210
- // }
1211
- //
1212
- // but that is fine
1213
- //
1214
- // it would be the easiest to change the placement of the comment to be the first child of the rule:
1215
- // .a {
1216
- // .b { /* comm */ }
1217
- // }
1218
- // with such inputs we wouldn't have to search for the comment at all
1219
- // TODO: consider changing this comment placement in the next major version
1220
-
1221
-
1222
- if (node.column < element.column) {
1223
- if (isIgnoringComment(node)) {
1224
- return;
1225
- }
1226
-
1227
- break;
1228
- }
1229
- }
1230
-
1231
- unsafePseudoClasses.forEach(function (unsafePseudoClass) {
1232
- console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
1233
- });
1234
- }
1235
- };
1236
- };
1237
-
1238
- var isImportRule = function isImportRule(element) {
1239
- return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
1240
- };
1241
-
1242
- var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
1243
- for (var i = index - 1; i >= 0; i--) {
1244
- if (!isImportRule(children[i])) {
1245
- return true;
1246
- }
1247
- }
1248
-
1249
- return false;
1250
- }; // use this to remove incorrect elements from further processing
1251
- // so they don't get handed to the `sheet` (or anything else)
1252
- // as that could potentially lead to additional logs which in turn could be overhelming to the user
1253
-
1254
-
1255
- var nullifyElement = function nullifyElement(element) {
1256
- element.type = '';
1257
- element.value = '';
1258
- element["return"] = '';
1259
- element.children = '';
1260
- element.props = '';
1261
- };
1262
-
1263
- var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
1264
- if (!isImportRule(element)) {
1265
- return;
1266
- }
1267
-
1268
- if (element.parent) {
1269
- 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.");
1270
- nullifyElement(element);
1271
- } else if (isPrependedWithRegularRules(index, children)) {
1272
- console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
1273
- nullifyElement(element);
1274
- }
1275
- };
1276
1156
 
1277
1157
  /* eslint-disable no-fallthrough */
1278
1158
 
@@ -1486,8 +1366,21 @@ var prefixer = function prefixer(element, index, children, callback) {
1486
1366
  }
1487
1367
  };
1488
1368
 
1489
- var isBrowser$4 = typeof document !== 'undefined';
1490
- var getServerStylisCache = isBrowser$4 ? undefined : weakMemoize(function () {
1369
+ /* import type { StylisPlugin } from './types' */
1370
+
1371
+ /*
1372
+ export type Options = {
1373
+ nonce?: string,
1374
+ stylisPlugins?: StylisPlugin[],
1375
+ key: string,
1376
+ container?: HTMLElement,
1377
+ speedy?: boolean,
1378
+ prepend?: boolean,
1379
+ insertionPoint?: HTMLElement
1380
+ }
1381
+ */
1382
+
1383
+ var getServerStylisCache = isBrowser$3 ? undefined : weakMemoize(function () {
1491
1384
  return memoize(function () {
1492
1385
  var cache = {};
1493
1386
  return function (name) {
@@ -1497,20 +1390,22 @@ var getServerStylisCache = isBrowser$4 ? undefined : weakMemoize(function () {
1497
1390
  });
1498
1391
  var defaultStylisPlugins = [prefixer];
1499
1392
 
1500
- var createCache = function createCache(options) {
1393
+ var createCache = function
1394
+ /*: EmotionCache */
1395
+ createCache(options
1396
+ /*: Options */
1397
+ ) {
1501
1398
  var key = options.key;
1502
1399
 
1503
- if (process.env.NODE_ENV !== 'production' && !key) {
1504
- 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.");
1505
- }
1506
-
1507
- if (isBrowser$4 && key === 'css') {
1400
+ if (isBrowser$3 && key === 'css') {
1508
1401
  var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
1509
1402
  // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
1510
1403
  // note this very very intentionally targets all style elements regardless of the key to ensure
1511
1404
  // that creating a cache works inside of render of a React component
1512
1405
 
1513
- Array.prototype.forEach.call(ssrStyles, function (node) {
1406
+ Array.prototype.forEach.call(ssrStyles, function (node
1407
+ /*: HTMLStyleElement */
1408
+ ) {
1514
1409
  // we want to only move elements which have a space in the data-emotion attribute value
1515
1410
  // because that indicates that it is an Emotion 11 server-side rendered style elements
1516
1411
  // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
@@ -1522,6 +1417,7 @@ var createCache = function createCache(options) {
1522
1417
  if (dataEmotionAttribute.indexOf(' ') === -1) {
1523
1418
  return;
1524
1419
  }
1420
+
1525
1421
  document.head.appendChild(node);
1526
1422
  node.setAttribute('data-s', '');
1527
1423
  });
@@ -1529,23 +1425,20 @@ var createCache = function createCache(options) {
1529
1425
 
1530
1426
  var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
1531
1427
 
1532
- if (process.env.NODE_ENV !== 'production') {
1533
- // $FlowFixMe
1534
- if (/[^a-z-]/.test(key)) {
1535
- throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
1536
- }
1537
- }
1538
-
1539
1428
  var inserted = {};
1540
1429
  var container;
1430
+ /* : Node */
1431
+
1541
1432
  var nodesToHydrate = [];
1542
1433
 
1543
- if (isBrowser$4) {
1434
+ if (isBrowser$3) {
1544
1435
  container = options.container || document.head;
1545
1436
  Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
1546
1437
  // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
1547
- document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
1548
- var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe
1438
+ document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node
1439
+ /*: HTMLStyleElement */
1440
+ ) {
1441
+ var attrib = node.getAttribute("data-emotion").split(' ');
1549
1442
 
1550
1443
  for (var i = 1; i < attrib.length; i++) {
1551
1444
  inserted[attrib[i]] = true;
@@ -1556,31 +1449,19 @@ var createCache = function createCache(options) {
1556
1449
  }
1557
1450
 
1558
1451
  var _insert;
1452
+ /*: (
1453
+ selector: string,
1454
+ serialized: SerializedStyles,
1455
+ sheet: StyleSheet,
1456
+ shouldCache: boolean
1457
+ ) => string | void */
1559
1458
 
1560
- var omnipresentPlugins = [compat, removeLabel];
1561
1459
 
1562
- if (process.env.NODE_ENV !== 'production') {
1563
- omnipresentPlugins.push(createUnsafeSelectorsAlarm({
1564
- get compat() {
1565
- return cache.compat;
1566
- }
1567
-
1568
- }), incorrectImportAlarm);
1569
- }
1460
+ var omnipresentPlugins = [compat, removeLabel];
1570
1461
 
1571
- if (isBrowser$4) {
1462
+ if (isBrowser$3) {
1572
1463
  var currentSheet;
1573
- var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {
1574
- if (!element.root) {
1575
- if (element["return"]) {
1576
- currentSheet.insert(element["return"]);
1577
- } else if (element.value && element.type !== COMMENT) {
1578
- // insert empty rule in non-production environments
1579
- // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
1580
- currentSheet.insert(element.value + "{}");
1581
- }
1582
- }
1583
- } : rulesheet(function (rule) {
1464
+ var finalizingPlugins = [stringify, rulesheet(function (rule) {
1584
1465
  currentSheet.insert(rule);
1585
1466
  })];
1586
1467
  var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
@@ -1589,17 +1470,19 @@ var createCache = function createCache(options) {
1589
1470
  return serialize(compile(styles), serializer);
1590
1471
  };
1591
1472
 
1592
- _insert = function insert(selector, serialized, sheet, shouldCache) {
1473
+ _insert = function
1474
+ /*: void */
1475
+ insert(selector
1476
+ /*: string */
1477
+ , serialized
1478
+ /*: SerializedStyles */
1479
+ , sheet
1480
+ /*: StyleSheet */
1481
+ , shouldCache
1482
+ /*: boolean */
1483
+ ) {
1593
1484
  currentSheet = sheet;
1594
1485
 
1595
- if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {
1596
- currentSheet = {
1597
- insert: function insert(rule) {
1598
- sheet.insert(rule + serialized.map);
1599
- }
1600
- };
1601
- }
1602
-
1603
1486
  stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
1604
1487
 
1605
1488
  if (shouldCache) {
@@ -1613,12 +1496,17 @@ var createCache = function createCache(options) {
1613
1496
 
1614
1497
  var _stylis = function _stylis(styles) {
1615
1498
  return serialize(compile(styles), _serializer);
1616
- }; // $FlowFixMe
1617
-
1499
+ };
1618
1500
 
1619
1501
  var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
1620
1502
 
1621
- var getRules = function getRules(selector, serialized) {
1503
+ var getRules = function
1504
+ /*: string */
1505
+ getRules(selector
1506
+ /*: string */
1507
+ , serialized
1508
+ /*: SerializedStyles */
1509
+ ) {
1622
1510
  var name = serialized.name;
1623
1511
 
1624
1512
  if (serverStylisCache[name] === undefined) {
@@ -1628,7 +1516,17 @@ var createCache = function createCache(options) {
1628
1516
  return serverStylisCache[name];
1629
1517
  };
1630
1518
 
1631
- _insert = function _insert(selector, serialized, sheet, shouldCache) {
1519
+ _insert = function
1520
+ /*: string | void */
1521
+ _insert(selector
1522
+ /*: string */
1523
+ , serialized
1524
+ /*: SerializedStyles */
1525
+ , sheet
1526
+ /*: StyleSheet */
1527
+ , shouldCache
1528
+ /*: boolean */
1529
+ ) {
1632
1530
  var name = serialized.name;
1633
1531
  var rules = getRules(selector, serialized);
1634
1532
 
@@ -1640,12 +1538,6 @@ var createCache = function createCache(options) {
1640
1538
  cache.inserted[name] = true;
1641
1539
  }
1642
1540
 
1643
- if ( // using === development instead of !== production
1644
- // because if people do ssr in tests, the source maps showing up would be annoying
1645
- process.env.NODE_ENV === 'development' && serialized.map !== undefined) {
1646
- return rules + serialized.map;
1647
- }
1648
-
1649
1541
  return rules;
1650
1542
  } else {
1651
1543
  // in compat mode, we put the styles on the inserted cache so
@@ -1664,7 +1556,9 @@ var createCache = function createCache(options) {
1664
1556
  };
1665
1557
  }
1666
1558
 
1667
- var cache = {
1559
+ var cache
1560
+ /*: EmotionCache */
1561
+ = {
1668
1562
  key: key,
1669
1563
  sheet: new StyleSheet({
1670
1564
  key: key,
@@ -1927,7 +1821,8 @@ var TYPE_STATICS = {};
1927
1821
  TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
1928
1822
  TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
1929
1823
 
1930
- var isBrowser$3 = typeof document !== 'undefined';
1824
+ var isBrowser$2 = typeof document !== 'undefined';
1825
+
1931
1826
  function getRegisteredStyles(registered, registeredStyles, classNames) {
1932
1827
  var rawClassName = '';
1933
1828
  classNames.split(' ').forEach(function (className) {
@@ -1951,7 +1846,7 @@ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
1951
1846
  // in node since emotion-server relies on whether a style is in
1952
1847
  // the registered cache to know whether a style is global or not
1953
1848
  // also, note that this check will be dead code eliminated in the browser
1954
- isBrowser$3 === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
1849
+ isBrowser$2 === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
1955
1850
  cache.registered[className] = serialized.styles;
1956
1851
  }
1957
1852
  };
@@ -1966,14 +1861,14 @@ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
1966
1861
  do {
1967
1862
  var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
1968
1863
 
1969
- if (!isBrowser$3 && maybeStyles !== undefined) {
1864
+ if (!isBrowser$2 && maybeStyles !== undefined) {
1970
1865
  stylesForSSR += maybeStyles;
1971
1866
  }
1972
1867
 
1973
1868
  current = current.next;
1974
1869
  } while (current !== undefined);
1975
1870
 
1976
- if (!isBrowser$3 && stylesForSSR.length !== 0) {
1871
+ if (!isBrowser$2 && stylesForSSR.length !== 0) {
1977
1872
  return stylesForSSR;
1978
1873
  }
1979
1874
  }
@@ -2083,8 +1978,8 @@ var unitlessKeys = {
2083
1978
  strokeWidth: 1
2084
1979
  };
2085
1980
 
2086
- var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
2087
- 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).";
1981
+ var isDevelopment$1 = false;
1982
+
2088
1983
  var hyphenateRegex = /[A-Z]|^ms/g;
2089
1984
  var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
2090
1985
 
@@ -2125,34 +2020,6 @@ var processStyleValue = function processStyleValue(key, value) {
2125
2020
  return value;
2126
2021
  };
2127
2022
 
2128
- if (process.env.NODE_ENV !== 'production') {
2129
- var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
2130
- var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];
2131
- var oldProcessStyleValue = processStyleValue;
2132
- var msPattern = /^-ms-/;
2133
- var hyphenPattern = /-(.)/g;
2134
- var hyphenatedCache = {};
2135
-
2136
- processStyleValue = function processStyleValue(key, value) {
2137
- if (key === 'content') {
2138
- 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) !== "'")) {
2139
- throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
2140
- }
2141
- }
2142
-
2143
- var processed = oldProcessStyleValue(key, value);
2144
-
2145
- if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {
2146
- hyphenatedCache[key] = true;
2147
- 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) {
2148
- return _char.toUpperCase();
2149
- }) + "?");
2150
- }
2151
-
2152
- return processed;
2153
- };
2154
- }
2155
-
2156
2023
  var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';
2157
2024
 
2158
2025
  function handleInterpolation(mergedProps, registered, interpolation) {
@@ -2160,12 +2027,11 @@ function handleInterpolation(mergedProps, registered, interpolation) {
2160
2027
  return '';
2161
2028
  }
2162
2029
 
2163
- if (interpolation.__emotion_styles !== undefined) {
2164
- if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {
2165
- throw new Error(noComponentSelectorMessage);
2166
- }
2030
+ var componentSelector = interpolation;
2031
+
2032
+ if (componentSelector.__emotion_styles !== undefined) {
2167
2033
 
2168
- return interpolation;
2034
+ return componentSelector;
2169
2035
  }
2170
2036
 
2171
2037
  switch (typeof interpolation) {
@@ -2176,17 +2042,21 @@ function handleInterpolation(mergedProps, registered, interpolation) {
2176
2042
 
2177
2043
  case 'object':
2178
2044
  {
2179
- if (interpolation.anim === 1) {
2045
+ var keyframes = interpolation;
2046
+
2047
+ if (keyframes.anim === 1) {
2180
2048
  cursor = {
2181
- name: interpolation.name,
2182
- styles: interpolation.styles,
2049
+ name: keyframes.name,
2050
+ styles: keyframes.styles,
2183
2051
  next: cursor
2184
2052
  };
2185
- return interpolation.name;
2053
+ return keyframes.name;
2186
2054
  }
2187
2055
 
2188
- if (interpolation.styles !== undefined) {
2189
- var next = interpolation.next;
2056
+ var serializedStyles = interpolation;
2057
+
2058
+ if (serializedStyles.styles !== undefined) {
2059
+ var next = serializedStyles.next;
2190
2060
 
2191
2061
  if (next !== undefined) {
2192
2062
  // not the most efficient thing ever but this is a pretty rare case
@@ -2201,11 +2071,7 @@ function handleInterpolation(mergedProps, registered, interpolation) {
2201
2071
  }
2202
2072
  }
2203
2073
 
2204
- var styles = interpolation.styles + ";";
2205
-
2206
- if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {
2207
- styles += interpolation.map;
2208
- }
2074
+ var styles = serializedStyles.styles + ";";
2209
2075
 
2210
2076
  return styles;
2211
2077
  }
@@ -2220,37 +2086,18 @@ function handleInterpolation(mergedProps, registered, interpolation) {
2220
2086
  var result = interpolation(mergedProps);
2221
2087
  cursor = previousCursor;
2222
2088
  return handleInterpolation(mergedProps, registered, result);
2223
- } else if (process.env.NODE_ENV !== 'production') {
2224
- 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}`");
2225
2089
  }
2226
2090
 
2227
2091
  break;
2228
2092
  }
2229
-
2230
- case 'string':
2231
- if (process.env.NODE_ENV !== 'production') {
2232
- var matched = [];
2233
- var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {
2234
- var fakeVarName = "animation" + matched.length;
2235
- matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`");
2236
- return "${" + fakeVarName + "}";
2237
- });
2238
-
2239
- if (matched.length) {
2240
- 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 + "`"));
2241
- }
2242
- }
2243
-
2244
- break;
2245
2093
  } // finalize string values (regular strings and functions interpolated into css calls)
2246
2094
 
2247
2095
 
2248
- if (registered == null) {
2249
- return interpolation;
2250
- }
2096
+ var asString = interpolation;
2251
2097
 
2252
- var cached = registered[interpolation];
2253
- return cached !== undefined ? cached : interpolation;
2098
+ {
2099
+ return asString;
2100
+ }
2254
2101
  }
2255
2102
 
2256
2103
  function createStringFromObject(mergedProps, registered, obj) {
@@ -2261,44 +2108,41 @@ function createStringFromObject(mergedProps, registered, obj) {
2261
2108
  string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
2262
2109
  }
2263
2110
  } else {
2264
- for (var _key in obj) {
2265
- var value = obj[_key];
2111
+ for (var key in obj) {
2112
+ var value = obj[key];
2266
2113
 
2267
2114
  if (typeof value !== 'object') {
2268
- if (registered != null && registered[value] !== undefined) {
2269
- string += _key + "{" + registered[value] + "}";
2270
- } else if (isProcessableValue(value)) {
2271
- string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
2115
+ var asString = value;
2116
+
2117
+ if (isProcessableValue(asString)) {
2118
+ string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
2272
2119
  }
2273
2120
  } else {
2274
- if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {
2121
+ if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment$1) {
2275
2122
  throw new Error(noComponentSelectorMessage);
2276
2123
  }
2277
2124
 
2278
- if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
2125
+ if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null)) {
2279
2126
  for (var _i = 0; _i < value.length; _i++) {
2280
2127
  if (isProcessableValue(value[_i])) {
2281
- string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
2128
+ string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
2282
2129
  }
2283
2130
  }
2284
2131
  } else {
2285
2132
  var interpolated = handleInterpolation(mergedProps, registered, value);
2286
2133
 
2287
- switch (_key) {
2134
+ switch (key) {
2288
2135
  case 'animation':
2289
2136
  case 'animationName':
2290
2137
  {
2291
- string += processStyleName(_key) + ":" + interpolated + ";";
2138
+ string += processStyleName(key) + ":" + interpolated + ";";
2292
2139
  break;
2293
2140
  }
2294
2141
 
2295
2142
  default:
2296
2143
  {
2297
- if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {
2298
- console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
2299
- }
2300
2144
 
2301
- string += _key + "{" + interpolated + "}";
2145
+ string += key + "{" + interpolated + "}";
2302
2146
  }
2303
2147
  }
2304
2148
  }
@@ -2310,16 +2154,11 @@ function createStringFromObject(mergedProps, registered, obj) {
2310
2154
  }
2311
2155
 
2312
2156
  var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
2313
- var sourceMapPattern;
2314
-
2315
- if (process.env.NODE_ENV !== 'production') {
2316
- sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
2317
- } // this is the cursor for keyframes
2318
2157
  // keyframes are stored on the SerializedStyles object as a linked list
2319
2158
 
2320
2159
 
2321
2160
  var cursor;
2322
- var serializeStyles = function serializeStyles(args, registered, mergedProps) {
2161
+ function serializeStyles(args, registered, mergedProps) {
2323
2162
  if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
2324
2163
  return args[0];
2325
2164
  }
@@ -2333,11 +2172,9 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
2333
2172
  stringMode = false;
2334
2173
  styles += handleInterpolation(mergedProps, registered, strings);
2335
2174
  } else {
2336
- if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {
2337
- console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
2338
- }
2175
+ var asTemplateStringsArr = strings;
2339
2176
 
2340
- styles += strings[0];
2177
+ styles += asTemplateStringsArr[0];
2341
2178
  } // we start at 1 since we've already handled the first arg
2342
2179
 
2343
2180
 
@@ -2345,69 +2182,47 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
2345
2182
  styles += handleInterpolation(mergedProps, registered, args[i]);
2346
2183
 
2347
2184
  if (stringMode) {
2348
- if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {
2349
- console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
2350
- }
2185
+ var templateStringsArr = strings;
2351
2186
 
2352
- styles += strings[i];
2187
+ styles += templateStringsArr[i];
2353
2188
  }
2354
2189
  }
2355
2190
 
2356
- var sourceMap;
2357
-
2358
- if (process.env.NODE_ENV !== 'production') {
2359
- styles = styles.replace(sourceMapPattern, function (match) {
2360
- sourceMap = match;
2361
- return '';
2362
- });
2363
- } // using a global regex with .exec is stateful so lastIndex has to be reset each time
2364
-
2365
2191
 
2366
2192
  labelPattern.lastIndex = 0;
2367
2193
  var identifierName = '';
2368
2194
  var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
2369
2195
 
2370
2196
  while ((match = labelPattern.exec(styles)) !== null) {
2371
- identifierName += '-' + // $FlowFixMe we know it's not null
2372
- match[1];
2197
+ identifierName += '-' + match[1];
2373
2198
  }
2374
2199
 
2375
2200
  var name = murmur2(styles) + identifierName;
2376
2201
 
2377
- if (process.env.NODE_ENV !== 'production') {
2378
- // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)
2379
- return {
2380
- name: name,
2381
- styles: styles,
2382
- map: sourceMap,
2383
- next: cursor,
2384
- toString: function toString() {
2385
- 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).";
2386
- }
2387
- };
2388
- }
2389
-
2390
2202
  return {
2391
2203
  name: name,
2392
2204
  styles: styles,
2393
2205
  next: cursor
2394
2206
  };
2395
- };
2207
+ }
2396
2208
 
2397
- var isBrowser$2 = typeof document !== 'undefined';
2209
+ var isBrowser$1 = typeof document !== 'undefined';
2398
2210
 
2399
2211
  var syncFallback = function syncFallback(create) {
2400
2212
  return create();
2401
2213
  };
2402
2214
 
2403
2215
  var useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;
2404
- var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$2 ? syncFallback : useInsertionEffect || syncFallback;
2405
- var useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;
2216
+ var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$1 ? syncFallback : useInsertionEffect || syncFallback;
2406
2217
 
2407
- var isBrowser$1 = typeof document !== 'undefined';
2408
- var hasOwn = {}.hasOwnProperty;
2218
+ var isDevelopment = false;
2409
2219
 
2410
- var EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
2220
+ var isBrowser = typeof document !== 'undefined';
2221
+
2222
+ /* import { type EmotionCache } from '@emotion/utils' */
2223
+ var EmotionCacheContext
2224
+ /*: React.Context<EmotionCache | null> */
2225
+ = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
2411
2226
  // because this module is primarily intended for the browser and node
2412
2227
  // but it's also required in react native and similar environments sometimes
2413
2228
  // and we could have a special build just for that
@@ -2417,24 +2232,37 @@ typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
2417
2232
  key: 'css'
2418
2233
  }) : null);
2419
2234
 
2420
- if (process.env.NODE_ENV !== 'production') {
2421
- EmotionCacheContext.displayName = 'EmotionCacheContext';
2422
- }
2423
-
2424
2235
  EmotionCacheContext.Provider;
2425
2236
 
2426
- var withEmotionCache = function withEmotionCache(func) {
2427
- // $FlowFixMe
2428
- return /*#__PURE__*/forwardRef(function (props, ref) {
2237
+ var withEmotionCache = function withEmotionCache
2238
+ /* <Props, Ref: React.Ref<*>> */
2239
+ (func
2240
+ /*: (props: Props, cache: EmotionCache, ref: Ref) => React.Node */
2241
+ )
2242
+ /*: React.AbstractComponent<Props> */
2243
+ {
2244
+ return /*#__PURE__*/forwardRef(function (props
2245
+ /*: Props */
2246
+ , ref
2247
+ /*: Ref */
2248
+ ) {
2429
2249
  // the cache will never be null in the browser
2430
2250
  var cache = useContext(EmotionCacheContext);
2431
2251
  return func(props, cache, ref);
2432
2252
  });
2433
2253
  };
2434
2254
 
2435
- if (!isBrowser$1) {
2436
- withEmotionCache = function withEmotionCache(func) {
2437
- return function (props) {
2255
+ if (!isBrowser) {
2256
+ withEmotionCache = function withEmotionCache
2257
+ /* <Props> */
2258
+ (func
2259
+ /*: (props: Props, cache: EmotionCache) => React.Node */
2260
+ )
2261
+ /*: React.StatelessFunctionalComponent<Props> */
2262
+ {
2263
+ return function (props
2264
+ /*: Props */
2265
+ ) {
2438
2266
  var cache = useContext(EmotionCacheContext);
2439
2267
 
2440
2268
  if (cache === null) {
@@ -2458,62 +2286,18 @@ if (!isBrowser$1) {
2458
2286
 
2459
2287
  var ThemeContext = /* #__PURE__ */React.createContext({});
2460
2288
 
2461
- if (process.env.NODE_ENV !== 'production') {
2462
- ThemeContext.displayName = 'EmotionThemeContext';
2463
- }
2464
-
2465
- var getLastPart = function getLastPart(functionName) {
2466
- // The match may be something like 'Object.createEmotionProps' or
2467
- // 'Loader.prototype.render'
2468
- var parts = functionName.split('.');
2469
- return parts[parts.length - 1];
2470
- };
2471
-
2472
- var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {
2473
- // V8
2474
- var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line);
2475
- if (match) return getLastPart(match[1]); // Safari / Firefox
2476
-
2477
- match = /^([A-Za-z0-9$.]+)@/.exec(line);
2478
- if (match) return getLastPart(match[1]);
2479
- return undefined;
2480
- };
2481
-
2482
- var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS
2483
- // identifiers, thus we only need to replace what is a valid character for JS,
2484
- // but not for CSS.
2485
-
2486
- var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
2487
- return identifier.replace(/\$/g, '-');
2488
- };
2489
-
2490
- var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {
2491
- if (!stackTrace) return undefined;
2492
- var lines = stackTrace.split('\n');
2493
-
2494
- for (var i = 0; i < lines.length; i++) {
2495
- var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error"
2496
-
2497
- if (!functionName) continue; // If we reach one of these, we have gone too far and should quit
2498
-
2499
- if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an
2500
- // uppercase letter
2501
-
2502
- if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);
2503
- }
2504
-
2505
- return undefined;
2506
- };
2289
+ var hasOwn = {}.hasOwnProperty;
2507
2290
 
2508
2291
  var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
2509
- var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
2510
- var createEmotionProps = function createEmotionProps(type, props) {
2511
- if (process.env.NODE_ENV !== 'production' && typeof props.css === 'string' && // check if there is a css declaration
2512
- props.css.indexOf(':') !== -1) {
2513
- 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 + "`");
2514
- }
2292
+ var createEmotionProps = function createEmotionProps(type
2293
+ /*: React.ElementType */
2294
+ , props
2295
+ /*: Object */
2296
+ ) {
2515
2297
 
2516
- var newProps = {};
2298
+ var newProps
2299
+ /*: any */
2300
+ = {};
2517
2301
 
2518
2302
  for (var key in props) {
2519
2303
  if (hasOwn.call(props, key)) {
@@ -2521,18 +2305,12 @@ var createEmotionProps = function createEmotionProps(type, props) {
2521
2305
  }
2522
2306
  }
2523
2307
 
2524
- newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when
2525
- // the label hasn't already been computed
2526
-
2527
- if (process.env.NODE_ENV !== 'production' && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {
2528
- var label = getLabelFromStackTrace(new Error().stack);
2529
- if (label) newProps[labelPropName] = label;
2530
- }
2308
+ newProps[typePropName] = type; // Runtime labeling is an opt-in feature because:
2531
2309
 
2532
2310
  return newProps;
2533
2311
  };
2534
2312
 
2535
- var Insertion$1 = function Insertion(_ref) {
2313
+ var Insertion = function Insertion(_ref) {
2536
2314
  var cache = _ref.cache,
2537
2315
  serialized = _ref.serialized,
2538
2316
  isStringTag = _ref.isStringTag;
@@ -2541,7 +2319,7 @@ var Insertion$1 = function Insertion(_ref) {
2541
2319
  return insertStyles(cache, serialized, isStringTag);
2542
2320
  });
2543
2321
 
2544
- if (!isBrowser$1 && rules !== undefined) {
2322
+ if (!isBrowser && rules !== undefined) {
2545
2323
  var _ref2;
2546
2324
 
2547
2325
  var serializedNames = serialized.name;
@@ -2560,7 +2338,9 @@ var Insertion$1 = function Insertion(_ref) {
2560
2338
  return null;
2561
2339
  };
2562
2340
 
2563
- var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
2341
+ var Emotion = /* #__PURE__ */withEmotionCache(
2342
+ /* <any, any> */
2343
+ function (props, cache, ref) {
2564
2344
  var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
2565
2345
  // not passing the registered cache to serializeStyles because it would
2566
2346
  // make certain babel optimisations not possible
@@ -2581,175 +2361,42 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
2581
2361
 
2582
2362
  var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));
2583
2363
 
2584
- if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {
2585
- var labelFromStack = props[labelPropName];
2586
-
2587
- if (labelFromStack) {
2588
- serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);
2589
- }
2590
- }
2591
-
2592
2364
  className += cache.key + "-" + serialized.name;
2593
2365
  var newProps = {};
2594
2366
 
2595
2367
  for (var key in props) {
2596
- if (hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {
2368
+ if (hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (!isDevelopment )) {
2597
2369
  newProps[key] = props[key];
2598
2370
  }
2599
2371
  }
2600
2372
 
2601
- newProps.ref = ref;
2602
2373
  newProps.className = className;
2603
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion$1, {
2374
+
2375
+ if (ref) {
2376
+ newProps.ref = ref;
2377
+ }
2378
+
2379
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
2604
2380
  cache: cache,
2605
2381
  serialized: serialized,
2606
2382
  isStringTag: typeof WrappedComponent === 'string'
2607
2383
  }), /*#__PURE__*/React.createElement(WrappedComponent, newProps));
2608
2384
  });
2609
2385
 
2610
- if (process.env.NODE_ENV !== 'production') {
2611
- Emotion.displayName = 'EmotionCssPropInternal';
2612
- }
2613
-
2614
2386
  var Emotion$1 = Emotion;
2615
2387
 
2616
- var pkg = {
2617
- name: "@emotion/react",
2618
- version: "11.11.4",
2619
- main: "dist/emotion-react.cjs.js",
2620
- module: "dist/emotion-react.esm.js",
2621
- browser: {
2622
- "./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js"
2623
- },
2624
- exports: {
2625
- ".": {
2626
- module: {
2627
- worker: "./dist/emotion-react.worker.esm.js",
2628
- browser: "./dist/emotion-react.browser.esm.js",
2629
- "default": "./dist/emotion-react.esm.js"
2630
- },
2631
- "import": "./dist/emotion-react.cjs.mjs",
2632
- "default": "./dist/emotion-react.cjs.js"
2633
- },
2634
- "./jsx-runtime": {
2635
- module: {
2636
- worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
2637
- browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
2638
- "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
2639
- },
2640
- "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
2641
- "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
2642
- },
2643
- "./_isolated-hnrs": {
2644
- module: {
2645
- worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
2646
- browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
2647
- "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
2648
- },
2649
- "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
2650
- "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
2651
- },
2652
- "./jsx-dev-runtime": {
2653
- module: {
2654
- worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
2655
- browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
2656
- "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
2657
- },
2658
- "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
2659
- "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
2660
- },
2661
- "./package.json": "./package.json",
2662
- "./types/css-prop": "./types/css-prop.d.ts",
2663
- "./macro": {
2664
- types: {
2665
- "import": "./macro.d.mts",
2666
- "default": "./macro.d.ts"
2667
- },
2668
- "default": "./macro.js"
2669
- }
2670
- },
2671
- types: "types/index.d.ts",
2672
- files: [
2673
- "src",
2674
- "dist",
2675
- "jsx-runtime",
2676
- "jsx-dev-runtime",
2677
- "_isolated-hnrs",
2678
- "types/*.d.ts",
2679
- "macro.*"
2680
- ],
2681
- sideEffects: false,
2682
- author: "Emotion Contributors",
2683
- license: "MIT",
2684
- scripts: {
2685
- "test:typescript": "dtslint types"
2686
- },
2687
- dependencies: {
2688
- "@babel/runtime": "^7.18.3",
2689
- "@emotion/babel-plugin": "^11.11.0",
2690
- "@emotion/cache": "^11.11.0",
2691
- "@emotion/serialize": "^1.1.3",
2692
- "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
2693
- "@emotion/utils": "^1.2.1",
2694
- "@emotion/weak-memoize": "^0.3.1",
2695
- "hoist-non-react-statics": "^3.3.1"
2696
- },
2697
- peerDependencies: {
2698
- react: ">=16.8.0"
2699
- },
2700
- peerDependenciesMeta: {
2701
- "@types/react": {
2702
- optional: true
2703
- }
2704
- },
2705
- devDependencies: {
2706
- "@definitelytyped/dtslint": "0.0.112",
2707
- "@emotion/css": "11.11.2",
2708
- "@emotion/css-prettifier": "1.1.3",
2709
- "@emotion/server": "11.11.0",
2710
- "@emotion/styled": "11.11.0",
2711
- "html-tag-names": "^1.1.2",
2712
- react: "16.14.0",
2713
- "svg-tag-names": "^1.1.1",
2714
- typescript: "^4.5.5"
2715
- },
2716
- repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
2717
- publishConfig: {
2718
- access: "public"
2719
- },
2720
- "umd:main": "dist/emotion-react.umd.min.js",
2721
- preconstruct: {
2722
- entrypoints: [
2723
- "./index.js",
2724
- "./jsx-runtime.js",
2725
- "./jsx-dev-runtime.js",
2726
- "./_isolated-hnrs.js"
2727
- ],
2728
- umdName: "emotionReact",
2729
- exports: {
2730
- envConditions: [
2731
- "browser",
2732
- "worker"
2733
- ],
2734
- extra: {
2735
- "./types/css-prop": "./types/css-prop.d.ts",
2736
- "./macro": {
2737
- types: {
2738
- "import": "./macro.d.mts",
2739
- "default": "./macro.d.ts"
2740
- },
2741
- "default": "./macro.js"
2742
- }
2743
- }
2744
- }
2745
- }
2746
- };
2747
-
2748
- var jsx = function jsx(type, props) {
2388
+ var jsx
2389
+ /*: typeof React.createElement */
2390
+ = function jsx
2391
+ /*: typeof React.createElement */
2392
+ (type
2393
+ /*: React.ElementType */
2394
+ , props
2395
+ /*: Object */
2396
+ ) {
2749
2397
  var args = arguments;
2750
2398
 
2751
2399
  if (props == null || !hasOwn.call(props, 'css')) {
2752
- // $FlowFixMe
2753
2400
  return React.createElement.apply(undefined, args);
2754
2401
  }
2755
2402
 
@@ -2760,123 +2407,16 @@ var jsx = function jsx(type, props) {
2760
2407
 
2761
2408
  for (var i = 2; i < argsLength; i++) {
2762
2409
  createElementArgArray[i] = args[i];
2763
- } // $FlowFixMe
2764
-
2410
+ }
2765
2411
 
2766
2412
  return React.createElement.apply(null, createElementArgArray);
2767
2413
  };
2768
2414
 
2769
- var warnedAboutCssPropForGlobal = false; // maintain place over rerenders.
2770
- // initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
2771
- // initial client-side render from SSR, use place of hydrating tag
2772
-
2773
- var Global = /* #__PURE__ */withEmotionCache(function (props, cache) {
2774
- if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is
2775
- // probably using the custom createElement which
2776
- // means it will be turned into a className prop
2777
- // $FlowFixMe I don't really want to add it to the type since it shouldn't be used
2778
- props.className || props.css)) {
2779
- console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
2780
- warnedAboutCssPropForGlobal = true;
2781
- }
2782
-
2783
- var styles = props.styles;
2784
- var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext));
2785
-
2786
- if (!isBrowser$1) {
2787
- var _ref;
2788
-
2789
- var serializedNames = serialized.name;
2790
- var serializedStyles = serialized.styles;
2791
- var next = serialized.next;
2792
-
2793
- while (next !== undefined) {
2794
- serializedNames += ' ' + next.name;
2795
- serializedStyles += next.styles;
2796
- next = next.next;
2797
- }
2798
-
2799
- var shouldCache = cache.compat === true;
2800
- var rules = cache.insert("", {
2801
- name: serializedNames,
2802
- styles: serializedStyles
2803
- }, cache.sheet, shouldCache);
2804
-
2805
- if (shouldCache) {
2806
- return null;
2807
- }
2808
-
2809
- return /*#__PURE__*/React.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = {
2810
- __html: rules
2811
- }, _ref.nonce = cache.sheet.nonce, _ref));
2812
- } // yes, i know these hooks are used conditionally
2813
- // but it is based on a constant that will never change at runtime
2814
- // it's effectively like having two implementations and switching them out
2815
- // so it's not actually breaking anything
2816
-
2817
-
2818
- var sheetRef = React.useRef();
2819
- useInsertionEffectWithLayoutFallback(function () {
2820
- var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675
2821
-
2822
- var sheet = new cache.sheet.constructor({
2823
- key: key,
2824
- nonce: cache.sheet.nonce,
2825
- container: cache.sheet.container,
2826
- speedy: cache.sheet.isSpeedy
2827
- });
2828
- var rehydrating = false; // $FlowFixMe
2829
-
2830
- var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]");
2831
-
2832
- if (cache.sheet.tags.length) {
2833
- sheet.before = cache.sheet.tags[0];
2834
- }
2835
-
2836
- if (node !== null) {
2837
- rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s
2838
-
2839
- node.setAttribute('data-emotion', key);
2840
- sheet.hydrate([node]);
2841
- }
2842
-
2843
- sheetRef.current = [sheet, rehydrating];
2844
- return function () {
2845
- sheet.flush();
2846
- };
2847
- }, [cache]);
2848
- useInsertionEffectWithLayoutFallback(function () {
2849
- var sheetRefCurrent = sheetRef.current;
2850
- var sheet = sheetRefCurrent[0],
2851
- rehydrating = sheetRefCurrent[1];
2852
-
2853
- if (rehydrating) {
2854
- sheetRefCurrent[1] = false;
2855
- return;
2856
- }
2857
-
2858
- if (serialized.next !== undefined) {
2859
- // insert keyframes
2860
- insertStyles(cache, serialized.next, true);
2861
- }
2862
-
2863
- if (sheet.tags.length) {
2864
- // if this doesn't exist then it will be null so the style element will be appended
2865
- var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
2866
- sheet.before = element;
2867
- sheet.flush();
2868
- }
2415
+ /* import type { Interpolation, SerializedStyles } from '@emotion/utils' */
2869
2416
 
2870
- cache.insert("", serialized, sheet, false);
2871
- }, [cache, serialized.name]);
2872
- return null;
2873
- });
2874
-
2875
- if (process.env.NODE_ENV !== 'production') {
2876
- Global.displayName = 'EmotionGlobal';
2877
- }
2878
-
2879
- function css$2() {
2417
+ function css$2()
2418
+ /*: SerializedStyles */
2419
+ {
2880
2420
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2881
2421
  args[_key] = arguments[_key];
2882
2422
  }
@@ -2884,10 +2424,20 @@ function css$2() {
2884
2424
  return serializeStyles(args);
2885
2425
  }
2886
2426
 
2887
- var keyframes = function keyframes() {
2888
- var insertable = css$2.apply(void 0, arguments);
2889
- var name = "animation-" + insertable.name; // $FlowFixMe
2427
+ /*
2428
+ type Keyframes = {|
2429
+ name: string,
2430
+ styles: string,
2431
+ anim: 1,
2432
+ toString: () => string
2433
+ |} & string
2434
+ */
2890
2435
 
2436
+ var keyframes = function
2437
+ /*: Keyframes */
2438
+ keyframes() {
2439
+ var insertable = css$2.apply(void 0, arguments);
2440
+ var name = "animation-" + insertable.name;
2891
2441
  return {
2892
2442
  name: name,
2893
2443
  styles: "@keyframes " + name + "{" + insertable.styles + "}",
@@ -2898,169 +2448,6 @@ var keyframes = function keyframes() {
2898
2448
  };
2899
2449
  };
2900
2450
 
2901
- var classnames = function classnames(args) {
2902
- var len = args.length;
2903
- var i = 0;
2904
- var cls = '';
2905
-
2906
- for (; i < len; i++) {
2907
- var arg = args[i];
2908
- if (arg == null) continue;
2909
- var toAdd = void 0;
2910
-
2911
- switch (typeof arg) {
2912
- case 'boolean':
2913
- break;
2914
-
2915
- case 'object':
2916
- {
2917
- if (Array.isArray(arg)) {
2918
- toAdd = classnames(arg);
2919
- } else {
2920
- if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {
2921
- 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.');
2922
- }
2923
-
2924
- toAdd = '';
2925
-
2926
- for (var k in arg) {
2927
- if (arg[k] && k) {
2928
- toAdd && (toAdd += ' ');
2929
- toAdd += k;
2930
- }
2931
- }
2932
- }
2933
-
2934
- break;
2935
- }
2936
-
2937
- default:
2938
- {
2939
- toAdd = arg;
2940
- }
2941
- }
2942
-
2943
- if (toAdd) {
2944
- cls && (cls += ' ');
2945
- cls += toAdd;
2946
- }
2947
- }
2948
-
2949
- return cls;
2950
- };
2951
-
2952
- function merge(registered, css, className) {
2953
- var registeredStyles = [];
2954
- var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
2955
-
2956
- if (registeredStyles.length < 2) {
2957
- return className;
2958
- }
2959
-
2960
- return rawClassName + css(registeredStyles);
2961
- }
2962
-
2963
- var Insertion = function Insertion(_ref) {
2964
- var cache = _ref.cache,
2965
- serializedArr = _ref.serializedArr;
2966
- var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
2967
- var rules = '';
2968
-
2969
- for (var i = 0; i < serializedArr.length; i++) {
2970
- var res = insertStyles(cache, serializedArr[i], false);
2971
-
2972
- if (!isBrowser$1 && res !== undefined) {
2973
- rules += res;
2974
- }
2975
- }
2976
-
2977
- if (!isBrowser$1) {
2978
- return rules;
2979
- }
2980
- });
2981
-
2982
- if (!isBrowser$1 && rules.length !== 0) {
2983
- var _ref2;
2984
-
2985
- return /*#__PURE__*/React.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedArr.map(function (serialized) {
2986
- return serialized.name;
2987
- }).join(' '), _ref2.dangerouslySetInnerHTML = {
2988
- __html: rules
2989
- }, _ref2.nonce = cache.sheet.nonce, _ref2));
2990
- }
2991
-
2992
- return null;
2993
- };
2994
-
2995
- var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {
2996
- var hasRendered = false;
2997
- var serializedArr = [];
2998
-
2999
- var css = function css() {
3000
- if (hasRendered && process.env.NODE_ENV !== 'production') {
3001
- throw new Error('css can only be used during render');
3002
- }
3003
-
3004
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3005
- args[_key] = arguments[_key];
3006
- }
3007
-
3008
- var serialized = serializeStyles(args, cache.registered);
3009
- serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`
3010
-
3011
- registerStyles(cache, serialized, false);
3012
- return cache.key + "-" + serialized.name;
3013
- };
3014
-
3015
- var cx = function cx() {
3016
- if (hasRendered && process.env.NODE_ENV !== 'production') {
3017
- throw new Error('cx can only be used during render');
3018
- }
3019
-
3020
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3021
- args[_key2] = arguments[_key2];
3022
- }
3023
-
3024
- return merge(cache.registered, css, classnames(args));
3025
- };
3026
-
3027
- var content = {
3028
- css: css,
3029
- cx: cx,
3030
- theme: React.useContext(ThemeContext)
3031
- };
3032
- var ele = props.children(content);
3033
- hasRendered = true;
3034
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
3035
- cache: cache,
3036
- serializedArr: serializedArr
3037
- }), ele);
3038
- });
3039
-
3040
- if (process.env.NODE_ENV !== 'production') {
3041
- ClassNames.displayName = 'EmotionClassNames';
3042
- }
3043
-
3044
- if (process.env.NODE_ENV !== 'production') {
3045
- var isBrowser = typeof document !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked
3046
-
3047
- var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined';
3048
-
3049
- if (isBrowser && !isTestEnv) {
3050
- // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later
3051
- var globalContext = // $FlowIgnore
3052
- typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef
3053
- : isBrowser ? window : global;
3054
- var globalKey = "__EMOTION_REACT_" + pkg.version.split('.')[0] + "__";
3055
-
3056
- if (globalContext[globalKey]) {
3057
- 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.');
3058
- }
3059
-
3060
- globalContext[globalKey] = true;
3061
- }
3062
- }
3063
-
3064
2451
  function _arrayWithHoles(r) {
3065
2452
  if (Array.isArray(r)) return r;
3066
2453
  }