# Disabled button reason tooltip

> A disabled button explains what is missing in a tooltip with a caution stripe and a shortcut to fix it on the spot.

- Category: [Tooltips](https://library.aimran.es/components/tooltips)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-tip-disabled-reason
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

A publish card whose button stays disabled with aria-disabled, so it can still be focused and explain itself. Hover or focus it and a tooltip with a striped caution edge says what is missing and offers a button to fix it right there. Clicking the disabled button shakes it and nudges the tooltip. Once fixed, the button turns active and then confirms the publish.

The main color is the caution stripe and the action, the second the dark band between stripes. Use this pattern for any blocked action, from checkout to settings, so people learn why something is off instead of guessing.

## Code

### HTML

```html
<div class="uvq08-dis" data-s="todo"><div class="cd"><p class="hd">Publish article</p><ul><li class="ok"><i aria-hidden="true"></i><span>Title and summary</span></li><li class="im"><i aria-hidden="true"></i><span>Cover image</span><em>Missing</em></li></ul><div class="ft"><span class="wr pk"><button type="button" class="pb" aria-disabled="true" aria-describedby="uvq08-dis-n"><span class="a">Publish</span><span class="b">Published</span></button><span class="tt"><span class="no"><span class="lk" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="5" y="10.5" width="14" height="10" rx="2.5"/><path d="M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5"/></svg></span><span id="uvq08-dis-n">The cover image is missing</span><button type="button" class="fx">Add image</button></span><span class="ys" id="uvq08-dis-y">All set to publish</span></span></span></div></div></div>
```

### CSS

```css
.uvq08-dis {
  --c1: #f59e0b;
  --c2: #1f2937;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq08-dis {
  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;
  padding-bottom: 7em;
}

.uvq08-dis .cd {
  width: 16em;
  padding: 1em 1.1em .9em;
  border-radius: 1.2em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent),0 24px 48px -30px rgba(0,0,0,.45);
}

.uvq08-dis .hd {
  margin: 0 0 .6em;
  font-size: 1.05em;
  font-weight: 800;
}

.uvq08-dis ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5em;
}

.uvq08-dis li {
  display: flex;
  align-items: center;
  gap: .6em;
  font-size: .85em;
}

.uvq08-dis li i {
  position: relative;
  flex: none;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--c1);
  background: color-mix(in srgb,var(--c1) 12%,transparent);
  transition: all calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-dis li.ok i,.uvq08-dis:not([data-s="todo"]) .im i {
  background: #22c55e;
  box-shadow: none;
}

.uvq08-dis li.ok i::after,.uvq08-dis:not([data-s="todo"]) .im i::after {
  content: "";
  position: absolute;
  left: .4em;
  top: .2em;
  width: .25em;
  height: .5em;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  rotate: 45deg;
}

.uvq08-dis em {
  margin-left: auto;
  padding: .15em .55em;
  border-radius: 1em;
  font-size: .78em;
  font-style: normal;
  font-weight: 800;
  color: color-mix(in srgb,var(--c1) 55%,var(--fg));
  background: color-mix(in srgb,var(--c1) 18%,transparent);
}

.uvq08-dis:not([data-s="todo"]) em {
  display: none;
}

.uvq08-dis .ft {
  display: flex;
  justify-content: flex-end;
  margin-top: .9em;
  padding-top: .8em;
  border-top: 1px solid color-mix(in srgb,var(--fg) 8%,transparent);
}

.uvq08-dis .wr {
  position: relative;
}

.uvq08-dis .pb {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: grid;
  padding: .65em 1.3em;
  border-radius: .8em;
  font-weight: 750;
  color: var(--bg);
  background: var(--fg);
  transition: all calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-dis .pb span {
  grid-area: 1/1;
  transition: opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-dis .pb .b {
  opacity: 0;
}

.uvq08-dis .pb[aria-disabled="true"] {
  opacity: .42;
  cursor: not-allowed;
}

.uvq08-dis .pb:not([aria-disabled="true"]):hover {
  transform: translateY(-.1em);
}

.uvq08-dis .pb:not([aria-disabled="true"]):active {
  transform: scale(.95);
}

.uvq08-dis .pb:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq08-dis[data-s="done"] .pb {
  color: #fff;
  background: #16a34a;
}

.uvq08-dis[data-s="done"] .pb .a {
  opacity: 0;
}

.uvq08-dis[data-s="done"] .pb .b {
  opacity: 1;
}

.uvq08-dis .pb.nudge {
  animation: uvq08-dis-s calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-dis .tt {
  position: absolute;
  right: -.4em;
  top: calc(100% + .75em);
  z-index: 3;
  display: block;
  width: 12.5em;
  padding: 1em .9em .8em;
  border-radius: .9em;
  font-size: .82em;
  line-height: 1.35;
  color: var(--bg);
  background: var(--fg);
  box-shadow: 0 .8em 1.6em -.6em rgba(0,0,0,.45);
  transform: translateY(-.35em);
  opacity: 0;
  visibility: hidden;
  transition: all calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-dis .tt::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: .38em;
  border-radius: .9em .9em 0 0;
  background: repeating-linear-gradient(-45deg,var(--c1) 0 .4em,var(--c2) .4em .8em);
}

.uvq08-dis .tt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: .9em;
}

.uvq08-dis .tt.nudge {
  animation: uvq08-dis-p calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-dis .no {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .5em .55em;
  font-weight: 650;
}

.uvq08-dis .lk {
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: .6em;
  color: var(--c1);
  background: color-mix(in srgb,var(--c1) 22%,transparent);
}

.uvq08-dis .lk svg {
  width: 1.1em;
  height: 1.1em;
}

.uvq08-dis .fx {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  grid-column: 1/-1;
  justify-self: end;
  padding: .4em .85em;
  border-radius: 2em;
  font-size: .9em;
  font-weight: 800;
  color: #111;
  background: var(--c1);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-dis .fx:hover {
  transform: translateY(-.1em);
}

.uvq08-dis .fx:active {
  transform: scale(.94);
}

.uvq08-dis .fx:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 2px;
}

.uvq08-dis .ys {
  display: none;
  font-weight: 650;
}

.uvq08-dis[data-s="ready"] .no {
  display: none;
}

.uvq08-dis[data-s="ready"] .ys {
  display: block;
}

.uvq08-dis[data-s="ready"] .tt::before {
  background: #22c55e;
}

.uvq08-dis .wr:hover .tt,.uvq08-dis .wr:focus-within .tt,.uvq08-dis .wr.pk .tt {
  transform: none;
  opacity: 1;
  visibility: visible;
}

.uvq08-dis[data-s="done"] .tt {
  display: none;
}

@keyframes uvq08-dis-s {
  20% {
    translate: -.3em 0;
  }
  40% {
    translate: .3em 0;
  }
  60% {
    translate: -.2em 0;
  }
  80% {
    translate: .1em 0;
  }
}

@keyframes uvq08-dis-p {
  50% {
    scale: 1.05;
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq08-dis").forEach(el => {
  const unpk=()=>{el.classList.remove("pk");el.querySelectorAll(".pk").forEach(x=>x.classList.remove("pk"))};el.addEventListener("pointerover",unpk,{once:true});el.addEventListener("focusin",unpk,{once:true});const pb=el.querySelector(".pb"),fx=el.querySelector(".fx"),tt=el.querySelector(".tt");
const set=s=>{el.dataset.s=s;pb.setAttribute("aria-disabled",String(s==="todo"));pb.setAttribute("aria-describedby",s==="todo"?"uvq08-dis-n":"uvq08-dis-y")};
const nudge=x=>{x.classList.remove("nudge");void x.offsetWidth;x.classList.add("nudge")};
pb.addEventListener("click",()=>{const s=el.dataset.s;if(s==="todo"){nudge(pb);nudge(tt)}else set(s==="ready"?"done":"todo")});
fx.addEventListener("click",()=>{set("ready");pb.focus()})
});
```

### 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 = `
.uvq08-dis {
  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;
  padding-bottom: 7em;
}

.uvq08-dis .cd {
  width: 16em;
  padding: 1em 1.1em .9em;
  border-radius: 1.2em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent),0 24px 48px -30px rgba(0,0,0,.45);
}

