@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.
- package/lib/components/form/label/Label.d.ts +2 -1
- package/lib/components/form/label/Label.js +2 -2
- package/lib/components/form/label/_index.scss +8 -1
- package/lib/components/formGroup/FormGroup.d.ts +2 -1
- package/lib/components/formGroup/FormGroup.js +2 -2
- package/lib/components/typography/_title.scss +1 -1
- package/lib/sassUtils/_typography.scss +0 -1
- package/lib/styles/index.css +8 -1
- package/package.json +1 -1
|
@@ -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,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
|
};
|
package/lib/styles/index.css
CHANGED
|
@@ -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
|
}
|