From a1e8f1e4426ed3560ce1b76fb73a6969388ed253 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Thu, 7 Apr 2022 22:57:15 +0200
Subject: chore: add a SelectWithTooltip component

---
 src/components/atoms/forms/select.tsx | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

(limited to 'src/components/atoms/forms/select.tsx')

diff --git a/src/components/atoms/forms/select.tsx b/src/components/atoms/forms/select.tsx
index e434a82..a42dbda 100644
--- a/src/components/atoms/forms/select.tsx
+++ b/src/components/atoms/forms/select.tsx
@@ -1,13 +1,17 @@
 import { ChangeEvent, FC, SetStateAction } from 'react';
 import styles from './forms.module.scss';
 
-type SelectOptions = {
+export type SelectOptions = {
   id: string;
   name: string;
   value: string;
 };
 
 export type SelectProps = {
+  /**
+   * Set additional classes.
+   */
+  classes?: string;
   /**
    * Field state. Either enabled (false) or disabled (true).
    */
@@ -43,7 +47,12 @@ export type SelectProps = {
  *
  * Render a HTML select element.
  */
-const Select: FC<SelectProps> = ({ options, setValue, ...props }) => {
+const Select: FC<SelectProps> = ({
+  classes = '',
+  options,
+  setValue,
+  ...props
+}) => {
   /**
    * Update select value when an option is selected.
    * @param e - The option change event.
@@ -65,7 +74,7 @@ const Select: FC<SelectProps> = ({ options, setValue, ...props }) => {
 
   return (
     <select
-      className={`${styles.field} ${styles['field--select']}`}
+      className={`${styles.field} ${styles['field--select']} ${classes}`}
       onChange={updateValue}
       {...props}
     >
-- 
cgit v1.2.3

