@vectara/vectara-ui 20.0.0 → 20.2.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.
- package/lib/components/flex/FlexContainer.d.ts +4 -26
- package/lib/components/flex/types.d.ts +6 -0
- package/lib/components/flex/types.js +10 -0
- package/lib/components/index.d.ts +4 -3
- package/lib/components/index.js +2 -1
- package/lib/components/popover/Popover.d.ts +5 -2
- package/lib/components/popover/Popover.js +10 -2
- package/lib/components/popover/_index.scss +10 -0
- package/lib/components/status/Status.d.ts +4 -1
- package/lib/components/status/Status.js +2 -2
- package/lib/components/stepNavigator/StepNavigator.d.ts +16 -0
- package/lib/components/stepNavigator/StepNavigator.js +47 -0
- package/lib/components/stepNavigator/_index.scss +105 -0
- package/lib/components/stepsVertical/StepsVertical.d.ts +4 -2
- package/lib/components/stepsVertical/StepsVertical.js +3 -3
- package/lib/styles/index.css +100 -0
- package/package.json +1 -1
- package/src/docs/pages/popover/Popover.tsx +1 -0
- package/src/docs/pages/status/Status.tsx +44 -2
- package/src/docs/pages/stepNavigator/BasicStepNavigator.tsx +18 -0
- package/src/docs/pages/stepNavigator/index.tsx +12 -0
- package/src/docs/pages.tsx +2 -1
|
@@ -1,31 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import { FlexSpacing } from "./types";
|
|
3
|
-
declare const alignItemsToClassNameMap: {
|
|
4
|
-
readonly baseline: "vuiFlexContainer--alignItemsBaseline";
|
|
5
|
-
readonly center: "vuiFlexContainer--alignItemsCenter";
|
|
6
|
-
readonly end: "vuiFlexContainer--alignItemsEnd";
|
|
7
|
-
readonly start: "vuiFlexContainer--alignItemsStart";
|
|
8
|
-
readonly stretch: "vuiFlexContainer--alignItemsStretch";
|
|
9
|
-
};
|
|
10
|
-
declare const directionToClassNameMap: {
|
|
11
|
-
readonly column: "vuiFlexContainer--directionColumn";
|
|
12
|
-
readonly columnReverse: "vuiFlexContainer--directionColumnReverse";
|
|
13
|
-
readonly row: "vuiFlexContainer--directionRow";
|
|
14
|
-
readonly rowReverse: "vuiFlexContainer--directionRowReverse";
|
|
15
|
-
};
|
|
16
|
-
declare const justifyContentToClassNameMap: {
|
|
17
|
-
readonly center: "vuiFlexContainer--justifyContentCenter";
|
|
18
|
-
readonly end: "vuiFlexContainer--justifyContentEnd";
|
|
19
|
-
readonly start: "vuiFlexContainer--justifyContentStart";
|
|
20
|
-
readonly spaceAround: "vuiFlexContainer--justifyContentSpaceAround";
|
|
21
|
-
readonly spaceBetween: "vuiFlexContainer--justifyContentSpaceBetween";
|
|
22
|
-
readonly spaceEvenly: "vuiFlexContainer--justifyContentSpaceEvenly";
|
|
23
|
-
};
|
|
2
|
+
import { AlignItemsPosition, FlexDirection, FlexSpacing, JustifyContentPosition } from "./types";
|
|
24
3
|
export type Props = {
|
|
25
4
|
children?: ReactNode;
|
|
26
|
-
alignItems?:
|
|
27
|
-
direction?:
|
|
28
|
-
justifyContent?:
|
|
5
|
+
alignItems?: AlignItemsPosition;
|
|
6
|
+
direction?: FlexDirection;
|
|
7
|
+
justifyContent?: JustifyContentPosition;
|
|
29
8
|
spacing?: FlexSpacing;
|
|
30
9
|
wrap?: boolean;
|
|
31
10
|
className?: string;
|
|
@@ -33,4 +12,3 @@ export type Props = {
|
|
|
33
12
|
inline?: boolean;
|
|
34
13
|
};
|
|
35
14
|
export declare const VuiFlexContainer: ({ children, alignItems, direction, justifyContent, spacing, wrap, className, fullWidth, inline, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
-
export {};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
export declare const FLEX_SPACING: readonly ["none", "xxs", "xs", "s", "m", "l", "xl", "xxl"];
|
|
2
2
|
export type FlexSpacing = (typeof FLEX_SPACING)[number];
|
|
3
|
+
export declare const ALIGN_ITEMS_POSITION: readonly ["baseline", "center", "end", "start", "stretch"];
|
|
4
|
+
export type AlignItemsPosition = (typeof ALIGN_ITEMS_POSITION)[number];
|
|
5
|
+
export declare const FLEX_DIRECTION: readonly ["column", "columnReverse", "row", "rowReverse"];
|
|
6
|
+
export type FlexDirection = (typeof FLEX_DIRECTION)[number];
|
|
7
|
+
export declare const JUSTIFY_CONTENT_POSITION: readonly ["center", "end", "start", "spaceAround", "spaceBetween", "spaceEvenly"];
|
|
8
|
+
export type JustifyContentPosition = (typeof JUSTIFY_CONTENT_POSITION)[number];
|
|
@@ -1 +1,11 @@
|
|
|
1
1
|
export const FLEX_SPACING = ["none", "xxs", "xs", "s", "m", "l", "xl", "xxl"];
|
|
2
|
+
export const ALIGN_ITEMS_POSITION = ["baseline", "center", "end", "start", "stretch"];
|
|
3
|
+
export const FLEX_DIRECTION = ["column", "columnReverse", "row", "rowReverse"];
|
|
4
|
+
export const JUSTIFY_CONTENT_POSITION = [
|
|
5
|
+
"center",
|
|
6
|
+
"end",
|
|
7
|
+
"start",
|
|
8
|
+
"spaceAround",
|
|
9
|
+
"spaceBetween",
|
|
10
|
+
"spaceEvenly"
|
|
11
|
+
];
|
|
@@ -93,8 +93,9 @@ import { SPINNER_COLOR, SPINNER_SIZE } from "./spinner/types";
|
|
|
93
93
|
import { Stat, VuiStatList } from "./statList/StatList";
|
|
94
94
|
import { VuiStat } from "./stat/Stat";
|
|
95
95
|
import { VuiStatus } from "./status/Status";
|
|
96
|
+
import { VuiStepNavigator, StepNavigatorStep, StepNavigatorSteps } from "./stepNavigator/StepNavigator";
|
|
96
97
|
import { VuiSteps, StepStatus, StepSize, Steps } from "./steps/Steps";
|
|
97
|
-
import { VuiStepsVertical, StepsVertical, StepVerticalStatus } from "./stepsVertical/StepsVertical";
|
|
98
|
+
import { VuiStepsVertical, StepVertical, StepsVertical, StepVerticalStatus } from "./stepsVertical/StepsVertical";
|
|
98
99
|
import { SKELETON_COLOR, VuiSkeleton } from "./skeleton/Skeleton";
|
|
99
100
|
import { VuiSummary, VuiSummaryCitation } from "./summary";
|
|
100
101
|
import { VuiTable } from "./table/Table";
|
|
@@ -116,5 +117,5 @@ import { VuiInfoTooltip } from "./tooltip/InfoTooltip";
|
|
|
116
117
|
import { VuiTopicButton } from "./topicButton/TopicButton";
|
|
117
118
|
import { copyToClipboard } from "../utils/copyToClipboard";
|
|
118
119
|
import { toRgb, toRgba } from "./context/Theme";
|
|
119
|
-
export type { AnchorSide, AppContentPadding, BarChartSeries, ComposedSeries, LineChartSeries, LineChartVariant, ScatterSeries, 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, AccountButtonHandle };
|
|
120
|
-
export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CHART_PALETTE, 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, VuiBarChart, VuiComposedChart, VuiLineChart, VuiPieChart, VuiScatterChart, VuiSparkline, VuiTreeMap, 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 };
|
|
120
|
+
export type { AnchorSide, AppContentPadding, BarChartSeries, ComposedSeries, LineChartSeries, LineChartVariant, ScatterSeries, 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, StepNavigatorStep, StepNavigatorSteps, StepStatus, StepSize, Steps, StepVertical, StepsVertical, StepVerticalStatus, TabNavigatorRoute, TabSize, Tree, TreeItem, AccountButtonHandle };
|
|
121
|
+
export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CHART_PALETTE, 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, VuiBarChart, VuiComposedChart, VuiLineChart, VuiPieChart, VuiScatterChart, VuiSparkline, VuiTreeMap, 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, VuiStepNavigator, VuiSteps, VuiStepsVertical, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperCheckboxGroup, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiTabsNavigator, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
|
package/lib/components/index.js
CHANGED
|
@@ -85,6 +85,7 @@ import { SPINNER_COLOR, SPINNER_SIZE } from "./spinner/types";
|
|
|
85
85
|
import { VuiStatList } from "./statList/StatList";
|
|
86
86
|
import { VuiStat } from "./stat/Stat";
|
|
87
87
|
import { VuiStatus } from "./status/Status";
|
|
88
|
+
import { VuiStepNavigator } from "./stepNavigator/StepNavigator";
|
|
88
89
|
import { VuiSteps } from "./steps/Steps";
|
|
89
90
|
import { VuiStepsVertical } from "./stepsVertical/StepsVertical";
|
|
90
91
|
import { SKELETON_COLOR, VuiSkeleton } from "./skeleton/Skeleton";
|
|
@@ -107,4 +108,4 @@ import { VuiInfoTooltip } from "./tooltip/InfoTooltip";
|
|
|
107
108
|
import { VuiTopicButton } from "./topicButton/TopicButton";
|
|
108
109
|
import { copyToClipboard } from "../utils/copyToClipboard";
|
|
109
110
|
import { toRgb, toRgba } from "./context/Theme";
|
|
110
|
-
export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CHART_PALETTE, 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, VuiBarChart, VuiComposedChart, VuiLineChart, VuiPieChart, VuiScatterChart, VuiSparkline, VuiTreeMap, 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 };
|
|
111
|
+
export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CHART_PALETTE, 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, VuiBarChart, VuiComposedChart, VuiLineChart, VuiPieChart, VuiScatterChart, VuiSparkline, VuiTreeMap, 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, VuiStepNavigator, VuiSteps, VuiStepsVertical, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperCheckboxGroup, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiTabsNavigator, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import { Props as VuiTooltipProps } from "../tooltip/Tooltip";
|
|
3
|
+
export type AnchorSide = "left" | "right" | "center" | "rightUp" | "rightDown" | "leftUp" | "leftDown" | "upLeft" | "upRight";
|
|
3
4
|
export type Props = {
|
|
4
5
|
button: React.ReactElement;
|
|
5
6
|
children?: React.ReactNode;
|
|
@@ -12,5 +13,7 @@ export type Props = {
|
|
|
12
13
|
anchorSide?: AnchorSide;
|
|
13
14
|
anchorOffsetX?: number;
|
|
14
15
|
anchorOffsetY?: number;
|
|
16
|
+
tooltip?: string;
|
|
17
|
+
tooltipProps?: Omit<VuiTooltipProps, "children" | "tip">;
|
|
15
18
|
};
|
|
16
|
-
export declare const VuiPopover: ({ button: originalButton, children, className, header, isOpen, setIsOpen, padding, anchorSide, anchorOffsetX, anchorOffsetY, onClickButton, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const VuiPopover: ({ button: originalButton, children, className, header, isOpen, setIsOpen, padding, anchorSide, anchorOffsetX, anchorOffsetY, onClickButton, tooltip, tooltipProps, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,6 +15,7 @@ import classNames from "classnames";
|
|
|
15
15
|
import { VuiPortal } from "../portal/Portal";
|
|
16
16
|
import { FocusOn } from "react-focus-on";
|
|
17
17
|
import { VuiItemsInput, VuiNumberInput, VuiTextInput } from "../form";
|
|
18
|
+
import { VuiTooltip } from "../tooltip/Tooltip";
|
|
18
19
|
const calculatePopoverPosition = (button, anchorOptions) => {
|
|
19
20
|
if (!button)
|
|
20
21
|
return undefined;
|
|
@@ -56,6 +57,11 @@ const calculatePopoverPosition = (button, anchorOptions) => {
|
|
|
56
57
|
return { bottom: `${adjustedBottom}px`, right: `${adjustedRight}px` };
|
|
57
58
|
}
|
|
58
59
|
const adjustedTop = bottom + offsetY + document.documentElement.scrollTop;
|
|
60
|
+
if (anchorSide === "center") {
|
|
61
|
+
// Anchor below the button, horizontally centered on it. Pairs with a
|
|
62
|
+
// translateX(-50%) in CSS to offset by half the popover's own width.
|
|
63
|
+
return { top: `${adjustedTop}px`, left: `${left + width / 2}px` };
|
|
64
|
+
}
|
|
59
65
|
if (anchorSide === "left") {
|
|
60
66
|
return { top: `${adjustedTop}px`, left: `${left}px` };
|
|
61
67
|
}
|
|
@@ -64,7 +70,7 @@ const calculatePopoverPosition = (button, anchorOptions) => {
|
|
|
64
70
|
return { top: `${adjustedTop}px`, right: `${adjustedRight}px` };
|
|
65
71
|
};
|
|
66
72
|
export const VuiPopover = (_a) => {
|
|
67
|
-
var { button: originalButton, children, className, header, isOpen, setIsOpen, padding, anchorSide = "right", anchorOffsetX = 2, anchorOffsetY = 2, onClickButton } = _a, rest = __rest(_a, ["button", "children", "className", "header", "isOpen", "setIsOpen", "padding", "anchorSide", "anchorOffsetX", "anchorOffsetY", "onClickButton"]);
|
|
73
|
+
var { button: originalButton, children, className, header, isOpen, setIsOpen, padding, anchorSide = "right", anchorOffsetX = 2, anchorOffsetY = 2, onClickButton, tooltip, tooltipProps } = _a, rest = __rest(_a, ["button", "children", "className", "header", "isOpen", "setIsOpen", "padding", "anchorSide", "anchorOffsetX", "anchorOffsetY", "onClickButton", "tooltip", "tooltipProps"]);
|
|
68
74
|
const returnFocusElRef = useRef(null);
|
|
69
75
|
const buttonRef = useRef(null);
|
|
70
76
|
const [, setPositionMarker] = useState(0);
|
|
@@ -105,7 +111,8 @@ export const VuiPopover = (_a) => {
|
|
|
105
111
|
setIsOpen(!isOpen);
|
|
106
112
|
};
|
|
107
113
|
}
|
|
108
|
-
const
|
|
114
|
+
const clonedButton = cloneElement(originalButton, buttonProps);
|
|
115
|
+
const button = tooltip !== undefined ? (_jsx(VuiTooltip, Object.assign({ tip: tooltip }, tooltipProps, { children: clonedButton }))) : (clonedButton);
|
|
109
116
|
useEffect(() => {
|
|
110
117
|
const updatePosition = () => {
|
|
111
118
|
// Force a re-render when the window resizes.
|
|
@@ -158,6 +165,7 @@ export const VuiPopover = (_a) => {
|
|
|
158
165
|
});
|
|
159
166
|
const classes = classNames("vuiPopover", className, {
|
|
160
167
|
"vuiPopover-isLoaded": showTransition,
|
|
168
|
+
"vuiPopover--center": anchorSide === "center",
|
|
161
169
|
"vuiPopover--rightUp": anchorSide === "rightUp",
|
|
162
170
|
"vuiPopover--leftUp": anchorSide === "leftUp",
|
|
163
171
|
"vuiPopover--upLeft": anchorSide === "upLeft",
|
|
@@ -27,6 +27,16 @@
|
|
|
27
27
|
transform: translateY(-100%) !important;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
// Centered below the button: shift left by half the popover's width while
|
|
31
|
+
// preserving the vertical enter transition.
|
|
32
|
+
.vuiPopover--center {
|
|
33
|
+
transform: translate(-50%, -$sizeXs);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.vuiPopover--center.vuiPopover-isLoaded {
|
|
37
|
+
transform: translate(-50%, 0);
|
|
38
|
+
}
|
|
39
|
+
|
|
30
40
|
.vuiPopover--upLeft,
|
|
31
41
|
.vuiPopover--upRight {
|
|
32
42
|
transform: translateY(0);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { AlignItemsPosition, FlexSpacing } from "../flex/types";
|
|
1
2
|
type Props = {
|
|
2
3
|
status: "error" | "warning" | "success" | "info";
|
|
3
4
|
label: string;
|
|
5
|
+
gap?: FlexSpacing;
|
|
6
|
+
align?: AlignItemsPosition;
|
|
4
7
|
};
|
|
5
|
-
export declare const VuiStatus: ({ status, label }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const VuiStatus: ({ status, label, gap, align }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
9
|
export {};
|
|
@@ -17,8 +17,8 @@ const statusToIcon = {
|
|
|
17
17
|
success: _jsx(BiCheck, {}),
|
|
18
18
|
info: _jsx(BiInfoCircle, {})
|
|
19
19
|
};
|
|
20
|
-
export const VuiStatus = ({ status, label }) => {
|
|
20
|
+
export const VuiStatus = ({ status, label, gap = "xs", align = "center" }) => {
|
|
21
21
|
const color = statusToColor[status];
|
|
22
22
|
const icon = statusToIcon[status];
|
|
23
|
-
return (_jsxs(VuiFlexContainer, Object.assign({ alignItems:
|
|
23
|
+
return (_jsxs(VuiFlexContainer, Object.assign({ alignItems: align, spacing: gap }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsx(VuiIcon, Object.assign({ color: color }, { children: icon })) })), _jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsx(VuiText, { children: _jsx("p", { children: _jsx(VuiTextColor, Object.assign({ color: color }, { children: label })) }) }) }))] })));
|
|
24
24
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StepVertical } from "../stepsVertical/StepsVertical";
|
|
2
|
+
export type StepNavigatorStep = Omit<StepVertical, "isActive" | "onSelect">;
|
|
3
|
+
export type StepNavigatorSteps = StepNavigatorStep[];
|
|
4
|
+
type Props = {
|
|
5
|
+
steps: StepNavigatorSteps;
|
|
6
|
+
activeStep: number;
|
|
7
|
+
showStepCount?: boolean;
|
|
8
|
+
onStepChange?: (index: number, step: StepNavigatorStep) => void;
|
|
9
|
+
onNext?: (index: number, step: StepNavigatorStep) => void;
|
|
10
|
+
onPrevious?: (index: number, step: StepNavigatorStep) => void;
|
|
11
|
+
onSelect?: (index: number, step: StepNavigatorStep) => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
"data-testid"?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const VuiStepNavigator: ({ steps, activeStep, showStepCount, onStepChange, onNext, onPrevious, onSelect, className, "data-testid": dataTestId }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useState } from "react";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { BiChevronDown, BiChevronLeft, BiChevronRight } from "react-icons/bi";
|
|
5
|
+
import { VuiIcon } from "../icon/Icon";
|
|
6
|
+
import { VuiPopover } from "../popover/Popover";
|
|
7
|
+
import { VuiStepsVertical } from "../stepsVertical/StepsVertical";
|
|
8
|
+
// Center pill that displays the current step and toggles the dropdown. Receives
|
|
9
|
+
// `isSelected` and `onClick` from VuiPopover, which clones it as its trigger.
|
|
10
|
+
const StepNavigatorTrigger = forwardRef(({ icon, title, stepLabel, showStepCount, isSelected, onClick, "data-testid": dataTestId }, ref) => (_jsxs("button", Object.assign({ type: "button", ref: ref, onClick: onClick, "aria-haspopup": "listbox", "aria-expanded": Boolean(isSelected), "data-testid": dataTestId, className: classNames("vuiStepNavigator__trigger", {
|
|
11
|
+
"vuiStepNavigator__trigger--open": isSelected
|
|
12
|
+
}) }, { children: [_jsx(VuiIcon, Object.assign({ size: "s", color: "primary" }, { children: icon })), _jsx("span", Object.assign({ className: "vuiStepNavigator__triggerTitle" }, { children: title })), showStepCount && _jsxs("span", Object.assign({ className: "vuiStepNavigator__triggerCount" }, { children: [" \u00B7 ", stepLabel] })), _jsx("span", Object.assign({ className: classNames("vuiStepNavigator__caret", {
|
|
13
|
+
"vuiStepNavigator__caret--open": isSelected
|
|
14
|
+
}) }, { children: _jsx(VuiIcon, Object.assign({ size: "s", color: "subdued" }, { children: _jsx(BiChevronDown, {}) })) }))] }))));
|
|
15
|
+
export const VuiStepNavigator = ({ steps, activeStep, showStepCount = true, onStepChange, onNext, onPrevious, onSelect, className, "data-testid": dataTestId }) => {
|
|
16
|
+
const clamp = (index) => Math.max(0, Math.min(steps.length - 1, index));
|
|
17
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
18
|
+
const active = clamp(activeStep);
|
|
19
|
+
const current = steps[active];
|
|
20
|
+
const commit = (index) => {
|
|
21
|
+
const nextIndex = clamp(index);
|
|
22
|
+
setIsOpen(false);
|
|
23
|
+
onStepChange === null || onStepChange === void 0 ? void 0 : onStepChange(nextIndex, steps[nextIndex]);
|
|
24
|
+
};
|
|
25
|
+
const goPrevious = () => {
|
|
26
|
+
if (active <= 0)
|
|
27
|
+
return;
|
|
28
|
+
onPrevious === null || onPrevious === void 0 ? void 0 : onPrevious(active - 1, steps[active - 1]);
|
|
29
|
+
commit(active - 1);
|
|
30
|
+
};
|
|
31
|
+
const goNext = () => {
|
|
32
|
+
if (active >= steps.length - 1)
|
|
33
|
+
return;
|
|
34
|
+
onNext === null || onNext === void 0 ? void 0 : onNext(active + 1, steps[active + 1]);
|
|
35
|
+
commit(active + 1);
|
|
36
|
+
};
|
|
37
|
+
const select = (index) => {
|
|
38
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(index, steps[index]);
|
|
39
|
+
commit(index);
|
|
40
|
+
};
|
|
41
|
+
const prevDisabled = active <= 0;
|
|
42
|
+
const nextDisabled = active >= steps.length - 1;
|
|
43
|
+
const stepLabel = `Step ${active + 1} of ${steps.length}`;
|
|
44
|
+
const verticalSteps = steps.map((step, index) => (Object.assign(Object.assign({}, step), { isActive: index === active, onSelect: () => select(index) })));
|
|
45
|
+
const menu = (_jsx(VuiStepsVertical, { className: "vuiStepNavigator__menu", steps: verticalSteps, "data-testid": dataTestId ? `${dataTestId}-menu` : undefined }));
|
|
46
|
+
return (_jsxs("div", Object.assign({ className: classNames("vuiStepNavigator", className), "data-testid": dataTestId }, { children: [_jsx("button", Object.assign({ type: "button", className: "vuiStepNavigator__sideButton", onClick: goPrevious, disabled: prevDisabled, "aria-label": "Previous step", "data-testid": dataTestId ? `${dataTestId}-previous` : undefined }, { children: _jsx(VuiIcon, Object.assign({ size: "m" }, { children: _jsx(BiChevronLeft, {}) })) })), _jsx("div", Object.assign({ className: "vuiStepNavigator__center" }, { children: _jsx(VuiPopover, Object.assign({ className: "vuiStepNavigator__popover", anchorSide: "center", anchorOffsetY: 8, padding: "none", isOpen: isOpen, setIsOpen: setIsOpen, button: _jsx(StepNavigatorTrigger, { icon: current.icon, title: current.title, stepLabel: stepLabel, showStepCount: showStepCount, "data-testid": dataTestId ? `${dataTestId}-trigger` : undefined }) }, { children: menu })) })), _jsx("button", Object.assign({ type: "button", className: "vuiStepNavigator__sideButton", onClick: goNext, disabled: nextDisabled, "aria-label": "Next step", "data-testid": dataTestId ? `${dataTestId}-next` : undefined }, { children: _jsx(VuiIcon, Object.assign({ size: "m" }, { children: _jsx(BiChevronRight, {}) })) }))] })));
|
|
47
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
@import "../../sassUtils/index";
|
|
2
|
+
|
|
3
|
+
$stepNavigatorBarHeight: 44px;
|
|
4
|
+
$stepNavigatorRadius: $sizeXs; // 8px buttons & pill & rows.
|
|
5
|
+
|
|
6
|
+
.vuiStepNavigator {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: stretch;
|
|
9
|
+
gap: $sizeXs;
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Square previous / next chevron buttons.
|
|
14
|
+
.vuiStepNavigator__sideButton {
|
|
15
|
+
flex: 0 0 auto;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
width: $stepNavigatorBarHeight;
|
|
20
|
+
padding: 0;
|
|
21
|
+
background-color: var(--vui-color-empty-shade);
|
|
22
|
+
border: 1px solid var(--vui-color-border-medium);
|
|
23
|
+
border-radius: $stepNavigatorRadius;
|
|
24
|
+
color: var(--vui-color-darker-shade);
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
transition: box-shadow $transitionSpeed;
|
|
27
|
+
|
|
28
|
+
&:not(:disabled):hover {
|
|
29
|
+
box-shadow: $shadowSmallEnd;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:disabled {
|
|
33
|
+
color: var(--vui-color-subdued-shade);
|
|
34
|
+
opacity: 0.45;
|
|
35
|
+
cursor: not-allowed;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.vuiStepNavigator__center {
|
|
40
|
+
flex: 1 1 auto;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Center pill: current-step display and dropdown trigger.
|
|
45
|
+
.vuiStepNavigator__trigger {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
flex-wrap: wrap;
|
|
50
|
+
gap: $sizeXs;
|
|
51
|
+
width: 100%;
|
|
52
|
+
min-height: $stepNavigatorBarHeight;
|
|
53
|
+
padding: $sizeS $sizeM;
|
|
54
|
+
background-color: var(--vui-color-empty-shade);
|
|
55
|
+
border: 1px solid var(--vui-color-medium-shade);
|
|
56
|
+
border-radius: $stepNavigatorRadius;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
transition: border-color $transitionSpeed, box-shadow $transitionSpeed, background-color $transitionSpeed;
|
|
59
|
+
|
|
60
|
+
&:hover {
|
|
61
|
+
box-shadow: $shadowSmallEnd;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&--open {
|
|
65
|
+
background-color: var(--vui-color-primary-lighter-shade);
|
|
66
|
+
border-color: var(--vui-color-primary-shade);
|
|
67
|
+
box-shadow: 0 0 0 3px rgba(var(--vui-color-primary-shade-rgb), 0.14);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.vuiStepNavigator__triggerTitle {
|
|
72
|
+
font-size: $fontSizeLarge - 3px; // 15px
|
|
73
|
+
font-weight: $fontWeightBold;
|
|
74
|
+
color: var(--vui-color-darker-shade);
|
|
75
|
+
white-space: nowrap;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.vuiStepNavigator__triggerCount {
|
|
79
|
+
font-size: $fontSizeStandard;
|
|
80
|
+
font-weight: $fontWeightNormal;
|
|
81
|
+
color: var(--vui-color-subdued-shade);
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.vuiStepNavigator__caret {
|
|
86
|
+
display: flex;
|
|
87
|
+
transition: transform $transitionSpeed;
|
|
88
|
+
|
|
89
|
+
&--open {
|
|
90
|
+
transform: rotate(180deg);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Dropdown panel: applied to the VuiPopover surface to round and lighten it.
|
|
95
|
+
.vuiStepNavigator__popover {
|
|
96
|
+
border-radius: $sizeS;
|
|
97
|
+
border-color: var(--vui-color-border-light);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Dropdown body: VuiStepsVertical, constrained to the trigger's footprint.
|
|
101
|
+
.vuiStepNavigator__menu {
|
|
102
|
+
width: 340px;
|
|
103
|
+
max-width: 94vw;
|
|
104
|
+
padding: $sizeXs;
|
|
105
|
+
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
export type { StepVerticalStatus } from "./types";
|
|
2
|
-
export type
|
|
2
|
+
export type StepVertical = {
|
|
3
3
|
id: string;
|
|
4
4
|
title: string;
|
|
5
5
|
isActive?: boolean;
|
|
6
6
|
hasErrors?: boolean;
|
|
7
|
+
isComplete?: boolean;
|
|
7
8
|
icon: React.ReactNode;
|
|
8
9
|
onSelect: () => void;
|
|
9
10
|
"data-testid"?: string;
|
|
10
|
-
}
|
|
11
|
+
};
|
|
12
|
+
export type StepsVertical = StepVertical[];
|
|
11
13
|
type Props = {
|
|
12
14
|
steps: StepsVertical;
|
|
13
15
|
className?: string;
|
|
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { BiError } from "react-icons/bi";
|
|
13
|
+
import { BiCheckCircle, BiError } from "react-icons/bi";
|
|
14
14
|
import { VuiIcon } from "../icon/Icon";
|
|
15
15
|
import { VuiMenuList } from "../menuList/VuiMenuList";
|
|
16
16
|
import { VuiMenuListButton } from "../menuList/VuiMenuListButton";
|
|
@@ -18,8 +18,8 @@ export const VuiStepsVertical = (_a) => {
|
|
|
18
18
|
var { steps, className, "data-testid": dataTestId } = _a, rest = __rest(_a, ["steps", "className", "data-testid"]);
|
|
19
19
|
return (_jsx(VuiMenuList, Object.assign({ className: className, "data-testid": dataTestId }, rest, { children: steps.map((step) => {
|
|
20
20
|
var _a;
|
|
21
|
-
const { id, title, isActive, hasErrors, icon, onSelect } = step;
|
|
21
|
+
const { id, title, isActive, hasErrors, isComplete, icon, onSelect } = step;
|
|
22
22
|
const stepTestId = (_a = step["data-testid"]) !== null && _a !== void 0 ? _a : `${dataTestId}-step-${id}`;
|
|
23
|
-
return (_jsx(VuiMenuListButton, Object.assign({ isActive: isActive, onClick: () => onSelect(), "data-testid": stepTestId, icon: icon, append: hasErrors
|
|
23
|
+
return (_jsx(VuiMenuListButton, Object.assign({ isActive: isActive, onClick: () => onSelect(), "data-testid": stepTestId, icon: icon, append: hasErrors ? (_jsx(VuiIcon, Object.assign({ size: "s", color: "danger", "data-testid": `${stepTestId}-error` }, { children: _jsx(BiError, {}) }))) : (isComplete && (_jsx(VuiIcon, Object.assign({ size: "s", color: "success", "data-testid": `${stepTestId}-complete` }, { children: _jsx(BiCheckCircle, {}) })))) }, { children: title }), id));
|
|
24
24
|
}) })));
|
|
25
25
|
};
|
package/lib/styles/index.css
CHANGED
|
@@ -4787,6 +4787,14 @@ h2.react-datepicker__current-month {
|
|
|
4787
4787
|
transform: translateY(-100%) !important;
|
|
4788
4788
|
}
|
|
4789
4789
|
|
|
4790
|
+
.vuiPopover--center {
|
|
4791
|
+
transform: translate(-50%, -8px);
|
|
4792
|
+
}
|
|
4793
|
+
|
|
4794
|
+
.vuiPopover--center.vuiPopover-isLoaded {
|
|
4795
|
+
transform: translate(-50%, 0);
|
|
4796
|
+
}
|
|
4797
|
+
|
|
4790
4798
|
.vuiPopover--upLeft,
|
|
4791
4799
|
.vuiPopover--upRight {
|
|
4792
4800
|
transform: translateY(0);
|
|
@@ -5525,6 +5533,98 @@ h2.react-datepicker__current-month {
|
|
|
5525
5533
|
font-size: 12px !important;
|
|
5526
5534
|
}
|
|
5527
5535
|
|
|
5536
|
+
.vuiStepNavigator {
|
|
5537
|
+
display: flex;
|
|
5538
|
+
align-items: stretch;
|
|
5539
|
+
gap: 8px;
|
|
5540
|
+
width: 100%;
|
|
5541
|
+
}
|
|
5542
|
+
|
|
5543
|
+
.vuiStepNavigator__sideButton {
|
|
5544
|
+
flex: 0 0 auto;
|
|
5545
|
+
display: flex;
|
|
5546
|
+
align-items: center;
|
|
5547
|
+
justify-content: center;
|
|
5548
|
+
width: 44px;
|
|
5549
|
+
padding: 0;
|
|
5550
|
+
background-color: var(--vui-color-empty-shade);
|
|
5551
|
+
border: 1px solid var(--vui-color-border-medium);
|
|
5552
|
+
border-radius: 8px;
|
|
5553
|
+
color: var(--vui-color-darker-shade);
|
|
5554
|
+
cursor: pointer;
|
|
5555
|
+
transition: box-shadow 0.2s;
|
|
5556
|
+
}
|
|
5557
|
+
.vuiStepNavigator__sideButton:not(:disabled):hover {
|
|
5558
|
+
box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
|
|
5559
|
+
}
|
|
5560
|
+
.vuiStepNavigator__sideButton:disabled {
|
|
5561
|
+
color: var(--vui-color-subdued-shade);
|
|
5562
|
+
opacity: 0.45;
|
|
5563
|
+
cursor: not-allowed;
|
|
5564
|
+
}
|
|
5565
|
+
|
|
5566
|
+
.vuiStepNavigator__center {
|
|
5567
|
+
flex: 1 1 auto;
|
|
5568
|
+
min-width: 0;
|
|
5569
|
+
}
|
|
5570
|
+
|
|
5571
|
+
.vuiStepNavigator__trigger {
|
|
5572
|
+
display: flex;
|
|
5573
|
+
align-items: center;
|
|
5574
|
+
justify-content: center;
|
|
5575
|
+
flex-wrap: wrap;
|
|
5576
|
+
gap: 8px;
|
|
5577
|
+
width: 100%;
|
|
5578
|
+
min-height: 44px;
|
|
5579
|
+
padding: 12px 16px;
|
|
5580
|
+
background-color: var(--vui-color-empty-shade);
|
|
5581
|
+
border: 1px solid var(--vui-color-medium-shade);
|
|
5582
|
+
border-radius: 8px;
|
|
5583
|
+
cursor: pointer;
|
|
5584
|
+
transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
|
|
5585
|
+
}
|
|
5586
|
+
.vuiStepNavigator__trigger:hover {
|
|
5587
|
+
box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
|
|
5588
|
+
}
|
|
5589
|
+
.vuiStepNavigator__trigger--open {
|
|
5590
|
+
background-color: var(--vui-color-primary-lighter-shade);
|
|
5591
|
+
border-color: var(--vui-color-primary-shade);
|
|
5592
|
+
box-shadow: 0 0 0 3px rgba(var(--vui-color-primary-shade-rgb), 0.14);
|
|
5593
|
+
}
|
|
5594
|
+
|
|
5595
|
+
.vuiStepNavigator__triggerTitle {
|
|
5596
|
+
font-size: 15px;
|
|
5597
|
+
font-weight: 600;
|
|
5598
|
+
color: var(--vui-color-darker-shade);
|
|
5599
|
+
white-space: nowrap;
|
|
5600
|
+
}
|
|
5601
|
+
|
|
5602
|
+
.vuiStepNavigator__triggerCount {
|
|
5603
|
+
font-size: 14px;
|
|
5604
|
+
font-weight: 400;
|
|
5605
|
+
color: var(--vui-color-subdued-shade);
|
|
5606
|
+
white-space: nowrap;
|
|
5607
|
+
}
|
|
5608
|
+
|
|
5609
|
+
.vuiStepNavigator__caret {
|
|
5610
|
+
display: flex;
|
|
5611
|
+
transition: transform 0.2s;
|
|
5612
|
+
}
|
|
5613
|
+
.vuiStepNavigator__caret--open {
|
|
5614
|
+
transform: rotate(180deg);
|
|
5615
|
+
}
|
|
5616
|
+
|
|
5617
|
+
.vuiStepNavigator__popover {
|
|
5618
|
+
border-radius: 12px;
|
|
5619
|
+
border-color: var(--vui-color-border-light);
|
|
5620
|
+
}
|
|
5621
|
+
|
|
5622
|
+
.vuiStepNavigator__menu {
|
|
5623
|
+
width: 340px;
|
|
5624
|
+
max-width: 94vw;
|
|
5625
|
+
padding: 8px;
|
|
5626
|
+
}
|
|
5627
|
+
|
|
5528
5628
|
.vuiSteps {
|
|
5529
5629
|
width: 100%;
|
|
5530
5630
|
position: relative;
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VuiSpacer, VuiStatus } from "../../../lib";
|
|
1
|
+
import { VuiSpacer, VuiStatus, VuiTitle } from "../../../lib";
|
|
2
2
|
|
|
3
3
|
export const Status = () => {
|
|
4
4
|
return (
|
|
@@ -17,7 +17,49 @@ export const Status = () => {
|
|
|
17
17
|
|
|
18
18
|
<VuiStatus status="info" label="Info" />
|
|
19
19
|
|
|
20
|
-
<VuiSpacer size="
|
|
20
|
+
<VuiSpacer size="l" />
|
|
21
|
+
|
|
22
|
+
<div style={{ width: "300px" }}>
|
|
23
|
+
<VuiTitle size="s">
|
|
24
|
+
<h3>Multiline message</h3>
|
|
25
|
+
</VuiTitle>
|
|
26
|
+
|
|
27
|
+
<VuiSpacer size="m" />
|
|
28
|
+
|
|
29
|
+
<VuiStatus
|
|
30
|
+
status="error"
|
|
31
|
+
label="A multiline error message. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis placerat sem, ut mattis sapien."
|
|
32
|
+
gap="l"
|
|
33
|
+
align="start"
|
|
34
|
+
/>
|
|
35
|
+
|
|
36
|
+
<VuiSpacer size="m" />
|
|
37
|
+
|
|
38
|
+
<VuiStatus
|
|
39
|
+
status="warning"
|
|
40
|
+
label="A multiline warning message. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis placerat sem, ut mattis sapien."
|
|
41
|
+
gap="l"
|
|
42
|
+
align="start"
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<VuiSpacer size="m" />
|
|
46
|
+
|
|
47
|
+
<VuiStatus
|
|
48
|
+
status="success"
|
|
49
|
+
label="A multiline success message. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis placerat sem, ut mattis sapien."
|
|
50
|
+
gap="l"
|
|
51
|
+
align="start"
|
|
52
|
+
/>
|
|
53
|
+
|
|
54
|
+
<VuiSpacer size="m" />
|
|
55
|
+
|
|
56
|
+
<VuiStatus
|
|
57
|
+
status="info"
|
|
58
|
+
label="A multiline info message. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis placerat sem, ut mattis sapien."
|
|
59
|
+
gap="l"
|
|
60
|
+
align="start"
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
21
63
|
</>
|
|
22
64
|
);
|
|
23
65
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { BiLink, BiLock, BiMessageRounded, BiPencil, BiShow, BiSolidMagicWand } from "react-icons/bi";
|
|
3
|
+
import { VuiStepNavigator, StepNavigatorSteps } from "../../../lib";
|
|
4
|
+
|
|
5
|
+
const steps: StepNavigatorSteps = [
|
|
6
|
+
{ id: "branding", title: "Branding", icon: <BiPencil />, isComplete: true },
|
|
7
|
+
{ id: "welcome", title: "Welcome", icon: <BiMessageRounded />, isComplete: true },
|
|
8
|
+
{ id: "prompts", title: "Suggested prompts", icon: <BiSolidMagicWand />, hasErrors: true },
|
|
9
|
+
{ id: "events", title: "Event visibility", icon: <BiShow /> },
|
|
10
|
+
{ id: "access", title: "Access & SSO", icon: <BiLock /> },
|
|
11
|
+
{ id: "url", title: "Public URL", icon: <BiLink /> }
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
export const BasicStepNavigator = () => {
|
|
15
|
+
const [activeStep, setActiveStep] = useState(1);
|
|
16
|
+
|
|
17
|
+
return <VuiStepNavigator steps={steps} activeStep={activeStep} onStepChange={(index) => setActiveStep(index)} />;
|
|
18
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BasicStepNavigator } from "./BasicStepNavigator";
|
|
2
|
+
|
|
3
|
+
const BasicStepNavigatorSource = require("!!raw-loader!./BasicStepNavigator");
|
|
4
|
+
|
|
5
|
+
export const stepNavigator = {
|
|
6
|
+
name: "Step navigator",
|
|
7
|
+
path: "/step-navigator",
|
|
8
|
+
example: {
|
|
9
|
+
component: <BasicStepNavigator />,
|
|
10
|
+
source: BasicStepNavigatorSource.default.toString()
|
|
11
|
+
}
|
|
12
|
+
};
|
package/src/docs/pages.tsx
CHANGED
|
@@ -65,6 +65,7 @@ import { spinner } from "./pages/spinner";
|
|
|
65
65
|
import { stat } from "./pages/stat";
|
|
66
66
|
import { status } from "./pages/status";
|
|
67
67
|
import { statList } from "./pages/statList";
|
|
68
|
+
import { stepNavigator } from "./pages/stepNavigator";
|
|
68
69
|
import { steps } from "./pages/steps";
|
|
69
70
|
import { stepsVertical } from "./pages/stepsVertical";
|
|
70
71
|
import { summary } from "./pages/summary";
|
|
@@ -111,7 +112,7 @@ export const categories: Category[] = [
|
|
|
111
112
|
},
|
|
112
113
|
{
|
|
113
114
|
name: "Navigation",
|
|
114
|
-
pages: [tabs, stepsVertical, steps, chip]
|
|
115
|
+
pages: [tabs, stepsVertical, steps, stepNavigator, chip]
|
|
115
116
|
},
|
|
116
117
|
{
|
|
117
118
|
name: "Content",
|