@vectara/vectara-ui 15.3.0 → 15.4.0
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.
- package/lib/components/table/Table.js +4 -1
- package/lib/components/table/_index.scss +8 -0
- package/lib/components/table/types.d.ts +1 -0
- package/lib/styles/index.css +6 -0
- package/package.json +8 -1
- package/src/docs/Docs.tsx +102 -0
- package/src/docs/Home.tsx +123 -0
- package/src/docs/Page.tsx +79 -0
- package/src/docs/components/Example.tsx +44 -0
- package/src/docs/components/HeaderLogo.tsx +26 -0
- package/src/docs/components/Subsection.tsx +22 -0
- package/src/docs/index.scss +3 -0
- package/src/docs/pages/accordion/Accordion.tsx +128 -0
- package/src/docs/pages/accordion/index.tsx +11 -0
- package/src/docs/pages/accountButton/AccountButton.tsx +46 -0
- package/src/docs/pages/accountButton/index.tsx +11 -0
- package/src/docs/pages/app/AltLayout.tsx +54 -0
- package/src/docs/pages/app/App.tsx +147 -0
- package/src/docs/pages/app/Layout.tsx +272 -0
- package/src/docs/pages/app/appExample.scss +57 -0
- package/src/docs/pages/app/index.tsx +11 -0
- package/src/docs/pages/badge/BadgeColors.tsx +13 -0
- package/src/docs/pages/badge/ClickableBadges.tsx +19 -0
- package/src/docs/pages/badge/DismissibleBadges.tsx +27 -0
- package/src/docs/pages/badge/MaxWidth.tsx +12 -0
- package/src/docs/pages/badge/Selection.tsx +36 -0
- package/src/docs/pages/badge/index.tsx +43 -0
- package/src/docs/pages/badge/maxWidth.scss +3 -0
- package/src/docs/pages/button/Colors.tsx +111 -0
- package/src/docs/pages/button/IconButton.tsx +114 -0
- package/src/docs/pages/button/Icons.tsx +25 -0
- package/src/docs/pages/button/Link.tsx +36 -0
- package/src/docs/pages/button/Sizes.tsx +76 -0
- package/src/docs/pages/button/Submit.tsx +16 -0
- package/src/docs/pages/button/Truncate.tsx +20 -0
- package/src/docs/pages/button/index.tsx +57 -0
- package/src/docs/pages/callout/Colors.tsx +51 -0
- package/src/docs/pages/callout/Variations.tsx +76 -0
- package/src/docs/pages/callout/index.tsx +22 -0
- package/src/docs/pages/card/Card.tsx +123 -0
- package/src/docs/pages/card/Expandable.tsx +153 -0
- package/src/docs/pages/card/Scrollable.tsx +39 -0
- package/src/docs/pages/card/SimpleCard.tsx +149 -0
- package/src/docs/pages/card/index.tsx +36 -0
- package/src/docs/pages/card/scrollableExample.scss +4 -0
- package/src/docs/pages/chat/Chat.tsx +158 -0
- package/src/docs/pages/chat/index.tsx +11 -0
- package/src/docs/pages/checkbox/WithLabel.tsx +51 -0
- package/src/docs/pages/checkbox/index.tsx +11 -0
- package/src/docs/pages/code/DisabledFeatures.tsx +46 -0
- package/src/docs/pages/code/FullHeight.tsx +50 -0
- package/src/docs/pages/code/Languages.tsx +68 -0
- package/src/docs/pages/code/Scrolling.tsx +51 -0
- package/src/docs/pages/code/index.tsx +36 -0
- package/src/docs/pages/codeEditor/CodeEditor.tsx +23 -0
- package/src/docs/pages/codeEditor/index.tsx +15 -0
- package/src/docs/pages/copyButton/CopyButton.tsx +33 -0
- package/src/docs/pages/copyButton/index.tsx +11 -0
- package/src/docs/pages/datePicker/DatePicker.tsx +44 -0
- package/src/docs/pages/datePicker/DateRangePicker.tsx +55 -0
- package/src/docs/pages/datePicker/Inline.tsx +8 -0
- package/src/docs/pages/datePicker/WithTimeSelection.tsx +30 -0
- package/src/docs/pages/datePicker/index.tsx +36 -0
- package/src/docs/pages/drawer/DangerDrawer.tsx +28 -0
- package/src/docs/pages/drawer/PrimaryDrawer.tsx +191 -0
- package/src/docs/pages/drawer/index.tsx +22 -0
- package/src/docs/pages/errorBoundary/ErrorBoundary.tsx +36 -0
- package/src/docs/pages/errorBoundary/index.tsx +12 -0
- package/src/docs/pages/flex/Column.tsx +10 -0
- package/src/docs/pages/flex/Layouts.tsx +101 -0
- package/src/docs/pages/flex/Spacing.tsx +18 -0
- package/src/docs/pages/flex/Wrap.tsx +25 -0
- package/src/docs/pages/flex/flexExample.scss +12 -0
- package/src/docs/pages/flex/index.tsx +38 -0
- package/src/docs/pages/formGroup/FormGroup.tsx +93 -0
- package/src/docs/pages/formGroup/NonFormElement.tsx +19 -0
- package/src/docs/pages/formGroup/Size.tsx +14 -0
- package/src/docs/pages/formGroup/index.tsx +29 -0
- package/src/docs/pages/grid/Grid.tsx +23 -0
- package/src/docs/pages/grid/GridAlignment.tsx +83 -0
- package/src/docs/pages/grid/GridResponsive.tsx +74 -0
- package/src/docs/pages/grid/GridSimple.tsx +41 -0
- package/src/docs/pages/grid/GridSpanning.tsx +86 -0
- package/src/docs/pages/grid/grid.scss +4 -0
- package/src/docs/pages/grid/index.tsx +43 -0
- package/src/docs/pages/horizontalRule/HorizontalRule.tsx +18 -0
- package/src/docs/pages/horizontalRule/index.tsx +11 -0
- package/src/docs/pages/icon/Colors.tsx +95 -0
- package/src/docs/pages/icon/InlineText.tsx +15 -0
- package/src/docs/pages/icon/Sizes.tsx +20 -0
- package/src/docs/pages/icon/index.tsx +29 -0
- package/src/docs/pages/image/Gallery.tsx +92 -0
- package/src/docs/pages/image/Image.tsx +61 -0
- package/src/docs/pages/image/index.tsx +22 -0
- package/src/docs/pages/inProgress/InProgress.tsx +5 -0
- package/src/docs/pages/inProgress/index.tsx +12 -0
- package/src/docs/pages/infoList/HorizontalList.tsx +11 -0
- package/src/docs/pages/infoList/InfoList.tsx +28 -0
- package/src/docs/pages/infoList/index.tsx +22 -0
- package/src/docs/pages/infoMenu/InfoMenu.tsx +62 -0
- package/src/docs/pages/infoMenu/index.tsx +11 -0
- package/src/docs/pages/infoTable/Complex.tsx +143 -0
- package/src/docs/pages/infoTable/Simple.tsx +155 -0
- package/src/docs/pages/infoTable/index.tsx +22 -0
- package/src/docs/pages/input/FullWidth.tsx +18 -0
- package/src/docs/pages/input/Large.tsx +18 -0
- package/src/docs/pages/input/NumberInput.tsx +20 -0
- package/src/docs/pages/input/PasswordInput.tsx +27 -0
- package/src/docs/pages/input/TextInput.tsx +18 -0
- package/src/docs/pages/input/index.tsx +43 -0
- package/src/docs/pages/itemsInput/ItemsInput.tsx +28 -0
- package/src/docs/pages/itemsInput/index.tsx +12 -0
- package/src/docs/pages/label/Label.tsx +18 -0
- package/src/docs/pages/label/index.tsx +11 -0
- package/src/docs/pages/link/Internal.tsx +19 -0
- package/src/docs/pages/link/Link.tsx +39 -0
- package/src/docs/pages/link/index.tsx +22 -0
- package/src/docs/pages/list/List.tsx +56 -0
- package/src/docs/pages/list/index.tsx +11 -0
- package/src/docs/pages/menu/Menu.tsx +51 -0
- package/src/docs/pages/menu/NoBorder.tsx +51 -0
- package/src/docs/pages/menu/NoTitle.tsx +30 -0
- package/src/docs/pages/menu/index.tsx +29 -0
- package/src/docs/pages/modal/DangerModal.tsx +28 -0
- package/src/docs/pages/modal/PrimaryModal.tsx +90 -0
- package/src/docs/pages/modal/index.tsx +22 -0
- package/src/docs/pages/notifications/Notifications.tsx +62 -0
- package/src/docs/pages/notifications/index.tsx +11 -0
- package/src/docs/pages/optionsButton/Primary.tsx +57 -0
- package/src/docs/pages/optionsButton/Secondary.tsx +58 -0
- package/src/docs/pages/optionsButton/index.tsx +22 -0
- package/src/docs/pages/optionsList/IconsAndColors.tsx +49 -0
- package/src/docs/pages/optionsList/OptionsList.tsx +32 -0
- package/src/docs/pages/optionsList/ScrollableOptionsList.tsx +33 -0
- package/src/docs/pages/optionsList/SelectableOptionsList.tsx +43 -0
- package/src/docs/pages/optionsList/index.tsx +36 -0
- package/src/docs/pages/pagination/Pagination.tsx +12 -0
- package/src/docs/pages/pagination/index.tsx +15 -0
- package/src/docs/pages/panel/Panel.tsx +220 -0
- package/src/docs/pages/panel/circles.png +0 -0
- package/src/docs/pages/panel/index.tsx +11 -0
- package/src/docs/pages/panel/lines.png +0 -0
- package/src/docs/pages/popover/IconButton.tsx +29 -0
- package/src/docs/pages/popover/Popover.tsx +79 -0
- package/src/docs/pages/popover/index.tsx +22 -0
- package/src/docs/pages/portalContainer/PortalContainer.tsx +36 -0
- package/src/docs/pages/portalContainer/index.tsx +15 -0
- package/src/docs/pages/progressBar/ProgressBar.tsx +32 -0
- package/src/docs/pages/progressBar/index.tsx +11 -0
- package/src/docs/pages/prompt/Prompt.tsx +3 -0
- package/src/docs/pages/prompt/index.tsx +11 -0
- package/src/docs/pages/radioButton/WithLabel.tsx +35 -0
- package/src/docs/pages/radioButton/index.tsx +11 -0
- package/src/docs/pages/searchInput/Clearable.tsx +31 -0
- package/src/docs/pages/searchInput/Large.tsx +29 -0
- package/src/docs/pages/searchInput/SearchInput.tsx +31 -0
- package/src/docs/pages/searchInput/Suggestions.tsx +70 -0
- package/src/docs/pages/searchInput/ValueSuggestions.tsx +114 -0
- package/src/docs/pages/searchInput/index.tsx +43 -0
- package/src/docs/pages/searchResult/Minimal.tsx +11 -0
- package/src/docs/pages/searchResult/SearchResults.tsx +76 -0
- package/src/docs/pages/searchResult/index.tsx +22 -0
- package/src/docs/pages/searchSelect/Async.tsx +153 -0
- package/src/docs/pages/searchSelect/FormGroup.tsx +94 -0
- package/src/docs/pages/searchSelect/SearchSelect.tsx +42 -0
- package/src/docs/pages/searchSelect/SingleSelect.tsx +44 -0
- package/src/docs/pages/searchSelect/WithBadges.tsx +85 -0
- package/src/docs/pages/searchSelect/index.scss +3 -0
- package/src/docs/pages/searchSelect/index.tsx +43 -0
- package/src/docs/pages/select/Select.tsx +15 -0
- package/src/docs/pages/select/index.tsx +11 -0
- package/src/docs/pages/setting/MinimalSetting.tsx +61 -0
- package/src/docs/pages/setting/Setting.tsx +64 -0
- package/src/docs/pages/setting/index.tsx +22 -0
- package/src/docs/pages/skeleton/Basic.tsx +16 -0
- package/src/docs/pages/skeleton/CardContent.tsx +16 -0
- package/src/docs/pages/skeleton/Colors.tsx +14 -0
- package/src/docs/pages/skeleton/Rows.tsx +25 -0
- package/src/docs/pages/skeleton/index.tsx +36 -0
- package/src/docs/pages/spacer/Spacer.tsx +20 -0
- package/src/docs/pages/spacer/index.tsx +13 -0
- package/src/docs/pages/spacer/spacerExample.scss +5 -0
- package/src/docs/pages/spinner/Colors.tsx +20 -0
- package/src/docs/pages/spinner/Inline.tsx +15 -0
- package/src/docs/pages/spinner/Sizes.tsx +14 -0
- package/src/docs/pages/spinner/_index.scss +5 -0
- package/src/docs/pages/spinner/index.tsx +30 -0
- package/src/docs/pages/stat/InCards.tsx +11 -0
- package/src/docs/pages/stat/Stat.tsx +5 -0
- package/src/docs/pages/stat/index.tsx +22 -0
- package/src/docs/pages/statList/StatList.tsx +29 -0
- package/src/docs/pages/statList/index.tsx +15 -0
- package/src/docs/pages/status/Status.tsx +23 -0
- package/src/docs/pages/status/index.tsx +15 -0
- package/src/docs/pages/steps/BasicSteps.tsx +25 -0
- package/src/docs/pages/steps/CustomSteps.tsx +78 -0
- package/src/docs/pages/steps/InteractiveSteps.tsx +44 -0
- package/src/docs/pages/steps/StepSizes.tsx +48 -0
- package/src/docs/pages/steps/StepStatuses.tsx +43 -0
- package/src/docs/pages/steps/index.tsx +43 -0
- package/src/docs/pages/summary/Markdown.tsx +37 -0
- package/src/docs/pages/summary/Rtl.tsx +15 -0
- package/src/docs/pages/summary/Summary.tsx +15 -0
- package/src/docs/pages/summary/index.tsx +29 -0
- package/src/docs/pages/superCheckboxGroup/LabelOnly.tsx +38 -0
- package/src/docs/pages/superCheckboxGroup/WithDescription.tsx +41 -0
- package/src/docs/pages/superCheckboxGroup/index.tsx +22 -0
- package/src/docs/pages/superRadioGroup/LabelOnly.tsx +38 -0
- package/src/docs/pages/superRadioGroup/WithDescription.tsx +41 -0
- package/src/docs/pages/superRadioGroup/index.tsx +22 -0
- package/src/docs/pages/table/Table.tsx +450 -0
- package/src/docs/pages/table/createFakePeople.ts +117 -0
- package/src/docs/pages/table/index.tsx +11 -0
- package/src/docs/pages/tabs/Enclosed.tsx +40 -0
- package/src/docs/pages/tabs/FullWidth.tsx +22 -0
- package/src/docs/pages/tabs/Links.tsx +30 -0
- package/src/docs/pages/tabs/Medium.tsx +31 -0
- package/src/docs/pages/tabs/Small.tsx +37 -0
- package/src/docs/pages/tabs/index.tsx +43 -0
- package/src/docs/pages/text/Text.tsx +138 -0
- package/src/docs/pages/text/TextColor.tsx +15 -0
- package/src/docs/pages/text/Title.tsx +16 -0
- package/src/docs/pages/text/Typography.tsx +97 -0
- package/src/docs/pages/text/index.tsx +36 -0
- package/src/docs/pages/textArea/TextArea.tsx +16 -0
- package/src/docs/pages/textArea/TextAreaResizeable.tsx +17 -0
- package/src/docs/pages/textArea/index.tsx +22 -0
- package/src/docs/pages/theme/Theme.tsx +54 -0
- package/src/docs/pages/theme/index.tsx +15 -0
- package/src/docs/pages/timeline/Timeline.tsx +149 -0
- package/src/docs/pages/timeline/index.tsx +11 -0
- package/src/docs/pages/toggle/Toggle.tsx +8 -0
- package/src/docs/pages/toggle/index.tsx +11 -0
- package/src/docs/pages/tooltip/Tooltip.tsx +29 -0
- package/src/docs/pages/tooltip/index.tsx +15 -0
- package/src/docs/pages/topicButton/Link.tsx +11 -0
- package/src/docs/pages/topicButton/index.tsx +15 -0
- package/src/docs/pages/truncate/TruncateString.tsx +13 -0
- package/src/docs/pages/truncate/index.tsx +11 -0
- package/src/docs/pages/validation/Validation.tsx +67 -0
- package/src/docs/pages/validation/index.tsx +11 -0
- package/src/docs/pages.tsx +152 -0
- package/.github/CODEOWNERS +0 -3
- package/.github/workflows/deploy-pages-site.yml +0 -26
- package/.github/workflows/deploy-pr-preview.yml +0 -25
- package/.github/workflows/publish-on-version-change.yml +0 -51
- package/CLAUDE.md +0 -11
- package/licenses.txt +0 -9035
|
@@ -136,7 +136,10 @@ export const VuiTable = (_a) => {
|
|
|
136
136
|
onSelectRow(selectedRows);
|
|
137
137
|
} }) }) }))), columns.map((column) => {
|
|
138
138
|
const { name, render, className, testId } = column;
|
|
139
|
-
|
|
139
|
+
const cellClasses = classNames(className, {
|
|
140
|
+
"vuiTableCell--truncate": column.truncate
|
|
141
|
+
});
|
|
142
|
+
return (_jsx("td", Object.assign({ className: cellClasses, "data-testid": typeof testId === "function" ? testId(row) : testId }, { children: _jsx(VuiTableCell, Object.assign({ column: column }, { children: render ? render(row, rowIndex) : row[column.name] })) }), name));
|
|
140
143
|
}), (actions || hasExpandableRows) && (_jsx("td", Object.assign({ className: "vuiTableRowActions" }, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "center", justifyContent: "end", spacing: "xs" }, { children: [actions && (_jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsx(VuiTableRowActions, { row: row, actions: actions, onToggle: (isSelected) => {
|
|
141
144
|
if (isSelected) {
|
|
142
145
|
setRowBeingActedUpon(row);
|
|
@@ -97,6 +97,14 @@ $tableResponsiveBreakpointSmall: 500px;
|
|
|
97
97
|
padding-right: $sizeXxl;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
// This enables truncated VuiText children to actually be truncated.
|
|
101
|
+
.vuiTableCell--truncate {
|
|
102
|
+
min-width: 0;
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
text-overflow: ellipsis;
|
|
106
|
+
}
|
|
107
|
+
|
|
100
108
|
tbody tr:not(.vuiTableRowExpandedContent) {
|
|
101
109
|
position: relative;
|
|
102
110
|
column-gap: $sizeM;
|
|
@@ -10,5 +10,6 @@ export type Column<T> = {
|
|
|
10
10
|
render?: (row: T, rowIndex: number) => React.ReactNode;
|
|
11
11
|
className?: string;
|
|
12
12
|
testId?: string | ((row: T) => string);
|
|
13
|
+
truncate?: boolean;
|
|
13
14
|
};
|
|
14
15
|
export type OnSort = (column: string, direction: "asc" | "desc" | "none") => void;
|
package/lib/styles/index.css
CHANGED
|
@@ -5175,6 +5175,12 @@ h2.react-datepicker__current-month {
|
|
|
5175
5175
|
.vuiTable--responsive .vuiTableRow--hasActions {
|
|
5176
5176
|
padding-right: 40px;
|
|
5177
5177
|
}
|
|
5178
|
+
.vuiTable--responsive .vuiTableCell--truncate {
|
|
5179
|
+
min-width: 0;
|
|
5180
|
+
overflow: hidden;
|
|
5181
|
+
white-space: nowrap;
|
|
5182
|
+
text-overflow: ellipsis;
|
|
5183
|
+
}
|
|
5178
5184
|
.vuiTable--responsive tbody tr:not(.vuiTableRowExpandedContent) {
|
|
5179
5185
|
position: relative;
|
|
5180
5186
|
column-gap: 16px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vectara/vectara-ui",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.4.0",
|
|
4
4
|
"homepage": "./",
|
|
5
5
|
"description": "Vectara's design system, codified as a React and Sass component library",
|
|
6
6
|
"author": "Vectara",
|
|
@@ -23,6 +23,13 @@
|
|
|
23
23
|
"module": "lib/index.js",
|
|
24
24
|
"main": "lib/index.js",
|
|
25
25
|
"types": "lib/index.d.ts",
|
|
26
|
+
"files": [
|
|
27
|
+
"lib/",
|
|
28
|
+
"src/docs/",
|
|
29
|
+
"README.md",
|
|
30
|
+
"NO_LICENSE",
|
|
31
|
+
"CHANGELOG.md"
|
|
32
|
+
],
|
|
26
33
|
"scripts": {
|
|
27
34
|
"start": "PORT=2000 react-scripts start",
|
|
28
35
|
"buildDocs": "BUILD_PATH='./docs/public' PUBLIC_URL='.' react-scripts build",
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Link, Navigate, Route, HashRouter as Router, Routes, useLocation } from "react-router-dom";
|
|
2
|
+
import { BiLogoGithub } from "react-icons/bi";
|
|
3
|
+
import {
|
|
4
|
+
VuiAppHeader,
|
|
5
|
+
VuiIconButton,
|
|
6
|
+
VuiFlexContainer,
|
|
7
|
+
VuiFlexItem,
|
|
8
|
+
VuiIcon,
|
|
9
|
+
VuiTitle,
|
|
10
|
+
VuiAppLayout,
|
|
11
|
+
VuiButtonSecondary,
|
|
12
|
+
VuiContextProvider,
|
|
13
|
+
LinkProps
|
|
14
|
+
} from "../lib";
|
|
15
|
+
import { HeaderLogo } from "./components/HeaderLogo";
|
|
16
|
+
import { categories } from "./pages";
|
|
17
|
+
import { Home } from "./Home";
|
|
18
|
+
import { Page } from "./Page";
|
|
19
|
+
import "./index.scss";
|
|
20
|
+
|
|
21
|
+
export const Docs = () => {
|
|
22
|
+
return (
|
|
23
|
+
<Router>
|
|
24
|
+
<DocsContent />
|
|
25
|
+
</Router>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const DocsContent = () => {
|
|
30
|
+
const location = useLocation();
|
|
31
|
+
|
|
32
|
+
const routes: React.ReactNode[] = [];
|
|
33
|
+
|
|
34
|
+
categories.forEach(({ pages }) => {
|
|
35
|
+
pages.forEach((page) => {
|
|
36
|
+
const { name, path } = page;
|
|
37
|
+
routes.push(<Route key={name} path={path} element={<Page page={page} />} />);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const linkProvider = (linkConfig: LinkProps) => {
|
|
42
|
+
const { className, href, onClick, children, ...rest } = linkConfig;
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<Link className={className} to={href ?? ""} onClick={onClick} {...rest}>
|
|
46
|
+
{children}
|
|
47
|
+
</Link>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const pathProvider = () => {
|
|
52
|
+
return location.pathname;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<VuiContextProvider linkProvider={linkProvider} pathProvider={pathProvider}>
|
|
57
|
+
<VuiAppHeader
|
|
58
|
+
left={
|
|
59
|
+
<VuiFlexContainer spacing="m" alignItems="center">
|
|
60
|
+
<VuiFlexItem grow={false} shrink={false}>
|
|
61
|
+
<HeaderLogo />
|
|
62
|
+
</VuiFlexItem>
|
|
63
|
+
|
|
64
|
+
<VuiFlexItem grow={false} shrink={false}>
|
|
65
|
+
<VuiTitle size="xs">
|
|
66
|
+
<h1>Vectara UI Library</h1>
|
|
67
|
+
</VuiTitle>
|
|
68
|
+
</VuiFlexItem>
|
|
69
|
+
|
|
70
|
+
<VuiFlexItem grow={false} shrink={false}>
|
|
71
|
+
<VuiButtonSecondary size="s" color="neutral" href="/">
|
|
72
|
+
Home
|
|
73
|
+
</VuiButtonSecondary>
|
|
74
|
+
</VuiFlexItem>
|
|
75
|
+
</VuiFlexContainer>
|
|
76
|
+
}
|
|
77
|
+
right={
|
|
78
|
+
<VuiIconButton
|
|
79
|
+
href="https://github.com/vectara/vectara-ui"
|
|
80
|
+
target="_blank"
|
|
81
|
+
color="neutral"
|
|
82
|
+
size="m"
|
|
83
|
+
aria-label="Vectara UI GitHub repository"
|
|
84
|
+
icon={
|
|
85
|
+
<VuiIcon>
|
|
86
|
+
<BiLogoGithub />
|
|
87
|
+
</VuiIcon>
|
|
88
|
+
}
|
|
89
|
+
/>
|
|
90
|
+
}
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
<VuiAppLayout navItems={categories}>
|
|
94
|
+
<Routes>
|
|
95
|
+
<Route path="/" element={<Home />} />
|
|
96
|
+
{routes}
|
|
97
|
+
<Route path="*" element={<Navigate replace to="/" />} />
|
|
98
|
+
</Routes>
|
|
99
|
+
</VuiAppLayout>
|
|
100
|
+
</VuiContextProvider>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { BiLinkExternal } from "react-icons/bi";
|
|
2
|
+
import {
|
|
3
|
+
VuiTitle,
|
|
4
|
+
VuiAppContent,
|
|
5
|
+
VuiSpacer,
|
|
6
|
+
VuiCard,
|
|
7
|
+
VuiFlexContainer,
|
|
8
|
+
VuiFlexItem,
|
|
9
|
+
VuiText,
|
|
10
|
+
VuiLink,
|
|
11
|
+
VuiIcon,
|
|
12
|
+
VuiHorizontalRule
|
|
13
|
+
} from "../lib";
|
|
14
|
+
|
|
15
|
+
export const Home = () => {
|
|
16
|
+
return (
|
|
17
|
+
<VuiAppContent padding="l">
|
|
18
|
+
<VuiFlexContainer alignItems="center" justifyContent="center">
|
|
19
|
+
<VuiFlexItem className="homeCard">
|
|
20
|
+
<VuiCard
|
|
21
|
+
header={
|
|
22
|
+
<VuiTitle size="m">
|
|
23
|
+
<h2>Vectara UI Library</h2>
|
|
24
|
+
</VuiTitle>
|
|
25
|
+
}
|
|
26
|
+
body={
|
|
27
|
+
<>
|
|
28
|
+
<VuiFlexContainer alignItems="start" justifyContent="center">
|
|
29
|
+
<VuiFlexItem shrink={false} grow={false}>
|
|
30
|
+
<VuiText size="l">
|
|
31
|
+
<p>✨</p>
|
|
32
|
+
</VuiText>
|
|
33
|
+
</VuiFlexItem>
|
|
34
|
+
|
|
35
|
+
<VuiFlexItem grow={1}>
|
|
36
|
+
<VuiText size="m">
|
|
37
|
+
<p>The Vectara UI Library is a React component library built with TypeScript and SCSS.</p>
|
|
38
|
+
</VuiText>
|
|
39
|
+
</VuiFlexItem>
|
|
40
|
+
</VuiFlexContainer>
|
|
41
|
+
|
|
42
|
+
<VuiSpacer size="m" />
|
|
43
|
+
|
|
44
|
+
<VuiFlexContainer alignItems="start" justifyContent="center">
|
|
45
|
+
<VuiFlexItem shrink={false} grow={false}>
|
|
46
|
+
<VuiText size="l">
|
|
47
|
+
<p>🚨</p>
|
|
48
|
+
</VuiText>
|
|
49
|
+
</VuiFlexItem>
|
|
50
|
+
|
|
51
|
+
<VuiFlexItem grow={1}>
|
|
52
|
+
<VuiText size="m">
|
|
53
|
+
<p>
|
|
54
|
+
We solely intend this library for internal use by{" "}
|
|
55
|
+
<VuiLink href="http://vectara.com/">Vectara</VuiLink>. Vectara, Inc. reserves all rights. For
|
|
56
|
+
more information, see the{" "}
|
|
57
|
+
<VuiLink href="https://github.com/vectara/vectara-ui/blob/main/README.md">README</VuiLink> and{" "}
|
|
58
|
+
<VuiLink href="https://github.com/vectara/vectara-ui/blob/main/NO_LICENSE">NO_LICENSE</VuiLink>.
|
|
59
|
+
</p>
|
|
60
|
+
</VuiText>
|
|
61
|
+
</VuiFlexItem>
|
|
62
|
+
</VuiFlexContainer>
|
|
63
|
+
|
|
64
|
+
<VuiSpacer size="m" />
|
|
65
|
+
|
|
66
|
+
<VuiFlexContainer alignItems="start" justifyContent="center">
|
|
67
|
+
<VuiFlexItem shrink={false} grow={false}>
|
|
68
|
+
<VuiText size="l">
|
|
69
|
+
<p>🙌</p>
|
|
70
|
+
</VuiText>
|
|
71
|
+
</VuiFlexItem>
|
|
72
|
+
|
|
73
|
+
<VuiFlexItem grow={1}>
|
|
74
|
+
<VuiText size="m">
|
|
75
|
+
<p>
|
|
76
|
+
That said, we welcome bug reports and feature requests on our{" "}
|
|
77
|
+
<VuiLink href="https://github.com/vectara/vectara-ui" target="_blank">
|
|
78
|
+
GitHub repo{" "}
|
|
79
|
+
<VuiIcon inline size="s">
|
|
80
|
+
<BiLinkExternal />
|
|
81
|
+
</VuiIcon>
|
|
82
|
+
</VuiLink>
|
|
83
|
+
.
|
|
84
|
+
</p>
|
|
85
|
+
</VuiText>
|
|
86
|
+
</VuiFlexItem>
|
|
87
|
+
</VuiFlexContainer>
|
|
88
|
+
|
|
89
|
+
<VuiSpacer size="m" />
|
|
90
|
+
<VuiHorizontalRule />
|
|
91
|
+
<VuiSpacer size="m" />
|
|
92
|
+
|
|
93
|
+
<VuiTitle size="s">
|
|
94
|
+
<h3>Dependencies</h3>
|
|
95
|
+
</VuiTitle>
|
|
96
|
+
|
|
97
|
+
<VuiSpacer size="s" />
|
|
98
|
+
|
|
99
|
+
<VuiText>
|
|
100
|
+
<ul>
|
|
101
|
+
<li>
|
|
102
|
+
<strong>
|
|
103
|
+
<VuiLink href="https://react-icons.github.io/react-icons/icons/bi/">BoxIcons</VuiLink>
|
|
104
|
+
</strong>{" "}
|
|
105
|
+
for icons
|
|
106
|
+
</li>
|
|
107
|
+
|
|
108
|
+
<li>
|
|
109
|
+
<strong>
|
|
110
|
+
<VuiLink href="https://prismjs.com/">PrismJS</VuiLink>
|
|
111
|
+
</strong>{" "}
|
|
112
|
+
for syntax highlighting
|
|
113
|
+
</li>
|
|
114
|
+
</ul>
|
|
115
|
+
</VuiText>
|
|
116
|
+
</>
|
|
117
|
+
}
|
|
118
|
+
/>
|
|
119
|
+
</VuiFlexItem>
|
|
120
|
+
</VuiFlexContainer>
|
|
121
|
+
</VuiAppContent>
|
|
122
|
+
);
|
|
123
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { useLocation, useNavigate } from "react-router-dom";
|
|
2
|
+
import { BiRightArrowAlt, BiLeftArrowAlt } from "react-icons/bi";
|
|
3
|
+
import { VuiIconButton, VuiFlexContainer, VuiFlexItem, VuiIcon, VuiTitle, VuiAppContent, VuiSpacer } from "../lib";
|
|
4
|
+
import { Page as PageType, paths } from "./pages";
|
|
5
|
+
import { Example } from "./components/Example";
|
|
6
|
+
import React from "react";
|
|
7
|
+
|
|
8
|
+
export const Page = ({ page }: { page: PageType }) => {
|
|
9
|
+
const { name, example, examples } = page;
|
|
10
|
+
const location = useLocation();
|
|
11
|
+
const navigate = useNavigate();
|
|
12
|
+
const currentPageIndex = paths.list.findIndex((page) => page.path === location.pathname);
|
|
13
|
+
|
|
14
|
+
const navigateToPreviousPage = () => {
|
|
15
|
+
const prevIndex = currentPageIndex === 0 ? paths.list.length - 1 : currentPageIndex - 1;
|
|
16
|
+
navigate(paths.list[prevIndex].path);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const navigateToNextPage = () => {
|
|
20
|
+
const nextIndex = currentPageIndex === paths.list.length - 1 ? 0 : currentPageIndex + 1;
|
|
21
|
+
navigate(paths.list[nextIndex].path);
|
|
22
|
+
};
|
|
23
|
+
return (
|
|
24
|
+
<VuiAppContent padding="l">
|
|
25
|
+
<VuiFlexContainer alignItems="center" justifyContent="spaceBetween">
|
|
26
|
+
<VuiFlexItem grow={false}>
|
|
27
|
+
<VuiTitle size="m">
|
|
28
|
+
<h2>{name}</h2>
|
|
29
|
+
</VuiTitle>
|
|
30
|
+
</VuiFlexItem>
|
|
31
|
+
|
|
32
|
+
<VuiFlexItem>
|
|
33
|
+
<VuiFlexContainer alignItems="center" spacing="xxs">
|
|
34
|
+
<VuiFlexItem grow={false}>
|
|
35
|
+
<VuiIconButton
|
|
36
|
+
aria-label="Go to previous example"
|
|
37
|
+
icon={
|
|
38
|
+
<VuiIcon>
|
|
39
|
+
<BiLeftArrowAlt />
|
|
40
|
+
</VuiIcon>
|
|
41
|
+
}
|
|
42
|
+
color="neutral"
|
|
43
|
+
onClick={() => navigateToPreviousPage()}
|
|
44
|
+
/>
|
|
45
|
+
</VuiFlexItem>
|
|
46
|
+
|
|
47
|
+
<VuiFlexItem>
|
|
48
|
+
<VuiIconButton
|
|
49
|
+
aria-label="Go to next example"
|
|
50
|
+
icon={
|
|
51
|
+
<VuiIcon>
|
|
52
|
+
<BiRightArrowAlt />
|
|
53
|
+
</VuiIcon>
|
|
54
|
+
}
|
|
55
|
+
color="neutral"
|
|
56
|
+
onClick={() => navigateToNextPage()}
|
|
57
|
+
/>
|
|
58
|
+
</VuiFlexItem>
|
|
59
|
+
</VuiFlexContainer>
|
|
60
|
+
</VuiFlexItem>
|
|
61
|
+
</VuiFlexContainer>
|
|
62
|
+
|
|
63
|
+
<VuiSpacer size="m" />
|
|
64
|
+
|
|
65
|
+
<>
|
|
66
|
+
{example ? (
|
|
67
|
+
<Example name={undefined} component={example.component} source={example.source} />
|
|
68
|
+
) : (
|
|
69
|
+
examples?.map(({ name: exampleName, component, source }) => (
|
|
70
|
+
<React.Fragment key={`example-${name}-${exampleName}`}>
|
|
71
|
+
<Example name={exampleName} component={component} source={source} />
|
|
72
|
+
<VuiSpacer size="l" />
|
|
73
|
+
</React.Fragment>
|
|
74
|
+
))
|
|
75
|
+
)}
|
|
76
|
+
</>
|
|
77
|
+
</VuiAppContent>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { VuiCode, VuiSpacer, VuiTab, VuiTabs, VuiTitle } from "../../lib";
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
name?: string;
|
|
6
|
+
component: React.ReactNode;
|
|
7
|
+
source: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Example = ({ name, component, source }: Props) => {
|
|
11
|
+
const [tab, setTab] = useState<"example" | "source">("example");
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
{name && (
|
|
16
|
+
<VuiTitle size="s">
|
|
17
|
+
<h3>{name}</h3>
|
|
18
|
+
</VuiTitle>
|
|
19
|
+
)}
|
|
20
|
+
|
|
21
|
+
<VuiSpacer size="xs" />
|
|
22
|
+
|
|
23
|
+
<VuiTabs>
|
|
24
|
+
<VuiTab isActive={tab === "example"} onClick={() => setTab("example")}>
|
|
25
|
+
Example
|
|
26
|
+
</VuiTab>
|
|
27
|
+
|
|
28
|
+
<VuiTab isActive={tab === "source"} onClick={() => setTab("source")}>
|
|
29
|
+
Source
|
|
30
|
+
</VuiTab>
|
|
31
|
+
</VuiTabs>
|
|
32
|
+
|
|
33
|
+
{tab === "example" && (
|
|
34
|
+
<>
|
|
35
|
+
<VuiSpacer size="m" />
|
|
36
|
+
{component}
|
|
37
|
+
</>
|
|
38
|
+
)}
|
|
39
|
+
{tab === "source" && <VuiCode language="tsx">{source}</VuiCode>}
|
|
40
|
+
|
|
41
|
+
<VuiSpacer size="l" />
|
|
42
|
+
</>
|
|
43
|
+
);
|
|
44
|
+
};
|