@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
  };
@@ -126,6 +126,10 @@ $textRhythm: $sizeM;
126
126
  @include truncateText;
127
127
  }
128
128
 
129
+ .vuiText--preserveWhiteSpace {
130
+ white-space: pre-wrap;
131
+ }
132
+
129
133
  @mixin defineTextStyles($fontSize, $fontWeight) {
130
134
  color: var(--vui-color-text);
131
135
  font-size: $fontSize;
@@ -5780,6 +5780,10 @@ h2.react-datepicker__current-month {
5780
5780
  white-space: nowrap;
5781
5781
  }
5782
5782
 
5783
+ .vuiText--preserveWhiteSpace {
5784
+ white-space: pre-wrap;
5785
+ }
5786
+
5783
5787
  .vuiText--xs {
5784
5788
  color: var(--vui-color-text);
5785
5789
  font-size: 12px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectara/vectara-ui",
3
- "version": "15.5.3",
3
+ "version": "15.6.1",
4
4
  "homepage": "./",
5
5
  "description": "Vectara's design system, codified as a React and Sass component library",
6
6
  "author": "Vectara",