.uvq08-dis .hd {
  margin: 0 0 .6em;
  font-size: 1.05em;
  font-weight: 800;
}

.uvq08-dis ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5em;
}

.uvq08-dis li {
  display: flex;
  align-items: center;
  gap: .6em;
  font-size: .85em;
}

.uvq08-dis li i {
  position: relative;
  flex: none;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--c1);
  background: color-mix(in srgb,var(--c1) 12%,transparent);
  transition: all calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-dis li.ok i,.uvq08-dis:not([data-s="todo"]) .im i {
  background: #22c55e;
  box-shadow: none;
}

.uvq08-dis li.ok i::after,.uvq08-dis:not([data-s="todo"]) .im i::after {
  content: "";
  position: absolute;
  left: .4em;
  top: .2em;
  width: .25em;
  height: .5em;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  rotate: 45deg;
}

.uvq08-dis em {
  margin-left: auto;
  padding: .15em .55em;
  border-radius: 1em;
  font-size: .78em;
  font-style: normal;
  font-weight: 800;
  color: color-mix(in srgb,var(--c1) 55%,var(--fg));
  background: color-mix(in srgb,var(--c1) 18%,transparent);
}

.uvq08-dis:not([data-s="todo"]) em {
  display: none;
}

.uvq08-dis .ft {
  display: flex;
  justify-content: flex-end;
  margin-top: .9em;
  padding-top: .8em;
  border-top: 1px solid color-mix(in srgb,var(--fg) 8%,transparent);
}

