@vectara/vectara-ui 15.9.0 → 15.9.2

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.
@@ -46,19 +46,17 @@ export const VuiDrawer = (_a) => {
46
46
  (_a = returnFocusElRef.current) === null || _a === void 0 ? void 0 : _a.focus();
47
47
  returnFocusElRef.current = null;
48
48
  setShowTransition(false);
49
+ // Wait for the transition to complete before unmounting.
50
+ // This duration should match the CSS transition speed.
51
+ window.setTimeout(() => {
52
+ setIsContentVisible(false);
53
+ }, 200);
49
54
  }
50
55
  }, [isOpen]);
51
56
  // Allow contents to respond to blur events before unmounting.
52
57
  const onCloseDelayed = () => {
53
58
  window.setTimeout(() => {
54
- // First remove the transition class to trigger the exit animation.
55
- setShowTransition(false);
56
59
  onClose === null || onClose === void 0 ? void 0 : onClose();
57
- // Wait for the transition to complete before unmounting.
58
- // This duration should match the CSS transition speed.
59
- window.setTimeout(() => {
60
- setIsContentVisible(false);
61
- }, 200);
62
60
  }, 0);
63
61
  };
64
62
  // Handle outside clicks, but ignore clicks on notifications.
@@ -46,19 +46,17 @@ export const VuiModal = (_a) => {
46
46
  (_a = returnFocusElRef.current) === null || _a === void 0 ? void 0 : _a.focus();
47
47
  returnFocusElRef.current = null;
48
48
  setShowTransition(false);
49
+ // Wait for the transition to complete before unmounting.
50
+ // This duration should match the CSS transition speed.
51
+ window.setTimeout(() => {
52
+ setIsContentVisible(false);
53
+ }, 200);
49
54
  }
50
55
  }, [isOpen]);
51
56
  // Allow contents to respond to blur events before unmounting.
52
57
  const onCloseDelayed = () => {
53
58
  window.setTimeout(() => {
54
- // First remove the transition class to trigger the exit animation.
55
- setShowTransition(false);
56
59
  onClose === null || onClose === void 0 ? void 0 : onClose();
57
- // Wait for the transition to complete before unmounting.
58
- // This duration should match the CSS transition speed.
59
- window.setTimeout(() => {
60
- setIsContentVisible(false);
61
- }, 200);
62
60
  }, 0);
63
61
  };
64
62
  const containerClasses = classNames("vuiModalContainer", {
@@ -133,6 +133,11 @@ export const VuiPopover = (_a) => {
133
133
  (_a = returnFocusElRef.current) === null || _a === void 0 ? void 0 : _a.focus();
134
134
  returnFocusElRef.current = null;
135
135
  setShowTransition(false);
136
+ // Wait for the transition to complete before unmounting.
137
+ // This duration should match the CSS transition speed.
138
+ window.setTimeout(() => {
139
+ setIsContentVisible(false);
140
+ }, 200);
136
141
  }
137
142
  }, [isOpen]);
138
143
  // Allow contents to respond to blur events before unmounting, and also
