@@ -3,19 +3,21 @@ import { Menu, Transition } from '@headlessui/react'
3
3
import { ChevronDownIcon } from '@heroicons/react/20/solid'
4
4
import { DropdownProps , OptionProps } from '../types/dropdown' ;
5
5
import { combineClassNames } from '../../javascript-functions/general' ;
6
+ import { IconClock } from '@tabler/icons' ;
6
7
7
8
8
9
export default function Dropdown ( props : DropdownProps ) {
9
10
const isDisabled = props . disabled || props . options . length < 1 ;
10
11
return (
11
- < Menu as = "div" className = "relative inline-block text-left" >
12
+ < Menu as = "div" className = "relative inline-block text-left w-full " >
12
13
< div >
13
- < Menu . Button className = { `inline-flex w-full justify-center items-center rounded-md border border-gray-300
14
+ < Menu . Button className = { `inline-flex w-full justify-between items-center rounded-md border border-gray-300
14
15
bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2
15
16
focus:ring-gray-300 focus:ring-offset-2 focus:ring-offset-gray-100
16
17
${ isDisabled ? "opacity-50" : "" } ` }
17
18
disabled = { isDisabled }
18
19
>
20
+ { props . hasIconClock ? < IconClock className = "h-5 w-5 text-gray-900" aria-hidden = "true" /> : null }
19
21
{ props . buttonName }
20
22
< ChevronDownIcon
21
23
className = "-mr-1 ml-2 h-5 w-5"
@@ -32,7 +34,7 @@ export default function Dropdown(props: DropdownProps) {
32
34
leaveFrom = "transform opacity-100 scale-100"
33
35
leaveTo = "transform opacity-0 scale-95"
34
36
>
35
- < Menu . Items className = " absolute z-10 mt-2 w-40 origin-top-right rounded-md bg-white shadow-sm ring-1 ring-black ring-opacity-5 focus:outline-none" >
37
+ < Menu . Items className = { ` absolute z-10 mt-2 w-40 origin-top-right rounded-md bg-white shadow-sm ring-1 ring-black ring-opacity-5 focus:outline-none ${ props . itemsClasses ? props . itemsClasses : '' } ` } >
36
38
< div className = "py-1" >
37
39
{ props . options . map ( ( option : OptionProps ) => (
38
40
< div key = { option . id } >
0 commit comments