@vectara/vectara-ui 15.9.4 → 15.9.6

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.
@@ -89,7 +89,7 @@
89
89
 
90
90
  .vuiAppSideNav--l {
91
91
  .vuiAppSideNav__inner {
92
- padding: 20px 12px 0;
92
+ padding: 4px 8px 0;
93
93
  }
94
94
 
95
95
  .vuiAppSideNavLink {
@@ -1,15 +1,17 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import { VuiPopover } from "../popover/Popover";
4
4
  import { VuiTab } from "./Tab";
5
5
  import { VuiTabs } from "./Tabs";
6
6
  import { useVuiContext } from "../context/Context";
7
+ import { VuiIcon } from "../icon/Icon";
8
+ import { BiDotsVertical } from "react-icons/bi";
7
9
  export const VuiTabsNavigator = ({ routes, popover }) => {
8
10
  var _a;
9
11
  const { getPath } = useVuiContext();
10
12
  const [isOpen, setIsOpen] = useState(false);
11
13
  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", vertical: true }, { children: routes.map(({ href, title, render, testId, isActive }, index) => {
14
+ return (_jsx(VuiPopover, Object.assign({}, popover, { isOpen: isOpen, setIsOpen: () => setIsOpen(!isOpen), button: _jsx("button", Object.assign({ className: "vuiTabsNavigatorButton" }, { children: _jsxs("div", Object.assign({ className: "vuiTabsNavigatorButton__inner" }, { children: [_jsx(VuiIcon, Object.assign({ size: "xs" }, { children: _jsx(BiDotsVertical, {}) })), _jsx("div", { 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
15
  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
16
  if (render)
15
17
  return render(tabLink);
@@ -1,5 +1,6 @@
1
1
  @import "./open";
2
2
  @import "./enclosed";
3
+ @import "./tabsNavigator";
3
4
 
4
5
  .vuiTabs {
5
6
  align-items: center;
@@ -0,0 +1,29 @@
1
+ .vuiTabsNavigatorButton {
2
+ font-size: $fontSizeStandard;
3
+ background-color: var(--vui-color-light-shade);
4
+ border-radius: $sizeXxs;
5
+ padding: 6px $sizeXs;
6
+
7
+ &:hover {
8
+ .vuiTabsNavigatorButton__inner {
9
+ box-shadow: $shadowLargeEnd;
10
+ }
11
+ }
12
+ }
13
+
14
+ .vuiTabsNavigatorButton__inner {
15
+ display: flex;
16
+ align-items: center;
17
+ gap: $sizeXs;
18
+ padding: $sizeXxs $sizeS;
19
+ text-overflow: ellipsis;
20
+ white-space: nowrap;
21
+ flex-grow: 0;
22
+ flex-shrink: 0;
23
+ text-decoration: none;
24
+ color: var(--vui-color-full-shade);
25
+ background-color: var(--vui-color-empty-shade);
26
+ box-shadow: $shadowSmallEnd;
27
+ border-radius: $sizeXxs;
28
+ transition: box-shadow $transitionSpeed;
29
+ }
@@ -500,7 +500,7 @@ fieldset {
500
500
  }
501
501
 
502
502
  .vuiAppSideNav--l .vuiAppSideNav__inner {
503
- padding: 20px 12px 0;
503
+ padding: 4px 8px 0;
504
504
  }
505
505
  .vuiAppSideNav--l .vuiAppSideNavLink {
506
506
  display: block;
@@ -5427,6 +5427,33 @@ h2.react-datepicker__current-month {
5427
5427
  box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
5428
5428
  }
5429
5429
 
5430
+ .vuiTabsNavigatorButton {
5431
+ font-size: 14px;
5432
+ background-color: var(--vui-color-light-shade);
5433
+ border-radius: 4px;
5434
+ padding: 6px 8px;
5435
+ }
5436
+ .vuiTabsNavigatorButton:hover .vuiTabsNavigatorButton__inner {
5437
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;
5438
+ }
5439
+
5440
+ .vuiTabsNavigatorButton__inner {
5441
+ display: flex;
5442
+ align-items: center;
5443
+ gap: 8px;
5444
+ padding: 4px 12px;
5445
+ text-overflow: ellipsis;
5446
+ white-space: nowrap;
5447
+ flex-grow: 0;
5448
+ flex-shrink: 0;
5449
+ text-decoration: none;
5450
+ color: var(--vui-color-full-shade);
5451
+ background-color: var(--vui-color-empty-shade);
5452
+ box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
5453
+ border-radius: 4px;
5454
+ transition: box-shadow 0.2s;
5455
+ }
5456
+
5430
5457
  .vuiTabs {
5431
5458
  align-items: center;
5432
5459
  justify-content: space-between;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectara/vectara-ui",
3
- "version": "15.9.4",
3
+ "version": "15.9.6",
4
4
  "homepage": "./",
5
5
  "description": "Vectara's design system, codified as a React and Sass component library",
6
6
  "author": "Vectara",
@@ -16,6 +16,11 @@ export const tabs = {
16
16
  name: "Tabs",
17
17
  path: "/tabs",
18
18
  examples: [
19
+ {
20
+ name: "Tabs Navigator",
21
+ component: <TabsNavigator />,
22
+ source: TabsNavigatorSource.default.toString()
23
+ },
19
24
  {
20
25
  name: "Small",
21
26
  component: <Small />,
@@ -40,11 +45,6 @@ export const tabs = {
40
45
  name: "Enclosed",
41
46
  component: <Enclosed />,
42
47
  source: EnclosedSource.default.toString()
43
- },
44
- {
45
- name: "Tabs Navigator",
46
- component: <TabsNavigator />,
47
- source: TabsNavigatorSource.default.toString()
48
48
  }
49
49
  ]
50
50
  };