@ntbjs/react-components 2.0.0-rc.11 → 2.0.0-rc.13

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 (183) hide show
  1. package/cjs/components/data/Alert/Alert.js +8 -10
  2. package/cjs/components/data/Alert/Alert.styled.js +17 -10
  3. package/cjs/components/data/Badge/Badge.js +13 -13
  4. package/cjs/components/data/Badge/Badge.styled.js +37 -26
  5. package/cjs/components/data/Popover/Popover.js +4 -2
  6. package/cjs/components/data/Tab/Tab.styled.js +6 -1
  7. package/cjs/components/data/Tabs/Tabs.js +22 -12
  8. package/cjs/components/data/Tabs/Tabs.styled.js +29 -16
  9. package/cjs/components/data/Tooltip/Tooltip.js +3 -1
  10. package/cjs/components/data/VerificationStatusIcon/VerificationStatusIcon.js +6 -6
  11. package/cjs/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.js +24 -15
  12. package/cjs/components/inputs/ActionButton/ActionButton.js +5 -3
  13. package/cjs/components/inputs/ActionButton/ActionButton.styled.js +17 -8
  14. package/cjs/components/inputs/Button/Button.js +45 -38
  15. package/cjs/components/inputs/Button/Button.styled.js +84 -38
  16. package/cjs/components/inputs/Checkbox/Checkbox.js +1 -1
  17. package/cjs/components/inputs/Checkbox/Checkbox.styled.js +23 -8
  18. package/cjs/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js +2 -2
  19. package/cjs/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js +46 -35
  20. package/cjs/components/inputs/CompactStarRating/CompactStarRating.js +3 -4
  21. package/cjs/components/inputs/CompactStarRating/CompactStarRating.styled.js +36 -25
  22. package/cjs/components/inputs/CompactTextInput/CompactTextInput.js +5 -5
  23. package/cjs/components/inputs/CompactTextInput/CompactTextInput.styled.js +79 -25
  24. package/cjs/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js +24 -7
  25. package/cjs/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js +1 -1
  26. package/cjs/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js +38 -13
  27. package/cjs/components/inputs/MultiSelect/MultiSelect.js +5 -48
  28. package/cjs/components/inputs/MultiSelect/MultiSelect.styled.js +27 -31
  29. package/cjs/components/inputs/Radio/Radio.styled.js +9 -2
  30. package/cjs/components/inputs/Switch/Switch.js +1 -1
  31. package/cjs/components/inputs/Switch/Switch.styled.js +22 -7
  32. package/cjs/components/inputs/TextArea/TextArea.js +10 -20
  33. package/cjs/components/inputs/TextArea/TextArea.styled.js +208 -133
  34. package/cjs/components/inputs/TextInput/TextInput.js +21 -22
  35. package/cjs/components/inputs/TextInput/TextInput.styled.js +58 -45
  36. package/cjs/components/layout/InputGroup/InputGroup.styled.js +6 -1
  37. package/cjs/components/layout/SectionSeparator/SectionSeparator.js +7 -7
  38. package/cjs/components/layout/SectionSeparator/SectionSeparator.styled.js +12 -5
  39. package/cjs/components/widgets/AssetAction/AssetAction.js +1 -1
  40. package/cjs/components/widgets/AssetAction/AssetAction.styled.js +16 -5
  41. package/cjs/components/widgets/AssetActionsBase/AssetActionsBase.styled.js +6 -1
  42. package/cjs/components/widgets/AssetGallery/AssetGallery.js +5 -1
  43. package/cjs/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js +9 -6
  44. package/cjs/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js +12 -3
  45. package/cjs/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js +7 -4
  46. package/cjs/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +80 -33
  47. package/cjs/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js +1 -1
  48. package/cjs/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js +22 -22
  49. package/cjs/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js +2 -2
  50. package/cjs/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js +18 -7
  51. package/cjs/components/widgets/ContextMenu/ContextMenu.js +2 -1
  52. package/cjs/components/widgets/ContextMenu/ContextMenu.styled.js +6 -1
  53. package/cjs/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js +4 -4
  54. package/cjs/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js +16 -7
  55. package/cjs/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js +6 -1
  56. package/cjs/components/widgets/InfoCard/InfoCard.js +17 -9
  57. package/cjs/components/widgets/InfoCard/InfoCard.styled.js +40 -13
  58. package/cjs/components/widgets/ProgressBar/ProgressBar.js +43 -22
  59. package/cjs/components/widgets/ProgressBar/ProgressBar.styled.js +78 -22
  60. package/cjs/components/widgets/SummaryCard/SummaryCard.js +9 -8
  61. package/cjs/components/widgets/SummaryCard/SummaryCard.styled.js +46 -19
  62. package/cjs/components/widgets/widgets/index.js +0 -2
  63. package/cjs/node_modules/@emotion/cache/dist/{emotion-cache.browser.esm.js → emotion-cache.esm.js} +61 -3
  64. package/cjs/node_modules/@emotion/react/dist/{emotion-element-f0de968e.browser.esm.js → emotion-element-d59e098f.esm.js} +54 -12
  65. package/cjs/node_modules/@emotion/react/dist/{emotion-react.browser.esm.js → emotion-react.esm.js} +10 -7
  66. package/cjs/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/{emotion-use-insertion-effect-with-fallbacks.browser.esm.js → emotion-use-insertion-effect-with-fallbacks.esm.js} +3 -1
  67. package/cjs/node_modules/@emotion/utils/dist/{emotion-utils.browser.esm.js → emotion-utils.esm.js} +12 -3
  68. package/cjs/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js +20 -0
  69. package/cjs/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +20 -12
  70. package/cjs/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js +1 -1
  71. package/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs.js +4 -2
  72. package/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +9 -8
  73. package/cjs/node_modules/@restart/hooks/{esm → lib}/useMergedRefs.js +8 -11
  74. package/cjs/node_modules/@restart/hooks/{esm → lib}/useUpdateEffect.js +2 -4
  75. package/cjs/node_modules/react/cjs/react.development.js +125 -82
  76. package/cjs/node_modules/react/cjs/react.production.js +88 -92
  77. package/cjs/node_modules/react-dom/cjs/react-dom.development.js +1 -1
  78. package/cjs/node_modules/react-dom/cjs/react-dom.production.js +1 -1
  79. package/cjs/node_modules/react-select/creatable/dist/react-select-creatable.esm.js +5 -5
  80. package/cjs/node_modules/react-select/dist/{Select-aab027f3.esm.js → Select-ef7c0426.esm.js} +23 -17
  81. package/cjs/node_modules/react-select/dist/index-641ee5b8.esm.js +47 -47
  82. package/cjs/node_modules/react-select/dist/{useCreatable-84008237.esm.js → useCreatable-09aaeb9a.esm.js} +3 -3
  83. package/cjs/node_modules/use-isomorphic-layout-effect/dist/{use-isomorphic-layout-effect.browser.esm.js → use-isomorphic-layout-effect.esm.js} +4 -1
  84. package/cjs/styles/utils/colors-export.js +41 -0
  85. package/cjs/utils/defaultTheme.js +28 -5
  86. package/esm/components/data/Alert/Alert.js +8 -10
  87. package/esm/components/data/Alert/Alert.styled.js +17 -10
  88. package/esm/components/data/Badge/Badge.js +13 -13
  89. package/esm/components/data/Badge/Badge.styled.js +37 -26
  90. package/esm/components/data/Popover/Popover.js +4 -2
  91. package/esm/components/data/Tab/Tab.styled.js +6 -1
  92. package/esm/components/data/Tabs/Tabs.js +23 -13
  93. package/esm/components/data/Tabs/Tabs.styled.js +29 -16
  94. package/esm/components/data/Tooltip/Tooltip.js +3 -1
  95. package/esm/components/data/VerificationStatusIcon/VerificationStatusIcon.js +6 -6
  96. package/esm/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.js +24 -15
  97. package/esm/components/inputs/ActionButton/ActionButton.js +5 -3
  98. package/esm/components/inputs/ActionButton/ActionButton.styled.js +17 -8
  99. package/esm/components/inputs/Button/Button.js +45 -38
  100. package/esm/components/inputs/Button/Button.styled.js +84 -38
  101. package/esm/components/inputs/Checkbox/Checkbox.js +1 -1
  102. package/esm/components/inputs/Checkbox/Checkbox.styled.js +23 -8
  103. package/esm/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js +4 -4
  104. package/esm/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js +46 -35
  105. package/esm/components/inputs/CompactStarRating/CompactStarRating.js +3 -4
  106. package/esm/components/inputs/CompactStarRating/CompactStarRating.styled.js +36 -25
  107. package/esm/components/inputs/CompactTextInput/CompactTextInput.js +5 -5
  108. package/esm/components/inputs/CompactTextInput/CompactTextInput.styled.js +79 -25
  109. package/esm/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js +24 -7
  110. package/esm/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js +1 -1
  111. package/esm/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js +38 -13
  112. package/esm/components/inputs/MultiSelect/MultiSelect.js +6 -49
  113. package/esm/components/inputs/MultiSelect/MultiSelect.styled.js +28 -28
  114. package/esm/components/inputs/Radio/Radio.styled.js +9 -2
  115. package/esm/components/inputs/Switch/Switch.js +1 -1
  116. package/esm/components/inputs/Switch/Switch.styled.js +22 -7
  117. package/esm/components/inputs/TextArea/TextArea.js +10 -20
  118. package/esm/components/inputs/TextArea/TextArea.styled.js +208 -133
  119. package/esm/components/inputs/TextInput/TextInput.js +21 -22
  120. package/esm/components/inputs/TextInput/TextInput.styled.js +58 -45
  121. package/esm/components/layout/InputGroup/InputGroup.styled.js +6 -1
  122. package/esm/components/layout/SectionSeparator/SectionSeparator.js +7 -7
  123. package/esm/components/layout/SectionSeparator/SectionSeparator.styled.js +12 -5
  124. package/esm/components/widgets/AssetAction/AssetAction.js +1 -1
  125. package/esm/components/widgets/AssetAction/AssetAction.styled.js +16 -5
  126. package/esm/components/widgets/AssetActionsBase/AssetActionsBase.styled.js +6 -1
  127. package/esm/components/widgets/AssetGallery/AssetGallery.js +5 -1
  128. package/esm/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js +9 -6
  129. package/esm/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js +12 -3
  130. package/esm/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js +7 -4
  131. package/esm/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +80 -33
  132. package/esm/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js +1 -1
  133. package/esm/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js +22 -22
  134. package/esm/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js +2 -2
  135. package/esm/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js +18 -7
  136. package/esm/components/widgets/ContextMenu/ContextMenu.js +2 -1
  137. package/esm/components/widgets/ContextMenu/ContextMenu.styled.js +6 -1
  138. package/esm/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js +4 -4
  139. package/esm/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js +16 -7
  140. package/esm/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js +6 -1
  141. package/esm/components/widgets/InfoCard/InfoCard.js +10 -2
  142. package/esm/components/widgets/InfoCard/InfoCard.styled.js +40 -13
  143. package/esm/components/widgets/ProgressBar/ProgressBar.js +31 -10
  144. package/esm/components/widgets/ProgressBar/ProgressBar.styled.js +77 -23
  145. package/esm/components/widgets/SummaryCard/SummaryCard.js +9 -8
  146. package/esm/components/widgets/SummaryCard/SummaryCard.styled.js +46 -19
  147. package/esm/components/widgets/widgets/index.js +0 -1
  148. package/esm/node_modules/@emotion/cache/dist/{emotion-cache.browser.esm.js → emotion-cache.esm.js} +61 -3
  149. package/esm/node_modules/@emotion/react/dist/{emotion-element-f0de968e.browser.esm.js → emotion-element-d59e098f.esm.js} +47 -5
  150. package/esm/node_modules/@emotion/react/dist/{emotion-react.browser.esm.js → emotion-react.esm.js} +3 -3
  151. package/esm/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/{emotion-use-insertion-effect-with-fallbacks.browser.esm.js → emotion-use-insertion-effect-with-fallbacks.esm.js} +3 -1
  152. package/esm/node_modules/@emotion/utils/dist/{emotion-utils.browser.esm.js → emotion-utils.esm.js} +12 -3
  153. package/esm/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js +16 -0
  154. package/esm/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +20 -12
  155. package/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js +4 -4
  156. package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs.js +4 -2
  157. package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +9 -8
  158. package/esm/node_modules/@restart/hooks/{esm → lib}/useMergedRefs.js +8 -11
  159. package/esm/node_modules/@restart/hooks/{esm → lib}/useUpdateEffect.js +2 -4
  160. package/esm/node_modules/react/cjs/react.development.js +125 -82
  161. package/esm/node_modules/react/cjs/react.production.js +88 -92
  162. package/esm/node_modules/react-dom/cjs/react-dom.development.js +1 -1
  163. package/esm/node_modules/react-dom/cjs/react-dom.production.js +1 -1
  164. package/esm/node_modules/react-select/creatable/dist/react-select-creatable.esm.js +3 -3
  165. package/esm/node_modules/react-select/dist/{Select-aab027f3.esm.js → Select-ef7c0426.esm.js} +12 -6
  166. package/esm/node_modules/react-select/dist/index-641ee5b8.esm.js +2 -2
  167. package/esm/node_modules/react-select/dist/{useCreatable-84008237.esm.js → useCreatable-09aaeb9a.esm.js} +1 -1
  168. package/esm/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js +9 -0
  169. package/esm/styles/utils/colors-export.js +37 -0
  170. package/esm/utils/defaultTheme.js +28 -5
  171. package/package.json +16 -22
  172. package/styles/utils/colors-export.js +35 -0
  173. package/cjs/components/widgets/Instructions/Instructions.js +0 -217
  174. package/cjs/components/widgets/Instructions/Instructions.styled.js +0 -47
  175. package/cjs/components/widgets/Instructions/widgets/Instructions/index.js +0 -9
  176. package/cjs/styles/utils/colors.scss.js +0 -11
  177. package/esm/components/widgets/Instructions/Instructions.js +0 -213
  178. package/esm/components/widgets/Instructions/Instructions.styled.js +0 -36
  179. package/esm/components/widgets/Instructions/widgets/Instructions/index.js +0 -1
  180. package/esm/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js +0 -6
  181. package/esm/styles/utils/colors.scss.js +0 -7
  182. package/styles/config.scss +0 -37
  183. /package/styles/utils/{colors.scss → .colors.scss} +0 -0
