UNPKG

welcome-ui

Version:

Customizable design system with react, typescript, tailwindcss and ariakit.

32 lines (31 loc) 1.1 kB
"use client"; import './utils.css'; import { u, b as f } from "./index-B6iGEm-i.js"; import { c as b } from "./index-B6iGEm-i.js"; import { f as S } from "./forwardRefWithAs-8eP3ZN15.js"; import { u as p } from "./use-viewport-DuW6YjHT.js"; import { useState as a, useCallback as d } from "react"; function y(e = "includeThreshold") { const { width: o } = p(), t = u(), i = o ?? (typeof window < "u" ? window.innerWidth : 0), c = (r) => e === "includeThreshold" ? i >= r : i > r, s = Object.keys(t).filter((r) => r !== "xxl").sort((r, n) => t[r] - t[n]); return s.reduce( (r, n) => c(t[n]) ? n : r, s[0] ); } function w(e, o) { const [t, i] = a(); return [d(() => { let s; typeof e == "number" || typeof e == "string" ? s = e.toString() : e.current instanceof HTMLInputElement ? s = e.current.value : e.current instanceof HTMLElement && (s = e.current.textContent); const r = f(s); i(r), o && setTimeout(i, o); }, [e, o]), t]; } export { b as classNames, S as forwardRefWithAs, y as useBreakpoint, w as useCopyText, u as useScreens, p as useViewportSize };