UNPKG

based-auth

Version:

A Next.js/Node.js authentication and wallet API kit for Ethereum and Solana, with utilities for serialization and contract interaction, designed for serverless and API route usage.

1,766 lines (1,765 loc) 144 kB
import * as $ from "react"; import qt, { createContext as Gt, useContext as ct, useState as pe, useMemo as Ue, useEffect as F, useRef as Ve } from "react"; import { WalletProvider as Ut, useWallet as Vt } from "@solana/wallet-adapter-react"; import { CoinbaseWalletAdapter as Ht, PhantomWalletAdapter as Yt, SafePalWalletAdapter as Jt, SolflareWalletAdapter as Qt, TrustWalletAdapter as Xt } from "@solana/wallet-adapter-wallets"; import { coinbaseWallet as Zt, safe as en } from "@wagmi/connectors"; import { createConfig as tn, createStorage as nn, injected as on, http as rn, cookieStorage as sn, getClient as an, disconnect as lt, writeContract as cn, getConnectors as ln, connect as dn, ConnectorAlreadyConnectedError as un, getChainId as wn, getAccount as bn, switchChain as dt, signMessage as fn } from "@wagmi/core"; import { N as y, M as Pe, j as mn, m as pn, b as kn, T as He, H as ut, n as gn, u as hn, c as xn, e as yn, r as vn } from "./index-DoYa-2VZ.mjs"; import { X as Cn, RotateCcw as Ae, CheckIcon as jn, CopyIcon as Nn, QrCodeIcon as Sn, ChevronLeft as En } from "lucide-react"; import * as H from "@radix-ui/react-dialog"; import { Drawer as Y } from "vaul"; import * as de from "@radix-ui/react-scroll-area"; import { useQuery as We, useMutation as Z, useQueryClient as An } from "@tanstack/react-query"; import { JsonRpcProvider as ae, FallbackProvider as ge, Contract as Le, formatUnits as Fe, parseUnits as Rn } from "ethers"; import { erc20Abi as wt } from "viem"; import { toast as ue } from "sonner"; import { Connection as Re, PublicKey as we, ComputeBudgetProgram as Te, Keypair as Tn, AddressLookupTableProgram as Ye, Transaction as In, TransactionMessage as Pn, VersionedTransaction as zn, clusterApiUrl as Wn } from "@solana/web3.js"; import { AnchorProvider as Mn, Program as On } from "@coral-xyz/anchor"; import { i as _n } from "./constants-BXtpLmkk.mjs"; import { useSession as Dn, signOut as Fn, getProviders as $n, signIn as bt } from "next-auth/react"; import { WalletAdapterNetwork as Je, WalletReadyState as _e } from "@solana/wallet-adapter-base"; import { s as ze, d as $e } from "./serialize-DsMsapZ4.mjs"; import { motion as G } from "framer-motion"; import { QRCodeSVG as Bn } from "qrcode.react"; import { Slot as Ln } from "@radix-ui/react-slot"; import { chainSol as Kn, chainSolDevnet as qn, isMainnet as Gn } from "./chains.js"; var Ie = { exports: {} }, je = {}; /** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Qe; function Un() { if (Qe) return je; Qe = 1; var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment"); function n(o, r, i) { var c = null; if (i !== void 0 && (c = "" + i), r.key !== void 0 && (c = "" + r.key), "key" in r) { i = {}; for (var a in r) a !== "key" && (i[a] = r[a]); } else i = r; return r = i.ref, { $$typeof: e, type: o, key: c, ref: r !== void 0 ? r : null, props: i }; } return je.Fragment = t, je.jsx = n, je.jsxs = n, je; } var Ne = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Xe; function Vn() { return Xe || (Xe = 1, process.env.NODE_ENV !== "production" && function() { function e(u) { if (u == null) return null; if (typeof u == "function") return u.$$typeof === U ? null : u.displayName || u.name || null; if (typeof u == "string") return u; switch (u) { case v: return "Fragment"; case h: return "Profiler"; case g: return "StrictMode"; case z: return "Suspense"; case M: return "SuspenseList"; case K: return "Activity"; } if (typeof u == "object") switch (typeof u.tag == "number" && console.error( "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." ), u.$$typeof) { case C: return "Portal"; case P: return (u.displayName || "Context") + ".Provider"; case j: return (u._context.displayName || "Context") + ".Consumer"; case T: var m = u.render; return u = u.displayName, u || (u = m.displayName || m.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u; case O: return m = u.displayName || null, m !== null ? m : e(u.type) || "Memo"; case J: m = u._payload, u = u._init; try { return e(u(m)); } catch { } } return null; } function t(u) { return "" + u; } function n(u) { try { t(u); var m = !1; } catch { m = !0; } if (m) { m = console; var A = m.error, W = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object"; return A.call( m, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", W ), t(u); } } function o(u) { if (u === v) return "<>"; if (typeof u == "object" && u !== null && u.$$typeof === J) return "<...>"; try { var m = e(u); return m ? "<" + m + ">" : "<...>"; } catch { return "<...>"; } } function r() { var u = q.A; return u === null ? null : u.getOwner(); } function i() { return Error("react-stack-top-frame"); } function c(u) { if (N.call(u, "key")) { var m = Object.getOwnPropertyDescriptor(u, "key").get; if (m && m.isReactWarning) return !1; } return u.key !== void 0; } function a(u, m) { function A() { fe || (fe = !0, console.error( "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", m )); } A.isReactWarning = !0, Object.defineProperty(u, "key", { get: A, configurable: !0 }); } function l() { var u = e(this.type); return ee[u] || (ee[u] = !0, console.error( "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." )), u = this.props.ref, u !== void 0 ? u : null; } function d(u, m, A, W, X, V, _, Me) { return A = V.ref, u = { $$typeof: k, type: u, key: m, props: V, _owner: X }, (A !== void 0 ? A : null) !== null ? Object.defineProperty(u, "ref", { enumerable: !1, get: l }) : Object.defineProperty(u, "ref", { enumerable: !1, value: null }), u._store = {}, Object.defineProperty(u._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: 0 }), Object.defineProperty(u, "_debugInfo", { configurable: !1, enumerable: !1, writable: !0, value: null }), Object.defineProperty(u, "_debugStack", { configurable: !1, enumerable: !1, writable: !0, value: _ }), Object.defineProperty(u, "_debugTask", { configurable: !1, enumerable: !1, writable: !0, value: Me }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u; } function b(u, m, A, W, X, V, _, Me) { var D = m.children; if (D !== void 0) if (W) if (L(D)) { for (W = 0; W < D.length; W++) w(D[W]); Object.freeze && Object.freeze(D); } else console.error( "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." ); else w(D); if (N.call(m, "key")) { D = e(u); var me = Object.keys(m).filter(function(Kt) { return Kt !== "key"; }); W = 0 < me.length ? "{key: someKey, " + me.join(": ..., ") + ": ...}" : "{key: someKey}", Q[D + W] || (me = 0 < me.length ? "{" + me.join(": ..., ") + ": ...}" : "{}", console.error( `A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`, W, D, me, D ), Q[D + W] = !0); } if (D = null, A !== void 0 && (n(A), D = "" + A), c(m) && (n(m.key), D = "" + m.key), "key" in m) { A = {}; for (var Oe in m) Oe !== "key" && (A[Oe] = m[Oe]); } else A = m; return D && a( A, typeof u == "function" ? u.displayName || u.name || "Unknown" : u ), d( u, D, V, X, r(), A, _, Me ); } function w(u) { typeof u == "object" && u !== null && u.$$typeof === k && u._store && (u._store.validated = 1); } var f = qt, k = Symbol.for("react.transitional.element"), C = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), j = Symbol.for("react.consumer"), P = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), z = Symbol.for("react.suspense"), M = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), J = Symbol.for("react.lazy"), K = Symbol.for("react.activity"), U = Symbol.for("react.client.reference"), q = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, L = Array.isArray, B = console.createTask ? console.createTask : function() { return null; }; f = { "react-stack-bottom-frame": function(u) { return u(); } }; var fe, ee = {}, oe = f["react-stack-bottom-frame"].bind( f, i )(), re = B(o(i)), Q = {}; Ne.Fragment = v, Ne.jsx = function(u, m, A, W, X) { var V = 1e4 > q.recentlyCreatedOwnerStacks++; return b( u, m, A, !1, W, X, V ? Error("react-stack-top-frame") : oe, V ? B(o(u)) : re ); }, Ne.jsxs = function(u, m, A, W, X) { var V = 1e4 > q.recentlyCreatedOwnerStacks++; return b( u, m, A, !0, W, X, V ? Error("react-stack-top-frame") : oe, V ? B(o(u)) : re ); }; }()), Ne; } var Ze; function Hn() { return Ze || (Ze = 1, process.env.NODE_ENV === "production" ? Ie.exports = Un() : Ie.exports = Vn()), Ie.exports; } var s = Hn(); const et = { home: "Connect", account: "Account", walletConnecting: "Wallet Connecting", selectETHWallet: "Select ETH Wallet", selectSolanaWallet: "Select Solana Wallet", walletqr: "Wallet QR", switchAccount: "Switch Account", switchingAccount: "Switching Account", switchChain: "Switch Chain", switchingChain: "Switching Chain", withdrawFunds: "Withdraw Funds", withdrawingFunds: "Withdrawing Funds", accountSigning: "Account Signing" }, p = { home: "home", account: "account", accountSigning: "accountSigning", socialConnecting: "socialConnecting", walletConnecting: "walletConnecting", selectETHWallet: "selectETHWallet", selectSolanaWallet: "selectSolanaWallet", walletqr: "walletqr", switchAccount: "switchAccount", switchingAccount: "switchingAccount", switchChain: "switchChain", switchingChain: "switchingChain", withdrawFunds: "withdrawFunds" }, Ke = Gt({ chains: [], wagmiConfig: null, signMessage: "based.bid welcomes you!!!", pendingItem: null, setPendingItem: () => { }, open: !1, setOpen: () => { }, router: p.home, setRouter: () => { } }), S = () => ct(Ke), qr = () => { const { open: e, setOpen: t, ...n } = ct(Ke); return { isOpen: e, openModal: () => { t(!0); }, closeModal: () => { t(!1); }, ...n }; }, Yn = ({ children: e, chains: t, host: n, name: o, description: r, icon: i, projectId: c, signMessage: a }) => { const [l, d] = pe(!1), [b, w] = pe(null), [f, k] = pe(null), C = Ue(() => { const g = t.filter( (j) => j.network.symbol === y.eth ), h = !(typeof window > "u") && (window == null ? void 0 : window.parent) !== window; return tn({ chains: g, connectors: [ on({ target: "metaMask" }), // walletConnectConnector.current, Zt({ appName: o, appLogoUrl: i, overrideIsMetaMask: !1, preference: "all" }), ...h ? [ en({ allowedDomains: [/gnosis-safe.io$/, /app.safe.global$/] }) ] : [] ], storage: nn({ storage: sn }), transports: Object.fromEntries( g.map((j) => [j.id, rn()]) ) }); }, [t]), v = Ue( () => [ new Ht(), new Yt(), new Jt(), new Qt(), new Xt() // new WalletConnectWalletAdapter({ // network: WalletAdapterNetwork.Mainnet, // options: { // relayUrl: "wss://relay.walletconnect.com", // projectId, // metadata: { // name, // description, // url: host, // icons: [icon], // }, // }, // }), ], [] ); return /* @__PURE__ */ s.jsx( Ke.Provider, { value: { chains: t, wagmiConfig: C, signMessage: a, open: l, setOpen: d, router: b, setRouter: w, pendingItem: f, setPendingItem: k }, children: /* @__PURE__ */ s.jsx(Ut, { wallets: v, autoConnect: !0, children: e }) } ); }; function ft(e) { var t, n, o = ""; if (typeof e == "string" || typeof e == "number") o += e; else if (typeof e == "object") if (Array.isArray(e)) { var r = e.length; for (t = 0; t < r; t++) e[t] && (n = ft(e[t])) && (o && (o += " "), o += n); } else for (n in e) e[n] && (o && (o += " "), o += n); return o; } function mt() { for (var e, t, n = 0, o = "", r = arguments.length; n < r; n++) (e = arguments[n]) && (t = ft(e)) && (o && (o += " "), o += t); return o; } const qe = "-", Jn = (e) => { const t = Xn(e), { conflictingClassGroups: n, conflictingClassGroupModifiers: o } = e; return { getClassGroupId: (c) => { const a = c.split(qe); return a[0] === "" && a.length !== 1 && a.shift(), pt(a, t) || Qn(c); }, getConflictingClassGroupIds: (c, a) => { const l = n[c] || []; return a && o[c] ? [...l, ...o[c]] : l; } }; }, pt = (e, t) => { var c; if (e.length === 0) return t.classGroupId; const n = e[0], o = t.nextPart.get(n), r = o ? pt(e.slice(1), o) : void 0; if (r) return r; if (t.validators.length === 0) return; const i = e.join(qe); return (c = t.validators.find(({ validator: a }) => a(i))) == null ? void 0 : c.classGroupId; }, tt = /^\[(.+)\]$/, Qn = (e) => { if (tt.test(e)) { const t = tt.exec(e)[1], n = t == null ? void 0 : t.substring(0, t.indexOf(":")); if (n) return "arbitrary.." + n; } }, Xn = (e) => { const { theme: t, prefix: n } = e, o = { nextPart: /* @__PURE__ */ new Map(), validators: [] }; return eo(Object.entries(e.classGroups), n).forEach(([i, c]) => { Be(c, o, i, t); }), o; }, Be = (e, t, n, o) => { e.forEach((r) => { if (typeof r == "string") { const i = r === "" ? t : nt(t, r); i.classGroupId = n; return; } if (typeof r == "function") { if (Zn(r)) { Be(r(o), t, n, o); return; } t.validators.push({ validator: r, classGroupId: n }); return; } Object.entries(r).forEach(([i, c]) => { Be(c, nt(t, i), n, o); }); }); }, nt = (e, t) => { let n = e; return t.split(qe).forEach((o) => { n.nextPart.has(o) || n.nextPart.set(o, { nextPart: /* @__PURE__ */ new Map(), validators: [] }), n = n.nextPart.get(o); }), n; }, Zn = (e) => e.isThemeGetter, eo = (e, t) => t ? e.map(([n, o]) => { const r = o.map((i) => typeof i == "string" ? t + i : typeof i == "object" ? Object.fromEntries(Object.entries(i).map(([c, a]) => [t + c, a])) : i); return [n, r]; }) : e, to = (e) => { if (e < 1) return { get: () => { }, set: () => { } }; let t = 0, n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(); const r = (i, c) => { n.set(i, c), t++, t > e && (t = 0, o = n, n = /* @__PURE__ */ new Map()); }; return { get(i) { let c = n.get(i); if (c !== void 0) return c; if ((c = o.get(i)) !== void 0) return r(i, c), c; }, set(i, c) { n.has(i) ? n.set(i, c) : r(i, c); } }; }, kt = "!", no = (e) => { const { separator: t, experimentalParseClassName: n } = e, o = t.length === 1, r = t[0], i = t.length, c = (a) => { const l = []; let d = 0, b = 0, w; for (let g = 0; g < a.length; g++) { let h = a[g]; if (d === 0) { if (h === r && (o || a.slice(g, g + i) === t)) { l.push(a.slice(b, g)), b = g + i; continue; } if (h === "/") { w = g; continue; } } h === "[" ? d++ : h === "]" && d--; } const f = l.length === 0 ? a : a.substring(b), k = f.startsWith(kt), C = k ? f.substring(1) : f, v = w && w > b ? w - b : void 0; return { modifiers: l, hasImportantModifier: k, baseClassName: C, maybePostfixModifierPosition: v }; }; return n ? (a) => n({ className: a, parseClassName: c }) : c; }, oo = (e) => { if (e.length <= 1) return e; const t = []; let n = []; return e.forEach((o) => { o[0] === "[" ? (t.push(...n.sort(), o), n = []) : n.push(o); }), t.push(...n.sort()), t; }, ro = (e) => ({ cache: to(e.cacheSize), parseClassName: no(e), ...Jn(e) }), io = /\s+/, so = (e, t) => { const { parseClassName: n, getClassGroupId: o, getConflictingClassGroupIds: r } = t, i = [], c = e.trim().split(io); let a = ""; for (let l = c.length - 1; l >= 0; l -= 1) { const d = c[l], { modifiers: b, hasImportantModifier: w, baseClassName: f, maybePostfixModifierPosition: k } = n(d); let C = !!k, v = o(C ? f.substring(0, k) : f); if (!v) { if (!C) { a = d + (a.length > 0 ? " " + a : a); continue; } if (v = o(f), !v) { a = d + (a.length > 0 ? " " + a : a); continue; } C = !1; } const g = oo(b).join(":"), h = w ? g + kt : g, j = h + v; if (i.includes(j)) continue; i.push(j); const P = r(v, C); for (let T = 0; T < P.length; ++T) { const z = P[T]; i.push(h + z); } a = d + (a.length > 0 ? " " + a : a); } return a; }; function ao() { let e = 0, t, n, o = ""; for (; e < arguments.length; ) (t = arguments[e++]) && (n = gt(t)) && (o && (o += " "), o += n); return o; } const gt = (e) => { if (typeof e == "string") return e; let t, n = ""; for (let o = 0; o < e.length; o++) e[o] && (t = gt(e[o])) && (n && (n += " "), n += t); return n; }; function co(e, ...t) { let n, o, r, i = c; function c(l) { const d = t.reduce((b, w) => w(b), e()); return n = ro(d), o = n.cache.get, r = n.cache.set, i = a, a(l); } function a(l) { const d = o(l); if (d) return d; const b = so(l, n); return r(l, b), b; } return function() { return i(ao.apply(null, arguments)); }; } const R = (e) => { const t = (n) => n[e] || []; return t.isThemeGetter = !0, t; }, ht = /^\[(?:([a-z-]+):)?(.+)\]$/i, lo = /^\d+\/\d+$/, uo = /* @__PURE__ */ new Set(["px", "full", "screen"]), wo = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, bo = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, fo = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/, mo = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, po = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, te = (e) => ke(e) || uo.has(e) || lo.test(e), ie = (e) => he(e, "length", jo), ke = (e) => !!e && !Number.isNaN(Number(e)), De = (e) => he(e, "number", ke), Se = (e) => !!e && Number.isInteger(Number(e)), ko = (e) => e.endsWith("%") && ke(e.slice(0, -1)), x = (e) => ht.test(e), se = (e) => wo.test(e), go = /* @__PURE__ */ new Set(["length", "size", "percentage"]), ho = (e) => he(e, go, xt), xo = (e) => he(e, "position", xt), yo = /* @__PURE__ */ new Set(["image", "url"]), vo = (e) => he(e, yo, So), Co = (e) => he(e, "", No), Ee = () => !0, he = (e, t, n) => { const o = ht.exec(e); return o ? o[1] ? typeof t == "string" ? o[1] === t : t.has(o[1]) : n(o[2]) : !1; }, jo = (e) => ( // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths. // For example, `hsl(0 0% 0%)` would be classified as a length without this check. // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough. bo.test(e) && !fo.test(e) ), xt = () => !1, No = (e) => mo.test(e), So = (e) => po.test(e), Eo = () => { const e = R("colors"), t = R("spacing"), n = R("blur"), o = R("brightness"), r = R("borderColor"), i = R("borderRadius"), c = R("borderSpacing"), a = R("borderWidth"), l = R("contrast"), d = R("grayscale"), b = R("hueRotate"), w = R("invert"), f = R("gap"), k = R("gradientColorStops"), C = R("gradientColorStopPositions"), v = R("inset"), g = R("margin"), h = R("opacity"), j = R("padding"), P = R("saturate"), T = R("scale"), z = R("sepia"), M = R("skew"), O = R("space"), J = R("translate"), K = () => ["auto", "contain", "none"], U = () => ["auto", "hidden", "clip", "visible", "scroll"], q = () => ["auto", x, t], N = () => [x, t], L = () => ["", te, ie], B = () => ["auto", ke, x], fe = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], ee = () => ["solid", "dashed", "dotted", "double", "none"], oe = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], re = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], Q = () => ["", "0", x], u = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], m = () => [ke, x]; return { cacheSize: 500, separator: ":", theme: { colors: [Ee], spacing: [te, ie], blur: ["none", "", se, x], brightness: m(), borderColor: [e], borderRadius: ["none", "", "full", se, x], borderSpacing: N(), borderWidth: L(), contrast: m(), grayscale: Q(), hueRotate: m(), invert: Q(), gap: N(), gradientColorStops: [e], gradientColorStopPositions: [ko, ie], inset: q(), margin: q(), opacity: m(), padding: N(), saturate: m(), scale: m(), sepia: Q(), skew: m(), space: N(), translate: N() }, classGroups: { // Layout /** * Aspect Ratio * @see https://tailwindcss.com/docs/aspect-ratio */ aspect: [{ aspect: ["auto", "square", "video", x] }], /** * Container * @see https://tailwindcss.com/docs/container */ container: ["container"], /** * Columns * @see https://tailwindcss.com/docs/columns */ columns: [{ columns: [se] }], /** * Break After * @see https://tailwindcss.com/docs/break-after */ "break-after": [{ "break-after": u() }], /** * Break Before * @see https://tailwindcss.com/docs/break-before */ "break-before": [{ "break-before": u() }], /** * Break Inside * @see https://tailwindcss.com/docs/break-inside */ "break-inside": [{ "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"] }], /** * Box Decoration Break * @see https://tailwindcss.com/docs/box-decoration-break */ "box-decoration": [{ "box-decoration": ["slice", "clone"] }], /** * Box Sizing * @see https://tailwindcss.com/docs/box-sizing */ box: [{ box: ["border", "content"] }], /** * Display * @see https://tailwindcss.com/docs/display */ display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"], /** * Floats * @see https://tailwindcss.com/docs/float */ float: [{ float: ["right", "left", "none", "start", "end"] }], /** * Clear * @see https://tailwindcss.com/docs/clear */ clear: [{ clear: ["left", "right", "both", "none", "start", "end"] }], /** * Isolation * @see https://tailwindcss.com/docs/isolation */ isolation: ["isolate", "isolation-auto"], /** * Object Fit * @see https://tailwindcss.com/docs/object-fit */ "object-fit": [{ object: ["contain", "cover", "fill", "none", "scale-down"] }], /** * Object Position * @see https://tailwindcss.com/docs/object-position */ "object-position": [{ object: [...fe(), x] }], /** * Overflow * @see https://tailwindcss.com/docs/overflow */ overflow: [{ overflow: U() }], /** * Overflow X * @see https://tailwindcss.com/docs/overflow */ "overflow-x": [{ "overflow-x": U() }], /** * Overflow Y * @see https://tailwindcss.com/docs/overflow */ "overflow-y": [{ "overflow-y": U() }], /** * Overscroll Behavior * @see https://tailwindcss.com/docs/overscroll-behavior */ overscroll: [{ overscroll: K() }], /** * Overscroll Behavior X * @see https://tailwindcss.com/docs/overscroll-behavior */ "overscroll-x": [{ "overscroll-x": K() }], /** * Overscroll Behavior Y * @see https://tailwindcss.com/docs/overscroll-behavior */ "overscroll-y": [{ "overscroll-y": K() }], /** * Position * @see https://tailwindcss.com/docs/position */ position: ["static", "fixed", "absolute", "relative", "sticky"], /** * Top / Right / Bottom / Left * @see https://tailwindcss.com/docs/top-right-bottom-left */ inset: [{ inset: [v] }], /** * Right / Left * @see https://tailwindcss.com/docs/top-right-bottom-left */ "inset-x": [{ "inset-x": [v] }], /** * Top / Bottom * @see https://tailwindcss.com/docs/top-right-bottom-left */ "inset-y": [{ "inset-y": [v] }], /** * Start * @see https://tailwindcss.com/docs/top-right-bottom-left */ start: [{ start: [v] }], /** * End * @see https://tailwindcss.com/docs/top-right-bottom-left */ end: [{ end: [v] }], /** * Top * @see https://tailwindcss.com/docs/top-right-bottom-left */ top: [{ top: [v] }], /** * Right * @see https://tailwindcss.com/docs/top-right-bottom-left */ right: [{ right: [v] }], /** * Bottom * @see https://tailwindcss.com/docs/top-right-bottom-left */ bottom: [{ bottom: [v] }], /** * Left * @see https://tailwindcss.com/docs/top-right-bottom-left */ left: [{ left: [v] }], /** * Visibility * @see https://tailwindcss.com/docs/visibility */ visibility: ["visible", "invisible", "collapse"], /** * Z-Index * @see https://tailwindcss.com/docs/z-index */ z: [{ z: ["auto", Se, x] }], // Flexbox and Grid /** * Flex Basis * @see https://tailwindcss.com/docs/flex-basis */ basis: [{ basis: q() }], /** * Flex Direction * @see https://tailwindcss.com/docs/flex-direction */ "flex-direction": [{ flex: ["row", "row-reverse", "col", "col-reverse"] }], /** * Flex Wrap * @see https://tailwindcss.com/docs/flex-wrap */ "flex-wrap": [{ flex: ["wrap", "wrap-reverse", "nowrap"] }], /** * Flex * @see https://tailwindcss.com/docs/flex */ flex: [{ flex: ["1", "auto", "initial", "none", x] }], /** * Flex Grow * @see https://tailwindcss.com/docs/flex-grow */ grow: [{ grow: Q() }], /** * Flex Shrink * @see https://tailwindcss.com/docs/flex-shrink */ shrink: [{ shrink: Q() }], /** * Order * @see https://tailwindcss.com/docs/order */ order: [{ order: ["first", "last", "none", Se, x] }], /** * Grid Template Columns * @see https://tailwindcss.com/docs/grid-template-columns */ "grid-cols": [{ "grid-cols": [Ee] }], /** * Grid Column Start / End * @see https://tailwindcss.com/docs/grid-column */ "col-start-end": [{ col: ["auto", { span: ["full", Se, x] }, x] }], /** * Grid Column Start * @see https://tailwindcss.com/docs/grid-column */ "col-start": [{ "col-start": B() }], /** * Grid Column End * @see https://tailwindcss.com/docs/grid-column */ "col-end": [{ "col-end": B() }], /** * Grid Template Rows * @see https://tailwindcss.com/docs/grid-template-rows */ "grid-rows": [{ "grid-rows": [Ee] }], /** * Grid Row Start / End * @see https://tailwindcss.com/docs/grid-row */ "row-start-end": [{ row: ["auto", { span: [Se, x] }, x] }], /** * Grid Row Start * @see https://tailwindcss.com/docs/grid-row */ "row-start": [{ "row-start": B() }], /** * Grid Row End * @see https://tailwindcss.com/docs/grid-row */ "row-end": [{ "row-end": B() }], /** * Grid Auto Flow * @see https://tailwindcss.com/docs/grid-auto-flow */ "grid-flow": [{ "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"] }], /** * Grid Auto Columns * @see https://tailwindcss.com/docs/grid-auto-columns */ "auto-cols": [{ "auto-cols": ["auto", "min", "max", "fr", x] }], /** * Grid Auto Rows * @see https://tailwindcss.com/docs/grid-auto-rows */ "auto-rows": [{ "auto-rows": ["auto", "min", "max", "fr", x] }], /** * Gap * @see https://tailwindcss.com/docs/gap */ gap: [{ gap: [f] }], /** * Gap X * @see https://tailwindcss.com/docs/gap */ "gap-x": [{ "gap-x": [f] }], /** * Gap Y * @see https://tailwindcss.com/docs/gap */ "gap-y": [{ "gap-y": [f] }], /** * Justify Content * @see https://tailwindcss.com/docs/justify-content */ "justify-content": [{ justify: ["normal", ...re()] }], /** * Justify Items * @see https://tailwindcss.com/docs/justify-items */ "justify-items": [{ "justify-items": ["start", "end", "center", "stretch"] }], /** * Justify Self * @see https://tailwindcss.com/docs/justify-self */ "justify-self": [{ "justify-self": ["auto", "start", "end", "center", "stretch"] }], /** * Align Content * @see https://tailwindcss.com/docs/align-content */ "align-content": [{ content: ["normal", ...re(), "baseline"] }], /** * Align Items * @see https://tailwindcss.com/docs/align-items */ "align-items": [{ items: ["start", "end", "center", "baseline", "stretch"] }], /** * Align Self * @see https://tailwindcss.com/docs/align-self */ "align-self": [{ self: ["auto", "start", "end", "center", "stretch", "baseline"] }], /** * Place Content * @see https://tailwindcss.com/docs/place-content */ "place-content": [{ "place-content": [...re(), "baseline"] }], /** * Place Items * @see https://tailwindcss.com/docs/place-items */ "place-items": [{ "place-items": ["start", "end", "center", "baseline", "stretch"] }], /** * Place Self * @see https://tailwindcss.com/docs/place-self */ "place-self": [{ "place-self": ["auto", "start", "end", "center", "stretch"] }], // Spacing /** * Padding * @see https://tailwindcss.com/docs/padding */ p: [{ p: [j] }], /** * Padding X * @see https://tailwindcss.com/docs/padding */ px: [{ px: [j] }], /** * Padding Y * @see https://tailwindcss.com/docs/padding */ py: [{ py: [j] }], /** * Padding Start * @see https://tailwindcss.com/docs/padding */ ps: [{ ps: [j] }], /** * Padding End * @see https://tailwindcss.com/docs/padding */ pe: [{ pe: [j] }], /** * Padding Top * @see https://tailwindcss.com/docs/padding */ pt: [{ pt: [j] }], /** * Padding Right * @see https://tailwindcss.com/docs/padding */ pr: [{ pr: [j] }], /** * Padding Bottom * @see https://tailwindcss.com/docs/padding */ pb: [{ pb: [j] }], /** * Padding Left * @see https://tailwindcss.com/docs/padding */ pl: [{ pl: [j] }], /** * Margin * @see https://tailwindcss.com/docs/margin */ m: [{ m: [g] }], /** * Margin X * @see https://tailwindcss.com/docs/margin */ mx: [{ mx: [g] }], /** * Margin Y * @see https://tailwindcss.com/docs/margin */ my: [{ my: [g] }], /** * Margin Start * @see https://tailwindcss.com/docs/margin */ ms: [{ ms: [g] }], /** * Margin End * @see https://tailwindcss.com/docs/margin */ me: [{ me: [g] }], /** * Margin Top * @see https://tailwindcss.com/docs/margin */ mt: [{ mt: [g] }], /** * Margin Right * @see https://tailwindcss.com/docs/margin */ mr: [{ mr: [g] }], /** * Margin Bottom * @see https://tailwindcss.com/docs/margin */ mb: [{ mb: [g] }], /** * Margin Left * @see https://tailwindcss.com/docs/margin */ ml: [{ ml: [g] }], /** * Space Between X * @see https://tailwindcss.com/docs/space */ "space-x": [{ "space-x": [O] }], /** * Space Between X Reverse * @see https://tailwindcss.com/docs/space */ "space-x-reverse": ["space-x-reverse"], /** * Space Between Y * @see https://tailwindcss.com/docs/space */ "space-y": [{ "space-y": [O] }], /** * Space Between Y Reverse * @see https://tailwindcss.com/docs/space */ "space-y-reverse": ["space-y-reverse"], // Sizing /** * Width * @see https://tailwindcss.com/docs/width */ w: [{ w: ["auto", "min", "max", "fit", "svw", "lvw", "dvw", x, t] }], /** * Min-Width * @see https://tailwindcss.com/docs/min-width */ "min-w": [{ "min-w": [x, t, "min", "max", "fit"] }], /** * Max-Width * @see https://tailwindcss.com/docs/max-width */ "max-w": [{ "max-w": [x, t, "none", "full", "min", "max", "fit", "prose", { screen: [se] }, se] }], /** * Height * @see https://tailwindcss.com/docs/height */ h: [{ h: [x, t, "auto", "min", "max", "fit", "svh", "lvh", "dvh"] }], /** * Min-Height * @see https://tailwindcss.com/docs/min-height */ "min-h": [{ "min-h": [x, t, "min", "max", "fit", "svh", "lvh", "dvh"] }], /** * Max-Height * @see https://tailwindcss.com/docs/max-height */ "max-h": [{ "max-h": [x, t, "min", "max", "fit", "svh", "lvh", "dvh"] }], /** * Size * @see https://tailwindcss.com/docs/size */ size: [{ size: [x, t, "auto", "min", "max", "fit"] }], // Typography /** * Font Size * @see https://tailwindcss.com/docs/font-size */ "font-size": [{ text: ["base", se, ie] }], /** * Font Smoothing * @see https://tailwindcss.com/docs/font-smoothing */ "font-smoothing": ["antialiased", "subpixel-antialiased"], /** * Font Style * @see https://tailwindcss.com/docs/font-style */ "font-style": ["italic", "not-italic"], /** * Font Weight * @see https://tailwindcss.com/docs/font-weight */ "font-weight": [{ font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", De] }], /** * Font Family * @see https://tailwindcss.com/docs/font-family */ "font-family": [{ font: [Ee] }], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ "fvn-normal": ["normal-nums"], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ "fvn-ordinal": ["ordinal"], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ "fvn-slashed-zero": ["slashed-zero"], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ "fvn-figure": ["lining-nums", "oldstyle-nums"], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ "fvn-spacing": ["proportional-nums", "tabular-nums"], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ "fvn-fraction": ["diagonal-fractions", "stacked-fractions"], /** * Letter Spacing * @see https://tailwindcss.com/docs/letter-spacing */ tracking: [{ tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", x] }], /** * Line Clamp * @see https://tailwindcss.com/docs/line-clamp */ "line-clamp": [{ "line-clamp": ["none", ke, De] }], /** * Line Height * @see https://tailwindcss.com/docs/line-height */ leading: [{ leading: ["none", "tight", "snug", "normal", "relaxed", "loose", te, x] }], /** * List Style Image * @see https://tailwindcss.com/docs/list-style-image */ "list-image": [{ "list-image": ["none", x] }], /** * List Style Type * @see https://tailwindcss.com/docs/list-style-type */ "list-style-type": [{ list: ["none", "disc", "decimal", x] }], /** * List Style Position * @see https://tailwindcss.com/docs/list-style-position */ "list-style-position": [{ list: ["inside", "outside"] }], /** * Placeholder Color * @deprecated since Tailwind CSS v3.0.0 * @see https://tailwindcss.com/docs/placeholder-color */ "placeholder-color": [{ placeholder: [e] }], /** * Placeholder Opacity * @see https://tailwindcss.com/docs/placeholder-opacity */ "placeholder-opacity": [{ "placeholder-opacity": [h] }], /** * Text Alignment * @see https://tailwindcss.com/docs/text-align */ "text-alignment": [{ text: ["left", "center", "right", "justify", "start", "end"] }], /** * Text Color * @see https://tailwindcss.com/docs/text-color */ "text-color": [{ text: [e] }], /** * Text Opacity * @see https://tailwindcss.com/docs/text-opacity */ "text-opacity": [{ "text-opacity": [h] }], /** * Text Decoration * @see https://tailwindcss.com/docs/text-decoration */ "text-decoration": ["underline", "overline", "line-through", "no-underline"], /** * Text Decoration Style * @see https://tailwindcss.com/docs/text-decoration-style */ "text-decoration-style": [{ decoration: [...ee(), "wavy"] }], /** * Text Decoration Thickness * @see https://tailwindcss.com/docs/text-decoration-thickness */ "text-decoration-thickness": [{ decoration: ["auto", "from-font", te, ie] }], /** * Text Underline Offset * @see https://tailwindcss.com/docs/text-underline-offset */ "underline-offset": [{ "underline-offset": ["auto", te, x] }], /** * Text Decoration Color * @see https://tailwindcss.com/docs/text-decoration-color */ "text-decoration-color": [{ decoration: [e] }], /** * Text Transform * @see https://tailwindcss.com/docs/text-transform */ "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"], /** * Text Overflow * @see https://tailwindcss.com/docs/text-overflow */ "text-overflow": ["truncate", "text-ellipsis", "text-clip"], /** * Text Wrap * @see https://tailwindcss.com/docs/text-wrap */ "text-wrap": [{ text: ["wrap", "nowrap", "balance", "pretty"] }], /** * Text Indent * @see https://tailwindcss.com/docs/text-indent */ indent: [{ indent: N() }], /** * Vertical Alignment * @see https://tailwindcss.com/docs/vertical-align */ "vertical-align": [{ align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", x] }], /** * Whitespace * @see https://tailwindcss.com/docs/whitespace */ whitespace: [{ whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"] }], /** * Word Break * @see https://tailwindcss.com/docs/word-break */ break: [{ break: ["normal", "words", "all", "keep"] }], /** * Hyphens * @see https://tailwindcss.com/docs/hyphens */ hyphens: [{ hyphens: ["none", "manual", "auto"] }], /** * Content * @see https://tailwindcss.com/docs/content */ content: [{ content: ["none", x] }], // Backgrounds /** * Background Attachment * @see https://tailwindcss.com/docs/background-attachment */ "bg-attachment": [{ bg: ["fixed", "local", "scroll"] }], /** * Background Clip * @see https://tailwindcss.com/docs/background-clip */ "bg-clip": [{ "bg-clip": ["border", "padding", "content", "text"] }], /** * Background Opacity * @deprecated since Tailwind CSS v3.0.0 * @see https://tailwindcss.com/docs/background-opacity */ "bg-opacity": [{ "bg-opacity": [h] }], /** * Background Origin * @see https://tailwindcss.com/docs/background-origin */ "bg-origin": [{ "bg-origin": ["border", "padding", "content"] }], /** * Background Position * @see https://tailwindcss.com/docs/background-position */ "bg-position": [{ bg: [...fe(), xo] }], /** * Background Repeat * @see https://tailwindcss.com/docs/background-repeat */ "bg-repeat": [{ bg: ["no-repeat", { repeat: ["", "x", "y", "round", "space"] }] }], /** * Background Size * @see https://tailwindcss.com/docs/background-size */ "bg-size": [{ bg: ["auto", "cover", "contain", ho] }], /** * Background Image * @see https://tailwindcss.com/docs/background-image */ "bg-image": [{ bg: ["none", { "gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"] }, vo] }], /** * Background Color * @see https://tailwindcss.com/docs/background-color */ "bg-color": [{ bg: [e] }], /** * Gradient Color Stops From Position * @see https://tailwindcss.com/docs/gradient-color-stops */ "gradient-from-pos": [{ from: [C] }], /** * Gradient Color Stops Via Position * @see https://tailwindcss.com/docs/gradient-color-stops */ "gradient-via-pos": [{ via: [C] }], /** * Gradient Color Stops To Position * @see https://tailwindcss.com/docs/gradient-color-stops */ "gradient-to-pos": [{ to: [C] }], /** * Gradient Color Stops From * @see https://tailwindcss.com/docs/gradient-color-stops */ "gradient-from": [{ from: [k] }], /** * Gradient Color Stops Via * @see https://tailwindcss.com/docs/gradient-color-stops */ "gradient-via": [{ via: [k] }], /** * Gradient Color Stops To * @see https://tailwindcss.com/docs/gradient-color-stops */ "gradient-to": [{ to: [k] }], // Borders /** * Border Radius * @see https://tailwindcss.com/docs/border-radius */ rounded: [{ rounded: [i] }], /** * Border Radius Start * @see https://tailwindcss.com/docs/border-radius */ "rounded-s": [{ "rounded-s": [i] }], /** * Border Radius End * @see https://tailwindcss.com/docs/border-radius */ "rounded-e": [{ "rounded-e": [i] }], /** * Border Radius Top * @see https://tailwindcss.com/docs/border-radius */ "rounded-t": [{ "rounded-t": [i] }], /** * Border Radius Right * @see https://tailwindcss.com/docs/border-radius */ "rounded-r": [{ "rounded-r": [i] }], /** * Border Radius Bottom * @see https://tailwindcss.com/docs/border-radius */ "rounded-b": [{ "rounded-b": [i] }], /** * Border Radius Left * @see https://tailwindcss.com/docs/border-radius */ "rounded-l": [{ "rounded-l": [i] }], /** * Border Radius Start Start * @see https://tailwindcss.com/docs/border-radius */ "rounded-ss": [{ "rounded-ss": [i] }], /** * Border Radius Start End * @see https://tailwindcss.com/docs/border-radius */ "rounded-se": [{ "rounded-se": [i] }], /** * Border Radius End End * @see https://tailwindcss.com/docs/border-radius */ "rounded-ee": [{ "rounded-ee": [i] }], /** * Border Radius End Start * @see https://tailwindcss.com/docs/border-radius */ "rounded-es": [{ "rounded-es": [i] }],