@rocket.chat/fuselage 0.77.0 → 0.78.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/components/AnimatedVisibility/index.d.ts +1 -1
  2. package/dist/components/AnimatedVisibility/index.d.ts.map +1 -1
  3. package/dist/components/AudioPlayer/AudioPlayer.d.ts.map +1 -1
  4. package/dist/components/AutoComplete/AutoComplete.d.ts +6 -4
  5. package/dist/components/AutoComplete/AutoComplete.d.ts.map +1 -1
  6. package/dist/components/AutoComplete/index.d.ts +1 -1
  7. package/dist/components/AutoComplete/index.d.ts.map +1 -1
  8. package/dist/components/Banner/Banner.d.ts +2 -2
  9. package/dist/components/Banner/Banner.d.ts.map +1 -1
  10. package/dist/components/Banner/index.d.ts +1 -1
  11. package/dist/components/Banner/index.d.ts.map +1 -1
  12. package/dist/components/Box/BoxTransforms.d.ts.map +1 -1
  13. package/dist/components/Box/index.d.ts +2 -0
  14. package/dist/components/Box/index.d.ts.map +1 -1
  15. package/dist/components/Box/stylingProps.d.ts +1 -1
  16. package/dist/components/Box/stylingProps.d.ts.map +1 -1
  17. package/dist/components/Button/ActionButton.d.ts +3 -3
  18. package/dist/components/Button/ActionButton.d.ts.map +1 -1
  19. package/dist/components/Button/Button.d.ts +1 -1
  20. package/dist/components/Button/IconButton.d.ts +3 -3
  21. package/dist/components/Button/IconButton.d.ts.map +1 -1
  22. package/dist/components/Button/index.d.ts +2 -2
  23. package/dist/components/Button/index.d.ts.map +1 -1
  24. package/dist/components/Chip/Chip.d.ts +1 -1
  25. package/dist/components/Label/index.d.ts +1 -0
  26. package/dist/components/Label/index.d.ts.map +1 -1
  27. package/dist/components/Menu/Menu.d.ts.map +1 -1
  28. package/dist/components/Menu/index.d.ts +1 -0
  29. package/dist/components/Menu/index.d.ts.map +1 -1
  30. package/dist/components/Message/MessageToolbar/MessageToolbarItem.d.ts +1 -7
  31. package/dist/components/Message/MessageToolbar/MessageToolbarItem.d.ts.map +1 -1
  32. package/dist/components/Message/index.d.ts +1 -0
  33. package/dist/components/Message/index.d.ts.map +1 -1
  34. package/dist/components/MultiSelect/MultiSelectFilteredAnchor.d.ts.map +1 -1
  35. package/dist/components/MultiSelect/index.d.ts +1 -0
  36. package/dist/components/MultiSelect/index.d.ts.map +1 -1
  37. package/dist/components/Options/Options.d.ts +1 -1
  38. package/dist/components/Options/Options.d.ts.map +1 -1
  39. package/dist/components/Options/index.d.ts +1 -0
  40. package/dist/components/Options/index.d.ts.map +1 -1
  41. package/dist/components/Options/useCursor.d.ts +2 -4
  42. package/dist/components/Options/useCursor.d.ts.map +1 -1
  43. package/dist/components/Options/useVisible.d.ts +6 -1
  44. package/dist/components/Options/useVisible.d.ts.map +1 -1
  45. package/dist/components/OptionsPaginated/OptionsPaginated.d.ts +1 -1
  46. package/dist/components/OptionsPaginated/OptionsPaginated.d.ts.map +1 -1
  47. package/dist/components/PaginatedSelect/PaginatedSelect.d.ts +1 -2
  48. package/dist/components/PaginatedSelect/PaginatedSelect.d.ts.map +1 -1
  49. package/dist/components/PaginatedSelect/index.d.ts +2 -1
  50. package/dist/components/PaginatedSelect/index.d.ts.map +1 -1
  51. package/dist/components/Pagination/Pagination.d.ts +1 -1
  52. package/dist/components/Pagination/Pagination.d.ts.map +1 -1
  53. package/dist/components/Pagination/index.d.ts +1 -1
  54. package/dist/components/Pagination/index.d.ts.map +1 -1
  55. package/dist/components/PaletteStyleTag/hooks/useCreateStyleContainer.d.ts.map +1 -1
  56. package/dist/components/PaletteStyleTag/index.d.ts +1 -0
  57. package/dist/components/PaletteStyleTag/index.d.ts.map +1 -1
  58. package/dist/components/PaletteStyleTag/types/themes.d.ts +0 -1
  59. package/dist/components/PaletteStyleTag/types/themes.d.ts.map +1 -1
  60. package/dist/components/Popover/Popover.d.ts +2 -1
  61. package/dist/components/Popover/Popover.d.ts.map +1 -1
  62. package/dist/components/Position/Position.d.ts.map +1 -1
  63. package/dist/components/Select/Select.d.ts +2 -2
  64. package/dist/components/Select/Select.d.ts.map +1 -1
  65. package/dist/components/Select/SelectAria.d.ts.map +1 -1
  66. package/dist/components/SelectInput/SelectInput.d.ts +1 -1
  67. package/dist/components/SelectInput/SelectInput.d.ts.map +1 -1
  68. package/dist/components/SelectInput/index.d.ts +1 -1
  69. package/dist/components/SelectInput/index.d.ts.map +1 -1
  70. package/dist/components/Sidebar/Sidebar.d.ts +6 -25
  71. package/dist/components/Sidebar/Sidebar.d.ts.map +1 -1
  72. package/dist/components/Sidebar/SidebarActions.d.ts +1 -7
  73. package/dist/components/Sidebar/SidebarActions.d.ts.map +1 -1
  74. package/dist/components/Sidebar/SidebarBanner.d.ts +2 -2
  75. package/dist/components/Sidebar/SidebarBanner.d.ts.map +1 -1
  76. package/dist/components/Sidebar/TopBar/TopBar.d.ts +1 -2
  77. package/dist/components/Sidebar/TopBar/TopBar.d.ts.map +1 -1
  78. package/dist/components/Sidebar/TopBar/TopBarAction.d.ts +1 -7
  79. package/dist/components/Sidebar/TopBar/TopBarAction.d.ts.map +1 -1
  80. package/dist/components/Sidebar/TopBar/TopBarSection.d.ts +1 -2
  81. package/dist/components/Sidebar/TopBar/TopBarSection.d.ts.map +1 -1
  82. package/dist/components/Sidebar/TopBar/TopBarTitle.d.ts +1 -2
  83. package/dist/components/Sidebar/TopBar/TopBarTitle.d.ts.map +1 -1
  84. package/dist/components/Sidebar/TopBar/TopBarToolBox.d.ts +1 -2
  85. package/dist/components/Sidebar/TopBar/TopBarToolBox.d.ts.map +1 -1
  86. package/dist/components/Sidebar/TopBar/TopBarV2.d.ts +2 -3
  87. package/dist/components/Sidebar/TopBar/TopBarV2.d.ts.map +1 -1
  88. package/dist/components/Sidebar/TopBar/TopBarWrapper.d.ts +1 -2
  89. package/dist/components/Sidebar/TopBar/TopBarWrapper.d.ts.map +1 -1
  90. package/dist/components/Sidebar/TopBar/index.d.ts +6 -25
  91. package/dist/components/Sidebar/TopBar/index.d.ts.map +1 -1
  92. package/dist/components/Sidebar/index.d.ts +2 -1
  93. package/dist/components/Sidebar/index.d.ts.map +1 -1
  94. package/dist/components/SidebarV2/SidebarAction.d.ts +1 -7
  95. package/dist/components/SidebarV2/SidebarAction.d.ts.map +1 -1
  96. package/dist/components/SidebarV2/SidebarBanner.d.ts +4 -5
  97. package/dist/components/SidebarV2/SidebarBanner.d.ts.map +1 -1
  98. package/dist/components/SidebarV2/SidebarGroupTitle.d.ts +1 -2
  99. package/dist/components/SidebarV2/SidebarGroupTitle.d.ts.map +1 -1
  100. package/dist/components/SidebarV2/SidebarItem/SidebarItemIcon.d.ts +2 -3
  101. package/dist/components/SidebarV2/SidebarItem/SidebarItemIcon.d.ts.map +1 -1
  102. package/dist/components/SidebarV2/SidebarItem/index.d.ts +2 -2
  103. package/dist/components/SidebarV2/SidebarItem/index.d.ts.map +1 -1
  104. package/dist/components/SidebarV2/index.d.ts +2 -2
  105. package/dist/components/SidebarV2/index.d.ts.map +1 -1
  106. package/dist/components/StatusBullet/icons/Away.d.ts.map +1 -1
  107. package/dist/components/StatusBullet/icons/Busy.d.ts.map +1 -1
  108. package/dist/components/StatusBullet/icons/Disabled.d.ts.map +1 -1
  109. package/dist/components/StatusBullet/icons/Loading.d.ts.map +1 -1
  110. package/dist/components/StatusBullet/icons/Offline.d.ts.map +1 -1
  111. package/dist/components/StatusBullet/icons/Online.d.ts.map +1 -1
  112. package/dist/contexts/OwnerDocument.d.ts +7 -0
  113. package/dist/contexts/OwnerDocument.d.ts.map +1 -0
  114. package/dist/contexts/index.d.ts +2 -0
  115. package/dist/contexts/index.d.ts.map +1 -0
  116. package/dist/fuselage.css +2 -2
  117. package/dist/fuselage.css.map +1 -1
  118. package/dist/fuselage.development.js +108 -41
  119. package/dist/fuselage.development.js.map +1 -1
  120. package/dist/fuselage.production.js +6 -6
  121. package/dist/hooks/useStyle.d.ts.map +1 -1
  122. package/dist/index.d.ts +3 -1
  123. package/dist/index.d.ts.map +1 -1
  124. package/dist/styleTokens.d.ts +11 -11
  125. package/dist/styleTokens.d.ts.map +1 -1
  126. package/dist/tsdoc-metadata.json +11 -0
  127. package/package.json +7 -5
