@boxyhq/react-ui
Version:
React UI components from BoxyHQ
1,185 lines (1,182 loc) • 35.3 kB
JavaScript
import Ie, { forwardRef as pr, useState as Le } from "react";
var U = { exports: {} }, F = {};
/**
* @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 Oe;
function br() {
if (Oe) return F;
Oe = 1;
var t = Ie, i = Symbol.for("react.element"), v = Symbol.for("react.fragment"), _ = Object.prototype.hasOwnProperty, C = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, w = { key: !0, ref: !0, __self: !0, __source: !0 };
function y(k, g, S) {
var p, j = {}, E = null, W = null;
S !== void 0 && (E = "" + S), g.key !== void 0 && (E = "" + g.key), g.ref !== void 0 && (W = g.ref);
for (p in g) _.call(g, p) && !w.hasOwnProperty(p) && (j[p] = g[p]);
if (k && k.defaultProps) for (p in g = k.defaultProps, g) j[p] === void 0 && (j[p] = g[p]);
return { $$typeof: i, type: k, key: E, ref: W, props: j, _owner: C.current };
}
return F.Fragment = v, F.jsx = y, F.jsxs = y, F;
}
var N = {};
/**
* @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 Pe;
function yr() {
return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && function() {
var t = Ie, i = Symbol.for("react.element"), v = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), y = Symbol.for("react.provider"), k = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), S = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), j = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), W = Symbol.for("react.offscreen"), ae = Symbol.iterator, Me = "@@iterator";
function De(e) {
if (e === null || typeof e != "object")
return null;
var r = ae && e[ae] || e[Me];
return typeof r == "function" ? r : null;
}
var A = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function h(e) {
{
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), o = 1; o < r; o++)
n[o - 1] = arguments[o];
$e("error", e, n);
}
}
function $e(e, r, n) {
{
var o = A.ReactDebugCurrentFrame, u = o.getStackAddendum();
u !== "" && (r += "%s", n = n.concat([u]));
var c = n.map(function(l) {
return String(l);
});
c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
}
}
var Fe = !1, Ne = !1, We = !1, Be = !1, Ye = !1, oe;
oe = Symbol.for("react.module.reference");
function Ve(e) {
return !!(typeof e == "string" || typeof e == "function" || e === _ || e === w || Ye || e === C || e === S || e === p || Be || e === W || Fe || Ne || We || typeof e == "object" && e !== null && (e.$$typeof === E || e.$$typeof === j || e.$$typeof === y || e.$$typeof === k || e.$$typeof === g || // 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.
e.$$typeof === oe || e.getModuleId !== void 0));
}
function qe(e, r, n) {
var o = e.displayName;
if (o)
return o;
var u = r.displayName || r.name || "";
return u !== "" ? n + "(" + u + ")" : n;
}
function ie(e) {
return e.displayName || "Context";
}
function T(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
return e.displayName || e.name || null;
if (typeof e == "string")
return e;
switch (e) {
case _:
return "Fragment";
case v:
return "Portal";
case w:
return "Profiler";
case C:
return "StrictMode";
case S:
return "Suspense";
case p:
return "SuspenseList";
}
if (typeof e == "object")
switch (e.$$typeof) {
case k:
var r = e;
return ie(r) + ".Consumer";
case y:
var n = e;
return ie(n._context) + ".Provider";
case g:
return qe(e, e.render, "ForwardRef");
case j:
var o = e.displayName || null;
return o !== null ? o : T(e.type) || "Memo";
case E: {
var u = e, c = u._payload, l = u._init;
try {
return T(l(c));
} catch {
return null;
}
}
}
return null;
}
var O = Object.assign, D = 0, se, le, ue, ce, fe, de, ve;
function ge() {
}
ge.__reactDisabledLog = !0;
function Ue() {
{
if (D === 0) {
se = console.log, le = console.info, ue = console.warn, ce = console.error, fe = console.group, de = console.groupCollapsed, ve = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: ge,
writable: !0
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
}
D++;
}
}
function ze() {
{
if (D--, D === 0) {
var e = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: O({}, e, {
value: se
}),
info: O({}, e, {
value: le
}),
warn: O({}, e, {
value: ue
}),
error: O({}, e, {
value: ce
}),
group: O({}, e, {
value: fe
}),
groupCollapsed: O({}, e, {
value: de
}),
groupEnd: O({}, e, {
value: ve
})
});
}
D < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var K = A.ReactCurrentDispatcher, G;
function B(e, r, n) {
{
if (G === void 0)
try {
throw Error();
} catch (u) {
var o = u.stack.trim().match(/\n( *(at )?)/);
G = o && o[1] || "";
}
return `
` + G + e;
}
}
var X = !1, Y;
{
var Je = typeof WeakMap == "function" ? WeakMap : Map;
Y = new Je();
}
function he(e, r) {
if (!e || X)
return "";
{
var n = Y.get(e);
if (n !== void 0)
return n;
}
var o;
X = !0;
var u = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var c;
c = K.current, K.current = null, Ue();
try {
if (r) {
var l = function() {
throw Error();
};
if (Object.defineProperty(l.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(l, []);
} catch (b) {
o = b;
}
Reflect.construct(e, [], l);
} else {
try {
l.call();
} catch (b) {
o = b;
}
e.call(l.prototype);
}
} else {
try {
throw Error();
} catch (b) {
o = b;
}
e();
}
} catch (b) {
if (b && o && typeof b.stack == "string") {
for (var s = b.stack.split(`
`), m = o.stack.split(`
`), f = s.length - 1, d = m.length - 1; f >= 1 && d >= 0 && s[f] !== m[d]; )
d--;
for (; f >= 1 && d >= 0; f--, d--)
if (s[f] !== m[d]) {
if (f !== 1 || d !== 1)
do
if (f--, d--, d < 0 || s[f] !== m[d]) {
var x = `
` + s[f].replace(" at new ", " at ");
return e.displayName && x.includes("<anonymous>") && (x = x.replace("<anonymous>", e.displayName)), typeof e == "function" && Y.set(e, x), x;
}
while (f >= 1 && d >= 0);
break;
}
}
} finally {
X = !1, K.current = c, ze(), Error.prepareStackTrace = u;
}
var L = e ? e.displayName || e.name : "", P = L ? B(L) : "";
return typeof e == "function" && Y.set(e, P), P;
}
function He(e, r, n) {
return he(e, !1);
}
function Ke(e) {
var r = e.prototype;
return !!(r && r.isReactComponent);
}
function V(e, r, n) {
if (e == null)
return "";
if (typeof e == "function")
return he(e, Ke(e));
if (typeof e == "string")
return B(e);
switch (e) {
case S:
return B("Suspense");
case p:
return B("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case g:
return He(e.render);
case j:
return V(e.type, r, n);
case E: {
var o = e, u = o._payload, c = o._init;
try {
return V(c(u), r, n);
} catch {
}
}
}
return "";
}
var $ = Object.prototype.hasOwnProperty, me = {}, _e = A.ReactDebugCurrentFrame;
function q(e) {
if (e) {
var r = e._owner, n = V(e.type, e._source, r ? r.type : null);
_e.setExtraStackFrame(n);
} else
_e.setExtraStackFrame(null);
}
function Ge(e, r, n, o, u) {
{
var c = Function.call.bind($);
for (var l in e)
if (c(e, l)) {
var s = void 0;
try {
if (typeof e[l] != "function") {
var m = Error((o || "React class") + ": " + n + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw m.name = "Invariant Violation", m;
}
s = e[l](r, l, o, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (f) {
s = f;
}
s && !(s instanceof Error) && (q(u), h("%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).", o || "React class", n, l, typeof s), q(null)), s instanceof Error && !(s.message in me) && (me[s.message] = !0, q(u), h("Failed %s type: %s", n, s.message), q(null));
}
}
}
var Xe = Array.isArray;
function Z(e) {
return Xe(e);
}
function Ze(e) {
{
var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
return n;
}
}
function Qe(e) {
try {
return pe(e), !1;
} catch {
return !0;
}
}
function pe(e) {
return "" + e;
}
function be(e) {
if (Qe(e))
return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ze(e)), pe(e);
}
var ye = A.ReactCurrentOwner, er = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, xe, we;
function rr(e) {
if ($.call(e, "ref")) {
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
if (r && r.isReactWarning)
return !1;
}
return e.ref !== void 0;
}
function nr(e) {
if ($.call(e, "key")) {
var r = Object.getOwnPropertyDescriptor(e, "key").get;
if (r && r.isReactWarning)
return !1;
}
return e.key !== void 0;
}
function tr(e, r) {
typeof e.ref == "string" && ye.current;
}
function ar(e, r) {
{
var n = function() {
xe || (xe = !0, h("%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)", r));
};
n.isReactWarning = !0, Object.defineProperty(e, "key", {
get: n,
configurable: !0
});
}
}
function or(e, r) {
{
var n = function() {
we || (we = !0, h("%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)", r));
};
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
get: n,
configurable: !0
});
}
}
var ir = function(e, r, n, o, u, c, l) {
var s = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: i,
// Built-in properties that belong on the element
type: e,
key: r,
ref: n,
props: l,
// Record the component responsible for creating this element.
_owner: c
};
return s._store = {}, Object.defineProperty(s._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(s, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: o
}), Object.defineProperty(s, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: u
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
};
function sr(e, r, n, o, u) {
{
var c, l = {}, s = null, m = null;
n !== void 0 && (be(n), s = "" + n), nr(r) && (be(r.key), s = "" + r.key), rr(r) && (m = r.ref, tr(r, u));
for (c in r)
$.call(r, c) && !er.hasOwnProperty(c) && (l[c] = r[c]);
if (e && e.defaultProps) {
var f = e.defaultProps;
for (c in f)
l[c] === void 0 && (l[c] = f[c]);
}
if (s || m) {
var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
s && ar(l, d), m && or(l, d);
}
return ir(e, s, m, u, o, ye.current, l);
}
}
var Q = A.ReactCurrentOwner, je = A.ReactDebugCurrentFrame;
function I(e) {
if (e) {
var r = e._owner, n = V(e.type, e._source, r ? r.type : null);
je.setExtraStackFrame(n);
} else
je.setExtraStackFrame(null);
}
var ee;
ee = !1;
function re(e) {
return typeof e == "object" && e !== null && e.$$typeof === i;
}
function Ce() {
{
if (Q.current) {
var e = T(Q.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
}
}
function lr(e) {
return "";
}
var Ee = {};
function ur(e) {
{
var r = Ce();
if (!r) {
var n = typeof e == "string" ? e : e.displayName || e.name;
n && (r = `
Check the top-level render call using <` + n + ">.");
}
return r;
}
}
function Re(e, r) {
{
if (!e._store || e._store.validated || e.key != null)
return;
e._store.validated = !0;
var n = ur(r);
if (Ee[n])
return;
Ee[n] = !0;
var o = "";
e && e._owner && e._owner !== Q.current && (o = " It was passed a child from " + T(e._owner.type) + "."), I(e), h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, o), I(null);
}
}
function ke(e, r) {
{
if (typeof e != "object")
return;
if (Z(e))
for (var n = 0; n < e.length; n++) {
var o = e[n];
re(o) && Re(o, r);
}
else if (re(e))
e._store && (e._store.validated = !0);
else if (e) {
var u = De(e);
if (typeof u == "function" && u !== e.entries)
for (var c = u.call(e), l; !(l = c.next()).done; )
re(l.value) && Re(l.value, r);
}
}
}
function cr(e) {
{
var r = e.type;
if (r == null || typeof r == "string")
return;
var n;
if (typeof r == "function")
n = r.propTypes;
else if (typeof r == "object" && (r.$$typeof === g || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
r.$$typeof === j))
n = r.propTypes;
else
return;
if (n) {
var o = T(r);
Ge(n, e.props, "prop", o, e);
} else if (r.PropTypes !== void 0 && !ee) {
ee = !0;
var u = T(r);
h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
}
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function fr(e) {
{
for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
var o = r[n];
if (o !== "children" && o !== "key") {
I(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), I(null);
break;
}
}
e.ref !== null && (I(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), I(null));
}
}
var Te = {};
function Se(e, r, n, o, u, c) {
{
var l = Ve(e);
if (!l) {
var s = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (s += " 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 m = lr();
m ? s += m : s += Ce();
var f;
e === null ? f = "null" : Z(e) ? f = "array" : e !== void 0 && e.$$typeof === i ? (f = "<" + (T(e.type) || "Unknown") + " />", s = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", f, s);
}
var d = sr(e, r, n, u, c);
if (d == null)
return d;
if (l) {
var x = r.children;
if (x !== void 0)
if (o)
if (Z(x)) {
for (var L = 0; L < x.length; L++)
ke(x[L], e);
Object.freeze && Object.freeze(x);
} else
h("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
ke(x, e);
}
if ($.call(r, "key")) {
var P = T(e), b = Object.keys(r).filter(function(_r) {
return _r !== "key";
}), ne = b.length > 0 ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!Te[P + ne]) {
var mr = b.length > 0 ? "{" + b.join(": ..., ") + ": ...}" : "{}";
h(`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} />`, ne, P, mr, P), Te[P + ne] = !0;
}
}
return e === _ ? fr(d) : cr(d), d;
}
}
function dr(e, r, n) {
return Se(e, r, n, !0);
}
function vr(e, r, n) {
return Se(e, r, n, !1);
}
var gr = vr, hr = dr;
N.Fragment = _, N.jsx = gr, N.jsxs = hr;
}()), N;
}
var Ae;
function xr() {
return Ae || (Ae = 1, process.env.NODE_ENV === "production" ? U.exports = br() : U.exports = yr()), U.exports;
}
var a = xr();
const H = (t = "", i = "") => (t ? `${t} ${i}` : i).trim(), wr = "_btn_1qvpf_3", jr = "_primary_1qvpf_24", Cr = "_secondary_1qvpf_44", Er = "_outline_1qvpf_49", Rr = "_destructive_1qvpf_69", kr = "_loading_1qvpf_73", Tr = "_spin_1qvpf_1", Sr = "_icon_1qvpf_77", z = {
"sr-only": "_sr-only_1qvpf_1",
btn: wr,
primary: jr,
secondary: Cr,
outline: Er,
destructive: Rr,
loading: kr,
spin: Tr,
icon: Sr
}, Or = "_spinner_1g6p5_3", Pr = "_small_1g6p5_27", Ar = "_currentColor_1g6p5_34", te = {
"sr-only": "_sr-only_1g6p5_1",
spinner: Or,
"loading-circle": "_loading-circle_1g6p5_1",
small: Pr,
currentColor: Ar
};
function Ir(t) {
function i() {
return (t.variant ? " " + te[t.variant] : "") + (t.color === "currentColor" ? " " + te[t.color] : "");
}
return /* @__PURE__ */ a.jsx(
"span",
{
"aria-label": "Loading",
className: `${te.spinner}${i()}`,
"aria-hidden": !0
}
);
}
function Lr(t) {
return /* @__PURE__ */ a.jsx(
"svg",
{
fill: "none",
viewBox: "0 0 24 24",
"stroke-width": "1.5",
stroke: "currentColor",
...t.svgAttrs,
children: /* @__PURE__ */ a.jsx(
"path",
{
"stroke-linecap": "round",
"stroke-linejoin": "round",
d: "M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"
}
)
}
);
}
function Mr(t) {
return /* @__PURE__ */ a.jsx(
"svg",
{
fill: "none",
viewBox: "0 0 24 24",
"stroke-width": "1.5",
stroke: "currentColor",
...t.svgAttrs,
children: /* @__PURE__ */ a.jsx(
"path",
{
"stroke-linecap": "round",
"stroke-linejoin": "round",
d: "M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"
}
)
}
);
}
const nn = pr(function(i, v) {
function _() {
const {
buttonRef: w,
name: y,
handleClick: k,
type: g,
variant: S,
classNames: p,
isLoading: j,
...E
} = i;
return E;
}
function C() {
return i.variant ? " " + z[i.variant] : "";
}
return /* @__PURE__ */ a.jsxs(
"button",
{
ref: v,
type: i.type || "button",
className: `${z.btn}${C()}${i.classNames ? " " + i.classNames : ""}`,
disabled: i.isLoading,
onClick: (w) => {
var y;
return (y = i.handleClick) == null ? void 0 : y.call(i, w);
},
..._(),
children: [
i.isLoading ? /* @__PURE__ */ a.jsx(Ir, { variant: "small", color: "currentColor" }) : null,
i.icon === "LeftArrowIcon" ? /* @__PURE__ */ a.jsx(
Lr,
{
svgAttrs: {
"aria-hidden": !0,
class: z.icon
}
}
) : null,
i.icon === "RightArrowIcon" ? /* @__PURE__ */ a.jsx(
Mr,
{
svgAttrs: {
"aria-hidden": !0,
class: z.icon
}
}
) : null,
i.name
]
}
);
}), M = {
px: "1px",
0: "0px",
0.5: "0.125rem",
1: "0.25rem",
1.5: "0.375rem",
2: "0.5rem",
2.5: "0.625rem",
3: "0.75rem",
3.5: "0.875rem",
4: "1rem",
5: "1.25rem",
6: "1.5rem",
7: "1.75rem",
8: "2rem",
9: "2.25rem",
10: "2.5rem",
11: "2.75rem",
12: "3rem",
14: "3.5rem",
16: "4rem",
20: "5rem",
24: "6rem",
28: "7rem",
32: "8rem",
36: "9rem",
40: "10rem",
44: "11rem",
48: "12rem",
52: "13rem",
56: "14rem",
60: "15rem",
64: "16rem",
72: "18rem",
80: "20rem",
96: "24rem"
};
function Dr(t) {
function i() {
return t.x !== void 0 && M[t.x] ? M[t.x] : M[0];
}
function v() {
return t.y !== void 0 && M[t.y] ? M[t.y] : M[0];
}
return /* @__PURE__ */ a.jsx(
"span",
{
style: {
marginLeft: i(),
marginTop: v(),
display: "inline-block"
},
"aria-hidden": !0
}
);
}
const $r = "_container_vbwgx_3", Fr = "_input_vbwgx_8", Nr = "_textarea_vbwgx_9", Wr = "_label_vbwgx_46", Br = "_labelWithCopy_vbwgx_54", Yr = "_fieldset_vbwgx_59", J = {
container: $r,
input: Fr,
textarea: Nr,
label: Wr,
labelWithCopy: Br,
fieldset: Yr,
"input-sm": "_input-sm_vbwgx_63"
}, Vr = "_btn_wxot7_3", qr = "_svg_wxot7_23", R = {
btn: Vr,
svg: qr
};
function Ur(t) {
return /* @__PURE__ */ a.jsx(
"svg",
{
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
viewBox: "0 0 24 24",
"stroke-width": "1.5",
stroke: "currentColor",
...t.svgAttrs,
children: /* @__PURE__ */ a.jsx(
"path",
{
"stroke-linecap": "round",
"stroke-linejoin": "round",
d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125"
}
)
}
);
}
function zr(t) {
return /* @__PURE__ */ a.jsx(
"svg",
{
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
viewBox: "0 0 24 24",
"stroke-width": "1.5",
stroke: "currentColor",
...t.svgAttrs,
children: /* @__PURE__ */ a.jsx(
"path",
{
"stroke-linecap": "round",
"stroke-linejoin": "round",
d: "M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5A3.375 3.375 0 006.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0015 2.25h-1.5a2.251 2.251 0 00-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 00-9-9z"
}
)
}
);
}
function Jr(t) {
return /* @__PURE__ */ a.jsxs(
"svg",
{
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
viewBox: "0 0 24 24",
"stroke-width": "1.5",
stroke: "currentColor",
...t.svgAttrs,
children: [
/* @__PURE__ */ a.jsx(
"path",
{
"stroke-linecap": "round",
"stroke-linejoin": "round",
d: "M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"
}
),
/* @__PURE__ */ a.jsx(
"path",
{
"stroke-linecap": "round",
"stroke-linejoin": "round",
d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
}
)
]
}
);
}
function Hr(t) {
return /* @__PURE__ */ a.jsx(
"svg",
{
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
viewBox: "0 0 24 24",
"stroke-width": "1.5",
stroke: "currentColor",
...t.svgAttrs,
children: /* @__PURE__ */ a.jsx(
"path",
{
"stroke-linecap": "round",
"stroke-linejoin": "round",
d: "M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"
}
)
}
);
}
function Kr(t) {
return /* @__PURE__ */ a.jsx(
"svg",
{
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
"stroke-width": "1.5",
"stroke-linecap": "round",
"stroke-linejoin": "round",
...t.svgAttrs,
children: /* @__PURE__ */ a.jsx(
"path",
{
"stroke-linecap": "round",
"stroke-linejoin": "round",
d: "M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"
}
)
}
);
}
function Gr(t) {
return /* @__PURE__ */ a.jsx(
"svg",
{
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
viewBox: "0 0 24 24",
"stroke-width": "1.5",
stroke: "currentColor",
...t.svgAttrs,
children: /* @__PURE__ */ a.jsx(
"path",
{
"stroke-linecap": "round",
"stroke-linejoin": "round",
d: "M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"
}
)
}
);
}
function Xr(t) {
return /* @__PURE__ */ a.jsx(
"svg",
{
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
viewBox: "0 0 24 24",
"stroke-width": "1.5",
stroke: "currentColor",
...t.svgAttrs,
children: /* @__PURE__ */ a.jsx(
"path",
{
"stroke-linecap": "round",
"stroke-linejoin": "round",
d: "M12 4.5v15m7.5-7.5h-15"
}
)
}
);
}
function Zr(t) {
const [i, v] = Le(
() => Math.random().toString(36).substring(2, 8)
);
return /* @__PURE__ */ a.jsxs(
"svg",
{
width: "20",
height: "20",
viewBox: "0 0 20 20",
fill: "none",
...t.svgAttrs,
children: [
/* @__PURE__ */ a.jsx("g", { "clip-path": `url(#clip${i})}`, children: /* @__PURE__ */ a.jsx(
"path",
{
d: "M10 1.25C5.16751 1.25 1.25 5.16751 1.25 10C1.25 14.8325 5.16751 18.75 10 18.75C14.8325 18.75 18.75 14.8325 18.75 10C18.75 7.67936 17.8281 5.45376 16.1872 3.81282C14.5462 2.17187 12.3206 1.25 10 1.25ZM8.75 13.4943L5.625 10.3693L6.61912 9.375L8.75 11.5057L13.3813 6.875L14.3786 7.86619L8.75 13.4943Z",
fill: "#24A148"
}
) }),
/* @__PURE__ */ a.jsx("defs", { children: /* @__PURE__ */ a.jsx("clipPath", { id: `clip${i}`, children: /* @__PURE__ */ a.jsx("rect", { width: "20", height: "20", fill: "white" }) }) })
]
}
);
}
function Qr(t) {
function i() {
var v;
return H((v = t.classNames) == null ? void 0 : v.button, R.btn);
}
return /* @__PURE__ */ a.jsxs(
"button",
{
type: "button",
onClick: (v) => t.handleClick(v),
className: i(),
"aria-label": t.label,
children: [
t.icon === "PencilIcon" ? /* @__PURE__ */ a.jsx(
Ur,
{
svgAttrs: {
"aria-hidden": !0,
class: R.svg
}
}
) : null,
t.icon === "CopytoClipboardIcon" ? /* @__PURE__ */ a.jsx(
zr,
{
svgAttrs: {
"aria-hidden": !0,
class: R.svg
}
}
) : null,
t.icon === "EyeIcon" ? /* @__PURE__ */ a.jsx(
Jr,
{
svgAttrs: {
"aria-hidden": !0,
class: R.svg
}
}
) : null,
t.icon === "EyeSlashIcon" ? /* @__PURE__ */ a.jsx(
Hr,
{
svgAttrs: {
"aria-hidden": !0,
class: R.svg
}
}
) : null,
t.icon === "InfoIcon" ? /* @__PURE__ */ a.jsx(
Kr,
{
svgAttrs: {
"aria-hidden": !0,
class: R.svg
}
}
) : null,
t.icon === "LinkIcon" ? /* @__PURE__ */ a.jsx(
Gr,
{
svgAttrs: {
"aria-hidden": !0,
class: R.svg
}
}
) : null,
t.icon === "PlusIcon" ? /* @__PURE__ */ a.jsx(
Xr,
{
svgAttrs: {
"aria-hidden": !0,
class: R.svg
}
}
) : null,
t.icon === "CheckMarkIcon" ? /* @__PURE__ */ a.jsx(
Zr,
{
svgAttrs: {
"aria-hidden": !0,
class: R.svg
}
}
) : null
]
}
);
}
function en(t) {
function i(_) {
navigator.clipboard.writeText(_);
}
function v() {
i(t.text), typeof t.successCallback == "function" && t.successCallback({
operation: "COPY"
});
}
return /* @__PURE__ */ a.jsx(
Qr,
{
label: "Copy",
icon: "CopytoClipboardIcon",
handleClick: v
}
);
}
function tn(t) {
return /* @__PURE__ */ a.jsx(
"svg",
{
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
viewBox: "0 0 24 24",
"stroke-width": "1.5",
stroke: "currentColor",
...t.svgAttrs,
children: /* @__PURE__ */ a.jsx(
"path",
{
"stroke-linecap": "round",
"stroke-linejoin": "round",
d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"
}
)
}
);
}
function an(t) {
const [i, v] = Le(() => t.label.replace(/ /g, ""));
function _() {
var C, w, y;
return {
container: H(
(C = t.classNames) == null ? void 0 : C.container,
J.container
),
input: H((w = t.classNames) == null ? void 0 : w.input, J.input),
label: H((y = t.classNames) == null ? void 0 : y.label, J.label)
};
}
return /* @__PURE__ */ a.jsxs("div", { className: _().container, children: [
/* @__PURE__ */ a.jsxs("div", { className: J.labelWithCopy, children: [
/* @__PURE__ */ a.jsx("label", { className: _().label, htmlFor: i, children: t.label }),
/* @__PURE__ */ a.jsx(
en,
{
successCallback: t.copyDoneCallback,
text: t.text
}
)
] }),
/* @__PURE__ */ a.jsx(Dr, { y: 2 }),
/* @__PURE__ */ a.jsx(
"input",
{
type: "text",
id: i,
value: t.text,
readOnly: !0,
className: _().input
}
)
] });
}
export {
nn as B,
Zr as C,
tn as E,
Kr as I,
Dr as S,
an as a,
Qr as b,
H as c,
en as d,
Ir as e,
a as j,
J as s
};
//# sourceMappingURL=index-CL4_ByuK.js.map