UNPKG

@starter-ui/core

Version:

This is a UI Components built with the utility classes from Tailwind CSS.

1,677 lines (1,675 loc) 178 kB
import Me, { createContext as Re, useContext as ie, useEffect as ee, useState as se, useMemo as ue, forwardRef as Cr, createElement as Oe, useRef as B, useLayoutEffect as Je, useCallback as ge } from "react"; import Sr from "react-dom"; var qe = { exports: {} }, _e = {}; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var xr; function pt() { if (xr) return _e; xr = 1; var e = Me, r = Symbol.for("react.element"), n = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 }; function c(l, d, g) { var p, m = {}, w = null, N = null; g !== void 0 && (w = "" + g), d.key !== void 0 && (w = "" + d.key), d.ref !== void 0 && (N = d.ref); for (p in d) s.call(d, p) && !o.hasOwnProperty(p) && (m[p] = d[p]); if (l && l.defaultProps) for (p in d = l.defaultProps, d) m[p] === void 0 && (m[p] = d[p]); return { $$typeof: r, type: l, key: w, ref: N, props: m, _owner: i.current }; } return _e.Fragment = n, _e.jsx = c, _e.jsxs = c, _e; } var Ne = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var vr; function gt() { return vr || (vr = 1, process.env.NODE_ENV !== "production" && function() { var e = Me, r = Symbol.for("react.element"), n = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), l = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), N = Symbol.for("react.offscreen"), j = Symbol.iterator, h = "@@iterator"; function b(a) { if (a === null || typeof a != "object") return null; var f = j && a[j] || a[h]; return typeof f == "function" ? f : null; } var y = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function v(a) { { for (var f = arguments.length, x = new Array(f > 1 ? f - 1 : 0), k = 1; k < f; k++) x[k - 1] = arguments[k]; P("error", a, x); } } function P(a, f, x) { { var k = y.ReactDebugCurrentFrame, T = k.getStackAddendum(); T !== "" && (f += "%s", x = x.concat([T])); var O = x.map(function(I) { return String(I); }); O.unshift("Warning: " + f), Function.prototype.apply.call(console[a], console, O); } } var S = !1, A = !1, W = !1, K = !1, re = !1, F; F = Symbol.for("react.module.reference"); function X(a) { return !!(typeof a == "string" || typeof a == "function" || a === s || a === o || re || a === i || a === g || a === p || K || a === N || S || A || W || typeof a == "object" && a !== null && (a.$$typeof === w || a.$$typeof === m || a.$$typeof === c || a.$$typeof === l || a.$$typeof === d || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. a.$$typeof === F || a.getModuleId !== void 0)); } function D(a, f, x) { var k = a.displayName; if (k) return k; var T = f.displayName || f.name || ""; return T !== "" ? x + "(" + T + ")" : x; } function _(a) { return a.displayName || "Context"; } function V(a) { if (a == null) return null; if (typeof a.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof a == "function") return a.displayName || a.name || null; if (typeof a == "string") return a; switch (a) { case s: return "Fragment"; case n: return "Portal"; case o: return "Profiler"; case i: return "StrictMode"; case g: return "Suspense"; case p: return "SuspenseList"; } if (typeof a == "object") switch (a.$$typeof) { case l: var f = a; return _(f) + ".Consumer"; case c: var x = a; return _(x._context) + ".Provider"; case d: return D(a, a.render, "ForwardRef"); case m: var k = a.displayName || null; return k !== null ? k : V(a.type) || "Memo"; case w: { var T = a, O = T._payload, I = T._init; try { return V(I(O)); } catch { return null; } } } return null; } var M = Object.assign, H = 0, ne, le, $, Y, R, z, Q; function he() { } he.__reactDisabledLog = !0; function Dr() { { if (H === 0) { ne = console.log, le = console.info, $ = console.warn, Y = console.error, R = console.group, z = console.groupCollapsed, Q = console.groupEnd; var a = { configurable: !0, enumerable: !0, value: he, writable: !0 }; Object.defineProperties(console, { info: a, log: a, warn: a, error: a, group: a, groupCollapsed: a, groupEnd: a }); } H++; } } function Wr() { { if (H--, H === 0) { var a = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: M({}, a, { value: ne }), info: M({}, a, { value: le }), warn: M({}, a, { value: $ }), error: M({}, a, { value: Y }), group: M({}, a, { value: R }), groupCollapsed: M({}, a, { value: z }), groupEnd: M({}, a, { value: Q }) }); } H < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var Le = y.ReactCurrentDispatcher, Fe; function Ie(a, f, x) { { if (Fe === void 0) try { throw Error(); } catch (T) { var k = T.stack.trim().match(/\n( *(at )?)/); Fe = k && k[1] || ""; } return ` ` + Fe + a; } } var De = !1, $e; { var Vr = typeof WeakMap == "function" ? WeakMap : Map; $e = new Vr(); } function nr(a, f) { if (!a || De) return ""; { var x = $e.get(a); if (x !== void 0) return x; } var k; De = !0; var T = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var O; O = Le.current, Le.current = null, Dr(); try { if (f) { var I = function() { throw Error(); }; if (Object.defineProperty(I.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(I, []); } catch (J) { k = J; } Reflect.construct(a, [], I); } else { try { I.call(); } catch (J) { k = J; } a.call(I.prototype); } } else { try { throw Error(); } catch (J) { k = J; } a(); } } catch (J) { if (J && k && typeof J.stack == "string") { for (var E = J.stack.split(` `), q = k.stack.split(` `), G = E.length - 1, U = q.length - 1; G >= 1 && U >= 0 && E[G] !== q[U]; ) U--; for (; G >= 1 && U >= 0; G--, U--) if (E[G] !== q[U]) { if (G !== 1 || U !== 1) do if (G--, U--, U < 0 || E[G] !== q[U]) { var te = ` ` + E[G].replace(" at new ", " at "); return a.displayName && te.includes("<anonymous>") && (te = te.replace("<anonymous>", a.displayName)), typeof a == "function" && $e.set(a, te), te; } while (G >= 1 && U >= 0); break; } } } finally { De = !1, Le.current = O, Wr(), Error.prepareStackTrace = T; } var me = a ? a.displayName || a.name : "", pe = me ? Ie(me) : ""; return typeof a == "function" && $e.set(a, pe), pe; } function Gr(a, f, x) { return nr(a, !1); } function Br(a) { var f = a.prototype; return !!(f && f.isReactComponent); } function ze(a, f, x) { if (a == null) return ""; if (typeof a == "function") return nr(a, Br(a)); if (typeof a == "string") return Ie(a); switch (a) { case g: return Ie("Suspense"); case p: return Ie("SuspenseList"); } if (typeof a == "object") switch (a.$$typeof) { case d: return Gr(a.render); case m: return ze(a.type, f, x); case w: { var k = a, T = k._payload, O = k._init; try { return ze(O(T), f, x); } catch { } } } return ""; } var je = Object.prototype.hasOwnProperty, ar = {}, or = y.ReactDebugCurrentFrame; function Te(a) { if (a) { var f = a._owner, x = ze(a.type, a._source, f ? f.type : null); or.setExtraStackFrame(x); } else or.setExtraStackFrame(null); } function Kr(a, f, x, k, T) { { var O = Function.call.bind(je); for (var I in a) if (O(a, I)) { var E = void 0; try { if (typeof a[I] != "function") { var q = Error((k || "React class") + ": " + x + " type `" + I + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[I] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw q.name = "Invariant Violation", q; } E = a[I](f, I, k, x, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (G) { E = G; } E && !(E instanceof Error) && (Te(T), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", k || "React class", x, I, typeof E), Te(null)), E instanceof Error && !(E.message in ar) && (ar[E.message] = !0, Te(T), v("Failed %s type: %s", x, E.message), Te(null)); } } } var Ur = Array.isArray; function We(a) { return Ur(a); } function Yr(a) { { var f = typeof Symbol == "function" && Symbol.toStringTag, x = f && a[Symbol.toStringTag] || a.constructor.name || "Object"; return x; } } function qr(a) { try { return lr(a), !1; } catch { return !0; } } function lr(a) { return "" + a; } function cr(a) { if (qr(a)) return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Yr(a)), lr(a); } var ke = y.ReactCurrentOwner, Xr = { key: !0, ref: !0, __self: !0, __source: !0 }, ir, ur, Ve; Ve = {}; function Jr(a) { if (je.call(a, "ref")) { var f = Object.getOwnPropertyDescriptor(a, "ref").get; if (f && f.isReactWarning) return !1; } return a.ref !== void 0; } function Zr(a) { if (je.call(a, "key")) { var f = Object.getOwnPropertyDescriptor(a, "key").get; if (f && f.isReactWarning) return !1; } return a.key !== void 0; } function Hr(a, f) { if (typeof a.ref == "string" && ke.current && f && ke.current.stateNode !== f) { var x = V(ke.current.type); Ve[x] || (v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', V(ke.current.type), a.ref), Ve[x] = !0); } } function Qr(a, f) { { var x = function() { ir || (ir = !0, v("%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://reactjs.org/link/special-props)", f)); }; x.isReactWarning = !0, Object.defineProperty(a, "key", { get: x, configurable: !0 }); } } function et(a, f) { { var x = function() { ur || (ur = !0, v("%s: `ref` 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://reactjs.org/link/special-props)", f)); }; x.isReactWarning = !0, Object.defineProperty(a, "ref", { get: x, configurable: !0 }); } } var rt = function(a, f, x, k, T, O, I) { var E = { // This tag allows us to uniquely identify this as a React Element $$typeof: r, // Built-in properties that belong on the element type: a, key: f, ref: x, props: I, // Record the component responsible for creating this element. _owner: O }; return E._store = {}, Object.defineProperty(E._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(E, "_self", { configurable: !1, enumerable: !1, writable: !1, value: k }), Object.defineProperty(E, "_source", { configurable: !1, enumerable: !1, writable: !1, value: T }), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E; }; function tt(a, f, x, k, T) { { var O, I = {}, E = null, q = null; x !== void 0 && (cr(x), E = "" + x), Zr(f) && (cr(f.key), E = "" + f.key), Jr(f) && (q = f.ref, Hr(f, T)); for (O in f) je.call(f, O) && !Xr.hasOwnProperty(O) && (I[O] = f[O]); if (a && a.defaultProps) { var G = a.defaultProps; for (O in G) I[O] === void 0 && (I[O] = G[O]); } if (E || q) { var U = typeof a == "function" ? a.displayName || a.name || "Unknown" : a; E && Qr(I, U), q && et(I, U); } return rt(a, E, q, T, k, ke.current, I); } } var Ge = y.ReactCurrentOwner, dr = y.ReactDebugCurrentFrame; function be(a) { if (a) { var f = a._owner, x = ze(a.type, a._source, f ? f.type : null); dr.setExtraStackFrame(x); } else dr.setExtraStackFrame(null); } var Be; Be = !1; function Ke(a) { return typeof a == "object" && a !== null && a.$$typeof === r; } function fr() { { if (Ge.current) { var a = V(Ge.current.type); if (a) return ` Check the render method of \`` + a + "`."; } return ""; } } function st(a) { return ""; } var pr = {}; function nt(a) { { var f = fr(); if (!f) { var x = typeof a == "string" ? a : a.displayName || a.name; x && (f = ` Check the top-level render call using <` + x + ">."); } return f; } } function gr(a, f) { { if (!a._store || a._store.validated || a.key != null) return; a._store.validated = !0; var x = nt(f); if (pr[x]) return; pr[x] = !0; var k = ""; a && a._owner && a._owner !== Ge.current && (k = " It was passed a child from " + V(a._owner.type) + "."), be(a), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', x, k), be(null); } } function hr(a, f) { { if (typeof a != "object") return; if (We(a)) for (var x = 0; x < a.length; x++) { var k = a[x]; Ke(k) && gr(k, f); } else if (Ke(a)) a._store && (a._store.validated = !0); else if (a) { var T = b(a); if (typeof T == "function" && T !== a.entries) for (var O = T.call(a), I; !(I = O.next()).done; ) Ke(I.value) && gr(I.value, f); } } } function at(a) { { var f = a.type; if (f == null || typeof f == "string") return; var x; if (typeof f == "function") x = f.propTypes; else if (typeof f == "object" && (f.$$typeof === d || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. f.$$typeof === m)) x = f.propTypes; else return; if (x) { var k = V(f); Kr(x, a.props, "prop", k, a); } else if (f.PropTypes !== void 0 && !Be) { Be = !0; var T = V(f); v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", T || "Unknown"); } typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function ot(a) { { for (var f = Object.keys(a.props), x = 0; x < f.length; x++) { var k = f[x]; if (k !== "children" && k !== "key") { be(a), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", k), be(null); break; } } a.ref !== null && (be(a), v("Invalid attribute `ref` supplied to `React.Fragment`."), be(null)); } } var br = {}; function mr(a, f, x, k, T, O) { { var I = X(a); if (!I) { var E = ""; (a === void 0 || typeof a == "object" && a !== null && Object.keys(a).length === 0) && (E += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var q = st(); q ? E += q : E += fr(); var G; a === null ? G = "null" : We(a) ? G = "array" : a !== void 0 && a.$$typeof === r ? (G = "<" + (V(a.type) || "Unknown") + " />", E = " Did you accidentally export a JSX literal instead of a component?") : G = typeof a, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", G, E); } var U = tt(a, f, x, T, O); if (U == null) return U; if (I) { var te = f.children; if (te !== void 0) if (k) if (We(te)) { for (var me = 0; me < te.length; me++) hr(te[me], a); Object.freeze && Object.freeze(te); } else v("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 hr(te, a); } if (je.call(f, "key")) { var pe = V(a), J = Object.keys(f).filter(function(ft) { return ft !== "key"; }), Ue = J.length > 0 ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}"; if (!br[pe + Ue]) { var dt = J.length > 0 ? "{" + J.join(": ..., ") + ": ...}" : "{}"; v(`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} />`, Ue, pe, dt, pe), br[pe + Ue] = !0; } } return a === s ? ot(U) : at(U), U; } } function lt(a, f, x) { return mr(a, f, x, !0); } function ct(a, f, x) { return mr(a, f, x, !1); } var it = ct, ut = lt; Ne.Fragment = s, Ne.jsx = it, Ne.jsxs = ut; }()), Ne; } process.env.NODE_ENV === "production" ? qe.exports = pt() : qe.exports = gt(); var t = qe.exports; function Rr(e) { var r, n, s = ""; if (typeof e == "string" || typeof e == "number") s += e; else if (typeof e == "object") if (Array.isArray(e)) { var i = e.length; for (r = 0; r < i; r++) e[r] && (n = Rr(e[r])) && (s && (s += " "), s += n); } else for (n in e) e[n] && (s && (s += " "), s += n); return s; } function ht() { for (var e, r, n = 0, s = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (r = Rr(e)) && (s && (s += " "), s += r); return s; } const Ze = "-", bt = (e) => { const r = xt(e), { conflictingClassGroups: n, conflictingClassGroupModifiers: s } = e; return { getClassGroupId: (c) => { const l = c.split(Ze); return l[0] === "" && l.length !== 1 && l.shift(), Er(l, r) || mt(c); }, getConflictingClassGroupIds: (c, l) => { const d = n[c] || []; return l && s[c] ? [...d, ...s[c]] : d; } }; }, Er = (e, r) => { var c; if (e.length === 0) return r.classGroupId; const n = e[0], s = r.nextPart.get(n), i = s ? Er(e.slice(1), s) : void 0; if (i) return i; if (r.validators.length === 0) return; const o = e.join(Ze); return (c = r.validators.find(({ validator: l }) => l(o))) == null ? void 0 : c.classGroupId; }, yr = /^\[(.+)\]$/, mt = (e) => { if (yr.test(e)) { const r = yr.exec(e)[1], n = r == null ? void 0 : r.substring(0, r.indexOf(":")); if (n) return "arbitrary.." + n; } }, xt = (e) => { const { theme: r, prefix: n } = e, s = { nextPart: /* @__PURE__ */ new Map(), validators: [] }; return yt(Object.entries(e.classGroups), n).forEach(([o, c]) => { Xe(c, s, o, r); }), s; }, Xe = (e, r, n, s) => { e.forEach((i) => { if (typeof i == "string") { const o = i === "" ? r : wr(r, i); o.classGroupId = n; return; } if (typeof i == "function") { if (vt(i)) { Xe(i(s), r, n, s); return; } r.validators.push({ validator: i, classGroupId: n }); return; } Object.entries(i).forEach(([o, c]) => { Xe(c, wr(r, o), n, s); }); }); }, wr = (e, r) => { let n = e; return r.split(Ze).forEach((s) => { n.nextPart.has(s) || n.nextPart.set(s, { nextPart: /* @__PURE__ */ new Map(), validators: [] }), n = n.nextPart.get(s); }), n; }, vt = (e) => e.isThemeGetter, yt = (e, r) => r ? e.map(([n, s]) => { const i = s.map((o) => typeof o == "string" ? r + o : typeof o == "object" ? Object.fromEntries(Object.entries(o).map(([c, l]) => [r + c, l])) : o); return [n, i]; }) : e, wt = (e) => { if (e < 1) return { get: () => { }, set: () => { } }; let r = 0, n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(); const i = (o, c) => { n.set(o, c), r++, r > e && (r = 0, s = n, n = /* @__PURE__ */ new Map()); }; return { get(o) { let c = n.get(o); if (c !== void 0) return c; if ((c = s.get(o)) !== void 0) return i(o, c), c; }, set(o, c) { n.has(o) ? n.set(o, c) : i(o, c); } }; }, Pr = "!", jt = (e) => { const { separator: r, experimentalParseClassName: n } = e, s = r.length === 1, i = r[0], o = r.length, c = (l) => { const d = []; let g = 0, p = 0, m; for (let b = 0; b < l.length; b++) { let y = l[b]; if (g === 0) { if (y === i && (s || l.slice(b, b + o) === r)) { d.push(l.slice(p, b)), p = b + o; continue; } if (y === "/") { m = b; continue; } } y === "[" ? g++ : y === "]" && g--; } const w = d.length === 0 ? l : l.substring(p), N = w.startsWith(Pr), j = N ? w.substring(1) : w, h = m && m > p ? m - p : void 0; return { modifiers: d, hasImportantModifier: N, baseClassName: j, maybePostfixModifierPosition: h }; }; return n ? (l) => n({ className: l, parseClassName: c }) : c; }, kt = (e) => { if (e.length <= 1) return e; const r = []; let n = []; return e.forEach((s) => { s[0] === "[" ? (r.push(...n.sort(), s), n = []) : n.push(s); }), r.push(...n.sort()), r; }, _t = (e) => ({ cache: wt(e.cacheSize), parseClassName: jt(e), ...bt(e) }), Nt = /\s+/, Ct = (e, r) => { const { parseClassName: n, getClassGroupId: s, getConflictingClassGroupIds: i } = r, o = [], c = e.trim().split(Nt); let l = ""; for (let d = c.length - 1; d >= 0; d -= 1) { const g = c[d], { modifiers: p, hasImportantModifier: m, baseClassName: w, maybePostfixModifierPosition: N } = n(g); let j = !!N, h = s(j ? w.substring(0, N) : w); if (!h) { if (!j) { l = g + (l.length > 0 ? " " + l : l); continue; } if (h = s(w), !h) { l = g + (l.length > 0 ? " " + l : l); continue; } j = !1; } const b = kt(p).join(":"), y = m ? b + Pr : b, v = y + h; if (o.includes(v)) continue; o.push(v); const P = i(h, j); for (let S = 0; S < P.length; ++S) { const A = P[S]; o.push(y + A); } l = g + (l.length > 0 ? " " + l : l); } return l; }; function St() { let e = 0, r, n, s = ""; for (; e < arguments.length; ) (r = arguments[e++]) && (n = Ir(r)) && (s && (s += " "), s += n); return s; } const Ir = (e) => { if (typeof e == "string") return e; let r, n = ""; for (let s = 0; s < e.length; s++) e[s] && (r = Ir(e[s])) && (n && (n += " "), n += r); return n; }; function Rt(e, ...r) { let n, s, i, o = c; function c(d) { const g = r.reduce((p, m) => m(p), e()); return n = _t(g), s = n.cache.get, i = n.cache.set, o = l, l(d); } function l(d) { const g = s(d); if (g) return g; const p = Ct(d, n); return i(d, p), p; } return function() { return o(St.apply(null, arguments)); }; } const L = (e) => { const r = (n) => n[e] || []; return r.isThemeGetter = !0, r; }, $r = /^\[(?:([a-z-]+):)?(.+)\]$/i, Et = /^\d+\/\d+$/, Pt = /* @__PURE__ */ new Set(["px", "full", "screen"]), It = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, $t = /\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$/, zt = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/, Tt = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, At = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, ce = (e) => ve(e) || Pt.has(e) || Et.test(e), de = (e) => we(e, "length", Gt), ve = (e) => !!e && !Number.isNaN(Number(e)), Ye = (e) => we(e, "number", ve), Ce = (e) => !!e && Number.isInteger(Number(e)), Ot = (e) => e.endsWith("%") && ve(e.slice(0, -1)), C = (e) => $r.test(e), fe = (e) => It.test(e), Mt = /* @__PURE__ */ new Set(["length", "size", "percentage"]), Lt = (e) => we(e, Mt, zr), Ft = (e) => we(e, "position", zr), Dt = /* @__PURE__ */ new Set(["image", "url"]), Wt = (e) => we(e, Dt, Kt), Vt = (e) => we(e, "", Bt), Se = () => !0, we = (e, r, n) => { const s = $r.exec(e); return s ? s[1] ? typeof r == "string" ? s[1] === r : r.has(s[1]) : n(s[2]) : !1; }, Gt = (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. $t.test(e) && !zt.test(e) ), zr = () => !1, Bt = (e) => Tt.test(e), Kt = (e) => At.test(e), Ut = () => { const e = L("colors"), r = L("spacing"), n = L("blur"), s = L("brightness"), i = L("borderColor"), o = L("borderRadius"), c = L("borderSpacing"), l = L("borderWidth"), d = L("contrast"), g = L("grayscale"), p = L("hueRotate"), m = L("invert"), w = L("gap"), N = L("gradientColorStops"), j = L("gradientColorStopPositions"), h = L("inset"), b = L("margin"), y = L("opacity"), v = L("padding"), P = L("saturate"), S = L("scale"), A = L("sepia"), W = L("skew"), K = L("space"), re = L("translate"), F = () => ["auto", "contain", "none"], X = () => ["auto", "hidden", "clip", "visible", "scroll"], D = () => ["auto", C, r], _ = () => [C, r], V = () => ["", ce, de], M = () => ["auto", ve, C], H = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], ne = () => ["solid", "dashed", "dotted", "double", "none"], le = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], $ = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], Y = () => ["", "0", C], R = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], z = () => [ve, C]; return { cacheSize: 500, separator: ":", theme: { colors: [Se], spacing: [ce, de], blur: ["none", "", fe, C], brightness: z(), borderColor: [e], borderRadius: ["none", "", "full", fe, C], borderSpacing: _(), borderWidth: V(), contrast: z(), grayscale: Y(), hueRotate: z(), invert: Y(), gap: _(), gradientColorStops: [e], gradientColorStopPositions: [Ot, de], inset: D(), margin: D(), opacity: z(), padding: _(), saturate: z(), scale: z(), sepia: Y(), skew: z(), space: _(), translate: _() }, classGroups: { // Layout /** * Aspect Ratio * @see https://tailwindcss.com/docs/aspect-ratio */ aspect: [{ aspect: ["auto", "square", "video", C] }], /** * Container * @see https://tailwindcss.com/docs/container */ container: ["container"], /** * Columns * @see https://tailwindcss.com/docs/columns */ columns: [{ columns: [fe] }], /** * Break After * @see https://tailwindcss.com/docs/break-after */ "break-after": [{ "break-after": R() }], /** * Break Before * @see https://tailwindcss.com/docs/break-before */ "break-before": [{ "break-before": R() }], /** * 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: [...H(), C] }], /** * Overflow * @see https://tailwindcss.com/docs/overflow */ overflow: [{ overflow: X() }], /** * Overflow X * @see https://tailwindcss.com/docs/overflow */ "overflow-x": [{ "overflow-x": X() }], /** * Overflow Y * @see https://tailwindcss.com/docs/overflow */ "overflow-y": [{ "overflow-y": X() }], /** * Overscroll Behavior * @see https://tailwindcss.com/docs/overscroll-behavior */ overscroll: [{ overscroll: F() }], /** * Overscroll Behavior X * @see https://tailwindcss.com/docs/overscroll-behavior */ "overscroll-x": [{ "overscroll-x": F() }], /** * Overscroll Behavior Y * @see https://tailwindcss.com/docs/overscroll-behavior */ "overscroll-y": [{ "overscroll-y": F() }], /** * 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: [h] }], /** * Right / Left * @see https://tailwindcss.com/docs/top-right-bottom-left */ "inset-x": [{ "inset-x": [h] }], /** * Top / Bottom * @see https://tailwindcss.com/docs/top-right-bottom-left */ "inset-y": [{ "inset-y": [h] }], /** * Start * @see https://tailwindcss.com/docs/top-right-bottom-left */ start: [{ start: [h] }], /** * End * @see https://tailwindcss.com/docs/top-right-bottom-left */ end: [{ end: [h] }], /** * Top * @see https://tailwindcss.com/docs/top-right-bottom-left */ top: [{ top: [h] }], /** * Right * @see https://tailwindcss.com/docs/top-right-bottom-left */ right: [{ right: [h] }], /** * Bottom * @see https://tailwindcss.com/docs/top-right-bottom-left */ bottom: [{ bottom: [h] }], /** * Left * @see https://tailwindcss.com/docs/top-right-bottom-left */ left: [{ left: [h] }], /** * Visibility * @see https://tailwindcss.com/docs/visibility */ visibility: ["visible", "invisible", "collapse"], /** * Z-Index * @see https://tailwindcss.com/docs/z-index */ z: [{ z: ["auto", Ce, C] }], // Flexbox and Grid /** * Flex Basis * @see https://tailwindcss.com/docs/flex-basis */ basis: [{ basis: D() }], /** * 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", C] }], /** * Flex Grow * @see https://tailwindcss.com/docs/flex-grow */ grow: [{ grow: Y() }], /** * Flex Shrink * @see https://tailwindcss.com/docs/flex-shrink */ shrink: [{ shrink: Y() }], /** * Order * @see https://tailwindcss.com/docs/order */ order: [{ order: ["first", "last", "none", Ce, C] }], /** * Grid Template Columns * @see https://tailwindcss.com/docs/grid-template-columns */ "grid-cols": [{ "grid-cols": [Se] }], /** * Grid Column Start / End * @see https://tailwindcss.com/docs/grid-column */ "col-start-end": [{ col: ["auto", { span: ["full", Ce, C] }, C] }], /** * Grid Column Start * @see https://tailwindcss.com/docs/grid-column */ "col-start": [{ "col-start": M() }], /** * Grid Column End * @see https://tailwindcss.com/docs/grid-column */ "col-end": [{ "col-end": M() }], /** * Grid Template Rows * @see https://tailwindcss.com/docs/grid-template-rows */ "grid-rows": [{ "grid-rows": [Se] }], /** * Grid Row Start / End * @see https://tailwindcss.com/docs/grid-row */ "row-start-end": [{ row: ["auto", { span: [Ce, C] }, C] }], /** * Grid Row Start * @see https://tailwindcss.com/docs/grid-row */ "row-start": [{ "row-start": M() }], /** * Grid Row End * @see https://tailwindcss.com/docs/grid-row */ "row-end": [{ "row-end": M() }], /** * 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", C] }], /** * Grid Auto Rows * @see https://tailwindcss.com/docs/grid-auto-rows */ "auto-rows": [{ "auto-rows": ["auto", "min", "max", "fr", C] }], /** * Gap * @see https://tailwindcss.com/docs/gap */ gap: [{ gap: [w] }], /** * Gap X * @see https://tailwindcss.com/docs/gap */ "gap-x": [{ "gap-x": [w] }], /** * Gap Y * @see https://tailwindcss.com/docs/gap */ "gap-y": [{ "gap-y": [w] }], /** * Justify Content * @see https://tailwindcss.com/docs/justify-content */ "justify-content": [{ justify: ["normal", ...$()] }], /** * 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", ...$(), "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": [...$(), "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: [v] }], /** * Padding X * @see https://tailwindcss.com/docs/padding */ px: [{ px: [v] }], /** * Padding Y * @see https://tailwindcss.com/docs/padding */ py: [{ py: [v] }], /** * Padding Start * @see https://tailwindcss.com/docs/padding */ ps: [{ ps: [v] }], /** * Padding End * @see https://tailwindcss.com/docs/padding */ pe: [{ pe: [v] }], /** * Padding Top * @see https://tailwindcss.com/docs/padding */ pt: [{ pt: [v] }], /** * Padding Right * @see https://tailwindcss.com/docs/padding */ pr: [{ pr: [v] }], /** * Padding Bottom * @see https://tailwindcss.com/docs/padding */ pb: [{ pb: [v] }], /** * Padding Left * @see https://tailwindcss.com/docs/padding */ pl: [{ pl: [v] }], /** * Margin * @see https://tailwindcss.com/docs/margin */ m: [{ m: [b] }], /** * Margin X * @see https://tailwindcss.com/docs/margin */ mx: [{ mx: [b] }], /** * Margin Y * @see https://tailwindcss.com/docs/margin */ my: [{ my: [b] }], /** * Margin Start * @see https://tailwindcss.com/docs/margin */ ms: [{ ms: [b] }], /** * Margin End * @see https://tailwindcss.com/docs/margin */ me: [{ me: [b] }], /** * Margin Top * @see https://tailwindcss.com/docs/margin */ mt: [{ mt: [b] }], /** * Margin Right * @see https://tailwindcss.com/docs/margin */ mr: [{ mr: [b] }], /** * Margin Bottom * @see https://tailwindcss.com/docs/margin */ mb: [{ mb: [b] }], /** * Margin Left * @see https://tailwindcss.com/docs/margin */ ml: [{ ml: [b] }], /** * Space Between X * @see https://tailwindcss.com/docs/space */ "space-x": [{ "space-x": [K] }], /** * 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": [K] }], /** * 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", C, r] }], /** * Min-Width * @see https://tailwindcss.com/docs/min-width */ "min-w": [{ "min-w": [C, r, "min", "max", "fit"] }], /** * Max-Width * @see https://tailwindcss.com/docs/max-width */ "max-w": [{ "max-w": [C, r, "none", "full", "min", "max", "fit", "prose", { screen: [fe] }, fe] }], /** * Height * @see https://tailwindcss.com/docs/height */ h: [{ h: [C, r, "auto", "min", "max", "fit", "svh", "lvh", "dvh"] }], /** * Min-Height * @see https://tailwindcss.com/docs/min-height */ "min-h": [{ "min-h": [C, r, "min", "max", "fit", "svh", "lvh", "dvh"] }], /** * Max-Height * @see https://tailwindcss.com/docs/max-height */ "max-h": [{ "max-h": [C, r, "min", "max", "fit", "svh", "lvh", "dvh"] }], /** * Size * @see https://tailwindcss.com/docs/size */ size: [{ size: [C, r, "auto", "min", "max", "fit"] }], // Typography /** * Font Size * @see https://tailwindcss.com/docs/font-size */ "font-size": [{ text: ["base", fe, de] }], /** * 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", Ye] }], /** * Font Family * @see https://tailwindcss.com/docs/font-family */ "font-family": [{ font: [Se] }], /** * 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-fractons"], /** * Letter Spacing * @see https://tailwindcss.com/docs/letter-spacing */ tracking: [{ tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", C] }], /** * Line Clamp * @see https://tailwindcss.com/docs/line-clamp */ "line-clamp": [{ "line-clamp": ["none", ve, Ye] }], /** * Line Height * @see https://tailwindcss.com/docs/line-height */ leading: [{ leading: ["none", "tight", "snug", "normal", "relaxed", "loose", ce, C] }], /** * List Style Image * @see https://tailwindcss.com/docs/list-style-image */ "list-image": [{ "list-image": ["none", C] }], /** * List Style Type * @see https://tailwindcss.com/docs/list-style-type */ "list-style-type": [{ list: ["none", "disc", "decimal", C] }], /** * 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": [y] }], /** * 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":