@vectara/vectara-ui 16.4.0 → 16.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.
@@ -43,6 +43,8 @@ import { InfoListItemType, VuiInfoListItem } from "./infoList/InfoListItem";
43
43
  import { VuiInfoMenu } from "./infoMenu/InfoMenu";
44
44
  import { VuiInfoTable, InfoTableColumnAlign, InfoTableRow, InfoTableRowType } from "./infoTable/InfoTable";
45
45
  import { VuiInProgress } from "./inProgress/InProgress";
46
+ import { VuiKvTable } from "./kvTable/KvTable";
47
+ import { KvTableItem, KvTableItems, KvTablePadding, KvTableAlign } from "./kvTable/types";
46
48
  import { VuiLink, VuiLinkInternal } from "./link/Link";
47
49
  import { LinkProps } from "./link/types";
48
50
  import { VuiList } from "./list/List";
@@ -97,5 +99,5 @@ import { VuiInfoTooltip } from "./tooltip/InfoTooltip";
97
99
  import { VuiTopicButton } from "./topicButton/TopicButton";
98
100
  import { copyToClipboard } from "../utils/copyToClipboard";
99
101
  import { toRgb, toRgba } from "./context/Theme";
100
- export type { AnchorSide, AppContentPadding, ButtonColor, CalloutColor, ChatLanguage, ChatStyle, ChatTurn, CheckboxConfig, CodeEditorColorConfig, CodeEditorError, CodeLanguage, InfoListItemType, InfoListType, InfoTableColumnAlign, InfoTableRow, InfoTableRowType, LinkProps, MenuItem, OptionListItem, Pagination, RadioButtonConfig, SearchResult, SearchSuggestion, Sections, SectionItem, SpansRow, Stat, StepStatus, StepSize, Steps, StepsVertical, StepVerticalStatus, TabSize, Tree, TreeItem };
101
- 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, generateTokensProvider, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiAppSideNavGroup, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiCode, VuiCodeEditor, VuiComplexConfigurationButton, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, VuiInfoTooltip, 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, 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 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, TabSize, Tree, TreeItem };
103
+ 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, generateTokensProvider, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiAppSideNavGroup, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiCode, VuiCodeEditor, VuiComplexConfigurationButton, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, VuiInfoTooltip, VuiKvTable, 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, 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 };
@@ -39,6 +39,7 @@ import { VuiInfoListItem } from "./infoList/InfoListItem";
39
39
  import { VuiInfoMenu } from "./infoMenu/InfoMenu";
40
40
  import { VuiInfoTable } from "./infoTable/InfoTable";
41
41
  import { VuiInProgress } from "./inProgress/InProgress";
42
+ import { VuiKvTable } from "./kvTable/KvTable";
42
43
  import { VuiLink, VuiLinkInternal } from "./link/Link";
43
44
  import { VuiList } from "./list/List";
44
45
  import { VuiMenu } from "./menu/Menu";
@@ -89,4 +90,4 @@ import { VuiInfoTooltip } from "./tooltip/InfoTooltip";
89
90
  import { VuiTopicButton } from "./topicButton/TopicButton";
90
91
  import { copyToClipboard } from "../utils/copyToClipboard";
91
92
  import { toRgb, toRgba } from "./context/Theme";
