@vectara/vectara-ui 18.4.0 → 19.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.
Files changed (35) hide show
  1. package/lib/components/card/SimpleCard.d.ts +1 -1
  2. package/lib/components/card/_index.scss +5 -30
  3. package/lib/components/composer/Composer.d.ts +41 -0
  4. package/lib/components/composer/Composer.js +148 -0
  5. package/lib/components/composer/_index.scss +4 -0
  6. package/lib/components/composer/useComposerHistory.d.ts +34 -0
  7. package/lib/components/composer/useComposerHistory.js +127 -0
  8. package/lib/components/context/Theme.d.ts +24 -0
  9. package/lib/components/context/Theme.js +78 -2
  10. package/lib/components/fileDropTarget/FileDropTarget.d.ts +8 -0
  11. package/lib/components/fileDropTarget/FileDropTarget.js +69 -0
  12. package/lib/components/fileDropTarget/_index.scss +34 -0
  13. package/lib/components/index.d.ts +5 -2
  14. package/lib/components/index.js +4 -1
  15. package/lib/components/patch/VuiPatch.d.ts +10 -0
  16. package/lib/components/patch/VuiPatch.js +32 -0
  17. package/lib/components/patch/_index.scss +30 -0
  18. package/lib/styles/index.css +122 -28
  19. package/package.json +1 -1
  20. package/src/docs/pages/card/SimpleCard.tsx +72 -6
  21. package/src/docs/pages/colorPalette/CategoricalColors.tsx +89 -0
  22. package/src/docs/pages/colorPalette/NeutralColors.tsx +42 -0
  23. package/src/docs/pages/colorPalette/SemanticColors.tsx +64 -0
  24. package/src/docs/pages/colorPalette/Swatch.tsx +59 -0
  25. package/src/docs/pages/colorPalette/TextAndBorderColors.tsx +37 -0
  26. package/src/docs/pages/colorPalette/Usage.tsx +72 -0
  27. package/src/docs/pages/colorPalette/index.tsx +43 -0
  28. package/src/docs/pages/composer/Composer.tsx +130 -0
  29. package/src/docs/pages/composer/index.tsx +11 -0
  30. package/src/docs/pages/fileDropTarget/FileDropTarget.tsx +80 -0
  31. package/src/docs/pages/fileDropTarget/index.tsx +11 -0
  32. package/src/docs/pages/patch/Icons.tsx +16 -0
  33. package/src/docs/pages/patch/Sizes.tsx +20 -0
  34. package/src/docs/pages/patch/index.tsx +22 -0
  35. package/src/docs/pages.tsx +9 -3
@@ -22,6 +22,7 @@ import { VuiChat } from "./chat/Chat";
22
22
  import { VuiChip } from "./chip/Chip";
23
23
  import { VuiCode } from "./code/Code";
24
24
  import { CodeLanguage } from "./code/types";
25
+ import { VuiComposer, ComposerFileError, ComposerShortcutApi, ComposerShortcutHandler, ComposerSubmission } from "./composer/Composer";
25
26
  import { VuiComplexConfigurationButton } from "./complexConfigurationButton/ComplexConfigurationButton";
26
27
  import { VuiContextProvider } from "./context/Context";
27
28
  import { VuiCopyButton } from "./copyButton/CopyButton";
@@ -30,6 +31,7 @@ import { VuiDateRangePicker } from "./datePicker/DateRangePicker";
30
31
  import { VuiDrawer } from "./drawer/Drawer";
31
32
  import { DURATION_BAR_COLOR, VuiDurationBar } from "./durationBar/DurationBar";
32
33
  import { VuiErrorBoundary } from "./errorBoundary/ErrorBoundary";
34
+ import { VuiFileDropTarget } from "./fileDropTarget/FileDropTarget";
33
35
  import { VuiFlexContainer } from "./flex/FlexContainer";
34
36
  import { VuiFlexItem } from "./flex/FlexItem";
35
37
  import { CheckboxConfig, CodeEditorColorConfig, CodeEditorError, RadioButtonConfig, generateTokensProvider, VuiCheckbox, VuiCodeEditor, VuiItemsInput, VuiLabel, VuiNumberInput, VuiRadioButton, VuiSelect, VuiSuperCheckboxGroup, VuiSuperRadioGroup, VuiTextInput, VuiTextArea, VuiPasswordInput } from "./form";
@@ -63,6 +65,7 @@ import { VuiOptionsListItem } from "./optionsList/OptionsListItem";
63
65
  import { OptionListItem } from "./optionsList/types";
64
66
  import { VuiPagination, Pagination } from "./pagination/Pagination";
65
67
  import { VuiPanel } from "./panel/Panel";
