@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
@@ -1,12 +1,14 @@
1
1
  import '../../../react/index.js';
2
- import createCache from '../../cache/dist/emotion-cache.browser.esm.js';
3
- import { getRegisteredStyles, registerStyles, insertStyles } from '../../utils/dist/emotion-utils.browser.esm.js';
2
+ import createCache from '../../cache/dist/emotion-cache.esm.js';
3
+ import { getRegisteredStyles, registerStyles, insertStyles } from '../../utils/dist/emotion-utils.esm.js';
4
4
  import { serializeStyles } from '../../serialize/dist/emotion-serialize.esm.js';
5
- import { useInsertionEffectAlwaysWithSyncFallback } from '../../use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js';
5
+ import { useInsertionEffectAlwaysWithSyncFallback } from '../../use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.esm.js';
6
6
  import { r as react } from '../../../../_virtual/index.js';
7
7
 
8
8
  var isDevelopment = false;
9
9
 
10
+ var isBrowser = typeof document !== 'undefined';
11
+
10
12
  var EmotionCacheContext = /* #__PURE__ */react.exports.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
11
13
  // because this module is primarily intended for the browser and node
12
14
  // but it's also required in react native and similar environments sometimes
@@ -27,6 +29,30 @@ var withEmotionCache = function withEmotionCache(func) {
27
29
  });
28
30
  };
29
31
 
32
+ if (!isBrowser) {
33
+ withEmotionCache = function withEmotionCache(func) {
34
+ return function (props) {
35
+ var cache = react.exports.useContext(EmotionCacheContext);
36
+
37
+ if (cache === null) {
38
+ // yes, we're potentially creating this on every render
39
+ // it doesn't actually matter though since it's only on the server
40
+ // so there will only every be a single render
41
+ // that could change in the future because of suspense and etc. but for now,
42
+ // this works and i don't want to optimise for a future thing that we aren't sure about
43
+ cache = createCache({
44
+ key: 'css'
45
+ });
46
+ return /*#__PURE__*/react.exports.createElement(EmotionCacheContext.Provider, {
47
+ value: cache
48
+ }, func(props, cache));
49
+ } else {
50
+ return func(props, cache);
51
+ }
52
+ };
53
+ };
54
+ }
55
+
30
56
  var ThemeContext = /* #__PURE__ */react.exports.createContext({});
31
57
 
32
58
  var hasOwn = {}.hasOwnProperty;
@@ -52,10 +78,26 @@ var Insertion = function Insertion(_ref) {
52
78
  serialized = _ref.serialized,
53
79
  isStringTag = _ref.isStringTag;
54
80
  registerStyles(cache, serialized, isStringTag);
55
- useInsertionEffectAlwaysWithSyncFallback(function () {
81
+ var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
56
82
  return insertStyles(cache, serialized, isStringTag);
57
83
  });
58
84
 
85
+ if (!isBrowser && rules !== undefined) {
86
+ var _ref2;
87
+
88
+ var serializedNames = serialized.name;
89
+ var next = serialized.next;
90
+
91
+ while (next !== undefined) {
92
+ serializedNames += ' ' + next.name;
93
+ next = next.next;
94
+ }
95
+
96
+ return /*#__PURE__*/react.exports.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
97
+ __html: rules
98
+ }, _ref2.nonce = cache.sheet.nonce, _ref2));
99
+ }
100
+
59
101
  return null;
60
102
  };
61
103
 
@@ -104,4 +146,4 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
104
146
 
105
147
  var Emotion$1 = Emotion;
106
148
 
107
- export { Emotion$1 as E, ThemeContext as T, createEmotionProps as c, hasOwn as h, isDevelopment as i, withEmotionCache as w };
149
+ export { Emotion$1 as E, ThemeContext as T, isDevelopment as a, createEmotionProps as c, hasOwn as h, isBrowser as i, withEmotionCache as w };
@@ -1,7 +1,7 @@
1
- import { h as hasOwn, E as Emotion$1, c as createEmotionProps } from './emotion-element-f0de968e.browser.esm.js';
2
- export { T as ThemeContext, w as withEmotionCache } from './emotion-element-f0de968e.browser.esm.js';
1
+ import { h as hasOwn, E as Emotion$1, c as createEmotionProps } from './emotion-element-d59e098f.esm.js';
2
+ export { T as ThemeContext, w as withEmotionCache } from './emotion-element-d59e098f.esm.js';
3
3
  import '../../../react/index.js';
