UNPKG

summit-kit

Version:

A React component library for building modern web applications with with an earthy and outdoorsy flair.

219 lines (218 loc) 6.65 kB
import { jsx as s, jsxs as y } from "react/jsx-runtime"; import { c as a, H as j, t as f } from "./index-DiM-Qsyc.js"; import { I as Z, L as p, O as ee, P as ne, Q as se, S as te, U as ce } from "./index-DiM-Qsyc.js"; const N = "_flex_tkzib_1", U = "_section_tkzib_5", w = "_reading_tkzib_9", u = { flex: N, section: U, reading: w }, L = (e) => /* @__PURE__ */ s("article", { className: u.reading, children: e.children }), V = (e) => /* @__PURE__ */ s("section", { className: u.section, children: e.children }), z = (e) => { const { direction: n = "row", justify: c = "flex-start", align: l = "flex-start", wrap: i = "nowrap", classes: d, ...o } = e; return /* @__PURE__ */ s( "div", { className: `${u.flex}${d && d.length > 0 ? ` ${d.join(" ")}` : ""}`, style: { justifyContent: c, alignItems: l, flexDirection: n, flexWrap: i, ...e.style ? e.style : {} }, ...o, children: e.children } ); }, S = "_submit_jr6oc_52", I = "_secondary_jr6oc_64", r = { "form-field": "_form-field_jr6oc_1", "label-container": "_label-container_jr6oc_6", "text-input": "_text-input_jr6oc_12", submit: S, secondary: I }, B = (e) => { const { disabled: n = !1, required: c = !1 } = e; return /* @__PURE__ */ y( "div", { className: `${r["form-field"]}${e.classes && e.classes?.length > 0 ? ` ${e.classes.join(" ")}` : ""}`, children: [ /* @__PURE__ */ s("div", { className: r["label-container"], children: /* @__PURE__ */ s("label", { className: `${r.label}`, htmlFor: e.id, children: e.label }) }), /* @__PURE__ */ s( "input", { id: e.id, name: e.id, className: `${r["text-input"]}`, type: e.type, required: c, disabled: n } ) ] } ); }, E = (e) => { const { disabled: n = !1 } = e; return /* @__PURE__ */ s( "button", { type: "submit", disabled: n, className: `${r.submit}${e.classes && e.classes.length > 0 ? e.classes?.join(" ") : ""}`, children: e.children } ); }, O = (e) => { const { disabled: n = !1, onClick: c } = e; return /* @__PURE__ */ s( "button", { onClick: c, type: "button", disabled: n, className: `${r.secondary} ${r.secondary}${e.classes && e.classes.length > 0 ? e.classes?.join(" ") : ""}`, children: e.children } ); }, P = (e) => /* @__PURE__ */ s( "form", { className: `${e.classes && e.classes.length > 0 ? e.classes?.join(" ") : ""}`, ...e.onSubmit && { onSubmit: (n) => { e.onSubmit && (n.preventDefault(), e.onSubmit(n)); } }, ...e.method && { method: e.method }, ...e.action && { action: e.action }, children: e.children } ), Q = (e) => /* @__PURE__ */ s( "h1", { className: `${a.h1}${e.classes && e.classes.length > 0 ? ` ${e.classes.join(" ")}` : ""}`, children: e.children } ), T = (e) => /* @__PURE__ */ s( "h2", { className: `${a.h2}${e.classes && e.classes.length > 0 ? ` ${e.classes.join(" ")}` : ""}`, children: e.children } ), q = (e) => /* @__PURE__ */ s( "h3", { className: `${a.h3}${e.classes && e.classes.length > 0 ? ` ${e.classes.join(" ")}` : ""}`, children: e.children } ), A = (e) => /* @__PURE__ */ s( "h4", { className: `${a.h4}${e.classes && e.classes.length > 0 ? ` ${e.classes.join(" ")}` : ""}`, children: e.children } ), W = (e) => /* @__PURE__ */ s( "h5", { className: `${a.h5}${e.classes && e.classes.length > 0 ? ` ${e.classes.join(" ")}` : ""}`, children: e.children } ), G = (e) => /* @__PURE__ */ s( "h6", { className: `${a.h6}${e.classes && e.classes.length > 0 ? ` ${e.classes.join(" ")}` : ""}`, children: e.children } ), J = (e) => { const { rel: n = "noopener noreferrer", target: c = "_parent" } = e; return /* @__PURE__ */ s( "a", { className: `${a.a}${e.classes && e.classes.length > 0 ? ` ${e.classes.join(" ")}` : ""}`, href: e.href, target: c, rel: n, children: e.children } ); }, t = []; for (let e = 0; e < 256; ++e) t.push((e + 256).toString(16).slice(1)); function H(e, n = 0) { return (t[e[n + 0]] + t[e[n + 1]] + t[e[n + 2]] + t[e[n + 3]] + "-" + t[e[n + 4]] + t[e[n + 5]] + "-" + t[e[n + 6]] + t[e[n + 7]] + "-" + t[e[n + 8]] + t[e[n + 9]] + "-" + t[e[n + 10]] + t[e[n + 11]] + t[e[n + 12]] + t[e[n + 13]] + t[e[n + 14]] + t[e[n + 15]]).toLowerCase(); } let h; const v = new Uint8Array(16); function k() { if (!h) { if (typeof crypto > "u" || !crypto.getRandomValues) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); h = crypto.getRandomValues.bind(crypto); } return h(v); } const D = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), g = { randomUUID: D }; function $(e, n, c) { if (g.randomUUID && !e) return g.randomUUID(); e = e || {}; const l = e.random ?? e.rng?.() ?? k(); if (l.length < 16) throw new Error("Random bytes length must be >= 16"); return l[6] = l[6] & 15 | 64, l[8] = l[8] & 63 | 128, H(l); } const K = ({ code: e, language: n }) => /* @__PURE__ */ s("div", { className: a.code, children: /* @__PURE__ */ s(j, { theme: f.dracula, code: e, language: n, children: ({ className: c, style: l, tokens: i, getLineProps: d, getTokenProps: o }) => /* @__PURE__ */ s( "pre", { className: c, style: { ...l, padding: "16px", borderRadius: "8px" }, children: i.map((m, b) => /* @__PURE__ */ s("div", { ...d({ line: m, key: b }), children: m.map((_, x) => /* @__PURE__ */ s("span", { ...o({ token: _, key: x }) }, $())) }, $())) } ) }) }), R = (e) => { const { src: n, alt: c = "This is not the image you're looking for...", width: l, ...i } = e; return /* @__PURE__ */ s("img", { src: n, alt: c, width: l, ...i }); }, M = (e) => { const { src: n, alt: c, width: l, ...i } = e; return /* @__PURE__ */ y("figure", { children: [ /* @__PURE__ */ s(R, { src: n, alt: c, width: l, ...i }), /* @__PURE__ */ s("figcaption", { children: c }) ] }); }; export { K as Code, M as Figure, z as Flex, P as Form, Q as H1, T as H2, q as H3, A as H4, W as H5, G as H6, Z as Icon, R as Image, B as Input, p as Li, J as Link, ee as Ol, ne as P, E as PrimaryButton, se as Quote, L as Reading, O as SecondaryButton, V as Section, te as Span, ce as Ul }; //# sourceMappingURL=react-server.js.map