92
- 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, generateTokensProvider, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiAppSideNavGroup, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiCode, VuiCodeEditor, VuiComplexConfigurationButton, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, VuiInfoTooltip, 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, 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 };
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, generateTokensProvider, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiAppSideNavGroup, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiCode, VuiCodeEditor, VuiComplexConfigurationButton, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, VuiInfoTooltip, VuiKvTable, 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, 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,11 @@
1
+ import { KvTableAlign, KvTableItems, KvTablePadding } from "./types";
2
+ type Props = {
3
+ items: KvTableItems;
4
+ keyHeader?: React.ReactNode;
5
+ valueHeader?: React.ReactNode;
6
+ label?: string;
7
+ padding?: KvTablePadding;
8
+ align?: KvTableAlign;
9
+ };
10
+ export declare const VuiKvTable: ({ items, keyHeader, valueHeader, label, padding, align }: Props) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import classNames from "classnames";
3
+ function normalizeItems(items) {
4
+ if (Array.isArray(items))
5
+ return items;
6
+ return Object.entries(items).map(([key, value]) => ({
7
+ key,
8
+ value: value == null ? "" : String(value)
9
+ }));
10
+ }
11
+ const paddingToClassMap = {
12
+ xxs: "vuiKvTable--paddingXxs",
13
+ xs: "vuiKvTable--paddingXs",
14
+ s: "vuiKvTable--paddingS"
15
+ };
16
+ const alignToClassMap = {
17
+ top: "vuiKvTable--alignTop",
18
+ middle: "vuiKvTable--alignMiddle",
19
+ bottom: "vuiKvTable--alignBottom"
20
+ };
21
+ export const VuiKvTable = ({ items, keyHeader, valueHeader, label, padding = "xs", align = "middle" }) => {
22
+ const hasHeader = keyHeader !== undefined || valueHeader !== undefined;
23
+ const classes = classNames("vuiKvTable", paddingToClassMap[padding], alignToClassMap[align]);
24
+ const normalizedItems = normalizeItems(items);
25
+ return (_jsxs("table", Object.assign({ className: classes, "aria-label": label }, { children: [hasHeader && (_jsx("thead", { children: _jsxs("tr", { children: [keyHeader !== undefined && _jsx("th", { children: keyHeader }), valueHeader !== undefined && _jsx("th", { children: valueHeader })] }) })), _jsx("tbody", { children: normalizedItems.map((item, i) => (_jsxs("tr", { children: [_jsx("th", Object.assign({ scope: "row", className: "vuiKvTableCell--key" }, { children: item.key })), _jsx("td", Object.assign({ className: "vuiKvTableCell--value" }, { children: item.value }))] }, i))) })] })));
26
+ };
@@ -0,0 +1,85 @@
1
+ .vuiKvTable {
2
+ width: 100%;
3
+ table-layout: auto;
4
+ border: 1px solid var(--vui-color-border-light);
5
+
6
+ thead {
7
+ background-color: var(--vui-color-light-shade);
8
+ border-bottom: 1px solid var(--vui-color-border-light);
9
+ }
10
+
11
+ thead th {
12
+ font-size: $fontSizeSmall;
13
+ font-weight: $fontWeightBold;
14
+ padding: $sizeXs $sizeS;
15
+ text-align: left;
16
+ }
17
+
18
+ tbody tr {
19
+ border-bottom: 1px solid var(--vui-color-border-light);
20
+
21
+ &:last-child {
22
+ border-bottom: none;
23
+ }
24
+ }
25
+
26
+ td {
27
+ font-size: $fontSizeStandard;
28
+ }
29
+ }
30
+
31
+ // Key cell: row header, subdued color, natural (non-wrapping) width.
32
+ .vuiKvTableCell--key {
33
+ color: var(--vui-color-subdued-shade);
34
+ white-space: nowrap;
35
+ font-weight: $fontWeightNormal;
36
+ font-size: $fontSizeStandard;
37
+ text-align: left;
38
+ }
39
+
40
+ // Value cell: consumes all remaining width in auto-layout table.
41
+ .vuiKvTableCell--value {
42
+ width: 100%;
43
+ }
44
+
45
+ .vuiKvTable--paddingXxs {
46
+ td,
47
+ .vuiKvTableCell--key {
48
+ padding: $sizeXxs $sizeS;
49
+ }
50
+ }
51
+
52
+ .vuiKvTable--paddingXs {
53
+ td,
54
+ .vuiKvTableCell--key {
55
+ padding: $sizeXs $sizeS;
56
+ }
57
+ }
58
+
59
+ .vuiKvTable--paddingS {
60
+ td,
61
+ .vuiKvTableCell--key {
62
+ padding: $sizeS $sizeS;
63
+ }
64
+ }
65
+
66
+ .vuiKvTable--alignTop {
67
+ td,
68
+ .vuiKvTableCell--key {
69
+ vertical-align: top;
70
+ }
71
+ }
72
+
73
+ .vuiKvTable--alignMiddle {
74
+ td,
75
+ .vuiKvTableCell--key {
76
+ vertical-align: middle;
77
+ }
78
+ }
79
+
80
+ .vuiKvTable--alignBottom {
81
+ td,
82
+ .vuiKvTableCell--key {
83
+ vertical-align: bottom;
84
+ }
85
+ }
@@ -0,0 +1,7 @@
1
+ export type KvTableItem = {
2
+ key: React.ReactNode;
3
+ value: React.ReactNode;
4
+ };
5
+ export type KvTableItems = KvTableItem[] | Record<string, unknown>;
6
+ export type KvTablePadding = "xxs" | "xs" | "s";
7
+ export type KvTableAlign = "top" | "middle" | "bottom";
@@ -0,0 +1 @@
1
+ export {};
@@ -59,11 +59,20 @@ export const VuiModal = (_a) => {
59
59
  onClose === null || onClose === void 0 ? void 0 : onClose();
60
60
  }, 0);