4
- import '../../use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js';
4
+ import '../../use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.esm.js';
5
5
  import { serializeStyles } from '../../serialize/dist/emotion-serialize.esm.js';
6
6
  import '../../../hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js';
7
7
  import { r as react } from '../../../../_virtual/index.js';
@@ -1,10 +1,12 @@
1
1
  import * as index from '../../../react/index.js';
2
2
 
3
+ var isBrowser = typeof document !== 'undefined';
4
+
3
5
  var syncFallback = function syncFallback(create) {
4
6
  return create();
5
7
  };
6
8
 
7
9
  var useInsertionEffect = index['useInsertion' + 'Effect'] ? index['useInsertion' + 'Effect'] : false;
8
- var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
10
+ var useInsertionEffectAlwaysWithSyncFallback = !isBrowser ? syncFallback : useInsertionEffect || syncFallback;
9
11
 
10
12
  export { useInsertionEffectAlwaysWithSyncFallback };
@@ -1,4 +1,4 @@
1
- var isBrowser = true;
1
+ var isBrowser = typeof document !== 'undefined';
2
2
 
3
3
  function getRegisteredStyles(registered, registeredStyles, classNames) {
4
4
  var rawClassName = '';
@@ -23,7 +23,7 @@ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
23
23
  // in node since emotion-server relies on whether a style is in
24
24
  // the registered cache to know whether a style is global or not
25
25
  // also, note that this check will be dead code eliminated in the browser
26
- isBrowser === false ) && cache.registered[className] === undefined) {
26
+ isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
27
27
  cache.registered[className] = serialized.styles;
28
28
  }
29
29
  };
@@ -32,13 +32,22 @@ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
32
32
  var className = cache.key + "-" + serialized.name;
33
33
 
34
34
  if (cache.inserted[serialized.name] === undefined) {
35
+ var stylesForSSR = '';
35
36
  var current = serialized;
36
37
 
37
38
  do {
38
- cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
39
+ var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
40
+
41
+ if (!isBrowser && maybeStyles !== undefined) {
42
+ stylesForSSR += maybeStyles;
43
+ }
39
44
 
40
45
  current = current.next;
41
46
  } while (current !== undefined);
47
+
48
+ if (!isBrowser && stylesForSSR.length !== 0) {
49
+ return stylesForSSR;
50
+ }
42
51
  }
43
52
  };
44
53
 
@@ -0,0 +1,16 @@
1
+ var weakMemoize = function weakMemoize(func) {
2
+ var cache = new WeakMap();
3
+ return function (arg) {
4
+ if (cache.has(arg)) {
5
+ // Use non-null assertion because we just checked that the cache `has` it
6
+ // This allows us to remove `undefined` from the return value
7
+ return cache.get(arg);
8
+ }
9
+
10
+ var ret = func(arg);
11
+ cache.set(arg, ret);
12
+ return ret;
13
+ };
14
+ };
15
+
16
+ export { weakMemoize as default };
@@ -322,16 +322,22 @@ const flip = function (options) {
322
322
  const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
323
323
  const nextPlacement = placements[nextIndex];
324
324
  if (nextPlacement) {
325
- // Try next placement and re-run the lifecycle.
326
- return {
327
- data: {
328
- index: nextIndex,
329
- overflows: overflowsData
330
- },
331
- reset: {
332
- placement: nextPlacement
333
- }
334
- };
325
+ const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
326
+ if (!ignoreCrossAxisOverflow ||
327
+ // We leave the current main axis only if every placement on that axis
328
+ // overflows the main axis.
329
+ overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
330
+ // Try next placement and re-run the lifecycle.
331
+ return {
332
+ data: {
333
+ index: nextIndex,
334
+ overflows: overflowsData
335
+ },
336
+ reset: {
337
+ placement: nextPlacement
338
+ }
339
+ };
340
+ }
335
341
  }
336
342
 
337
343
  // First, find the candidates that fit on the mainAxis side of overflow,
@@ -577,6 +583,8 @@ const inline = function (options) {
577
583
  };
578
584
  };
