@remittancev2/vite-package
Version:
Reusable UI library for remittance platform
400 lines (399 loc) • 12.9 kB
JavaScript
import oe, { useState as X } from "react";
var A = { exports: {} }, T = {};
/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var H;
function ae() {
if (H) return T;
H = 1;
var t = Symbol.for("react.transitional.element"), o = Symbol.for("react.fragment");
function c(d, a, u) {
var b = null;
if (u !== void 0 && (b = "" + u), a.key !== void 0 && (b = "" + a.key), "key" in a) {
u = {};
for (var E in a)
E !== "key" && (u[E] = a[E]);
} else u = a;
return a = u.ref, {
$$typeof: t,
type: d,
key: b,
ref: a !== void 0 ? a : null,
props: u
};
}
return T.Fragment = o, T.jsx = c, T.jsxs = c, T;
}
var y = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Z;
function se() {
return Z || (Z = 1, process.env.NODE_ENV !== "production" && function() {
function t(e) {
if (e == null) return null;
if (typeof e == "function")
return e.$$typeof === re ? null : e.displayName || e.name || null;
if (typeof e == "string") return e;
switch (e) {
case _:
return "Fragment";
case P:
return "Profiler";
case h:
return "StrictMode";
case Y:
return "Suspense";
case F:
return "SuspenseList";
case ee:
return "Activity";
}
if (typeof e == "object")
switch (typeof e.tag == "number" && console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
), e.$$typeof) {
case g:
return "Portal";
case j:
return (e.displayName || "Context") + ".Provider";
case N:
return (e._context.displayName || "Context") + ".Consumer";
case C:
var r = e.render;
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
case i:
return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
case W:
r = e._payload, e = e._init;
try {
return t(e(r));
} catch {
}
}
return null;
}
function o(e) {
return "" + e;
}
function c(e) {
try {
o(e);
var r = !1;
} catch {
r = !0;
}
if (r) {
r = console;
var n = r.error, s = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
return n.call(
r,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
s
), o(e);
}
}
function d(e) {
if (e === _) return "<>";
if (typeof e == "object" && e !== null && e.$$typeof === W)
return "<...>";
try {
var r = t(e);
return r ? "<" + r + ">" : "<...>";
} catch {
return "<...>";
}
}
function a() {
var e = M.A;
return e === null ? null : e.getOwner();
}
function u() {
return Error("react-stack-top-frame");
}
function b(e) {
if (B.call(e, "key")) {
var r = Object.getOwnPropertyDescriptor(e, "key").get;
if (r && r.isReactWarning) return !1;
}
return e.key !== void 0;
}
function E(e, r) {
function n() {
U || (U = !0, console.error(
"%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://react.dev/link/special-props)",
r
));
}
n.isReactWarning = !0, Object.defineProperty(e, "key", {
get: n,
configurable: !0
});
}
function p() {
var e = t(this.type);
return q[e] || (q[e] = !0, console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
)), e = this.props.ref, e !== void 0 ? e : null;
}
function O(e, r, n, s, v, f, L, $) {
return n = f.ref, e = {
$$typeof: w,
type: e,
key: r,
props: f,
_owner: v
}, (n !== void 0 ? n : null) !== null ? Object.defineProperty(e, "ref", {
enumerable: !1,
get: p
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: 0
}), Object.defineProperty(e, "_debugInfo", {
configurable: !1,
enumerable: !1,
writable: !0,
value: null
}), Object.defineProperty(e, "_debugStack", {
configurable: !1,
enumerable: !1,
writable: !0,
value: L
}), Object.defineProperty(e, "_debugTask", {
configurable: !1,
enumerable: !1,
writable: !0,
value: $
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
}
function S(e, r, n, s, v, f, L, $) {
var l = r.children;
if (l !== void 0)
if (s)
if (te(l)) {
for (s = 0; s < l.length; s++)
k(l[s]);
Object.freeze && Object.freeze(l);
} else
console.error(
"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 k(l);
if (B.call(r, "key")) {
l = t(e);
var x = Object.keys(r).filter(function(ne) {
return ne !== "key";
});
s = 0 < x.length ? "{key: someKey, " + x.join(": ..., ") + ": ...}" : "{key: someKey}", G[l + s] || (x = 0 < x.length ? "{" + x.join(": ..., ") + ": ...}" : "{}", console.error(
`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} />`,
s,
l,
x,
l
), G[l + s] = !0);
}
if (l = null, n !== void 0 && (c(n), l = "" + n), b(r) && (c(r.key), l = "" + r.key), "key" in r) {
n = {};
for (var D in r)
D !== "key" && (n[D] = r[D]);
} else n = r;
return l && E(
n,
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
), O(
e,
l,
f,
v,
a(),
n,
L,
$
);
}
function k(e) {
typeof e == "object" && e !== null && e.$$typeof === w && e._store && (e._store.validated = 1);
}
var R = oe, w = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), N = Symbol.for("react.consumer"), j = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), Y = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), i = Symbol.for("react.memo"), W = Symbol.for("react.lazy"), ee = Symbol.for("react.activity"), re = Symbol.for("react.client.reference"), M = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, te = Array.isArray, I = console.createTask ? console.createTask : function() {
return null;
};
R = {
"react-stack-bottom-frame": function(e) {
return e();
}
};
var U, q = {}, J = R["react-stack-bottom-frame"].bind(
R,
u
)(), V = I(d(u)), G = {};
y.Fragment = _, y.jsx = function(e, r, n, s, v) {
var f = 1e4 > M.recentlyCreatedOwnerStacks++;
return S(
e,
r,
n,
!1,
s,
v,
f ? Error("react-stack-top-frame") : J,
f ? I(d(e)) : V
);
}, y.jsxs = function(e, r, n, s, v) {
var f = 1e4 > M.recentlyCreatedOwnerStacks++;
return S(
e,
r,
n,
!0,
s,
v,
f ? Error("react-stack-top-frame") : J,
f ? I(d(e)) : V
);
};
}()), y;
}
var Q;
function le() {
return Q || (Q = 1, process.env.NODE_ENV === "production" ? A.exports = ae() : A.exports = se()), A.exports;
}
var m = le();
const ve = ({ variant: t = "primary", children: o, ...c }) => /* @__PURE__ */ m.jsx("button", { className: `${t}`, ...c, children: o }), ce = (t) => {
const [o, c] = X(!1), [d, a] = X(!1), u = () => {
var i;
a(!0), (i = t.onMouseEnter) == null || i.call(t);
}, b = () => {
var i;
a(!1), (i = t.onMouseLeave) == null || i.call(t);
}, E = () => c(!0), p = () => c(!1), O = () => {
var i;
return (i = t.onClick) == null ? void 0 : i.call(t);
}, {
activeStyle: S,
align: k = "left",
text: R,
children: w = R,
className: g,
icon: _,
iconSize: h = "26px",
preventActiveStyles: P = !1,
size: N = "50px",
style: j,
disabled: C,
type: Y = "button"
} = t, F = ue(z.button, {
activeStyle: P ? j : S,
customStyle: j,
active: d || o,
size: N
});
return /* @__PURE__ */ m.jsx(
"button",
{
style: F,
onClick: O,
onMouseEnter: u,
onMouseLeave: b,
onFocus: E,
onBlur: p,
className: g,
disabled: C,
type: Y,
children: /* @__PURE__ */ m.jsxs("div", { style: z.flex, children: [
!K(h) && !!_ && /* @__PURE__ */ m.jsx(
"div",
{
style: {
display: "flex",
justifyContent: "center",
minWidth: h
}
}
),
!K(h) && /* @__PURE__ */ m.jsx("div", { style: z.divider }),
/* @__PURE__ */ m.jsx("div", { style: { textAlign: k, width: "100%" }, children: w })
] })
}
);
}, K = (t) => t === "0" || t === "0px" || t === 0, ue = (t, {
size: o,
customStyle: c,
active: d,
activeStyle: a
}) => ({
...t,
height: o,
...c,
...d && a
}), z = {
button: {
display: "block",
border: 0,
borderRadius: 3,
boxShadow: "rgba(0, 0, 0, 0.5) 0 1px 2px",
color: "#ffffff",
cursor: "pointer",
fontSize: "19px",
margin: "5px",
width: "calc(100% - 10px)",
overflow: "hidden",
padding: "0 10px",
userSelect: "none"
},
divider: {
width: "10px"
},
flex: {
alignItems: "center",
display: "flex",
height: "100%"
}
}, ie = (t) => (o) => {
const c = {
activeStyle: { ...t == null ? void 0 : t.activeStyle, ...o.activeStyle },
...t,
...o,
style: { ...t == null ? void 0 : t.style, ...o.style }
};
return /* @__PURE__ */ m.jsx(ce, { ...c });
}, fe = {
activeStyle: { background: "#ff9f23" },
icon: de,
style: { background: "#f9ae32" },
text: "Log in with Amazon"
}, be = ie(fe);
function de({ size: t, color: o }) {
return /* @__PURE__ */ m.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: o, width: t, height: t, viewBox: "0 0 24 24", children: /* @__PURE__ */ m.jsx(
"path",
{
d: "M13.958 10.09c0 1.232.029 2.256-.591 3.351-.502.891-1.301 1.438-2.186 1.438-1.214 0-1.922-.924-1.922-2.292 0-2.692 2.415-3.182 4.7-3.182v.685zm3.186 7.705c-.209.189-.512.201-.745.074-1.052-.872-1.238-1.276-1.814-2.106-1.734 1.767-2.962 2.297-5.209 2.297-2.66 0-4.731-1.641-4.731-4.925 0-2.565 1.391-4.309 3.37-5.164 1.715-.754 4.11-.891 5.942-1.095v-.41c0-.753.06-1.642-.383-2.294-.385-.579-1.124-.82-1.775-.82-1.205 0-2.277.618-2.54 1.897-.054.285-.261.567-.549.582l-3.061-.333c-.259-.056-.548-.266-.472-.66.704-3.716 4.06-4.838 7.066-4.838 1.537 0 3.547.41 4.758 1.574 1.538 1.436 1.392 3.352 1.392 5.438v4.923c0 1.481.616 2.13 1.192 2.929.204.287.247.63-.01.839-.647.541-1.794 1.537-2.423 2.099l-.008-.007zm3.559 1.988c-2.748 1.472-5.735 2.181-8.453 2.181-4.027 0-7.927-1.393-11.081-3.706-.277-.202-.481.154-.251.416 2.925 3.326 6.786 5.326 11.076 5.326 3.061 0 6.614-1.214 9.066-3.494.406-.377.058-.945-.357-.723zm.67 2.216c-.091.227.104.32.31.147 1.339-1.12 1.685-3.466 1.411-3.804-.272-.336-2.612-.626-4.04.377-.22.154-.182.367.062.337.805-.096 2.595-.312 2.913.098.319.41-.355 2.094-.656 2.845z",
fillRule: "evenodd",
clipRule: "evenodd"
}
) });
}
export {
ve as Button,
be as FacebookButton
};