.uvq08-dis .wr {
  position: relative;
}

.uvq08-dis .pb {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: grid;
  padding: .65em 1.3em;
  border-radius: .8em;
  font-weight: 750;
  color: var(--bg);
  background: var(--fg);
  transition: all calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-dis .pb span {
  grid-area: 1/1;
  transition: opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-dis .pb .b {
  opacity: 0;
}

.uvq08-dis .pb[aria-disabled="true"] {
  opacity: .42;
  cursor: not-allowed;
}

.uvq08-dis .pb:not([aria-disabled="true"]):hover {
  transform: translateY(-.1em);
}

.uvq08-dis .pb:not([aria-disabled="true"]):active {
  transform: scale(.95);
}

.uvq08-dis .pb:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq08-dis[data-s="done"] .pb {
  color: #fff;
  background: #16a34a;
}

.uvq08-dis[data-s="done"] .pb .a {
  opacity: 0;
}

.uvq08-dis[data-s="done"] .pb .b {
  opacity: 1;
}

.uvq08-dis .pb.nudge {
  animation: uvq08-dis-s calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-dis .tt {
  position: absolute;
  right: -.4em;
  top: calc(100% + .75em);
  z-index: 3;
  display: block;
  width: 12.5em;
  padding: 1em .9em .8em;
  border-radius: .9em;
  font-size: .82em;
  line-height: 1.35;
  color: var(--bg);
  background: var(--fg);
  box-shadow: 0 .8em 1.6em -.6em rgba(0,0,0,.45);
  transform: translateY(-.35em);
  opacity: 0;
  visibility: hidden;
  transition: all calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-dis .tt::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: .38em;
  border-radius: .9em .9em 0 0;
  background: repeating-linear-gradient(-45deg,var(--c1) 0 .4em,var(--c2) .4em .8em);
}

.uvq08-dis .tt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: .9em;
}

.uvq08-dis .tt.nudge {
  animation: uvq08-dis-p calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-dis .no {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .5em .55em;
  font-weight: 650;
}

.uvq08-dis .lk {
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: .6em;
  color: var(--c1);
  background: color-mix(in srgb,var(--c1) 22%,transparent);
}

.uvq08-dis .lk svg {
  width: 1.1em;
  height: 1.1em;
}

.uvq08-dis .fx {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  grid-column: 1/-1;
  justify-self: end;
  padding: .4em .85em;
  border-radius: 2em;
  font-size: .9em;
  font-weight: 800;
  color: #111;
  background: var(--c1);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-dis .fx:hover {
  transform: translateY(-.1em);
}

.uvq08-dis .fx:active {
  transform: scale(.94);
}

.uvq08-dis .fx:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 2px;
}

.uvq08-dis .ys {
  display: none;
  font-weight: 650;
}

.uvq08-dis[data-s="ready"] .no {
  display: none;
}

.uvq08-dis[data-s="ready"] .ys {
  display: block;
}

.uvq08-dis[data-s="ready"] .tt::before {
  background: #22c55e;
}

.uvq08-dis .wr:hover .tt,.uvq08-dis .wr:focus-within .tt,.uvq08-dis .wr.pk .tt {
  transform: none;
  opacity: 1;
  visibility: visible;
}

.uvq08-dis[data-s="done"] .tt {
  display: none;
}

@keyframes uvq08-dis-s {
  20% {
    translate: -.3em 0;
  }
  40% {
    translate: .3em 0;
  }
  60% {
    translate: -.2em 0;
  }
  80% {
    translate: .1em 0;
  }
}

@keyframes uvq08-dis-p {
  50% {
    scale: 1.05;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq08-dis,.uvq08-dis *,.uvq08-dis *::before,.uvq08-dis *::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 unpk=()=>{el.classList.remove("pk");el.querySelectorAll(".pk").forEach(x=>x.classList.remove("pk"))};el.addEventListener("pointerover",unpk,{once:true});el.addEventListener("focusin",unpk,{once:true});const pb=el.querySelector(".pb"),fx=el.querySelector(".fx"),tt=el.querySelector(".tt");
const set=s=>{el.dataset.s=s;pb.setAttribute("aria-disabled",String(s==="todo"));pb.setAttribute("aria-describedby",s==="todo"?"uvq08-dis-n":"uvq08-dis-y")};
const nudge=x=>{x.classList.remove("nudge");void x.offsetWidth;x.classList.add("nudge")};
pb.addEventListener("click",()=>{const s=el.dataset.s;if(s==="todo"){nudge(pb);nudge(tt)}else set(s==="ready"?"done":"todo")});
fx.addEventListener("click",()=>{set("ready");pb.focus()})
}

export default function TipDisabledReason() {
  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": "#f59e0b",
          "--c2": "#1f2937",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq08-dis" data-s="todo"><div className="cd"><p className="hd">Publish article</p><ul><li className="ok"><i aria-hidden="true"></i><span>Title and summary</span></li><li className="im"><i aria-hidden="true"></i><span>Cover image</span><em>Missing</em></li></ul><div className="ft"><span className="wr pk"><button type="button" className="pb" aria-disabled="true" aria-describedby="uvq08-dis-n"><span className="a">Publish</span><span className="b">Published</span></button><span className="tt"><span className="no"><span className="lk" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><rect x="5" y="10.5" width="14" height="10" rx="2.5" /><path d="M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5" /></svg></span><span id="uvq08-dis-n">The cover image is missing</span><button type="button" className="fx">Add image</button></span><span className="ys" id="uvq08-dis-y">All set to publish</span></span></span></div></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 “Disabled button reason tooltip” block (Tooltips) from AIMRAN Library to my project.

## What it is
A disabled button explains what is missing in a tooltip with a caution stripe and a shortcut to fix it on the spot.

## Chosen settings
- Main color: #f59e0b
- Secondary color: #1f2937
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Publicar artículo"

## 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 = `
.uvq08-dis {
  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;
  padding-bottom: 7em;
}

.uvq08-dis .cd {
  width: 16em;
  padding: 1em 1.1em .9em;
  border-radius: 1.2em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent),0 24px 48px -30px rgba(0,0,0,.45);
}

.uvq08-dis .hd {
  margin: 0 0 .6em;
  font-size: 1.05em;
  font-weight: 800;
}

.uvq08-dis ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5em;
}

.uvq08-dis li {
  display: flex;
  align-items: center;
  gap: .6em;
  font-size: .85em;
}

.uvq08-dis li i {
  position: relative;
  flex: none;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--c1);
  background: color-mix(in srgb,var(--c1) 12%,transparent);
  transition: all calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-dis li.ok i,.uvq08-dis:not([data-s="todo"]) .im i {
  background: #22c55e;
  box-shadow: none;
}

.uvq08-dis li.ok i::after,.uvq08-dis:not([data-s="todo"]) .im i::after {
  content: "";
  position: absolute;
  left: .4em;
  top: .2em;
  width: .25em;
  height: .5em;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  rotate: 45deg;
}

.uvq08-dis em {
  margin-left: auto;
  padding: .15em .55em;
  border-radius: 1em;
  font-size: .78em;
  font-style: normal;
  font-weight: 800;
  color: color-mix(in srgb,var(--c1) 55%,var(--fg));
  background: color-mix(in srgb,var(--c1) 18%,transparent);
}

.uvq08-dis:not([data-s="todo"]) em {
  display: none;
}

.uvq08-dis .ft {
  display: flex;
  justify-content: flex-end;
  margin-top: .9em;
  padding-top: .8em;
  border-top: 1px solid color-mix(in srgb,var(--fg) 8%,transparent);
}

.uvq08-dis .wr {
  position: relative;
}

.uvq08-dis .pb {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: grid;
  padding: .65em 1.3em;
  border-radius: .8em;
  font-weight: 750;
  color: var(--bg);
  background: var(--fg);
  transition: all calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-dis .pb span {
  grid-area: 1/1;
  transition: opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-dis .pb .b {
  opacity: 0;
}

.uvq08-dis .pb[aria-disabled="true"] {
  opacity: .42;
  cursor: not-allowed;
}

.uvq08-dis .pb:not([aria-disabled="true"]):hover {
  transform: translateY(-.1em);
}

.uvq08-dis .pb:not([aria-disabled="true"]):active {
  transform: scale(.95);
}

.uvq08-dis .pb:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq08-dis[data-s="done"] .pb {
  color: #fff;
  background: #16a34a;
}

.uvq08-dis[data-s="done"] .pb .a {
  opacity: 0;
}

.uvq08-dis[data-s="done"] .pb .b {
  opacity: 1;
}

.uvq08-dis .pb.nudge {
  animation: uvq08-dis-s calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-dis .tt {
  position: absolute;
  right: -.4em;
  top: calc(100% + .75em);
  z-index: 3;
  display: block;
  width: 12.5em;
  padding: 1em .9em .8em;
  border-radius: .9em;
  font-size: .82em;
  line-height: 1.35;
  color: var(--bg);
  background: var(--fg);
  box-shadow: 0 .8em 1.6em -.6em rgba(0,0,0,.45);
  transform: translateY(-.35em);
  opacity: 0;
  visibility: hidden;
  transition: all calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-dis .tt::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: .38em;
  border-radius: .9em .9em 0 0;
  background: repeating-linear-gradient(-45deg,var(--c1) 0 .4em,var(--c2) .4em .8em);
}

.uvq08-dis .tt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: .9em;
}

.uvq08-dis .tt.nudge {
  animation: uvq08-dis-p calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-dis .no {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .5em .55em;
  font-weight: 650;
}

.uvq08-dis .lk {
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: .6em;
  color: var(--c1);
  background: color-mix(in srgb,var(--c1) 22%,transparent);
}

.uvq08-dis .lk svg {
  width: 1.1em;
  height: 1.1em;
}

.uvq08-dis .fx {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  grid-column: 1/-1;
  justify-self: end;
  padding: .4em .85em;
  border-radius: 2em;
  font-size: .9em;
  font-weight: 800;
  color: #111;
  background: var(--c1);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-dis .fx:hover {
  transform: translateY(-.1em);
}

.uvq08-dis .fx:active {
  transform: scale(.94);
}

.uvq08-dis .fx:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 2px;
}

.uvq08-dis .ys {
  display: none;
  font-weight: 650;
}

.uvq08-dis[data-s="ready"] .no {
  display: none;
}

.uvq08-dis[data-s="ready"] .ys {
  display: block;
}

.uvq08-dis[data-s="ready"] .tt::before {
  background: #22c55e;
}

.uvq08-dis .wr:hover .tt,.uvq08-dis .wr:focus-within .tt,.uvq08-dis .wr.pk .tt {
  transform: none;
  opacity: 1;
  visibility: visible;
}

.uvq08-dis[data-s="done"] .tt {
  display: none;
}

@keyframes uvq08-dis-s {
  20% {
    translate: -.3em 0;
  }
  40% {
    translate: .3em 0;
  }
  60% {
    translate: -.2em 0;
  }
  80% {
    translate: .1em 0;
  }
}

@keyframes uvq08-dis-p {
  50% {
    scale: 1.05;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq08-dis,.uvq08-dis *,.uvq08-dis *::before,.uvq08-dis *::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 unpk=()=>{el.classList.remove("pk");el.querySelectorAll(".pk").forEach(x=>x.classList.remove("pk"))};el.addEventListener("pointerover",unpk,{once:true});el.addEventListener("focusin",unpk,{once:true});const pb=el.querySelector(".pb"),fx=el.querySelector(".fx"),tt=el.querySelector(".tt");
const set=s=>{el.dataset.s=s;pb.setAttribute("aria-disabled",String(s==="todo"));pb.setAttribute("aria-describedby",s==="todo"?"uvq08-dis-n":"uvq08-dis-y")};
const nudge=x=>{x.classList.remove("nudge");void x.offsetWidth;x.classList.add("nudge")};
pb.addEventListener("click",()=>{const s=el.dataset.s;if(s==="todo"){nudge(pb);nudge(tt)}else set(s==="ready"?"done":"todo")});
fx.addEventListener("click",()=>{set("ready");pb.focus()})
}

export default function TipDisabledReason() {
  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": "#f59e0b",
          "--c2": "#1f2937",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq08-dis" data-s="todo"><div className="cd"><p className="hd">Publish article</p><ul><li className="ok"><i aria-hidden="true"></i><span>Title and summary</span></li><li className="im"><i aria-hidden="true"></i><span>Cover image</span><em>Missing</em></li></ul><div className="ft"><span className="wr pk"><button type="button" className="pb" aria-disabled="true" aria-describedby="uvq08-dis-n"><span className="a">Publish</span><span className="b">Published</span></button><span className="tt"><span className="no"><span className="lk" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><rect x="5" y="10.5" width="14" height="10" rx="2.5" /><path d="M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5" /></svg></span><span id="uvq08-dis-n">The cover image is missing</span><button type="button" className="fx">Add image</button></span><span className="ys" id="uvq08-dis-y">All set to publish</span></span></span></div></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.
````