61
61
  };
62
+ // Handle outside clicks, but ignore clicks on notifications.
63
+ const handleClickOutside = (event) => {
64
+ const target = event.target;
65
+ // Check if the click is within a notification.
66
+ if (target.closest("[data-awareness='notification']")) {
67
+ return;
68
+ }
69
+ onCloseDelayed();
70
+ };
62
71
  const containerClasses = classNames("vuiModalContainer", {
63
72
  "vuiModalContainer-isLoaded": showTransition
64
73
  });
65
74
  const classes = classNames("vuiModal", `vuiModal--${color}`, `vuiModal--${size}`, className);
66
- return (_jsx(VuiPortal, { children: (isOpen || isContentVisible || showTransition) && (_jsx(VuiScreenBlock, Object.assign({ type: "modal", isHidden: !isOpen }, { children: _jsx(FocusOn, Object.assign({ onEscapeKey: onCloseDelayed, onClickOutside: canClickOutsideToClose ? onCloseDelayed : undefined,
75
+ return (_jsx(VuiPortal, { children: (isOpen || isContentVisible || showTransition) && (_jsx(VuiScreenBlock, Object.assign({ type: "modal", isHidden: !isOpen }, { children: _jsx(FocusOn, Object.assign({ onEscapeKey: onCloseDelayed, onClickOutside: canClickOutsideToClose ? handleClickOutside : undefined,
67
76
  // Enable manual focus return to work.
68
77
  returnFocus: false,
69
78
  // Enable focus on contents when it's open,
@@ -3864,6 +3864,73 @@ h2.react-datepicker__current-month {
3864
3864
  background-color: var(--vui-color-light-shade);
3865
3865
  }
3866
3866
 
3867
+ .vuiKvTable {
3868
+ width: 100%;
3869
+ table-layout: auto;
3870
+ border: 1px solid var(--vui-color-border-light);
3871
+ }
3872
+ .vuiKvTable thead {
3873
+ background-color: var(--vui-color-light-shade);
3874
+ border-bottom: 1px solid var(--vui-color-border-light);
3875
+ }
3876
+ .vuiKvTable thead th {
3877
+ font-size: 12px;
3878
+ font-weight: 600;
3879
+ padding: 8px 12px;
3880
+ text-align: left;
3881
+ }
3882
+ .vuiKvTable tbody tr {
3883
+ border-bottom: 1px solid var(--vui-color-border-light);
3884
+ }
3885
+ .vuiKvTable tbody tr:last-child {
3886
+ border-bottom: none;
3887
+ }
3888
+ .vuiKvTable td {
3889
+ font-size: 14px;
3890
+ }
3891
+
3892
+ .vuiKvTableCell--key {
3893
+ color: var(--vui-color-subdued-shade);
3894
+ white-space: nowrap;
3895
+ font-weight: 400;
3896
+ font-size: 14px;
3897
+ text-align: left;
3898
+ }
3899
+
3900
+ .vuiKvTableCell--value {
3901
+ width: 100%;
3902
+ }
3903
+
3904
+ .vuiKvTable--paddingXxs td,
3905
+ .vuiKvTable--paddingXxs .vuiKvTableCell--key {
3906
+ padding: 4px 12px;
3907
+ }
3908
+
3909
+ .vuiKvTable--paddingXs td,
3910
+ .vuiKvTable--paddingXs .vuiKvTableCell--key {
3911
+ padding: 8px 12px;
3912
+ }
3913
+
3914
+ .vuiKvTable--paddingS td,
3915
+ .vuiKvTable--paddingS .vuiKvTableCell--key {
3916
+ padding: 12px 12px;
3917
+ }
3918
+
3919
+ .vuiKvTable--alignTop td,
3920
+ .vuiKvTable--alignTop .vuiKvTableCell--key {
3921
+ vertical-align: top;
3922
+ }
3923
+
3924
+ .vuiKvTable--alignMiddle td,
3925
+ .vuiKvTable--alignMiddle .vuiKvTableCell--key {
3926
+ vertical-align: middle;
3927
+ }
3928
+
3929
+ .vuiKvTable--alignBottom td,
3930
+ .vuiKvTable--alignBottom .vuiKvTableCell--key {
3931
+ vertical-align: bottom;
3932
+ }
3933
+
3867
3934
  .vuiLink {
3868
3935
  color: var(--vui-color-primary-shade) !important;
3869
3936
  text-decoration: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectara/vectara-ui",
3
- "version": "16.4.0",
3
+ "version": "16.5.0",
4
4
  "homepage": "./",
5
5
  "description": "Vectara's design system, codified as a React and Sass component library",
6
6
  "author": "Vectara",
@@ -218,6 +218,20 @@ export const PrimaryDrawer = () => {
218
218
  that the focus management and scroll locking still work as expected.
219
219
  </p>
220
220
  </VuiText>
221
+
222
+ <VuiSpacer size="m" />
223
+
224
+ <VuiButtonSecondary
225
+ color="primary"
226
+ onClick={() => {
227
+ addNotification({
228
+ color: "primary",
229
+ message: "Just some information, FYI"
230
+ });
231
+ }}
232
+ >
233
+ Add notification
234
+ </VuiButtonSecondary>
221
235
  </VuiModal>
222
236
 
223
237
  <VuiNotifications />
@@ -0,0 +1,19 @@
1
+ import { VuiKvTable } from "../../../lib";
2
+
3
+ export const Simple = () => {
4
+ return (
5
+ <VuiKvTable
6
+ label="Span details"
7
+ items={{
8
+ span_id: "b7ad6b7169203331",
9
+ parent_span_id: "–",
10
+ trace_id: "0af7651916cd43dd8448eb211c80319c",
11
+ status: "ok",
12
+ started_at: "Apr 22, 14:32:11 UTC",
13
+ duration: "12.48s",
14
+ step_name: "research",
15
+ event_id: "evt_9a1f"
16
+ }}
17
+ />
18
+ );
19
+ };
@@ -0,0 +1,26 @@
1
+ import { VuiBadge, VuiKvTable } from "../../../lib";
2
+
3
+ export const WithHeader = () => {
4
+ return (
5
+ <VuiKvTable
6
+ label="LLM call attributes"
7
+ keyHeader="Attribute"
8
+ valueHeader="Value"
9
+ items={[
10
+ { key: "model", value: "claude-sonnet-4-5" },
11
+ { key: "provider_name", value: "anthropic" },
12
+ { key: "input_tokens", value: "18432" },
13
+ { key: "output_tokens", value: "2104" },
14
+ { key: "cache_read_input_tokens", value: "12000" },
15
+ { key: "temperature", value: "0.2" },
16
+ { key: "max_tokens", value: "4096" },
17
+ {
18
+ key: "status",
19
+ value: (
20
+ <VuiBadge color="success">ok</VuiBadge>
21
+ )
22
+ }
23
+ ]}
24
+ />
25
+ );
26
+ };
@@ -0,0 +1,22 @@
1
+ import { Simple } from "./Simple";
2
+ import { WithHeader } from "./WithHeader";
3
+
4
+ const SimpleSource = require("!!raw-loader!./Simple");
5
+ const WithHeaderSource = require("!!raw-loader!./WithHeader");
6
+
7
+ export const kvTable = {
8
+ name: "KV Table",
9
+ path: "/kvTable",
10
+ examples: [
11
+ {
12
+ name: "Simple",
13
+ component: <Simple />,
14
+ source: SimpleSource.default.toString()
15
+ },
16
+ {
17
+ name: "With header",
18
+ component: <WithHeader />,
19
+ source: WithHeaderSource.default.toString()
20
+ }
21
+ ]
22
+ };
@@ -24,6 +24,7 @@ import { image } from "./pages/image";
24
24
  import { infoList } from "./pages/infoList";
25
25
  import { infoMenu } from "./pages/infoMenu";
26
26
  import { infoTable } from "./pages/infoTable";
27
+ import { kvTable } from "./pages/kvTable";
27
28
  import { inProgress } from "./pages/inProgress";
28
29
  import { input } from "./pages/input";
29
30
  import { itemsInput } from "./pages/itemsInput";
@@ -88,7 +89,7 @@ export const categories: Category[] = [
88
89
  },
89
90
  {
90
91
  name: "Info",
91
- pages: [table, spans, infoTable, infoList, statList, list, pagination]
92
+ pages: [table, spans, infoTable, kvTable, infoList, statList, list, pagination]
92
93
  },
93
94
  {
94
95
  name: "Layout",