Skip to content

Commit

Permalink
feat: add info
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgfr committed Jan 7, 2025
1 parent 3a649c9 commit 150b000
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type SelectProps = {
/** Default: false */
disabled?: boolean;
/** Default: "default" */
state?: "success" | "error" | "default";
state?: "success" | "error" | "info" | "default";
/** The message won't be displayed if state is "default" */
stateRelatedMessage?: ReactNode;
style?: CSSProperties;
Expand Down Expand Up @@ -79,6 +79,8 @@ export const Select = memo(
return "fr-select-group--error";
case "success":
return "fr-select-group--valid";
case "info":
return "fr-select-group--info";
case "default":
return undefined;
}
Expand Down Expand Up @@ -119,6 +121,8 @@ export const Select = memo(
return "fr-error-text";
case "success":
return "fr-valid-text";
case "info":
return "fr-info-text";
}
assert<Equals<typeof state, never>>(false);
})()
Expand Down
6 changes: 5 additions & 1 deletion src/shared/Fieldset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export namespace FieldsetProps {
/** Default: "vertical" */
orientation?: "vertical" | "horizontal";
/** Default: "default" */
state?: "success" | "error" | "default";
state?: "success" | "error" | "info" | "default";
/**
* The message won't be displayed if state is "default".
* If the state is "error" providing a message is mandatory
Expand Down Expand Up @@ -121,6 +121,8 @@ export const Fieldset = memo(
return "fr-fieldset--error";
case "success":
return "fr-fieldset--valid";
case "info":
return "fr-fieldset--info";
}
})()
),
Expand Down Expand Up @@ -204,6 +206,8 @@ export const Fieldset = memo(
return "fr-message--error";
case "success":
return "fr-message--valid";
case "info":
return "fr-message--info";
}
})()
)}
Expand Down

0 comments on commit 150b000

Please sign in to comment.