@@ -3,6 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var emotionSheet_esm = require('../../sheet/dist/emotion-sheet.esm.js');
6
+ var emotionWeakMemoize_esm = require('../../weak-memoize/dist/emotion-weak-memoize.esm.js');
7
+ var emotionMemoize_esm = require('../../memoize/dist/emotion-memoize.esm.js');
6
8
  var Middleware = require('../../../stylis/src/Middleware.js');
7
9
  var Enum = require('../../../stylis/src/Enum.js');
8
10
  var Utility = require('../../../stylis/src/Utility.js');
@@ -10,6 +12,8 @@ var Serializer = require('../../../stylis/src/Serializer.js');
10
12
  var Tokenizer = require('../../../stylis/src/Tokenizer.js');
11
13
  var Parser = require('../../../stylis/src/Parser.js');
12
14
 
15
+ var isBrowser = typeof document !== 'undefined';
16
+
13
17
  var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
14
18
  var previous = 0;
15
19
  var character = 0;
@@ -347,12 +351,17 @@ var prefixer = function prefixer(element, index, children, callback) {
347
351
  }
348
352
  };
349
353
 
354
+ var getServerStylisCache = isBrowser ? undefined : emotionWeakMemoize_esm["default"](function () {
355
+ return emotionMemoize_esm["default"](function () {
356
+ return {};
357
+ });
358
+ });
350
359
  var defaultStylisPlugins = [prefixer];
