@vectara/vectara-ui 14.3.1 → 15.0.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.
- package/CLAUDE.md +11 -0
- 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 +51 -28
- package/lib/components/table/_index.scss +52 -4
- package/lib/components/tabs/Tabs.d.ts +3 -3
- package/lib/components/tabs/Tabs.js +2 -2
- package/lib/styles/index.css +65 -9
- package/package.json +1 -1
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
## Optimize for readability and maintainability
|
|
2
|
+
|
|
3
|
+
- Write terse, clear code. When forced to choose between clarity or terseness, prefer clear code.
|
|
4
|
+
- Choose variable and function names that clarify their role.
|
|
5
|
+
|
|
6
|
+
## Comments
|
|
7
|
+
|
|
8
|
+
- Write comments that are concise descriptions of behavior and intent.
|
|
9
|
+
- Don’t write comments that simply describe the literal operation of the code.
|
|
10
|
+
- But if you encounter comments that already exist in the code, try to preserve them.
|
|
11
|
+
- End comments with periods.
|
|
@@ -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,49 @@ 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
|
+
// Map selected row IDs to selected rows.
|
|
133
|
+
const selectedRows = selectedRowIds
|
|
134
|
+
.map((id) => rows.find((row) => extractId(row, idField) === id))
|
|
135
|
+
.filter((row) => row !== undefined);
|
|
136
|
+
onSelectRow(selectedRows);
|
|
137
|
+
} }) }) }))), columns.map((column) => {
|
|
138
|
+
const { name, render, className, testId } = column;
|
|
139
|
+
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));
|
|
140
|
+
}), (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
|
+
if (isSelected) {
|
|
142
|
+
setRowBeingActedUpon(row);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
setRowBeingActedUpon(undefined);
|
|
146
|
+
}
|
|
147
|
+
}, 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, {}) }), size: "s", 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
148
|
});
|
|
128
149
|
}
|
|
129
150
|
const selectAllCheckboxProps = {
|
|
@@ -158,5 +179,7 @@ export const VuiTable = (_a) => {
|
|
|
158
179
|
const { name, width } = column;
|
|
159
180
|
const styles = width ? { width } : undefined;
|
|
160
181
|
return (_jsx("th", Object.assign({ style: styles }, { children: _jsx(VuiTableHeaderCell, { column: column, onSort: handleSort, sortDirection: sortColumn === name ? sortDirection : "none" }) }), name));
|
|
161
|
-
}), actions
|
|
182
|
+
}), (actions || hasExpandableRows) && (_jsx("th", { className: classNames("vuiTableHeaderActions", {
|
|
183
|
+
"vuiTableHeaderActions--extended": actions && hasExpandableRows
|
|
184
|
+
}) }))] }) }), _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
185
|
};
|
|
@@ -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,35 @@ $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-bottom: $sizeS;
|
|
161
|
+
padding: $sizeL;
|
|
162
|
+
border-radius: 0 0 $sizeXs $sizeXs;
|
|
163
|
+
box-shadow: $shadowLargeStart;
|
|
164
|
+
|
|
165
|
+
.vuiTableRowExpandedContent__cell {
|
|
166
|
+
padding: 0;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
151
169
|
}
|
|
152
170
|
}
|
|
153
171
|
|
|
154
172
|
@container (width < #{$tableResponsiveBreakpointSmall}) {
|
|
155
173
|
.vuiTable--responsive {
|
|
156
|
-
tbody tr {
|
|
174
|
+
tbody tr:not(.vuiTableRowExpandedContent) {
|
|
157
175
|
grid-template-columns: 1fr;
|
|
158
176
|
}
|
|
159
177
|
}
|
|
@@ -197,6 +215,9 @@ $tableResponsiveBreakpointSmall: 500px;
|
|
|
197
215
|
.vuiTableHeaderActions {
|
|
198
216
|
width: 42px;
|
|
199
217
|
}
|
|
218
|
+
.vuiTableHeaderActions--extended {
|
|
219
|
+
width: 76px;
|
|
220
|
+
}
|
|
200
221
|
|
|
201
222
|
.vuiTableContent {
|
|
202
223
|
height: 80px;
|
|
@@ -249,3 +270,30 @@ $tableResponsiveBreakpointSmall: 500px;
|
|
|
249
270
|
.vuiTableHeaderCell__icon--none {
|
|
250
271
|
opacity: 0.75;
|
|
251
272
|
}
|
|
273
|
+
|
|
274
|
+
// Expandable rows
|
|
275
|
+
.vuiTableRowExpandToggle {
|
|
276
|
+
display: flex;
|
|
277
|
+
align-items: center;
|
|
278
|
+
justify-content: center;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.vuiTableRow--expanded {
|
|
282
|
+
border-bottom-color: transparent;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.vuiTableRowExpandedContent {
|
|
286
|
+
background-color: rgba(var(--vui-color-light-shade-rgb), 0.25);
|
|
287
|
+
|
|
288
|
+
&:not(:last-child) {
|
|
289
|
+
border-bottom: 1px solid var(--vui-color-border-light);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
&:last-child {
|
|
293
|
+
border-bottom: 1px solid var(--vui-color-border-medium);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.vuiTable .vuiTableRowExpandedContent__cell {
|
|
298
|
+
padding: $sizeL $sizeXl;
|
|
299
|
+
}
|
|
@@ -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,50 @@ 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-bottom: 12px;
|
|
5158
|
+
padding: 24px;
|
|
5159
|
+
border-radius: 0 0 8px 8px;
|
|
5160
|
+
box-shadow: rgba(50, 50, 93, 0.25) 0px 0 0 0, rgba(0, 0, 0, 0.16) 0px 1px 4px;
|
|
5161
|
+
}
|
|
5162
|
+
.vuiTable--responsive tbody tr.vuiTableRowExpandedContent .vuiTableRowExpandedContent__cell {
|
|
5163
|
+
padding: 0;
|
|
5164
|
+
}
|
|
5137
5165
|
}
|
|
5138
5166
|
@container (width < 500px) {
|
|
5139
|
-
.vuiTable--responsive tbody tr {
|
|
5167
|
+
.vuiTable--responsive tbody tr:not(.vuiTableRowExpandedContent) {
|
|
5140
5168
|
grid-template-columns: 1fr;
|
|
5141
5169
|
}
|
|
5142
5170
|
}
|
|
@@ -5172,6 +5200,10 @@ h2.react-datepicker__current-month {
|
|
|
5172
5200
|
width: 42px;
|
|
5173
5201
|
}
|
|
5174
5202
|
|
|
5203
|
+
.vuiTableHeaderActions--extended {
|
|
5204
|
+
width: 76px;
|
|
5205
|
+
}
|
|
5206
|
+
|
|
5175
5207
|
.vuiTableContent {
|
|
5176
5208
|
height: 80px;
|
|
5177
5209
|
}
|
|
@@ -5222,6 +5254,30 @@ h2.react-datepicker__current-month {
|
|
|
5222
5254
|
opacity: 0.75;
|
|
5223
5255
|
}
|
|
5224
5256
|
|
|
5257
|
+
.vuiTableRowExpandToggle {
|
|
5258
|
+
display: flex;
|
|
5259
|
+
align-items: center;
|
|
5260
|
+
justify-content: center;
|
|
5261
|
+
}
|
|
5262
|
+
|
|
5263
|
+
.vuiTableRow--expanded {
|
|
5264
|
+
border-bottom-color: transparent;
|
|
5265
|
+
}
|
|
5266
|
+
|
|
5267
|
+
.vuiTableRowExpandedContent {
|
|
5268
|
+
background-color: rgba(var(--vui-color-light-shade-rgb), 0.25);
|
|
5269
|
+
}
|
|
5270
|
+
.vuiTableRowExpandedContent:not(:last-child) {
|
|
5271
|
+
border-bottom: 1px solid var(--vui-color-border-light);
|
|
5272
|
+
}
|
|
5273
|
+
.vuiTableRowExpandedContent:last-child {
|
|
5274
|
+
border-bottom: 1px solid var(--vui-color-border-medium);
|
|
5275
|
+
}
|
|
5276
|
+
|
|
5277
|
+
.vuiTable .vuiTableRowExpandedContent__cell {
|
|
5278
|
+
padding: 24px 32px;
|
|
5279
|
+
}
|
|
5280
|
+
|
|
5225
5281
|
.vuiTabs--open {
|
|
5226
5282
|
display: flex;
|
|
5227
5283
|
border-bottom: 1px solid var(--vui-color-border-light);
|