@@ -140,14 +145,7 @@ export const VuiPopover = (_a) => {
140
145
  // outside of the popover.
141
146
  const onCloseDelayed = () => {
142
147
  window.setTimeout(() => {
143
- // First remove the transition class to trigger the exit animation.
144
- setShowTransition(false);
145
148
  setIsOpen(false);
146
- // Wait for the transition to complete before unmounting.
147
- // This duration should match the CSS transition speed.
148
- window.setTimeout(() => {
149
- setIsContentVisible(false);
150
- }, 200);
151
149
  }, 0);
152
150
  };
153
151
  // Always keep menu position up to date. If we tried to cache this inside
@@ -9,7 +9,7 @@ export const VuiTabsNavigator = ({ routes, popover }) => {
9
9
  const { getPath } = useVuiContext();
10
10
  const [isOpen, setIsOpen] = useState(false);
11
11
  const activeRoute = routes.find((route) => route.isActive || getPath().includes(route.href));
12
- return (_jsx(VuiPopover, Object.assign({}, popover, { isOpen: isOpen, setIsOpen: () => setIsOpen(!isOpen), button: _jsx("div", Object.assign({ className: "vuiTabs vuiTabs--s vuiTabs--enclosed" }, { children: _jsx(VuiTab, Object.assign({ isActive: true }, { children: (_a = activeRoute === null || activeRoute === void 0 ? void 0 : activeRoute.title) !== null && _a !== void 0 ? _a : "No selection" })) })), padding: "none" }, { children: _jsx(VuiTabs, Object.assign({ size: "s", tabStyle: "enclosed" }, { children: routes.map(({ href, title, render, testId, isActive }, index) => {
12
+ return (_jsx(VuiPopover, Object.assign({}, popover, { isOpen: isOpen, setIsOpen: () => setIsOpen(!isOpen), button: _jsx("div", Object.assign({ className: "vuiTabs vuiTabs--s vuiTabs--enclosed" }, { children: _jsx(VuiTab, Object.assign({ isActive: true }, { children: (_a = activeRoute === null || activeRoute === void 0 ? void 0 : activeRoute.title) !== null && _a !== void 0 ? _a : "No selection" })) })), padding: "none" }, { children: _jsx(VuiTabs, Object.assign({ size: "s", tabStyle: "enclosed", vertical: true }, { children: routes.map(({ href, title, render, testId, isActive }, index) => {
13
13
  const tabLink = (_jsx(VuiTab, Object.assign({ href: href, isActive: isActive !== null && isActive !== void 0 ? isActive : getPath().includes(href), "data-testid": testId, onClick: () => setIsOpen(false) }, { children: title }), index));
14
14
  if (render)
15
15
  return render(tabLink);
@@ -7,6 +7,7 @@ type Props = {
7
7
  size?: TabSize;
8
8
  fullWidth?: boolean;
9
9
  tabStyle?: TabStyle;
10
+ vertical?: boolean;
10
11
  };
11
- export declare const VuiTabs: ({ children, className, append, size, fullWidth, tabStyle }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const VuiTabs: ({ children, className, append, size, fullWidth, tabStyle, vertical }: Props) => import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -1,8 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import classNames from "classnames";
3
- export const VuiTabs = ({ children, className, append, size = "s", fullWidth, tabStyle = "open" }) => {
3
+ export const VuiTabs = ({ children, className, append, size = "s", fullWidth, tabStyle = "open", vertical }) => {
4
4
  const classes = classNames(className, "vuiTabs", `vuiTabs--${size}`, `vuiTabs--${tabStyle}`, {
5
- "vuiTabs--fullWidth": fullWidth
5
+ "vuiTabs--fullWidth": fullWidth,
6
+ "vuiTabs--vertical": vertical
6
7
  });
7
8
  return (_jsxs("div", Object.assign({ className: classes }, { children: [_jsx("div", Object.assign({ className: "vuiTabs__tabs" }, { children: children })), append && _jsx("div", Object.assign({ className: "vuiTabs__appendedContent" }, { children: append }))] })));
8
9
  };
@@ -7,6 +7,23 @@
7
7
  column-gap: $sizeXxs;
8
8
  }
9
9
 
10
+ .vuiTabs--vertical {
11
+ .vuiTabs__tabs {
12
+ flex-direction: column;
13
+ align-items: stretch;
14
+
15
+ .vuiTab {
16
+ &:first-child {
17
+ padding-left: $sizeXxs;
18
+ }
19
+
20
+ &:last-child {
21
+ padding-right: $sizeXxs;
22
+ }
23
+ }
24
+ }
25
+ }
26
+
10
27
  .vuiTabs--fullWidth {
11
28
  .vuiTabs__tabs {
12
29
  flex-grow: 1;
@@ -5433,6 +5433,17 @@ h2.react-datepicker__current-month {
5433
5433
  column-gap: 4px;
5434
5434
  }
5435
5435
 
5436
+ .vuiTabs--vertical .vuiTabs__tabs {
5437
+ flex-direction: column;
5438
+ align-items: stretch;
5439
+ }
5440
+ .vuiTabs--vertical .vuiTabs__tabs .vuiTab:first-child {
5441
+ padding-left: 4px;
5442
+ }
5443
+ .vuiTabs--vertical .vuiTabs__tabs .vuiTab:last-child {
5444
+ padding-right: 4px;
5445
+ }
5446
+
5436
5447
  .vuiTabs--fullWidth .vuiTabs__tabs {
5437
5448
  flex-grow: 1;
5438
5449
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectara/vectara-ui",
3
- "version": "15.9.0",
3
+ "version": "15.9.2",
4
4
  "homepage": "./",
5
5
  "description": "Vectara's design system, codified as a React and Sass component library",
6
6
  "author": "Vectara",