351
360
 
352
361
  var createCache = function createCache(options) {
353
362
  var key = options.key;
354
363
 
355
- if (key === 'css') {
364
+ if (isBrowser && key === 'css') {
356
365
  var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
357
366
  // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
358
367
  // note this very very intentionally targets all style elements regardless of the key to ensure
@@ -382,7 +391,7 @@ var createCache = function createCache(options) {
382
391
  var container;
383
392
  var nodesToHydrate = [];
384
393
 
385
- {
394
+ if (isBrowser) {
386
395
  container = options.container || document.head;
387
396
  Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
388
397
  // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
@@ -401,7 +410,7 @@ var createCache = function createCache(options) {
401
410
 
402
411
  var omnipresentPlugins = [compat, removeLabel];
403
412
 
404
- {
413
+ if (!getServerStylisCache) {
405
414
  var currentSheet;
406
415
  var finalizingPlugins = [Serializer.stringify, Middleware.rulesheet(function (rule) {
407
416
  currentSheet.insert(rule);
@@ -421,6 +430,55 @@ var createCache = function createCache(options) {
421
430
  cache.inserted[serialized.name] = true;
422
431
  }
423
432
  };
433
+ } else {
434
+ var _finalizingPlugins = [Serializer.stringify];
435
+
436
+ var _serializer = Middleware.middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));
437
+
438
+ var _stylis = function _stylis(styles) {
439
+ return Serializer.serialize(Parser.compile(styles), _serializer);
440
+ };
441
+
442
+ var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
443
+
444
+ var getRules = function getRules(selector, serialized) {
445
+ var name = serialized.name;
446
+
447
+ if (serverStylisCache[name] === undefined) {
448
+ serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
449
+ }
450
+
451
+ return serverStylisCache[name];
452
+ };
453
+
454
+ _insert = function _insert(selector, serialized, sheet, shouldCache) {
455
+ var name = serialized.name;
456
+ var rules = getRules(selector, serialized);
457
+
458
+ if (cache.compat === undefined) {
459
+ // in regular mode, we don't set the styles on the inserted cache
460
+ // since we don't need to and that would be wasting memory
461
+ // we return them so that they are rendered in a style tag
462
+ if (shouldCache) {
463
+ cache.inserted[name] = true;
464
+ }
465
+
466
+ return rules;
467
+ } else {
468
+ // in compat mode, we put the styles on the inserted cache so
469
+ // that emotion-server can pull out the styles
470
+ // except when we don't want to cache it which was in Global but now
471
+ // is nowhere but we don't want to do a major right now
472
+ // and just in case we're going to leave the case here
473
+ // it's also not affecting client side bundle size
474
+ // so it's really not a big deal
475
+ if (shouldCache) {
476
+ cache.inserted[name] = rules;
477
+ } else {
478
+ return rules;
479
+ }
480
+ }
481
+ };
424
482
  }
425
483
 
426
484
  var cache = {
@@ -3,27 +3,29 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('../../../react/index.js');
6
- var emotionCache_browser_esm = require('../../cache/dist/emotion-cache.browser.esm.js');
7
- var emotionUtils_browser_esm = require('../../utils/dist/emotion-utils.browser.esm.js');
6
+ var emotionCache_esm = require('../../cache/dist/emotion-cache.esm.js');
7
+ var emotionUtils_esm = require('../../utils/dist/emotion-utils.esm.js');
8
8
  var emotionSerialize_esm = require('../../serialize/dist/emotion-serialize.esm.js');
9
- var emotionUseInsertionEffectWithFallbacks_browser_esm = require('../../use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js');
9
+ var emotionUseInsertionEffectWithFallbacks_esm = require('../../use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.esm.js');
10
10
  var index = require('../../../../_virtual/index.js');
11
11
 
12
12
  var isDevelopment = false;
13
13
 
14
+ var isBrowser = typeof document !== 'undefined';
15
+
14
16
  var EmotionCacheContext = /* #__PURE__ */index.react.exports.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
15
17
  // because this module is primarily intended for the browser and node
16
18
  // but it's also required in react native and similar environments sometimes
17
19
  // and we could have a special build just for that
18
20
  // but this is much easier and the native packages
19
21
  // might use a different theme context in the future anyway
20
- typeof HTMLElement !== 'undefined' ? /* #__PURE__ */emotionCache_browser_esm["default"]({
22
+ typeof HTMLElement !== 'undefined' ? /* #__PURE__ */emotionCache_esm["default"]({
21
23
  key: 'css'
22
24
  }) : null);
23
25
 
24
26
  EmotionCacheContext.Provider;
25
27
 
26
- var withEmotionCache = function withEmotionCache(func) {
28
+ exports.w = function withEmotionCache(func) {
27
29
  return /*#__PURE__*/index.react.exports.forwardRef(function (props, ref) {
28
30
  // the cache will never be null in the browser
29
31
  var cache = index.react.exports.useContext(EmotionCacheContext);
@@ -31,6 +33,30 @@ var withEmotionCache = function withEmotionCache(func) {
31
33
  });
32
34
  };
33
35
 
36
+ if (!isBrowser) {
37
+ exports.w = function withEmotionCache(func) {
38
+ return function (props) {
39
+ var cache = index.react.exports.useContext(EmotionCacheContext);
40
+
41
+ if (cache === null) {
42
+ // yes, we're potentially creating this on every render
43
+ // it doesn't actually matter though since it's only on the server
44
+ // so there will only every be a single render
45
+ // that could change in the future because of suspense and etc. but for now,
46
+ // this works and i don't want to optimise for a future thing that we aren't sure about
47
+ cache = emotionCache_esm["default"]({
48
+ key: 'css'
49
+ });
50
+ return /*#__PURE__*/index.react.exports.createElement(EmotionCacheContext.Provider, {
51
+ value: cache
52
+ }, func(props, cache));
53
+ } else {
54
+ return func(props, cache);
55
+ }
56
+ };
57
+ };
58
+ }
59
+
34
60
  var ThemeContext = /* #__PURE__ */index.react.exports.createContext({});
35
61
 
36
62
  var hasOwn = {}.hasOwnProperty;
@@ -55,15 +81,31 @@ var Insertion = function Insertion(_ref) {
55
81
  var cache = _ref.cache,
56
82
  serialized = _ref.serialized,
57
83
  isStringTag = _ref.isStringTag;
58
- emotionUtils_browser_esm.registerStyles(cache, serialized, isStringTag);
59
- emotionUseInsertionEffectWithFallbacks_browser_esm.useInsertionEffectAlwaysWithSyncFallback(function () {
60
- return emotionUtils_browser_esm.insertStyles(cache, serialized, isStringTag);
84
+ emotionUtils_esm.registerStyles(cache, serialized, isStringTag);
85
+ var rules = emotionUseInsertionEffectWithFallbacks_esm.useInsertionEffectAlwaysWithSyncFallback(function () {
86
+ return emotionUtils_esm.insertStyles(cache, serialized, isStringTag);
61
87
  });
62
88
 
89
+ if (!isBrowser && rules !== undefined) {
90
+ var _ref2;
91
+
92
+ var serializedNames = serialized.name;
93
+ var next = serialized.next;
94
+
95
+ while (next !== undefined) {
96
+ serializedNames += ' ' + next.name;
97
+ next = next.next;
98
+ }
99
+
100
+ return /*#__PURE__*/index.react.exports.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
101
+ __html: rules
102
+ }, _ref2.nonce = cache.sheet.nonce, _ref2));
103
+ }
104
+
63
105
  return null;
64
106
  };
65
107
 
66
- var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
108
+ var Emotion = /* #__PURE__ */exports.w(function (props, cache, ref) {
67
109
  var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
68
110
  // not passing the registered cache to serializeStyles because it would
69
111
  // make certain babel optimisations not possible
@@ -77,7 +119,7 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
77
119
  var className = '';
78
120
 
79
121
  if (typeof props.className === 'string') {
80
- className = emotionUtils_browser_esm.getRegisteredStyles(cache.registered, registeredStyles, props.className);
122
+ className = emotionUtils_esm.getRegisteredStyles(cache.registered, registeredStyles, props.className);
81
123
  } else if (props.className != null) {
82
124
  className = props.className + " ";
83
125
  }
@@ -110,7 +152,7 @@ var Emotion$1 = Emotion;
110
152
 
111
153
  exports.E = Emotion$1;
112
154
  exports.T = ThemeContext;
155
+ exports.a = isDevelopment;
113
156
  exports.c = createEmotionProps;
114
157
  exports.h = hasOwn;
115
- exports.i = isDevelopment;
116
- exports.w = withEmotionCache;
158
+ exports.i = isBrowser;
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var emotionElementF0de968e_browser_esm = require('./emotion-element-f0de968e.browser.esm.js');
5
+ var emotionElementD59e098f_esm = require('./emotion-element-d59e098f.esm.js');
6
6
  require('../../../react/index.js');
7
- require('../../use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js');
7
+ require('../../use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.esm.js');
8
8
  var emotionSerialize_esm = require('../../serialize/dist/emotion-serialize.esm.js');
9
9
  require('../../../hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js');
10
10
  var index = require('../../../../_virtual/index.js');
@@ -13,14 +13,14 @@ exports.jsx = function jsx(type, props) {
13
13
  // eslint-disable-next-line prefer-rest-params
14
14
  var args = arguments;
15
15
 
16
- if (props == null || !emotionElementF0de968e_browser_esm.h.call(props, 'css')) {
16
+ if (props == null || !emotionElementD59e098f_esm.h.call(props, 'css')) {
17
17
  return index.react.exports.createElement.apply(undefined, args);
18
18
  }
19
19
 
20
20
  var argsLength = args.length;
21
21
  var createElementArgArray = new Array(argsLength);
22
- createElementArgArray[0] = emotionElementF0de968e_browser_esm.E;
23
- createElementArgArray[1] = emotionElementF0de968e_browser_esm.c(type, props);
22
+ createElementArgArray[0] = emotionElementD59e098f_esm.E;
23
+ createElementArgArray[1] = emotionElementD59e098f_esm.c(type, props);
24
24
 
25
25
  for (var i = 2; i < argsLength; i++) {
26
26
  createElementArgArray[i] = args[i];
@@ -56,8 +56,11 @@ function keyframes() {
56
56
  };
57
57
  }
58
58
 
59
- exports.ThemeContext = emotionElementF0de968e_browser_esm.T;
60
- exports.withEmotionCache = emotionElementF0de968e_browser_esm.w;
59
+ exports.ThemeContext = emotionElementD59e098f_esm.T;
60
+ Object.defineProperty(exports, 'withEmotionCache', {
61
+ enumerable: true,
62
+ get: function () { return emotionElementD59e098f_esm.w; }
63
+ });
61
64
  exports.createElement = exports.jsx;
62
65
  exports.css = css;
63
66
  exports.keyframes = keyframes;
@@ -4,11 +4,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var index = require('../../../react/index.js');
6
6
 
7
+ var isBrowser = typeof document !== 'undefined';
8
+
7
9
  var syncFallback = function syncFallback(create) {
8
10
  return create();
9
11
  };
10
12
 
11
13
  var useInsertionEffect = index['useInsertion' + 'Effect'] ? index['useInsertion' + 'Effect'] : false;
12
- var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
14
+ var useInsertionEffectAlwaysWithSyncFallback = !isBrowser ? syncFallback : useInsertionEffect || syncFallback;
13
15
 
14
16
  exports.useInsertionEffectAlwaysWithSyncFallback = useInsertionEffectAlwaysWithSyncFallback;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var isBrowser = true;
5
+ var isBrowser = typeof document !== 'undefined';
6
6
 
7
7
  function getRegisteredStyles(registered, registeredStyles, classNames) {
8
8
  var rawClassName = '';
@@ -27,7 +27,7 @@ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
27
27
  // in node since emotion-server relies on whether a style is in
28
28
  // the registered cache to know whether a style is global or not
29
29
  // also, note that this check will be dead code eliminated in the browser
30
- isBrowser === false ) && cache.registered[className] === undefined) {
30
+ isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
31
31
  cache.registered[className] = serialized.styles;
32
32
  }
33
33
  };
@@ -36,13 +36,22 @@ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
36
36
  var className = cache.key + "-" + serialized.name;
37
37
 
38
38
  if (cache.inserted[serialized.name] === undefined) {
39
+ var stylesForSSR = '';
39
40
  var current = serialized;
40
41
 
41
42
  do {
42
- cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
43
+ var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
44
+
45
+ if (!isBrowser && maybeStyles !== undefined) {
46
+ stylesForSSR += maybeStyles;
47
+ }
43
48
 
44
49
  current = current.next;
45
50
  } while (current !== undefined);
51
+
52
+ if (!isBrowser && stylesForSSR.length !== 0) {
53
+ return stylesForSSR;
54
+ }
46
55
  }
47
56
  };
48
57
 
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var weakMemoize = function weakMemoize(func) {
6
+ var cache = new WeakMap();
7
+ return function (arg) {
8
+ if (cache.has(arg)) {
9
+ // Use non-null assertion because we just checked that the cache `has` it
10
+ // This allows us to remove `undefined` from the return value
11
+ return cache.get(arg);
12
+ }
13
+
14
+ var ret = func(arg);
15
+ cache.set(arg, ret);
16
+ return ret;
17
+ };
18
+ };
19
+
20
+ exports["default"] = weakMemoize;
@@ -325,16 +325,22 @@ const flip = function (options) {
325
325
  const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
326
326
  const nextPlacement = placements[nextIndex];
327
327
  if (nextPlacement) {
328
- // Try next placement and re-run the lifecycle.
329
- return {
330
- data: {
331
- index: nextIndex,
332
- overflows: overflowsData
333
- },
334
- reset: {
335
- placement: nextPlacement
336
- }
337
- };
328
+ const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== floatingUi_utils.getSideAxis(nextPlacement) : false;
329
+ if (!ignoreCrossAxisOverflow ||
330
+ // We leave the current main axis only if every placement on that axis
331
+ // overflows the main axis.
332
+ overflowsData.every(d => floatingUi_utils.getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
333
+ // Try next placement and re-run the lifecycle.
334
+ return {
335
+ data: {
336
+ index: nextIndex,
337
+ overflows: overflowsData
338
+ },
339
+ reset: {
340
+ placement: nextPlacement
341
+ }
342
+ };
343
+ }
338
344
  }
339
345
 
340
346
  // First, find the candidates that fit on the mainAxis side of overflow,
@@ -580,6 +586,8 @@ const inline = function (options) {
580
586
  };
581
587
  };
582
588
 
589
+ const originSides = /*#__PURE__*/new Set(['left', 'top']);
590
+
583
591
  // For type backwards-compatibility, the `OffsetOptions` type was also
584
592
  // Derivable.
585
593
 
@@ -593,7 +601,7 @@ async function convertValueToCoords(state, options) {
593
601
  const side = floatingUi_utils.getSide(placement);
594
602
  const alignment = floatingUi_utils.getAlignment(placement);
595
603
  const isVertical = floatingUi_utils.getSideAxis(placement) === 'y';
596
- const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
604
+ const mainAxisMulti = originSides.has(side) ? -1 : 1;
597
605
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
598
606
  const rawValue = floatingUi_utils.evaluate(options, state);
599
607
 
@@ -793,7 +801,7 @@ const limitShift = function (options) {
793
801
  if (checkCrossAxis) {
794
802
  var _middlewareData$offse, _middlewareData$offse2;
795
803
  const len = mainAxis === 'y' ? 'width' : 'height';
796
- const isOriginSide = ['top', 'left'].includes(floatingUi_utils.getSide(placement));
804
+ const isOriginSide = originSides.has(floatingUi_utils.getSide(placement));
797
805
  const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
798
806
  const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
799
807
  if (crossAxisCoord < limitMin) {
@@ -216,7 +216,7 @@ function observeMove(element, onMove) {
216
216
  // Handle <iframe>s
217
217
  root: root.ownerDocument
218
218
  });
219
- } catch (e) {
219
+ } catch (_e) {
220
220
  io = new IntersectionObserver(handleObserve, options);
221
221
  }
222
222
  io.observe(element);
@@ -46,6 +46,7 @@ function isShadowRoot(value) {
46
46
  }
47
47
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
48
48
  }
49
+ const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
49
50
  function isOverflowElement(element) {
50
51
  const {
51
52
  overflow,
@@ -53,14 +54,15 @@ function isOverflowElement(element) {
53
54
  overflowY,
54
55
  display
55
56
  } = getComputedStyle(element);
56
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
57
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
57
58
  }
58
59
  function isWebKit() {
59
60
  if (typeof CSS === 'undefined' || !CSS.supports) return false;
60
61
  return CSS.supports('-webkit-backdrop-filter', 'none');
61
62
  }
63
+ const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
62
64
  function isLastTraversableNode(node) {
63
- return ['html', 'body', '#document'].includes(getNodeName(node));
65
+ return lastTraversableNodeNames.has(getNodeName(node));
64
66
  }
65
67
  function getComputedStyle(element) {
66
68
  return getWindow(element).getComputedStyle(element);
@@ -46,8 +46,9 @@ function getOppositeAxis(axis) {
46
46
  function getAxisLength(axis) {
47
47
  return axis === 'y' ? 'height' : 'width';
48
48
  }
49
+ const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
49
50
  function getSideAxis(placement) {
50
- return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
51
+ return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
51
52
  }
52
53
  function getAlignmentAxis(placement) {
53
54
  return getOppositeAxis(getSideAxis(placement));
@@ -72,19 +73,19 @@ function getExpandedPlacements(placement) {
72
73
  function getOppositeAlignmentPlacement(placement) {
73
74
  return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
74
75
  }
76
+ const lrPlacement = ['left', 'right'];
77
+ const rlPlacement = ['right', 'left'];
78
+ const tbPlacement = ['top', 'bottom'];
79
+ const btPlacement = ['bottom', 'top'];
75
80
  function getSideList(side, isStart, rtl) {
76
- const lr = ['left', 'right'];
77
- const rl = ['right', 'left'];
78
- const tb = ['top', 'bottom'];
79
- const bt = ['bottom', 'top'];
80
81
  switch (side) {
81
82
  case 'top':
82
83
  case 'bottom':
83
- if (rtl) return isStart ? rl : lr;
84
- return isStart ? lr : rl;
84
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
85
+ return isStart ? lrPlacement : rlPlacement;
85
86
  case 'left':
86
87
  case 'right':
87
- return isStart ? tb : bt;
88
+ return isStart ? tbPlacement : btPlacement;
88
89
  default:
89
90
  return [];
90
91
  }
@@ -5,20 +5,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  require('../../../react/index.js');
6
6
  var index = require('../../../../_virtual/index.js');
7
7
 
8
- var toFnRef = function toFnRef(ref) {
9
- return !ref || typeof ref === 'function' ? ref : function (value) {
8
+ function toFnRef(ref) {
9
+ return !ref || typeof ref === 'function' ? ref : value => {
10
10
  ref.current = value;
11
11
  };
12
- };
13
-
12
+ }
14
13
  function mergeRefs(refA, refB) {
15
- var a = toFnRef(refA);
16
- var b = toFnRef(refB);
17
- return function (value) {
14
+ const a = toFnRef(refA);
15
+ const b = toFnRef(refB);
16
+ return value => {
18
17
  if (a) a(value);
19
18
  if (b) b(value);
20
19
  };
21
20
  }
21
+
22
22
  /**
23
23
  * Create and returns a single callback ref composed from two other Refs.
24
24
  *
@@ -35,11 +35,8 @@ function mergeRefs(refA, refB) {
35
35
  * @param refB A Callback or mutable Ref
36
36
  * @category refs
37
37
  */
38
-
39
38
  function useMergedRefs(refA, refB) {
40
- return index.react.exports.useMemo(function () {
41
- return mergeRefs(refA, refB);
42
- }, [refA, refB]);
39
+ return index.react.exports.useMemo(() => mergeRefs(refA, refB), [refA, refB]);
43
40
  }
44
41
 
45
42
  exports["default"] = useMergedRefs;
@@ -25,15 +25,13 @@ var index = require('../../../../_virtual/index.js');
25
25
  *
26
26
  * @category effects
27
27
  */
28
-
29
28
  function useUpdateEffect(fn, deps) {
30
- var isFirst = index.react.exports.useRef(true);
31
- index.react.exports.useEffect(function () {
29
+ const isFirst = index.react.exports.useRef(true);
30
+ index.react.exports.useEffect(() => {
32
31
  if (isFirst.current) {
33
32
  isFirst.current = false;
34
33
  return;
35
34
  }
36
-
37
35
  return fn();
38
36
  }, deps);
39
37
  }