{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"no-search-results-state-with-empty-clothes-rail-drawing","type":"registry:component","title":"No Search Results State with Empty Clothes Rail","description":"","dependencies":[],"files":[{"path":"components/we-inc/no-search-results-state-with-empty-clothes-rail-drawing.tsx","type":"registry:component","content":"import { useEffect, useLayoutEffect, useRef } from \"react\";\n\n// Edit these first: the terracotta line and cream colours at the top of .m4srch, and the search words in the field and heading.\nconst CSS = `\n.m4srch { --m4srch-bg: #f6efe6; --m4srch-panel: #fffaf3; --m4srch-ink: #2b211c; --m4srch-quiet: #66574c; --m4srch-line: #e6d9c8; --m4srch-focus: #a5482a; --m4srch-pen: #a5482a; }\n.m4srch { position: relative; box-sizing: border-box; overflow: hidden; font-family: \"Inter Tight\", \"Inter\", ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif; -webkit-font-smoothing: antialiased; }\n.m4srch *, .m4srch *::before, .m4srch *::after { box-sizing: border-box; }\n.m4srch svg { display: block; }\n.m4srch .m4srch-s { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }\n.m4srch-replay { position: absolute; right: 14px; bottom: 14px; z-index: 5; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--m4srch-line); border-radius: 999px; background: var(--m4srch-replaybg, transparent); color: var(--m4srch-quiet); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }\n.m4srch-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }\n.m4srch-replay:hover { color: var(--m4srch-ink); }\n.m4srch-replay:focus-visible { outline: 2px solid var(--m4srch-focus); outline-offset: 2px; }\n/* Hidden until the drawing starts, only when motion is allowed and the script is running. */\n@media (prefers-reduced-motion: no-preference) {\n  .m4srch.is-js:not([data-run]) .m4srch-s { stroke-dashoffset: 1; }\n  .m4srch.is-js:not([data-run]) .m4srch-f { opacity: 0; }\n}\n.m4srch[data-run] .m4srch-s { animation: m4srch-draw .6s cubic-bezier(.5, .05, .3, 1) both; }\n.m4srch[data-run] .m4srch-f { animation: m4srch-fade .5s ease-out both; }\n.m4srch[data-run] .m4srch-slow { animation-duration: 1s; }\n.m4srch[data-run] .m4srch-quick { animation-duration: .35s; }\n@keyframes m4srch-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }\n@keyframes m4srch-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }\n/* Paused while scrolled out of view. */\n.m4srch[data-off] * { animation-play-state: paused !important; }\n/* Reduced motion: the finished drawing, no movement. */\n@media (prefers-reduced-motion: reduce) {\n  .m4srch *, .m4srch *::before, .m4srch *::after { animation: none !important; transition: none !important; }\n  .m4srch-replay { display: none; }\n}\n\n.m4srch { background: var(--m4srch-bg); color: var(--m4srch-ink); padding: 40px clamp(14px, 4vw, 48px) 76px; }\n.m4srch-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }\n.m4srch-shop { max-width: 880px; margin: 0 auto; background: var(--m4srch-panel); border: 1px solid var(--m4srch-line); border-radius: 14px; box-shadow: 0 22px 44px -34px rgba(43, 33, 28, .45); }\n.m4srch-top { display: flex; align-items: center; gap: 20px; padding: 16px 22px; border-bottom: 1px solid var(--m4srch-line); }\n.m4srch-brand { margin: 0; font-family: Georgia, \"Times New Roman\", serif; font-size: 20px; white-space: nowrap; }\n.m4srch-form { flex: 1; display: flex; gap: 8px; min-width: 0; }\n.m4srch-input { flex: 1; min-width: 0; min-height: 42px; padding: 0 14px; border: 1px solid #d6c6b2; border-radius: 10px; background: #fff; color: var(--m4srch-ink); font: inherit; font-size: 15px; }\n.m4srch-input:focus-visible, .m4srch-go:focus-visible, .m4srch a:focus-visible { outline: 2px solid var(--m4srch-focus); outline-offset: 2px; }\n.m4srch-go { min-height: 42px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--m4srch-ink); color: #fffaf3; font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; }\n.m4srch-meta { margin: 0; padding: 14px 22px 0; font-size: 13.5px; color: var(--m4srch-quiet); }\n.m4srch-empty { padding: 20px 24px 48px; text-align: center; }\n.m4srch-art { width: 240px; max-width: 72%; height: auto; margin: 0 auto 10px; }\n.m4srch-art .m4srch-s { stroke: var(--m4srch-pen); stroke-width: 2; }\n.m4srch-art .m4srch-thin { stroke-width: 1.4; }\n.m4srch-art .m4srch-lens { stroke: var(--m4srch-ink); stroke-width: 2.2; }\n.m4srch-art .m4srch-handle { stroke: var(--m4srch-ink); stroke-width: 4.5; }\n.m4srch-h { margin: 0; font-family: Georgia, \"Times New Roman\", serif; font-weight: 400; font-size: clamp(22px, 3vw, 28px); line-height: 1.2; }\n.m4srch-p { margin: 10px auto 0; max-width: 28em; font-size: 15px; line-height: 1.6; color: var(--m4srch-quiet); }\n.m4srch-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }\n.m4srch-btn, .m4srch-ghost { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border-radius: 999px; font-size: 14.5px; font-weight: 600; text-decoration: none; }\n.m4srch-btn { background: var(--m4srch-pen); color: #fffaf3; }\n.m4srch-btn:hover { background: #8c3c22; }\n.m4srch-ghost { color: var(--m4srch-ink); border: 1px solid #d6c6b2; }\n@media (max-width: 600px) {\n  .m4srch-top { flex-direction: column; align-items: stretch; gap: 12px; }\n}\n\n.m4srch[data-run] .m4srch-t0 { animation-delay: 0.00s; }\n.m4srch[data-run] .m4srch-t1 { animation-delay: 0.05s; }\n.m4srch[data-run] .m4srch-t2 { animation-delay: 0.10s; }\n.m4srch[data-run] .m4srch-t3 { animation-delay: 0.15s; }\n.m4srch[data-run] .m4srch-t4 { animation-delay: 0.20s; }\n.m4srch[data-run] .m4srch-t5 { animation-delay: 0.25s; }\n.m4srch[data-run] .m4srch-t6 { animation-delay: 0.30s; }\n.m4srch[data-run] .m4srch-t7 { animation-delay: 0.35s; }\n.m4srch[data-run] .m4srch-t8 { animation-delay: 0.40s; }\n.m4srch[data-run] .m4srch-t9 { animation-delay: 0.45s; }\n.m4srch[data-run] .m4srch-t10 { animation-delay: 0.50s; }\n.m4srch[data-run] .m4srch-t11 { animation-delay: 0.55s; }\n.m4srch[data-run] .m4srch-t12 { animation-delay: 0.60s; }\n.m4srch[data-run] .m4srch-t13 { animation-delay: 0.65s; }\n.m4srch[data-run] .m4srch-t14 { animation-delay: 0.70s; }\n.m4srch[data-run] .m4srch-t15 { animation-delay: 0.75s; }\n.m4srch[data-run] .m4srch-t16 { animation-delay: 0.80s; }\n.m4srch[data-run] .m4srch-t17 { animation-delay: 0.85s; }\n.m4srch[data-run] .m4srch-t18 { animation-delay: 0.90s; }\n.m4srch[data-run] .m4srch-t19 { animation-delay: 0.95s; }\n.m4srch[data-run] .m4srch-t20 { animation-delay: 1.00s; }\n.m4srch[data-run] .m4srch-t21 { animation-delay: 1.05s; }\n.m4srch[data-run] .m4srch-t22 { animation-delay: 1.10s; }\n.m4srch[data-run] .m4srch-t23 { animation-delay: 1.15s; }\n.m4srch[data-run] .m4srch-t24 { animation-delay: 1.20s; }\n.m4srch[data-run] .m4srch-t25 { animation-delay: 1.25s; }\n.m4srch[data-run] .m4srch-t26 { animation-delay: 1.30s; }\n.m4srch[data-run] .m4srch-t27 { animation-delay: 1.35s; }\n.m4srch[data-run] .m4srch-t28 { animation-delay: 1.40s; }\n.m4srch[data-run] .m4srch-t29 { animation-delay: 1.45s; }\n.m4srch[data-run] .m4srch-t30 { animation-delay: 1.50s; }\n.m4srch[data-run] .m4srch-t31 { animation-delay: 1.55s; }\n.m4srch[data-run] .m4srch-t32 { animation-delay: 1.60s; }\n.m4srch[data-run] .m4srch-t33 { animation-delay: 1.65s; }\n.m4srch[data-run] .m4srch-t34 { animation-delay: 1.70s; }\n.m4srch[data-run] .m4srch-t35 { animation-delay: 1.75s; }\n.m4srch[data-run] .m4srch-t36 { animation-delay: 1.80s; }\n.m4srch[data-run] .m4srch-t37 { animation-delay: 1.85s; }\n.m4srch[data-run] .m4srch-t38 { animation-delay: 1.90s; }\n.m4srch[data-run] .m4srch-t39 { animation-delay: 1.95s; }\n`;\n\n// Runs before paint in the browser so the drawing never flashes finished before it starts.\nconst useBrowserLayoutEffect = typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\nexport default function NoSearchResultsStateWithEmpty() {\n  const rootRef = useRef<HTMLElement>(null);\n\n  // Draws once when the piece enters the view (works inside a scrolling box too) and pauses any loop when it leaves.\n  // With prefers-reduced-motion the CSS shows the finished drawing and hides the Replay button.\n  useBrowserLayoutEffect(() => {\n    const root = rootRef.current;\n    if (!root) return;\n    root.classList.add(\"is-js\");\n    const play = () => {\n      root.removeAttribute(\"data-run\");\n      void root.offsetWidth; // restart the keyframes\n      root.setAttribute(\"data-run\", \"\");\n    };\n    const btn = root.querySelector(\".m4srch-replay\");\n    btn?.addEventListener(\"click\", play);\n    if (typeof IntersectionObserver === \"undefined\") {\n      play();\n      return () => btn?.removeEventListener(\"click\", play);\n    }\n    let seen = false;\n    const io = new IntersectionObserver((entries) => {\n      const on = entries[0].isIntersecting;\n      root.toggleAttribute(\"data-off\", !on);\n      if (on && !seen) {\n        seen = true;\n        play();\n      }\n    }, { threshold: 0.2 });\n    io.observe(root);\n    return () => {\n      io.disconnect();\n      btn?.removeEventListener(\"click\", play);\n    };\n  }, []);\n\n  return (\n    <section ref={rootRef} className=\"m4srch\">\n      <style>{CSS}</style>\n<div className=\"m4srch-shop\">\n  <header className=\"m4srch-top\">\n    <p className=\"m4srch-brand\">Marlow &amp; Weft</p>\n    <form className=\"m4srch-form\" role=\"search\" action=\"#\" onSubmit={(e) => e.preventDefault()}>\n      <label className=\"m4srch-sr\" htmlFor=\"m4srch-q\">Search the shop</label>\n      <input className=\"m4srch-input\" id=\"m4srch-q\" type=\"search\" defaultValue=\"linen apron xs\" autoComplete=\"off\"/>\n      <button className=\"m4srch-go\" type=\"submit\">Search</button>\n    </form>\n  </header>\n  <p className=\"m4srch-meta\">0 results</p>\n  <div className=\"m4srch-empty\">\n    <svg className=\"m4srch-art\" viewBox=\"0 0 260 180\" aria-hidden=\"true\" focusable=\"false\">\n      <path className=\"m4srch-s m4srch-t0\" d=\"M52 40H208\" pathLength=\"1\"/>\n      <path className=\"m4srch-s m4srch-t1 m4srch-quick\" d=\"M62 40V152M198 40V152\" pathLength=\"1\"/>\n      <path className=\"m4srch-s m4srch-t3 m4srch-quick\" d=\"M42 158L62 152L82 158M178 158L198 152L218 158\" pathLength=\"1\"/>\n      <path className=\"m4srch-s m4srch-t4 m4srch-thin\" d=\"M86 37C86 31 94 31 94 37C94 41 90 42 90 47\" pathLength=\"1\"/>\n      <path className=\"m4srch-s m4srch-t5\" d=\"M90 47L70.5 61.5C69 62.6 69.6 65 71.5 65H108.5C110.4 65 111 62.6 109.5 61.5Z\" pathLength=\"1\"/>\n      <g transform=\"rotate(6 132 40)\">\n        <path className=\"m4srch-s m4srch-t6 m4srch-thin\" d=\"M128 37C128 31 136 31 136 37C136 41 132 42 132 47\" pathLength=\"1\"/>\n        <path className=\"m4srch-s m4srch-t7\" d=\"M132 47L112.5 61.5C111 62.6 111.6 65 113.5 65H150.5C152.4 65 153 62.6 151.5 61.5Z\" pathLength=\"1\"/>\n      </g>\n      <path className=\"m4srch-s m4srch-t8 m4srch-thin\" d=\"M170 37C170 31 178 31 178 37C178 41 174 42 174 47\" pathLength=\"1\"/>\n      <path className=\"m4srch-s m4srch-t9\" d=\"M174 47L154.5 61.5C153 62.6 153.6 65 155.5 65H192.5C194.4 65 195 62.6 193.5 61.5Z\" pathLength=\"1\"/>\n      <circle className=\"m4srch-s m4srch-t11 m4srch-slow m4srch-lens\" cx=\"150\" cy=\"118\" r=\"21\" pathLength=\"1\" transform=\"rotate(-140 150 118)\"/>\n      <path className=\"m4srch-s m4srch-t15 m4srch-handle\" d=\"M165.5 133.5L181 149\" pathLength=\"1\"/>\n      <path className=\"m4srch-s m4srch-t17 m4srch-quick m4srch-thin\" d=\"M140 110A13 13 0 0 1 151 104\" pathLength=\"1\"/>\n    </svg>\n    <h2 className=\"m4srch-h\">No matches for “linen apron xs”</h2>\n    <p className=\"m4srch-p\">Try fewer words or check the spelling. Our aprons are cut in three sizes, so searching for the fabric alone usually finds them.</p>\n    <div className=\"m4srch-actions\">\n      <a className=\"m4srch-btn\" href=\"#\">Clear the search</a>\n      <a className=\"m4srch-ghost\" href=\"#\">Browse every apron</a>\n    </div>\n  </div>\n</div>\n<button type=\"button\" className=\"m4srch-replay\" aria-label=\"Replay the drawing\"><svg viewBox=\"0 0 20 20\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M4.5 11a5.5 5.5 0 1 0 1.8-4.6\"/><path d=\"M5 3.2v3.6h3.6\"/></svg>Replay</button>\n    </section>\n  );\n}\n"}]}
