@boxyhq/react-ui
Advanced tools
Comparing version 2.0.0 to 3.0.0-beta.45
819
dist/sso.js
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode("._container_ptl9n_1{display:flex;flex-direction:column;max-width:28rem}._label_ptl9n_7{margin-bottom:.375rem}._input_ptl9n_11{font-family:inherit;appearance:none;background-color:#fff;border-radius:.375rem;border-width:1px;border-color:#ebedf0;border-style:solid;padding:.5rem .75rem;font-size:1rem;margin-top:1px;outline:none;margin-bottom:1rem}._input_ptl9n_11:focus{outline:2px solid hsl(0 0% 20%/ .2);outline-offset:2px}._button_ptl9n_31{cursor:pointer;font-family:inherit;background-image:none;border-radius:.25rem;padding:.5rem 1rem;background-color:transparent;border:1px solid rgb(51,51,51);color:currentColor}._button_ptl9n_31:disabled{background:hsl(219 14% 28% / .2);color:#3333;border-color:currentColor;pointer-events:none}._button_ptl9n_31:hover:not(:disabled){background-color:#333;color:#fff}._button_ptl9n_31:focus-visible{outline:2px solid hsl(219 14% 22%);outline-offset:2px}._button_ptl9n_31:active:hover,._button_ptl9n_31:active:focus{transform:scale(.95)}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})(); | ||
import Me, { useState as ve } from "react"; | ||
var pe = { exports: {} }, Y = {}; | ||
/** | ||
* @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 $e; | ||
function vr() { | ||
if ($e) | ||
return Y; | ||
$e = 1; | ||
var u = Me, p = Symbol.for("react.element"), P = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, w = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, k = { key: !0, ref: !0, __self: !0, __source: !0 }; | ||
function C(_, d, x) { | ||
var v, g = {}, y = null, I = null; | ||
x !== void 0 && (y = "" + x), d.key !== void 0 && (y = "" + d.key), d.ref !== void 0 && (I = d.ref); | ||
for (v in d) | ||
m.call(d, v) && !k.hasOwnProperty(v) && (g[v] = d[v]); | ||
if (_ && _.defaultProps) | ||
for (v in d = _.defaultProps, d) | ||
g[v] === void 0 && (g[v] = d[v]); | ||
return { $$typeof: p, type: _, key: y, ref: I, props: g, _owner: w.current }; | ||
} | ||
return Y.Fragment = P, Y.jsx = C, Y.jsxs = C, Y; | ||
} | ||
var M = {}; | ||
/** | ||
* @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 Le; | ||
function pr() { | ||
return Le || (Le = 1, process.env.NODE_ENV !== "production" && function() { | ||
var u = Me, p = Symbol.for("react.element"), P = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), C = Symbol.for("react.provider"), _ = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), I = Symbol.for("react.offscreen"), N = Symbol.iterator, U = "@@iterator"; | ||
function V(e) { | ||
if (e === null || typeof e != "object") | ||
return null; | ||
var r = N && e[N] || e[U]; | ||
return typeof r == "function" ? r : null; | ||
} | ||
var E = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
function f(e) { | ||
{ | ||
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++) | ||
t[n - 1] = arguments[n]; | ||
B("error", e, t); | ||
} | ||
} | ||
function B(e, r, t) { | ||
{ | ||
var n = E.ReactDebugCurrentFrame, o = n.getStackAddendum(); | ||
o !== "" && (r += "%s", t = t.concat([o])); | ||
var s = t.map(function(i) { | ||
return String(i); | ||
}); | ||
s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s); | ||
} | ||
} | ||
var q = !1, G = !1, J = !1, z = !1, K = !1, $; | ||
$ = Symbol.for("react.module.reference"); | ||
function R(e) { | ||
return !!(typeof e == "string" || typeof e == "function" || e === m || e === k || K || e === w || e === x || e === v || z || e === I || q || G || J || typeof e == "object" && e !== null && (e.$$typeof === y || e.$$typeof === g || e.$$typeof === C || e.$$typeof === _ || e.$$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. | ||
e.$$typeof === $ || e.getModuleId !== void 0)); | ||
} | ||
function ae(e, r, t) { | ||
var n = e.displayName; | ||
if (n) | ||
return n; | ||
var o = r.displayName || r.name || ""; | ||
return o !== "" ? t + "(" + o + ")" : t; | ||
} | ||
function F(e) { | ||
return e.displayName || "Context"; | ||
} | ||
function T(e) { | ||
if (e == null) | ||
return null; | ||
if (typeof e.tag == "number" && f("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 m: | ||
return "Fragment"; | ||
case P: | ||
return "Portal"; | ||
case k: | ||
return "Profiler"; | ||
case w: | ||
return "StrictMode"; | ||
case x: | ||
return "Suspense"; | ||
case v: | ||
return "SuspenseList"; | ||
} | ||
if (typeof e == "object") | ||
switch (e.$$typeof) { | ||
case _: | ||
var r = e; | ||
return F(r) + ".Consumer"; | ||
case C: | ||
var t = e; | ||
return F(t._context) + ".Provider"; | ||
case d: | ||
return ae(e, e.render, "ForwardRef"); | ||
case g: | ||
var n = e.displayName || null; | ||
return n !== null ? n : T(e.type) || "Memo"; | ||
case y: { | ||
var o = e, s = o._payload, i = o._init; | ||
try { | ||
return T(i(s)); | ||
} catch { | ||
return null; | ||
} | ||
} | ||
} | ||
return null; | ||
} | ||
var j = Object.assign, L = 0, be, ge, he, _e, me, ye, Ee; | ||
function Re() { | ||
} | ||
Re.__reactDisabledLog = !0; | ||
function Ue() { | ||
{ | ||
if (L === 0) { | ||
be = console.log, ge = console.info, he = console.warn, _e = console.error, me = console.group, ye = console.groupCollapsed, Ee = console.groupEnd; | ||
var e = { | ||
configurable: !0, | ||
enumerable: !0, | ||
value: Re, | ||
writable: !0 | ||
}; | ||
Object.defineProperties(console, { | ||
info: e, | ||
log: e, | ||
warn: e, | ||
error: e, | ||
group: e, | ||
groupCollapsed: e, | ||
groupEnd: e | ||
}); | ||
} | ||
L++; | ||
} | ||
} | ||
function Ve() { | ||
{ | ||
if (L--, L === 0) { | ||
var e = { | ||
configurable: !0, | ||
enumerable: !0, | ||
writable: !0 | ||
}; | ||
Object.defineProperties(console, { | ||
log: j({}, e, { | ||
value: be | ||
}), | ||
info: j({}, e, { | ||
value: ge | ||
}), | ||
warn: j({}, e, { | ||
value: he | ||
}), | ||
error: j({}, e, { | ||
value: _e | ||
}), | ||
group: j({}, e, { | ||
value: me | ||
}), | ||
groupCollapsed: j({}, e, { | ||
value: ye | ||
}), | ||
groupEnd: j({}, e, { | ||
value: Ee | ||
}) | ||
}); | ||
} | ||
L < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue."); | ||
} | ||
} | ||
var ie = E.ReactCurrentDispatcher, oe; | ||
function H(e, r, t) { | ||
{ | ||
if (oe === void 0) | ||
try { | ||
throw Error(); | ||
} catch (o) { | ||
var n = o.stack.trim().match(/\n( *(at )?)/); | ||
oe = n && n[1] || ""; | ||
} | ||
return ` | ||
` + oe + e; | ||
} | ||
} | ||
var ue = !1, X; | ||
{ | ||
var Be = typeof WeakMap == "function" ? WeakMap : Map; | ||
X = new Be(); | ||
} | ||
function Te(e, r) { | ||
if (!e || ue) | ||
return ""; | ||
{ | ||
var t = X.get(e); | ||
if (t !== void 0) | ||
return t; | ||
} | ||
var n; | ||
ue = !0; | ||
var o = Error.prepareStackTrace; | ||
Error.prepareStackTrace = void 0; | ||
var s; | ||
s = ie.current, ie.current = null, Ue(); | ||
try { | ||
if (r) { | ||
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 (S) { | ||
n = S; | ||
} | ||
Reflect.construct(e, [], i); | ||
} else { | ||
try { | ||
i.call(); | ||
} catch (S) { | ||
n = S; | ||
} | ||
e.call(i.prototype); | ||
} | ||
} else { | ||
try { | ||
throw Error(); | ||
} catch (S) { | ||
n = S; | ||
} | ||
e(); | ||
} | ||
} catch (S) { | ||
if (S && n && typeof S.stack == "string") { | ||
for (var a = S.stack.split(` | ||
`), b = n.stack.split(` | ||
`), l = a.length - 1, c = b.length - 1; l >= 1 && c >= 0 && a[l] !== b[c]; ) | ||
c--; | ||
for (; l >= 1 && c >= 0; l--, c--) | ||
if (a[l] !== b[c]) { | ||
if (l !== 1 || c !== 1) | ||
do | ||
if (l--, c--, c < 0 || a[l] !== b[c]) { | ||
var h = ` | ||
` + a[l].replace(" at new ", " at "); | ||
return e.displayName && h.includes("<anonymous>") && (h = h.replace("<anonymous>", e.displayName)), typeof e == "function" && X.set(e, h), h; | ||
} | ||
while (l >= 1 && c >= 0); | ||
break; | ||
} | ||
} | ||
} finally { | ||
ue = !1, ie.current = s, Ve(), Error.prepareStackTrace = o; | ||
} | ||
var A = e ? e.displayName || e.name : "", Ne = A ? H(A) : ""; | ||
return typeof e == "function" && X.set(e, Ne), Ne; | ||
} | ||
function qe(e, r, t) { | ||
return Te(e, !1); | ||
} | ||
function Ge(e) { | ||
var r = e.prototype; | ||
return !!(r && r.isReactComponent); | ||
} | ||
function Z(e, r, t) { | ||
if (e == null) | ||
return ""; | ||
if (typeof e == "function") | ||
return Te(e, Ge(e)); | ||
if (typeof e == "string") | ||
return H(e); | ||
switch (e) { | ||
case x: | ||
return H("Suspense"); | ||
case v: | ||
return H("SuspenseList"); | ||
} | ||
if (typeof e == "object") | ||
switch (e.$$typeof) { | ||
case d: | ||
return qe(e.render); | ||
case g: | ||
return Z(e.type, r, t); | ||
case y: { | ||
var n = e, o = n._payload, s = n._init; | ||
try { | ||
return Z(s(o), r, t); | ||
} catch { | ||
} | ||
} | ||
} | ||
return ""; | ||
} | ||
var Q = Object.prototype.hasOwnProperty, Se = {}, Oe = E.ReactDebugCurrentFrame; | ||
function ee(e) { | ||
if (e) { | ||
var r = e._owner, t = Z(e.type, e._source, r ? r.type : null); | ||
Oe.setExtraStackFrame(t); | ||
} else | ||
Oe.setExtraStackFrame(null); | ||
} | ||
function Je(e, r, t, n, o) { | ||
{ | ||
var s = Function.call.bind(Q); | ||
for (var i in e) | ||
if (s(e, i)) { | ||
var a = void 0; | ||
try { | ||
if (typeof e[i] != "function") { | ||
var b = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); | ||
throw b.name = "Invariant Violation", b; | ||
} | ||
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); | ||
} catch (l) { | ||
a = l; | ||
} | ||
a && !(a instanceof Error) && (ee(o), f("%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).", n || "React class", t, i, typeof a), ee(null)), a instanceof Error && !(a.message in Se) && (Se[a.message] = !0, ee(o), f("Failed %s type: %s", t, a.message), ee(null)); | ||
} | ||
} | ||
} | ||
var ze = Array.isArray; | ||
function se(e) { | ||
return ze(e); | ||
} | ||
function Ke(e) { | ||
{ | ||
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object"; | ||
return t; | ||
} | ||
} | ||
function He(e) { | ||
try { | ||
return Pe(e), !1; | ||
} catch { | ||
return !0; | ||
} | ||
} | ||
function Pe(e) { | ||
return "" + e; | ||
} | ||
function Ce(e) { | ||
if (He(e)) | ||
return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)), Pe(e); | ||
} | ||
var W = E.ReactCurrentOwner, Xe = { | ||
key: !0, | ||
ref: !0, | ||
__self: !0, | ||
__source: !0 | ||
}, xe, we, le; | ||
le = {}; | ||
function Ze(e) { | ||
if (Q.call(e, "ref")) { | ||
var r = Object.getOwnPropertyDescriptor(e, "ref").get; | ||
if (r && r.isReactWarning) | ||
return !1; | ||
} | ||
return e.ref !== void 0; | ||
} | ||
function Qe(e) { | ||
if (Q.call(e, "key")) { | ||
var r = Object.getOwnPropertyDescriptor(e, "key").get; | ||
if (r && r.isReactWarning) | ||
return !1; | ||
} | ||
return e.key !== void 0; | ||
} | ||
function er(e, r) { | ||
if (typeof e.ref == "string" && W.current && r && W.current.stateNode !== r) { | ||
var t = T(W.current.type); | ||
le[t] || (f('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', T(W.current.type), e.ref), le[t] = !0); | ||
} | ||
} | ||
function rr(e, r) { | ||
{ | ||
var t = function() { | ||
xe || (xe = !0, f("%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)); | ||
}; | ||
t.isReactWarning = !0, Object.defineProperty(e, "key", { | ||
get: t, | ||
configurable: !0 | ||
}); | ||
} | ||
} | ||
function tr(e, r) { | ||
{ | ||
var t = function() { | ||
we || (we = !0, f("%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)); | ||
}; | ||
t.isReactWarning = !0, Object.defineProperty(e, "ref", { | ||
get: t, | ||
configurable: !0 | ||
}); | ||
} | ||
} | ||
var nr = function(e, r, t, n, o, s, i) { | ||
var a = { | ||
// This tag allows us to uniquely identify this as a React Element | ||
$$typeof: p, | ||
// Built-in properties that belong on the element | ||
type: e, | ||
key: r, | ||
ref: t, | ||
props: i, | ||
// Record the component responsible for creating this element. | ||
_owner: s | ||
}; | ||
return a._store = {}, Object.defineProperty(a._store, "validated", { | ||
configurable: !1, | ||
enumerable: !1, | ||
writable: !0, | ||
value: !1 | ||
}), Object.defineProperty(a, "_self", { | ||
configurable: !1, | ||
enumerable: !1, | ||
writable: !1, | ||
value: n | ||
}), Object.defineProperty(a, "_source", { | ||
configurable: !1, | ||
enumerable: !1, | ||
writable: !1, | ||
value: o | ||
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a; | ||
}; | ||
function ar(e, r, t, n, o) { | ||
{ | ||
var s, i = {}, a = null, b = null; | ||
t !== void 0 && (Ce(t), a = "" + t), Qe(r) && (Ce(r.key), a = "" + r.key), Ze(r) && (b = r.ref, er(r, o)); | ||
for (s in r) | ||
Q.call(r, s) && !Xe.hasOwnProperty(s) && (i[s] = r[s]); | ||
if (e && e.defaultProps) { | ||
var l = e.defaultProps; | ||
for (s in l) | ||
i[s] === void 0 && (i[s] = l[s]); | ||
} | ||
if (a || b) { | ||
var c = typeof e == "function" ? e.displayName || e.name || "Unknown" : e; | ||
a && rr(i, c), b && tr(i, c); | ||
} | ||
return nr(e, a, b, o, n, W.current, i); | ||
} | ||
} | ||
var ce = E.ReactCurrentOwner, je = E.ReactDebugCurrentFrame; | ||
function D(e) { | ||
if (e) { | ||
var r = e._owner, t = Z(e.type, e._source, r ? r.type : null); | ||
je.setExtraStackFrame(t); | ||
} else | ||
je.setExtraStackFrame(null); | ||
} | ||
var fe; | ||
fe = !1; | ||
function de(e) { | ||
return typeof e == "object" && e !== null && e.$$typeof === p; | ||
} | ||
function ke() { | ||
{ | ||
if (ce.current) { | ||
var e = T(ce.current.type); | ||
if (e) | ||
return ` | ||
Check the render method of \`` + e + "`."; | ||
} | ||
return ""; | ||
} | ||
} | ||
function ir(e) { | ||
{ | ||
if (e !== void 0) { | ||
var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber; | ||
return ` | ||
Check your code at ` + r + ":" + t + "."; | ||
} | ||
return ""; | ||
} | ||
} | ||
var Ie = {}; | ||
function or(e) { | ||
{ | ||
var r = ke(); | ||
if (!r) { | ||
var t = typeof e == "string" ? e : e.displayName || e.name; | ||
t && (r = ` | ||
Check the top-level render call using <` + t + ">."); | ||
} | ||
return r; | ||
} | ||
} | ||
function Fe(e, r) { | ||
{ | ||
if (!e._store || e._store.validated || e.key != null) | ||
return; | ||
e._store.validated = !0; | ||
var t = or(r); | ||
if (Ie[t]) | ||
return; | ||
Ie[t] = !0; | ||
var n = ""; | ||
e && e._owner && e._owner !== ce.current && (n = " It was passed a child from " + T(e._owner.type) + "."), D(e), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), D(null); | ||
} | ||
} | ||
function De(e, r) { | ||
{ | ||
if (typeof e != "object") | ||
return; | ||
if (se(e)) | ||
for (var t = 0; t < e.length; t++) { | ||
var n = e[t]; | ||
de(n) && Fe(n, r); | ||
} | ||
else if (de(e)) | ||
e._store && (e._store.validated = !0); | ||
else if (e) { | ||
var o = V(e); | ||
if (typeof o == "function" && o !== e.entries) | ||
for (var s = o.call(e), i; !(i = s.next()).done; ) | ||
de(i.value) && Fe(i.value, r); | ||
} | ||
} | ||
} | ||
function ur(e) { | ||
{ | ||
var r = e.type; | ||
if (r == null || typeof r == "string") | ||
return; | ||
var t; | ||
if (typeof r == "function") | ||
t = r.propTypes; | ||
else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here. | ||
// Inner props are checked in the reconciler. | ||
r.$$typeof === g)) | ||
t = r.propTypes; | ||
else | ||
return; | ||
if (t) { | ||
var n = T(r); | ||
Je(t, e.props, "prop", n, e); | ||
} else if (r.PropTypes !== void 0 && !fe) { | ||
fe = !0; | ||
var o = T(r); | ||
f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown"); | ||
} | ||
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); | ||
} | ||
} | ||
function sr(e) { | ||
{ | ||
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) { | ||
var n = r[t]; | ||
if (n !== "children" && n !== "key") { | ||
D(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null); | ||
break; | ||
} | ||
} | ||
e.ref !== null && (D(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), D(null)); | ||
} | ||
} | ||
function Ae(e, r, t, n, o, s) { | ||
{ | ||
var i = R(e); | ||
if (!i) { | ||
var a = ""; | ||
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " 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 b = ir(o); | ||
b ? a += b : a += ke(); | ||
var l; | ||
e === null ? l = "null" : se(e) ? l = "array" : e !== void 0 && e.$$typeof === p ? (l = "<" + (T(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a); | ||
} | ||
var c = ar(e, r, t, o, s); | ||
if (c == null) | ||
return c; | ||
if (i) { | ||
var h = r.children; | ||
if (h !== void 0) | ||
if (n) | ||
if (se(h)) { | ||
for (var A = 0; A < h.length; A++) | ||
De(h[A], e); | ||
Object.freeze && Object.freeze(h); | ||
} else | ||
f("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 | ||
De(h, e); | ||
} | ||
return e === m ? sr(c) : ur(c), c; | ||
} | ||
} | ||
function lr(e, r, t) { | ||
return Ae(e, r, t, !0); | ||
} | ||
function cr(e, r, t) { | ||
return Ae(e, r, t, !1); | ||
} | ||
var fr = cr, dr = lr; | ||
M.Fragment = m, M.jsx = fr, M.jsxs = dr; | ||
}()), M; | ||
} | ||
process.env.NODE_ENV === "production" ? pe.exports = vr() : pe.exports = pr(); | ||
var O = pe.exports; | ||
const br = (u, p = "logged") => `boxyhq-${u}-${p}`, We = (u, p) => { | ||
let P = ""; | ||
return P = br(u, p), P; | ||
}, gr = "_container_ptl9n_1", hr = "_label_ptl9n_7", _r = "_input_ptl9n_11", mr = "_button_ptl9n_31", re = { | ||
container: gr, | ||
label: hr, | ||
input: _r, | ||
button: mr | ||
}, te = (u = "", p) => u || p, Ye = "sso", ne = { | ||
import * as s from "react"; | ||
import { useState as d } from "react"; | ||
const U = (t, n = "logged") => `boxyhq-${t}-${n}`; | ||
var q = U; | ||
const B = (t, n) => { | ||
let i = ""; | ||
return i = q(t, n), i; | ||
}; | ||
var x = B; | ||
const D = "_container_ptl9n_1", R = "_label_ptl9n_7", k = "_input_ptl9n_11", p = "_button_ptl9n_31", u = { | ||
container: D, | ||
label: R, | ||
input: k, | ||
button: p | ||
}, w = (t = "", n) => t || n; | ||
var r = w; | ||
const C = "sso", c = { | ||
ssoIdentifier: "", | ||
@@ -644,101 +24,98 @@ inputLabel: "Tenant", | ||
}; | ||
function Er(u) { | ||
var N, U, V, E, f, B, q, G, J, z, K, $; | ||
const [p, P] = ve( | ||
() => ne.ssoIdentifier | ||
), [m, w] = ve(() => ""), [k, C] = ve(() => !1); | ||
function V(t) { | ||
var E, h, y, N, S, v, T, P; | ||
const [n, i] = d( | ||
() => c.ssoIdentifier | ||
), [b, f] = d(() => ""), [F, m] = d(() => !1); | ||
function _() { | ||
return !!m; | ||
return !!b; | ||
} | ||
function d() { | ||
return !(p || u.ssoIdentifier) || k; | ||
function $() { | ||
return !(n || t.ssoIdentifier) || F; | ||
} | ||
function x() { | ||
return !u.ssoIdentifier; | ||
function A() { | ||
return !t.ssoIdentifier; | ||
} | ||
function v() { | ||
return We(Ye, "input"); | ||
function I() { | ||
return x(C, "input"); | ||
} | ||
function g() { | ||
return We(Ye, "span"); | ||
return x(C, "span"); | ||
} | ||
function y(R) { | ||
w(""), P(R.currentTarget.value); | ||
function o() { | ||
var e, l, a, L; | ||
return { | ||
container: r( | ||
(e = t.classNames) == null ? void 0 : e.container, | ||
u.container | ||
), | ||
label: r((l = t.classNames) == null ? void 0 : l.label, u.label), | ||
input: r((a = t.classNames) == null ? void 0 : a.input, u.input), | ||
button: r( | ||
(L = t.classNames) == null ? void 0 : L.button, | ||
u.button | ||
) | ||
}; | ||
} | ||
function I(R) { | ||
(async function(ae) { | ||
ae.preventDefault(), C(!0); | ||
const { | ||
error: { message: F } | ||
} = await u.onSubmit(p || u.ssoIdentifier) || { | ||
error: {} | ||
}; | ||
C(!1), typeof F == "string" && F && w(F); | ||
})(R); | ||
function M(e) { | ||
var l; | ||
f(""), i((l = e.currentTarget) == null ? void 0 : l.value); | ||
} | ||
return /* @__PURE__ */ O.jsxs( | ||
function O(e) { | ||
e.preventDefault(), m(!0); | ||
const l = (n || t.ssoIdentifier) ?? ""; | ||
t.onSubmit({ | ||
ssoIdentifier: l, | ||
cb(a) { | ||
m(!1), a != null && a.error.message && f(a.error.message); | ||
} | ||
}); | ||
} | ||
return /* @__PURE__ */ s.createElement( | ||
"div", | ||
{ | ||
style: (N = u.styles) == null ? void 0 : N.container, | ||
className: te( | ||
(U = u.classNames) == null ? void 0 : U.container, | ||
re.container | ||
), | ||
...(V = u.innerProps) == null ? void 0 : V.container, | ||
children: [ | ||
x() ? /* @__PURE__ */ O.jsxs(O.Fragment, { children: [ | ||
/* @__PURE__ */ O.jsx( | ||
"label", | ||
{ | ||
htmlFor: v(), | ||
style: (E = u.styles) == null ? void 0 : E.label, | ||
...(f = u.innerProps) == null ? void 0 : f.label, | ||
className: te( | ||
(B = u.classNames) == null ? void 0 : B.label, | ||
re.label | ||
), | ||
children: u.inputLabel || ne.inputLabel | ||
} | ||
), | ||
/* @__PURE__ */ O.jsx( | ||
"input", | ||
{ | ||
id: v(), | ||
value: p, | ||
placeholder: u.placeholder || ne.placeholder, | ||
onChange: (R) => y(R), | ||
style: (q = u.styles) == null ? void 0 : q.input, | ||
className: te( | ||
(G = u.classNames) == null ? void 0 : G.input, | ||
re.input | ||
), | ||
"aria-invalid": _(), | ||
"aria-describedby": g(), | ||
...(J = u.innerProps) == null ? void 0 : J.input | ||
} | ||
), | ||
_() ? /* @__PURE__ */ O.jsx(O.Fragment, { children: /* @__PURE__ */ O.jsx("span", { id: g(), children: m }) }) : null | ||
] }) : null, | ||
/* @__PURE__ */ O.jsx( | ||
"button", | ||
{ | ||
type: "button", | ||
disabled: d(), | ||
onClick: (R) => I(R), | ||
style: (z = u.styles) == null ? void 0 : z.button, | ||
className: te( | ||
(K = u.classNames) == null ? void 0 : K.button, | ||
re.button | ||
), | ||
...($ = u.innerProps) == null ? void 0 : $.button, | ||
children: u.buttonText || ne.buttonText | ||
} | ||
) | ||
] | ||
} | ||
style: (E = t.styles) == null ? void 0 : E.container, | ||
className: o().container, | ||
...(h = t.innerProps) == null ? void 0 : h.container | ||
}, | ||
A() ? /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement( | ||
"label", | ||
{ | ||
htmlFor: I(), | ||
style: (y = t.styles) == null ? void 0 : y.label, | ||
className: o().label, | ||
...(N = t.innerProps) == null ? void 0 : N.label | ||
}, | ||
t.inputLabel || c.inputLabel | ||
), /* @__PURE__ */ s.createElement( | ||
"input", | ||
{ | ||
id: I(), | ||
value: n, | ||
placeholder: t.placeholder || c.placeholder, | ||
onInput: (e) => M(e), | ||
style: (S = t.styles) == null ? void 0 : S.input, | ||
className: o().input, | ||
"aria-invalid": _(), | ||
"aria-describedby": g(), | ||
...(v = t.innerProps) == null ? void 0 : v.input | ||
} | ||
), _() ? /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("span", { id: g() }, b)) : null) : null, | ||
/* @__PURE__ */ s.createElement( | ||
"button", | ||
{ | ||
type: "button", | ||
disabled: $(), | ||
onClick: (e) => O(e), | ||
style: (T = t.styles) == null ? void 0 : T.button, | ||
className: o().button, | ||
...(P = t.innerProps) == null ? void 0 : P.button | ||
}, | ||
t.buttonText || c.buttonText | ||
) | ||
); | ||
} | ||
export { | ||
Er as Login | ||
V as Login | ||
}; | ||
//# sourceMappingURL=sso.js.map |
{ | ||
"name": "@boxyhq/react-ui", | ||
"description": "React UI components from BoxyHQ", | ||
"version": "2.0.0", | ||
"version": "3.0.0-beta.45", | ||
"type": "module", | ||
@@ -24,3 +24,3 @@ "keywords": [ | ||
], | ||
"types": "./dist/index.d.ts", | ||
"types": "./index.d.ts", | ||
"exports": { | ||
@@ -27,0 +27,0 @@ "./sso": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1
27308
8
142
2