@vectara/vectara-ui 9.14.1 → 9.15.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.
@@ -2,6 +2,7 @@ type Props = {
2
2
  className?: string;
3
3
  labelFor?: string;
4
4
  children: React.ReactNode;
5
+ size?: "xs" | "s";
5
6
  };
6
- export declare const VuiLabel: ({ className, labelFor, children, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const VuiLabel: ({ className, labelFor, children, size, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import classNames from "classnames";
14
14
  export const VuiLabel = (_a) => {
15
- var { className, labelFor, children } = _a, rest = __rest(_a, ["className", "labelFor", "children"]);
16
- const classes = classNames("vuiLabel", className);
15
+ var { className, labelFor, children, size = "s" } = _a, rest = __rest(_a, ["className", "labelFor", "children", "size"]);
16
+ const classes = classNames("vuiLabel", `vuiLabel--${size}`, className);
17
17
  return (_jsx("label", Object.assign({ className: classes, htmlFor: labelFor }, rest, { children: children })));
18
18
  };
@@ -1,5 +1,12 @@
1
1
  .vuiLabel {
2
- font-size: $labelFontSize;
3
2
  font-weight: $labelFontWeight;
4
3
  color: $labelColor;
5
4
  }
5
+
6
+ .vuiLabel--xs {
7
+ font-size: $fontSizeSmall;
8
+ }
9
+
10
+ .vuiLabel--s {
11
+ font-size: $fontSizeStandard;
12
+ }
@@ -1,10 +1,11 @@
1
1
  type Props = {
2
2
  labelFor: string;
3
3
  label: string;
4
+ labelSize?: "s" | "xs";
4
5
  children: React.ReactElement;
5
6
  helpText?: React.ReactNode;
6
7
  errors?: string[];
7
8
  isRequired?: boolean;
8
9
  };
9
- export declare const VuiFormGroup: ({ children, labelFor, helpText, label, errors, isRequired }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const VuiFormGroup: ({ children, labelFor, helpText, label, labelSize, errors, isRequired }: Props) => import("react/jsx-runtime").JSX.Element;
10
11
  export {};
@@ -10,7 +10,7 @@ import { VuiNumberInput } from "../form/input/NumberInput";
10
10
  import { VuiTextArea } from "../form/textArea/TextArea";
11
11
  import { VuiSelect } from "../form/select/Select";
12
12
  const VALIDATION_ALLOWLIST = [VuiTextInput, VuiNumberInput, VuiTextArea, VuiSelect];
13
- export const VuiFormGroup = ({ children, labelFor, helpText, label, errors, isRequired }) => {
13
+ export const VuiFormGroup = ({ children, labelFor, helpText, label, labelSize = "s", errors, isRequired }) => {
14
14
  const ariaProps = {
15
15
  "aria-describedby": ""
16
16
  };
@@ -33,5 +33,5 @@ export const VuiFormGroup = ({ children, labelFor, helpText, label, errors, isRe
33
33
  cloneProps.isInvalid = errors && errors.length > 0;
34
34
  }
35
35
  const content = cloneElement(children, cloneProps);
36
- return (_jsxs("div", { children: [_jsxs(VuiLabel, Object.assign({ labelFor: labelFor }, { children: [label, isRequired && " (required)"] })), _jsx(VuiSpacer, { size: "xs" }), helpText && (_jsxs(_Fragment, { children: [_jsx(VuiText, Object.assign({ size: "xs", id: ariaDescribedByLabel }, { children: _jsx("p", { children: _jsx(VuiTextColor, Object.assign({ color: "subdued" }, { children: helpText })) }) })), _jsx(VuiSpacer, { size: "xs" })] })), errorMessages && (_jsxs(_Fragment, { children: [errorMessages, _jsx(VuiSpacer, { size: "xs" })] })), content] }));
36
+ return (_jsxs("div", { children: [_jsxs(VuiLabel, Object.assign({ labelFor: labelFor, size: labelSize }, { children: [label, isRequired && " (required)"] })), _jsx(VuiSpacer, { size: labelSize === "s" ? "xs" : "xxs" }), helpText && (_jsxs(_Fragment, { children: [_jsx(VuiText, Object.assign({ size: "xs", id: ariaDescribedByLabel }, { children: _jsx("p", { children: _jsx(VuiTextColor, Object.assign({ color: "subdued" }, { children: helpText })) }) })), _jsx(VuiSpacer, { size: "xs" })] })), errorMessages && (_jsxs(_Fragment, { children: [errorMessages, _jsx(VuiSpacer, { size: "xs" })] })), content] }));
37
37
  };
@@ -13,7 +13,7 @@ $size: (
13
13
  color: $colorText
14
14
  ),
15
15
  xs: (
16
- size: $labelFontSize,
16
+ size: $fontSizeStandard,
17
17
  line-height: 1.4,
18
18
  weight: $labelFontWeight,
19
19
  color: $labelColor
@@ -17,6 +17,5 @@ $fontWeightStrong: 500;
17
17
  $fontWeightBold: 600;
18
18
  $fontWeightHeavy: 800;
19
19
 
20
- $labelFontSize: $fontSizeStandard;
21
20
  $labelFontWeight: $fontWeightBold;
22
21
  $labelColor: $colorText;
@@ -2582,11 +2582,18 @@ h2.react-datepicker__current-month {
2582
2582
  }
2583
2583
 
2584
2584
  .vuiLabel {
2585
- font-size: 14px;
2586
2585
  font-weight: 600;
2587
2586
  color: #1c1d22;
2588
2587
  }
2589
2588
 
2589
+ .vuiLabel--xs {
2590
+ font-size: 12px;
2591
+ }
2592
+
2593
+ .vuiLabel--s {
2594
+ font-size: 14px;
2595
+ }
2596
+
2590
2597
  .vuiRadioButtonLabel {
2591
2598
  font-size: 14px;
2592
2599
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectara/vectara-ui",
3
- "version": "9.14.1",
3
+ "version": "9.15.0",
4
4
  "homepage": "./",
5
5
  "description": "Vectara's design system, codified as a React and Sass component library",
6
6
  "author": "Vectara",