UNPKG

stone-kit

Version:
514 lines (513 loc) 15.7 kB
import { jsxs as j, jsx as b } from "react/jsx-runtime"; import * as c from "react"; import "react-dom"; import { c as $, b as ee, N as D, s as S, w as X, u as te, d as F, e as W, D as ne, f as re, g as I, h as oe, i as ie, j as N, k as ae, m as z, l as le } from "./index-DmANy9jd.js"; import "./components/Button/ui/Button.js"; import "./components/mobileButton/ui/MobileButton.js"; import { NewIcon as se } from "./components/NewIcon/ui/NewIcon.js"; import "./components/DestinationTab/ui/DestinationTab.js"; import "./components/RoundButton/ui/RoundButton.js"; import "./components/Tag/ui/Tag.js"; import "./components/Switcher/ui/Switcher.js"; import "./components/Text/ui/Text.js"; import "./components/Flex/ui/Flex.js"; import "./components/Input/ui/Input.js"; import "./FilterWithSave-Dy5t7CrS.js"; import "./components/GroupedInput/ui/GroupedInputs.js"; import "./index-rKuIKazb.js"; import "./components/MetroTag/ui/MetroTag.js"; import "./components/Select/ui/Select.js"; import "./components/SliderNavigation/ui/SliderNavigation.js"; import "./components/LotCardSkeleton/ui/LotCardSkeleton.js"; import "./components/TabSelect/ui/TabSelect.js"; import "./components/CheckBox/CheckBox.js"; import "./components/CheckBoxNew/CheckBoxNew.js"; import "./components/CheckboxSelect/ui/CheckboxSelect.js"; /** * React Router DOM v6.26.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */ function x() { return x = Object.assign ? Object.assign.bind() : function(e) { for (var n = 1; n < arguments.length; n++) { var r = arguments[n]; for (var a in r) Object.prototype.hasOwnProperty.call(r, a) && (e[a] = r[a]); } return e; }, x.apply(this, arguments); } function M(e, n) { if (e == null) return {}; var r = {}, a = Object.keys(e), t, o; for (o = 0; o < a.length; o++) t = a[o], !(n.indexOf(t) >= 0) && (r[t] = e[t]); return r; } const T = "get", L = "application/x-www-form-urlencoded"; function P(e) { return e != null && typeof e.tagName == "string"; } function ue(e) { return P(e) && e.tagName.toLowerCase() === "button"; } function ce(e) { return P(e) && e.tagName.toLowerCase() === "form"; } function me(e) { return P(e) && e.tagName.toLowerCase() === "input"; } function fe(e) { return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey); } function de(e, n) { return e.button === 0 && // Ignore everything but left clicks (!n || n === "_self") && // Let browser handle "target=_blank" etc. !fe(e); } let R = null; function pe() { if (R === null) try { new FormData( document.createElement("form"), // @ts-expect-error if FormData supports the submitter parameter, this will throw 0 ), R = !1; } catch { R = !0; } return R; } const he = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]); function U(e) { return e != null && !he.has(e) ? (process.env.NODE_ENV !== "production" && X(!1, '"' + e + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + L + '"')), null) : e; } function ve(e, n) { let r, a, t, o, i; if (ce(e)) { let s = e.getAttribute("action"); a = s ? S(s, n) : null, r = e.getAttribute("method") || T, t = U(e.getAttribute("enctype")) || L, o = new FormData(e); } else if (ue(e) || me(e) && (e.type === "submit" || e.type === "image")) { let s = e.form; if (s == null) throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>'); let u = e.getAttribute("formaction") || s.getAttribute("action"); if (a = u ? S(u, n) : null, r = e.getAttribute("formmethod") || s.getAttribute("method") || T, t = U(e.getAttribute("formenctype")) || U(s.getAttribute("enctype")) || L, o = new FormData(s, e), !pe()) { let { name: l, type: f, value: h } = e; if (f === "image") { let v = l ? l + "." : ""; o.append(v + "x", "0"), o.append(v + "y", "0"); } else l && o.append(l, h); } } else { if (P(e)) throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">'); r = T, a = null, t = L, i = e; } return o && t === "text/plain" && (i = o, o = void 0), { action: a, method: r.toLowerCase(), encType: t, formData: o, body: i }; } const be = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "unstable_viewTransition"], we = ["aria-current", "caseSensitive", "className", "end", "style", "to", "unstable_viewTransition", "children"], ye = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "unstable_viewTransition"], ge = "6"; try { window.__reactRouterVersion = ge; } catch { } const Y = /* @__PURE__ */ c.createContext({ isTransitioning: !1 }); process.env.NODE_ENV !== "production" && (Y.displayName = "ViewTransition"); const Ee = /* @__PURE__ */ c.createContext(/* @__PURE__ */ new Map()); process.env.NODE_ENV !== "production" && (Ee.displayName = "Fetchers"); const Se = "startTransition", H = c[Se]; function lt(e) { let { basename: n, children: r, future: a, window: t } = e, o = c.useRef(); o.current == null && (o.current = $({ window: t, v5Compat: !0 })); let i = o.current, [s, u] = c.useState({ action: i.action, location: i.location }), { v7_startTransition: l } = a || {}, f = c.useCallback((h) => { l && H ? H(() => u(h)) : u(h); }, [u, l]); return c.useLayoutEffect(() => i.listen(f), [i, f]), /* @__PURE__ */ c.createElement(ee, { basename: n, children: r, location: s.location, navigationType: s.action, navigator: i, future: a }); } process.env.NODE_ENV; const Ne = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", xe = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, B = /* @__PURE__ */ c.forwardRef(function(n, r) { let { onClick: a, relative: t, reloadDocument: o, replace: i, state: s, target: u, to: l, preventScrollReset: f, unstable_viewTransition: h } = n, v = M(n, be), { basename: C } = c.useContext(D), w, y = !1; if (typeof l == "string" && xe.test(l) && (w = l, Ne)) try { let p = new URL(window.location.href), d = l.startsWith("//") ? new URL(p.protocol + l) : new URL(l), _ = S(d.pathname, C); d.origin === p.origin && _ != null ? l = _ + d.search + d.hash : y = !0; } catch { process.env.NODE_ENV !== "production" && X(!1, '<Link to="' + l + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.'); } let g = te(l, { relative: t }), E = Te(l, { replace: i, state: s, target: u, preventScrollReset: f, relative: t, unstable_viewTransition: h }); function m(p) { a && a(p), p.defaultPrevented || E(p); } return ( // eslint-disable-next-line jsx-a11y/anchor-has-content /* @__PURE__ */ c.createElement("a", x({}, v, { href: w || g, onClick: y || o ? a : m, ref: r, target: u })) ); }); process.env.NODE_ENV !== "production" && (B.displayName = "Link"); const Ce = /* @__PURE__ */ c.forwardRef(function(n, r) { let { "aria-current": a = "page", caseSensitive: t = !1, className: o = "", end: i = !1, style: s, to: u, unstable_viewTransition: l, children: f } = n, h = M(n, we), v = F(u, { relative: h.relative }), C = W(), w = c.useContext(ne), { navigator: y, basename: g } = c.useContext(D), E = w != null && // Conditional usage is OK here because the usage of a data router is static // eslint-disable-next-line react-hooks/rules-of-hooks Oe(v) && l === !0, m = y.encodeLocation ? y.encodeLocation(v).pathname : v.pathname, p = C.pathname, d = w && w.navigation && w.navigation.location ? w.navigation.location.pathname : null; t || (p = p.toLowerCase(), d = d ? d.toLowerCase() : null, m = m.toLowerCase()), d && g && (d = S(d, g) || d); const _ = m !== "/" && m.endsWith("/") ? m.length - 1 : m.length; let O = p === m || !i && p.startsWith(m) && p.charAt(_) === "/", K = d != null && (d === m || !i && d.startsWith(m) && d.charAt(m.length) === "/"), V = { isActive: O, isPending: K, isTransitioning: E }, Q = O ? a : void 0, A; typeof o == "function" ? A = o(V) : A = [o, O ? "active" : null, K ? "pending" : null, E ? "transitioning" : null].filter(Boolean).join(" "); let Z = typeof s == "function" ? s(V) : s; return /* @__PURE__ */ c.createElement(B, x({}, h, { "aria-current": Q, className: A, ref: r, style: Z, to: u, unstable_viewTransition: l }), typeof f == "function" ? f(V) : f); }); process.env.NODE_ENV !== "production" && (Ce.displayName = "NavLink"); const _e = /* @__PURE__ */ c.forwardRef((e, n) => { let { fetcherKey: r, navigate: a, reloadDocument: t, replace: o, state: i, method: s = T, action: u, onSubmit: l, relative: f, preventScrollReset: h, unstable_viewTransition: v } = e, C = M(e, ye), w = Fe(), y = Pe(u, { relative: f }), g = s.toLowerCase() === "get" ? "get" : "post", E = (m) => { if (l && l(m), m.defaultPrevented) return; m.preventDefault(); let p = m.nativeEvent.submitter, d = (p == null ? void 0 : p.getAttribute("formmethod")) || s; w(p || m.currentTarget, { fetcherKey: r, method: d, navigate: a, replace: o, state: i, relative: f, preventScrollReset: h, unstable_viewTransition: v }); }; return /* @__PURE__ */ c.createElement("form", x({ ref: n, method: g, action: y, onSubmit: t ? l : E }, C)); }); process.env.NODE_ENV !== "production" && (_e.displayName = "Form"); process.env.NODE_ENV; var k; (function(e) { e.UseScrollRestoration = "useScrollRestoration", e.UseSubmit = "useSubmit", e.UseSubmitFetcher = "useSubmitFetcher", e.UseFetcher = "useFetcher", e.useViewTransitionState = "useViewTransitionState"; })(k || (k = {})); var q; (function(e) { e.UseFetcher = "useFetcher", e.UseFetchers = "useFetchers", e.UseScrollRestoration = "useScrollRestoration"; })(q || (q = {})); function Re(e) { return e + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router."; } function J(e) { let n = c.useContext(le); return n || (process.env.NODE_ENV !== "production" ? N(!1, Re(e)) : N(!1)), n; } function Te(e, n) { let { target: r, replace: a, state: t, preventScrollReset: o, relative: i, unstable_viewTransition: s } = n === void 0 ? {} : n, u = re(), l = W(), f = F(e, { relative: i }); return c.useCallback((h) => { if (de(h, r)) { h.preventDefault(); let v = a !== void 0 ? a : I(l) === I(f); u(e, { replace: v, state: t, preventScrollReset: o, relative: i, unstable_viewTransition: s }); } }, [l, u, f, a, t, r, e, o, i, s]); } function Le() { if (typeof document > "u") throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead."); } let ke = 0, De = () => "__" + String(++ke) + "__"; function Fe() { let { router: e } = J(k.UseSubmit), { basename: n } = c.useContext(D), r = oe(); return c.useCallback(function(a, t) { t === void 0 && (t = {}), Le(); let { action: o, method: i, encType: s, formData: u, body: l } = ve(a, n); if (t.navigate === !1) { let f = t.fetcherKey || De(); e.fetch(f, r, t.action || o, { preventScrollReset: t.preventScrollReset, formData: u, body: l, formMethod: t.method || i, formEncType: t.encType || s, unstable_flushSync: t.unstable_flushSync }); } else e.navigate(t.action || o, { preventScrollReset: t.preventScrollReset, formData: u, body: l, formMethod: t.method || i, formEncType: t.encType || s, replace: t.replace, state: t.state, fromRouteId: r, unstable_flushSync: t.unstable_flushSync, unstable_viewTransition: t.unstable_viewTransition }); }, [e, n, r]); } function Pe(e, n) { let { relative: r } = n === void 0 ? {} : n, { basename: a } = c.useContext(D), t = c.useContext(ie); t || (process.env.NODE_ENV !== "production" ? N(!1, "useFormAction must be used inside a RouteContext") : N(!1)); let [o] = t.matches.slice(-1), i = x({}, F(e || ".", { relative: r })), s = W(); if (e == null) { i.search = s.search; let u = new URLSearchParams(i.search); u.has("index") && u.get("index") === "" && (u.delete("index"), i.search = u.toString() ? "?" + u.toString() : ""); } return (!e || e === ".") && o.route.index && (i.search = i.search ? i.search.replace(/^\?/, "?index&") : "?index"), a !== "/" && (i.pathname = i.pathname === "/" ? a : ae([a, i.pathname])), I(i); } function Oe(e, n) { n === void 0 && (n = {}); let r = c.useContext(Y); r == null && (process.env.NODE_ENV !== "production" ? N(!1, "`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?") : N(!1)); let { basename: a } = J(k.useViewTransitionState), t = F(e, { relative: n.relative }); if (!r.isTransitioning) return !1; let o = S(r.currentLocation.pathname, a) || r.currentLocation.pathname, i = S(r.nextLocation.pathname, a) || r.nextLocation.pathname; return z(t.pathname, i) != null || z(t.pathname, o) != null; } const Ve = "_root_9577c_1", Ae = "_linkWrap_9577c_8", G = { root: Ve, linkWrap: Ae }, st = () => { const e = ({ to: n, title: r }) => /* @__PURE__ */ j( B, { to: n, className: G.linkWrap, children: [ r, /* @__PURE__ */ b( se, { size: "24", name: "play2", deg: "90", color: "white" } ) ] } ); return /* @__PURE__ */ j("div", { className: G.root, children: [ /* @__PURE__ */ b( e, { to: "/buttons", title: "КНОПКИ" } ), /* @__PURE__ */ b( e, { to: "/modals", title: "МОДАЛКИ" } ), /* @__PURE__ */ b( e, { to: "/tabs", title: "ТАБЫ" } ), /* @__PURE__ */ b( e, { to: "/icons", title: "ИКОНКИ" } ), /* @__PURE__ */ b( e, { to: "/lots", title: "ЛОТЫ" } ), /* @__PURE__ */ b( e, { to: "/tags", title: "ТЭГИ" } ), /* @__PURE__ */ b( e, { to: "/select", title: "СЕЛЕКТ" } ), /* @__PURE__ */ b( e, { to: "/forms", title: "ФОРМЫ" } ), /* @__PURE__ */ b( e, { to: "/logo", title: "ЛОГО" } ), /* @__PURE__ */ b( e, { to: "/input", title: "ИНПУТЫ" } ), /* @__PURE__ */ b( e, { to: "/checkbox", title: "ЧЕКБОКСЫ" } ) ] }); }; export { lt as B, st as M };