Checkbox for analytics opt in & settings redesign (#934)
This commit is contained in:
parent
2454daeef9
commit
0423a494c4
18 changed files with 154 additions and 65 deletions
|
|
@ -209,3 +209,7 @@ limitations under the License.
|
|||
margin-left: 26px;
|
||||
width: 100%; /* Ensure that it breaks onto the next row */
|
||||
}
|
||||
|
||||
.description.noLabel {
|
||||
margin-top: -20px; /* Ensures that there is no weired spacing if the checkbox doesn't have a label */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,14 +55,14 @@ export function Field({ children, className }: FieldProps): JSX.Element {
|
|||
}
|
||||
|
||||
interface InputFieldProps {
|
||||
label: string;
|
||||
label?: string;
|
||||
type: string;
|
||||
prefix?: string;
|
||||
suffix?: string;
|
||||
id?: string;
|
||||
checked?: boolean;
|
||||
className?: string;
|
||||
description?: string;
|
||||
description?: string | ReactNode;
|
||||
disabled?: boolean;
|
||||
required?: boolean;
|
||||
// this is a hack. Those variables should be part of `HTMLAttributes<HTMLInputElement> | HTMLAttributes<HTMLTextAreaElement>`
|
||||
|
|
@ -140,7 +140,14 @@ export const InputField = forwardRef<
|
|||
</label>
|
||||
{suffix && <span>{suffix}</span>}
|
||||
{description && (
|
||||
<p id={descriptionId} className={styles.description}>
|
||||
<p
|
||||
id={descriptionId}
|
||||
className={
|
||||
label
|
||||
? styles.description
|
||||
: classNames(styles.description, styles.noLabel)
|
||||
}
|
||||
>
|
||||
{description}
|
||||
</p>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue