@vectara/vectara-ui 9.2.6 → 9.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,5 +42,5 @@ export const VuiStep = ({ title, status = "incomplete", subTitle, onClick, stepN
42
42
  if (isClickable) {
43
43
  return (_jsx("button", Object.assign({ className: stepContainerClasses, onKeyDown: handleKeyDown, onClick: handleClick, type: "button", "aria-current": status === "current" ? "step" : undefined, "data-testid": dataTestId, "data-status": status }, { children: stepContent })));
44
44
  }
45
- return (_jsx("div", Object.assign({ className: stepContainerClasses, "aria-current": status === "current" ? "step" : undefined }, { children: stepContent })));
45
+ return (_jsx("div", Object.assign({ className: stepContainerClasses, "aria-current": status === "current" ? "step" : undefined, "data-testid": dataTestId }, { children: stepContent })));
46
46
  };
@@ -32,7 +32,7 @@ export const VuiSteps = (_a) => {
32
32
  const totalSteps = steps.length;
33
33
  const currentStepIndex = steps.findIndex((step) => step.status === "current");
34
34
  return (_jsx("div", Object.assign({ className: classes, "data-testid": dataTestId }, rest, { children: _jsx("div", Object.assign({ className: "vuiSteps__container" }, { children: steps.map((step, index) => {
35
- var _a, _b, _c;
35
+ var _a, _b, _c, _d;
36
36
  const isFirstStep = index === 0;
37
37
  const isLastStep = index === totalSteps - 1;
38
38
  const stepContainerClasses = classNames("vuiSteps__stepContainer", {
@@ -42,6 +42,6 @@ export const VuiSteps = (_a) => {
42
42
  const icon = (_a = step.icon) !== null && _a !== void 0 ? _a : (step.status === "complete" ? (_jsx(BiCheck, {})) : step.status === "danger" ? (_jsx(BiError, {})) : step.status === "warning" ? (_jsx(BiSolidHand, {})) : null);
43
43
  return (_jsxs("div", Object.assign({ className: stepContainerClasses }, { children: [!isLastStep && (_jsx("div", { className: classNames("vuiSteps__connector", {
44
44
  "vuiSteps__connector--complete": index < currentStepIndex
45
- }) })), _jsx(VuiStep, { title: step.title, status: step.status, onClick: step.onClick, "data-testid": `${dataTestId}-step-${index}`, stepNode: step.status === "loading" ? (_jsx("div", { children: _jsx(VuiSpinner, {}) })) : icon ? (_jsx(VuiIcon, Object.assign({ color: statusToColor[(_b = step.status) !== null && _b !== void 0 ? _b : "incomplete"], size: size === "xs" ? undefined : size }, { children: icon }))) : size === "xs" ? null : (_jsx("span", Object.assign({ className: "vuiStep__numberText" }, { children: (_c = step.value) !== null && _c !== void 0 ? _c : index + 1 }))), size: size, subTitle: step.subTitle })] }), index));
45
+ }) })), _jsx(VuiStep, { title: step.title, status: step.status, onClick: step.onClick, "data-testid": (_b = step["data-testid"]) !== null && _b !== void 0 ? _b : `${dataTestId}-step-${index}`, stepNode: step.status === "loading" ? (_jsx("div", { children: _jsx(VuiSpinner, {}) })) : icon ? (_jsx(VuiIcon, Object.assign({ color: statusToColor[(_c = step.status) !== null && _c !== void 0 ? _c : "incomplete"], size: size === "xs" ? undefined : size }, { children: icon }))) : size === "xs" ? null : (_jsx("span", Object.assign({ className: "vuiStep__numberText" }, { children: (_d = step.value) !== null && _d !== void 0 ? _d : index + 1 }))), size: size, subTitle: step.subTitle })] }), index));
46
46
  }) })) })));
47
47
  };
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  type Props = {
3
3
  children: React.ReactNode;
4
+ spacing?: "none" | "s" | "m" | "l";
4
5
  };
5
- export declare const VuiTimeline: ({ children }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const VuiTimeline: ({ children, spacing }: Props) => import("react/jsx-runtime").JSX.Element;
6
7
  export {};
@@ -1,11 +1,13 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import classNames from "classnames";
3
3
  import React from "react";
4
- export const VuiTimeline = ({ children }) => {
4
+ export const VuiTimeline = ({ children, spacing = "m" }) => {
5
5
  const childrenCount = React.Children.count(children);
6
6
  const wrappedChildren = React.Children.map(children, (child, index) => {
7
7
  const isLast = index === childrenCount - 1;
8
- const classes = classNames("vuiTimelineContainer", { "vuiTimelineContainer--bordered": !isLast });
8
+ const classes = classNames("vuiTimelineContainer", `vuiTimelineContainer--spacing-${spacing}`, {
9
+ "vuiTimelineContainer--bordered": !isLast
10
+ });
9
11
  return _jsx("div", Object.assign({ className: classes }, { children: child }));
10
12
  });
11
13
  return _jsx(_Fragment, { children: wrappedChildren });
@@ -3,9 +3,24 @@ $iconWidth: 36px;
3
3
  .vuiTimelineContainer {
4
4
  margin-left: $iconWidth;
5
5
  border-left: 1px solid transparent;
6
+ }
7
+
8
+ .vuiTimelineContainer--spacing-none {
9
+ padding-bottom: 0;
10
+ }
11
+
12
+ .vuiTimelineContainer--spacing-s {
13
+ padding-bottom: $sizeS;
14
+ }
15
+
16
+ .vuiTimelineContainer--spacing-m {
6
17
  padding-bottom: $sizeM;
7
18
  }
8
19
 
20
+ .vuiTimelineContainer--spacing-l {
21
+ padding-bottom: $sizeL;
22
+ }
23
+
9
24
  .vuiTimelineContainer--bordered {
10
25
  border-left: 2px solid $borderColorLight;
11
26
  }
@@ -4342,9 +4342,24 @@ h2.react-datepicker__current-month {
4342
4342
  .vuiTimelineContainer {
4343
4343
  margin-left: 36px;
4344
4344
  border-left: 1px solid transparent;
4345
+ }
4346
+
4347
+ .vuiTimelineContainer--spacing-none {
4348
+ padding-bottom: 0;
4349
+ }
4350
+
4351
+ .vuiTimelineContainer--spacing-s {
4352
+ padding-bottom: 12px;
4353
+ }
4354
+
4355
+ .vuiTimelineContainer--spacing-m {
4345
4356
  padding-bottom: 16px;
4346
4357
  }
4347
4358
 
4359
+ .vuiTimelineContainer--spacing-l {
4360
+ padding-bottom: 24px;
4361
+ }
4362
+
4348
4363
  .vuiTimelineContainer--bordered {
4349
4364
  border-left: 2px solid #e3e4f3;
4350
4365
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectara/vectara-ui",
3
- "version": "9.2.6",
3
+ "version": "9.3.1",
4
4
  "homepage": "./",
5
5
  "description": "Vectara's design system, codified as a React and Sass component library",
6
6
  "author": "Vectara",