@vectara/vectara-ui 15.5.3 → 15.6.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.
|
@@ -37,5 +37,5 @@ export const VuiNotification = ({ color, message, onDismiss, children, hasCopyBu
|
|
|
37
37
|
icon = null;
|
|
38
38
|
}
|
|
39
39
|
const copyValue = code ? `${message}\n\n${code.content}` : message;
|
|
40
|
-
return (_jsx("div", Object.assign({ className: classes, "data-testid": `notification-${color}` }, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "start", spacing: "s" }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: 1 }, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "start", spacing: "xs" }, { children: [icon, _jsxs("div", { children: [_jsx(VuiText, { children: _jsx(VuiTextColor, Object.assign({ color: color }, { children: message })) }), code && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), _jsx(VuiCode, Object.assign({ language: code.language }, { children: code.content }))] })), hasCopyButton && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), _jsx(VuiCopyButton, { value: copyValue, size: "s", label: "Copy" })] })), children && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), children] })), link && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), _jsx(VuiLink, Object.assign({}, link))] }))] })] })) })), _jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: _jsx(VuiIconButton, { "aria-label": "Dismiss message", size: "xs", color: "neutral", icon: _jsx(VuiIcon, { children: _jsx(BiX, {}) }), onClick: () => onDismiss(), "data-testid": `dismissNotificationButton-${color}` }) }))] })) })));
|
|
40
|
+
return (_jsx("div", Object.assign({ className: classes, "data-testid": `notification-${color}` }, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "start", spacing: "s" }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: 1 }, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "start", spacing: "xs" }, { children: [icon, _jsxs("div", { children: [_jsx(VuiText, Object.assign({ preserveWhiteSpace: true }, { children: _jsx(VuiTextColor, Object.assign({ color: color }, { children: message })) })), code && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), _jsx(VuiCode, Object.assign({ language: code.language }, { children: code.content }))] })), hasCopyButton && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), _jsx(VuiCopyButton, { value: copyValue, size: "s", label: "Copy notification" })] })), children && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), children] })), link && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), _jsx(VuiLink, Object.assign({}, link))] }))] })] })) })), _jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: _jsx(VuiIconButton, { "aria-label": "Dismiss message", size: "xs", color: "neutral", icon: _jsx(VuiIcon, { children: _jsx(BiX, {}) }), onClick: () => onDismiss(), "data-testid": `dismissNotificationButton-${color}` }) }))] })) })));
|
|
41
41
|
};
|
|
@@ -8,6 +8,7 @@ type Props = {
|
|
|
8
8
|
size?: (typeof TEXT_SIZE)[number];
|
|
9
9
|
align?: (typeof TEXT_ALIGN)[number];
|
|
10
10
|
truncate?: boolean;
|
|
11
|
+
preserveWhiteSpace?: boolean;
|
|
11
12
|
};
|
|
12
|
-
export declare const VuiText: ({ children, className, id, truncate, size, align, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const VuiText: ({ children, className, id, truncate, preserveWhiteSpace, size, align, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -13,12 +13,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import classNames from "classnames";
|
|
14
14
|
const TEXT_ALIGN = ["left", "center", "right"];
|
|
15
15
|
export const VuiText = (_a) => {
|
|
16
|
-
var { children, className, id, truncate, size = "s", align } = _a, rest = __rest(_a, ["children", "className", "id", "truncate", "size", "align"]);
|
|
16
|
+
var { children, className, id, truncate, preserveWhiteSpace, size = "s", align } = _a, rest = __rest(_a, ["children", "className", "id", "truncate", "preserveWhiteSpace", "size", "align"]);
|
|
17
17
|
const classes = classNames("vuiText", `vuiText--${size}`, {
|
|
18
18
|
// Don't default to left alignment, so that the component inherits
|
|
19
19
|
// whatever has been defined by an ancestor.
|
|
20
20
|
[`vuiText--${align}`]: align,
|
|
21
|
-
"vuiText--truncate": truncate
|
|
21
|
+
"vuiText--truncate": truncate,
|
|
22
|
+
"vuiText--preserveWhiteSpace": preserveWhiteSpace
|
|
22
23
|
}, className);
|
|
23
24
|
return (_jsx("div", Object.assign({ className: classes, id: id }, rest, { children: children })));
|
|
24
25
|
};
|
package/lib/styles/index.css
CHANGED