@vectara/vectara-ui 16.4.0 → 16.4.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.
@@ -59,11 +59,20 @@ export const VuiModal = (_a) => {
59
59
  onClose === null || onClose === void 0 ? void 0 : onClose();
60
60
  }, 0);
61
61
  };
62
+ // Handle outside clicks, but ignore clicks on notifications.
63
+ const handleClickOutside = (event) => {
64
+ const target = event.target;
65
+ // Check if the click is within a notification.
66
+ if (target.closest("[data-awareness='notification']")) {
67
+ return;
68
+ }
69
+ onCloseDelayed();
70
+ };
62
71
  const containerClasses = classNames("vuiModalContainer", {
63
72
  "vuiModalContainer-isLoaded": showTransition
64
73
  });
65
74
  const classes = classNames("vuiModal", `vuiModal--${color}`, `vuiModal--${size}`, className);
66
- return (_jsx(VuiPortal, { children: (isOpen || isContentVisible || showTransition) && (_jsx(VuiScreenBlock, Object.assign({ type: "modal", isHidden: !isOpen }, { children: _jsx(FocusOn, Object.assign({ onEscapeKey: onCloseDelayed, onClickOutside: canClickOutsideToClose ? onCloseDelayed : undefined,
75
+ return (_jsx(VuiPortal, { children: (isOpen || isContentVisible || showTransition) && (_jsx(VuiScreenBlock, Object.assign({ type: "modal", isHidden: !isOpen }, { children: _jsx(FocusOn, Object.assign({ onEscapeKey: onCloseDelayed, onClickOutside: canClickOutsideToClose ? handleClickOutside : undefined,
67
76
  // Enable manual focus return to work.
68
77
  returnFocus: false,
69
78
  // Enable focus on contents when it's open,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectara/vectara-ui",
3
- "version": "16.4.0",
3
+ "version": "16.4.1",
4
4
  "homepage": "./",
5
5
  "description": "Vectara's design system, codified as a React and Sass component library",
6
6
  "author": "Vectara",
@@ -218,6 +218,20 @@ export const PrimaryDrawer = () => {
218
218
  that the focus management and scroll locking still work as expected.
219
219
  </p>
220
220
  </VuiText>
221
+
222
+ <VuiSpacer size="m" />
223
+
224
+ <VuiButtonSecondary
225
+ color="primary"
226
+ onClick={() => {
227
+ addNotification({
228
+ color: "primary",
229
+ message: "Just some information, FYI"
230
+ });
231
+ }}
232
+ >
233
+ Add notification
234
+ </VuiButtonSecondary>
221
235
  </VuiModal>
222
236
 
223
237
  <VuiNotifications />