68
+ import { PATCH_COLOR, PatchColor, VuiPatch } from "./patch/VuiPatch";
66
69
  import { VuiPopover, AnchorSide } from "./popover/Popover";
67
70
  import { VuiPortal } from "./portal/Portal";
68
71
  import { PROGRESS_BAR_COLOR, VuiProgressBar } from "./progressBar/ProgressBar";
@@ -105,5 +108,5 @@ import { VuiInfoTooltip } from "./tooltip/InfoTooltip";
105
108
  import { VuiTopicButton } from "./topicButton/TopicButton";
106
109
  import { copyToClipboard } from "../utils/copyToClipboard";
107
110
  import { toRgb, toRgba } from "./context/Theme";
108
- export type { AnchorSide, AppContentPadding, ButtonColor, CalloutColor, ChatLanguage, ChatStyle, ChatTurn, CheckboxConfig, CodeEditorColorConfig, CodeEditorError, CodeLanguage, InfoListItemType, InfoListType, InfoTableColumnAlign, InfoTableRow, InfoTableRowType, KvTableAlign, KvTableItem, KvTableItems, KvTablePadding, LinkProps, MenuItem, OptionListItem, Pagination, RadioButtonConfig, SearchResult, SearchSuggestion, Sections, SectionItem, SpansRow, Stat, StepStatus, StepSize, Steps, StepsVertical, StepVerticalStatus, TabNavigatorRoute, TabSize, Tree, TreeItem };
109
- export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, DURATION_BAR_COLOR, 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, generateTokensProvider, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiAppSideNavGroup, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiChip, VuiCode, VuiCodeEditor, VuiComplexConfigurationButton, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiDurationBar, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, VuiInfoTooltip, VuiKvTable, VuiInProgress, VuiItemsInput, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiMenuList, VuiMenuListButton, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPagination, VuiPanel, VuiPasswordInput, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSideList, VuiSideListButton, VuiSimpleCard, VuiSimpleGrid, VuiSpacer, VuiSpans, VuiSpinner, VuiStat, VuiStatList, VuiStatus, VuiSteps, VuiStepsVertical, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperCheckboxGroup, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiTabsNavigator, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
111
+ export type { AnchorSide, AppContentPadding, ButtonColor, CalloutColor, ChatLanguage, ChatStyle, ChatTurn, CheckboxConfig, CodeEditorColorConfig, CodeEditorError, CodeLanguage, ComposerFileError, ComposerShortcutApi, ComposerShortcutHandler, ComposerSubmission, InfoListItemType, InfoListType, InfoTableColumnAlign, InfoTableRow, InfoTableRowType, KvTableAlign, KvTableItem, KvTableItems, KvTablePadding, LinkProps, MenuItem, OptionListItem, Pagination, PatchColor, RadioButtonConfig, SearchResult, SearchSuggestion, Sections, SectionItem, SpansRow, Stat, StepStatus, StepSize, Steps, StepsVertical, StepVerticalStatus, TabNavigatorRoute, TabSize, Tree, TreeItem };
112
+ export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, DURATION_BAR_COLOR, ICON_COLOR, ICON_SIZE, ICON_TYPE, PATCH_COLOR, PROGRESS_BAR_COLOR, SPACER_SIZE, SPINNER_COLOR, SKELETON_COLOR, SPINNER_SIZE, TAB_SIZE, TEXT_COLOR, TEXT_SIZE, TITLE_SIZE, addNotification, copyToClipboard, generateTokensProvider, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiAppSideNavGroup, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiChip, VuiCode, VuiCodeEditor, VuiComposer, VuiComplexConfigurationButton, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiDurationBar, VuiErrorBoundary, VuiFileDropTarget, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, VuiInfoTooltip, VuiKvTable, VuiInProgress, VuiItemsInput, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiMenuList, VuiMenuListButton, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPagination, VuiPanel, VuiPasswordInput, VuiPatch, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSideList, VuiSideListButton, VuiSimpleCard, VuiSimpleGrid, VuiSpacer, VuiSpans, VuiSpinner, VuiStat, VuiStatList, VuiStatus, VuiSteps, VuiStepsVertical, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperCheckboxGroup, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiTabsNavigator, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
@@ -18,6 +18,7 @@ import { CALLOUT_COLOR, CALLOUT_SIZE } from "./callout/types";
18
18
  import { VuiChat } from "./chat/Chat";
19
19
  import { VuiChip } from "./chip/Chip";
20
20
  import { VuiCode } from "./code/Code";
21
+ import { VuiComposer } from "./composer/Composer";
21
22
  import { VuiComplexConfigurationButton } from "./complexConfigurationButton/ComplexConfigurationButton";
22
23
  import { VuiContextProvider } from "./context/Context";