@@ -500,25 +500,26 @@ const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-ru
500
500
  const fuselage_hooks_1 = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
501
501
  const react_1 = __webpack_require__(/*! react */ "react");
502
502
  const __1 = __webpack_require__(/*! ../.. */ "./src/index.ts");
503
+ const contexts_1 = __webpack_require__(/*! ../../contexts */ "./src/contexts/index.ts");
503
504
  const Slider_1 = __webpack_require__(/*! ../Slider */ "./src/components/Slider/index.ts");
504
505
  const getMaskTime = (durationTime) => new Date(durationTime * 1000)
505
506
  .toISOString()
506
507
  .slice(durationTime > 60 * 60 ? 11 : 14, 19);
507
- function forceDownload(url, fileName) {
508
+ function forceDownload(ownerDocument, url, fileName) {
508
509
  const xhr = new XMLHttpRequest();
509
510
  xhr.open('GET', url, true);
510
511
  xhr.responseType = 'blob';
511
512
  xhr.onload = function () {
512
513
  const urlCreator = window.URL || window.webkitURL;
513
514
  const imageUrl = urlCreator.createObjectURL(this.response);
514
- const tag = document.createElement('a');
515
+ const tag = ownerDocument.createElement('a');
515
516
  tag.href = imageUrl;
516
517
  if (fileName) {
517
518
  tag.download = fileName;
518
519
  }
519
- document.body.appendChild(tag);
520
+ ownerDocument.body.appendChild(tag);
520
521
  tag.click();
521
- document.body.removeChild(tag);
522
+ ownerDocument.body.removeChild(tag);
522
523
  };
523
524
  xhr.send();
524
525
  }
@@ -571,6 +572,7 @@ const AudioPlayer = (0, react_1.forwardRef)(({ src, type = 'audio/mpeg', maxPlay
571
572
  }
572
573
  handlePlaybackSpeed(1);
573
574
  };
575
+ const { document: ownerDocument } = (0, contexts_1.useOwnerDocument)();
574
576
  return ((0, jsx_runtime_1.jsxs)(__1.Box, { borderWidth: 'default', bg: 'tint', borderColor: 'extra-light', pb: 12, pie: 8, pis: 16, borderRadius: 'x4', w: '100%', maxWidth: 'x300', ref: containerRef, display: 'flex', alignItems: 'center', children: [(0, jsx_runtime_1.jsx)(__1.IconButton, { primary: true, medium: true, onClick: handlePlay, "aria-label": isPlaying ? pauseLabel : playLabel, icon: isPlaying ? 'pause-shape-filled' : 'play-shape-filled' }), (0, jsx_runtime_1.jsxs)(__1.Margins, { inline: 8, children: [(0, jsx_runtime_1.jsx)(__1.Box, { fontScale: 'p2', color: 'secondary-info', children: isPlaying || currentTime > 0
575
577
  ? getMaskTime(currentTime)
576
578
  : getMaskTime(durationTime) }), (0, jsx_runtime_1.jsx)(__1.Box, { mi: 16, w: 'full', children: (0, jsx_runtime_1.jsx)(Slider_1.Slider, { "aria-label": audioPlaybackRangeLabel, showOutput: false, value: currentTime, maxValue: durationTime, onChange: (value) => {
@@ -579,9 +581,9 @@ const AudioPlayer = (0, react_1.forwardRef)(({ src, type = 'audio/mpeg', maxPlay
579
581
  }
580
582
  } }) }), (0, jsx_runtime_1.jsxs)(__1.Button, { secondary: true, small: true, onClick: handlePlaybackSpeedSingleControl, "aria-label": changePlaybackSpeedLabel, children: [playbackSpeed, "x"] })] }), download && ((0, jsx_runtime_1.jsx)(__1.IconButton, { primary: true, "aria-label": downloadAudioFileLabel, is: 'a', href: src, download: true, icon: 'download', medium: true, onClick: (e) => {
581
583
  const { host } = new URL(src);
582
- if (host !== window.location.host) {
584
+ if (host !== ownerDocument.defaultView?.location.host) {
583
585
  e.preventDefault();
584
- forceDownload(src);
586
+ forceDownload(ownerDocument, src);
585
587
  }
586
588
  } })), (0, jsx_runtime_1.jsxs)("audio", { style: { display: 'none' }, onTimeUpdate: (e) => {
587
589
  setCurrentTime(e.target.currentTime);
@@ -657,8 +659,9 @@ const isSelectedValid = (value) => (selected) => {
657
659
  ? selected.value === value
658
660
  : value.includes(selected.value);
659
661
  };
660
- function AutoComplete({ value, filter, setFilter, options = [], renderItem, renderSelected: RenderSelected, onChange, renderEmpty, placeholder, error, disabled, multiple, onBlur: onBlurAction = () => { }, ...props }) {
661
- const ref = (0, react_1.useRef)(null);
662
+ const AutoComplete = (0, react_1.forwardRef)(function AutoComplete({ value, filter, setFilter, options = [], renderItem, renderSelected: RenderSelected, onChange, renderEmpty, placeholder, error, disabled, multiple, onBlur: onBlurAction = () => { }, ...props }, ref) {
663
+ const innerRef = (0, react_1.useRef)(null);
664
+ const mergedRefs = (0, fuselage_hooks_1.useMergedRefs)(ref, innerRef);
662
665
  const { ref: containerRef, borderBoxSize } = (0, fuselage_hooks_1.useResizeObserver)();
663
666
  const [selected, setSelected] = (0, react_1.useState)(() => getSelected(value, options) || []);
664
667
  (0, react_1.useEffect)(() => {
@@ -703,12 +706,12 @@ function AutoComplete({ value, filter, setFilter, options = [], renderItem, rend
703
706
  onBlurAction(event);
704
707
  });
705
708
  (0, react_1.useEffect)(reset, [filter, reset]);
706
- return ((0, jsx_runtime_1.jsxs)(Box_1.Box, { "rcx-autocomplete": true, ref: containerRef, onClick: (0, fuselage_hooks_1.useStableCallback)(() => ref.current?.focus()), flexGrow: 1, className: (0, react_1.useMemo)(() => [error && 'invalid', disabled && 'disabled'], [error, disabled]), children: [(0, jsx_runtime_1.jsx)(Box_1.Box, { display: 'flex', flexGrow: 1, alignItems: 'center', flexWrap: 'wrap', margin: 'neg-x4', role: 'group', children: (0, jsx_runtime_1.jsxs)(Margins_1.Margins, { all: 'x4', children: [(0, jsx_runtime_1.jsx)(InputBox_1.Input, { ref: ref, onChange: (0, fuselage_hooks_1.useStableCallback)((e) => setFilter?.(e.currentTarget.value)), onBlur: handleOnBlur, onFocus: show, onKeyDown: handleKeyDown, placeholder: optionsAreVisible === AnimatedVisibility_1.AnimatedVisibility.HIDDEN || !value
709
+ return ((0, jsx_runtime_1.jsxs)(Box_1.Box, { "rcx-autocomplete": true, ref: containerRef, onClick: (0, fuselage_hooks_1.useStableCallback)(() => innerRef.current?.focus()), flexGrow: 1, className: (0, react_1.useMemo)(() => [error && 'invalid', disabled && 'disabled'], [error, disabled]), children: [(0, jsx_runtime_1.jsx)(Box_1.Box, { display: 'flex', flexGrow: 1, alignItems: 'center', flexWrap: 'wrap', margin: 'neg-x4', role: 'group', children: (0, jsx_runtime_1.jsxs)(Margins_1.Margins, { all: 'x4', children: [(0, jsx_runtime_1.jsx)(InputBox_1.Input, { ref: mergedRefs, onChange: (0, fuselage_hooks_1.useStableCallback)((e) => setFilter?.(e.currentTarget.value)), onBlur: handleOnBlur, onFocus: show, onKeyDown: handleKeyDown, placeholder: optionsAreVisible === AnimatedVisibility_1.AnimatedVisibility.HIDDEN || !value
707
710
  ? placeholder
708
711
  : undefined, order: 1, "rcx-input-box--undecorated": true, value: filter, disabled: disabled, ...props }), selected.map((itemSelected) => RenderSelected ? ((0, jsx_runtime_1.jsx)(RenderSelected, { selected: itemSelected, onRemove: handleRemove }, itemSelected.value)) : ((0, jsx_runtime_1.jsx)(Chip_1.Chip, { value: itemSelected.value, children: itemSelected.label, onClick: handleRemove }, itemSelected.value)))] }) }), (0, jsx_runtime_1.jsx)(Box_1.Box, { "rcx-autocomplete__addon": true, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: optionsAreVisible === AnimatedVisibility_1.AnimatedVisibility.VISIBLE
709
712
  ? 'cross'
710
713
  : 'magnifier', size: 'x20', color: 'default' }) }), (0, jsx_runtime_1.jsx)(PositionAnimated_1.PositionAnimated, { visible: optionsAreVisible, anchor: containerRef, children: (0, jsx_runtime_1.jsx)(Options_1.Options, { width: borderBoxSize.inlineSize, onSelect: handleSelect, renderItem: renderItem, renderEmpty: renderEmpty, cursor: cursor, value: value, options: memoizedOptions }) })] }));
711
- }
714
+ });
712
715
  exports["default"] = AutoComplete;
713
716
 
714
717
 
@@ -3747,6 +3750,7 @@ const react_1 = __webpack_require__(/*! react */ "react");
3747
3750
  const react_aria_1 = __webpack_require__(/*! react-aria */ "react-aria");
3748
3751
  const react_dom_1 = __webpack_require__(/*! react-dom */ "react-dom");
3749
3752
  const react_stately_1 = __webpack_require__(/*! react-stately */ "react-stately");
3753
+ const contexts_1 = __webpack_require__(/*! ../../contexts */ "./src/contexts/index.ts");
3750
3754
  const Button_1 = __webpack_require__(/*! ../Button */ "./src/components/Button/index.ts");
3751
3755
  const MenuDropdown_1 = __importDefault(__webpack_require__(/*! ./MenuDropdown */ "./src/components/Menu/MenuDropdown.tsx"));
3752
3756
  const MenuPopover_1 = __importDefault(__webpack_require__(/*! ./MenuPopover */ "./src/components/Menu/MenuPopover.tsx"));
@@ -3763,6 +3767,7 @@ const Menu = ({ icon = 'kebab', placement = 'bottom-start', title, is: MenuButto
3763
3767
  const { large, medium, tiny, mini } = props;
3764
3768
  const sizes = { large, medium, tiny, mini };
3765
3769
  const defaultSmall = !large && !medium && !tiny && !mini;
3770
+ const { document: ownerDocument } = (0, contexts_1.useOwnerDocument)();
3766
3771
  const popover = state.isOpen && ((0, jsx_runtime_1.jsx)(MenuPopover_1.default, { state: state, triggerRef: ref, placement: (0, helpers_1.getPlacement)(placement), maxWidth: maxWidth, children: (0, jsx_runtime_1.jsx)(MenuDropdown_1.default, { ...props, ...menuProps }) }));
3767
3772
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [button ? ((0, react_1.cloneElement)(button, {
3768
3773
  ...buttonProps,
@@ -3771,7 +3776,9 @@ const Menu = ({ icon = 'kebab', placement = 'bottom-start', title, is: MenuButto
3771
3776
  className,
3772
3777
  title,
3773
3778
  pressed: pressed || state.isOpen,
3774
- })) : ((0, jsx_runtime_1.jsx)(MenuButton, { ...buttonProps, ref: ref, icon: icon, className: className, title: title, pressed: pressed || state.isOpen, small: defaultSmall, ...sizes })), detached ? (0, react_dom_1.createPortal)(popover, document.body) : popover] }));
3779
+ })) : ((0, jsx_runtime_1.jsx)(MenuButton, { ...buttonProps, ref: ref, icon: icon, className: className, title: title, pressed: pressed || state.isOpen, small: defaultSmall, ...sizes })), detached
3780
+ ? (0, react_dom_1.createPortal)(popover, ownerDocument?.body || document.body)
3781
+ : popover] }));
3775
3782
  };
3776
3783
  exports["default"] = Menu;
3777
3784
 
@@ -6024,7 +6031,7 @@ const react_1 = __webpack_require__(/*! react */ "react");
6024
6031
  const Flex_1 = __webpack_require__(/*! ../Flex */ "./src/components/Flex/index.ts");
6025
6032
  const InputBox_1 = __webpack_require__(/*! ../InputBox */ "./src/components/InputBox/index.ts");
6026
6033
  const MultiSelectFilteredAnchor = (0, react_1.forwardRef)(function MultiSelectFilteredAnchor({ children: _children, filter, onChangeFilter, placeholder, ...props }, ref) {
6027
- return ((0, jsx_runtime_1.jsx)(Flex_1.FlexItem, { grow: 1, children: (0, jsx_runtime_1.jsx)(InputBox_1.Input, { ref: ref, placeholder: placeholder, value: filter, onInput: (e) => onChangeFilter(e.currentTarget.value), ...props, "rcx-input-box--undecorated": true, order: 1 }) }));
6034
+ return ((0, jsx_runtime_1.jsx)(Flex_1.FlexItem, { grow: 1, children: (0, jsx_runtime_1.jsx)(InputBox_1.Input, { ref: ref, placeholder: placeholder, value: filter, onInput: (e) => onChangeFilter(e.currentTarget.value), ...props, "rcx-input-box--undecorated": true, order: 1, autoComplete: 'off' }) }));
6028
6035
  });
6029
6036
  exports["default"] = MultiSelectFilteredAnchor;
6030
6037
 
@@ -7623,18 +7630,23 @@ exports.getThemePalette = getThemePalette;
7623
7630
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7624
7631
  exports.useCreateStyleContainer = void 0;
7625
7632
  const react_1 = __webpack_require__(/*! react */ "react");
7626
- const useCreateStyleContainer = (id) => (0, react_1.useMemo)(() => {
7627
- const refElement = document.getElementById('rcx-styles') || document.head.lastChild;
7628
- const el = document.getElementById(id);
7629
- if (el) {
7630
- return el;
7631
- }
7632
- const styleElement = document.createElement('style');
7633
- styleElement.setAttribute('id', id);
7634
- document.head.insertBefore(styleElement, refElement);
7635
- document.head.appendChild(document.createElement('style'));
7636
- return styleElement;
7637
- }, [id]);
7633
+ const contexts_1 = __webpack_require__(/*! ../../../contexts */ "./src/contexts/index.ts");
7634
+ const useCreateStyleContainer = (id) => {
7635
+ const { document: ownerDocument } = (0, contexts_1.useOwnerDocument)();
7636
+ return (0, react_1.useMemo)(() => {
7637
+ const refElement = ownerDocument.getElementById('rcx-styles') ||
7638
+ ownerDocument.head.lastChild;
7639
+ const el = ownerDocument.getElementById(id);
7640
+ if (el) {
7641
+ return el;
7642
+ }
7643
+ const styleElement = ownerDocument.createElement('style');
7644
+ styleElement.setAttribute('id', id);
7645
+ ownerDocument.head.insertBefore(styleElement, refElement);
7646
+ ownerDocument.head.appendChild(ownerDocument.createElement('style'));
7647
+ return styleElement;
7648
+ }, [id, ownerDocument]);
7649
+ };
7638
7650
  exports.useCreateStyleContainer = useCreateStyleContainer;
7639
7651
 
7640
7652
 
@@ -7729,14 +7741,17 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
7729
7741
  const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
7730
7742
  const react_1 = __webpack_require__(/*! react */ "react");
7731
7743
  const react_aria_1 = __webpack_require__(/*! react-aria */ "react-aria");
7732
- function Popover(props) {
7744
+ const contexts_1 = __webpack_require__(/*! ../../contexts */ "./src/contexts/index.ts");
7745
+ function Popover({ portalContainer, ...props }) {
7733
7746
  const popoverRef = (0, react_1.useRef)(null);
7734
7747
  const { state, children, isNonModal } = props;
7748
+ const { document: ownerDocument } = (0, contexts_1.useOwnerDocument)();
7735
7749
  const { popoverProps, underlayProps } = (0, react_aria_1.usePopover)({
7736
7750
  ...props,
7737
7751
  popoverRef,
7752
+ boundaryElement: ownerDocument?.body,
7738
7753
  }, state);
7739
- return ((0, jsx_runtime_1.jsxs)(react_aria_1.Overlay, { children: [!isNonModal && (0, jsx_runtime_1.jsx)("div", { ...underlayProps }), (0, jsx_runtime_1.jsxs)("div", { ...popoverProps, ref: popoverRef, children: [!isNonModal && (0, jsx_runtime_1.jsx)(react_aria_1.DismissButton, { onDismiss: state.close }), children, (0, jsx_runtime_1.jsx)(react_aria_1.DismissButton, { onDismiss: state.close })] })] }));
7754
+ return ((0, jsx_runtime_1.jsxs)(react_aria_1.Overlay, { portalContainer: ownerDocument?.body, children: [!isNonModal && (0, jsx_runtime_1.jsx)("div", { ...underlayProps }), (0, jsx_runtime_1.jsxs)("div", { ...popoverProps, ref: popoverRef, children: [!isNonModal && (0, jsx_runtime_1.jsx)(react_aria_1.DismissButton, { onDismiss: state.close }), children, (0, jsx_runtime_1.jsx)(react_aria_1.DismissButton, { onDismiss: state.close })] })] }));
7740
7755
  }
7741
7756
  exports["default"] = Popover;
7742
7757
 
@@ -7772,25 +7787,27 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
7772
7787
  const fuselage_hooks_1 = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
7773
7788
  const react_1 = __webpack_require__(/*! react */ "react");
7774
7789
  const react_dom_1 = __webpack_require__(/*! react-dom */ "react-dom");
7790
+ const contexts_1 = __webpack_require__(/*! ../../contexts */ "./src/contexts/index.ts");
7775
7791
  const Position = ({ anchor, children, placement, margin, className: _className, ...props }) => {
7776
7792
  const target = (0, react_1.useRef)(null);
7777
7793
  const { style: positionStyle, placement: positionPlacement } = (0, fuselage_hooks_1.usePosition)(anchor, target, (0, react_1.useMemo)(() => ({ placement, margin }), [placement, margin])) || {};
7778
7794
  const style = (0, react_1.useMemo)(() => ({ position: 'fixed', ...positionStyle }), [positionStyle]);
7795
+ const { document: ownerDocument } = (0, contexts_1.useOwnerDocument)();
7779
7796
  const [portalContainer] = (0, react_1.useState)(() => {
7780
- const prev = document.getElementById('position-container');
7797
+ const prev = ownerDocument.getElementById('position-container');
7781
7798
  if (prev) {
7782
7799
  return prev;
7783
7800
  }
7784
- const element = document.createElement('div');
7801
+ const element = ownerDocument.createElement('div');
7785
7802
  element.id = 'position-container';
7786
- document.body.appendChild(element);
7803
+ ownerDocument.body.appendChild(element);
7787
7804
  return element;
7788
7805
  });
7789
7806
  (0, react_1.useEffect)(() => () => {
7790
7807
  if (portalContainer.childNodes.length === 0) {
7791
- document.body.removeChild(portalContainer);
7808
+ ownerDocument.body.removeChild(portalContainer);
7792
7809
  }
7793
- }, [portalContainer]);
7810
+ }, [portalContainer, ownerDocument]);
7794
7811
  return (0, react_dom_1.createPortal)((0, react_1.cloneElement)(children, {
7795
7812
  ref: target,
7796
7813
  style,
@@ -8222,7 +8239,7 @@ exports.SelectAria = (0, react_1.forwardRef)(function SelectAria({ error, placeh
8222
8239
  const mergedRef = (0, fuselage_hooks_1.useMergedRefs)(outerRef, ref);
8223
8240
  const { triggerProps, valueProps, menuProps } = (0, react_aria_1.useSelect)({ isDisabled, ...props }, state, ref);
8224
8241
  const { focusProps, isFocusVisible } = (0, react_aria_1.useFocusRing)();
8225
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_aria_1.HiddenSelect, { state: state, triggerRef: ref, label: props.label, name: props.name, isDisabled: isDisabled }), (0, jsx_runtime_1.jsxs)(SelectTrigger_1.SelectTrigger, { ...(0, react_aria_1.mergeProps)(focusProps, triggerProps), ref: mergedRef, small: small, focus: isFocusVisible || state.isOpen, error: error, id: id, children: [(0, jsx_runtime_1.jsx)(Box_1.Box, { is: 'span', color: state.selectedItem ? 'default' : 'hint', ...valueProps, ...(small && { fontScale: 'c1' }), children: state.selectedItem ? state.selectedItem.rendered : placeholder }), (0, jsx_runtime_1.jsx)(Icon_1.Icon, { color: 'default', name: state.isOpen ? 'chevron-up' : 'chevron-down', size: 'x20' })] }), state.isOpen && ((0, jsx_runtime_1.jsx)(Popover_1.Popover, { state: state, triggerRef: ref, placement: 'bottom', offset: 4, containerPadding: 8, children: (0, jsx_runtime_1.jsx)(Options_1.OptionContainer, { style: {
8242
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Box_1.Box, { position: 'relative', size: 0, children: (0, jsx_runtime_1.jsx)(react_aria_1.HiddenSelect, { state: state, triggerRef: ref, label: props.label, name: props.name, isDisabled: isDisabled }) }), (0, jsx_runtime_1.jsxs)(SelectTrigger_1.SelectTrigger, { ...(0, react_aria_1.mergeProps)(focusProps, triggerProps), ref: mergedRef, small: small, focus: isFocusVisible || state.isOpen, error: error, id: id, children: [(0, jsx_runtime_1.jsx)(Box_1.Box, { is: 'span', color: state.selectedItem ? 'default' : 'hint', ...valueProps, ...(small && { fontScale: 'c1' }), children: state.selectedItem ? state.selectedItem.rendered : placeholder }), (0, jsx_runtime_1.jsx)(Icon_1.Icon, { color: 'default', name: state.isOpen ? 'chevron-up' : 'chevron-down', size: 'x20' })] }), state.isOpen && ((0, jsx_runtime_1.jsx)(Popover_1.Popover, { state: state, triggerRef: ref, placement: 'bottom', offset: 4, containerPadding: 8, children: (0, jsx_runtime_1.jsx)(Options_1.OptionContainer, { style: {
8226
8243
  width: borderBoxSize?.inlineSize,
8227
8244
  }, children: (0, jsx_runtime_1.jsx)(Listbox_1.ListBox, { ...menuProps, state: state }) }) }))] }));
8228
8245
  });
@@ -10507,7 +10524,7 @@ exports["default"] = StatusBullet;
10507
10524
 
10508
10525
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10509
10526
  const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
10510
- const Away = ({ size, className, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { ...props, width: '10', height: '10', viewBox: '0 0 10 10', className: `rcx-status-bullet rcx-status-bullet--away ${className} ${size === 'small' ? 'rcx-status-bullet--small' : ''}`, xmlns: 'http://www.w3.org/2000/svg', children: (0, jsx_runtime_1.jsx)("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M5.13337 9.93325C7.78434 9.93325 9.93338 7.78422 9.93338 5.13325C9.93338 2.48229 7.78434 0.333252 5.13337 0.333252C2.48241 0.333252 0.333374 2.48229 0.333374 5.13325C0.333374 7.78422 2.48241 9.93325 5.13337 9.93325ZM5.80004 2.33325C5.80004 1.96506 5.50156 1.66659 5.13337 1.66659C4.76518 1.66659 4.46671 1.96506 4.46671 2.33325V5.13325V5.45367L4.71691 5.65383L6.71691 7.25383C7.00442 7.48384 7.42395 7.43722 7.65395 7.14972C7.88396 6.86221 7.83735 6.44268 7.54984 6.21267L5.80004 4.81284V2.33325Z' }) }));
10527
+ const Away = ({ size, className, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { ...props, width: '10', height: '10', viewBox: '0 0 10 10', "aria-hidden": 'true', className: `rcx-status-bullet rcx-status-bullet--away ${className} ${size === 'small' ? 'rcx-status-bullet--small' : ''}`, xmlns: 'http://www.w3.org/2000/svg', children: (0, jsx_runtime_1.jsx)("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M5.13337 9.93325C7.78434 9.93325 9.93338 7.78422 9.93338 5.13325C9.93338 2.48229 7.78434 0.333252 5.13337 0.333252C2.48241 0.333252 0.333374 2.48229 0.333374 5.13325C0.333374 7.78422 2.48241 9.93325 5.13337 9.93325ZM5.80004 2.33325C5.80004 1.96506 5.50156 1.66659 5.13337 1.66659C4.76518 1.66659 4.46671 1.96506 4.46671 2.33325V5.13325V5.45367L4.71691 5.65383L6.71691 7.25383C7.00442 7.48384 7.42395 7.43722 7.65395 7.14972C7.88396 6.86221 7.83735 6.44268 7.54984 6.21267L5.80004 4.81284V2.33325Z' }) }));
10511
10528
  exports["default"] = Away;
10512
10529
 
10513
10530
 
@@ -10522,7 +10539,7 @@ exports["default"] = Away;
10522
10539
 
10523
10540
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10524
10541
  const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
10525
- const Busy = ({ size, className, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { ...props, width: '10', height: '10', viewBox: '0 0 10 10', className: `rcx-status-bullet rcx-status-bullet--busy ${className} ${size === 'small' ? 'rcx-status-bullet--small' : ''}`, xmlns: 'http://www.w3.org/2000/svg', children: (0, jsx_runtime_1.jsx)("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M5.13337 9.93325C7.78434 9.93325 9.93338 7.78422 9.93338 5.13325C9.93338 2.48229 7.78434 0.333252 5.13337 0.333252C2.48241 0.333252 0.333374 2.48229 0.333374 5.13325C0.333374 7.78422 2.48241 9.93325 5.13337 9.93325ZM3.53338 4.46655C3.16519 4.46655 2.86671 4.76503 2.86671 5.13322C2.86671 5.50141 3.16519 5.79989 3.53338 5.79989H6.73338C7.10157 5.79989 7.40004 5.50141 7.40004 5.13322C7.40004 4.76503 7.10157 4.46655 6.73338 4.46655H3.53338Z' }) }));
10542
+ const Busy = ({ size, className, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { ...props, width: '10', height: '10', viewBox: '0 0 10 10', "aria-hidden": 'true', className: `rcx-status-bullet rcx-status-bullet--busy ${className} ${size === 'small' ? 'rcx-status-bullet--small' : ''}`, xmlns: 'http://www.w3.org/2000/svg', children: (0, jsx_runtime_1.jsx)("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M5.13337 9.93325C7.78434 9.93325 9.93338 7.78422 9.93338 5.13325C9.93338 2.48229 7.78434 0.333252 5.13337 0.333252C2.48241 0.333252 0.333374 2.48229 0.333374 5.13325C0.333374 7.78422 2.48241 9.93325 5.13337 9.93325ZM3.53338 4.46655C3.16519 4.46655 2.86671 4.76503 2.86671 5.13322C2.86671 5.50141 3.16519 5.79989 3.53338 5.79989H6.73338C7.10157 5.79989 7.40004 5.50141 7.40004 5.13322C7.40004 4.76503 7.10157 4.46655 6.73338 4.46655H3.53338Z' }) }));
10526
10543
  exports["default"] = Busy;
10527
10544
 
10528
10545
 
@@ -10537,7 +10554,7 @@ exports["default"] = Busy;
10537
10554
 
10538
10555
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10539
10556
  const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
10540
- const Disabled = ({ size, className, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { ...props, width: '24', height: '24', viewBox: '0 0 24 24', className: `rcx-status-bullet rcx-status-bullet--disabled ${className} ${size === 'small' ? 'rcx-status-bullet--small' : ''}`, xmlns: 'http://www.w3.org/2000/svg', children: (0, jsx_runtime_1.jsx)("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM13.3367 5.33333C13.3367 4.59695 12.7398 4 12.0034 4C11.267 4 10.67 4.59695 10.67 5.33333V14.6667C10.67 15.403 11.267 16 12.0034 16C12.7398 16 13.3367 15.403 13.3367 14.6667V5.33333ZM13.3367 18.6667C13.3367 17.9303 12.7398 17.3333 12.0034 17.3333C11.267 17.3333 10.67 17.9303 10.67 18.6667C10.67 19.403 11.267 20 12.0034 20C12.7398 20 13.3367 19.403 13.3367 18.6667Z' }) }));
10557
+ const Disabled = ({ size, className, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { ...props, width: '24', height: '24', viewBox: '0 0 24 24', "aria-hidden": 'true', className: `rcx-status-bullet rcx-status-bullet--disabled ${className} ${size === 'small' ? 'rcx-status-bullet--small' : ''}`, xmlns: 'http://www.w3.org/2000/svg', children: (0, jsx_runtime_1.jsx)("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM13.3367 5.33333C13.3367 4.59695 12.7398 4 12.0034 4C11.267 4 10.67 4.59695 10.67 5.33333V14.6667C10.67 15.403 11.267 16 12.0034 16C12.7398 16 13.3367 15.403 13.3367 14.6667V5.33333ZM13.3367 18.6667C13.3367 17.9303 12.7398 17.3333 12.0034 17.3333C11.267 17.3333 10.67 17.9303 10.67 18.6667C10.67 19.403 11.267 20 12.0034 20C12.7398 20 13.3367 19.403 13.3367 18.6667Z' }) }));
10541
10558
  exports["default"] = Disabled;
10542
10559
 
10543
10560
 
@@ -10552,7 +10569,7 @@ exports["default"] = Disabled;
10552
10569
 
10553
10570
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10554
10571
  const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
10555
- const Loading = ({ size, className, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { ...props, width: '12', height: '12', viewBox: '0 0 12 12', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', className: `rcx-status-bullet rcx-status-bullet--loading ${className} ${size === 'small' ? 'rcx-status-bullet--small' : ''}`, children: (0, jsx_runtime_1.jsx)("circle", { cx: '6', cy: '6', r: '5', className: 'rcx-status-bullet rcx-status-bullet--loading', strokeWidth: '2', strokeDasharray: '2 2' }) }));
10572
+ const Loading = ({ size, className, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { ...props, width: '12', height: '12', viewBox: '0 0 12 12', fill: 'none', "aria-hidden": 'true', xmlns: 'http://www.w3.org/2000/svg', className: `rcx-status-bullet rcx-status-bullet--loading ${className} ${size === 'small' ? 'rcx-status-bullet--small' : ''}`, children: (0, jsx_runtime_1.jsx)("circle", { cx: '6', cy: '6', r: '5', className: 'rcx-status-bullet rcx-status-bullet--loading', strokeWidth: '2', strokeDasharray: '2 2' }) }));
10556
10573
  exports["default"] = Loading;
10557
10574
 
10558
10575
 
@@ -10567,7 +10584,7 @@ exports["default"] = Loading;
10567
10584
 
10568
10585
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10569
10586
  const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
10570
- const Offline = ({ size, className, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { ...props, width: '12', height: '12', viewBox: '0 0 12 12', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', className: `rcx-status-bullet rcx-status-bullet--offline ${className} ${size === 'small' ? 'rcx-status-bullet--small' : ''}`, children: (0, jsx_runtime_1.jsx)("circle", { cx: '6', cy: '6', r: '5', className: `rcx-status-bullet rcx-status-bullet--offline`, strokeWidth: '2' }) }));
10587
+ const Offline = ({ size, className, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { ...props, width: '12', height: '12', viewBox: '0 0 12 12', fill: 'none', "aria-hidden": 'true', xmlns: 'http://www.w3.org/2000/svg', className: `rcx-status-bullet rcx-status-bullet--offline ${className} ${size === 'small' ? 'rcx-status-bullet--small' : ''}`, children: (0, jsx_runtime_1.jsx)("circle", { cx: '6', cy: '6', r: '5', className: `rcx-status-bullet rcx-status-bullet--offline`, strokeWidth: '2' }) }));
10571
10588
  exports["default"] = Offline;
10572
10589
 
10573
10590
 
@@ -10582,7 +10599,7 @@ exports["default"] = Offline;
10582
10599
 
10583
10600
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10584
10601
  const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
10585
- const Online = ({ size, className, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { ...props, width: '24', height: '24', viewBox: '0 0 24 24', className: `rcx-status-bullet rcx-status-bullet--online ${className} ${size === 'small' ? 'rcx-status-bullet--small' : ''}`, xmlns: 'http://www.w3.org/2000/svg', children: (0, jsx_runtime_1.jsx)("path", { d: 'M24 12.0001C24 18.6275 18.6274 24.0001 12 24.0001C5.37255 24.0001 -3.05176e-05 18.6275 -3.05176e-05 12.0001C-3.05176e-05 5.37271 5.37255 0.00012207 12 0.00012207C18.6274 0.00012207 24 5.37271 24 12.0001Z' }) }));
10602
+ const Online = ({ size, className, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { ...props, width: '24', height: '24', viewBox: '0 0 24 24', "aria-hidden": 'true', className: `rcx-status-bullet rcx-status-bullet--online ${className} ${size === 'small' ? 'rcx-status-bullet--small' : ''}`, xmlns: 'http://www.w3.org/2000/svg', children: (0, jsx_runtime_1.jsx)("path", { d: 'M24 12.0001C24 18.6275 18.6274 24.0001 12 24.0001C5.37255 24.0001 -3.05176e-05 18.6275 -3.05176e-05 12.0001C-3.05176e-05 5.37271 5.37255 0.00012207 12 0.00012207C18.6274 0.00012207 24 5.37271 24 12.0001Z' }) }));
10586
10603
  exports["default"] = Online;
10587
10604
 
10588
10605
 
@@ -11422,6 +11439,52 @@ __exportStar(__webpack_require__(/*! ./Tooltip */ "./src/components/Tooltip/inde
11422
11439
  __exportStar(__webpack_require__(/*! ./UrlInput */ "./src/components/UrlInput/index.ts"), exports);
11423
11440
 
11424
11441
 
11442
+ /***/ },
11443
+
11444
+ /***/ "./src/contexts/OwnerDocument.ts"
11445
+ /*!***************************************!*\
11446
+ !*** ./src/contexts/OwnerDocument.ts ***!
11447
+ \***************************************/
11448
+ (__unused_webpack_module, exports, __webpack_require__) {
11449
+
11450
+
11451
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
11452
+ exports.useOwnerDocument = exports.OwnerDocument = void 0;
11453
+ const react_1 = __webpack_require__(/*! react */ "react");
11454
+ exports.OwnerDocument = (0, react_1.createContext)({ document: window.document });
11455
+ const useOwnerDocument = () => {
11456
+ return (0, react_1.useContext)(exports.OwnerDocument);
11457
+ };
11458
+ exports.useOwnerDocument = useOwnerDocument;
11459
+
11460
+
11461
+ /***/ },
11462
+
11463
+ /***/ "./src/contexts/index.ts"
11464
+ /*!*******************************!*\
11465
+ !*** ./src/contexts/index.ts ***!
11466
+ \*******************************/
11467
+ (__unused_webpack_module, exports, __webpack_require__) {
11468
+
11469
+
11470
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11471
+ if (k2 === undefined) k2 = k;
11472
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11473
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11474
+ desc = { enumerable: true, get: function() { return m[k]; } };
11475
+ }
11476
+ Object.defineProperty(o, k2, desc);
11477
+ }) : (function(o, m, k, k2) {
11478
+ if (k2 === undefined) k2 = k;
11479
+ o[k2] = m[k];
11480
+ }));
11481
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11482
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11483
+ };
11484
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
11485
+ __exportStar(__webpack_require__(/*! ./OwnerDocument */ "./src/contexts/OwnerDocument.ts"), exports);
11486
+
11487
+
11425
11488
  /***/ },
11426
11489
 
11427
11490
  /***/ "./src/getPaletteColor.ts"
@@ -11894,6 +11957,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
11894
11957
  exports.useStyle = void 0;
11895
11958
  const css_in_js_1 = __webpack_require__(/*! @rocket.chat/css-in-js */ "@rocket.chat/css-in-js");
11896
11959
  const react_1 = __webpack_require__(/*! react */ "react");
11960
+ const contexts_1 = __webpack_require__(/*! ../contexts */ "./src/contexts/index.ts");
11897
11961
  const useStyle = (cssFn, arg) => {
11898
11962
  const content = (0, react_1.useMemo)(() => (cssFn ? cssFn(arg) : undefined), [arg, cssFn]);
11899
11963
  const className = (0, react_1.useMemo)(() => {
@@ -11903,17 +11967,18 @@ const useStyle = (cssFn, arg) => {
11903
11967
  return content ? (0, css_in_js_1.createClassName)(content) : undefined;
11904
11968
  }, [content]);
11905
11969
  (0, react_1.useDebugValue)(className);
11970
+ const { document } = (0, contexts_1.useOwnerDocument)();
11906
11971
  (0, react_1.useInsertionEffect)(() => {
11907
11972
  if (!content || !className) {
11908
11973
  return;
11909
11974
  }
11910
11975
  const escapedClassName = (0, css_in_js_1.escapeName)(className);
11911
11976
  const transpiledContent = (0, css_in_js_1.transpile)(`.${escapedClassName}`, content);
11912
- const detach = (0, css_in_js_1.attachRules)(transpiledContent);
11977
+ const detach = (0, css_in_js_1.attachRules)(transpiledContent, { document });
11913
11978
  return () => {
11914
11979
  setTimeout(detach, 1000);
11915
11980
  };
11916
- }, [className, content]);
11981
+ }, [className, content, document]);
11917
11982
  return className;
11918
11983
  };
11919
11984
  exports.useStyle = useStyle;
@@ -11943,13 +12008,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11943
12008
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11944
12009
  };
11945
12010
  Object.defineProperty(exports, "__esModule", ({ value: true }));
11946
- exports.useArrayLikeClassNameProp = exports.__setThrowErrorOnInvalidToken__ = exports.Palette = void 0;
12011
+ exports.useArrayLikeClassNameProp = exports.Var = exports.__setThrowErrorOnInvalidToken__ = exports.Palette = void 0;
11947
12012
  __webpack_require__(/*! ./index.scss */ "./src/index.scss");
11948
12013
  __exportStar(__webpack_require__(/*! ./components */ "./src/components/index.ts"), exports);
11949
12014
  __exportStar(__webpack_require__(/*! ./styleTokens */ "./src/styleTokens.ts"), exports);
12015
+ __exportStar(__webpack_require__(/*! ./contexts */ "./src/contexts/index.ts"), exports);
11950
12016
  var Theme_1 = __webpack_require__(/*! ./Theme */ "./src/Theme.ts");
11951
12017
  Object.defineProperty(exports, "Palette", ({ enumerable: true, get: function () { return Theme_1.Palette; } }));
11952
12018
  Object.defineProperty(exports, "__setThrowErrorOnInvalidToken__", ({ enumerable: true, get: function () { return Theme_1.__setThrowErrorOnInvalidToken__; } }));
12019
+ Object.defineProperty(exports, "Var", ({ enumerable: true, get: function () { return Theme_1.Var; } }));
11953
12020
  var useArrayLikeClassNameProp_1 = __webpack_require__(/*! ./hooks/useArrayLikeClassNameProp */ "./src/hooks/useArrayLikeClassNameProp.ts");
11954
12021
  Object.defineProperty(exports, "useArrayLikeClassNameProp", ({ enumerable: true, get: function () { return useArrayLikeClassNameProp_1.useArrayLikeClassNameProp; } }));
11955
12022