Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type InputProps = {
className?: string;
label: ReactNode;
hintText?: ReactNode;
hideLabel?: boolean;
/** default: false */
disabled?: boolean;
iconId?: FrIconClassName | RiIconClassName;
Expand Down Expand Up @@ -58,6 +59,7 @@ export const Input = memo(
className,
label,
hintText,
hideLabel,
disabled = false,
iconId: iconId_props,
classes = {},
Expand Down Expand Up @@ -88,7 +90,7 @@ export const Input = memo(
<div
className={cx(
fr.cx(
"fr-input-group",
nativeInputProps?.type === "file" ? "fr-upload-group" : "fr-input-group",
disabled && "fr-input-group--disabled",
(() => {
switch (state) {
Expand All @@ -109,9 +111,8 @@ export const Input = memo(
{...rest}
>
<label
className={cx(fr.cx("fr-label"), classes.label)}
className={cx(fr.cx("fr-label", hideLabel && "fr-sr-only"), classes.label)}
htmlFor={inputId}
aria-describedby="select-valid-desc-valid"
>
{label}
{hintText !== undefined && <span className="fr-hint-text">{hintText}</span>}
Expand Down