23
24
  import { VuiCopyButton } from "./copyButton/CopyButton";
@@ -26,6 +27,7 @@ import { VuiDateRangePicker } from "./datePicker/DateRangePicker";
26
27
  import { VuiDrawer } from "./drawer/Drawer";
27
28
  import { DURATION_BAR_COLOR, VuiDurationBar } from "./durationBar/DurationBar";
28
29
  import { VuiErrorBoundary } from "./errorBoundary/ErrorBoundary";
30
+ import { VuiFileDropTarget } from "./fileDropTarget/FileDropTarget";
29
31
  import { VuiFlexContainer } from "./flex/FlexContainer";
30
32
  import { VuiFlexItem } from "./flex/FlexItem";
31
33
  import { generateTokensProvider, VuiCheckbox, VuiCodeEditor, VuiItemsInput, VuiLabel, VuiNumberInput, VuiRadioButton, VuiSelect, VuiSuperCheckboxGroup, VuiSuperRadioGroup, VuiTextInput, VuiTextArea, VuiPasswordInput } from "./form";
@@ -56,6 +58,7 @@ import { VuiOptionsList } from "./optionsList/OptionsList";
56
58
  import { VuiOptionsListItem } from "./optionsList/OptionsListItem";
57
59
  import { VuiPagination } from "./pagination/Pagination";
58
60
  import { VuiPanel } from "./panel/Panel";
61
+ import { PATCH_COLOR, VuiPatch } from "./patch/VuiPatch";
59
62
  import { VuiPopover } from "./popover/Popover";
60
63
  import { VuiPortal } from "./portal/Portal";
61
64
  import { PROGRESS_BAR_COLOR, VuiProgressBar } from "./progressBar/ProgressBar";
@@ -96,4 +99,4 @@ import { VuiInfoTooltip } from "./tooltip/InfoTooltip";
96
99
  import { VuiTopicButton } from "./topicButton/TopicButton";
97
100
  import { copyToClipboard } from "../utils/copyToClipboard";
98
101
  import { toRgb, toRgba } from "./context/Theme";
