@seamly/web-ui 21.0.1 → 21.0.2-beta.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.
@@ -13990,23 +13990,28 @@ const ChatScrollProvider = ({ children }) => {
13990
13990
 
13991
13991
 
13992
13992
 
13993
- const CollapseButton = ({
13994
- onClick
13995
- }) => {
13993
+
13994
+ const CollapseButton = () => {
13996
13995
  const {
13997
13996
  t
13998
13997
  } = useI18n();
13999
- const handleClick = (0,hooks_.useCallback)(() => onClick(), [onClick]);
14000
- return (0,jsx_runtime_namespaceObject.jsx)("button", {
13998
+ const {
13999
+ isOpen,
14000
+ closeChat
14001
+ } = useVisibility();
14002
+ const {
14003
+ isWindow
14004
+ } = useSeamlyLayoutMode();
14005
+ return isOpen && isWindow ? (0,jsx_runtime_namespaceObject.jsx)("button", {
14001
14006
  type: "button",
14002
14007
  className: css_className('button', 'collapse-button'),
14003
- onClick: handleClick,
14008
+ onClick: closeChat,
14004
14009
  children: (0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
14005
14010
  name: "chevronDown",
14006
14011
  size: "32",
14007
14012
  alt: t('window.srCollapseButton')
14008
14013
  })
14009
- });
14014
+ }) : null;
14010
14015
  };
14011
14016
  /* harmony default export */ const collapse_button = (CollapseButton);
14012
14017
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/chat-status/index.tsx
@@ -14097,7 +14102,6 @@ function chat_frame_defineProperty(obj, key, value) { if (key in obj) { Object.d
14097
14102
 
14098
14103
 
14099
14104
 
14100
-
14101
14105
  function ChatFrame({
14102
14106
  children,
14103
14107
  interruptComponent: InterruptComponent
@@ -14107,12 +14111,8 @@ function ChatFrame({
14107
14111
  meta
14108
14112
  } = useInterrupt();
14109
14113
  const {
14110
- isOpen,
14111
- closeChat
14114
+ isOpen
14112
14115
  } = useVisibility();
14113
- const {
14114
- isWindow
14115
- } = useSeamlyLayoutMode();
14116
14116
  if (hasInterrupt) {
14117
14117
  if (isOpen) {
14118
14118
  return (0,jsx_runtime_namespaceObject.jsx)(InterruptComponent, chat_frame_objectSpread({}, meta));
@@ -14123,9 +14123,7 @@ function ChatFrame({
14123
14123
  children: [(0,jsx_runtime_namespaceObject.jsxs)(chat_scroll_provider, {
14124
14124
  children: [(0,jsx_runtime_namespaceObject.jsxs)("div", {
14125
14125
  className: css_className('chat__container__header'),
14126
- children: [(0,jsx_runtime_namespaceObject.jsx)(TranslationStatus, {}), isOpen && isWindow && (0,jsx_runtime_namespaceObject.jsx)(collapse_button, {
14127
- onClick: closeChat
14128
- })]
14126
+ children: [(0,jsx_runtime_namespaceObject.jsx)(TranslationStatus, {}), (0,jsx_runtime_namespaceObject.jsx)(collapse_button, {})]
14129
14127
  }), children]
14130
14128
  }), (0,jsx_runtime_namespaceObject.jsx)(entry_container, {}), isOpen && (0,jsx_runtime_namespaceObject.jsx)(AppOptions, {})]
14131
14129
  });
@@ -14177,6 +14175,7 @@ const Header = ({
14177
14175
 
14178
14176
 
14179
14177
 
14178
+
14180
14179
  const Interrupt = ({
14181
14180
  originalError,
14182
14181
  title,
@@ -14212,10 +14211,10 @@ const Interrupt = ({
14212
14211
  }
14213
14212
  focusSkiplinkTarget();
14214
14213
  };
14215
- return !isExpiredError ? (0,jsx_runtime_namespaceObject.jsx)("section", {
14214
+ return !isExpiredError ? (0,jsx_runtime_namespaceObject.jsxs)("section", {
14216
14215
  className: css_className('interrupt'),
14217
14216
  "aria-labelledby": headingId,
14218
- children: (0,jsx_runtime_namespaceObject.jsxs)("div", {
14217
+ children: [(0,jsx_runtime_namespaceObject.jsx)(collapse_button, {}), (0,jsx_runtime_namespaceObject.jsxs)("div", {
14219
14218
  className: css_className('interrupt__body'),
14220
14219
  children: [(0,jsx_runtime_namespaceObject.jsx)("h2", {
14221
14220
  id: headingId,
@@ -14233,7 +14232,7 @@ const Interrupt = ({
14233
14232
  children: buttonText
14234
14233
  })
14235
14234
  })]
14236
- })
14235
+ })]
14237
14236
  }) : (0,jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {});
14238
14237
  };
14239
14238
  /* harmony default export */ const interrupt = (Interrupt);