-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cards.jsx
131 lines (125 loc) · 3.87 KB
/
Cards.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
This example requires some changes to your config:
```
// tailwind.config.js
const colors = require('tailwindcss/colors')
module.exports = {
// ...
theme: {
extend: {
colors: {
sky: colors.sky,
teal: colors.teal,
rose: colors.rose,
},
},
},
}
```
*/
import {
AcademicCapIcon,
BanknotesIcon,
CheckBadgeIcon,
ClockIcon,
ReceiptRefundIcon,
UsersIcon
} from '@heroicons/react/24/outline'
const actions = [
{
title: 'Request time off',
href: '#',
icon: ClockIcon,
iconForeground: 'text-teal-700',
iconBackground: 'bg-teal-50',
},
{
title: 'Benefits',
href: '#',
icon: CheckBadgeIcon,
iconForeground: 'text-purple-700',
iconBackground: 'bg-purple-50',
},
{
title: 'Schedule a one-on-one',
href: '#',
icon: UsersIcon,
iconForeground: 'text-sky-700',
iconBackground: 'bg-sky-50',
},
{
title: 'Payroll',
href: '#',
icon: BanknotesIcon,
iconForeground: 'text-yellow-700',
iconBackground: 'bg-yellow-50',
},
{
title: 'Submit an expense',
href: '#',
icon: ReceiptRefundIcon,
iconForeground: 'text-rose-700',
iconBackground: 'bg-rose-50',
},
{
title: 'Training',
href: '#',
icon: AcademicCapIcon,
iconForeground: 'text-indigo-700',
iconBackground: 'bg-indigo-50',
},
]
function classNames(...classes) {
return classes.filter(Boolean).join(' ')
}
export default function Cards() {
return (
<div className="divide-y divide-gray-200 overflow-hidden rounded-lg bg-gray-200 shadow sm:grid sm:grid-cols-2 sm:gap-px sm:divide-y-0">
{actions.map((action, actionIdx) => (
<div
key={action.title}
className={classNames(
actionIdx === 0 ? 'rounded-tl-lg rounded-tr-lg sm:rounded-tr-none' : '',
actionIdx === 1 ? 'sm:rounded-tr-lg' : '',
actionIdx === actions.length - 2 ? 'sm:rounded-bl-lg' : '',
actionIdx === actions.length - 1 ? 'rounded-bl-lg rounded-br-lg sm:rounded-bl-none' : '',
'relative group bg-white p-6 focus-within:ring-2 focus-within:ring-inset focus-within:ring-indigo-500'
)}
>
<div>
<span
className={classNames(
action.iconBackground,
action.iconForeground,
'rounded-lg inline-flex p-3 ring-4 ring-white'
)}
>
<action.icon className="h-6 w-6" aria-hidden="true" />
</span>
</div>
<div className="mt-8">
<h3 className="text-lg font-medium">
<a href={action.href} className="focus:outline-none">
{/* Extend touch target to entire panel */}
<span className="absolute inset-0" aria-hidden="true" />
{action.title}
</a>
</h3>
<p className="mt-2 text-sm text-gray-500">
Doloribus dolores nostrum quia qui natus officia quod et dolorem. Sit repellendus qui ut at blanditiis et
quo et molestiae.
</p>
</div>
<span
className="pointer-events-none absolute top-6 right-6 text-gray-300 group-hover:text-gray-400"
aria-hidden="true"
>
<svg className="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24">
<path d="M20 4h1a1 1 0 00-1-1v1zm-1 12a1 1 0 102 0h-2zM8 3a1 1 0 000 2V3zM3.293 19.293a1 1 0 101.414 1.414l-1.414-1.414zM19 4v12h2V4h-2zm1-1H8v2h12V3zm-.707.293l-16 16 1.414 1.414 16-16-1.414-1.414z" />
</svg>
</span>
</div>
))}
</div>
)
}