# Calendar quick event popover

> Click an empty slot in the week and a bubble anchored to it lets you give the event a title and a color.

- Category: [Overlays](https://library.aimran.es/components/overlays)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-ov-calendar-quick-event
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Creating an event should not mean leaving the calendar, so this popover opens right next to the slot you click. It reads the day and hour from the grid headers, flips sides when there is no room and points its arrow at the cell. Saving drops a colored block into the slot, which you can click again to edit. It fits schedulers, booking tools and team planners.

The main color marks today, the save button and the selection ring. Move around the grid with the arrow keys, press Enter in the title to save, and Escape cancels with focus back on the cell that opened it.

## Code

### HTML

```html
<div class="uvq13-cal"><div class="cal" role="group" aria-label="Week of 27 October"><span></span><span class="dh" id="uvq13-cal-d0"><span>Monday</span> <b>27</b></span><span class="dh td" id="uvq13-cal-d1"><span>Tuesday</span> <b>28</b></span><span class="dh" id="uvq13-cal-d2"><span>Wednesday</span> <b>29</b></span><span class="dh" id="uvq13-cal-d3"><span>Thursday</span> <b>30</b></span><span class="hh" id="uvq13-cal-h0">9:00</span><button type="button" class="cell" data-h="0" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d0 uvq13-cal-h0"></button><button type="button" class="cell" data-h="0" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d1 uvq13-cal-h0"></button><button type="button" class="cell" data-h="0" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d2 uvq13-cal-h0"></button><button type="button" class="cell" data-h="0" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d3 uvq13-cal-h0"><span class="ev" style="--c:#f59e0b"><b>Dentist</b><small>9:00</small></span></button><span class="hh" id="uvq13-cal-h1">10:00</span><button type="button" class="cell" data-h="1" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d0 uvq13-cal-h1"></button><button type="button" class="cell" data-h="1" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d1 uvq13-cal-h1"><span class="ev" style="--c:#14b8a6"><b>Design</b><small>10:00</small></span></button><button type="button" class="cell" data-h="1" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d2 uvq13-cal-h1"></button><button type="button" class="cell" data-h="1" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d3 uvq13-cal-h1"></button><span class="hh" id="uvq13-cal-h2">11:00</span><button type="button" class="cell" data-h="2" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d0 uvq13-cal-h2"></button><button type="button" class="cell" data-h="2" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d1 uvq13-cal-h2"></button><button type="button" class="cell" data-h="2" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d2 uvq13-cal-h2"></button><button type="button" class="cell" data-h="2" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d3 uvq13-cal-h2"></button><span class="hh" id="uvq13-cal-h3">12:00</span><button type="button" class="cell" data-h="3" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d0 uvq13-cal-h3"></button><button type="button" class="cell" data-h="3" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d1 uvq13-cal-h3"></button><button type="button" class="cell" data-h="3" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d2 uvq13-cal-h3"><span class="ev" style="--c:#e2553f"><b>Lunch with Leo</b><small>12:00</small></span></button><button type="button" class="cell" data-h="3" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d3 uvq13-cal-h3"></button></div><div class="po" role="dialog" aria-modal="true" aria-labelledby="uvq13-cal-pt"><p class="pt" id="uvq13-cal-pt">New event</p><input class="nm" placeholder="Add title" aria-label="Event title" autocomplete="off"><p class="wh"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="8.5"/><path d="M12 7.5V12l3 2"/></svg><span class="when"></span></p><div class="cs" role="radiogroup" aria-label="Color"><button type="button" role="radio" aria-checked="true" aria-label="Coral" style="--c:#e2553f"></button><button type="button" role="radio" aria-checked="false" aria-label="Teal" style="--c:#14b8a6"></button><button type="button" role="radio" aria-checked="false" aria-label="Amber" style="--c:#f59e0b"></button><button type="button" role="radio" aria-checked="false" aria-label="Indigo" style="--c:#6366f1"></button></div><div class="ac"><button type="button" class="cn">Cancel</button><button type="button" class="ok">Save</button></div><span class="nt" hidden>Untitled</span></div></div>
```

### CSS

```css
.uvq13-cal {
  --c1: #e2553f;
  --c2: #fde6df;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq13-cal {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  width: 22em;
  height: 17em;
  border-radius: 1.2em;
  overflow: hidden;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-cal .cal {
  position: absolute;
  inset: .9em;
  display: grid;
  grid-template-columns: 2.3em repeat(4,1fr);
  grid-template-rows: 2.6em repeat(4,1fr);
  gap: .28em;
}

.uvq13-cal .dh {
  display: grid;
  place-items: center;
  align-content: center;
  gap: .15em;
  font-size: .64em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  line-height: 1;
}

.uvq13-cal .dh b {
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  font-size: 1.45em;
  font-weight: 750;
  color: var(--fg);
}

.uvq13-cal .td,.uvq13-cal .td b {
  color: var(--c1);
}

.uvq13-cal .td b {
  color: #fff;
  background: var(--c1);
}

.uvq13-cal .hh {
  padding: .25em .45em 0 0;
  font-size: .6em;
  text-align: right;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  font-variant-numeric: tabular-nums;
}

.uvq13-cal .cell {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  min-height: 0;
  border-radius: .5em;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
  transition: background calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-cal .cell:empty:hover {
  background: color-mix(in srgb,var(--c1) 10%,transparent);
}

.uvq13-cal .cell:empty:hover::after {
  content: "+";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--c1);
}

.uvq13-cal .cell.sel {
  box-shadow: inset 0 0 0 2px var(--c1);
}

.uvq13-cal .ev {
  position: absolute;
  inset: .15em;
  display: flex;
  flex-direction: column;
  padding: .3em .4em;
  border-radius: .4em;
  overflow: hidden;
  font-size: .6em;
  line-height: 1.25;
  text-align: left;
  color: color-mix(in srgb,var(--c) 55%,var(--fg));
  background: color-mix(in srgb,var(--c) 22%,var(--bg));
  box-shadow: inset .22em 0 0 var(--c);
}

.uvq13-cal .ev b {
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uvq13-cal .ev small {
  opacity: .8;
}

.uvq13-cal .ev.new {
  animation: uvq13-cal-p calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-cal .po {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  width: 10.5em;
  padding: .8em;
  border-radius: .9em;
  background: color-mix(in srgb,var(--fg) 2%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent),0 1.6em 3.2em -1.2em rgba(0,0,0,.5);
  opacity: 0;
  transform: scale(.94);
  pointer-events: none;
  transition: opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-cal.open .po {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.uvq13-cal .po::before {
  content: "";
  position: absolute;
  top: var(--ay,2em);
  width: .75em;
  height: .75em;
  background: inherit;
  transform: rotate(45deg);
}

.uvq13-cal .po.r {
  transform-origin: 0 50%;
}

.uvq13-cal .po.l {
  transform-origin: 100% 50%;
}

.uvq13-cal .po.r::before {
  left: -.38em;
  box-shadow: -1px 1px 0 color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-cal .po.l::before {
  right: -.38em;
  box-shadow: 1px -1px 0 color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-cal .pt {
  margin: 0 0 .4em;
  font-size: .62em;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-cal .nm {
  box-sizing: border-box;
  width: 100%;
  padding: .15em 0 .3em;
  border: 0;
  border-bottom: 2px solid color-mix(in srgb,var(--fg) 9%,transparent);
  outline: 0;
  background: none;
  font: inherit;
  font-size: .95em;
  font-weight: 700;
  color: var(--fg);
}

.uvq13-cal .nm::placeholder {
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  font-weight: 500;
}

.uvq13-cal .nm:focus {
  border-bottom-color: var(--c1);
}

.uvq13-cal .wh {
  display: flex;
  align-items: center;
  gap: .35em;
  margin: .55em 0;
  font-size: .66em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-cal .wh svg {
  flex: none;
  width: 1.1em;
  height: 1.1em;
}

.uvq13-cal .cs {
  display: flex;
  gap: .5em;
}

.uvq13-cal .cs button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  width: 1.25em;
  height: 1.25em;
  border-radius: 50%;
  background: var(--c);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-cal .cs button:hover {
  transform: scale(1.12);
}

.uvq13-cal .cs [aria-checked="true"] {
  box-shadow: 0 0 0 2px var(--bg),0 0 0 3.5px var(--c);
}

.uvq13-cal .ac {
  display: flex;
  justify-content: flex-end;
  gap: .35em;
  margin-top: .75em;
}

.uvq13-cal .ac button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .5em .8em;
  border-radius: .5em;
  font-size: .72em;
  font-weight: 700;
}

.uvq13-cal .ac .cn {
  background: color-mix(in srgb,var(--fg) 6%,transparent);
}

.uvq13-cal .ac .ok {
  color: #fff;
  background: var(--c1);
}

.uvq13-cal button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq13-cal-p {
  from {
    transform: scale(.6);
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq13-cal,.uvq13-cal *,.uvq13-cal *::before,.uvq13-cal *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### JavaScript

```js
document.querySelectorAll(".uvq13-cal").forEach(el => {
  const po=el.querySelector(".po"),nm=po.querySelector(".nm"),wh=po.querySelector(".when"),cs=[...po.querySelectorAll(".cs button")],nt=po.querySelector(".nt"),cells=[...el.querySelectorAll(".cell")];let cur=null,tms=[];const later=(f,ms)=>tms.push(setTimeout(f,ms));
const isO=()=>el.classList.contains("open");
const sc=()=>el.getBoundingClientRect().width/el.offsetWidth||1;
const col=()=>cs.find(b=>b.getAttribute("aria-checked")==="true")||cs[0];
const pick=b=>cs.forEach(x=>{x.setAttribute("aria-checked",String(x===b));x.tabIndex=x===b?0:-1});
const place=c=>{const s=sc(),R=el.getBoundingClientRect(),r=c.getBoundingClientRect(),x=(r.left-R.left)/s,y=(r.top-R.top)/s,w=r.width/s,h=r.height/s,W=el.clientWidth,H=el.clientHeight,pw=po.offsetWidth,ph=po.offsetHeight,g=10;let left=x+w+g,side="r";if(left+pw>W-6){left=x-pw-g;side="l"}const top=Math.max(6,Math.min(H-ph-6,y+h/2-ph/2));po.style.left=left+"px";po.style.top=top+"px";po.style.setProperty("--ay",Math.max(8,Math.min(ph-20,y+h/2-top-6))+"px");po.className="po "+side};
const open=(c,u)=>{if(cur)cur.classList.remove("sel");cur=c;c.classList.add("sel");const ids=c.getAttribute("aria-labelledby").split(" "),d=el.querySelector("#"+ids[0]),hh=el.querySelector("#"+ids[1]);wh.textContent=d.textContent.replace(/\s+/g," ").trim()+" · "+hh.textContent+" – "+(+c.dataset.h+10)+":00";const ev=c.querySelector(".ev");nm.value=ev?ev.querySelector("b").textContent:"";pick(ev&&cs.find(x=>x.style.getPropertyValue("--c")===ev.style.getPropertyValue("--c"))||cs[0]);place(c);el.classList.add("open");po.inert=false;u&&later(()=>nm.focus({preventScroll:true}),60)};
const close=back=>{if(!isO())return;el.classList.remove("open");po.inert=true;if(cur){cur.classList.remove("sel");back&&cur.focus({preventScroll:true})}};
const save=()=>{if(!cur)return;const t=nm.value.trim()||nt.textContent;let ev=cur.querySelector(".ev");if(!ev){ev=document.createElement("span");ev.className="ev";ev.append(document.createElement("b"),document.createElement("small"));cur.appendChild(ev)}ev.style.setProperty("--c",col().style.getPropertyValue("--c"));ev.querySelector("b").textContent=t;ev.querySelector("small").textContent=(+cur.dataset.h+9)+":00";ev.classList.remove("new");void ev.offsetWidth;ev.classList.add("new");close(true)};
cells.forEach(c=>c.addEventListener("click",()=>open(c,true)));
po.querySelector(".ok").addEventListener("click",save);po.querySelector(".cn").addEventListener("click",()=>close(true));
nm.addEventListener("keydown",e=>{if(e.key==="Enter"){e.preventDefault();save()}});
cs.forEach((b,i)=>{b.addEventListener("click",()=>pick(b));b.addEventListener("keydown",e=>{const m={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];if(m){e.preventDefault();const n=cs[(i+m+cs.length)%cs.length];pick(n);n.focus()}})});
el.addEventListener("keydown",e=>{if(isO()){if(e.key==="Escape"){e.preventDefault();e.stopPropagation();close(true)}else if(e.key==="Tab"){const f=[nm,...cs.filter(b=>b.tabIndex===0),...po.querySelectorAll(".ac button")],a=f[0],z=f[f.length-1],ac=document.activeElement;if(e.shiftKey&&(ac===a||!po.contains(ac))){e.preventDefault();z.focus()}else if(!e.shiftKey&&(ac===z||!po.contains(ac))){e.preventDefault();a.focus()}}return}const i=cells.indexOf(document.activeElement),m={ArrowRight:1,ArrowLeft:-1,ArrowDown:4,ArrowUp:-4}[e.key];if(i>-1&&m&&cells[i+m]){e.preventDefault();cells[i+m].focus()}});
el.addEventListener("pointerdown",e=>{if(isO()&&!po.contains(e.target)&&!e.target.closest(".cell"))close(false)});
po.inert=true;pick(cs[0]);later(()=>open(cells[4],false),600);return()=>tms.forEach(clearTimeout)
});
```

### React

```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq13-cal {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  width: 22em;
  height: 17em;
  border-radius: 1.2em;
  overflow: hidden;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-cal .cal {
  position: absolute;
  inset: .9em;
  display: grid;
  grid-template-columns: 2.3em repeat(4,1fr);
  grid-template-rows: 2.6em repeat(4,1fr);
  gap: .28em;
}

.uvq13-cal .dh {
  display: grid;
  place-items: center;
  align-content: center;
  gap: .15em;
  font-size: .64em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  line-height: 1;
}

.uvq13-cal .dh b {
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  font-size: 1.45em;
  font-weight: 750;
  color: var(--fg);
}

.uvq13-cal .td,.uvq13-cal .td b {
  color: var(--c1);
}

.uvq13-cal .td b {
  color: #fff;
  background: var(--c1);
}

.uvq13-cal .hh {
  padding: .25em .45em 0 0;
  font-size: .6em;
  text-align: right;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  font-variant-numeric: tabular-nums;
}

.uvq13-cal .cell {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  min-height: 0;
  border-radius: .5em;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
  transition: background calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-cal .cell:empty:hover {
  background: color-mix(in srgb,var(--c1) 10%,transparent);
}

.uvq13-cal .cell:empty:hover::after {
  content: "+";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--c1);
}

.uvq13-cal .cell.sel {
  box-shadow: inset 0 0 0 2px var(--c1);
}

.uvq13-cal .ev {
  position: absolute;
  inset: .15em;
  display: flex;
  flex-direction: column;
  padding: .3em .4em;
  border-radius: .4em;
  overflow: hidden;
  font-size: .6em;
  line-height: 1.25;
  text-align: left;
  color: color-mix(in srgb,var(--c) 55%,var(--fg));
  background: color-mix(in srgb,var(--c) 22%,var(--bg));
  box-shadow: inset .22em 0 0 var(--c);
}

.uvq13-cal .ev b {
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uvq13-cal .ev small {
  opacity: .8;
}

.uvq13-cal .ev.new {
  animation: uvq13-cal-p calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-cal .po {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  width: 10.5em;
  padding: .8em;
  border-radius: .9em;
  background: color-mix(in srgb,var(--fg) 2%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent),0 1.6em 3.2em -1.2em rgba(0,0,0,.5);
  opacity: 0;
  transform: scale(.94);
  pointer-events: none;
  transition: opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-cal.open .po {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.uvq13-cal .po::before {
  content: "";
  position: absolute;
  top: var(--ay,2em);
  width: .75em;
  height: .75em;
  background: inherit;
  transform: rotate(45deg);
}

.uvq13-cal .po.r {
  transform-origin: 0 50%;
}

.uvq13-cal .po.l {
  transform-origin: 100% 50%;
}

.uvq13-cal .po.r::before {
  left: -.38em;
  box-shadow: -1px 1px 0 color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-cal .po.l::before {
  right: -.38em;
  box-shadow: 1px -1px 0 color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-cal .pt {
  margin: 0 0 .4em;
  font-size: .62em;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-cal .nm {
  box-sizing: border-box;
  width: 100%;
  padding: .15em 0 .3em;
  border: 0;
  border-bottom: 2px solid color-mix(in srgb,var(--fg) 9%,transparent);
  outline: 0;
  background: none;
  font: inherit;
  font-size: .95em;
  font-weight: 700;
  color: var(--fg);
}

.uvq13-cal .nm::placeholder {
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  font-weight: 500;
}

.uvq13-cal .nm:focus {
  border-bottom-color: var(--c1);
}

.uvq13-cal .wh {
  display: flex;
  align-items: center;
  gap: .35em;
  margin: .55em 0;
  font-size: .66em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-cal .wh svg {
  flex: none;
  width: 1.1em;
  height: 1.1em;
}

.uvq13-cal .cs {
  display: flex;
  gap: .5em;
}

.uvq13-cal .cs button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  width: 1.25em;
  height: 1.25em;
  border-radius: 50%;
  background: var(--c);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-cal .cs button:hover {
  transform: scale(1.12);
}

.uvq13-cal .cs [aria-checked="true"] {
  box-shadow: 0 0 0 2px var(--bg),0 0 0 3.5px var(--c);
}

.uvq13-cal .ac {
  display: flex;
  justify-content: flex-end;
  gap: .35em;
  margin-top: .75em;
}

.uvq13-cal .ac button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .5em .8em;
  border-radius: .5em;
  font-size: .72em;
  font-weight: 700;
}

.uvq13-cal .ac .cn {
  background: color-mix(in srgb,var(--fg) 6%,transparent);
}

.uvq13-cal .ac .ok {
  color: #fff;
  background: var(--c1);
}

.uvq13-cal button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq13-cal-p {
  from {
    transform: scale(.6);
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq13-cal,.uvq13-cal *,.uvq13-cal *::before,.uvq13-cal *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const po=el.querySelector(".po"),nm=po.querySelector(".nm"),wh=po.querySelector(".when"),cs=[...po.querySelectorAll(".cs button")],nt=po.querySelector(".nt"),cells=[...el.querySelectorAll(".cell")];let cur=null,tms=[];const later=(f,ms)=>tms.push(setTimeout(f,ms));
const isO=()=>el.classList.contains("open");
const sc=()=>el.getBoundingClientRect().width/el.offsetWidth||1;
const col=()=>cs.find(b=>b.getAttribute("aria-checked")==="true")||cs[0];
const pick=b=>cs.forEach(x=>{x.setAttribute("aria-checked",String(x===b));x.tabIndex=x===b?0:-1});
const place=c=>{const s=sc(),R=el.getBoundingClientRect(),r=c.getBoundingClientRect(),x=(r.left-R.left)/s,y=(r.top-R.top)/s,w=r.width/s,h=r.height/s,W=el.clientWidth,H=el.clientHeight,pw=po.offsetWidth,ph=po.offsetHeight,g=10;let left=x+w+g,side="r";if(left+pw>W-6){left=x-pw-g;side="l"}const top=Math.max(6,Math.min(H-ph-6,y+h/2-ph/2));po.style.left=left+"px";po.style.top=top+"px";po.style.setProperty("--ay",Math.max(8,Math.min(ph-20,y+h/2-top-6))+"px");po.className="po "+side};
const open=(c,u)=>{if(cur)cur.classList.remove("sel");cur=c;c.classList.add("sel");const ids=c.getAttribute("aria-labelledby").split(" "),d=el.querySelector("#"+ids[0]),hh=el.querySelector("#"+ids[1]);wh.textContent=d.textContent.replace(/\s+/g," ").trim()+" · "+hh.textContent+" – "+(+c.dataset.h+10)+":00";const ev=c.querySelector(".ev");nm.value=ev?ev.querySelector("b").textContent:"";pick(ev&&cs.find(x=>x.style.getPropertyValue("--c")===ev.style.getPropertyValue("--c"))||cs[0]);place(c);el.classList.add("open");po.inert=false;u&&later(()=>nm.focus({preventScroll:true}),60)};
const close=back=>{if(!isO())return;el.classList.remove("open");po.inert=true;if(cur){cur.classList.remove("sel");back&&cur.focus({preventScroll:true})}};
const save=()=>{if(!cur)return;const t=nm.value.trim()||nt.textContent;let ev=cur.querySelector(".ev");if(!ev){ev=document.createElement("span");ev.className="ev";ev.append(document.createElement("b"),document.createElement("small"));cur.appendChild(ev)}ev.style.setProperty("--c",col().style.getPropertyValue("--c"));ev.querySelector("b").textContent=t;ev.querySelector("small").textContent=(+cur.dataset.h+9)+":00";ev.classList.remove("new");void ev.offsetWidth;ev.classList.add("new");close(true)};
cells.forEach(c=>c.addEventListener("click",()=>open(c,true)));
po.querySelector(".ok").addEventListener("click",save);po.querySelector(".cn").addEventListener("click",()=>close(true));
nm.addEventListener("keydown",e=>{if(e.key==="Enter"){e.preventDefault();save()}});
cs.forEach((b,i)=>{b.addEventListener("click",()=>pick(b));b.addEventListener("keydown",e=>{const m={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];if(m){e.preventDefault();const n=cs[(i+m+cs.length)%cs.length];pick(n);n.focus()}})});
el.addEventListener("keydown",e=>{if(isO()){if(e.key==="Escape"){e.preventDefault();e.stopPropagation();close(true)}else if(e.key==="Tab"){const f=[nm,...cs.filter(b=>b.tabIndex===0),...po.querySelectorAll(".ac button")],a=f[0],z=f[f.length-1],ac=document.activeElement;if(e.shiftKey&&(ac===a||!po.contains(ac))){e.preventDefault();z.focus()}else if(!e.shiftKey&&(ac===z||!po.contains(ac))){e.preventDefault();a.focus()}}return}const i=cells.indexOf(document.activeElement),m={ArrowRight:1,ArrowLeft:-1,ArrowDown:4,ArrowUp:-4}[e.key];if(i>-1&&m&&cells[i+m]){e.preventDefault();cells[i+m].focus()}});
el.addEventListener("pointerdown",e=>{if(isO()&&!po.contains(e.target)&&!e.target.closest(".cell"))close(false)});
po.inert=true;pick(cs[0]);later(()=>open(cells[4],false),600);return()=>tms.forEach(clearTimeout)
}

export default function OvCalendarQuickEvent() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#e2553f",
          "--c2": "#fde6df",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq13-cal"><div className="cal" role="group" aria-label="Week of 27 October"><span></span><span className="dh" id="uvq13-cal-d0"><span>Monday</span> <b>27</b></span><span className="dh td" id="uvq13-cal-d1"><span>Tuesday</span> <b>28</b></span><span className="dh" id="uvq13-cal-d2"><span>Wednesday</span> <b>29</b></span><span className="dh" id="uvq13-cal-d3"><span>Thursday</span> <b>30</b></span><span className="hh" id="uvq13-cal-h0">9:00</span><button type="button" className="cell" data-h="0" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d0 uvq13-cal-h0"></button><button type="button" className="cell" data-h="0" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d1 uvq13-cal-h0"></button><button type="button" className="cell" data-h="0" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d2 uvq13-cal-h0"></button><button type="button" className="cell" data-h="0" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d3 uvq13-cal-h0"><span className="ev" style={{ "--c": "#f59e0b" } as CSSProperties}><b>Dentist</b><small>9:00</small></span></button><span className="hh" id="uvq13-cal-h1">10:00</span><button type="button" className="cell" data-h="1" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d0 uvq13-cal-h1"></button><button type="button" className="cell" data-h="1" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d1 uvq13-cal-h1"><span className="ev" style={{ "--c": "#14b8a6" } as CSSProperties}><b>Design</b><small>10:00</small></span></button><button type="button" className="cell" data-h="1" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d2 uvq13-cal-h1"></button><button type="button" className="cell" data-h="1" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d3 uvq13-cal-h1"></button><span className="hh" id="uvq13-cal-h2">11:00</span><button type="button" className="cell" data-h="2" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d0 uvq13-cal-h2"></button><button type="button" className="cell" data-h="2" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d1 uvq13-cal-h2"></button><button type="button" className="cell" data-h="2" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d2 uvq13-cal-h2"></button><button type="button" className="cell" data-h="2" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d3 uvq13-cal-h2"></button><span className="hh" id="uvq13-cal-h3">12:00</span><button type="button" className="cell" data-h="3" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d0 uvq13-cal-h3"></button><button type="button" className="cell" data-h="3" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d1 uvq13-cal-h3"></button><button type="button" className="cell" data-h="3" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d2 uvq13-cal-h3"><span className="ev" style={{ "--c": "#e2553f" } as CSSProperties}><b>Lunch with Leo</b><small>12:00</small></span></button><button type="button" className="cell" data-h="3" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d3 uvq13-cal-h3"></button></div><div className="po" role="dialog" aria-modal="true" aria-labelledby="uvq13-cal-pt"><p className="pt" id="uvq13-cal-pt">New event</p><input className="nm" placeholder="Add title" aria-label="Event title" autoComplete="off" /><p className="wh"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="8.5" /><path d="M12 7.5V12l3 2" /></svg><span className="when"></span></p><div className="cs" role="radiogroup" aria-label="Color"><button type="button" role="radio" aria-checked="true" aria-label="Coral" style={{ "--c": "#e2553f" } as CSSProperties}></button><button type="button" role="radio" aria-checked="false" aria-label="Teal" style={{ "--c": "#14b8a6" } as CSSProperties}></button><button type="button" role="radio" aria-checked="false" aria-label="Amber" style={{ "--c": "#f59e0b" } as CSSProperties}></button><button type="button" role="radio" aria-checked="false" aria-label="Indigo" style={{ "--c": "#6366f1" } as CSSProperties}></button></div><div className="ac"><button type="button" className="cn">Cancel</button><button type="button" className="ok">Save</button></div><span className="nt" hidden={true}>Untitled</span></div></div>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Calendar quick event popover” block (Overlays) from AIMRAN Library to my project.

## What it is
Click an empty slot in the week and a bubble anchored to it lets you give the event a title and a color.

## Chosen settings
- Main color: #e2553f
- Secondary color: #fde6df
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Semana del 27 de octubre"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq13-cal {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  width: 22em;
  height: 17em;
  border-radius: 1.2em;
  overflow: hidden;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-cal .cal {
  position: absolute;
  inset: .9em;
  display: grid;
  grid-template-columns: 2.3em repeat(4,1fr);
  grid-template-rows: 2.6em repeat(4,1fr);
  gap: .28em;
}

.uvq13-cal .dh {
  display: grid;
  place-items: center;
  align-content: center;
  gap: .15em;
  font-size: .64em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  line-height: 1;
}

.uvq13-cal .dh b {
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  font-size: 1.45em;
  font-weight: 750;
  color: var(--fg);
}

.uvq13-cal .td,.uvq13-cal .td b {
  color: var(--c1);
}

.uvq13-cal .td b {
  color: #fff;
  background: var(--c1);
}

.uvq13-cal .hh {
  padding: .25em .45em 0 0;
  font-size: .6em;
  text-align: right;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  font-variant-numeric: tabular-nums;
}

.uvq13-cal .cell {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  min-height: 0;
  border-radius: .5em;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
  transition: background calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-cal .cell:empty:hover {
  background: color-mix(in srgb,var(--c1) 10%,transparent);
}

.uvq13-cal .cell:empty:hover::after {
  content: "+";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--c1);
}

.uvq13-cal .cell.sel {
  box-shadow: inset 0 0 0 2px var(--c1);
}

.uvq13-cal .ev {
  position: absolute;
  inset: .15em;
  display: flex;
  flex-direction: column;
  padding: .3em .4em;
  border-radius: .4em;
  overflow: hidden;
  font-size: .6em;
  line-height: 1.25;
  text-align: left;
  color: color-mix(in srgb,var(--c) 55%,var(--fg));
  background: color-mix(in srgb,var(--c) 22%,var(--bg));
  box-shadow: inset .22em 0 0 var(--c);
}

.uvq13-cal .ev b {
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uvq13-cal .ev small {
  opacity: .8;
}

.uvq13-cal .ev.new {
  animation: uvq13-cal-p calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-cal .po {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  width: 10.5em;
  padding: .8em;
  border-radius: .9em;
  background: color-mix(in srgb,var(--fg) 2%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent),0 1.6em 3.2em -1.2em rgba(0,0,0,.5);
  opacity: 0;
  transform: scale(.94);
  pointer-events: none;
  transition: opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-cal.open .po {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.uvq13-cal .po::before {
  content: "";
  position: absolute;
  top: var(--ay,2em);
  width: .75em;
  height: .75em;
  background: inherit;
  transform: rotate(45deg);
}

.uvq13-cal .po.r {
  transform-origin: 0 50%;
}

.uvq13-cal .po.l {
  transform-origin: 100% 50%;
}

.uvq13-cal .po.r::before {
  left: -.38em;
  box-shadow: -1px 1px 0 color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-cal .po.l::before {
  right: -.38em;
  box-shadow: 1px -1px 0 color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-cal .pt {
  margin: 0 0 .4em;
  font-size: .62em;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-cal .nm {
  box-sizing: border-box;
  width: 100%;
  padding: .15em 0 .3em;
  border: 0;
  border-bottom: 2px solid color-mix(in srgb,var(--fg) 9%,transparent);
  outline: 0;
  background: none;
  font: inherit;
  font-size: .95em;
  font-weight: 700;
  color: var(--fg);
}

.uvq13-cal .nm::placeholder {
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  font-weight: 500;
}

.uvq13-cal .nm:focus {
  border-bottom-color: var(--c1);
}

.uvq13-cal .wh {
  display: flex;
  align-items: center;
  gap: .35em;
  margin: .55em 0;
  font-size: .66em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-cal .wh svg {
  flex: none;
  width: 1.1em;
  height: 1.1em;
}

.uvq13-cal .cs {
  display: flex;
  gap: .5em;
}

.uvq13-cal .cs button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  width: 1.25em;
  height: 1.25em;
  border-radius: 50%;
  background: var(--c);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-cal .cs button:hover {
  transform: scale(1.12);
}

.uvq13-cal .cs [aria-checked="true"] {
  box-shadow: 0 0 0 2px var(--bg),0 0 0 3.5px var(--c);
}

.uvq13-cal .ac {
  display: flex;
  justify-content: flex-end;
  gap: .35em;
  margin-top: .75em;
}

.uvq13-cal .ac button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .5em .8em;
  border-radius: .5em;
  font-size: .72em;
  font-weight: 700;
}

.uvq13-cal .ac .cn {
  background: color-mix(in srgb,var(--fg) 6%,transparent);
}

.uvq13-cal .ac .ok {
  color: #fff;
  background: var(--c1);
}

.uvq13-cal button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq13-cal-p {
  from {
    transform: scale(.6);
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq13-cal,.uvq13-cal *,.uvq13-cal *::before,.uvq13-cal *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const po=el.querySelector(".po"),nm=po.querySelector(".nm"),wh=po.querySelector(".when"),cs=[...po.querySelectorAll(".cs button")],nt=po.querySelector(".nt"),cells=[...el.querySelectorAll(".cell")];let cur=null,tms=[];const later=(f,ms)=>tms.push(setTimeout(f,ms));
const isO=()=>el.classList.contains("open");
const sc=()=>el.getBoundingClientRect().width/el.offsetWidth||1;
const col=()=>cs.find(b=>b.getAttribute("aria-checked")==="true")||cs[0];
const pick=b=>cs.forEach(x=>{x.setAttribute("aria-checked",String(x===b));x.tabIndex=x===b?0:-1});
const place=c=>{const s=sc(),R=el.getBoundingClientRect(),r=c.getBoundingClientRect(),x=(r.left-R.left)/s,y=(r.top-R.top)/s,w=r.width/s,h=r.height/s,W=el.clientWidth,H=el.clientHeight,pw=po.offsetWidth,ph=po.offsetHeight,g=10;let left=x+w+g,side="r";if(left+pw>W-6){left=x-pw-g;side="l"}const top=Math.max(6,Math.min(H-ph-6,y+h/2-ph/2));po.style.left=left+"px";po.style.top=top+"px";po.style.setProperty("--ay",Math.max(8,Math.min(ph-20,y+h/2-top-6))+"px");po.className="po "+side};
const open=(c,u)=>{if(cur)cur.classList.remove("sel");cur=c;c.classList.add("sel");const ids=c.getAttribute("aria-labelledby").split(" "),d=el.querySelector("#"+ids[0]),hh=el.querySelector("#"+ids[1]);wh.textContent=d.textContent.replace(/\s+/g," ").trim()+" · "+hh.textContent+" – "+(+c.dataset.h+10)+":00";const ev=c.querySelector(".ev");nm.value=ev?ev.querySelector("b").textContent:"";pick(ev&&cs.find(x=>x.style.getPropertyValue("--c")===ev.style.getPropertyValue("--c"))||cs[0]);place(c);el.classList.add("open");po.inert=false;u&&later(()=>nm.focus({preventScroll:true}),60)};
const close=back=>{if(!isO())return;el.classList.remove("open");po.inert=true;if(cur){cur.classList.remove("sel");back&&cur.focus({preventScroll:true})}};
const save=()=>{if(!cur)return;const t=nm.value.trim()||nt.textContent;let ev=cur.querySelector(".ev");if(!ev){ev=document.createElement("span");ev.className="ev";ev.append(document.createElement("b"),document.createElement("small"));cur.appendChild(ev)}ev.style.setProperty("--c",col().style.getPropertyValue("--c"));ev.querySelector("b").textContent=t;ev.querySelector("small").textContent=(+cur.dataset.h+9)+":00";ev.classList.remove("new");void ev.offsetWidth;ev.classList.add("new");close(true)};
cells.forEach(c=>c.addEventListener("click",()=>open(c,true)));
po.querySelector(".ok").addEventListener("click",save);po.querySelector(".cn").addEventListener("click",()=>close(true));
nm.addEventListener("keydown",e=>{if(e.key==="Enter"){e.preventDefault();save()}});
cs.forEach((b,i)=>{b.addEventListener("click",()=>pick(b));b.addEventListener("keydown",e=>{const m={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];if(m){e.preventDefault();const n=cs[(i+m+cs.length)%cs.length];pick(n);n.focus()}})});
el.addEventListener("keydown",e=>{if(isO()){if(e.key==="Escape"){e.preventDefault();e.stopPropagation();close(true)}else if(e.key==="Tab"){const f=[nm,...cs.filter(b=>b.tabIndex===0),...po.querySelectorAll(".ac button")],a=f[0],z=f[f.length-1],ac=document.activeElement;if(e.shiftKey&&(ac===a||!po.contains(ac))){e.preventDefault();z.focus()}else if(!e.shiftKey&&(ac===z||!po.contains(ac))){e.preventDefault();a.focus()}}return}const i=cells.indexOf(document.activeElement),m={ArrowRight:1,ArrowLeft:-1,ArrowDown:4,ArrowUp:-4}[e.key];if(i>-1&&m&&cells[i+m]){e.preventDefault();cells[i+m].focus()}});
el.addEventListener("pointerdown",e=>{if(isO()&&!po.contains(e.target)&&!e.target.closest(".cell"))close(false)});
po.inert=true;pick(cs[0]);later(()=>open(cells[4],false),600);return()=>tms.forEach(clearTimeout)
}

export default function OvCalendarQuickEvent() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#e2553f",
          "--c2": "#fde6df",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq13-cal"><div className="cal" role="group" aria-label="Week of 27 October"><span></span><span className="dh" id="uvq13-cal-d0"><span>Monday</span> <b>27</b></span><span className="dh td" id="uvq13-cal-d1"><span>Tuesday</span> <b>28</b></span><span className="dh" id="uvq13-cal-d2"><span>Wednesday</span> <b>29</b></span><span className="dh" id="uvq13-cal-d3"><span>Thursday</span> <b>30</b></span><span className="hh" id="uvq13-cal-h0">9:00</span><button type="button" className="cell" data-h="0" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d0 uvq13-cal-h0"></button><button type="button" className="cell" data-h="0" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d1 uvq13-cal-h0"></button><button type="button" className="cell" data-h="0" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d2 uvq13-cal-h0"></button><button type="button" className="cell" data-h="0" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d3 uvq13-cal-h0"><span className="ev" style={{ "--c": "#f59e0b" } as CSSProperties}><b>Dentist</b><small>9:00</small></span></button><span className="hh" id="uvq13-cal-h1">10:00</span><button type="button" className="cell" data-h="1" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d0 uvq13-cal-h1"></button><button type="button" className="cell" data-h="1" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d1 uvq13-cal-h1"><span className="ev" style={{ "--c": "#14b8a6" } as CSSProperties}><b>Design</b><small>10:00</small></span></button><button type="button" className="cell" data-h="1" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d2 uvq13-cal-h1"></button><button type="button" className="cell" data-h="1" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d3 uvq13-cal-h1"></button><span className="hh" id="uvq13-cal-h2">11:00</span><button type="button" className="cell" data-h="2" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d0 uvq13-cal-h2"></button><button type="button" className="cell" data-h="2" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d1 uvq13-cal-h2"></button><button type="button" className="cell" data-h="2" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d2 uvq13-cal-h2"></button><button type="button" className="cell" data-h="2" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d3 uvq13-cal-h2"></button><span className="hh" id="uvq13-cal-h3">12:00</span><button type="button" className="cell" data-h="3" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d0 uvq13-cal-h3"></button><button type="button" className="cell" data-h="3" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d1 uvq13-cal-h3"></button><button type="button" className="cell" data-h="3" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d2 uvq13-cal-h3"><span className="ev" style={{ "--c": "#e2553f" } as CSSProperties}><b>Lunch with Leo</b><small>12:00</small></span></button><button type="button" className="cell" data-h="3" aria-haspopup="dialog" aria-labelledby="uvq13-cal-d3 uvq13-cal-h3"></button></div><div className="po" role="dialog" aria-modal="true" aria-labelledby="uvq13-cal-pt"><p className="pt" id="uvq13-cal-pt">New event</p><input className="nm" placeholder="Add title" aria-label="Event title" autoComplete="off" /><p className="wh"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="8.5" /><path d="M12 7.5V12l3 2" /></svg><span className="when"></span></p><div className="cs" role="radiogroup" aria-label="Color"><button type="button" role="radio" aria-checked="true" aria-label="Coral" style={{ "--c": "#e2553f" } as CSSProperties}></button><button type="button" role="radio" aria-checked="false" aria-label="Teal" style={{ "--c": "#14b8a6" } as CSSProperties}></button><button type="button" role="radio" aria-checked="false" aria-label="Amber" style={{ "--c": "#f59e0b" } as CSSProperties}></button><button type="button" role="radio" aria-checked="false" aria-label="Indigo" style={{ "--c": "#6366f1" } as CSSProperties}></button></div><div className="ac"><button type="button" className="cn">Cancel</button><button type="button" className="ok">Save</button></div><span className="nt" hidden={true}>Untitled</span></div></div>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