579
585
 
586
+ const originSides = /*#__PURE__*/new Set(['left', 'top']);
587
+
580
588
  // For type backwards-compatibility, the `OffsetOptions` type was also
581
589
  // Derivable.
582
590
 
@@ -590,7 +598,7 @@ async function convertValueToCoords(state, options) {
590
598
  const side = getSide(placement);
591
599
  const alignment = getAlignment(placement);
592
600
  const isVertical = getSideAxis(placement) === 'y';
593
- const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
601
+ const mainAxisMulti = originSides.has(side) ? -1 : 1;
594
602
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
595
603
  const rawValue = evaluate(options, state);
596
604
 
@@ -790,7 +798,7 @@ const limitShift = function (options) {
790
798
  if (checkCrossAxis) {
791
799
  var _middlewareData$offse, _middlewareData$offse2;
792
800
  const len = mainAxis === 'y' ? 'width' : 'height';
793
- const isOriginSide = ['top', 'left'].includes(getSide(placement));
801
+ const isOriginSide = originSides.has(getSide(placement));
794
802
  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);
795
803
  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);
796
804
  if (crossAxisCoord < limitMin) {
@@ -1,10 +1,10 @@
1
1
  import { offset, autoPlacement, shift, flip, size, hide, arrow, inline, limitShift } from '../../core/dist/floating-ui.core.mjs.js';
2
2
  import { createCoords, rectToClientRect, round, floor, max, min } from '../../utils/dist/floating-ui.utils.mjs.js';
3
- import { getOverflowAncestors, isElement, getWindow, getFrameElement, getComputedStyle, getDocumentElement, isHTMLElement, isWebKit } from '../../utils/dist/floating-ui.utils.dom.mjs.js';
3
+ import { getOverflowAncestors, isElement, getWindow, getFrameElement, getComputedStyle as getComputedStyle$1, getDocumentElement, isHTMLElement, isWebKit } from '../../utils/dist/floating-ui.utils.dom.mjs.js';
4
4
  export { getOverflowAncestors } from '../../utils/dist/floating-ui.utils.dom.mjs.js';
5
5
 
6
6
  function getCssDimensions(element) {
7
- const css = getComputedStyle(element);
7
+ const css = getComputedStyle$1(element);
8
8
  // In testing environments, the `width` and `height` properties are empty
9
9
  // strings for SVG elements, returning NaN. Fallback to `0` in this case.
10
10
  let width = parseFloat(css.width) || 0;
@@ -109,7 +109,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
109
109
  while (currentIFrame && offsetParent && offsetWin !== currentWin) {
110
110
  const iframeScale = getScale(currentIFrame);
111
111
  const iframeRect = currentIFrame.getBoundingClientRect();
112
- const css = getComputedStyle(currentIFrame);
112
+ const css = getComputedStyle$1(currentIFrame);
113
113
  const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
114
114
  const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
115
115
  x *= iframeScale.x;
@@ -213,7 +213,7 @@ function observeMove(element, onMove) {
213
213
  // Handle <iframe>s
214
214
  root: root.ownerDocument
215
215
  });
216
- } catch (e) {
216
+ } catch (_e) {
217
217
  io = new IntersectionObserver(handleObserve, options);
218
218
  }
219
219
  io.observe(element);
@@ -42,6 +42,7 @@ function isShadowRoot(value) {
42
42
  }
43
43
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
44
44
  }
45
+ const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
45
46
  function isOverflowElement(element) {
46
47
  const {
47
48
  overflow,
@@ -49,14 +50,15 @@ function isOverflowElement(element) {
49
50
  overflowY,
50
51
  display
51
52
  } = getComputedStyle(element);
52
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
53
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
53
54
  }
54
55
  function isWebKit() {
55
56
  if (typeof CSS === 'undefined' || !CSS.supports) return false;
56
57
  return CSS.supports('-webkit-backdrop-filter', 'none');
57
58
  }
59
+ const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
58
60
  function isLastTraversableNode(node) {
59
- return ['html', 'body', '#document'].includes(getNodeName(node));
61
+ return lastTraversableNodeNames.has(getNodeName(node));
60
62
  }
61
63
  function getComputedStyle(element) {
62
64
  return getWindow(element).getComputedStyle(element);
@@ -42,8 +42,9 @@ function getOppositeAxis(axis) {
42
42
  function getAxisLength(axis) {
43
43
  return axis === 'y' ? 'height' : 'width';
44
44
  }
45
+ const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
45
46
  function getSideAxis(placement) {
46
- return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
47
+ return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
47
48
  }
48
49
  function getAlignmentAxis(placement) {
49
50
  return getOppositeAxis(getSideAxis(placement));
@@ -68,19 +69,19 @@ function getExpandedPlacements(placement) {
68
69
  function getOppositeAlignmentPlacement(placement) {
69
70
  return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
70
71
  }
72
+ const lrPlacement = ['left', 'right'];
73
+ const rlPlacement = ['right', 'left'];
74
+ const tbPlacement = ['top', 'bottom'];
75
+ const btPlacement = ['bottom', 'top'];
71
76
  function getSideList(side, isStart, rtl) {
72
- const lr = ['left', 'right'];
73
- const rl = ['right', 'left'];
74
- const tb = ['top', 'bottom'];
75
- const bt = ['bottom', 'top'];
76
77
  switch (side) {
77
78
  case 'top':
78
79
  case 'bottom':
79
- if (rtl) return isStart ? rl : lr;
80
- return isStart ? lr : rl;
80
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
81
+ return isStart ? lrPlacement : rlPlacement;
81
82
  case 'left':
82
83
  case 'right':
83
- return isStart ? tb : bt;
84
+ return isStart ? tbPlacement : btPlacement;
84
85
  default:
85
86
  return [];
86
87
  }
@@ -1,20 +1,20 @@
1
1
  import '../../../react/index.js';
2
2
  import { r as react } from '../../../../_virtual/index.js';
3
3
 
4
- var toFnRef = function toFnRef(ref) {
5
- return !ref || typeof ref === 'function' ? ref : function (value) {
4
+ function toFnRef(ref) {
5
+ return !ref || typeof ref === 'function' ? ref : value => {
6
6
  ref.current = value;
7
7
  };
8
- };
9
-
8
+ }
10
9
  function mergeRefs(refA, refB) {
11
- var a = toFnRef(refA);
12
- var b = toFnRef(refB);
13
- return function (value) {
10
+ const a = toFnRef(refA);
11
+ const b = toFnRef(refB);
12
+ return value => {
14
13
  if (a) a(value);
15
14
  if (b) b(value);
16
15
  };
17
16
  }
17
+
18
18
  /**
19
19
  * Create and returns a single callback ref composed from two other Refs.
20
20
  *
@@ -31,11 +31,8 @@ function mergeRefs(refA, refB) {
31
31
  * @param refB A Callback or mutable Ref
32
32
  * @category refs
33
33
  */
34
-
35
34
  function useMergedRefs(refA, refB) {
36
- return react.exports.useMemo(function () {
37
- return mergeRefs(refA, refB);
38
- }, [refA, refB]);
35
+ return react.exports.useMemo(() => mergeRefs(refA, refB), [refA, refB]);
39
36
  }
40
37
 
41
38
  export { useMergedRefs as default, mergeRefs };
@@ -21,15 +21,13 @@ import { r as react } from '../../../../_virtual/index.js';
21
21
  *
22
22
  * @category effects
23
23
  */
24
-
25
24
  function useUpdateEffect(fn, deps) {
26
- var isFirst = react.exports.useRef(true);
27
- react.exports.useEffect(function () {
25
+ const isFirst = react.exports.useRef(true);
26
+ react.exports.useEffect(() => {
28
27
  if (isFirst.current) {
29
28
  isFirst.current = false;
30
29
  return;
31
30
  }
32
-
33
31
  return fn();
34
32
  }, deps);
35
33
  }