Improving A11y across pages (#2219)
* Improving Event-Types A11y * Fixing more A11y Issues * Removing Yarn.lock
This commit is contained in:
		
							parent
							
								
									37a10a9638
								
							
						
					
					
						commit
						296697370d
					
				
					 3 changed files with 1252 additions and 729 deletions
				
			
		|  | @ -5,11 +5,11 @@ import utc from "dayjs/plugin/utc"; | ||||||
| import React, { useCallback, useState } from "react"; | import React, { useCallback, useState } from "react"; | ||||||
| import { Controller, useFieldArray } from "react-hook-form"; | import { Controller, useFieldArray } from "react-hook-form"; | ||||||
| 
 | 
 | ||||||
|  | import { useLocale } from "@calcom/lib/hooks/useLocale"; | ||||||
| import Button from "@calcom/ui/Button"; | import Button from "@calcom/ui/Button"; | ||||||
| 
 | 
 | ||||||
| import { defaultDayRange } from "@lib/availability"; | import { defaultDayRange } from "@lib/availability"; | ||||||
| import { weekdayNames } from "@lib/core/i18n/weekday"; | import { weekdayNames } from "@lib/core/i18n/weekday"; | ||||||
| import { useLocale } from "@lib/hooks/useLocale"; |  | ||||||
| import { TimeRange } from "@lib/types/schedule"; | import { TimeRange } from "@lib/types/schedule"; | ||||||
| 
 | 
 | ||||||
| import { useMeQuery } from "@components/Shell"; | import { useMeQuery } from "@components/Shell"; | ||||||
|  | @ -169,6 +169,7 @@ const ScheduleBlock = ({ name, day, weekday }: ScheduleBlockProps) => { | ||||||
|               size="icon" |               size="icon" | ||||||
|               color="minimal" |               color="minimal" | ||||||
|               StartIcon={TrashIcon} |               StartIcon={TrashIcon} | ||||||
|  |               aria-label={t("remove")} | ||||||
|               type="button" |               type="button" | ||||||
|               onClick={() => remove(index)} |               onClick={() => remove(index)} | ||||||
|             /> |             /> | ||||||
|  | @ -183,6 +184,7 @@ const ScheduleBlock = ({ name, day, weekday }: ScheduleBlockProps) => { | ||||||
|           size="icon" |           size="icon" | ||||||
|           className={fields.length > 0 ? "visible" : "invisible"} |           className={fields.length > 0 ? "visible" : "invisible"} | ||||||
|           StartIcon={PlusIcon} |           StartIcon={PlusIcon} | ||||||
|  |           aria-label={t("add")} | ||||||
|           onClick={handleAppend} |           onClick={handleAppend} | ||||||
|         /> |         /> | ||||||
|       </div> |       </div> | ||||||
|  |  | ||||||
|  | @ -784,10 +784,11 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => { | ||||||
|                         locationFormMethods.unregister("locationAddress"); |                         locationFormMethods.unregister("locationAddress"); | ||||||
|                         openLocationModal(location.type); |                         openLocationModal(location.type); | ||||||
|                       }} |                       }} | ||||||
|  |                       aria-label={t("edit")} | ||||||
|                       className="mr-1 p-1 text-gray-500 hover:text-gray-900"> |                       className="mr-1 p-1 text-gray-500 hover:text-gray-900"> | ||||||
|                       <PencilIcon className="h-4 w-4" /> |                       <PencilIcon className="h-4 w-4" /> | ||||||
|                     </button> |                     </button> | ||||||
|                     <button type="button" onClick={() => removeLocation(location)}> |                     <button type="button" onClick={() => removeLocation(location)} aria-label={t("remove")}> | ||||||
|                       <XIcon className="border-l-1 h-6 w-6 pl-1 text-gray-500 hover:text-gray-900 " /> |                       <XIcon className="border-l-1 h-6 w-6 pl-1 text-gray-500 hover:text-gray-900 " /> | ||||||
|                     </button> |                     </button> | ||||||
|                   </div> |                   </div> | ||||||
|  | @ -883,7 +884,10 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => { | ||||||
|                   <div className="space-y-3"> |                   <div className="space-y-3"> | ||||||
|                     <div className="block items-center sm:flex"> |                     <div className="block items-center sm:flex"> | ||||||
|                       <div className="min-w-48 mb-4 sm:mb-0"> |                       <div className="min-w-48 mb-4 sm:mb-0"> | ||||||
|                         <label htmlFor="slug" className="flex text-sm font-medium text-neutral-700"> |                         <label | ||||||
|  |                           id="slug-label" | ||||||
|  |                           htmlFor="slug" | ||||||
|  |                           className="flex text-sm font-medium text-neutral-700"> | ||||||
|                           <LinkIcon className="mt-0.5 h-4 w-4 text-neutral-500 ltr:mr-2 rtl:ml-2" /> |                           <LinkIcon className="mt-0.5 h-4 w-4 text-neutral-500 ltr:mr-2 rtl:ml-2" /> | ||||||
|                           {t("url")} |                           {t("url")} | ||||||
|                         </label> |                         </label> | ||||||
|  | @ -896,6 +900,8 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => { | ||||||
|                           </span> |                           </span> | ||||||
|                           <input |                           <input | ||||||
|                             type="text" |                             type="text" | ||||||
|  |                             id="slug" | ||||||
|  |                             aria-labelledby="slug-label" | ||||||
|                             required |                             required | ||||||
|                             className="focus:border-primary-500 focus:ring-primary-500 block w-full min-w-0 flex-1 rounded-none rounded-r-sm border-gray-300 sm:text-sm" |                             className="focus:border-primary-500 focus:ring-primary-500 block w-full min-w-0 flex-1 rounded-none rounded-r-sm border-gray-300 sm:text-sm" | ||||||
|                             defaultValue={eventType.slug} |                             defaultValue={eventType.slug} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 sean-brydon
						sean-brydon