@vectara/vectara-ui 9.4.1 → 9.5.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.
|
@@ -63,7 +63,7 @@ import { VuiSpacer } from "./spacer/Spacer";
|
|
|
63
63
|
import { SPACER_SIZE } from "./spacer/types";
|
|
64
64
|
import { VuiSpinner } from "./spinner/Spinner";
|
|
65
65
|
import { SPINNER_COLOR, SPINNER_SIZE } from "./spinner/types";
|
|
66
|
-
import { VuiStatList } from "./statList/StatList";
|
|
66
|
+
import { Stat, VuiStatList } from "./statList/StatList";
|
|
67
67
|
import { VuiStatus } from "./status/Status";
|
|
68
68
|
import { VuiSteps, StepStatus, StepSize, VuiStepProps } from "./steps/Steps";
|
|
69
69
|
import { VuiSummary } from "./summary/Summary";
|
|
@@ -82,5 +82,5 @@ import { VuiToggle } from "./toggle/Toggle";
|
|
|
82
82
|
import { VuiTooltip } from "./tooltip/Tooltip";
|
|
83
83
|
import { VuiTopicButton } from "./topicButton/TopicButton";
|
|
84
84
|
import { copyToClipboard } from "../utils/copyToClipboard";
|
|
85
|
-
export type { AnchorSide, AppContentPadding, ButtonColor, CalloutColor, ChatLanguage, ChatStyle, ChatTurn, CodeLanguage, InfoListType, InfoTableColumnAlign, InfoTableRow, InfoTableRowType, LinkProps, MenuItem, OptionListItem, RadioButtonConfig, SearchResult, Sections, SectionItem, StepStatus, StepSize, TabSize, Tree, TreeItem, VuiStepProps };
|
|
85
|
+
export type { AnchorSide, AppContentPadding, ButtonColor, CalloutColor, ChatLanguage, ChatStyle, ChatTurn, CodeLanguage, InfoListType, InfoTableColumnAlign, InfoTableRow, InfoTableRowType, LinkProps, MenuItem, OptionListItem, RadioButtonConfig, SearchResult, Sections, SectionItem, Stat, StepStatus, StepSize, TabSize, Tree, TreeItem, VuiStepProps };
|
|
86
86
|
export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, ICON_COLOR, ICON_SIZE, ICON_TYPE, PROGRESS_BAR_COLOR, SPACER_SIZE, SPINNER_COLOR, SPINNER_SIZE, TAB_SIZE, TEXT_COLOR, TEXT_SIZE, TITLE_SIZE, addNotification, copyToClipboard, 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, VuiInfoList, VuiInfoMenu, VuiInfoTable, VuiItemsInput, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPanel, VuiPasswordInput, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSpacer, VuiSpinner, VuiStatList, VuiStatus, VuiSteps, VuiSummary, VuiSummaryCitation, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CodeLanguage } from "../code/types";
|
|
1
2
|
export declare const addNotification: (props: Omit<Props, "onDismiss">) => string | number;
|
|
2
3
|
type Props = {
|
|
3
4
|
color: "primary" | "success" | "warning" | "danger";
|
|
@@ -5,6 +6,10 @@ type Props = {
|
|
|
5
6
|
onDismiss: () => void;
|
|
6
7
|
children?: React.ReactNode;
|
|
7
8
|
hasCopyButton?: boolean;
|
|
9
|
+
code?: {
|
|
10
|
+
content: string;
|
|
11
|
+
language?: CodeLanguage;
|
|
12
|
+
};
|
|
8
13
|
};
|
|
9
|
-
export declare const VuiNotification: ({ color, message, onDismiss, children, hasCopyButton }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const VuiNotification: ({ color, message, onDismiss, children, hasCopyButton, code }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
15
|
export {};
|
|
@@ -10,12 +10,13 @@ import { VuiIconButton } from "../button/IconButton";
|
|
|
10
10
|
import { VuiIcon } from "../icon/Icon";
|
|
11
11
|
import { VuiSpacer } from "../spacer/Spacer";
|
|
12
12
|
import { VuiCopyButton } from "../copyButton/CopyButton";
|
|
13
|
+
import { VuiCode } from "../code/Code";
|
|
13
14
|
export const addNotification = (props) => {
|
|
14
15
|
return sonnerToast.custom((id) => (_jsx(VuiNotification, Object.assign({ onDismiss: () => {
|
|
15
16
|
sonnerToast.dismiss(id);
|
|
16
17
|
} }, props))), { duration: 10000 });
|
|
17
18
|
};
|
|
18
|
-
export const VuiNotification = ({ color, message, onDismiss, children, hasCopyButton }) => {
|
|
19
|
+
export const VuiNotification = ({ color, message, onDismiss, children, hasCopyButton, code }) => {
|
|
19
20
|
const classes = classNames("vuiNotification", `vuiNotification--${color}`);
|
|
20
21
|
let icon;
|
|
21
22
|
switch (color) {
|
|
@@ -34,5 +35,5 @@ export const VuiNotification = ({ color, message, onDismiss, children, hasCopyBu
|
|
|
34
35
|
default:
|
|
35
36
|
icon = null;
|
|
36
37
|
}
|
|
37
|
-
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 })) }), hasCopyButton && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), _jsx(VuiCopyButton, { value: message, size: "s", label: "Copy" })] })), children && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), children] }))] })] })) })), _jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsx(VuiIconButton, { "aria-label": "Dismiss message", size: "xs", color: "neutral", icon: _jsx(VuiIcon, { children: _jsx(BiX, {}) }), onClick: () => onDismiss(), "data-testid": `dismissNotificationButton-${color}` }) }))] })) })));
|
|
38
|
+
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 && !code && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), _jsx(VuiCopyButton, { value: message, size: "s", label: "Copy" })] })), children && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), children] }))] })] })) })), _jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsx(VuiIconButton, { "aria-label": "Dismiss message", size: "xs", color: "neutral", icon: _jsx(VuiIcon, { children: _jsx(BiX, {}) }), onClick: () => onDismiss(), "data-testid": `dismissNotificationButton-${color}` }) }))] })) })));
|
|
38
39
|
};
|