@vectara/vectara-ui 11.2.1 → 12.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/Card.d.ts +2 -1
- package/lib/components/card/Card.js +5 -2
- package/lib/components/card/_index.scss +4 -0
- package/lib/components/grid/Grid.d.ts +18 -1
- package/lib/components/grid/Grid.js +87 -3
- package/lib/components/grid/GridItem.d.ts +23 -0
- package/lib/components/grid/GridItem.js +103 -0
- package/lib/components/grid/SimpleGrid.d.ts +11 -0
- package/lib/components/grid/SimpleGrid.js +33 -0
- package/lib/components/grid/_index.scss +212 -0
- package/lib/components/grid/types.d.ts +6 -0
- package/lib/components/grid/types.js +1 -0
- package/lib/components/index.d.ts +3 -1
- package/lib/components/index.js +3 -1
- package/lib/components/panel/Panel.d.ts +3 -1
- package/lib/components/panel/Panel.js +18 -3
- package/lib/components/panel/_index.scss +8 -0
- package/lib/styles/index.css +464 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ type Props = {
|
|
|
10
10
|
highlight?: boolean;
|
|
11
11
|
ungrouped?: boolean;
|
|
12
12
|
fullHeight?: boolean;
|
|
13
|
+
isScrollable?: boolean;
|
|
13
14
|
};
|
|
14
|
-
export declare const VuiCard: ({ header, body, footer, align, interactive, href, className, padding, highlight, ungrouped, fullHeight, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const VuiCard: ({ header, body, footer, align, interactive, href, className, padding, highlight, ungrouped, fullHeight, isScrollable, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export {};
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import classNames from "classnames";
|
|
14
14
|
export const VuiCard = (_a) => {
|
|
15
|
-
var { header, body, footer, align = "left", interactive, href, className, padding = "s", highlight, ungrouped, fullHeight } = _a, rest = __rest(_a, ["header", "body", "footer", "align", "interactive", "href", "className", "padding", "highlight", "ungrouped", "fullHeight"]);
|
|
15
|
+
var { header, body, footer, align = "left", interactive, href, className, padding = "s", highlight, ungrouped, fullHeight, isScrollable } = _a, rest = __rest(_a, ["header", "body", "footer", "align", "interactive", "href", "className", "padding", "highlight", "ungrouped", "fullHeight", "isScrollable"]);
|
|
16
16
|
const classes = classNames("vuiCard", `vuiCard--${align}`, `vuiCard--${padding}`, {
|
|
17
17
|
"vuiCard--interactive": interactive && !href,
|
|
18
18
|
"vuiCard--link": href,
|
|
@@ -20,8 +20,11 @@ export const VuiCard = (_a) => {
|
|
|
20
20
|
"vuiCard--ungrouped": ungrouped,
|
|
21
21
|
"vuiCard--fullHeight": fullHeight
|
|
22
22
|
}, className);
|
|
23
|
+
const bodyClasses = classNames("vuiCard__body", {
|
|
24
|
+
"vuiCard__body--scrollable": isScrollable
|
|
25
|
+
});
|
|
23
26
|
const headerContent = header && _jsx("div", Object.assign({ className: "vuiCard__header" }, { children: header }));
|
|
24
|
-
const bodyContent = body && _jsx("div", Object.assign({ className:
|
|
27
|
+
const bodyContent = body && _jsx("div", Object.assign({ className: bodyClasses }, { children: body }));
|
|
25
28
|
const footerContent = footer && _jsx("div", Object.assign({ className: "vuiCard__footer" }, { children: footer }));
|
|
26
29
|
if (href) {
|
|
27
30
|
return (_jsxs("a", Object.assign({ className: classes, href: href }, rest, { children: [headerContent, bodyContent, footerContent] })));
|
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FlexSpacing } from "../flex/types";
|
|
3
|
+
import { ResponsiveGridValue } from "./types";
|
|
3
4
|
export declare const COLUMNS: readonly [1, 2, 3, 4];
|
|
4
5
|
export type Columns = (typeof COLUMNS)[number];
|
|
6
|
+
declare const GRID_ALIGN_ITEMS: readonly ["start", "end", "center", "stretch", "baseline"];
|
|
7
|
+
type GridAlignItems = (typeof GRID_ALIGN_ITEMS)[number];
|
|
8
|
+
declare const GRID_JUSTIFY_ITEMS: readonly ["start", "end", "center", "stretch"];
|
|
9
|
+
type GridJustifyItems = (typeof GRID_JUSTIFY_ITEMS)[number];
|
|
10
|
+
declare const GRID_ALIGN_CONTENT: readonly ["start", "end", "center", "stretch", "spaceAround", "spaceBetween", "spaceEvenly"];
|
|
11
|
+
type GridAlignContent = (typeof GRID_ALIGN_CONTENT)[number];
|
|
12
|
+
declare const GRID_JUSTIFY_CONTENT: readonly ["start", "end", "center", "stretch", "spaceAround", "spaceBetween", "spaceEvenly"];
|
|
13
|
+
type GridJustifyContent = (typeof GRID_JUSTIFY_CONTENT)[number];
|
|
5
14
|
type Props = {
|
|
6
15
|
children?: React.ReactNode;
|
|
7
16
|
columns?: Columns;
|
|
8
17
|
spacing?: FlexSpacing;
|
|
18
|
+
templateColumns?: ResponsiveGridValue<string>;
|
|
19
|
+
templateRows?: string;
|
|
20
|
+
alignItems?: GridAlignItems;
|
|
21
|
+
justifyItems?: GridJustifyItems;
|
|
22
|
+
alignContent?: GridAlignContent;
|
|
23
|
+
justifyContent?: GridJustifyContent;
|
|
24
|
+
inline?: boolean;
|
|
25
|
+
fullWidth?: boolean;
|
|
9
26
|
className?: string;
|
|
10
27
|
};
|
|
11
|
-
export declare const VuiGrid: ({ children, columns, spacing, className, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const VuiGrid: ({ children, columns, spacing, templateColumns, templateRows, alignItems, justifyItems, alignContent, justifyContent, inline, fullWidth, className, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
29
|
export {};
|
|
@@ -12,9 +12,93 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import classNames from "classnames";
|
|
14
14
|
export const COLUMNS = [1, 2, 3, 4];
|
|
15
|
+
const GRID_ALIGN_ITEMS = ["start", "end", "center", "stretch", "baseline"];
|
|
16
|
+
const GRID_JUSTIFY_ITEMS = ["start", "end", "center", "stretch"];
|
|
17
|
+
const GRID_ALIGN_CONTENT = [
|
|
18
|
+
"start",
|
|
19
|
+
"end",
|
|
20
|
+
"center",
|
|
21
|
+
"stretch",
|
|
22
|
+
"spaceAround",
|
|
23
|
+
"spaceBetween",
|
|
24
|
+
"spaceEvenly"
|
|
25
|
+
];
|
|
26
|
+
const GRID_JUSTIFY_CONTENT = [
|
|
27
|
+
"start",
|
|
28
|
+
"end",
|
|
29
|
+
"center",
|
|
30
|
+
"stretch",
|
|
31
|
+
"spaceAround",
|
|
32
|
+
"spaceBetween",
|
|
33
|
+
"spaceEvenly"
|
|
34
|
+
];
|
|
35
|
+
const alignItemsClassMap = {
|
|
36
|
+
start: "vuiGrid--alignItemsStart",
|
|
37
|
+
end: "vuiGrid--alignItemsEnd",
|
|
38
|
+
center: "vuiGrid--alignItemsCenter",
|
|
39
|
+
stretch: "vuiGrid--alignItemsStretch",
|
|
40
|
+
baseline: "vuiGrid--alignItemsBaseline"
|
|
41
|
+
};
|
|
42
|
+
const justifyItemsClassMap = {
|
|
43
|
+
start: "vuiGrid--justifyItemsStart",
|
|
44
|
+
end: "vuiGrid--justifyItemsEnd",
|
|
45
|
+
center: "vuiGrid--justifyItemsCenter",
|
|
46
|
+
stretch: "vuiGrid--justifyItemsStretch"
|
|
47
|
+
};
|
|
48
|
+
const alignContentClassMap = {
|
|
49
|
+
start: "vuiGrid--alignContentStart",
|
|
50
|
+
end: "vuiGrid--alignContentEnd",
|
|
51
|
+
center: "vuiGrid--alignContentCenter",
|
|
52
|
+
stretch: "vuiGrid--alignContentStretch",
|
|
53
|
+
spaceAround: "vuiGrid--alignContentSpaceAround",
|
|
54
|
+
spaceBetween: "vuiGrid--alignContentSpaceBetween",
|
|
55
|
+
spaceEvenly: "vuiGrid--alignContentSpaceEvenly"
|
|
56
|
+
};
|
|
57
|
+
const justifyContentClassMap = {
|
|
58
|
+
start: "vuiGrid--justifyContentStart",
|
|
59
|
+
end: "vuiGrid--justifyContentEnd",
|
|
60
|
+
center: "vuiGrid--justifyContentCenter",
|
|
61
|
+
stretch: "vuiGrid--justifyContentStretch",
|
|
62
|
+
spaceAround: "vuiGrid--justifyContentSpaceAround",
|
|
63
|
+
spaceBetween: "vuiGrid--justifyContentSpaceBetween",
|
|
64
|
+
spaceEvenly: "vuiGrid--justifyContentSpaceEvenly"
|
|
65
|
+
};
|
|
15
66
|
export const VuiGrid = (_a) => {
|
|
16
|
-
var { children, columns = 2, spacing = "m", className } = _a, rest = __rest(_a, ["children", "columns", "spacing", "className"]);
|
|
67
|
+
var { children, columns = 2, spacing = "m", templateColumns, templateRows, alignItems, justifyItems, alignContent, justifyContent, inline, fullWidth, className } = _a, rest = __rest(_a, ["children", "columns", "spacing", "templateColumns", "templateRows", "alignItems", "justifyItems", "alignContent", "justifyContent", "inline", "fullWidth", "className"]);
|
|
17
68
|
const classes = classNames("vuiGridContainer", className);
|
|
18
|
-
const
|
|
19
|
-
|
|
69
|
+
const isResponsiveTemplateColumns = templateColumns && typeof templateColumns === "object";
|
|
70
|
+
const contentClasses = classNames("vuiGrid", {
|
|
71
|
+
[`vuiGrid--${spacing}`]: spacing,
|
|
72
|
+
[`vuiGrid--columns${columns}`]: !templateColumns && columns,
|
|
73
|
+
"vuiGrid--inline": inline,
|
|
74
|
+
"vuiGrid--fullWidth": fullWidth,
|
|
75
|
+
"vuiGrid--responsive": isResponsiveTemplateColumns
|
|
76
|
+
}, alignItems && alignItemsClassMap[alignItems], justifyItems && justifyItemsClassMap[justifyItems], alignContent && alignContentClassMap[alignContent], justifyContent && justifyContentClassMap[justifyContent]);
|
|
77
|
+
const gridStyle = {};
|
|
78
|
+
if (templateColumns) {
|
|
79
|
+
if (typeof templateColumns === "string") {
|
|
80
|
+
gridStyle.gridTemplateColumns = templateColumns;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
// Implement cascading: each breakpoint inherits from the previous if not defined
|
|
84
|
+
// If 'default' is specified, use it as the base fallback value
|
|
85
|
+
const defaultValue = templateColumns.default;
|
|
86
|
+
const smValue = templateColumns.sm || defaultValue;
|
|
87
|
+
const mdValue = templateColumns.md || smValue;
|
|
88
|
+
const lgValue = templateColumns.lg || mdValue;
|
|
89
|
+
if (smValue) {
|
|
90
|
+
gridStyle["--grid-template-sm"] = smValue;
|
|
91
|
+
}
|
|
92
|
+
if (mdValue) {
|
|
93
|
+
gridStyle["--grid-template-md"] = mdValue;
|
|
94
|
+
}
|
|
95
|
+
if (lgValue) {
|
|
96
|
+
gridStyle["--grid-template-lg"] = lgValue;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (templateRows) {
|
|
101
|
+
gridStyle.gridTemplateRows = templateRows;
|
|
102
|
+
}
|
|
103
|
+
return (_jsx("div", Object.assign({ className: classes }, rest, { children: _jsx("div", Object.assign({ className: contentClasses, style: Object.keys(gridStyle).length > 0 ? gridStyle : undefined }, { children: children })) })));
|
|
20
104
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ResponsiveGridValue } from "./types";
|
|
3
|
+
declare const GRID_ALIGN_SELF: readonly ["start", "end", "center", "stretch", "baseline"];
|
|
4
|
+
type GridAlignSelf = (typeof GRID_ALIGN_SELF)[number];
|
|
5
|
+
declare const GRID_JUSTIFY_SELF: readonly ["start", "end", "center", "stretch"];
|
|
6
|
+
type GridJustifySelf = (typeof GRID_JUSTIFY_SELF)[number];
|
|
7
|
+
type GridSpan = number | "auto";
|
|
8
|
+
type GridLine = number | "auto" | `span ${number}`;
|
|
9
|
+
type GridItemProps = {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
area?: string;
|
|
12
|
+
colSpan?: ResponsiveGridValue<GridSpan>;
|
|
13
|
+
rowSpan?: GridSpan;
|
|
14
|
+
colStart?: GridLine;
|
|
15
|
+
colEnd?: GridLine;
|
|
16
|
+
rowStart?: GridLine;
|
|
17
|
+
rowEnd?: GridLine;
|
|
18
|
+
alignSelf?: GridAlignSelf;
|
|
19
|
+
justifySelf?: GridJustifySelf;
|
|
20
|
+
className?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const VuiGridItem: ({ children, area, colSpan, rowSpan, colStart, colEnd, rowStart, rowEnd, alignSelf, justifySelf, className, ...rest }: GridItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import classNames from "classnames";
|
|
14
|
+
const GRID_ALIGN_SELF = ["start", "end", "center", "stretch", "baseline"];
|
|
15
|
+
const GRID_JUSTIFY_SELF = ["start", "end", "center", "stretch"];
|
|
16
|
+
// Mapping objects for alignment properties
|
|
17
|
+
const alignSelfClassMap = {
|
|
18
|
+
start: "vuiGridItem--alignSelfStart",
|
|
19
|
+
end: "vuiGridItem--alignSelfEnd",
|
|
20
|
+
center: "vuiGridItem--alignSelfCenter",
|
|
21
|
+
stretch: "vuiGridItem--alignSelfStretch",
|
|
22
|
+
baseline: "vuiGridItem--alignSelfBaseline"
|
|
23
|
+
};
|
|
24
|
+
const justifySelfClassMap = {
|
|
25
|
+
start: "vuiGridItem--justifySelfStart",
|
|
26
|
+
end: "vuiGridItem--justifySelfEnd",
|
|
27
|
+
center: "vuiGridItem--justifySelfCenter",
|
|
28
|
+
stretch: "vuiGridItem--justifySelfStretch"
|
|
29
|
+
};
|
|
30
|
+
const isResponsiveGridValue = (value) => {
|
|
31
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
32
|
+
};
|
|
33
|
+
const normalizeGridSpan = (value) => {
|
|
34
|
+
if (value === "auto")
|
|
35
|
+
return "auto";
|
|
36
|
+
return `span ${value}`;
|
|
37
|
+
};
|
|
38
|
+
// Helper to check if a grid value is a number within the valid range for CSS classes
|
|
39
|
+
const isGridValueInRange = (value, maxValue = 12) => {
|
|
40
|
+
return typeof value === "number" && value >= 1 && value <= maxValue;
|
|
41
|
+
};
|
|
42
|
+
export const VuiGridItem = (_a) => {
|
|
43
|
+
var { children, area, colSpan, rowSpan, colStart, colEnd, rowStart, rowEnd, alignSelf, justifySelf, className } = _a, rest = __rest(_a, ["children", "area", "colSpan", "rowSpan", "colStart", "colEnd", "rowStart", "rowEnd", "alignSelf", "justifySelf", "className"]);
|
|
44
|
+
const isColSpanResponsive = isResponsiveGridValue(colSpan);
|
|
45
|
+
const classes = classNames("vuiGridItem", {
|
|
46
|
+
[`vuiGridItem--colSpan${colSpan}`]: !isColSpanResponsive && isGridValueInRange(colSpan),
|
|
47
|
+
[`vuiGridItem--rowSpan${rowSpan}`]: isGridValueInRange(rowSpan),
|
|
48
|
+
[`vuiGridItem--colStart${colStart}`]: isGridValueInRange(colStart),
|
|
49
|
+
[`vuiGridItem--colEnd${colEnd}`]: isGridValueInRange(colEnd),
|
|
50
|
+
[`vuiGridItem--rowStart${rowStart}`]: isGridValueInRange(rowStart),
|
|
51
|
+
[`vuiGridItem--rowEnd${rowEnd}`]: isGridValueInRange(rowEnd),
|
|
52
|
+
"vuiGridItem--responsive": isColSpanResponsive
|
|
53
|
+
}, alignSelf && alignSelfClassMap[alignSelf], justifySelf && justifySelfClassMap[justifySelf], className);
|
|
54
|
+
const style = {};
|
|
55
|
+
if (area) {
|
|
56
|
+
style.gridArea = area;
|
|
57
|
+
}
|
|
58
|
+
if (isColSpanResponsive) {
|
|
59
|
+
// Implement cascading: each breakpoint inherits from the previous if not defined
|
|
60
|
+
// If 'default' is specified, use it as the base fallback value
|
|
61
|
+
const defaultValue = colSpan.default;
|
|
62
|
+
const smValue = colSpan.sm !== undefined ? colSpan.sm : defaultValue;
|
|
63
|
+
const mdValue = colSpan.md !== undefined ? colSpan.md : smValue;
|
|
64
|
+
const lgValue = colSpan.lg !== undefined ? colSpan.lg : mdValue;
|
|
65
|
+
if (smValue !== undefined) {
|
|
66
|
+
style["--grid-item-colSpan-sm"] = normalizeGridSpan(smValue);
|
|
67
|
+
}
|
|
68
|
+
if (mdValue !== undefined) {
|
|
69
|
+
style["--grid-item-colSpan-md"] = normalizeGridSpan(mdValue);
|
|
70
|
+
}
|
|
71
|
+
if (lgValue !== undefined) {
|
|
72
|
+
style["--grid-item-colSpan-lg"] = normalizeGridSpan(lgValue);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else if (colSpan === "auto" || (typeof colSpan === "number" && colSpan > 12)) {
|
|
76
|
+
style.gridColumn = colSpan === "auto" ? "auto" : `span ${colSpan}`;
|
|
77
|
+
}
|
|
78
|
+
if (rowSpan === "auto" || (typeof rowSpan === "number" && rowSpan > 12)) {
|
|
79
|
+
style.gridRow = rowSpan === "auto" ? "auto" : `span ${rowSpan}`;
|
|
80
|
+
}
|
|
81
|
+
// Handle position values that are strings or > 12
|
|
82
|
+
if (colStart) {
|
|
83
|
+
if (typeof colStart === "string" || colStart > 12) {
|
|
84
|
+
style.gridColumnStart = colStart;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (colEnd) {
|
|
88
|
+
if (typeof colEnd === "string" || colEnd > 12) {
|
|
89
|
+
style.gridColumnEnd = colEnd;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (rowStart) {
|
|
93
|
+
if (typeof rowStart === "string" || rowStart > 12) {
|
|
94
|
+
style.gridRowStart = rowStart;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (rowEnd) {
|
|
98
|
+
if (typeof rowEnd === "string" || rowEnd > 12) {
|
|
99
|
+
style.gridRowEnd = rowEnd;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return (_jsx("div", Object.assign({ className: classes, style: Object.keys(style).length > 0 ? style : undefined }, rest, { children: children })));
|
|
103
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FlexSpacing } from "../flex/types";
|
|
3
|
+
type Props = {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
columns?: number | Record<string, number>;
|
|
6
|
+
minChildWidth?: string;
|
|
7
|
+
spacing?: FlexSpacing;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const VuiSimpleGrid: ({ children, columns, minChildWidth, spacing, className, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import classNames from "classnames";
|
|
14
|
+
import { VuiGrid } from "./Grid";
|
|
15
|
+
export const VuiSimpleGrid = (_a) => {
|
|
16
|
+
var { children, columns, minChildWidth, spacing = "m", className } = _a, rest = __rest(_a, ["children", "columns", "minChildWidth", "spacing", "className"]);
|
|
17
|
+
let templateColumns;
|
|
18
|
+
if (minChildWidth) {
|
|
19
|
+
// Use auto-fit with minmax for responsive behavior
|
|
20
|
+
templateColumns = `repeat(auto-fit, minmax(${minChildWidth}, 1fr))`;
|
|
21
|
+
}
|
|
22
|
+
else if (typeof columns === "number") {
|
|
23
|
+
templateColumns = `repeat(${columns}, 1fr)`;
|
|
24
|
+
}
|
|
25
|
+
else if (columns && typeof columns === "object") {
|
|
26
|
+
// TODO: Responsive columns object - would need media queries or container queries
|
|
27
|
+
// For now, just use the first value as a fallback
|
|
28
|
+
const firstValue = Object.values(columns)[0];
|
|
29
|
+
templateColumns = `repeat(${firstValue}, 1fr)`;
|
|
30
|
+
}
|
|
31
|
+
const classes = classNames("vuiSimpleGrid", className);
|
|
32
|
+
return (_jsx(VuiGrid, Object.assign({ templateColumns: templateColumns, spacing: spacing, className: classes }, rest, { children: children })));
|
|
33
|
+
};
|
|
@@ -67,3 +67,215 @@ $spacing: (
|
|
|
67
67
|
grid-template-columns: 1fr;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
+
|
|
71
|
+
// Responsive grid template columns using CSS custom properties
|
|
72
|
+
.vuiGrid--responsive {
|
|
73
|
+
// Small (applies from 0px up - default/mobile-first)
|
|
74
|
+
grid-template-columns: var(--grid-template-sm);
|
|
75
|
+
|
|
76
|
+
@container (width > 500px) {
|
|
77
|
+
grid-template-columns: var(--grid-template-md);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@container (width > 800px) {
|
|
81
|
+
grid-template-columns: var(--grid-template-lg);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Alignment - align-items
|
|
86
|
+
.vuiGrid--alignItemsStart {
|
|
87
|
+
align-items: start;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.vuiGrid--alignItemsEnd {
|
|
91
|
+
align-items: end;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.vuiGrid--alignItemsCenter {
|
|
95
|
+
align-items: center;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.vuiGrid--alignItemsStretch {
|
|
99
|
+
align-items: stretch;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.vuiGrid--alignItemsBaseline {
|
|
103
|
+
align-items: baseline;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Alignment - justify-items
|
|
107
|
+
.vuiGrid--justifyItemsStart {
|
|
108
|
+
justify-items: start;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.vuiGrid--justifyItemsEnd {
|
|
112
|
+
justify-items: end;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.vuiGrid--justifyItemsCenter {
|
|
116
|
+
justify-items: center;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.vuiGrid--justifyItemsStretch {
|
|
120
|
+
justify-items: stretch;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Alignment - align-content
|
|
124
|
+
.vuiGrid--alignContentStart {
|
|
125
|
+
align-content: start;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.vuiGrid--alignContentEnd {
|
|
129
|
+
align-content: end;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.vuiGrid--alignContentCenter {
|
|
133
|
+
align-content: center;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.vuiGrid--alignContentStretch {
|
|
137
|
+
align-content: stretch;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.vuiGrid--alignContentSpaceAround {
|
|
141
|
+
align-content: space-around;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.vuiGrid--alignContentSpaceBetween {
|
|
145
|
+
align-content: space-between;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.vuiGrid--alignContentSpaceEvenly {
|
|
149
|
+
align-content: space-evenly;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Alignment - justify-content
|
|
153
|
+
.vuiGrid--justifyContentStart {
|
|
154
|
+
justify-content: start;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.vuiGrid--justifyContentEnd {
|
|
158
|
+
justify-content: end;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.vuiGrid--justifyContentCenter {
|
|
162
|
+
justify-content: center;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.vuiGrid--justifyContentStretch {
|
|
166
|
+
justify-content: stretch;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.vuiGrid--justifyContentSpaceAround {
|
|
170
|
+
justify-content: space-around;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.vuiGrid--justifyContentSpaceBetween {
|
|
174
|
+
justify-content: space-between;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.vuiGrid--justifyContentSpaceEvenly {
|
|
178
|
+
justify-content: space-evenly;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Display options
|
|
182
|
+
.vuiGrid--inline {
|
|
183
|
+
display: inline-grid;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.vuiGrid--fullWidth {
|
|
187
|
+
width: 100%;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// GridItem styles
|
|
191
|
+
.vuiGridItem {
|
|
192
|
+
// Base styles if needed
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// GridItem column span helpers
|
|
196
|
+
@for $i from 1 through 12 {
|
|
197
|
+
.vuiGridItem--colSpan#{$i} {
|
|
198
|
+
grid-column: span $i;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// GridItem row span helpers
|
|
203
|
+
@for $i from 1 through 12 {
|
|
204
|
+
.vuiGridItem--rowSpan#{$i} {
|
|
205
|
+
grid-row: span $i;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// GridItem position helpers - column start/end
|
|
210
|
+
@for $i from 1 through 12 {
|
|
211
|
+
.vuiGridItem--colStart#{$i} {
|
|
212
|
+
grid-column-start: $i;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.vuiGridItem--colEnd#{$i} {
|
|
216
|
+
grid-column-end: $i;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// GridItem position helpers - row start/end
|
|
221
|
+
@for $i from 1 through 12 {
|
|
222
|
+
.vuiGridItem--rowStart#{$i} {
|
|
223
|
+
grid-row-start: $i;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.vuiGridItem--rowEnd#{$i} {
|
|
227
|
+
grid-row-end: $i;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// GridItem alignment - align-self
|
|
232
|
+
.vuiGridItem--alignSelfStart {
|
|
233
|
+
align-self: start;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.vuiGridItem--alignSelfEnd {
|
|
237
|
+
align-self: end;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.vuiGridItem--alignSelfCenter {
|
|
241
|
+
align-self: center;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.vuiGridItem--alignSelfStretch {
|
|
245
|
+
align-self: stretch;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.vuiGridItem--alignSelfBaseline {
|
|
249
|
+
align-self: baseline;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// GridItem alignment - justify-self
|
|
253
|
+
.vuiGridItem--justifySelfStart {
|
|
254
|
+
justify-self: start;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.vuiGridItem--justifySelfEnd {
|
|
258
|
+
justify-self: end;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.vuiGridItem--justifySelfCenter {
|
|
262
|
+
justify-self: center;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.vuiGridItem--justifySelfStretch {
|
|
266
|
+
justify-self: stretch;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Responsive grid item column span using CSS custom properties
|
|
270
|
+
.vuiGridItem--responsive {
|
|
271
|
+
// Small (applies from 0px up - default/mobile-first)
|
|
272
|
+
grid-column: var(--grid-item-colSpan-sm);
|
|
273
|
+
|
|
274
|
+
@container (width > 500px) {
|
|
275
|
+
grid-column: var(--grid-item-colSpan-md);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
@container (width > 800px) {
|
|
279
|
+
grid-column: var(--grid-item-colSpan-lg);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -31,6 +31,8 @@ import { VuiFlexItem } from "./flex/FlexItem";
|
|
|
31
31
|
import { RadioButtonConfig, VuiCheckbox, VuiItemsInput, VuiLabel, VuiNumberInput, VuiRadioButton, VuiSelect, VuiSuperRadioGroup, VuiTextInput, VuiTextArea, VuiPasswordInput } from "./form";
|
|
32
32
|
import { VuiFormGroup } from "./formGroup/FormGroup";
|
|
33
33
|
import { VuiGrid } from "./grid/Grid";
|
|
34
|
+
import { VuiGridItem } from "./grid/GridItem";
|
|
35
|
+
import { VuiSimpleGrid } from "./grid/SimpleGrid";
|
|
34
36
|
import { VuiHorizontalRule } from "./horizontalRule/HorizontalRule";
|
|
35
37
|
import { VuiIcon } from "./icon/Icon";
|
|
36
38
|
import { ICON_COLOR, ICON_SIZE, ICON_TYPE } from "./icon/types";
|
|
@@ -90,4 +92,4 @@ import { VuiTopicButton } from "./topicButton/TopicButton";
|
|
|
90
92
|
import { copyToClipboard } from "../utils/copyToClipboard";
|
|
91
93
|
import { toRgb, toRgba } from "./context/Theme";
|
|
92
94
|
export type { AnchorSide, AppContentPadding, ButtonColor, CalloutColor, ChatLanguage, ChatStyle, ChatTurn, CodeLanguage, InfoListType, InfoTableColumnAlign, InfoTableRow, InfoTableRowType, LinkProps, MenuItem, OptionListItem, Pagination, RadioButtonConfig, SearchResult, SearchSuggestion, Sections, SectionItem, Stat, StepStatus, StepSize, TabSize, Tree, TreeItem, VuiStepProps };
|
|
93
|
-
export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, ICON_COLOR, ICON_SIZE, ICON_TYPE, PROGRESS_BAR_COLOR, SPACER_SIZE, SPINNER_COLOR, SKELETON_COLOR, SPINNER_SIZE, TAB_SIZE, TEXT_COLOR, TEXT_SIZE, TITLE_SIZE, addNotification, copyToClipboard, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiCode, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoMenu, VuiInfoTable, VuiInProgress, VuiItemsInput, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPagination, VuiPanel, VuiPasswordInput, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSpacer, VuiSpinner, VuiStatList, VuiStatus, VuiSteps, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
|
|
95
|
+
export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, ICON_COLOR, ICON_SIZE, ICON_TYPE, PROGRESS_BAR_COLOR, SPACER_SIZE, SPINNER_COLOR, SKELETON_COLOR, SPINNER_SIZE, TAB_SIZE, TEXT_COLOR, TEXT_SIZE, TITLE_SIZE, addNotification, copyToClipboard, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiCode, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiSimpleGrid, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoMenu, VuiInfoTable, VuiInProgress, VuiItemsInput, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPagination, VuiPanel, VuiPasswordInput, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSpacer, VuiSpinner, VuiStatList, VuiStatus, VuiSteps, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
|
package/lib/components/index.js
CHANGED
|
@@ -27,6 +27,8 @@ import { VuiFlexItem } from "./flex/FlexItem";
|
|
|
27
27
|
import { VuiCheckbox, VuiItemsInput, VuiLabel, VuiNumberInput, VuiRadioButton, VuiSelect, VuiSuperRadioGroup, VuiTextInput, VuiTextArea, VuiPasswordInput } from "./form";
|
|
28
28
|
import { VuiFormGroup } from "./formGroup/FormGroup";
|
|
29
29
|
import { VuiGrid } from "./grid/Grid";
|
|
30
|
+
import { VuiGridItem } from "./grid/GridItem";
|
|
31
|
+
import { VuiSimpleGrid } from "./grid/SimpleGrid";
|
|
30
32
|
import { VuiHorizontalRule } from "./horizontalRule/HorizontalRule";
|
|
31
33
|
import { VuiIcon } from "./icon/Icon";
|
|
32
34
|
import { ICON_COLOR, ICON_SIZE, ICON_TYPE } from "./icon/types";
|
|
@@ -82,4 +84,4 @@ import { VuiTooltip } from "./tooltip/Tooltip";
|
|
|
82
84
|
import { VuiTopicButton } from "./topicButton/TopicButton";
|
|
83
85
|
import { copyToClipboard } from "../utils/copyToClipboard";
|
|
84
86
|
import { toRgb, toRgba } from "./context/Theme";
|
|
85
|
-
export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, ICON_COLOR, ICON_SIZE, ICON_TYPE, PROGRESS_BAR_COLOR, SPACER_SIZE, SPINNER_COLOR, SKELETON_COLOR, SPINNER_SIZE, TAB_SIZE, TEXT_COLOR, TEXT_SIZE, TITLE_SIZE, addNotification, copyToClipboard, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiCode, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoMenu, VuiInfoTable, VuiInProgress, VuiItemsInput, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPagination, VuiPanel, VuiPasswordInput, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSpacer, VuiSpinner, VuiStatList, VuiStatus, VuiSteps, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
|
|
87
|
+
export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, ICON_COLOR, ICON_SIZE, ICON_TYPE, PROGRESS_BAR_COLOR, SPACER_SIZE, SPINNER_COLOR, SKELETON_COLOR, SPINNER_SIZE, TAB_SIZE, TEXT_COLOR, TEXT_SIZE, TITLE_SIZE, addNotification, copyToClipboard, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiCode, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiSimpleGrid, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoMenu, VuiInfoTable, VuiInProgress, VuiItemsInput, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPagination, VuiPanel, VuiPasswordInput, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSpacer, VuiSpinner, VuiStatList, VuiStatus, VuiSteps, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
|
|
@@ -7,6 +7,8 @@ type Props = {
|
|
|
7
7
|
background?: string;
|
|
8
8
|
backgroundScale?: "width" | "height";
|
|
9
9
|
backgroundMaxSize?: string;
|
|
10
|
+
fullHeight?: boolean;
|
|
11
|
+
fullWidth?: boolean;
|
|
10
12
|
};
|
|
11
|
-
export declare const VuiPanel: ({ icon, children, actions, background, backgroundScale, align, color, backgroundMaxSize }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const VuiPanel: ({ icon, children, actions, background, backgroundScale, align, color, backgroundMaxSize, fullHeight, fullWidth, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -1,12 +1,27 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
13
|
import classNames from "classnames";
|
|
3
|
-
export const VuiPanel = (
|
|
4
|
-
|
|
14
|
+
export const VuiPanel = (_a) => {
|
|
15
|
+
var { icon, children, actions, background, backgroundScale = "height", align = "top", color = "default", backgroundMaxSize, fullHeight, fullWidth } = _a, rest = __rest(_a, ["icon", "children", "actions", "background", "backgroundScale", "align", "color", "backgroundMaxSize", "fullHeight", "fullWidth"]);
|
|
16
|
+
const classes = classNames("vuiPanel", `vuiPanel--${color}`, `vuiPanel--align-${align}`, {
|
|
17
|
+
"vuiPanel--fullHeight": fullHeight,
|
|
18
|
+
"vuiPanel--fullWidth": fullWidth
|
|
19
|
+
});
|
|
5
20
|
const style = backgroundMaxSize !== undefined
|
|
6
21
|
? {
|
|
7
22
|
maxWidth: backgroundScale === "width" ? backgroundMaxSize : undefined,
|
|
8
23
|
maxHeight: backgroundScale === "height" ? backgroundMaxSize : undefined
|
|
9
24
|
}
|
|
10
25
|
: {};
|
|
11
|
-
return (_jsxs("div", Object.assign({ className: classes }, { children: [background && (_jsx("img", { className: `vuiPanelBackground vuiBackgroundScale--${backgroundScale}`, src: background, style: style })), icon && _jsx("div", Object.assign({ className: "vuiPanelIcon" }, { children: icon })), children && _jsx("div", Object.assign({ className: "vuiPanelContent" }, { children: children })), actions && _jsx("div", Object.assign({ className: "vuiPanelActions" }, { children: actions }))] })));
|
|
26
|
+
return (_jsxs("div", Object.assign({ className: classes }, rest, { children: [background && (_jsx("img", { className: `vuiPanelBackground vuiBackgroundScale--${backgroundScale}`, src: background, style: style })), icon && _jsx("div", Object.assign({ className: "vuiPanelIcon" }, { children: icon })), children && _jsx("div", Object.assign({ className: "vuiPanelContent" }, { children: children })), actions && _jsx("div", Object.assign({ className: "vuiPanelActions" }, { children: actions }))] })));
|
|
12
27
|
};
|
package/lib/styles/index.css
CHANGED
|
@@ -1139,6 +1139,10 @@ fieldset {
|
|
|
1139
1139
|
flex-grow: 1;
|
|
1140
1140
|
}
|
|
1141
1141
|
|
|
1142
|
+
.vuiCard__body--scrollable {
|
|
1143
|
+
overflow-y: auto;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1142
1146
|
.vuiCard__footer {
|
|
1143
1147
|
display: flex;
|
|
1144
1148
|
flex-direction: column;
|
|
@@ -2806,6 +2810,458 @@ h2.react-datepicker__current-month {
|
|
|
2806
2810
|
grid-template-columns: 1fr;
|
|
2807
2811
|
}
|
|
2808
2812
|
}
|
|
2813
|
+
.vuiGrid--responsive {
|
|
2814
|
+
grid-template-columns: var(--grid-template-sm);
|
|
2815
|
+
}
|
|
2816
|
+
@container (width > 500px) {
|
|
2817
|
+
.vuiGrid--responsive {
|
|
2818
|
+
grid-template-columns: var(--grid-template-md);
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
@container (width > 800px) {
|
|
2822
|
+
.vuiGrid--responsive {
|
|
2823
|
+
grid-template-columns: var(--grid-template-lg);
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
|
|
2827
|
+
.vuiGrid--alignItemsStart {
|
|
2828
|
+
align-items: start;
|
|
2829
|
+
}
|
|
2830
|
+
|
|
2831
|
+
.vuiGrid--alignItemsEnd {
|
|
2832
|
+
align-items: end;
|
|
2833
|
+
}
|
|
2834
|
+
|
|
2835
|
+
.vuiGrid--alignItemsCenter {
|
|
2836
|
+
align-items: center;
|
|
2837
|
+
}
|
|
2838
|
+
|
|
2839
|
+
.vuiGrid--alignItemsStretch {
|
|
2840
|
+
align-items: stretch;
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2843
|
+
.vuiGrid--alignItemsBaseline {
|
|
2844
|
+
align-items: baseline;
|
|
2845
|
+
}
|
|
2846
|
+
|
|
2847
|
+
.vuiGrid--justifyItemsStart {
|
|
2848
|
+
justify-items: start;
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
.vuiGrid--justifyItemsEnd {
|
|
2852
|
+
justify-items: end;
|
|
2853
|
+
}
|
|
2854
|
+
|
|
2855
|
+
.vuiGrid--justifyItemsCenter {
|
|
2856
|
+
justify-items: center;
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
.vuiGrid--justifyItemsStretch {
|
|
2860
|
+
justify-items: stretch;
|
|
2861
|
+
}
|
|
2862
|
+
|
|
2863
|
+
.vuiGrid--alignContentStart {
|
|
2864
|
+
align-content: start;
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
.vuiGrid--alignContentEnd {
|
|
2868
|
+
align-content: end;
|
|
2869
|
+
}
|
|
2870
|
+
|
|
2871
|
+
.vuiGrid--alignContentCenter {
|
|
2872
|
+
align-content: center;
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
.vuiGrid--alignContentStretch {
|
|
2876
|
+
align-content: stretch;
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2879
|
+
.vuiGrid--alignContentSpaceAround {
|
|
2880
|
+
align-content: space-around;
|
|
2881
|
+
}
|
|
2882
|
+
|
|
2883
|
+
.vuiGrid--alignContentSpaceBetween {
|
|
2884
|
+
align-content: space-between;
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2887
|
+
.vuiGrid--alignContentSpaceEvenly {
|
|
2888
|
+
align-content: space-evenly;
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2891
|
+
.vuiGrid--justifyContentStart {
|
|
2892
|
+
justify-content: start;
|
|
2893
|
+
}
|
|
2894
|
+
|
|
2895
|
+
.vuiGrid--justifyContentEnd {
|
|
2896
|
+
justify-content: end;
|
|
2897
|
+
}
|
|
2898
|
+
|
|
2899
|
+
.vuiGrid--justifyContentCenter {
|
|
2900
|
+
justify-content: center;
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
.vuiGrid--justifyContentStretch {
|
|
2904
|
+
justify-content: stretch;
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2907
|
+
.vuiGrid--justifyContentSpaceAround {
|
|
2908
|
+
justify-content: space-around;
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2911
|
+
.vuiGrid--justifyContentSpaceBetween {
|
|
2912
|
+
justify-content: space-between;
|
|
2913
|
+
}
|
|
2914
|
+
|
|
2915
|
+
.vuiGrid--justifyContentSpaceEvenly {
|
|
2916
|
+
justify-content: space-evenly;
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
.vuiGrid--inline {
|
|
2920
|
+
display: inline-grid;
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
.vuiGrid--fullWidth {
|
|
2924
|
+
width: 100%;
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2927
|
+
.vuiGridItem--colSpan1 {
|
|
2928
|
+
grid-column: span 1;
|
|
2929
|
+
}
|
|
2930
|
+
|
|
2931
|
+
.vuiGridItem--colSpan2 {
|
|
2932
|
+
grid-column: span 2;
|
|
2933
|
+
}
|
|
2934
|
+
|
|
2935
|
+
.vuiGridItem--colSpan3 {
|
|
2936
|
+
grid-column: span 3;
|
|
2937
|
+
}
|
|
2938
|
+
|
|
2939
|
+
.vuiGridItem--colSpan4 {
|
|
2940
|
+
grid-column: span 4;
|
|
2941
|
+
}
|
|
2942
|
+
|
|
2943
|
+
.vuiGridItem--colSpan5 {
|
|
2944
|
+
grid-column: span 5;
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2947
|
+
.vuiGridItem--colSpan6 {
|
|
2948
|
+
grid-column: span 6;
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
.vuiGridItem--colSpan7 {
|
|
2952
|
+
grid-column: span 7;
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
.vuiGridItem--colSpan8 {
|
|
2956
|
+
grid-column: span 8;
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
.vuiGridItem--colSpan9 {
|
|
2960
|
+
grid-column: span 9;
|
|
2961
|
+
}
|
|
2962
|
+
|
|
2963
|
+
.vuiGridItem--colSpan10 {
|
|
2964
|
+
grid-column: span 10;
|
|
2965
|
+
}
|
|
2966
|
+
|
|
2967
|
+
.vuiGridItem--colSpan11 {
|
|
2968
|
+
grid-column: span 11;
|
|
2969
|
+
}
|
|
2970
|
+
|
|
2971
|
+
.vuiGridItem--colSpan12 {
|
|
2972
|
+
grid-column: span 12;
|
|
2973
|
+
}
|
|
2974
|
+
|
|
2975
|
+
.vuiGridItem--rowSpan1 {
|
|
2976
|
+
grid-row: span 1;
|
|
2977
|
+
}
|
|
2978
|
+
|
|
2979
|
+
.vuiGridItem--rowSpan2 {
|
|
2980
|
+
grid-row: span 2;
|
|
2981
|
+
}
|
|
2982
|
+
|
|
2983
|
+
.vuiGridItem--rowSpan3 {
|
|
2984
|
+
grid-row: span 3;
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2987
|
+
.vuiGridItem--rowSpan4 {
|
|
2988
|
+
grid-row: span 4;
|
|
2989
|
+
}
|
|
2990
|
+
|
|
2991
|
+
.vuiGridItem--rowSpan5 {
|
|
2992
|
+
grid-row: span 5;
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
.vuiGridItem--rowSpan6 {
|
|
2996
|
+
grid-row: span 6;
|
|
2997
|
+
}
|
|
2998
|
+
|
|
2999
|
+
.vuiGridItem--rowSpan7 {
|
|
3000
|
+
grid-row: span 7;
|
|
3001
|
+
}
|
|
3002
|
+
|
|
3003
|
+
.vuiGridItem--rowSpan8 {
|
|
3004
|
+
grid-row: span 8;
|
|
3005
|
+
}
|
|
3006
|
+
|
|
3007
|
+
.vuiGridItem--rowSpan9 {
|
|
3008
|
+
grid-row: span 9;
|
|
3009
|
+
}
|
|
3010
|
+
|
|
3011
|
+
.vuiGridItem--rowSpan10 {
|
|
3012
|
+
grid-row: span 10;
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3015
|
+
.vuiGridItem--rowSpan11 {
|
|
3016
|
+
grid-row: span 11;
|
|
3017
|
+
}
|
|
3018
|
+
|
|
3019
|
+
.vuiGridItem--rowSpan12 {
|
|
3020
|
+
grid-row: span 12;
|
|
3021
|
+
}
|
|
3022
|
+
|
|
3023
|
+
.vuiGridItem--colStart1 {
|
|
3024
|
+
grid-column-start: 1;
|
|
3025
|
+
}
|
|
3026
|
+
|
|
3027
|
+
.vuiGridItem--colEnd1 {
|
|
3028
|
+
grid-column-end: 1;
|
|
3029
|
+
}
|
|
3030
|
+
|
|
3031
|
+
.vuiGridItem--colStart2 {
|
|
3032
|
+
grid-column-start: 2;
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
.vuiGridItem--colEnd2 {
|
|
3036
|
+
grid-column-end: 2;
|
|
3037
|
+
}
|
|
3038
|
+
|
|
3039
|
+
.vuiGridItem--colStart3 {
|
|
3040
|
+
grid-column-start: 3;
|
|
3041
|
+
}
|
|
3042
|
+
|
|
3043
|
+
.vuiGridItem--colEnd3 {
|
|
3044
|
+
grid-column-end: 3;
|
|
3045
|
+
}
|
|
3046
|
+
|
|
3047
|
+
.vuiGridItem--colStart4 {
|
|
3048
|
+
grid-column-start: 4;
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3051
|
+
.vuiGridItem--colEnd4 {
|
|
3052
|
+
grid-column-end: 4;
|
|
3053
|
+
}
|
|
3054
|
+
|
|
3055
|
+
.vuiGridItem--colStart5 {
|
|
3056
|
+
grid-column-start: 5;
|
|
3057
|
+
}
|
|
3058
|
+
|
|
3059
|
+
.vuiGridItem--colEnd5 {
|
|
3060
|
+
grid-column-end: 5;
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3063
|
+
.vuiGridItem--colStart6 {
|
|
3064
|
+
grid-column-start: 6;
|
|
3065
|
+
}
|
|
3066
|
+
|
|
3067
|
+
.vuiGridItem--colEnd6 {
|
|
3068
|
+
grid-column-end: 6;
|
|
3069
|
+
}
|
|
3070
|
+
|
|
3071
|
+
.vuiGridItem--colStart7 {
|
|
3072
|
+
grid-column-start: 7;
|
|
3073
|
+
}
|
|
3074
|
+
|
|
3075
|
+
.vuiGridItem--colEnd7 {
|
|
3076
|
+
grid-column-end: 7;
|
|
3077
|
+
}
|
|
3078
|
+
|
|
3079
|
+
.vuiGridItem--colStart8 {
|
|
3080
|
+
grid-column-start: 8;
|
|
3081
|
+
}
|
|
3082
|
+
|
|
3083
|
+
.vuiGridItem--colEnd8 {
|
|
3084
|
+
grid-column-end: 8;
|
|
3085
|
+
}
|
|
3086
|
+
|
|
3087
|
+
.vuiGridItem--colStart9 {
|
|
3088
|
+
grid-column-start: 9;
|
|
3089
|
+
}
|
|
3090
|
+
|
|
3091
|
+
.vuiGridItem--colEnd9 {
|
|
3092
|
+
grid-column-end: 9;
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
.vuiGridItem--colStart10 {
|
|
3096
|
+
grid-column-start: 10;
|
|
3097
|
+
}
|
|
3098
|
+
|
|
3099
|
+
.vuiGridItem--colEnd10 {
|
|
3100
|
+
grid-column-end: 10;
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
.vuiGridItem--colStart11 {
|
|
3104
|
+
grid-column-start: 11;
|
|
3105
|
+
}
|
|
3106
|
+
|
|
3107
|
+
.vuiGridItem--colEnd11 {
|
|
3108
|
+
grid-column-end: 11;
|
|
3109
|
+
}
|
|
3110
|
+
|
|
3111
|
+
.vuiGridItem--colStart12 {
|
|
3112
|
+
grid-column-start: 12;
|
|
3113
|
+
}
|
|
3114
|
+
|
|
3115
|
+
.vuiGridItem--colEnd12 {
|
|
3116
|
+
grid-column-end: 12;
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
.vuiGridItem--rowStart1 {
|
|
3120
|
+
grid-row-start: 1;
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
.vuiGridItem--rowEnd1 {
|
|
3124
|
+
grid-row-end: 1;
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3127
|
+
.vuiGridItem--rowStart2 {
|
|
3128
|
+
grid-row-start: 2;
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
.vuiGridItem--rowEnd2 {
|
|
3132
|
+
grid-row-end: 2;
|
|
3133
|
+
}
|
|
3134
|
+
|
|
3135
|
+
.vuiGridItem--rowStart3 {
|
|
3136
|
+
grid-row-start: 3;
|
|
3137
|
+
}
|
|
3138
|
+
|
|
3139
|
+
.vuiGridItem--rowEnd3 {
|
|
3140
|
+
grid-row-end: 3;
|
|
3141
|
+
}
|
|
3142
|
+
|
|
3143
|
+
.vuiGridItem--rowStart4 {
|
|
3144
|
+
grid-row-start: 4;
|
|
3145
|
+
}
|
|
3146
|
+
|
|
3147
|
+
.vuiGridItem--rowEnd4 {
|
|
3148
|
+
grid-row-end: 4;
|
|
3149
|
+
}
|
|
3150
|
+
|
|
3151
|
+
.vuiGridItem--rowStart5 {
|
|
3152
|
+
grid-row-start: 5;
|
|
3153
|
+
}
|
|
3154
|
+
|
|
3155
|
+
.vuiGridItem--rowEnd5 {
|
|
3156
|
+
grid-row-end: 5;
|
|
3157
|
+
}
|
|
3158
|
+
|
|
3159
|
+
.vuiGridItem--rowStart6 {
|
|
3160
|
+
grid-row-start: 6;
|
|
3161
|
+
}
|
|
3162
|
+
|
|
3163
|
+
.vuiGridItem--rowEnd6 {
|
|
3164
|
+
grid-row-end: 6;
|
|
3165
|
+
}
|
|
3166
|
+
|
|
3167
|
+
.vuiGridItem--rowStart7 {
|
|
3168
|
+
grid-row-start: 7;
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
.vuiGridItem--rowEnd7 {
|
|
3172
|
+
grid-row-end: 7;
|
|
3173
|
+
}
|
|
3174
|
+
|
|
3175
|
+
.vuiGridItem--rowStart8 {
|
|
3176
|
+
grid-row-start: 8;
|
|
3177
|
+
}
|
|
3178
|
+
|
|
3179
|
+
.vuiGridItem--rowEnd8 {
|
|
3180
|
+
grid-row-end: 8;
|
|
3181
|
+
}
|
|
3182
|
+
|
|
3183
|
+
.vuiGridItem--rowStart9 {
|
|
3184
|
+
grid-row-start: 9;
|
|
3185
|
+
}
|
|
3186
|
+
|
|
3187
|
+
.vuiGridItem--rowEnd9 {
|
|
3188
|
+
grid-row-end: 9;
|
|
3189
|
+
}
|
|
3190
|
+
|
|
3191
|
+
.vuiGridItem--rowStart10 {
|
|
3192
|
+
grid-row-start: 10;
|
|
3193
|
+
}
|
|
3194
|
+
|
|
3195
|
+
.vuiGridItem--rowEnd10 {
|
|
3196
|
+
grid-row-end: 10;
|
|
3197
|
+
}
|
|
3198
|
+
|
|
3199
|
+
.vuiGridItem--rowStart11 {
|
|
3200
|
+
grid-row-start: 11;
|
|
3201
|
+
}
|
|
3202
|
+
|
|
3203
|
+
.vuiGridItem--rowEnd11 {
|
|
3204
|
+
grid-row-end: 11;
|
|
3205
|
+
}
|
|
3206
|
+
|
|
3207
|
+
.vuiGridItem--rowStart12 {
|
|
3208
|
+
grid-row-start: 12;
|
|
3209
|
+
}
|
|
3210
|
+
|
|
3211
|
+
.vuiGridItem--rowEnd12 {
|
|
3212
|
+
grid-row-end: 12;
|
|
3213
|
+
}
|
|
3214
|
+
|
|
3215
|
+
.vuiGridItem--alignSelfStart {
|
|
3216
|
+
align-self: start;
|
|
3217
|
+
}
|
|
3218
|
+
|
|
3219
|
+
.vuiGridItem--alignSelfEnd {
|
|
3220
|
+
align-self: end;
|
|
3221
|
+
}
|
|
3222
|
+
|
|
3223
|
+
.vuiGridItem--alignSelfCenter {
|
|
3224
|
+
align-self: center;
|
|
3225
|
+
}
|
|
3226
|
+
|
|
3227
|
+
.vuiGridItem--alignSelfStretch {
|
|
3228
|
+
align-self: stretch;
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
.vuiGridItem--alignSelfBaseline {
|
|
3232
|
+
align-self: baseline;
|
|
3233
|
+
}
|
|
3234
|
+
|
|
3235
|
+
.vuiGridItem--justifySelfStart {
|
|
3236
|
+
justify-self: start;
|
|
3237
|
+
}
|
|
3238
|
+
|
|
3239
|
+
.vuiGridItem--justifySelfEnd {
|
|
3240
|
+
justify-self: end;
|
|
3241
|
+
}
|
|
3242
|
+
|
|
3243
|
+
.vuiGridItem--justifySelfCenter {
|
|
3244
|
+
justify-self: center;
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
.vuiGridItem--justifySelfStretch {
|
|
3248
|
+
justify-self: stretch;
|
|
3249
|
+
}
|
|
3250
|
+
|
|
3251
|
+
.vuiGridItem--responsive {
|
|
3252
|
+
grid-column: var(--grid-item-colSpan-sm);
|
|
3253
|
+
}
|
|
3254
|
+
@container (width > 500px) {
|
|
3255
|
+
.vuiGridItem--responsive {
|
|
3256
|
+
grid-column: var(--grid-item-colSpan-md);
|
|
3257
|
+
}
|
|
3258
|
+
}
|
|
3259
|
+
@container (width > 800px) {
|
|
3260
|
+
.vuiGridItem--responsive {
|
|
3261
|
+
grid-column: var(--grid-item-colSpan-lg);
|
|
3262
|
+
}
|
|
3263
|
+
}
|
|
3264
|
+
|
|
2809
3265
|
.vuiHorizontalRule {
|
|
2810
3266
|
border-top: none;
|
|
2811
3267
|
border-left: none;
|
|
@@ -3557,6 +4013,14 @@ h2.react-datepicker__current-month {
|
|
|
3557
4013
|
background-color: transparent;
|
|
3558
4014
|
}
|
|
3559
4015
|
|
|
4016
|
+
.vuiPanel--fullHeight {
|
|
4017
|
+
height: 100%;
|
|
4018
|
+
}
|
|
4019
|
+
|
|
4020
|
+
.vuiPanel--fullWidth {
|
|
4021
|
+
width: 100%;
|
|
4022
|
+
}
|
|
4023
|
+
|
|
3560
4024
|
.vuiPanelIcon {
|
|
3561
4025
|
margin-bottom: 12px;
|
|
3562
4026
|
}
|