@vectara/vectara-ui 14.3.1 → 15.0.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/card/SimpleCard.d.ts +4 -2
- package/lib/components/card/SimpleCard.js +11 -7
- package/lib/components/card/_index.scss +16 -0
- package/lib/components/table/Table.d.ts +3 -2
- package/lib/components/table/Table.js +48 -28
- package/lib/components/table/_index.scss +50 -4
- package/lib/components/tabs/Tabs.d.ts +3 -3
- package/lib/components/tabs/Tabs.js +2 -2
- package/lib/styles/index.css +62 -9
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MouseEvent } from "react";
|
|
1
|
+
import { ReactNode, MouseEvent } from "react";
|
|
2
2
|
type Props = {
|
|
3
3
|
className?: string;
|
|
4
4
|
fullHeight?: boolean;
|
|
@@ -6,6 +6,8 @@ type Props = {
|
|
|
6
6
|
onClick?: (e: MouseEvent) => void;
|
|
7
7
|
padding?: "xxs" | "xs" | "s" | "m" | "l";
|
|
8
8
|
children?: React.ReactNode;
|
|
9
|
+
error?: string | ReactNode;
|
|
10
|
+
warning?: string | ReactNode;
|
|
9
11
|
};
|
|
10
|
-
export declare const VuiSimpleCard: ({ href, className, fullHeight, padding, children, onClick, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const VuiSimpleCard: ({ href, className, fullHeight, padding, children, onClick, error, warning, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -9,23 +9,27 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import classNames from "classnames";
|
|
14
14
|
import { useVuiContext } from "../context/Context";
|
|
15
|
+
import { VuiSpacer } from "../spacer/Spacer";
|
|
16
|
+
import { VuiStatus } from "../status/Status";
|
|
15
17
|
export const VuiSimpleCard = (_a) => {
|
|
16
|
-
var { href, className, fullHeight, padding = "s", children, onClick } = _a, rest = __rest(_a, ["href", "className", "fullHeight", "padding", "children", "onClick"]);
|
|
18
|
+
var { href, className, fullHeight, padding = "s", children, onClick, error, warning } = _a, rest = __rest(_a, ["href", "className", "fullHeight", "padding", "children", "onClick", "error", "warning"]);
|
|
17
19
|
const { createLink } = useVuiContext();
|
|
18
20
|
const classes = classNames("vuiSimpleCard", `vuiSimpleCard--${padding}`, {
|
|
19
21
|
"vuiSimpleCard--interactive": href || onClick,
|
|
20
|
-
"vuiSimpleCard--fullHeight": fullHeight
|
|
22
|
+
"vuiSimpleCard--fullHeight": fullHeight,
|
|
23
|
+
"vuiSimpleCard--danger": error,
|
|
24
|
+
"vuiSimpleCard--warning": warning
|
|
21
25
|
}, className);
|
|
26
|
+
const content = (_jsxs(_Fragment, { children: [children, error && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), typeof error === "string" ? _jsx(VuiStatus, { status: "error", label: error }) : error] })), warning && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), typeof warning === "string" ? _jsx(VuiStatus, { status: "warning", label: warning }) : warning] }))] }));
|
|
22
27
|
if (href) {
|
|
23
28
|
return createLink(Object.assign({ className: classes, href,
|
|
24
|
-
onClick,
|
|
25
|
-
children }, rest));
|
|
29
|
+
onClick, children: content }, rest));
|
|
26
30
|
}
|
|
27
31
|
if (onClick) {
|
|
28
|
-
return (_jsx("button", Object.assign({ className: classes, onClick: onClick }, rest, { children:
|
|
32
|
+
return (_jsx("button", Object.assign({ className: classes, onClick: onClick }, rest, { children: content })));
|
|
29
33
|
}
|
|
30
|
-
return (_jsx("div", Object.assign({ className: classes, onClick: onClick }, rest, { children:
|
|
34
|
+
return (_jsx("div", Object.assign({ className: classes, onClick: onClick }, rest, { children: content })));
|
|
31
35
|
};
|
|
@@ -188,6 +188,22 @@
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
.vuiSimpleCard--danger {
|
|
192
|
+
border-color: var(--vui-color-danger-shade);
|
|
193
|
+
|
|
194
|
+
&.vuiSimpleCard--interactive:hover {
|
|
195
|
+
border-color: var(--vui-color-danger-shade);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.vuiSimpleCard--warning {
|
|
200
|
+
border-color: var(--vui-color-warning-shade);
|
|
201
|
+
|
|
202
|
+
&.vuiSimpleCard--interactive:hover {
|
|
203
|
+
border-color: var(--vui-color-warning-shade);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
191
207
|
.vuiSimpleCard--fullHeight {
|
|
192
208
|
height: 100%;
|
|
193
209
|
}
|
|
@@ -8,7 +8,7 @@ import { Column, OnSort, Row } from "./types";
|
|
|
8
8
|
type Props<T> = {
|
|
9
9
|
isLoading?: boolean;
|
|
10
10
|
idField: keyof T | ((row: T) => string);
|
|
11
|
-
rowDecorator?: (row: T) =>
|
|
11
|
+
rowDecorator?: (row: T) => React.HTMLAttributes<HTMLTableRowElement>;
|
|
12
12
|
columns: Column<T>[];
|
|
13
13
|
rows: T[];
|
|
14
14
|
actions?: TableRowActionsProps<T>["actions"];
|
|
@@ -27,6 +27,7 @@ type Props<T> = {
|
|
|
27
27
|
bodyStyle?: BodyStyle;
|
|
28
28
|
isHeaderSticky?: boolean;
|
|
29
29
|
isResponsive?: boolean;
|
|
30
|
+
collapsedContent?: (row: T) => React.ReactNode;
|
|
30
31
|
};
|
|
31
32
|
type BodyStyle = {
|
|
32
33
|
verticalAlign?: "top" | "middle" | "bottom";
|
|
@@ -38,5 +39,5 @@ type Selection<T> = {
|
|
|
38
39
|
selectedRows?: T[];
|
|
39
40
|
};
|
|
40
41
|
type Search = TextInputProps;
|
|
41
|
-
export declare const VuiTable: <T extends Row>({ isLoading, idField, rowDecorator, columns, rows, actions, actionsTestIdProvider, reloadTestId, pagination, selection, search, customControls, onSort, onReload, content, className, fluid, isDisabled, bodyStyle, isHeaderSticky, isResponsive, ...rest }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare const VuiTable: <T extends Row>({ isLoading, idField, rowDecorator, columns, rows, actions, actionsTestIdProvider, reloadTestId, pagination, selection, search, customControls, onSort, onReload, content, className, fluid, isDisabled, bodyStyle, isHeaderSticky, isResponsive, collapsedContent, ...rest }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
42
43
|
export {};
|
|
@@ -10,8 +10,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
-
import { useState } from "react";
|
|
13
|
+
import React, { useState } from "react";
|
|
14
14
|
import classNames from "classnames";
|
|
15
|
+
import { BiChevronDown, BiChevronRight } from "react-icons/bi";
|
|
15
16
|
import { VuiCheckbox, VuiTextInput } from "../form";
|
|
16
17
|
import { VuiSpacer } from "../spacer/Spacer";
|
|
17
18
|
import { VuiTableRowActions } from "./TableRowActions";
|
|
@@ -26,6 +27,8 @@ import { VuiTableBulkActions } from "./TableBulkActions";
|
|
|
26
27
|
import { VuiSpinner } from "../spinner/Spinner";
|
|
27
28
|
import { VuiTableContent } from "./TableContent";
|
|
28
29
|
import { VuiButtonSecondary } from "../button/ButtonSecondary";
|
|
30
|
+
import { VuiIconButton } from "../button/IconButton";
|
|
31
|
+
import { VuiIcon } from "../icon/Icon";
|
|
29
32
|
const verticalAlignToClass = {
|
|
30
33
|
top: "vuiTable--verticalAlignTop",
|
|
31
34
|
middle: "vuiTable--verticalAlignMiddle",
|
|
@@ -41,10 +44,11 @@ const extractId = (row, idField) => {
|
|
|
41
44
|
// https://github.com/typescript-eslint/typescript-eslint/issues/4062
|
|
42
45
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint
|
|
43
46
|
export const VuiTable = (_a) => {
|
|
44
|
-
var { isLoading, idField, rowDecorator, columns, rows, actions, actionsTestIdProvider, reloadTestId, pagination, selection, search, customControls, onSort, onReload, content, className, fluid, isDisabled = false, bodyStyle, isHeaderSticky, isResponsive = true } = _a, rest = __rest(_a, ["isLoading", "idField", "rowDecorator", "columns", "rows", "actions", "actionsTestIdProvider", "reloadTestId", "pagination", "selection", "search", "customControls", "onSort", "onReload", "content", "className", "fluid", "isDisabled", "bodyStyle", "isHeaderSticky", "isResponsive"]);
|
|
47
|
+
var { isLoading, idField, rowDecorator, columns, rows, actions, actionsTestIdProvider, reloadTestId, pagination, selection, search, customControls, onSort, onReload, content, className, fluid, isDisabled = false, bodyStyle, isHeaderSticky, isResponsive = true, collapsedContent } = _a, rest = __rest(_a, ["isLoading", "idField", "rowDecorator", "columns", "rows", "actions", "actionsTestIdProvider", "reloadTestId", "pagination", "selection", "search", "customControls", "onSort", "onReload", "content", "className", "fluid", "isDisabled", "bodyStyle", "isHeaderSticky", "isResponsive", "collapsedContent"]);
|
|
45
48
|
const [rowBeingActedUpon, setRowBeingActedUpon] = useState(undefined);
|
|
46
49
|
const [sortColumn, setSortColumn] = useState(null);
|
|
47
50
|
const [sortDirection, setSortDirection] = useState("none");
|
|
51
|
+
const [expandedRowIds, setExpandedRowIds] = useState(new Set());
|
|
48
52
|
const { bulkActions, isRowSelectable, onSelectRow, selectedRows } = selection || {};
|
|
49
53
|
const { value: searchValue } = search || {};
|
|
50
54
|
const handleSort = (columnName, direction) => {
|
|
@@ -74,7 +78,8 @@ export const VuiTable = (_a) => {
|
|
|
74
78
|
}, {})) || {};
|
|
75
79
|
const hasSearch = search !== undefined;
|
|
76
80
|
const hasBulkActions = bulkActions !== undefined;
|
|
77
|
-
const
|
|
81
|
+
const hasExpandableRows = collapsedContent !== undefined;
|
|
82
|
+
const columnCount = columns.length + (onSelectRow ? 1 : 0) + (actions || hasExpandableRows ? 1 : 0);
|
|
78
83
|
const classes = classNames("vuiTable", (bodyStyle === null || bodyStyle === void 0 ? void 0 : bodyStyle.verticalAlign) && verticalAlignToClass[bodyStyle.verticalAlign], {
|
|
79
84
|
"vuiTable--fluid": fluid,
|
|
80
85
|
"vuiTable--responsive": isResponsive,
|
|
@@ -97,33 +102,48 @@ export const VuiTable = (_a) => {
|
|
|
97
102
|
const rowId = extractId(row, idField);
|
|
98
103
|
const rowAttributes = (_a = rowDecorator === null || rowDecorator === void 0 ? void 0 : rowDecorator(row)) !== null && _a !== void 0 ? _a : {};
|
|
99
104
|
const { className: rowClassNameAttribute } = rowAttributes, restRowAttributes = __rest(rowAttributes, ["className"]);
|
|
105
|
+
const isExpanded = expandedRowIds.has(rowId);
|
|
100
106
|
const rowClassName = classNames(rowClassNameAttribute, {
|
|
101
107
|
"vuiTableRow-isBeingActedUpon": rowBeingActedUpon === row,
|
|
102
|
-
"vuiTableRow--hasActions": Boolean(actions),
|
|
103
|
-
"vuiTableRow--isSelectable": Boolean(onSelectRow)
|
|
108
|
+
"vuiTableRow--hasActions": Boolean(actions) || hasExpandableRows,
|
|
109
|
+
"vuiTableRow--isSelectable": Boolean(onSelectRow),
|
|
110
|
+
"vuiTableRow--expanded": isExpanded
|
|
104
111
|
});
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
112
|
+
const toggleExpand = () => {
|
|
113
|
+
setExpandedRowIds((prev) => {
|
|
114
|
+
const next = new Set(prev);
|
|
115
|
+
if (next.has(rowId)) {
|
|
116
|
+
next.delete(rowId);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
next.add(rowId);
|
|
120
|
+
}
|
|
121
|
+
return next;
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
return (_jsxs(React.Fragment, { children: [_jsxs("tr", Object.assign({ className: rowClassName }, restRowAttributes, { children: [onSelectRow && (_jsx("td", Object.assign({ className: "vuiTableRowSelect" }, { children: _jsx(VuiTableCell, { children: _jsx(VuiCheckbox, { disabled: isRowSelectable ? !isRowSelectable(row) : undefined, checked: (_b = selectedIds[rowId]) !== null && _b !== void 0 ? _b : false, onChange: () => {
|
|
125
|
+
if (selectedIds[rowId]) {
|
|
126
|
+
delete selectedIds[rowId];
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
selectedIds[rowId] = true;
|
|
130
|
+
}
|
|
131
|
+
const selectedRowIds = Object.keys(selectedIds);
|
|
132
|
+
const selectedRows = selectedRowIds
|
|
133
|
+
.map((id) => rows.find((row) => extractId(row, idField) === id))
|
|
134
|
+
.filter((row) => row !== undefined);
|
|
135
|
+
onSelectRow(selectedRows);
|
|
136
|
+
} }) }) }))), columns.map((column) => {
|
|
137
|
+
const { name, render, className, testId } = column;
|
|
138
|
+
return (_jsx("td", Object.assign({ className: className, "data-testid": typeof testId === "function" ? testId(row) : testId }, { children: _jsx(VuiTableCell, Object.assign({ column: column }, { children: render ? render(row, rowIndex) : row[column.name] })) }), name));
|
|
139
|
+
}), (actions || hasExpandableRows) && (_jsx("td", Object.assign({ className: "vuiTableRowActions" }, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "center", justifyContent: "end", spacing: "s" }, { children: [actions && (_jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsx(VuiTableRowActions, { row: row, actions: actions, onToggle: (isSelected) => {
|
|
140
|
+
if (isSelected) {
|
|
141
|
+
setRowBeingActedUpon(row);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
setRowBeingActedUpon(undefined);
|
|
145
|
+
}
|
|
146
|
+
}, testId: (_c = actionsTestIdProvider === null || actionsTestIdProvider === void 0 ? void 0 : actionsTestIdProvider(row)) !== null && _c !== void 0 ? _c : undefined }) }))), hasExpandableRows && (_jsx(VuiFlexItem, Object.assign({ grow: false, className: "vuiTableRowExpandToggle" }, { children: _jsx(VuiIconButton, { icon: _jsx(VuiIcon, { children: isExpanded ? _jsx(BiChevronDown, {}) : _jsx(BiChevronRight, {}) }), color: "neutral", "aria-label": isExpanded ? "Collapse row" : "Expand row", onClick: toggleExpand }) })))] })) })))] })), hasExpandableRows && isExpanded && (_jsx("tr", Object.assign({ className: "vuiTableRowExpandedContent vuiTableRow--inert" }, { children: _jsx("td", Object.assign({ className: "vuiTableRowExpandedContent__cell", colSpan: columnCount }, { children: collapsedContent(row) })) })))] }, rowId));
|
|
127
147
|
});
|
|
128
148
|
}
|
|
129
149
|
const selectAllCheckboxProps = {
|
|
@@ -158,5 +178,5 @@ export const VuiTable = (_a) => {
|
|
|
158
178
|
const { name, width } = column;
|
|
159
179
|
const styles = width ? { width } : undefined;
|
|
160
180
|
return (_jsx("th", Object.assign({ style: styles }, { children: _jsx(VuiTableHeaderCell, { column: column, onSort: handleSort, sortDirection: sortColumn === name ? sortDirection : "none" }) }), name));
|
|
161
|
-
}), actions && _jsx("th", { className: "vuiTableHeaderActions" })] }) }), _jsx("tbody", { children: tableContent })] })), !pagination ? undefined : isComplexPagination(pagination) ? (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "xs" }), _jsx(VuiPagination, Object.assign({ isDisabled: !isInteractive }, pagination))] })) : (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "xs" }), _jsx(VuiTablePager, Object.assign({ isDisabled: !isInteractive }, pagination))] }))] })));
|
|
181
|
+
}), (actions || hasExpandableRows) && _jsx("th", { className: "vuiTableHeaderActions" })] }) }), _jsx("tbody", { children: tableContent })] })), !pagination ? undefined : isComplexPagination(pagination) ? (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "xs" }), _jsx(VuiPagination, Object.assign({ isDisabled: !isInteractive }, pagination))] })) : (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "xs" }), _jsx(VuiTablePager, Object.assign({ isDisabled: !isInteractive }, pagination))] }))] })));
|
|
162
182
|
};
|
|
@@ -97,7 +97,7 @@ $tableResponsiveBreakpointSmall: 500px;
|
|
|
97
97
|
padding-right: $sizeXxl;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
tbody tr {
|
|
100
|
+
tbody tr:not(.vuiTableRowExpandedContent) {
|
|
101
101
|
position: relative;
|
|
102
102
|
column-gap: $sizeM;
|
|
103
103
|
row-gap: $sizeM;
|
|
@@ -110,6 +110,11 @@ $tableResponsiveBreakpointSmall: 500px;
|
|
|
110
110
|
box-shadow: $shadowLargeStart;
|
|
111
111
|
margin-bottom: $sizeS;
|
|
112
112
|
|
|
113
|
+
&.vuiTableRow--expanded {
|
|
114
|
+
margin-bottom: 0;
|
|
115
|
+
border-radius: $sizeXs $sizeXs 0 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
113
118
|
td {
|
|
114
119
|
padding: 0;
|
|
115
120
|
}
|
|
@@ -138,22 +143,36 @@ $tableResponsiveBreakpointSmall: 500px;
|
|
|
138
143
|
}
|
|
139
144
|
|
|
140
145
|
&.vuiTable--notSelectable {
|
|
141
|
-
tbody tr {
|
|
146
|
+
tbody tr:not(.vuiTableRowExpandedContent) {
|
|
142
147
|
padding-left: $sizeM;
|
|
143
148
|
}
|
|
144
149
|
}
|
|
145
150
|
|
|
146
151
|
&.vuiTable--noActions {
|
|
147
|
-
tbody tr {
|
|
152
|
+
tbody tr:not(.vuiTableRowExpandedContent) {
|
|
148
153
|
padding-right: $sizeM;
|
|
149
154
|
}
|
|
150
155
|
}
|
|
156
|
+
|
|
157
|
+
// Expanded content in responsive mode
|
|
158
|
+
tbody tr.vuiTableRowExpandedContent {
|
|
159
|
+
display: block;
|
|
160
|
+
margin-top: -$sizeS - $sizeXxs; // Pull up to connect with parent row
|
|
161
|
+
margin-bottom: $sizeS;
|
|
162
|
+
padding: $sizeL;
|
|
163
|
+
border-radius: 0 0 $sizeXs $sizeXs;
|
|
164
|
+
box-shadow: $shadowLargeStart;
|
|
165
|
+
|
|
166
|
+
.vuiTableRowExpandedContent__cell {
|
|
167
|
+
padding: 0;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
151
170
|
}
|
|
152
171
|
}
|
|
153
172
|
|
|
154
173
|
@container (width < #{$tableResponsiveBreakpointSmall}) {
|
|
155
174
|
.vuiTable--responsive {
|
|
156
|
-
tbody tr {
|
|
175
|
+
tbody tr:not(.vuiTableRowExpandedContent) {
|
|
157
176
|
grid-template-columns: 1fr;
|
|
158
177
|
}
|
|
159
178
|
}
|
|
@@ -249,3 +268,30 @@ $tableResponsiveBreakpointSmall: 500px;
|
|
|
249
268
|
.vuiTableHeaderCell__icon--none {
|
|
250
269
|
opacity: 0.75;
|
|
251
270
|
}
|
|
271
|
+
|
|
272
|
+
// Expandable rows
|
|
273
|
+
.vuiTableRowExpandToggle {
|
|
274
|
+
display: flex;
|
|
275
|
+
align-items: center;
|
|
276
|
+
justify-content: center;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.vuiTableRow--expanded {
|
|
280
|
+
border-bottom-color: transparent;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.vuiTableRowExpandedContent {
|
|
284
|
+
background-color: rgba(var(--vui-color-light-shade-rgb), 0.25);
|
|
285
|
+
|
|
286
|
+
&:not(:last-child) {
|
|
287
|
+
border-bottom: 1px solid var(--vui-color-border-light);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
&:last-child {
|
|
291
|
+
border-bottom: 1px solid var(--vui-color-border-medium);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.vuiTable .vuiTableRowExpandedContent__cell {
|
|
296
|
+
padding: $sizeL $sizeXl;
|
|
297
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { TabSize } from "./types";
|
|
2
|
-
type
|
|
2
|
+
type TabStyle = "enclosed" | "open";
|
|
3
3
|
type Props = {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
append?: React.ReactNode;
|
|
6
6
|
className?: string;
|
|
7
7
|
size?: TabSize;
|
|
8
8
|
fullWidth?: boolean;
|
|
9
|
-
|
|
9
|
+
tabStyle?: TabStyle;
|
|
10
10
|
};
|
|
11
|
-
export declare const VuiTabs: ({ children, className, append, size, fullWidth,
|
|
11
|
+
export declare const VuiTabs: ({ children, className, append, size, fullWidth, tabStyle }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
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,
|
|
4
|
-
const classes = classNames(className, "vuiTabs", `vuiTabs--${size}`, `vuiTabs--${
|
|
3
|
+
export const VuiTabs = ({ children, className, append, size = "s", fullWidth, tabStyle = "open" }) => {
|
|
4
|
+
const classes = classNames(className, "vuiTabs", `vuiTabs--${size}`, `vuiTabs--${tabStyle}`, {
|
|
5
5
|
"vuiTabs--fullWidth": fullWidth
|
|
6
6
|
});
|
|
7
7
|
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 }))] })));
|
package/lib/styles/index.css
CHANGED
|
@@ -1289,6 +1289,20 @@ fieldset {
|
|
|
1289
1289
|
box-shadow: rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;
|
|
1290
1290
|
}
|
|
1291
1291
|
|
|
1292
|
+
.vuiSimpleCard--danger {
|
|
1293
|
+
border-color: var(--vui-color-danger-shade);
|
|
1294
|
+
}
|
|
1295
|
+
.vuiSimpleCard--danger.vuiSimpleCard--interactive:hover {
|
|
1296
|
+
border-color: var(--vui-color-danger-shade);
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
.vuiSimpleCard--warning {
|
|
1300
|
+
border-color: var(--vui-color-warning-shade);
|
|
1301
|
+
}
|
|
1302
|
+
.vuiSimpleCard--warning.vuiSimpleCard--interactive:hover {
|
|
1303
|
+
border-color: var(--vui-color-warning-shade);
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1292
1306
|
.vuiSimpleCard--fullHeight {
|
|
1293
1307
|
height: 100%;
|
|
1294
1308
|
}
|
|
@@ -5094,7 +5108,7 @@ h2.react-datepicker__current-month {
|
|
|
5094
5108
|
.vuiTable--responsive .vuiTableRow--hasActions {
|
|
5095
5109
|
padding-right: 40px;
|
|
5096
5110
|
}
|
|
5097
|
-
.vuiTable--responsive tbody tr {
|
|
5111
|
+
.vuiTable--responsive tbody tr:not(.vuiTableRowExpandedContent) {
|
|
5098
5112
|
position: relative;
|
|
5099
5113
|
column-gap: 16px;
|
|
5100
5114
|
row-gap: 16px;
|
|
@@ -5107,36 +5121,51 @@ h2.react-datepicker__current-month {
|
|
|
5107
5121
|
box-shadow: rgba(50, 50, 93, 0.25) 0px 0 0 0, rgba(0, 0, 0, 0.16) 0px 1px 4px;
|
|
5108
5122
|
margin-bottom: 12px;
|
|
5109
5123
|
}
|
|
5110
|
-
.vuiTable--responsive tbody tr
|
|
5124
|
+
.vuiTable--responsive tbody tr:not(.vuiTableRowExpandedContent).vuiTableRow--expanded {
|
|
5125
|
+
margin-bottom: 0;
|
|
5126
|
+
border-radius: 8px 8px 0 0;
|
|
5127
|
+
}
|
|
5128
|
+
.vuiTable--responsive tbody tr:not(.vuiTableRowExpandedContent) td {
|
|
5111
5129
|
padding: 0;
|
|
5112
5130
|
}
|
|
5113
|
-
.vuiTable--responsive tbody tr .vuiTableCellWrapper {
|
|
5131
|
+
.vuiTable--responsive tbody tr:not(.vuiTableRowExpandedContent) .vuiTableCellWrapper {
|
|
5114
5132
|
display: flex;
|
|
5115
5133
|
flex-direction: column;
|
|
5116
5134
|
gap: 4px;
|
|
5117
5135
|
}
|
|
5118
|
-
.vuiTable--responsive tbody tr .vuiTableCell__label {
|
|
5136
|
+
.vuiTable--responsive tbody tr:not(.vuiTableRowExpandedContent) .vuiTableCell__label {
|
|
5119
5137
|
display: block;
|
|
5120
5138
|
}
|
|
5121
|
-
.vuiTable--responsive tbody tr .vuiTableRowSelect {
|
|
5139
|
+
.vuiTable--responsive tbody tr:not(.vuiTableRowExpandedContent) .vuiTableRowSelect {
|
|
5122
5140
|
position: absolute;
|
|
5123
5141
|
top: 16px;
|
|
5124
5142
|
left: 8px;
|
|
5125
5143
|
}
|
|
5126
|
-
.vuiTable--responsive tbody tr .vuiTableRowActions {
|
|
5144
|
+
.vuiTable--responsive tbody tr:not(.vuiTableRowExpandedContent) .vuiTableRowActions {
|
|
5127
5145
|
position: absolute;
|
|
5128
5146
|
top: 10px;
|
|
5129
5147
|
right: 8px;
|
|
5130
5148
|
}
|
|
5131
|
-
.vuiTable--responsive.vuiTable--notSelectable tbody tr {
|
|
5149
|
+
.vuiTable--responsive.vuiTable--notSelectable tbody tr:not(.vuiTableRowExpandedContent) {
|
|
5132
5150
|
padding-left: 16px;
|
|
5133
5151
|
}
|
|
5134
|
-
.vuiTable--responsive.vuiTable--noActions tbody tr {
|
|
5152
|
+
.vuiTable--responsive.vuiTable--noActions tbody tr:not(.vuiTableRowExpandedContent) {
|
|
5135
5153
|
padding-right: 16px;
|
|
5136
5154
|
}
|
|
5155
|
+
.vuiTable--responsive tbody tr.vuiTableRowExpandedContent {
|
|
5156
|
+
display: block;
|
|
5157
|
+
margin-top: -16px;
|
|
5158
|
+
margin-bottom: 12px;
|
|
5159
|
+
padding: 24px;
|
|
5160
|
+
border-radius: 0 0 8px 8px;
|
|
5161
|
+
box-shadow: rgba(50, 50, 93, 0.25) 0px 0 0 0, rgba(0, 0, 0, 0.16) 0px 1px 4px;
|
|
5162
|
+
}
|
|
5163
|
+
.vuiTable--responsive tbody tr.vuiTableRowExpandedContent .vuiTableRowExpandedContent__cell {
|
|
5164
|
+
padding: 0;
|
|
5165
|
+
}
|
|
5137
5166
|
}
|
|
5138
5167
|
@container (width < 500px) {
|
|
5139
|
-
.vuiTable--responsive tbody tr {
|
|
5168
|
+
.vuiTable--responsive tbody tr:not(.vuiTableRowExpandedContent) {
|
|
5140
5169
|
grid-template-columns: 1fr;
|
|
5141
5170
|
}
|
|
5142
5171
|
}
|
|
@@ -5222,6 +5251,30 @@ h2.react-datepicker__current-month {
|
|
|
5222
5251
|
opacity: 0.75;
|
|
5223
5252
|
}
|
|
5224
5253
|
|
|
5254
|
+
.vuiTableRowExpandToggle {
|
|
5255
|
+
display: flex;
|
|
5256
|
+
align-items: center;
|
|
5257
|
+
justify-content: center;
|
|
5258
|
+
}
|
|
5259
|
+
|
|
5260
|
+
.vuiTableRow--expanded {
|
|
5261
|
+
border-bottom-color: transparent;
|
|
5262
|
+
}
|
|
5263
|
+
|
|
5264
|
+
.vuiTableRowExpandedContent {
|
|
5265
|
+
background-color: rgba(var(--vui-color-light-shade-rgb), 0.25);
|
|
5266
|
+
}
|
|
5267
|
+
.vuiTableRowExpandedContent:not(:last-child) {
|
|
5268
|
+
border-bottom: 1px solid var(--vui-color-border-light);
|
|
5269
|
+
}
|
|
5270
|
+
.vuiTableRowExpandedContent:last-child {
|
|
5271
|
+
border-bottom: 1px solid var(--vui-color-border-medium);
|
|
5272
|
+
}
|
|
5273
|
+
|
|
5274
|
+
.vuiTable .vuiTableRowExpandedContent__cell {
|
|
5275
|
+
padding: 24px 32px;
|
|
5276
|
+
}
|
|
5277
|
+
|
|
5225
5278
|
.vuiTabs--open {
|
|
5226
5279
|
display: flex;
|
|
5227
5280
|
border-bottom: 1px solid var(--vui-color-border-light);
|