diff --git a/packages/core/src/CheckBoxGroup/CheckBoxGroup.styles.tsx b/packages/core/src/CheckBoxGroup/CheckBoxGroup.styles.tsx index 7a287d3401..859cf44dd8 100644 --- a/packages/core/src/CheckBoxGroup/CheckBoxGroup.styles.tsx +++ b/packages/core/src/CheckBoxGroup/CheckBoxGroup.styles.tsx @@ -8,7 +8,7 @@ export const { staticClasses, useClasses } = createClasses("HvCheckBoxGroup", { overflowClipMargin: 4, verticalAlign: "top", }, - label: { marginBottom: theme.space.xs }, + label: {}, group: { display: "flex" }, vertical: { flexDirection: "column", diff --git a/packages/core/src/CheckBoxGroup/CheckBoxGroup.tsx b/packages/core/src/CheckBoxGroup/CheckBoxGroup.tsx index 481673f809..c5067142ff 100644 --- a/packages/core/src/CheckBoxGroup/CheckBoxGroup.tsx +++ b/packages/core/src/CheckBoxGroup/CheckBoxGroup.tsx @@ -362,6 +362,7 @@ export const HvCheckBoxGroup = forwardRef( > {label && ( (
{hasLabel && ( (
{hasLabel && ( {hasLabel && ( { {!hideLabels && (
(
{hasLabel && ( { id?: string; /** The text to be shown by the label. */ label?: React.ReactNode; + /** Whether to give label gutter spacing */ + showGutter?: boolean; /** The id of the form element the label is bound to. */ htmlFor?: string; /** If `true` the label is displayed with a disabled style. */ @@ -39,6 +41,7 @@ export const HvLabel = (props: HvLabelProps) => { className, children, label, + showGutter, disabled: disabledProp, required: requiredProp, htmlFor: htmlForProp, @@ -62,8 +65,8 @@ export const HvLabel = (props: HvLabelProps) => { className={cx( classes.root, { - [classes.labelDisabled]: !!disabled, - [classes.childGutter]: !!(children && label), + [classes.labelDisabled]: disabled, + [classes.childGutter]: showGutter || (children && label), }, className, )} diff --git a/packages/core/src/Input/Input.styles.tsx b/packages/core/src/Input/Input.styles.tsx index 6ab1f25053..c69f99f08a 100644 --- a/packages/core/src/Input/Input.styles.tsx +++ b/packages/core/src/Input/Input.styles.tsx @@ -6,7 +6,7 @@ import { suggestionsClasses } from "../FormElement/Suggestions"; export const { staticClasses, useClasses } = createClasses("HvInput", { root: { display: "block" }, labelContainer: { display: "flex", alignItems: "flex-start" }, - label: { paddingBottom: "6px", display: "block" }, + label: {}, description: {}, adornmentsBox: { display: "flex", diff --git a/packages/core/src/Input/Input.tsx b/packages/core/src/Input/Input.tsx index 248876d66d..02569c9951 100644 --- a/packages/core/src/Input/Input.tsx +++ b/packages/core/src/Input/Input.tsx @@ -787,6 +787,7 @@ export const HvInput = fixedForwardRef(function HvInput<
{hasLabel && ( ( > {label && ( {label && ( {label && ( ( > {label && ( (
{hasLabel && ( {hasLabel && ( (
{label && ( ({ HvLabel: { classes: { root: { fontWeight: theme.fontWeights.semibold }, + childGutter: { paddingBottom: 6 }, }, }, HvList: {