Skip to content

Commit 3879633

Browse files
authored
Merge pull request #54 from codegouvfr:feature/input-adjustments
Input adjustements
2 parents 710932f + 2cff002 commit 3879633

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Input.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export type InputProps = {
1111
className?: string;
1212
label: ReactNode;
1313
hintText?: ReactNode;
14+
hideLabel?: boolean;
1415
/** default: false */
1516
disabled?: boolean;
1617
iconId?: FrIconClassName | RiIconClassName;
@@ -58,6 +59,7 @@ export const Input = memo(
5859
className,
5960
label,
6061
hintText,
62+
hideLabel,
6163
disabled = false,
6264
iconId: iconId_props,
6365
classes = {},
@@ -88,7 +90,7 @@ export const Input = memo(
8890
<div
8991
className={cx(
9092
fr.cx(
91-
"fr-input-group",
93+
nativeInputProps?.type === "file" ? "fr-upload-group" : "fr-input-group",
9294
disabled && "fr-input-group--disabled",
9395
(() => {
9496
switch (state) {
@@ -109,9 +111,8 @@ export const Input = memo(
109111
{...rest}
110112
>
111113
<label
112-
className={cx(fr.cx("fr-label"), classes.label)}
114+
className={cx(fr.cx("fr-label", hideLabel && "fr-sr-only"), classes.label)}
113115
htmlFor={inputId}
114-
aria-describedby="select-valid-desc-valid"
115116
>
116117
{label}
117118
{hintText !== undefined && <span className="fr-hint-text">{hintText}</span>}

0 commit comments

Comments
 (0)