99
- export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, DURATION_BAR_COLOR, 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, generateTokensProvider, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiAppSideNavGroup, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiChip, VuiCode, VuiCodeEditor, VuiComplexConfigurationButton, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiDurationBar, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, VuiInfoTooltip, VuiKvTable, VuiInProgress, VuiItemsInput, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiMenuList, VuiMenuListButton, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPagination, VuiPanel, VuiPasswordInput, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSideList, VuiSideListButton, VuiSimpleCard, VuiSimpleGrid, VuiSpacer, VuiSpans, VuiSpinner, VuiStat, VuiStatList, VuiStatus, VuiSteps, VuiStepsVertical, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperCheckboxGroup, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiTabsNavigator, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
102
+ export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, DURATION_BAR_COLOR, ICON_COLOR, ICON_SIZE, ICON_TYPE, PATCH_COLOR, PROGRESS_BAR_COLOR, SPACER_SIZE, SPINNER_COLOR, SKELETON_COLOR, SPINNER_SIZE, TAB_SIZE, TEXT_COLOR, TEXT_SIZE, TITLE_SIZE, addNotification, copyToClipboard, generateTokensProvider, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiAppSideNavGroup, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiChip, VuiCode, VuiCodeEditor, VuiComposer, VuiComplexConfigurationButton, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiDurationBar, VuiErrorBoundary, VuiFileDropTarget, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, VuiInfoTooltip, VuiKvTable, VuiInProgress, VuiItemsInput, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiMenuList, VuiMenuListButton, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPagination, VuiPanel, VuiPasswordInput, VuiPatch, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSideList, VuiSideListButton, VuiSimpleCard, VuiSimpleGrid, VuiSpacer, VuiSpans, VuiSpinner, VuiStat, VuiStatList, VuiStatus, VuiSteps, VuiStepsVertical, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperCheckboxGroup, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiTabsNavigator, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
@@ -0,0 +1,10 @@
1
+ export declare const PATCH_COLOR: readonly ["red", "orange", "amber", "lime", "emerald", "teal", "sky", "indigo", "purple", "fuchsia", "pink", "slate"];
2
+ export type PatchColor = (typeof PATCH_COLOR)[number];
3
+ type Props = {
4
+ color: PatchColor;
5
+ size?: "xs" | "s" | "m";
6
+ children?: React.ReactNode;
7
+ "data-testid"?: string;
8
+ };
9
+ export declare const VuiPatch: ({ color, size, children, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,32 @@
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
+ export const PATCH_COLOR = [
15
+ "red",
16
+ "orange",
17
+ "amber",
18
+ "lime",
19
+ "emerald",
20
+ "teal",
21
+ "sky",
22
+ "indigo",
23
+ "purple",
24
+ "fuchsia",
25
+ "pink",
26
+ "slate"
27
+ ];
28
+ export const VuiPatch = (_a) => {
29
+ var { color, size = "xs", children } = _a, rest = __rest(_a, ["color", "size", "children"]);
30
+ const classes = classNames("vuiPatch", `vuiPatch--${color}`, `vuiPatch--${size}`);
31
+ return (_jsx("div", Object.assign({ className: classes }, rest, { children: children })));
32
+ };
@@ -0,0 +1,30 @@
1
+ .vuiPatch {
2
+ flex: 0 0 auto;
3
+ border-radius: $sizeXs;
4
+ display: inline-flex;
5
+ align-items: center;
6
+ justify-content: center;
7
+ }
8
+
9
+ $colors: "indigo", "emerald", "amber", "pink", "sky", "orange", "slate", "teal", "lime", "purple", "fuchsia", "red";
10
+
11
+ @each $color in $colors {
12
+ .vuiPatch--#{$color} {
13
+ background-color: var(--vui-color-#{$color}-background);
14
+ color: var(--vui-color-#{$color}-text);
15
+ }
16
+ }
17
+
18
+ $size: (
19
+ xs: $sizeXs,
20
+ s: $sizeS,
21
+ m: $sizeM
22
+ );
23
+
24
+ $sizes: "xs", "s", "m";
25
+
26
+ @each $sizeName, $sizeValue in $size {
27
+ .vuiPatch--#{$sizeName} {
28
+ padding: $sizeValue;
29
+ }
30
+ }
@@ -1310,50 +1310,27 @@ fieldset {
1310
1310
  }
1311
1311
 
1312
1312
  .vuiSimpleCard--interactive {
1313
- border: 1px solid var(--vui-color-primary-highlight-shade);
1314
1313
  transition: box-shadow 0.2s, border-color 0.2s;
1315
1314
  }
1316
1315
  .vuiSimpleCard--interactive:hover {
1317
- border-color: var(--vui-color-primary-shade);
1318
- box-shadow: rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;
1319
- }
1320
-
1321
- .vuiSimpleCard--danger {
1322
- border-color: var(--vui-color-danger-shade);
1323
- }
1324
- .vuiSimpleCard--danger.vuiSimpleCard--interactive:hover {
1325
- border-color: var(--vui-color-danger-shade);
1326
- }
1327
-
1328
- .vuiSimpleCard--warning {
1329
- border-color: var(--vui-color-warning-shade);
1330
- }
1331
- .vuiSimpleCard--warning.vuiSimpleCard--interactive:hover {
1332
- border-color: var(--vui-color-warning-shade);
1316
+ border-color: var(--vui-color-primary-highlight-shade);
1317
+ box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
1333
1318
  }
1334
1319
 
1335
1320
  .vuiSimpleCard--fullHeight {
1336
1321
  height: 100%;
1337
1322
  }
1338
1323
 
1339
- .vuiSimpleCard--xxs {
1340
- padding: 8px 12px;
1341
- }
1342
-
1343
- .vuiSimpleCard--xs {
1344
- padding: 12px 16px;
1345
- }
1346
-
1347
1324
  .vuiSimpleCard--s {
1348
- padding: 16px 24px;
1325
+ padding: 12px;
1349
1326
  }
1350
1327
 
1351
1328
  .vuiSimpleCard--m {
1352
- padding: 24px 32px;
1329
+ padding: 16px;
1353
1330
  }
1354
1331
 
1355
1332
  .vuiSimpleCard--l {
1356
- padding: 32px 40px;
1333
+ padding: 24px;
1357
1334
  }
1358
1335
 
1359
1336
  .vuiChatTurn {
@@ -1639,6 +1616,11 @@ fieldset {
1639
1616
  padding: 8px 4px 0 24px;
1640
1617
  }
1641
1618
 
1619
+ .vuiComposer {
1620
+ position: relative;
1621
+ width: 100%;
1622
+ }
1623
+
1642
1624
  .vuiComplexConfigurationButton {
1643
1625
  width: 100%;
1644
1626
  border: 1px solid var(--vui-color-primary-highlight-shade);
@@ -2610,6 +2592,38 @@ h2.react-datepicker__current-month {
2610
2592
  background-color: var(--vui-color-medium-shade);
2611
2593
  }
2612
2594
 
2595
+ .vuiFileDropTarget__messageContainer {
2596
+ position: fixed;
2597
+ left: 0;
2598
+ top: 0;
2599
+ width: 100%;
2600
+ height: 100%;
2601
+ display: flex;
2602
+ justify-content: center;
2603
+ align-items: center;
2604
+ }
2605
+
2606
+ .vuiFileDropTarget__message {
2607
+ padding: 24px;
2608
+ max-width: 400px;
2609
+ width: 100%;
2610
+ pointer-events: none;
2611
+ }
2612
+ .vuiFileDropTarget__message p,
2613
+ .vuiFileDropTarget__message span {
2614
+ color: var(--vui-color-empty-shade) !important;
2615
+ }
2616
+
2617
+ .vuiFileDropTarget__scopedOverlay {
2618
+ position: absolute;
2619
+ inset: 0;
2620
+ display: flex;
2621
+ align-items: center;
2622
+ justify-content: center;
2623
+ background-color: rgba(var(--vui-color-primary-shade-rgb), 0.6);
2624
+ z-index: 10;
2625
+ }
2626
+
2613
2627
  .vuiFlexContainer {
2614
2628
  display: flex;
2615
2629
  align-items: stretch;
@@ -4600,6 +4614,86 @@ h2.react-datepicker__current-month {
4600
4614
  height: auto;
4601
4615
  }
4602
4616
 
4617
+ .vuiPatch {
4618
+ flex: 0 0 auto;
4619
+ border-radius: 8px;
4620
+ display: inline-flex;
4621
+ align-items: center;
4622
+ justify-content: center;
4623
+ }
4624
+
4625
+ .vuiPatch--indigo {
4626
+ background-color: var(--vui-color-indigo-background);
4627
+ color: var(--vui-color-indigo-text);
4628
+ }
4629
+
4630
+ .vuiPatch--emerald {
4631
+ background-color: var(--vui-color-emerald-background);
4632
+ color: var(--vui-color-emerald-text);
4633
+ }
4634
+
4635
+ .vuiPatch--amber {
4636
+ background-color: var(--vui-color-amber-background);
4637
+ color: var(--vui-color-amber-text);
4638
+ }
4639
+
4640
+ .vuiPatch--pink {
4641
+ background-color: var(--vui-color-pink-background);
4642
+ color: var(--vui-color-pink-text);
4643
+ }
4644
+
4645
+ .vuiPatch--sky {
4646
+ background-color: var(--vui-color-sky-background);
4647
+ color: var(--vui-color-sky-text);
4648
+ }
4649
+
4650
+ .vuiPatch--orange {
4651
+ background-color: var(--vui-color-orange-background);
4652
+ color: var(--vui-color-orange-text);
4653
+ }
4654
+
4655
+ .vuiPatch--slate {
4656
+ background-color: var(--vui-color-slate-background);
4657
+ color: var(--vui-color-slate-text);
4658
+ }
4659
+
4660
+ .vuiPatch--teal {
4661
+ background-color: var(--vui-color-teal-background);
4662
+ color: var(--vui-color-teal-text);
4663
+ }
4664
+
4665
+ .vuiPatch--lime {
4666
+ background-color: var(--vui-color-lime-background);
4667
+ color: var(--vui-color-lime-text);
4668
+ }
4669
+
4670
+ .vuiPatch--purple {
4671
+ background-color: var(--vui-color-purple-background);
4672
+ color: var(--vui-color-purple-text);
4673
+ }
4674
+
4675
+ .vuiPatch--fuchsia {
4676
+ background-color: var(--vui-color-fuchsia-background);
4677
+ color: var(--vui-color-fuchsia-text);
4678
+ }
4679
+
4680
+ .vuiPatch--red {
4681
+ background-color: var(--vui-color-red-background);
4682
+ color: var(--vui-color-red-text);
4683
+ }
4684
+
4685
+ .vuiPatch--xs {
4686
+ padding: 8px;
4687
+ }
4688
+
4689
+ .vuiPatch--s {
4690
+ padding: 12px;
4691
+ }
4692
+
4693
+ .vuiPatch--m {
4694
+ padding: 16px;
4695
+ }
4696
+
4603
4697
  .vuiPopover {
4604
4698
  position: absolute;
4605
4699
  background-color: var(--vui-color-empty-shade);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectara/vectara-ui",
3
- "version": "18.4.0",
3
+ "version": "19.0.0",
4
4
  "homepage": "./",
5
5
  "description": "Vectara's design system, codified as a React and Sass component library",
6
6
  "author": "Vectara",
@@ -1,8 +1,11 @@
1
1
  import { useState } from "react";
2
2
  import {
3
+ VuiBadge,
3
4
  VuiFlexContainer,
4
5
  VuiGrid,
6
+ VuiHorizontalRule,
5
7
  VuiIcon,
8
+ VuiPatch,
6
9
  VuiSelect,
7
10
  VuiSimpleCard,
8
11
  VuiSpacer,
@@ -10,18 +13,16 @@ import {
10
13
  VuiTextColor,
11
14
  VuiTitle
12
15
  } from "../../../lib";
13
- import { BiPencil } from "react-icons/bi";
16
+ import { BiData, BiPencil, BiRightArrowAlt } from "react-icons/bi";
14
17
 
15
18
  const paddingOptions = [
16
- { text: "Extra extra small", value: "xxs" },
17
- { text: "Extra small", value: "xs" },
18
19
  { text: "Small", value: "s" },
19
20
  { text: "Medium", value: "m" },
20
21
  { text: "Large", value: "l" }
21
22
  ];
22
23
 
23
24
  export const SimpleCard = () => {
24
- const [padding, setPadding] = useState<"xxs" | "xs" | "s" | "m" | "l">("xs");
25
+ const [padding, setPadding] = useState<"s" | "m" | "l">("l");
25
26
 
26
27
  return (
27
28
  <>
@@ -29,7 +30,7 @@ export const SimpleCard = () => {
29
30
  id="paddingOptions"
30
31
  options={paddingOptions}
31
32
  value={padding}
32
- onChange={(event) => setPadding(event.target.value as "xxs" | "xs" | "s" | "m" | "l")}
33
+ onChange={(event) => setPadding(event.target.value as "s" | "m" | "l")}
33
34
  />
34
35
 
35
36
  <VuiSpacer size="m" />
@@ -130,7 +131,11 @@ export const SimpleCard = () => {
130
131
  </VuiText>
131
132
  </VuiSimpleCard>
132
133
 
133
- <VuiSimpleCard padding={padding} warning="Missing configuration" onClick={() => console.log("Raccoon says hi!")}>
134
+ <VuiSimpleCard
135
+ padding={padding}
136
+ warning="Missing configuration"
137
+ onClick={() => console.log("Raccoon says hi!")}
138
+ >
134
139
  <VuiTitle size="xs">
135
140
  <h3>Raccoon</h3>
136
141
  </VuiTitle>
@@ -144,6 +149,67 @@ export const SimpleCard = () => {
144
149
  </VuiText>
145
150
  </VuiSimpleCard>
146
151
  </VuiGrid>
152
+
153
+ <VuiSpacer size="m" />
154
+
155
+ <div style={{ maxWidth: "400px" }}>
156
+ <VuiSimpleCard padding={padding} onClick={() => console.log("Selected")}>
157
+ <VuiFlexContainer alignItems="start" justifyContent="spaceBetween">
158
+ <VuiPatch color="emerald" size="s">
159
+ <VuiIcon>
160
+ <BiData />
161
+ </VuiIcon>
162
+ </VuiPatch>
163
+
164
+ <VuiBadge color="primary">Sources</VuiBadge>
165
+ </VuiFlexContainer>
166
+
167
+ <VuiSpacer size="m" />
168
+
169
+ <VuiTitle size="s">
170
+ <h3>
171
+ <strong>Tyrannodata</strong>
172
+ </h3>
173
+ </VuiTitle>
174
+
175
+ <VuiSpacer size="xxs" />
176
+
177
+ <VuiText size="xs">
178
+ <p>
179
+ <VuiTextColor color="subdued">Terrible, horrible, no-good data</VuiTextColor>
180
+ </p>
181
+ </VuiText>
182
+
183
+ <VuiSpacer size="s" />
184
+
185
+ <VuiText size="s">
186
+ <p>
187
+ <VuiTextColor color="subdued">
188
+ This data has seen better days. Where once it soared, mighty and free, above the lesser data, these days
189
+ it spends its time scavenging for bytes.
190
+ </VuiTextColor>
191
+ </p>
192
+ </VuiText>
193
+
194
+ <VuiSpacer size="l" />
195
+
196
+ <VuiHorizontalRule color="subdued" />
197
+
198
+ <VuiSpacer size="l" />
199
+
200
+ <VuiFlexContainer alignItems="center" justifyContent="spaceBetween">
201
+ <VuiText size="s">
202
+ <p>
203
+ <VuiTextColor color="primary">Select</VuiTextColor>
204
+ </p>
205
+ </VuiText>
206
+
207
+ <VuiIcon color="primary" size="s">
208
+ <BiRightArrowAlt />
209
+ </VuiIcon>
210
+ </VuiFlexContainer>
211
+ </VuiSimpleCard>
212
+ </div>
147
213
  </>
148
214
  );
149
215
  };
@@ -0,0 +1,89 @@
1
+ import { BiSolidBookmark } from "react-icons/bi";
2
+ import { VuiCopyButton, VuiFlexContainer, VuiFlexItem, VuiSpacer, VuiText, VuiTextColor } from "../../../lib";
3
+
4
+ // Categorical colors carry no fixed meaning — the hue just distinguishes one category from another.
5
+ // Each is a pair: a tinted background and a saturated foreground for text and icons.
6
+ const categoricalColors = [
7
+ // Warm
8
+ { name: "Red", background: "--vui-color-red-background", text: "--vui-color-red-text" },
9
+ { name: "Orange", background: "--vui-color-orange-background", text: "--vui-color-orange-text" },
10
+ { name: "Amber", background: "--vui-color-amber-background", text: "--vui-color-amber-text" },
11
+ // Greens
12
+ { name: "Lime", background: "--vui-color-lime-background", text: "--vui-color-lime-text" },
13
+ { name: "Emerald", background: "--vui-color-emerald-background", text: "--vui-color-emerald-text" },
14
+ { name: "Teal", background: "--vui-color-teal-background", text: "--vui-color-teal-text" },
15
+ // Blues
16
+ { name: "Sky", background: "--vui-color-sky-background", text: "--vui-color-sky-text" },
17
+ { name: "Indigo", background: "--vui-color-indigo-background", text: "--vui-color-indigo-text" },
18
+ // Purples and pinks
19
+ { name: "Purple", background: "--vui-color-purple-background", text: "--vui-color-purple-text" },
20
+ { name: "Fuchsia", background: "--vui-color-fuchsia-background", text: "--vui-color-fuchsia-text" },
21
+ { name: "Pink", background: "--vui-color-pink-background", text: "--vui-color-pink-text" },
22
+ // Neutral
23
+ { name: "Slate", background: "--vui-color-slate-background", text: "--vui-color-slate-text" }
24
+ ];
25
+
26
+ // A single CSS variable row: the variable name plus a button to copy its var() reference.
27
+ const VariableRow = ({ cssVariable }: { cssVariable: string }) => (
28
+ <VuiFlexContainer alignItems="center" spacing="xs" justifyContent="spaceBetween">
29
+ <VuiFlexItem grow={false}>
30
+ <VuiText size="xs">
31
+ <p>
32
+ <code>{cssVariable}</code>
33
+ </p>
34
+ </VuiText>
35
+ </VuiFlexItem>
36
+
37
+ <VuiFlexItem grow={false}>
38
+ <VuiCopyButton size="xs" value={`var(${cssVariable})`} title={`Copy var(${cssVariable})`} />
39
+ </VuiFlexItem>
40
+ </VuiFlexContainer>
41
+ );
42
+
43
+ export const CategoricalColors = () => {
44
+ return (
45
+ <>
46
+ <VuiText>
47
+ <p>
48
+ <VuiTextColor color="subdued">
49
+ Interchangeable hue pairs for color-coding categories. The icon inherits the foreground color via{" "}
50
+ <code>currentColor</code>, so a patch only needs the background and text variables.
51
+ </VuiTextColor>
52
+ </p>
53
+ </VuiText>
54
+
55
+ <VuiSpacer size="l" />
56
+
57
+ <VuiFlexContainer spacing="l" wrap>
58
+ {categoricalColors.map(({ name, background, text }) => (
59
+ <VuiFlexItem grow={false} key={name}>
60
+ <div style={{ width: 220 }}>
61
+ {/* A representative patch built from the pair. */}
62
+ <div
63
+ style={{
64
+ display: "inline-flex",
65
+ alignItems: "center",
66
+ gap: 6,
67
+ padding: "4px 10px",
68
+ borderRadius: 6,
69
+ fontSize: 13,
70
+ fontWeight: 600,
71
+ backgroundColor: `var(${background})`,
72
+ color: `var(${text})`
73
+ }}
74
+ >
75
+ <BiSolidBookmark />
76
+ {name}
77
+ </div>
78
+
79
+ <VuiSpacer size="s" />
80
+
81
+ <VariableRow cssVariable={background} />
82
+ <VariableRow cssVariable={text} />
83
+ </div>
84
+ </VuiFlexItem>
85
+ ))}
86
+ </VuiFlexContainer>
87
+ </>
88
+ );
89
+ };
@@ -0,0 +1,42 @@
1
+ import { VuiFlexContainer } from "../../../lib";
2
+ import { Subsection } from "../../components/Subsection";
3
+ import { Swatch } from "./Swatch";
4
+
5
+ // Neutral shades run from the empty shade (the app background) to the full shade.
6
+ // In the dark theme these invert, so reach for the semantic name rather than the literal lightness.
7
+ const neutralSwatches = [
8
+ { name: "Empty shade", cssVariable: "--vui-color-empty-shade", value: "#ffffff" },
9
+ { name: "Light shade", cssVariable: "--vui-color-light-shade", value: "#f1f4f6" },
10
+ { name: "Medium shade", cssVariable: "--vui-color-medium-shade", value: "#cbd1de" },
11
+ { name: "Dark shade", cssVariable: "--vui-color-dark-shade", value: "#3f4551" },
12
+ { name: "Darker shade", cssVariable: "--vui-color-darker-shade", value: "#1c1d22" },
13
+ { name: "Full shade", cssVariable: "--vui-color-full-shade", value: "#0b0c0e" }
14
+ ];
15
+
16
+ // Special-purpose accents that sit outside the semantic families.
17
+ const specialSwatches = [
18
+ { name: "Primary highlight", cssVariable: "--vui-color-primary-highlight-shade", value: "#d9e2ff" },
19
+ { name: "Subdued", cssVariable: "--vui-color-subdued-shade", value: "#6d7686" }
20
+ ];
21
+
22
+ export const NeutralColors = () => {
23
+ return (
24
+ <>
25
+ <Subsection title="Neutrals">
26
+ <VuiFlexContainer spacing="l" wrap>
27
+ {neutralSwatches.map((swatch) => (
28
+ <Swatch key={swatch.cssVariable} {...swatch} />
29
+ ))}
30
+ </VuiFlexContainer>
31
+ </Subsection>
32
+
33
+ <Subsection title="Special">
34
+ <VuiFlexContainer spacing="l" wrap>
35
+ {specialSwatches.map((swatch) => (
36
+ <Swatch key={swatch.cssVariable} {...swatch} />
37
+ ))}
38
+ </VuiFlexContainer>
39
+ </Subsection>
40
+ </>
41
+ );
42
+ };
@@ -0,0 +1,64 @@
1
+ import { VuiFlexContainer } from "../../../lib";
2
+ import { Subsection } from "../../components/Subsection";
3
+ import { Swatch } from "./Swatch";
4
+
5
+ // Each semantic family has three shades: a base "shade", a 50%-opacity "light shade",
6
+ // and a tinted "lighter shade" suitable for backgrounds.
7
+ const families = [
8
+ {
9
+ name: "Accent",
10
+ swatches: [
11
+ { name: "Shade", cssVariable: "--vui-color-accent-shade", value: "#5f30c3" },
12
+ { name: "Light shade", cssVariable: "--vui-color-accent-light-shade", value: "50% opacity" },
13
+ { name: "Lighter shade", cssVariable: "--vui-color-accent-lighter-shade", value: "#eee7ff" }
14
+ ]
15
+ },
16
+ {
17
+ name: "Primary",
18
+ swatches: [
19
+ { name: "Shade", cssVariable: "--vui-color-primary-shade", value: "#045dda" },
20
+ { name: "Light shade", cssVariable: "--vui-color-primary-light-shade", value: "50% opacity" },
21
+ { name: "Lighter shade", cssVariable: "--vui-color-primary-lighter-shade", value: "#f1f7ff" }
22
+ ]
23
+ },
24
+ {
25
+ name: "Success",
26
+ swatches: [
27
+ { name: "Shade", cssVariable: "--vui-color-success-shade", value: "#249719" },
28
+ { name: "Light shade", cssVariable: "--vui-color-success-light-shade", value: "50% opacity" },
29
+ { name: "Lighter shade", cssVariable: "--vui-color-success-lighter-shade", value: "#e2f2e0" }
30
+ ]
31
+ },
32
+ {
33
+ name: "Warning",
34
+ swatches: [
35
+ { name: "Shade", cssVariable: "--vui-color-warning-shade", value: "#a86f1b" },
36
+ { name: "Light shade", cssVariable: "--vui-color-warning-light-shade", value: "50% opacity" },
37
+ { name: "Lighter shade", cssVariable: "--vui-color-warning-lighter-shade", value: "#ffeed4" }
38
+ ]
39
+ },
40
+ {
41
+ name: "Danger",
42
+ swatches: [
43
+ { name: "Shade", cssVariable: "--vui-color-danger-shade", value: "#d22d2d" },
44
+ { name: "Light shade", cssVariable: "--vui-color-danger-light-shade", value: "50% opacity" },
45
+ { name: "Lighter shade", cssVariable: "--vui-color-danger-lighter-shade", value: "#fff1f1" }
46
+ ]
47
+ }
48
+ ];
49
+
50
+ export const SemanticColors = () => {
51
+ return (
52
+ <>
53
+ {families.map((family) => (
54
+ <Subsection key={family.name} title={family.name}>
55
+ <VuiFlexContainer spacing="l" wrap>
56
+ {family.swatches.map((swatch) => (
57
+ <Swatch key={swatch.cssVariable} {...swatch} />
58
+ ))}
59
+ </VuiFlexContainer>
60
+ </Subsection>
61
+ ))}
62
+ </>
63
+ );
64
+ };