@deframe-sdk/components 0.1.33 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +206 -2
- package/dist/index.d.ts +206 -2
- package/dist/index.js +2043 -65
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2029 -66
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +144 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13301,6 +13301,82 @@ function OnchainDepositFormView({
|
|
|
13301
13301
|
}
|
|
13302
13302
|
);
|
|
13303
13303
|
}
|
|
13304
|
+
var tabBaseClasses = [
|
|
13305
|
+
"inline-flex flex-1 items-center justify-center",
|
|
13306
|
+
"gap-[var(--deframe-widget-size-gap-xs)]",
|
|
13307
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
13308
|
+
"border-[length:var(--deframe-widget-size-border-sm)] border-solid border-transparent",
|
|
13309
|
+
"outline-none whitespace-nowrap transition-[background,color,border-color] duration-150",
|
|
13310
|
+
"font-[var(--deframe-widget-font-family)] [font-weight:var(--deframe-widget-font-weight-medium)]",
|
|
13311
|
+
"py-[5px] px-[var(--deframe-widget-size-padding-x-lg)]",
|
|
13312
|
+
"[font-size:var(--deframe-widget-font-size-md)] [line-height:var(--deframe-widget-font-leading-md)]"
|
|
13313
|
+
].join(" ");
|
|
13314
|
+
var activeTabClasses = "text-[color:var(--deframe-widget-color-brand-primary)]";
|
|
13315
|
+
var inactiveTabClasses = "text-[color:var(--deframe-widget-color-text-secondary)] hover:bg-[var(--deframe-widget-color-bg-tertiary)]";
|
|
13316
|
+
var FlowTabHeader = ({
|
|
13317
|
+
activeTab,
|
|
13318
|
+
cryptoHref,
|
|
13319
|
+
pixHref,
|
|
13320
|
+
cryptoLabel = "Cripto",
|
|
13321
|
+
pixLabel = "PIX",
|
|
13322
|
+
className
|
|
13323
|
+
}) => {
|
|
13324
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13325
|
+
"nav",
|
|
13326
|
+
{
|
|
13327
|
+
"data-slot": "flow-tab-header",
|
|
13328
|
+
"data-test-id": "flow-tab-header",
|
|
13329
|
+
className: tailwindMerge.twMerge("px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-sm)]", className),
|
|
13330
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13331
|
+
"div",
|
|
13332
|
+
{
|
|
13333
|
+
role: "tablist",
|
|
13334
|
+
"data-test-id": "flow-tab-header-tablist",
|
|
13335
|
+
className: tailwindMerge.twMerge(
|
|
13336
|
+
"inline-flex w-full rounded-[var(--deframe-widget-size-radius-md)]",
|
|
13337
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
13338
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
13339
|
+
"p-[3px] gap-[2px]"
|
|
13340
|
+
),
|
|
13341
|
+
children: [
|
|
13342
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13343
|
+
"a",
|
|
13344
|
+
{
|
|
13345
|
+
href: cryptoHref,
|
|
13346
|
+
role: "tab",
|
|
13347
|
+
"aria-selected": activeTab === "crypto",
|
|
13348
|
+
"aria-current": activeTab === "crypto" ? "page" : void 0,
|
|
13349
|
+
"aria-label": cryptoLabel,
|
|
13350
|
+
"data-test-id": "flow-tab-header-tab-crypto",
|
|
13351
|
+
className: tailwindMerge.twMerge(
|
|
13352
|
+
tabBaseClasses,
|
|
13353
|
+
activeTab === "crypto" ? activeTabClasses : inactiveTabClasses
|
|
13354
|
+
),
|
|
13355
|
+
children: cryptoLabel
|
|
13356
|
+
}
|
|
13357
|
+
),
|
|
13358
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13359
|
+
"a",
|
|
13360
|
+
{
|
|
13361
|
+
href: pixHref,
|
|
13362
|
+
role: "tab",
|
|
13363
|
+
"aria-selected": activeTab === "pix",
|
|
13364
|
+
"aria-current": activeTab === "pix" ? "page" : void 0,
|
|
13365
|
+
"aria-label": pixLabel,
|
|
13366
|
+
"data-test-id": "flow-tab-header-tab-pix",
|
|
13367
|
+
className: tailwindMerge.twMerge(
|
|
13368
|
+
tabBaseClasses,
|
|
13369
|
+
activeTab === "pix" ? activeTabClasses : inactiveTabClasses
|
|
13370
|
+
),
|
|
13371
|
+
children: pixLabel
|
|
13372
|
+
}
|
|
13373
|
+
)
|
|
13374
|
+
]
|
|
13375
|
+
}
|
|
13376
|
+
)
|
|
13377
|
+
}
|
|
13378
|
+
);
|
|
13379
|
+
};
|
|
13304
13380
|
var OnchainDepositFormSimpleView = ({
|
|
13305
13381
|
// Token selector
|
|
13306
13382
|
selectedToken,
|
|
@@ -13389,72 +13465,11 @@ var OnchainDepositFormSimpleView = ({
|
|
|
13389
13465
|
}
|
|
13390
13466
|
),
|
|
13391
13467
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13392
|
-
|
|
13468
|
+
FlowTabHeader,
|
|
13393
13469
|
{
|
|
13394
|
-
|
|
13395
|
-
|
|
13396
|
-
|
|
13397
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13398
|
-
"div",
|
|
13399
|
-
{
|
|
13400
|
-
role: "tablist",
|
|
13401
|
-
"data-test-id": "onchain-deposit-form-simple-view-tablist",
|
|
13402
|
-
className: tailwindMerge.twMerge(
|
|
13403
|
-
"inline-flex w-full rounded-[var(--deframe-widget-size-radius-md)]",
|
|
13404
|
-
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
13405
|
-
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
13406
|
-
"p-[3px] gap-[2px]"
|
|
13407
|
-
),
|
|
13408
|
-
children: [
|
|
13409
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13410
|
-
"a",
|
|
13411
|
-
{
|
|
13412
|
-
href: cryptoHref != null ? cryptoHref : "/dashboard/deposit/onchain",
|
|
13413
|
-
role: "tab",
|
|
13414
|
-
"aria-selected": activeTab === "crypto",
|
|
13415
|
-
"aria-current": activeTab === "crypto" ? "page" : void 0,
|
|
13416
|
-
"aria-label": "Cripto",
|
|
13417
|
-
"data-test-id": "onchain-deposit-form-simple-view-tab-crypto",
|
|
13418
|
-
className: tailwindMerge.twMerge(
|
|
13419
|
-
"inline-flex flex-1 items-center justify-center",
|
|
13420
|
-
"gap-[var(--deframe-widget-size-gap-xs)]",
|
|
13421
|
-
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
13422
|
-
"border-[length:var(--deframe-widget-size-border-sm)] border-solid border-transparent",
|
|
13423
|
-
"outline-none whitespace-nowrap transition-[background,color,border-color] duration-150",
|
|
13424
|
-
"font-[var(--deframe-widget-font-family)] [font-weight:var(--deframe-widget-font-weight-medium)]",
|
|
13425
|
-
"py-[5px] px-[var(--deframe-widget-size-padding-x-lg)]",
|
|
13426
|
-
"[font-size:var(--deframe-widget-font-size-md)] [line-height:var(--deframe-widget-font-leading-md)]",
|
|
13427
|
-
activeTab === "crypto" ? "text-[color:var(--deframe-widget-color-brand-primary)]" : "text-[color:var(--deframe-widget-color-text-secondary)] hover:bg-[var(--deframe-widget-color-bg-tertiary)]"
|
|
13428
|
-
),
|
|
13429
|
-
children: "Cripto"
|
|
13430
|
-
}
|
|
13431
|
-
),
|
|
13432
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13433
|
-
"a",
|
|
13434
|
-
{
|
|
13435
|
-
href: pixHref != null ? pixHref : "/dashboard/deposit/onramp",
|
|
13436
|
-
role: "tab",
|
|
13437
|
-
"aria-selected": activeTab === "pix",
|
|
13438
|
-
"aria-current": activeTab === "pix" ? "page" : void 0,
|
|
13439
|
-
"aria-label": "PIX",
|
|
13440
|
-
"data-test-id": "onchain-deposit-form-simple-view-tab-pix",
|
|
13441
|
-
className: tailwindMerge.twMerge(
|
|
13442
|
-
"inline-flex flex-1 items-center justify-center",
|
|
13443
|
-
"gap-[var(--deframe-widget-size-gap-xs)]",
|
|
13444
|
-
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
13445
|
-
"border-[length:var(--deframe-widget-size-border-sm)] border-solid border-transparent",
|
|
13446
|
-
"outline-none whitespace-nowrap transition-[background,color,border-color] duration-150",
|
|
13447
|
-
"font-[var(--deframe-widget-font-family)] [font-weight:var(--deframe-widget-font-weight-medium)]",
|
|
13448
|
-
"py-[5px] px-[var(--deframe-widget-size-padding-x-lg)]",
|
|
13449
|
-
"[font-size:var(--deframe-widget-font-size-md)] [line-height:var(--deframe-widget-font-leading-md)]",
|
|
13450
|
-
activeTab === "pix" ? "text-[color:var(--deframe-widget-color-brand-primary)]" : "text-[color:var(--deframe-widget-color-text-secondary)] hover:bg-[var(--deframe-widget-color-bg-tertiary)]"
|
|
13451
|
-
),
|
|
13452
|
-
children: "PIX"
|
|
13453
|
-
}
|
|
13454
|
-
)
|
|
13455
|
-
]
|
|
13456
|
-
}
|
|
13457
|
-
)
|
|
13470
|
+
activeTab: activeTab != null ? activeTab : "crypto",
|
|
13471
|
+
cryptoHref: cryptoHref != null ? cryptoHref : "/dashboard/deposit/onchain",
|
|
13472
|
+
pixHref: pixHref != null ? pixHref : "/dashboard/deposit/onramp"
|
|
13458
13473
|
}
|
|
13459
13474
|
),
|
|
13460
13475
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14073,6 +14088,10 @@ function OnchainWithdrawFormView({
|
|
|
14073
14088
|
);
|
|
14074
14089
|
}
|
|
14075
14090
|
var OnchainWithdrawFormSimpleView = ({
|
|
14091
|
+
// Tab switcher
|
|
14092
|
+
activeTab,
|
|
14093
|
+
cryptoHref,
|
|
14094
|
+
pixHref,
|
|
14076
14095
|
// Token selector
|
|
14077
14096
|
selectedToken,
|
|
14078
14097
|
onTokenClick,
|
|
@@ -14221,6 +14240,24 @@ var OnchainWithdrawFormSimpleView = ({
|
|
|
14221
14240
|
className: dividerClasses
|
|
14222
14241
|
}
|
|
14223
14242
|
),
|
|
14243
|
+
activeTab && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14244
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14245
|
+
FlowTabHeader,
|
|
14246
|
+
{
|
|
14247
|
+
activeTab,
|
|
14248
|
+
cryptoHref: cryptoHref != null ? cryptoHref : "/dashboard/withdraw/onchain",
|
|
14249
|
+
pixHref: pixHref != null ? pixHref : "/dashboard/withdraw/offramp"
|
|
14250
|
+
}
|
|
14251
|
+
),
|
|
14252
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14253
|
+
"div",
|
|
14254
|
+
{
|
|
14255
|
+
"data-slot": "onchain-withdraw-simple-divider-tabs",
|
|
14256
|
+
"data-test-id": "onchain-withdraw-form-simple-view-divider-tabs",
|
|
14257
|
+
className: dividerClasses
|
|
14258
|
+
}
|
|
14259
|
+
)
|
|
14260
|
+
] }),
|
|
14224
14261
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14225
14262
|
"div",
|
|
14226
14263
|
{
|
|
@@ -15100,6 +15137,1932 @@ var OnchainWithdrawSignatureWarningSimpleView = ({
|
|
|
15100
15137
|
}
|
|
15101
15138
|
) });
|
|
15102
15139
|
};
|
|
15140
|
+
function KycLoadingView({ message = "Carregando" }) {
|
|
15141
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15142
|
+
"div",
|
|
15143
|
+
{
|
|
15144
|
+
"data-test-id": "kyc-loading-view",
|
|
15145
|
+
className: "w-full max-w-[620px] relative bg-[var(--deframe-widget-color-bg-primary)] lg:bg-[var(--deframe-widget-color-bg-secondary)] overflow-hidden mx-auto mt-[75px] rounded-[var(--deframe-widget-size-radius-sm)] p-6 min-h-[80vh] flex items-center justify-center",
|
|
15146
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-6", children: [
|
|
15147
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 bg-[#F6A700] rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-10 h-10", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5l-4-4V4h8v3.5l-4 4z" }) }) }),
|
|
15148
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
15149
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h3", children: message }),
|
|
15150
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {})
|
|
15151
|
+
] })
|
|
15152
|
+
] })
|
|
15153
|
+
}
|
|
15154
|
+
);
|
|
15155
|
+
}
|
|
15156
|
+
function KycRequiredView({ title, description, buttonLabel, onAction }) {
|
|
15157
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15158
|
+
"div",
|
|
15159
|
+
{
|
|
15160
|
+
"data-test-id": "kyc-required-view",
|
|
15161
|
+
className: "w-full max-w-[620px] relative bg-[var(--deframe-widget-color-bg-primary)] lg:bg-[var(--deframe-widget-color-bg-secondary)] overflow-hidden mx-auto mt-[75px] rounded-[var(--deframe-widget-size-radius-sm)] p-6 min-h-[80vh] flex flex-col",
|
|
15162
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center gap-6 h-[400px]", children: [
|
|
15163
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 bg-[var(--deframe-widget-color-brand-primary)]/20 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-10 h-10 text-[color:var(--deframe-widget-color-brand-primary)]", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 12C14.21 12 16 10.21 16 8C16 5.79 14.21 4 12 4C9.79 4 8 5.79 8 8C8 10.21 9.79 12 12 12ZM12 14C9.33 14 4 15.34 4 18V20H20V18C20 15.34 14.67 14 12 14Z" }) }) }),
|
|
15164
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-2", children: [
|
|
15165
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h3", children: title }),
|
|
15166
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-[color:var(--deframe-widget-color-text-secondary)]", children: description })
|
|
15167
|
+
] }),
|
|
15168
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15169
|
+
PrimaryButton,
|
|
15170
|
+
{
|
|
15171
|
+
onClick: onAction,
|
|
15172
|
+
className: "w-full max-w-xs h-12",
|
|
15173
|
+
"aria-label": buttonLabel,
|
|
15174
|
+
children: buttonLabel
|
|
15175
|
+
}
|
|
15176
|
+
)
|
|
15177
|
+
] })
|
|
15178
|
+
}
|
|
15179
|
+
);
|
|
15180
|
+
}
|
|
15181
|
+
var DefaultArrowIcon = /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-5 h-5", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }) });
|
|
15182
|
+
function OffchainMethodSelectionView({
|
|
15183
|
+
title,
|
|
15184
|
+
options,
|
|
15185
|
+
bannerMessage,
|
|
15186
|
+
arrowIcon = DefaultArrowIcon
|
|
15187
|
+
}) {
|
|
15188
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15189
|
+
"div",
|
|
15190
|
+
{
|
|
15191
|
+
"data-test-id": "offchain-method-selection-view",
|
|
15192
|
+
className: "w-full max-w-[620px] relative bg-[var(--deframe-widget-color-bg-primary)] lg:bg-[var(--deframe-widget-color-bg-secondary)] overflow-hidden mx-auto lg:my-[75px] rounded-[var(--deframe-widget-size-radius-sm)] p-6 lg:p-12 min-h-[80vh] flex flex-col",
|
|
15193
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col w-full flex-1", children: [
|
|
15194
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h2", className: "mb-3", children: title }),
|
|
15195
|
+
bannerMessage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15196
|
+
BannerNotification,
|
|
15197
|
+
{
|
|
15198
|
+
variant: "info",
|
|
15199
|
+
message: bannerMessage
|
|
15200
|
+
}
|
|
15201
|
+
),
|
|
15202
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-3 mt-2", children: options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15203
|
+
ListItem,
|
|
15204
|
+
{
|
|
15205
|
+
onClick: () => option.onClick(),
|
|
15206
|
+
containerClassName: "p-2 cursor-pointer transition-all",
|
|
15207
|
+
children: [
|
|
15208
|
+
/* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15209
|
+
"div",
|
|
15210
|
+
{
|
|
15211
|
+
"data-test-id": `method-option-icon-${index}`,
|
|
15212
|
+
className: "w-12 h-12 rounded-full flex items-center justify-center",
|
|
15213
|
+
style: { backgroundColor: option.iconBgColor },
|
|
15214
|
+
children: option.icon
|
|
15215
|
+
}
|
|
15216
|
+
) }),
|
|
15217
|
+
/* @__PURE__ */ jsxRuntime.jsx(ListItemContent, { className: "ml-4", children: /* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h4", className: "mb-1", children: option.label }) }),
|
|
15218
|
+
/* @__PURE__ */ jsxRuntime.jsx(ListItemRightSide, { className: "ml-auto", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[color:var(--deframe-widget-color-text-secondary)]", children: arrowIcon }) })
|
|
15219
|
+
]
|
|
15220
|
+
},
|
|
15221
|
+
index
|
|
15222
|
+
)) })
|
|
15223
|
+
] })
|
|
15224
|
+
}
|
|
15225
|
+
);
|
|
15226
|
+
}
|
|
15227
|
+
var defaultBackIcon = /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 12H5M12 19l-7-7 7-7" }) });
|
|
15228
|
+
var defaultFlagIcon = /* @__PURE__ */ jsxRuntime.jsx(
|
|
15229
|
+
"img",
|
|
15230
|
+
{
|
|
15231
|
+
src: "/brazil-flag-rounded.png",
|
|
15232
|
+
alt: "Brazil",
|
|
15233
|
+
className: "w-[24px] h-[24px] rounded-[var(--deframe-widget-size-radius-sm)]"
|
|
15234
|
+
}
|
|
15235
|
+
);
|
|
15236
|
+
function OnrampFormView({
|
|
15237
|
+
amount,
|
|
15238
|
+
onAmountChange,
|
|
15239
|
+
isLoadingQuote,
|
|
15240
|
+
summaryTitle,
|
|
15241
|
+
summaryItems,
|
|
15242
|
+
isBelowMinAmount,
|
|
15243
|
+
minAmountFormatted,
|
|
15244
|
+
hasNoAmount,
|
|
15245
|
+
isProcessing,
|
|
15246
|
+
onSubmit,
|
|
15247
|
+
onBack,
|
|
15248
|
+
submitLabel,
|
|
15249
|
+
flagIcon = defaultFlagIcon,
|
|
15250
|
+
backIcon = defaultBackIcon,
|
|
15251
|
+
className
|
|
15252
|
+
}) {
|
|
15253
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15254
|
+
"div",
|
|
15255
|
+
{
|
|
15256
|
+
className: tailwindMerge.twMerge("w-full p-4 mx-auto space-y-6", className),
|
|
15257
|
+
"data-test-id": "onramp-form-view",
|
|
15258
|
+
children: [
|
|
15259
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15260
|
+
SecondaryButton,
|
|
15261
|
+
{
|
|
15262
|
+
onClick: onBack,
|
|
15263
|
+
className: "mb-4 !border-0 max-w-[84px]",
|
|
15264
|
+
"aria-label": "Voltar",
|
|
15265
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
15266
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-5 h-5 text-[color:var(--deframe-widget-color-text-primary-dark)]", children: backIcon }),
|
|
15267
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[length:var(--deframe-widget-font-size-sm)] text-[color:var(--deframe-widget-color-text-primary-dark)]", children: "Voltar" })
|
|
15268
|
+
] })
|
|
15269
|
+
}
|
|
15270
|
+
),
|
|
15271
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
15272
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h3", children: "Quanto voc\xEA quer depositar?" }),
|
|
15273
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-[color:var(--deframe-widget-color-text-secondary)]", children: "Insira o valor gere o c\xF3digo PIX" })
|
|
15274
|
+
] }),
|
|
15275
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-[var(--deframe-widget-color-bg-secondary)] rounded-[var(--deframe-widget-size-radius-lg)] shadow-sm", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 flex items-end justify-between", children: [
|
|
15276
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
15277
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 mb-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15278
|
+
TextBody,
|
|
15279
|
+
{
|
|
15280
|
+
variant: "text-small",
|
|
15281
|
+
className: "text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
15282
|
+
children: "Voc\xEA paga com PIX"
|
|
15283
|
+
}
|
|
15284
|
+
) }),
|
|
15285
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: flagIcon })
|
|
15286
|
+
] }),
|
|
15287
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 text-right", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15288
|
+
"input",
|
|
15289
|
+
{
|
|
15290
|
+
type: "text",
|
|
15291
|
+
inputMode: "decimal",
|
|
15292
|
+
value: amount ? `R$ ${amount}` : "",
|
|
15293
|
+
onChange: (e) => {
|
|
15294
|
+
const value = e.target.value.replace(/[^0-9.]/g, "");
|
|
15295
|
+
onAmountChange(value || "");
|
|
15296
|
+
},
|
|
15297
|
+
onWheel: (event) => {
|
|
15298
|
+
event.currentTarget.blur();
|
|
15299
|
+
},
|
|
15300
|
+
placeholder: "R$0.00",
|
|
15301
|
+
className: "w-full bg-transparent text-right text-[28px] font-extrabold text-[color:var(--deframe-widget-color-text-secondary)] outline-none",
|
|
15302
|
+
"data-test-id": "onramp-form-amount-input",
|
|
15303
|
+
"aria-label": "Valor do dep\xF3sito"
|
|
15304
|
+
}
|
|
15305
|
+
) })
|
|
15306
|
+
] }) }),
|
|
15307
|
+
isLoadingQuote ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-[var(--deframe-widget-color-bg-secondary)] p-4 rounded-[var(--deframe-widget-size-radius-lg)] space-y-3", children: [
|
|
15308
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
15309
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: 96, height: 16, shimmer: true }),
|
|
15310
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: 80, height: 16, shimmer: true })
|
|
15311
|
+
] }),
|
|
15312
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
15313
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: 80, height: 16, shimmer: true }),
|
|
15314
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: 64, height: 16, shimmer: true })
|
|
15315
|
+
] })
|
|
15316
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
15317
|
+
SummaryDetails,
|
|
15318
|
+
{
|
|
15319
|
+
title: summaryTitle,
|
|
15320
|
+
items: summaryItems,
|
|
15321
|
+
defaultOpen: true,
|
|
15322
|
+
showDividers: true,
|
|
15323
|
+
className: "bg-[var(--deframe-widget-color-bg-secondary)]"
|
|
15324
|
+
}
|
|
15325
|
+
),
|
|
15326
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15327
|
+
BannerNotification,
|
|
15328
|
+
{
|
|
15329
|
+
message: "Dep\xF3sitos via Pix s\xE3o convertidos automaticamente em BRLA.",
|
|
15330
|
+
variant: "info"
|
|
15331
|
+
}
|
|
15332
|
+
),
|
|
15333
|
+
isBelowMinAmount && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15334
|
+
BannerNotification,
|
|
15335
|
+
{
|
|
15336
|
+
message: `O valor m\xEDnimo para dep\xF3sito \xE9 R$ ${minAmountFormatted}.`,
|
|
15337
|
+
variant: "warning"
|
|
15338
|
+
}
|
|
15339
|
+
),
|
|
15340
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15341
|
+
PrimaryButton,
|
|
15342
|
+
{
|
|
15343
|
+
onClick: onSubmit,
|
|
15344
|
+
disabled: isBelowMinAmount || isProcessing || hasNoAmount,
|
|
15345
|
+
"aria-label": submitLabel,
|
|
15346
|
+
"data-test-id": "onramp-form-submit",
|
|
15347
|
+
children: isProcessing ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center justify-center gap-2", children: [
|
|
15348
|
+
"Processando ",
|
|
15349
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {})
|
|
15350
|
+
] }) : submitLabel
|
|
15351
|
+
}
|
|
15352
|
+
)
|
|
15353
|
+
]
|
|
15354
|
+
}
|
|
15355
|
+
);
|
|
15356
|
+
}
|
|
15357
|
+
var ClockIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15358
|
+
"svg",
|
|
15359
|
+
{
|
|
15360
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15361
|
+
width: "16",
|
|
15362
|
+
height: "16",
|
|
15363
|
+
viewBox: "0 0 24 24",
|
|
15364
|
+
fill: "none",
|
|
15365
|
+
stroke: "currentColor",
|
|
15366
|
+
strokeWidth: "2",
|
|
15367
|
+
strokeLinecap: "round",
|
|
15368
|
+
strokeLinejoin: "round",
|
|
15369
|
+
className,
|
|
15370
|
+
"aria-hidden": "true",
|
|
15371
|
+
children: [
|
|
15372
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
15373
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "12 6 12 12 16 14" })
|
|
15374
|
+
]
|
|
15375
|
+
}
|
|
15376
|
+
);
|
|
15377
|
+
var CopyIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15378
|
+
"svg",
|
|
15379
|
+
{
|
|
15380
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15381
|
+
width: "16",
|
|
15382
|
+
height: "16",
|
|
15383
|
+
viewBox: "0 0 24 24",
|
|
15384
|
+
fill: "none",
|
|
15385
|
+
stroke: "currentColor",
|
|
15386
|
+
strokeWidth: "2",
|
|
15387
|
+
strokeLinecap: "round",
|
|
15388
|
+
strokeLinejoin: "round",
|
|
15389
|
+
className,
|
|
15390
|
+
"aria-hidden": "true",
|
|
15391
|
+
children: [
|
|
15392
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
|
|
15393
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
15394
|
+
]
|
|
15395
|
+
}
|
|
15396
|
+
);
|
|
15397
|
+
var OnrampFormSimpleView = ({
|
|
15398
|
+
// Base OnrampFormViewProps
|
|
15399
|
+
amount,
|
|
15400
|
+
onAmountChange,
|
|
15401
|
+
isLoadingQuote,
|
|
15402
|
+
summaryTitle,
|
|
15403
|
+
summaryItems,
|
|
15404
|
+
isBelowMinAmount,
|
|
15405
|
+
minAmountFormatted,
|
|
15406
|
+
hasNoAmount,
|
|
15407
|
+
isProcessing,
|
|
15408
|
+
onSubmit,
|
|
15409
|
+
onBack,
|
|
15410
|
+
submitLabel,
|
|
15411
|
+
// Simple-specific props
|
|
15412
|
+
activeTab,
|
|
15413
|
+
cryptoHref,
|
|
15414
|
+
pixHref,
|
|
15415
|
+
pixCode,
|
|
15416
|
+
qrCodeElement,
|
|
15417
|
+
remainingLabel,
|
|
15418
|
+
isExpired,
|
|
15419
|
+
copied,
|
|
15420
|
+
onCopy,
|
|
15421
|
+
onRegenerate,
|
|
15422
|
+
isRegenerating,
|
|
15423
|
+
onClose,
|
|
15424
|
+
error
|
|
15425
|
+
}) => {
|
|
15426
|
+
const hasPixCode = !!pixCode;
|
|
15427
|
+
const isSubmitDisabled = !amount || amount === "0" || amount === "" || isBelowMinAmount || hasNoAmount || isProcessing;
|
|
15428
|
+
const panelBaseClasses = [
|
|
15429
|
+
"relative flex flex-col overflow-hidden w-[420px]",
|
|
15430
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
15431
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
15432
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
15433
|
+
].join(" ");
|
|
15434
|
+
const headerBaseClasses = [
|
|
15435
|
+
"flex items-center",
|
|
15436
|
+
"px-[var(--deframe-widget-size-padding-x-md)]",
|
|
15437
|
+
"py-[var(--deframe-widget-size-padding-y-md)]"
|
|
15438
|
+
].join(" ");
|
|
15439
|
+
const titleBaseClasses = [
|
|
15440
|
+
"flex-1",
|
|
15441
|
+
"text-[15px]",
|
|
15442
|
+
"[font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
15443
|
+
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
15444
|
+
].join(" ");
|
|
15445
|
+
const dividerClasses = "h-px bg-[var(--deframe-widget-color-border-secondary)]";
|
|
15446
|
+
const bodyBaseClasses = [
|
|
15447
|
+
"flex flex-col",
|
|
15448
|
+
"gap-[var(--deframe-widget-size-gap-md)]",
|
|
15449
|
+
"px-[var(--deframe-widget-size-padding-x-md)]",
|
|
15450
|
+
"py-[var(--deframe-widget-size-padding-y-md)]"
|
|
15451
|
+
].join(" ");
|
|
15452
|
+
const footerBaseClasses = [
|
|
15453
|
+
"flex gap-[var(--deframe-widget-size-gap-sm)]",
|
|
15454
|
+
"px-[var(--deframe-widget-size-padding-x-md)]",
|
|
15455
|
+
"pb-[var(--deframe-widget-size-padding-y-md)]"
|
|
15456
|
+
].join(" ");
|
|
15457
|
+
const cardClasses2 = tailwindMerge.twMerge(
|
|
15458
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
15459
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
15460
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
15461
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]"
|
|
15462
|
+
);
|
|
15463
|
+
const secondaryButtonClasses = [
|
|
15464
|
+
"flex-1 h-12 rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
15465
|
+
"text-[15px] text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
15466
|
+
"border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
15467
|
+
"outline-none",
|
|
15468
|
+
"transition-[background,color,border-color] duration-150",
|
|
15469
|
+
"hover:opacity-100",
|
|
15470
|
+
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_60%,transparent)]",
|
|
15471
|
+
"hover:text-[color:var(--deframe-widget-color-text-primary)]"
|
|
15472
|
+
].join(" ");
|
|
15473
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15474
|
+
"div",
|
|
15475
|
+
{
|
|
15476
|
+
"data-slot": "onramp-form-simple-panel",
|
|
15477
|
+
"data-test-id": "onramp-form-simple-view",
|
|
15478
|
+
className: panelBaseClasses,
|
|
15479
|
+
children: [
|
|
15480
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
15481
|
+
"header",
|
|
15482
|
+
{
|
|
15483
|
+
"data-slot": "onramp-form-simple-header",
|
|
15484
|
+
"data-test-id": "onramp-form-simple-view-header",
|
|
15485
|
+
className: headerBaseClasses,
|
|
15486
|
+
children: [
|
|
15487
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15488
|
+
"span",
|
|
15489
|
+
{
|
|
15490
|
+
"data-slot": "onramp-form-simple-title",
|
|
15491
|
+
"data-test-id": "onramp-form-simple-view-title",
|
|
15492
|
+
className: titleBaseClasses,
|
|
15493
|
+
children: "Depositar"
|
|
15494
|
+
}
|
|
15495
|
+
),
|
|
15496
|
+
onClose && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15497
|
+
CloseButton_default,
|
|
15498
|
+
{
|
|
15499
|
+
onClick: onClose,
|
|
15500
|
+
ariaLabel: "Fechar painel de dep\xF3sito",
|
|
15501
|
+
testId: "onramp-form-simple-view-close"
|
|
15502
|
+
}
|
|
15503
|
+
)
|
|
15504
|
+
]
|
|
15505
|
+
}
|
|
15506
|
+
),
|
|
15507
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15508
|
+
"div",
|
|
15509
|
+
{
|
|
15510
|
+
"data-slot": "onramp-form-simple-divider",
|
|
15511
|
+
"data-test-id": "onramp-form-simple-view-divider",
|
|
15512
|
+
className: dividerClasses
|
|
15513
|
+
}
|
|
15514
|
+
),
|
|
15515
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15516
|
+
FlowTabHeader,
|
|
15517
|
+
{
|
|
15518
|
+
activeTab: activeTab != null ? activeTab : "pix",
|
|
15519
|
+
cryptoHref: cryptoHref != null ? cryptoHref : "/dashboard/deposit/onchain",
|
|
15520
|
+
pixHref: pixHref != null ? pixHref : "/dashboard/deposit/onramp"
|
|
15521
|
+
}
|
|
15522
|
+
),
|
|
15523
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15524
|
+
"div",
|
|
15525
|
+
{
|
|
15526
|
+
"data-slot": "onramp-form-simple-divider-tabs",
|
|
15527
|
+
"data-test-id": "onramp-form-simple-view-divider-tabs",
|
|
15528
|
+
className: dividerClasses
|
|
15529
|
+
}
|
|
15530
|
+
),
|
|
15531
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15532
|
+
"div",
|
|
15533
|
+
{
|
|
15534
|
+
"data-slot": "onramp-form-simple-body",
|
|
15535
|
+
"data-test-id": "onramp-form-simple-view-body",
|
|
15536
|
+
className: bodyBaseClasses,
|
|
15537
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: !hasPixCode ? (
|
|
15538
|
+
/* ── Step 1: Amount input ─────────────────────────────────────── */
|
|
15539
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
15540
|
+
framerMotion.motion.div,
|
|
15541
|
+
{
|
|
15542
|
+
"data-slot": "onramp-form-simple-step-1",
|
|
15543
|
+
"data-test-id": "onramp-form-simple-view-step-1",
|
|
15544
|
+
initial: { opacity: 0 },
|
|
15545
|
+
animate: { opacity: 1 },
|
|
15546
|
+
exit: { opacity: 0 },
|
|
15547
|
+
transition: { duration: 0.15 },
|
|
15548
|
+
className: "flex flex-col gap-[var(--deframe-widget-size-gap-md)]",
|
|
15549
|
+
children: [
|
|
15550
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15551
|
+
"div",
|
|
15552
|
+
{
|
|
15553
|
+
"data-slot": "onramp-form-simple-amount-card",
|
|
15554
|
+
"data-test-id": "onramp-form-simple-view-amount-card",
|
|
15555
|
+
className: cardClasses2,
|
|
15556
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15557
|
+
"div",
|
|
15558
|
+
{
|
|
15559
|
+
"data-slot": "onramp-form-simple-amount-row",
|
|
15560
|
+
"data-test-id": "onramp-form-simple-view-amount-row",
|
|
15561
|
+
className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)]",
|
|
15562
|
+
children: [
|
|
15563
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15564
|
+
"span",
|
|
15565
|
+
{
|
|
15566
|
+
"data-slot": "onramp-form-simple-currency-label",
|
|
15567
|
+
"data-test-id": "onramp-form-simple-view-currency-label",
|
|
15568
|
+
className: "text-[36px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-tertiary)] leading-[1] flex-shrink-0",
|
|
15569
|
+
children: "R$"
|
|
15570
|
+
}
|
|
15571
|
+
),
|
|
15572
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15573
|
+
"div",
|
|
15574
|
+
{
|
|
15575
|
+
"data-test-id": "onramp-form-simple-view-currency-divider",
|
|
15576
|
+
className: "w-px h-10 bg-[var(--deframe-widget-color-border-secondary)] flex-shrink-0"
|
|
15577
|
+
}
|
|
15578
|
+
),
|
|
15579
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15580
|
+
EarnAmountInputSimpleView,
|
|
15581
|
+
{
|
|
15582
|
+
value: amount,
|
|
15583
|
+
onChange: (e) => {
|
|
15584
|
+
const raw = e.target.value.replace(/[^0-9.,]/g, "");
|
|
15585
|
+
onAmountChange(raw);
|
|
15586
|
+
},
|
|
15587
|
+
ariaLabel: "Valor do dep\xF3sito PIX",
|
|
15588
|
+
dollarAmountFormatted: ""
|
|
15589
|
+
}
|
|
15590
|
+
)
|
|
15591
|
+
]
|
|
15592
|
+
}
|
|
15593
|
+
)
|
|
15594
|
+
}
|
|
15595
|
+
),
|
|
15596
|
+
isBelowMinAmount && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15597
|
+
EarnInlineNotificationSimpleView,
|
|
15598
|
+
{
|
|
15599
|
+
variant: "warning",
|
|
15600
|
+
message: `O valor m\xEDnimo para dep\xF3sito \xE9 R$ ${minAmountFormatted}.`
|
|
15601
|
+
}
|
|
15602
|
+
),
|
|
15603
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15604
|
+
EarnInlineNotificationSimpleView,
|
|
15605
|
+
{
|
|
15606
|
+
variant: "error",
|
|
15607
|
+
message: error
|
|
15608
|
+
}
|
|
15609
|
+
),
|
|
15610
|
+
isLoadingQuote ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15611
|
+
"div",
|
|
15612
|
+
{
|
|
15613
|
+
"data-test-id": "onramp-form-simple-view-skeleton",
|
|
15614
|
+
className: tailwindMerge.twMerge(cardClasses2, "space-y-3"),
|
|
15615
|
+
children: [
|
|
15616
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
15617
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: 96, height: 16, shimmer: true }),
|
|
15618
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: 80, height: 16, shimmer: true })
|
|
15619
|
+
] }),
|
|
15620
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
15621
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: 80, height: 16, shimmer: true }),
|
|
15622
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: 64, height: 16, shimmer: true })
|
|
15623
|
+
] })
|
|
15624
|
+
]
|
|
15625
|
+
}
|
|
15626
|
+
) : summaryItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15627
|
+
SummaryDetails,
|
|
15628
|
+
{
|
|
15629
|
+
title: summaryTitle,
|
|
15630
|
+
items: summaryItems,
|
|
15631
|
+
defaultOpen: true,
|
|
15632
|
+
showDividers: true,
|
|
15633
|
+
className: "bg-[var(--deframe-widget-color-bg-secondary)]"
|
|
15634
|
+
}
|
|
15635
|
+
)
|
|
15636
|
+
]
|
|
15637
|
+
},
|
|
15638
|
+
"step-1"
|
|
15639
|
+
)
|
|
15640
|
+
) : (
|
|
15641
|
+
/* ── Step 2: QR code + PIX code ───────────────────────────────── */
|
|
15642
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
15643
|
+
framerMotion.motion.div,
|
|
15644
|
+
{
|
|
15645
|
+
"data-slot": "onramp-form-simple-step-2",
|
|
15646
|
+
"data-test-id": "onramp-form-simple-view-step-2",
|
|
15647
|
+
initial: { opacity: 0 },
|
|
15648
|
+
animate: { opacity: 1 },
|
|
15649
|
+
exit: { opacity: 0 },
|
|
15650
|
+
transition: { duration: 0.15 },
|
|
15651
|
+
className: "flex flex-col gap-[var(--deframe-widget-size-gap-md)]",
|
|
15652
|
+
children: [
|
|
15653
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
15654
|
+
"div",
|
|
15655
|
+
{
|
|
15656
|
+
"data-slot": "onramp-form-simple-qr-card",
|
|
15657
|
+
"data-test-id": "onramp-form-simple-view-qr-card",
|
|
15658
|
+
className: tailwindMerge.twMerge(
|
|
15659
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
15660
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
15661
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
15662
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-lg)]",
|
|
15663
|
+
"flex items-center justify-center",
|
|
15664
|
+
"relative overflow-hidden"
|
|
15665
|
+
),
|
|
15666
|
+
children: [
|
|
15667
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15668
|
+
"div",
|
|
15669
|
+
{
|
|
15670
|
+
"data-slot": "onramp-form-simple-qr-wrapper",
|
|
15671
|
+
"data-test-id": "onramp-form-simple-view-qr-wrapper",
|
|
15672
|
+
className: "bg-white p-3 rounded-lg leading-[0]",
|
|
15673
|
+
children: qrCodeElement
|
|
15674
|
+
}
|
|
15675
|
+
),
|
|
15676
|
+
isExpired && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15677
|
+
"div",
|
|
15678
|
+
{
|
|
15679
|
+
"data-slot": "onramp-form-simple-qr-expired-overlay",
|
|
15680
|
+
"data-test-id": "onramp-form-simple-view-qr-expired-overlay",
|
|
15681
|
+
className: tailwindMerge.twMerge(
|
|
15682
|
+
"absolute inset-0 flex items-center justify-center",
|
|
15683
|
+
"bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-primary)_80%,transparent)]",
|
|
15684
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]"
|
|
15685
|
+
),
|
|
15686
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15687
|
+
"span",
|
|
15688
|
+
{
|
|
15689
|
+
"data-test-id": "onramp-form-simple-view-qr-expired-text",
|
|
15690
|
+
className: "text-[15px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-state-error)] font-[var(--deframe-widget-font-family)]",
|
|
15691
|
+
children: "C\xF3digo expirado"
|
|
15692
|
+
}
|
|
15693
|
+
)
|
|
15694
|
+
}
|
|
15695
|
+
)
|
|
15696
|
+
]
|
|
15697
|
+
}
|
|
15698
|
+
),
|
|
15699
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
15700
|
+
"div",
|
|
15701
|
+
{
|
|
15702
|
+
"data-slot": "onramp-form-simple-pix-code",
|
|
15703
|
+
"data-test-id": "onramp-form-simple-view-pix-code",
|
|
15704
|
+
className: tailwindMerge.twMerge(
|
|
15705
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
15706
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
15707
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
15708
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-sm)]"
|
|
15709
|
+
),
|
|
15710
|
+
children: [
|
|
15711
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15712
|
+
"p",
|
|
15713
|
+
{
|
|
15714
|
+
"data-test-id": "onramp-form-simple-view-pix-code-label",
|
|
15715
|
+
className: "mb-[var(--deframe-widget-size-gap-xs)] text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]",
|
|
15716
|
+
children: "C\xF3digo PIX"
|
|
15717
|
+
}
|
|
15718
|
+
),
|
|
15719
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)]", children: [
|
|
15720
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15721
|
+
"span",
|
|
15722
|
+
{
|
|
15723
|
+
"data-test-id": "onramp-form-simple-view-pix-code-value",
|
|
15724
|
+
className: "flex-1 min-w-0 truncate font-mono text-[13px] text-[color:var(--deframe-widget-color-text-primary)] font-[var(--deframe-widget-font-family)]",
|
|
15725
|
+
children: pixCode
|
|
15726
|
+
}
|
|
15727
|
+
),
|
|
15728
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
15729
|
+
"button",
|
|
15730
|
+
{
|
|
15731
|
+
type: "button",
|
|
15732
|
+
"data-test-id": "onramp-form-simple-view-pix-code-copy",
|
|
15733
|
+
"aria-label": copied ? "C\xF3digo copiado" : "Copiar c\xF3digo PIX",
|
|
15734
|
+
onClick: onCopy,
|
|
15735
|
+
className: tailwindMerge.twMerge(
|
|
15736
|
+
"flex items-center gap-1 flex-shrink-0 px-2 py-1",
|
|
15737
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
15738
|
+
"text-[12px] [font-weight:var(--deframe-widget-font-weight-medium)]",
|
|
15739
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
15740
|
+
"cursor-pointer outline-none",
|
|
15741
|
+
"transition-[background,color] duration-150",
|
|
15742
|
+
copied ? "text-[color:var(--deframe-widget-color-state-success)] bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-success)_12%,transparent)]" : "text-[color:var(--deframe-widget-color-brand-primary)] hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_12%,transparent)]"
|
|
15743
|
+
),
|
|
15744
|
+
children: [
|
|
15745
|
+
/* @__PURE__ */ jsxRuntime.jsx(CopyIcon, {}),
|
|
15746
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: copied ? "Copiado!" : "Copiar" })
|
|
15747
|
+
]
|
|
15748
|
+
}
|
|
15749
|
+
)
|
|
15750
|
+
] })
|
|
15751
|
+
]
|
|
15752
|
+
}
|
|
15753
|
+
),
|
|
15754
|
+
remainingLabel && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15755
|
+
"div",
|
|
15756
|
+
{
|
|
15757
|
+
"data-slot": "onramp-form-simple-timer",
|
|
15758
|
+
"data-test-id": "onramp-form-simple-view-timer",
|
|
15759
|
+
className: "flex items-center justify-center gap-[var(--deframe-widget-size-gap-xs)]",
|
|
15760
|
+
children: [
|
|
15761
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15762
|
+
ClockIcon,
|
|
15763
|
+
{
|
|
15764
|
+
className: tailwindMerge.twMerge(
|
|
15765
|
+
"flex-shrink-0",
|
|
15766
|
+
isExpired ? "text-[color:var(--deframe-widget-color-state-error)]" : "text-[color:var(--deframe-widget-color-text-tertiary)]"
|
|
15767
|
+
)
|
|
15768
|
+
}
|
|
15769
|
+
),
|
|
15770
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15771
|
+
"span",
|
|
15772
|
+
{
|
|
15773
|
+
"data-test-id": "onramp-form-simple-view-timer-label",
|
|
15774
|
+
className: tailwindMerge.twMerge(
|
|
15775
|
+
"text-[13px] [font-weight:var(--deframe-widget-font-weight-medium)] font-[var(--deframe-widget-font-family)]",
|
|
15776
|
+
isExpired ? "text-[color:var(--deframe-widget-color-state-error)]" : "text-[color:var(--deframe-widget-color-text-tertiary)]"
|
|
15777
|
+
),
|
|
15778
|
+
children: remainingLabel
|
|
15779
|
+
}
|
|
15780
|
+
)
|
|
15781
|
+
]
|
|
15782
|
+
}
|
|
15783
|
+
),
|
|
15784
|
+
isExpired && onRegenerate && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15785
|
+
PrimaryButton,
|
|
15786
|
+
{
|
|
15787
|
+
type: "button",
|
|
15788
|
+
onClick: onRegenerate,
|
|
15789
|
+
disabled: isRegenerating,
|
|
15790
|
+
className: "w-full h-12 rounded-[var(--deframe-widget-size-radius-sm)] text-[15px]",
|
|
15791
|
+
"aria-label": "Gerar novo c\xF3digo PIX",
|
|
15792
|
+
"data-test-id": "onramp-form-simple-view-regenerate",
|
|
15793
|
+
children: isRegenerating ? "Gerando..." : "Gerar novo c\xF3digo"
|
|
15794
|
+
}
|
|
15795
|
+
)
|
|
15796
|
+
]
|
|
15797
|
+
},
|
|
15798
|
+
"step-2"
|
|
15799
|
+
)
|
|
15800
|
+
) })
|
|
15801
|
+
}
|
|
15802
|
+
),
|
|
15803
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15804
|
+
"footer",
|
|
15805
|
+
{
|
|
15806
|
+
"data-slot": "onramp-form-simple-footer",
|
|
15807
|
+
"data-test-id": "onramp-form-simple-view-footer",
|
|
15808
|
+
className: footerBaseClasses,
|
|
15809
|
+
children: !hasPixCode ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15810
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15811
|
+
SecondaryButton,
|
|
15812
|
+
{
|
|
15813
|
+
type: "button",
|
|
15814
|
+
className: secondaryButtonClasses,
|
|
15815
|
+
onClick: onBack,
|
|
15816
|
+
"aria-label": "Cancelar dep\xF3sito",
|
|
15817
|
+
"data-test-id": "onramp-form-simple-view-cancel",
|
|
15818
|
+
children: "Cancelar"
|
|
15819
|
+
}
|
|
15820
|
+
),
|
|
15821
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15822
|
+
PrimaryButton,
|
|
15823
|
+
{
|
|
15824
|
+
type: "button",
|
|
15825
|
+
className: "flex-1 h-12 rounded-[var(--deframe-widget-size-radius-sm)] text-[15px]",
|
|
15826
|
+
onClick: onSubmit,
|
|
15827
|
+
disabled: isSubmitDisabled,
|
|
15828
|
+
"aria-label": submitLabel,
|
|
15829
|
+
"data-test-id": "onramp-form-simple-view-submit",
|
|
15830
|
+
children: isProcessing ? "Processando..." : submitLabel
|
|
15831
|
+
}
|
|
15832
|
+
)
|
|
15833
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
15834
|
+
SecondaryButton,
|
|
15835
|
+
{
|
|
15836
|
+
type: "button",
|
|
15837
|
+
className: tailwindMerge.twMerge(secondaryButtonClasses, "w-full"),
|
|
15838
|
+
onClick: onBack,
|
|
15839
|
+
"aria-label": "Cancelar",
|
|
15840
|
+
"data-test-id": "onramp-form-simple-view-cancel",
|
|
15841
|
+
children: "Cancelar"
|
|
15842
|
+
}
|
|
15843
|
+
)
|
|
15844
|
+
}
|
|
15845
|
+
)
|
|
15846
|
+
]
|
|
15847
|
+
}
|
|
15848
|
+
);
|
|
15849
|
+
};
|
|
15850
|
+
function OnrampPixcodeView({
|
|
15851
|
+
pixCode,
|
|
15852
|
+
summaryTitle,
|
|
15853
|
+
summaryItems,
|
|
15854
|
+
isLoadingQuote,
|
|
15855
|
+
remainingLabel,
|
|
15856
|
+
isExpired,
|
|
15857
|
+
copied,
|
|
15858
|
+
isRegenerating,
|
|
15859
|
+
onCopy,
|
|
15860
|
+
onRegenerate,
|
|
15861
|
+
qrCodeElement,
|
|
15862
|
+
className
|
|
15863
|
+
}) {
|
|
15864
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15865
|
+
"div",
|
|
15866
|
+
{
|
|
15867
|
+
className: tailwindMerge.twMerge(
|
|
15868
|
+
"w-full p-4 mx-auto space-y-6 animate-fade-in flex flex-col flex-1",
|
|
15869
|
+
className
|
|
15870
|
+
),
|
|
15871
|
+
"data-test-id": "onramp-pixcode-view",
|
|
15872
|
+
children: [
|
|
15873
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
15874
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-[21px] font-bold text-[color:var(--deframe-widget-color-text-secondary)] leading-tight", children: "Pague com Pix" }),
|
|
15875
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[14px] text-[color:var(--deframe-widget-color-text-secondary)]", children: "Aponte a sua c\xE2mera para o QR code ou copie e cole o c\xF3digo no app do seu banco" })
|
|
15876
|
+
] }),
|
|
15877
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-[var(--deframe-widget-color-bg-primary)] p-4 rounded-[var(--deframe-widget-size-radius-lg)]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative mx-auto w-fit", children: [
|
|
15878
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: isExpired ? "blur-sm opacity-60 transition" : "transition", children: qrCodeElement }),
|
|
15879
|
+
isExpired && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center px-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[12px] font-semibold text-[color:var(--deframe-widget-color-text-primary)] bg-[var(--deframe-widget-color-bg-primary)]/90 rounded-[var(--deframe-widget-size-radius-sm)] px-3 py-2 border border-[var(--deframe-widget-color-border-secondary)]", children: "C\xF3digo expirado" }) })
|
|
15880
|
+
] }) }) }),
|
|
15881
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-[var(--deframe-widget-color-bg-secondary)] rounded-[var(--deframe-widget-size-radius-lg)] shadow-sm", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
15882
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "font-mono text-[12px] text-[color:var(--deframe-widget-color-text-primary)] truncate flex-1", children: [
|
|
15883
|
+
pixCode.substring(0, 50),
|
|
15884
|
+
"..."
|
|
15885
|
+
] }),
|
|
15886
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15887
|
+
"button",
|
|
15888
|
+
{
|
|
15889
|
+
onClick: onCopy,
|
|
15890
|
+
disabled: isExpired,
|
|
15891
|
+
className: tailwindMerge.twMerge(
|
|
15892
|
+
"text-[12px] font-semibold underline shrink-0",
|
|
15893
|
+
isExpired ? "text-[color:var(--deframe-widget-color-text-tertiary)] cursor-not-allowed" : "text-[color:var(--deframe-widget-color-brand-primary)]"
|
|
15894
|
+
),
|
|
15895
|
+
"aria-label": copied ? "C\xF3digo copiado" : "Copiar c\xF3digo PIX",
|
|
15896
|
+
"data-test-id": "onramp-pixcode-copy-button",
|
|
15897
|
+
children: copied ? "Copiado!" : "Copiar"
|
|
15898
|
+
}
|
|
15899
|
+
)
|
|
15900
|
+
] }) }) }),
|
|
15901
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2", children: [
|
|
15902
|
+
/* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "w-4 h-4 text-[color:var(--deframe-widget-color-text-secondary)]", viewBox: "0 0 16 16", fill: "none", children: [
|
|
15903
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "6.5", stroke: "#1890FF", strokeWidth: "1" }),
|
|
15904
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 4V8L10.5 10.5", stroke: "#1890FF", strokeWidth: "1", strokeLinecap: "round" })
|
|
15905
|
+
] }),
|
|
15906
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[12px] text-[color:var(--deframe-widget-color-text-secondary)]", children: isExpired ? "C\xF3digo expirou. Gere um novo para pagar." : `Expira em ${remainingLabel}` })
|
|
15907
|
+
] }),
|
|
15908
|
+
isExpired && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15909
|
+
"button",
|
|
15910
|
+
{
|
|
15911
|
+
type: "button",
|
|
15912
|
+
onClick: onRegenerate,
|
|
15913
|
+
disabled: isRegenerating,
|
|
15914
|
+
className: "text-[12px] font-semibold text-[color:var(--deframe-widget-color-brand-primary)] underline self-center disabled:opacity-50 disabled:cursor-not-allowed",
|
|
15915
|
+
"aria-label": "Gerar novo c\xF3digo Pix",
|
|
15916
|
+
"data-test-id": "onramp-pixcode-regenerate-button",
|
|
15917
|
+
children: isRegenerating ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15918
|
+
"Gerando novo c\xF3digo ",
|
|
15919
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {})
|
|
15920
|
+
] }) : "Gerar novo c\xF3digo Pix"
|
|
15921
|
+
}
|
|
15922
|
+
),
|
|
15923
|
+
isLoadingQuote ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 bg-[var(--deframe-widget-color-bg-secondary)] rounded-[var(--deframe-widget-size-radius-lg)] border border-[var(--deframe-widget-color-border-secondary)] space-y-2", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
15924
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 bg-[var(--deframe-widget-color-bg-tertiary)] rounded-[var(--deframe-widget-size-radius-sm)] animate-pulse w-20" }),
|
|
15925
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[14px] text-[color:var(--deframe-widget-color-text-secondary)]", children: "\u2248" }),
|
|
15926
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 bg-[var(--deframe-widget-color-bg-tertiary)] rounded-[var(--deframe-widget-size-radius-sm)] animate-pulse w-16" })
|
|
15927
|
+
] }) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
15928
|
+
SummaryDetails,
|
|
15929
|
+
{
|
|
15930
|
+
title: summaryTitle,
|
|
15931
|
+
items: summaryItems,
|
|
15932
|
+
defaultOpen: true,
|
|
15933
|
+
className: "bg-[var(--deframe-widget-color-bg-secondary)]"
|
|
15934
|
+
}
|
|
15935
|
+
)
|
|
15936
|
+
]
|
|
15937
|
+
}
|
|
15938
|
+
);
|
|
15939
|
+
}
|
|
15940
|
+
function SuccessIcon3() {
|
|
15941
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-20 h-20", children: [
|
|
15942
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-[#2ba176] rounded-full opacity-20" }),
|
|
15943
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-12 h-12 bg-[#2ba176] rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-5 h-5", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15944
|
+
"path",
|
|
15945
|
+
{
|
|
15946
|
+
d: "M10 15V5M10 5L6 9M10 5L14 9",
|
|
15947
|
+
stroke: "#121212",
|
|
15948
|
+
strokeWidth: "2",
|
|
15949
|
+
strokeLinecap: "round",
|
|
15950
|
+
strokeLinejoin: "round"
|
|
15951
|
+
}
|
|
15952
|
+
) }) }) })
|
|
15953
|
+
] });
|
|
15954
|
+
}
|
|
15955
|
+
function SuccessHeader({ children }) {
|
|
15956
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center gap-4", children });
|
|
15957
|
+
}
|
|
15958
|
+
function SuccessTitle({ children }) {
|
|
15959
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-[28px] font-extrabold text-[color:var(--deframe-widget-color-text-primary)] leading-tight mb-2", children });
|
|
15960
|
+
}
|
|
15961
|
+
function SuccessDescription({ children }) {
|
|
15962
|
+
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[14px] text-[color:var(--deframe-widget-color-text-secondary)]", children });
|
|
15963
|
+
}
|
|
15964
|
+
function DepositCard({ children }) {
|
|
15965
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-[var(--deframe-widget-color-bg-secondary)] rounded-[var(--deframe-widget-size-radius-lg)] shadow-sm", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-6", children }) });
|
|
15966
|
+
}
|
|
15967
|
+
function DepositRow({ children }) {
|
|
15968
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3", children });
|
|
15969
|
+
}
|
|
15970
|
+
function DepositIcon() {
|
|
15971
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-8 h-8 bg-[var(--deframe-widget-color-brand-primary)] rounded-full flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-lg", children: "R" }) });
|
|
15972
|
+
}
|
|
15973
|
+
function DepositInfo({ children }) {
|
|
15974
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col", children });
|
|
15975
|
+
}
|
|
15976
|
+
function OnrampSuccessView({
|
|
15977
|
+
amount = "0",
|
|
15978
|
+
summaryTitle = "",
|
|
15979
|
+
summaryItems = [],
|
|
15980
|
+
onNewDeposit,
|
|
15981
|
+
onGoToDashboard,
|
|
15982
|
+
className
|
|
15983
|
+
}) {
|
|
15984
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15985
|
+
"div",
|
|
15986
|
+
{
|
|
15987
|
+
className: tailwindMerge.twMerge(
|
|
15988
|
+
"w-full p-4 mx-auto space-y-6 animate-fade-in flex flex-col flex-1",
|
|
15989
|
+
className
|
|
15990
|
+
),
|
|
15991
|
+
"data-test-id": "onramp-success-view",
|
|
15992
|
+
children: [
|
|
15993
|
+
/* @__PURE__ */ jsxRuntime.jsxs(SuccessHeader, { children: [
|
|
15994
|
+
/* @__PURE__ */ jsxRuntime.jsx(SuccessIcon3, {}),
|
|
15995
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
|
|
15996
|
+
/* @__PURE__ */ jsxRuntime.jsx(SuccessTitle, { children: "Dep\xF3sito via PIX conclu\xEDdo" }),
|
|
15997
|
+
/* @__PURE__ */ jsxRuntime.jsxs(SuccessDescription, { children: [
|
|
15998
|
+
amount,
|
|
15999
|
+
" BRLA foram adicionados \xE0 sua carteira."
|
|
16000
|
+
] })
|
|
16001
|
+
] })
|
|
16002
|
+
] }),
|
|
16003
|
+
/* @__PURE__ */ jsxRuntime.jsx(DepositCard, { children: /* @__PURE__ */ jsxRuntime.jsxs(DepositRow, { children: [
|
|
16004
|
+
/* @__PURE__ */ jsxRuntime.jsx(DepositIcon, {}),
|
|
16005
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DepositInfo, { children: [
|
|
16006
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-[color:var(--deframe-widget-color-text-secondary)]", children: "Voc\xEA depositou via PIX" }),
|
|
16007
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-[14px] font-semibold text-[color:var(--deframe-widget-color-text-secondary)]", children: [
|
|
16008
|
+
amount,
|
|
16009
|
+
" BRLA"
|
|
16010
|
+
] })
|
|
16011
|
+
] })
|
|
16012
|
+
] }) }),
|
|
16013
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16014
|
+
SummaryDetails,
|
|
16015
|
+
{
|
|
16016
|
+
title: summaryTitle,
|
|
16017
|
+
items: summaryItems,
|
|
16018
|
+
defaultOpen: false,
|
|
16019
|
+
className: "bg-[var(--deframe-widget-color-bg-secondary)]"
|
|
16020
|
+
}
|
|
16021
|
+
),
|
|
16022
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex items-center my-4 gap-2 mt-auto", children: [
|
|
16023
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16024
|
+
SecondaryButton,
|
|
16025
|
+
{
|
|
16026
|
+
onClick: onNewDeposit,
|
|
16027
|
+
"aria-label": "Fazer novo dep\xF3sito",
|
|
16028
|
+
"data-test-id": "onramp-success-new-deposit",
|
|
16029
|
+
children: "Fazer novo dep\xF3sito"
|
|
16030
|
+
}
|
|
16031
|
+
),
|
|
16032
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16033
|
+
PrimaryButton,
|
|
16034
|
+
{
|
|
16035
|
+
onClick: onGoToDashboard,
|
|
16036
|
+
"aria-label": "Ir para carteira",
|
|
16037
|
+
"data-test-id": "onramp-success-go-dashboard",
|
|
16038
|
+
children: "Ir para carteira"
|
|
16039
|
+
}
|
|
16040
|
+
)
|
|
16041
|
+
] })
|
|
16042
|
+
]
|
|
16043
|
+
}
|
|
16044
|
+
);
|
|
16045
|
+
}
|
|
16046
|
+
var OnrampSuccessSimpleView = ({
|
|
16047
|
+
onGoToDashboard
|
|
16048
|
+
}) => {
|
|
16049
|
+
React6__namespace.useEffect(() => {
|
|
16050
|
+
if (!onGoToDashboard) return;
|
|
16051
|
+
const timer = setTimeout(onGoToDashboard, 5e3);
|
|
16052
|
+
return () => clearTimeout(timer);
|
|
16053
|
+
}, [onGoToDashboard]);
|
|
16054
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "onramp-success-simple-view", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16055
|
+
EarnFeedbackOverlaySimpleView,
|
|
16056
|
+
{
|
|
16057
|
+
variant: "success",
|
|
16058
|
+
title: "Dep\xF3sito via PIX Confirmado!",
|
|
16059
|
+
subtitle: "Seu saldo foi atualizado."
|
|
16060
|
+
}
|
|
16061
|
+
) });
|
|
16062
|
+
};
|
|
16063
|
+
var defaultBackIcon2 = /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 12H5M12 19l-7-7 7-7" }) });
|
|
16064
|
+
function OfframpInputFormView({
|
|
16065
|
+
brlaBalance,
|
|
16066
|
+
amount,
|
|
16067
|
+
onAmountChange,
|
|
16068
|
+
pixKey,
|
|
16069
|
+
onPixKeyChange,
|
|
16070
|
+
onMaxClick,
|
|
16071
|
+
showMaxButton,
|
|
16072
|
+
summaryTitle,
|
|
16073
|
+
summaryItems,
|
|
16074
|
+
isLoadingQuote,
|
|
16075
|
+
amountWarningMessage,
|
|
16076
|
+
hasActiveWithdrawal,
|
|
16077
|
+
completedBanner,
|
|
16078
|
+
error,
|
|
16079
|
+
offrampError,
|
|
16080
|
+
submitLabel,
|
|
16081
|
+
submitDisabled,
|
|
16082
|
+
onSubmit,
|
|
16083
|
+
onBack,
|
|
16084
|
+
backIcon,
|
|
16085
|
+
tokenIconUrl = "/brladigital_32.webp",
|
|
16086
|
+
flagIconUrl = "/brazil-flag-rounded.png",
|
|
16087
|
+
className
|
|
16088
|
+
}) {
|
|
16089
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16090
|
+
"div",
|
|
16091
|
+
{
|
|
16092
|
+
className: tailwindMerge.twMerge(
|
|
16093
|
+
"w-full max-w-[620px] relative bg-[var(--deframe-widget-color-bg-primary)] lg:bg-[var(--deframe-widget-color-bg-secondary)] overflow-hidden mx-auto mt-[75px] rounded-[var(--deframe-widget-size-radius-sm)] p-6 min-h-[80vh] flex flex-col",
|
|
16094
|
+
className
|
|
16095
|
+
),
|
|
16096
|
+
"data-test-id": "offramp-input-form-view",
|
|
16097
|
+
children: [
|
|
16098
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-6", children: [
|
|
16099
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16100
|
+
"button",
|
|
16101
|
+
{
|
|
16102
|
+
onClick: onBack,
|
|
16103
|
+
className: "flex items-center gap-2 mb-4 cursor-pointer",
|
|
16104
|
+
"aria-label": "Voltar",
|
|
16105
|
+
"data-test-id": "offramp-input-form-back-button",
|
|
16106
|
+
children: [
|
|
16107
|
+
backIcon || defaultBackIcon2,
|
|
16108
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-medium", children: "Voltar" })
|
|
16109
|
+
]
|
|
16110
|
+
}
|
|
16111
|
+
),
|
|
16112
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-1 bg-[var(--deframe-widget-color-border-secondary)] rounded-full overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full bg-[#1FC16B]", style: { width: "25%" } }) })
|
|
16113
|
+
] }),
|
|
16114
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-start justify-start gap-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full space-y-6", children: [
|
|
16115
|
+
completedBanner && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16116
|
+
BannerNotification,
|
|
16117
|
+
{
|
|
16118
|
+
message: completedBanner,
|
|
16119
|
+
variant: "success"
|
|
16120
|
+
}
|
|
16121
|
+
),
|
|
16122
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
16123
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h3", children: "Saque via PIX" }),
|
|
16124
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-[color:var(--deframe-widget-color-text-secondary)]", children: "Insira o valor e a chave PIX para receber em sua conta banc\xE1ria." })
|
|
16125
|
+
] }),
|
|
16126
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ListItem, { children: [
|
|
16127
|
+
/* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16128
|
+
"img",
|
|
16129
|
+
{
|
|
16130
|
+
src: tokenIconUrl,
|
|
16131
|
+
alt: "Token",
|
|
16132
|
+
className: "w-10 h-10 rounded-full"
|
|
16133
|
+
}
|
|
16134
|
+
) }),
|
|
16135
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { className: "ml-4", children: [
|
|
16136
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)] ml-2", children: "Saldo em BRLA dispon\xEDvel" }),
|
|
16137
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TextHeading, { variant: "h5", className: "ml-2", children: [
|
|
16138
|
+
brlaBalance,
|
|
16139
|
+
" BRLA"
|
|
16140
|
+
] })
|
|
16141
|
+
] })
|
|
16142
|
+
] }),
|
|
16143
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
16144
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)] mb-2", children: "Quanto voc\xEA quer enviar via PIX?" }),
|
|
16145
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-[var(--deframe-widget-color-bg-secondary)] border border-[var(--deframe-widget-color-border-secondary)] rounded-[var(--deframe-widget-size-radius-sm)] p-4 flex items-center justify-between", children: [
|
|
16146
|
+
/* @__PURE__ */ jsxRuntime.jsx("img", { src: flagIconUrl, alt: "BRL", className: "w-6 h-6 rounded-full" }),
|
|
16147
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16148
|
+
"input",
|
|
16149
|
+
{
|
|
16150
|
+
type: "text",
|
|
16151
|
+
inputMode: "decimal",
|
|
16152
|
+
value: amount ? `R$${amount}` : "",
|
|
16153
|
+
onChange: (e) => {
|
|
16154
|
+
const value = e.target.value.replace(/[^0-9.]/g, "");
|
|
16155
|
+
onAmountChange(value || "");
|
|
16156
|
+
},
|
|
16157
|
+
onWheel: (event) => {
|
|
16158
|
+
event.currentTarget.blur();
|
|
16159
|
+
},
|
|
16160
|
+
placeholder: "R$0.00",
|
|
16161
|
+
className: "w-full bg-transparent text-right text-[28px] font-extrabold text-[color:var(--deframe-widget-color-text-primary)] outline-none",
|
|
16162
|
+
"aria-label": "Valor do saque",
|
|
16163
|
+
"data-test-id": "offramp-input-form-amount"
|
|
16164
|
+
}
|
|
16165
|
+
)
|
|
16166
|
+
] }),
|
|
16167
|
+
showMaxButton && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16168
|
+
TertiaryButton,
|
|
16169
|
+
{
|
|
16170
|
+
onClick: onMaxClick,
|
|
16171
|
+
className: "text-[length:var(--deframe-widget-font-size-sm)]",
|
|
16172
|
+
"aria-label": "Usar valor m\xE1ximo",
|
|
16173
|
+
children: "Max"
|
|
16174
|
+
}
|
|
16175
|
+
) }),
|
|
16176
|
+
hasActiveWithdrawal && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16177
|
+
BannerNotification,
|
|
16178
|
+
{
|
|
16179
|
+
message: "Voc\xEA j\xE1 tem um saque em andamento. Aguarde a conclus\xE3o antes de iniciar outro.",
|
|
16180
|
+
variant: "warning"
|
|
16181
|
+
}
|
|
16182
|
+
),
|
|
16183
|
+
amountWarningMessage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16184
|
+
BannerNotification,
|
|
16185
|
+
{
|
|
16186
|
+
message: amountWarningMessage,
|
|
16187
|
+
variant: "warning"
|
|
16188
|
+
}
|
|
16189
|
+
)
|
|
16190
|
+
] }),
|
|
16191
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
16192
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)] mb-2", children: "Qual \xE9 a sua chave PIX?" }),
|
|
16193
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16194
|
+
Input2,
|
|
16195
|
+
{
|
|
16196
|
+
type: "text",
|
|
16197
|
+
value: pixKey,
|
|
16198
|
+
onChange: (e) => onPixKeyChange(e.target.value),
|
|
16199
|
+
placeholder: "(CPF, email, telefone ou aleat\xF3ria)",
|
|
16200
|
+
className: "w-full h-12 text-[length:var(--deframe-widget-font-size-md)] border border-[var(--deframe-widget-color-border-secondary)] rounded-[var(--deframe-widget-size-radius-sm)] bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
16201
|
+
"aria-label": "Chave PIX",
|
|
16202
|
+
"data-test-id": "offramp-input-form-pix-key"
|
|
16203
|
+
}
|
|
16204
|
+
),
|
|
16205
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16206
|
+
BannerNotification,
|
|
16207
|
+
{
|
|
16208
|
+
variant: "info",
|
|
16209
|
+
message: "A chave PIX deve estar vinculada ao mesmo CPF do seu cadastro."
|
|
16210
|
+
}
|
|
16211
|
+
)
|
|
16212
|
+
] }),
|
|
16213
|
+
isLoadingQuote ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-[var(--deframe-widget-color-bg-secondary)] p-4 rounded-[var(--deframe-widget-size-radius-sm)]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
16214
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: 128, height: 16, shimmer: true }),
|
|
16215
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: 64, height: 16, shimmer: true })
|
|
16216
|
+
] }) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
16217
|
+
SummaryDetails,
|
|
16218
|
+
{
|
|
16219
|
+
title: summaryTitle,
|
|
16220
|
+
items: summaryItems,
|
|
16221
|
+
className: "bg-[var(--deframe-widget-color-bg-secondary)]"
|
|
16222
|
+
}
|
|
16223
|
+
),
|
|
16224
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16225
|
+
BannerNotification,
|
|
16226
|
+
{
|
|
16227
|
+
message: "Depois de inserir o valor e confirmar o pix voc\xEA precisa assinar a transa\xE7\xE3o na sua wallet. Processamento pode levar alguns minutos.",
|
|
16228
|
+
variant: "info"
|
|
16229
|
+
}
|
|
16230
|
+
),
|
|
16231
|
+
(error || offrampError) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16232
|
+
BannerNotification,
|
|
16233
|
+
{
|
|
16234
|
+
message: error || offrampError || "",
|
|
16235
|
+
variant: "error"
|
|
16236
|
+
}
|
|
16237
|
+
),
|
|
16238
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16239
|
+
PrimaryButton,
|
|
16240
|
+
{
|
|
16241
|
+
onClick: onSubmit,
|
|
16242
|
+
disabled: submitDisabled,
|
|
16243
|
+
"aria-label": "Confirmar saque",
|
|
16244
|
+
"data-test-id": "offramp-input-form-submit",
|
|
16245
|
+
children: submitLabel
|
|
16246
|
+
}
|
|
16247
|
+
)
|
|
16248
|
+
] }) })
|
|
16249
|
+
]
|
|
16250
|
+
}
|
|
16251
|
+
);
|
|
16252
|
+
}
|
|
16253
|
+
|
|
16254
|
+
// src/stories/offramp-input-form-view/constants.ts
|
|
16255
|
+
var PIX_KEY_OPTIONS = [
|
|
16256
|
+
{ value: "cpf", label: "CPF" },
|
|
16257
|
+
{ value: "email", label: "Email" },
|
|
16258
|
+
{ value: "phone", label: "Celular" },
|
|
16259
|
+
{ value: "random", label: "Aleat\xF3ria" }
|
|
16260
|
+
];
|
|
16261
|
+
var tabBaseClasses2 = [
|
|
16262
|
+
"flex-1 py-[4px] px-[8px]",
|
|
16263
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
16264
|
+
"border-none outline-none cursor-pointer",
|
|
16265
|
+
"whitespace-nowrap text-center",
|
|
16266
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
16267
|
+
"text-[13px] [line-height:1.4]",
|
|
16268
|
+
"transition-[background,color] duration-150",
|
|
16269
|
+
"bg-transparent"
|
|
16270
|
+
].join(" ");
|
|
16271
|
+
var activeTabClasses2 = [
|
|
16272
|
+
"[font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
16273
|
+
"text-[color:var(--deframe-widget-color-brand-primary)]"
|
|
16274
|
+
].join(" ");
|
|
16275
|
+
var inactiveTabClasses2 = [
|
|
16276
|
+
"[font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
16277
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
16278
|
+
"hover:text-[color:var(--deframe-widget-color-text-primary)]",
|
|
16279
|
+
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_60%,transparent)]"
|
|
16280
|
+
].join(" ");
|
|
16281
|
+
var PixKeySegmentedControl = ({
|
|
16282
|
+
value,
|
|
16283
|
+
onChange
|
|
16284
|
+
}) => {
|
|
16285
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16286
|
+
"div",
|
|
16287
|
+
{
|
|
16288
|
+
role: "tablist",
|
|
16289
|
+
"data-slot": "pix-key-segmented-control",
|
|
16290
|
+
"data-test-id": "pix-key-segmented-control",
|
|
16291
|
+
className: tailwindMerge.twMerge(
|
|
16292
|
+
"inline-flex w-full",
|
|
16293
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
16294
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
16295
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
16296
|
+
"p-[3px] gap-[2px]"
|
|
16297
|
+
),
|
|
16298
|
+
children: PIX_KEY_OPTIONS.map(({ value: optionValue, label }) => {
|
|
16299
|
+
const isActive = optionValue === value;
|
|
16300
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16301
|
+
"button",
|
|
16302
|
+
{
|
|
16303
|
+
type: "button",
|
|
16304
|
+
role: "tab",
|
|
16305
|
+
"aria-selected": isActive,
|
|
16306
|
+
"aria-label": label,
|
|
16307
|
+
"data-test-id": `pix-key-tab-${optionValue}`,
|
|
16308
|
+
onClick: () => onChange(optionValue),
|
|
16309
|
+
className: tailwindMerge.twMerge(
|
|
16310
|
+
tabBaseClasses2,
|
|
16311
|
+
isActive ? activeTabClasses2 : inactiveTabClasses2
|
|
16312
|
+
),
|
|
16313
|
+
children: label
|
|
16314
|
+
},
|
|
16315
|
+
optionValue
|
|
16316
|
+
);
|
|
16317
|
+
})
|
|
16318
|
+
}
|
|
16319
|
+
);
|
|
16320
|
+
};
|
|
16321
|
+
var STORAGE_KEY = "deframe-pix-key-type";
|
|
16322
|
+
var PIX_PLACEHOLDERS = {
|
|
16323
|
+
cpf: "000.000.000-00",
|
|
16324
|
+
email: "seu@email.com",
|
|
16325
|
+
phone: "+55 (11) 99999-9999",
|
|
16326
|
+
random: "Chave aleat\xF3ria"
|
|
16327
|
+
};
|
|
16328
|
+
var OfframpInputFormSimpleView = ({
|
|
16329
|
+
// Base props
|
|
16330
|
+
brlaBalance,
|
|
16331
|
+
amount,
|
|
16332
|
+
onAmountChange,
|
|
16333
|
+
pixKey,
|
|
16334
|
+
onPixKeyChange,
|
|
16335
|
+
amountWarningMessage,
|
|
16336
|
+
hasActiveWithdrawal,
|
|
16337
|
+
completedBanner,
|
|
16338
|
+
error,
|
|
16339
|
+
offrampError,
|
|
16340
|
+
submitLabel,
|
|
16341
|
+
submitDisabled,
|
|
16342
|
+
onSubmit,
|
|
16343
|
+
onBack,
|
|
16344
|
+
className,
|
|
16345
|
+
// Simple-specific props
|
|
16346
|
+
activeTab,
|
|
16347
|
+
cryptoHref,
|
|
16348
|
+
pixHref,
|
|
16349
|
+
onPercentageSelect,
|
|
16350
|
+
maxLabel,
|
|
16351
|
+
onClose
|
|
16352
|
+
}) => {
|
|
16353
|
+
const [pixKeyType, setPixKeyType] = React6__namespace.default.useState(() => {
|
|
16354
|
+
if (typeof window === "undefined") return "cpf";
|
|
16355
|
+
return localStorage.getItem(STORAGE_KEY) || "cpf";
|
|
16356
|
+
});
|
|
16357
|
+
function handlePixKeyTypeChange(type) {
|
|
16358
|
+
setPixKeyType(type);
|
|
16359
|
+
localStorage.setItem(STORAGE_KEY, type);
|
|
16360
|
+
}
|
|
16361
|
+
const [cardHovered, setCardHovered] = React6__namespace.default.useState(false);
|
|
16362
|
+
const hideTimerRef = React6__namespace.default.useRef(void 0);
|
|
16363
|
+
function handleHoverStart() {
|
|
16364
|
+
clearTimeout(hideTimerRef.current);
|
|
16365
|
+
setCardHovered(true);
|
|
16366
|
+
}
|
|
16367
|
+
function handleHoverEnd() {
|
|
16368
|
+
hideTimerRef.current = setTimeout(() => setCardHovered(false), 150);
|
|
16369
|
+
}
|
|
16370
|
+
React6__namespace.default.useEffect(() => () => clearTimeout(hideTimerRef.current), []);
|
|
16371
|
+
const hasAmountError = !!amountWarningMessage;
|
|
16372
|
+
const hasPixKeyError = !!error || !!offrampError;
|
|
16373
|
+
const isSubmitDisabledInternal = submitDisabled || !amount || amount === "0" || !pixKey.trim();
|
|
16374
|
+
const panelBaseClasses = [
|
|
16375
|
+
"relative flex flex-col overflow-hidden w-[420px]",
|
|
16376
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
16377
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
16378
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
16379
|
+
].join(" ");
|
|
16380
|
+
const headerBaseClasses = [
|
|
16381
|
+
"flex items-center",
|
|
16382
|
+
"px-[var(--deframe-widget-size-padding-x-md)]",
|
|
16383
|
+
"py-[var(--deframe-widget-size-padding-y-md)]"
|
|
16384
|
+
].join(" ");
|
|
16385
|
+
const titleBaseClasses = [
|
|
16386
|
+
"flex-1",
|
|
16387
|
+
"text-[15px]",
|
|
16388
|
+
"[font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
16389
|
+
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
16390
|
+
].join(" ");
|
|
16391
|
+
const dividerClasses = "h-px bg-[var(--deframe-widget-color-border-secondary)]";
|
|
16392
|
+
const bodyBaseClasses = [
|
|
16393
|
+
"flex flex-col",
|
|
16394
|
+
"gap-[var(--deframe-widget-size-gap-md)]",
|
|
16395
|
+
"px-[var(--deframe-widget-size-padding-x-md)]",
|
|
16396
|
+
"py-[var(--deframe-widget-size-padding-y-md)]"
|
|
16397
|
+
].join(" ");
|
|
16398
|
+
const amountCardClasses = tailwindMerge.twMerge(
|
|
16399
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
16400
|
+
"border",
|
|
16401
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
|
|
16402
|
+
"transition-[border-color,background] duration-200",
|
|
16403
|
+
hasAmountError ? "border-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_32%,transparent)] bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_16%,transparent)]" : "border-[color:var(--deframe-widget-color-border-secondary)] bg-[var(--deframe-widget-color-bg-secondary)]"
|
|
16404
|
+
);
|
|
16405
|
+
const pixKeyCardClasses = tailwindMerge.twMerge(
|
|
16406
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
16407
|
+
"border",
|
|
16408
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
|
|
16409
|
+
"transition-[border-color,background] duration-200",
|
|
16410
|
+
hasPixKeyError ? "border-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_32%,transparent)] bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_16%,transparent)]" : "border-[color:var(--deframe-widget-color-border-secondary)] bg-[var(--deframe-widget-color-bg-secondary)]"
|
|
16411
|
+
);
|
|
16412
|
+
const footerBaseClasses = [
|
|
16413
|
+
"flex gap-[var(--deframe-widget-size-gap-sm)]",
|
|
16414
|
+
"px-[var(--deframe-widget-size-padding-x-md)]",
|
|
16415
|
+
"pb-[var(--deframe-widget-size-padding-y-md)]"
|
|
16416
|
+
].join(" ");
|
|
16417
|
+
const cancelButtonClasses = [
|
|
16418
|
+
"flex-1 h-12 rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
16419
|
+
"text-[15px] text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
16420
|
+
"border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
16421
|
+
"outline-none",
|
|
16422
|
+
"transition-[background,color,border-color] duration-150",
|
|
16423
|
+
"hover:opacity-100",
|
|
16424
|
+
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_60%,transparent)]",
|
|
16425
|
+
"hover:text-[color:var(--deframe-widget-color-text-primary)]"
|
|
16426
|
+
].join(" ");
|
|
16427
|
+
const submitButtonClasses = [
|
|
16428
|
+
"flex-1 h-12 rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
16429
|
+
"border-none",
|
|
16430
|
+
"text-[15px]",
|
|
16431
|
+
isSubmitDisabledInternal ? "text-[color:var(--deframe-widget-color-text-primary-disabled)]" : "text-[color:var(--deframe-widget-color-text-primary-dark)]",
|
|
16432
|
+
"outline-none",
|
|
16433
|
+
"transition-[background,color] duration-200"
|
|
16434
|
+
].join(" ");
|
|
16435
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16436
|
+
"div",
|
|
16437
|
+
{
|
|
16438
|
+
"data-slot": "offramp-input-form-simple-panel",
|
|
16439
|
+
"data-test-id": "offramp-input-form-simple-view",
|
|
16440
|
+
className: tailwindMerge.twMerge(panelBaseClasses, className),
|
|
16441
|
+
children: [
|
|
16442
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16443
|
+
"header",
|
|
16444
|
+
{
|
|
16445
|
+
"data-slot": "offramp-input-form-simple-header",
|
|
16446
|
+
"data-test-id": "offramp-input-form-simple-view-header",
|
|
16447
|
+
className: headerBaseClasses,
|
|
16448
|
+
children: [
|
|
16449
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16450
|
+
"span",
|
|
16451
|
+
{
|
|
16452
|
+
"data-slot": "offramp-input-form-simple-title",
|
|
16453
|
+
"data-test-id": "offramp-input-form-simple-view-title",
|
|
16454
|
+
className: titleBaseClasses,
|
|
16455
|
+
children: "Sacar"
|
|
16456
|
+
}
|
|
16457
|
+
),
|
|
16458
|
+
onClose && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16459
|
+
CloseButton_default,
|
|
16460
|
+
{
|
|
16461
|
+
onClick: onClose,
|
|
16462
|
+
ariaLabel: "Close withdrawal panel",
|
|
16463
|
+
testId: "offramp-input-form-simple-view-close"
|
|
16464
|
+
}
|
|
16465
|
+
)
|
|
16466
|
+
]
|
|
16467
|
+
}
|
|
16468
|
+
),
|
|
16469
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16470
|
+
"div",
|
|
16471
|
+
{
|
|
16472
|
+
"data-slot": "offramp-input-form-simple-divider",
|
|
16473
|
+
"data-test-id": "offramp-input-form-simple-view-divider",
|
|
16474
|
+
className: dividerClasses
|
|
16475
|
+
}
|
|
16476
|
+
),
|
|
16477
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16478
|
+
FlowTabHeader,
|
|
16479
|
+
{
|
|
16480
|
+
activeTab: activeTab != null ? activeTab : "pix",
|
|
16481
|
+
cryptoHref: cryptoHref != null ? cryptoHref : "/dashboard/withdraw/onchain",
|
|
16482
|
+
pixHref: pixHref != null ? pixHref : "/dashboard/withdraw/offramp"
|
|
16483
|
+
}
|
|
16484
|
+
),
|
|
16485
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16486
|
+
"div",
|
|
16487
|
+
{
|
|
16488
|
+
"data-slot": "offramp-input-form-simple-divider-tabs",
|
|
16489
|
+
"data-test-id": "offramp-input-form-simple-view-divider-tabs",
|
|
16490
|
+
className: dividerClasses
|
|
16491
|
+
}
|
|
16492
|
+
),
|
|
16493
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16494
|
+
"div",
|
|
16495
|
+
{
|
|
16496
|
+
"data-slot": "offramp-input-form-simple-body",
|
|
16497
|
+
"data-test-id": "offramp-input-form-simple-view-body",
|
|
16498
|
+
className: bodyBaseClasses,
|
|
16499
|
+
children: [
|
|
16500
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16501
|
+
"div",
|
|
16502
|
+
{
|
|
16503
|
+
"data-slot": "offramp-input-form-simple-amount-card",
|
|
16504
|
+
"data-test-id": "offramp-input-form-simple-view-amount-card",
|
|
16505
|
+
onMouseEnter: handleHoverStart,
|
|
16506
|
+
onMouseLeave: handleHoverEnd,
|
|
16507
|
+
className: amountCardClasses,
|
|
16508
|
+
children: [
|
|
16509
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16510
|
+
"div",
|
|
16511
|
+
{
|
|
16512
|
+
"data-slot": "offramp-input-form-simple-amount-top-row",
|
|
16513
|
+
"data-test-id": "offramp-input-form-simple-view-amount-top-row",
|
|
16514
|
+
className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)]",
|
|
16515
|
+
children: [
|
|
16516
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16517
|
+
"span",
|
|
16518
|
+
{
|
|
16519
|
+
"data-test-id": "offramp-input-form-simple-view-currency-prefix",
|
|
16520
|
+
className: "text-[36px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]",
|
|
16521
|
+
children: "R$"
|
|
16522
|
+
}
|
|
16523
|
+
),
|
|
16524
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16525
|
+
"div",
|
|
16526
|
+
{
|
|
16527
|
+
"data-test-id": "offramp-input-form-simple-view-input-divider",
|
|
16528
|
+
className: "w-px h-10 bg-[var(--deframe-widget-color-border-secondary)] flex-shrink-0"
|
|
16529
|
+
}
|
|
16530
|
+
),
|
|
16531
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16532
|
+
EarnAmountInputSimpleView,
|
|
16533
|
+
{
|
|
16534
|
+
value: amount,
|
|
16535
|
+
onChange: (e) => onAmountChange(e.target.value),
|
|
16536
|
+
ariaLabel: "Valor do saque",
|
|
16537
|
+
dollarAmountFormatted: ""
|
|
16538
|
+
}
|
|
16539
|
+
)
|
|
16540
|
+
]
|
|
16541
|
+
}
|
|
16542
|
+
),
|
|
16543
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16544
|
+
"div",
|
|
16545
|
+
{
|
|
16546
|
+
"data-slot": "offramp-input-form-simple-balance-row",
|
|
16547
|
+
"data-test-id": "offramp-input-form-simple-view-balance-row",
|
|
16548
|
+
className: "mt-[var(--deframe-widget-size-gap-sm)]",
|
|
16549
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16550
|
+
"span",
|
|
16551
|
+
{
|
|
16552
|
+
className: tailwindMerge.twMerge(
|
|
16553
|
+
"text-[13px] font-[var(--deframe-widget-font-family)]",
|
|
16554
|
+
hasAmountError ? "text-[color:var(--deframe-widget-color-state-error)]" : "text-[color:var(--deframe-widget-color-text-secondary)]"
|
|
16555
|
+
),
|
|
16556
|
+
children: [
|
|
16557
|
+
"Saldo: ",
|
|
16558
|
+
brlaBalance,
|
|
16559
|
+
" BRLA"
|
|
16560
|
+
]
|
|
16561
|
+
}
|
|
16562
|
+
)
|
|
16563
|
+
}
|
|
16564
|
+
),
|
|
16565
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: onPercentageSelect && cardHovered && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16566
|
+
framerMotion.motion.div,
|
|
16567
|
+
{
|
|
16568
|
+
"data-slot": "offramp-input-form-simple-chips-row",
|
|
16569
|
+
"data-test-id": "offramp-input-form-simple-view-chips-row",
|
|
16570
|
+
initial: { opacity: 0, height: 0, marginTop: 0 },
|
|
16571
|
+
animate: { opacity: 1, height: "auto", marginTop: "var(--deframe-widget-size-gap-sm)" },
|
|
16572
|
+
exit: { opacity: 0, height: 0, marginTop: 0 },
|
|
16573
|
+
transition: { duration: 0.15, ease: "easeOut" },
|
|
16574
|
+
style: { overflow: "hidden" },
|
|
16575
|
+
onMouseEnter: handleHoverStart,
|
|
16576
|
+
onMouseLeave: handleHoverEnd,
|
|
16577
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16578
|
+
EarnPercentageButtonsSimpleView,
|
|
16579
|
+
{
|
|
16580
|
+
onPercentageClick: onPercentageSelect,
|
|
16581
|
+
maxLabel: maxLabel != null ? maxLabel : "M\xE1x."
|
|
16582
|
+
}
|
|
16583
|
+
)
|
|
16584
|
+
}
|
|
16585
|
+
) }),
|
|
16586
|
+
amountWarningMessage && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16587
|
+
EarnInlineNotificationSimpleView,
|
|
16588
|
+
{
|
|
16589
|
+
variant: "error",
|
|
16590
|
+
message: amountWarningMessage
|
|
16591
|
+
}
|
|
16592
|
+
) })
|
|
16593
|
+
]
|
|
16594
|
+
}
|
|
16595
|
+
),
|
|
16596
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16597
|
+
"div",
|
|
16598
|
+
{
|
|
16599
|
+
"data-slot": "offramp-input-form-simple-pix-key-card",
|
|
16600
|
+
"data-test-id": "offramp-input-form-simple-view-pix-key-card",
|
|
16601
|
+
className: pixKeyCardClasses,
|
|
16602
|
+
children: [
|
|
16603
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16604
|
+
PixKeySegmentedControl,
|
|
16605
|
+
{
|
|
16606
|
+
value: pixKeyType,
|
|
16607
|
+
onChange: handlePixKeyTypeChange
|
|
16608
|
+
}
|
|
16609
|
+
),
|
|
16610
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16611
|
+
"div",
|
|
16612
|
+
{
|
|
16613
|
+
"data-slot": "offramp-input-form-simple-pix-divider",
|
|
16614
|
+
"data-test-id": "offramp-input-form-simple-view-pix-divider",
|
|
16615
|
+
className: "h-px bg-[var(--deframe-widget-color-border-secondary)] my-[var(--deframe-widget-size-gap-sm)]"
|
|
16616
|
+
}
|
|
16617
|
+
),
|
|
16618
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16619
|
+
"input",
|
|
16620
|
+
{
|
|
16621
|
+
"data-slot": "offramp-input-form-simple-pix-input",
|
|
16622
|
+
"data-test-id": "offramp-input-form-simple-view-pix-input",
|
|
16623
|
+
type: "text",
|
|
16624
|
+
value: pixKey,
|
|
16625
|
+
onChange: (e) => onPixKeyChange(e.target.value),
|
|
16626
|
+
placeholder: PIX_PLACEHOLDERS[pixKeyType],
|
|
16627
|
+
"aria-label": "Chave PIX",
|
|
16628
|
+
className: tailwindMerge.twMerge(
|
|
16629
|
+
"w-full bg-transparent outline-none",
|
|
16630
|
+
"text-[13px] [font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
16631
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
16632
|
+
"placeholder:text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
16633
|
+
"text-[color:var(--deframe-widget-color-text-primary)]",
|
|
16634
|
+
'[font-feature-settings:"tnum"]'
|
|
16635
|
+
),
|
|
16636
|
+
spellCheck: false,
|
|
16637
|
+
autoComplete: "off"
|
|
16638
|
+
}
|
|
16639
|
+
),
|
|
16640
|
+
(error || offrampError) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16641
|
+
EarnInlineNotificationSimpleView,
|
|
16642
|
+
{
|
|
16643
|
+
variant: "error",
|
|
16644
|
+
message: error || offrampError || ""
|
|
16645
|
+
}
|
|
16646
|
+
) })
|
|
16647
|
+
]
|
|
16648
|
+
}
|
|
16649
|
+
),
|
|
16650
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16651
|
+
EarnInlineNotificationSimpleView,
|
|
16652
|
+
{
|
|
16653
|
+
variant: "info",
|
|
16654
|
+
message: "A chave PIX deve estar vinculada ao mesmo CPF do seu cadastro."
|
|
16655
|
+
}
|
|
16656
|
+
),
|
|
16657
|
+
hasActiveWithdrawal && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16658
|
+
EarnInlineNotificationSimpleView,
|
|
16659
|
+
{
|
|
16660
|
+
variant: "warning",
|
|
16661
|
+
message: "Voc\xEA j\xE1 possui um saque em andamento."
|
|
16662
|
+
}
|
|
16663
|
+
),
|
|
16664
|
+
completedBanner && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16665
|
+
EarnInlineNotificationSimpleView,
|
|
16666
|
+
{
|
|
16667
|
+
variant: "success",
|
|
16668
|
+
message: completedBanner
|
|
16669
|
+
}
|
|
16670
|
+
)
|
|
16671
|
+
]
|
|
16672
|
+
}
|
|
16673
|
+
),
|
|
16674
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16675
|
+
"footer",
|
|
16676
|
+
{
|
|
16677
|
+
"data-slot": "offramp-input-form-simple-footer",
|
|
16678
|
+
"data-test-id": "offramp-input-form-simple-view-footer",
|
|
16679
|
+
className: footerBaseClasses,
|
|
16680
|
+
children: [
|
|
16681
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16682
|
+
SecondaryButton,
|
|
16683
|
+
{
|
|
16684
|
+
type: "button",
|
|
16685
|
+
className: cancelButtonClasses,
|
|
16686
|
+
onClick: onBack,
|
|
16687
|
+
"aria-label": "Cancel withdrawal",
|
|
16688
|
+
"data-test-id": "offramp-input-form-simple-view-cancel",
|
|
16689
|
+
children: "Cancelar"
|
|
16690
|
+
}
|
|
16691
|
+
),
|
|
16692
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16693
|
+
PrimaryButton,
|
|
16694
|
+
{
|
|
16695
|
+
type: "button",
|
|
16696
|
+
className: submitButtonClasses,
|
|
16697
|
+
disabled: isSubmitDisabledInternal,
|
|
16698
|
+
onClick: onSubmit,
|
|
16699
|
+
"aria-label": "Confirmar saque",
|
|
16700
|
+
"data-test-id": "offramp-input-form-simple-view-submit",
|
|
16701
|
+
children: submitLabel
|
|
16702
|
+
}
|
|
16703
|
+
)
|
|
16704
|
+
]
|
|
16705
|
+
}
|
|
16706
|
+
)
|
|
16707
|
+
]
|
|
16708
|
+
}
|
|
16709
|
+
);
|
|
16710
|
+
};
|
|
16711
|
+
function ExplorerLink2({ href, label, className }) {
|
|
16712
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16713
|
+
"a",
|
|
16714
|
+
{
|
|
16715
|
+
"data-test-id": "explorer-link",
|
|
16716
|
+
href,
|
|
16717
|
+
target: "_blank",
|
|
16718
|
+
rel: "noopener noreferrer",
|
|
16719
|
+
"aria-label": label || "View on explorer",
|
|
16720
|
+
className: tailwindMerge.twMerge(
|
|
16721
|
+
"text-[color:var(--deframe-widget-color-brand-primary)] font-[var(--deframe-widget-font-weight-semibold)] hover:underline text-[length:var(--deframe-widget-font-size-sm)] leading-[var(--deframe-widget-font-leading-sm)]",
|
|
16722
|
+
className
|
|
16723
|
+
),
|
|
16724
|
+
children: label || href
|
|
16725
|
+
}
|
|
16726
|
+
);
|
|
16727
|
+
}
|
|
16728
|
+
function StepStatusIcon2({ status = "completed" }) {
|
|
16729
|
+
switch (status) {
|
|
16730
|
+
case "completed":
|
|
16731
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-full bg-[var(--deframe-widget-color-bg-secondary)] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "text-[color:var(--deframe-widget-color-brand-primary)]", children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" }) }) });
|
|
16732
|
+
case "pending":
|
|
16733
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-full bg-[var(--deframe-widget-color-bg-secondary)] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "text-yellow-400", children: [
|
|
16734
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
16735
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "12 6 12 12 16 14" })
|
|
16736
|
+
] }) });
|
|
16737
|
+
case "failed":
|
|
16738
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-full bg-[var(--deframe-widget-color-bg-secondary)] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "text-red-400", children: [
|
|
16739
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
16740
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
16741
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
16742
|
+
] }) });
|
|
16743
|
+
}
|
|
16744
|
+
}
|
|
16745
|
+
function StepDisplay2({ step }) {
|
|
16746
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4 w-full", children: [
|
|
16747
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[length:var(--deframe-widget-font-size-sm)] text-[color:var(--deframe-widget-color-text-primary)] flex-1", children: step.description }),
|
|
16748
|
+
step.explorerUrl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(ExplorerLink2, { href: step.explorerUrl, label: "Ver no Explorer", className: "text-[length:var(--deframe-widget-font-size-xs)] whitespace-nowrap" }) })
|
|
16749
|
+
] });
|
|
16750
|
+
}
|
|
16751
|
+
function PixOfframpProcessingDetails({ breakdown, estimatedTime, className }) {
|
|
16752
|
+
if (!breakdown || breakdown.length === 0) {
|
|
16753
|
+
return null;
|
|
16754
|
+
}
|
|
16755
|
+
const getProcessingSteps = () => {
|
|
16756
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col w-full", children: [
|
|
16757
|
+
estimatedTime && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between pb-3 text-[length:var(--deframe-widget-font-size-sm)]", children: [
|
|
16758
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[color:var(--deframe-widget-color-text-secondary)]", children: "Tempo estimado" }),
|
|
16759
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-[var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)]", children: estimatedTime })
|
|
16760
|
+
] }),
|
|
16761
|
+
breakdown.map((step, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3", children: [
|
|
16762
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
16763
|
+
/* @__PURE__ */ jsxRuntime.jsx(StepStatusIcon2, { status: step.status }),
|
|
16764
|
+
index < breakdown.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px flex-1 min-h-[10px] bg-[var(--deframe-widget-color-bg-primary)] my-2" })
|
|
16765
|
+
] }),
|
|
16766
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 pb-3", children: /* @__PURE__ */ jsxRuntime.jsx(StepDisplay2, { step }) })
|
|
16767
|
+
] }, `step-${index}`))
|
|
16768
|
+
] });
|
|
16769
|
+
};
|
|
16770
|
+
const items = [
|
|
16771
|
+
{
|
|
16772
|
+
label: "",
|
|
16773
|
+
value: getProcessingSteps(),
|
|
16774
|
+
valueClassName: "flex flex-col gap-3 w-full"
|
|
16775
|
+
}
|
|
16776
|
+
];
|
|
16777
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "pix-offramp-processing-details", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16778
|
+
SummaryDetails,
|
|
16779
|
+
{
|
|
16780
|
+
title: "Detalhes",
|
|
16781
|
+
items,
|
|
16782
|
+
defaultOpen: true,
|
|
16783
|
+
className: `bg-[var(--deframe-widget-color-bg-secondary)] ${className || ""}`
|
|
16784
|
+
}
|
|
16785
|
+
) });
|
|
16786
|
+
}
|
|
16787
|
+
var defaultCloseIcon = /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6L6 18M6 6l12 12" }) });
|
|
16788
|
+
function OfframpProcessingView({
|
|
16789
|
+
step = "creating_ticket",
|
|
16790
|
+
amount = "0",
|
|
16791
|
+
summaryTitle = "",
|
|
16792
|
+
summaryItems = [],
|
|
16793
|
+
transferTxHash,
|
|
16794
|
+
onClose,
|
|
16795
|
+
closeIcon,
|
|
16796
|
+
tokenIconUrl = "/brladigital_32.webp",
|
|
16797
|
+
className
|
|
16798
|
+
}) {
|
|
16799
|
+
const progressPercent = step === "creating_ticket" ? 50 : step === "transferring" ? 75 : 85;
|
|
16800
|
+
const prepareStatus = step === "creating_ticket" ? "processing" : "done";
|
|
16801
|
+
const signatureStatus = step === "waiting_pix" ? "done" : step === "transferring" ? "processing" : "pending";
|
|
16802
|
+
const sendStatus = "pending";
|
|
16803
|
+
const mapStatus = (status) => {
|
|
16804
|
+
if (status === "done") return "completed";
|
|
16805
|
+
return "pending";
|
|
16806
|
+
};
|
|
16807
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16808
|
+
"div",
|
|
16809
|
+
{
|
|
16810
|
+
className: tailwindMerge.twMerge(
|
|
16811
|
+
"w-full max-w-[620px] relative bg-[var(--deframe-widget-color-bg-primary)] lg:bg-[var(--deframe-widget-color-bg-secondary)] overflow-hidden mx-auto mt-[75px] rounded-[var(--deframe-widget-size-radius-sm)] p-6 min-h-[80vh] flex flex-col",
|
|
16812
|
+
className
|
|
16813
|
+
),
|
|
16814
|
+
"data-test-id": "offramp-processing-view",
|
|
16815
|
+
children: [
|
|
16816
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-6", children: [
|
|
16817
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16818
|
+
"button",
|
|
16819
|
+
{
|
|
16820
|
+
onClick: onClose,
|
|
16821
|
+
className: "flex items-center justify-center w-8 h-8 text-[color:var(--deframe-widget-color-text-secondary)] hover:text-[color:var(--deframe-widget-color-text-primary)] transition mb-4",
|
|
16822
|
+
"aria-label": "Fechar",
|
|
16823
|
+
"data-test-id": "offramp-processing-close-button",
|
|
16824
|
+
children: closeIcon || defaultCloseIcon
|
|
16825
|
+
}
|
|
16826
|
+
),
|
|
16827
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-1 bg-[var(--deframe-widget-color-border-secondary)] rounded-full overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full bg-[#1FC16B] transition-all duration-300", style: { width: `${progressPercent}%` } }) })
|
|
16828
|
+
] }),
|
|
16829
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-start justify-start gap-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full space-y-6", children: [
|
|
16830
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center text-center space-y-4", children: [
|
|
16831
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 bg-[#F6A700] rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-10 h-10 animate-pulse", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5l-4-4V4h8v3.5l-4 4z" }) }) }),
|
|
16832
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16833
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TextHeading, { variant: "h3", className: "mb-2 flex items-center justify-center gap-1", children: [
|
|
16834
|
+
"Estamos enviando seu PIX",
|
|
16835
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex gap-0.5", children: [
|
|
16836
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-bounce", style: { animationDelay: "0ms", animationDuration: "1.4s" }, children: "." }),
|
|
16837
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-bounce", style: { animationDelay: "200ms", animationDuration: "1.4s" }, children: "." }),
|
|
16838
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-bounce", style: { animationDelay: "400ms", animationDuration: "1.4s" }, children: "." })
|
|
16839
|
+
] })
|
|
16840
|
+
] }),
|
|
16841
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-[color:var(--deframe-widget-color-text-secondary)]", children: "Seu PIX est\xE1 sendo enviado. Na maioria das vezes, cai em segundos." })
|
|
16842
|
+
] })
|
|
16843
|
+
] }),
|
|
16844
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ListItem, { children: [
|
|
16845
|
+
/* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16846
|
+
"img",
|
|
16847
|
+
{
|
|
16848
|
+
src: tokenIconUrl,
|
|
16849
|
+
alt: "Token",
|
|
16850
|
+
className: "w-10 h-10 rounded-full"
|
|
16851
|
+
}
|
|
16852
|
+
) }),
|
|
16853
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { className: "ml-4", children: [
|
|
16854
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)] ml-2", children: "Voc\xEA sacou via PIX" }),
|
|
16855
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TextHeading, { variant: "h5", className: "ml-2", children: [
|
|
16856
|
+
amount,
|
|
16857
|
+
" BRLA"
|
|
16858
|
+
] })
|
|
16859
|
+
] })
|
|
16860
|
+
] }),
|
|
16861
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16862
|
+
SummaryDetails,
|
|
16863
|
+
{
|
|
16864
|
+
title: summaryTitle,
|
|
16865
|
+
items: summaryItems,
|
|
16866
|
+
className: "bg-[var(--deframe-widget-color-bg-secondary)]"
|
|
16867
|
+
}
|
|
16868
|
+
),
|
|
16869
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16870
|
+
PixOfframpProcessingDetails,
|
|
16871
|
+
{
|
|
16872
|
+
estimatedTime: "~2-5 min",
|
|
16873
|
+
breakdown: [
|
|
16874
|
+
{
|
|
16875
|
+
type: "prepare_withdrawal",
|
|
16876
|
+
description: "Preparando seu saque",
|
|
16877
|
+
status: mapStatus(prepareStatus)
|
|
16878
|
+
},
|
|
16879
|
+
{
|
|
16880
|
+
type: "blockchain_signature",
|
|
16881
|
+
description: "Assinatura",
|
|
16882
|
+
status: mapStatus(signatureStatus),
|
|
16883
|
+
explorerUrl: transferTxHash ? `https://polygonscan.com/tx/${transferTxHash}` : void 0
|
|
16884
|
+
},
|
|
16885
|
+
{
|
|
16886
|
+
type: "pix_transfer",
|
|
16887
|
+
description: "Enviando PIX para sua conta",
|
|
16888
|
+
status: mapStatus(sendStatus)
|
|
16889
|
+
}
|
|
16890
|
+
]
|
|
16891
|
+
}
|
|
16892
|
+
),
|
|
16893
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full space-y-3", children: /* @__PURE__ */ jsxRuntime.jsxs(PrimaryButton, { disabled: true, "aria-label": "Aguarde processamento", children: [
|
|
16894
|
+
"Aguarde ",
|
|
16895
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {})
|
|
16896
|
+
] }) })
|
|
16897
|
+
] }) })
|
|
16898
|
+
]
|
|
16899
|
+
}
|
|
16900
|
+
);
|
|
16901
|
+
}
|
|
16902
|
+
var OfframpProcessingSimpleView = () => {
|
|
16903
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "offramp-processing-simple-view", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16904
|
+
EarnFeedbackOverlaySimpleView,
|
|
16905
|
+
{
|
|
16906
|
+
variant: "loading",
|
|
16907
|
+
title: "PROCESSANDO SAQUE...",
|
|
16908
|
+
subtitle: "Seu PIX est\xE1 sendo enviado. Aguarde alguns instantes."
|
|
16909
|
+
}
|
|
16910
|
+
) });
|
|
16911
|
+
};
|
|
16912
|
+
function Card({ children, className }) {
|
|
16913
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16914
|
+
"div",
|
|
16915
|
+
{
|
|
16916
|
+
"data-test-id": "card",
|
|
16917
|
+
className: tailwindMerge.twMerge(
|
|
16918
|
+
"bg-[var(--deframe-widget-color-bg-secondary)] rounded-[var(--deframe-widget-size-radius-sm)] shadow-sm",
|
|
16919
|
+
className
|
|
16920
|
+
),
|
|
16921
|
+
children
|
|
16922
|
+
}
|
|
16923
|
+
);
|
|
16924
|
+
}
|
|
16925
|
+
var defaultCloseIcon2 = /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6L6 18M6 6l12 12" }) });
|
|
16926
|
+
var defaultArrowUpIcon = /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "w-10 h-10 text-[#1FC16B]", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 19V5M5 12l7-7 7 7" }) });
|
|
16927
|
+
function TransactionIdDisplay({ transactionId }) {
|
|
16928
|
+
const truncated = transactionId.length > 16 ? `${transactionId.slice(0, 8)}...${transactionId.slice(-6)}` : transactionId;
|
|
16929
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
16930
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "font-mono text-[color:var(--deframe-widget-color-text-primary)] leading-5", children: truncated }),
|
|
16931
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16932
|
+
AddressDisplay,
|
|
16933
|
+
{
|
|
16934
|
+
address: transactionId,
|
|
16935
|
+
className: "border-none bg-transparent p-0 gap-0",
|
|
16936
|
+
textClassName: "hidden"
|
|
16937
|
+
}
|
|
16938
|
+
)
|
|
16939
|
+
] });
|
|
16940
|
+
}
|
|
16941
|
+
function OfframpSuccessView({
|
|
16942
|
+
amount = "0",
|
|
16943
|
+
feesFormatted = "0",
|
|
16944
|
+
transactionId,
|
|
16945
|
+
date = "",
|
|
16946
|
+
onClose,
|
|
16947
|
+
onConfirm,
|
|
16948
|
+
closeIcon,
|
|
16949
|
+
arrowUpIcon,
|
|
16950
|
+
tokenIconUrl = "/brladigital_32.webp",
|
|
16951
|
+
className
|
|
16952
|
+
}) {
|
|
16953
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16954
|
+
"div",
|
|
16955
|
+
{
|
|
16956
|
+
className: tailwindMerge.twMerge(
|
|
16957
|
+
"w-full max-w-[620px] relative bg-[var(--deframe-widget-color-bg-primary)] lg:bg-[var(--deframe-widget-color-bg-secondary)] overflow-hidden mx-auto mt-[75px] rounded-[var(--deframe-widget-size-radius-sm)] p-6 min-h-[80vh] flex flex-col",
|
|
16958
|
+
className
|
|
16959
|
+
),
|
|
16960
|
+
"data-test-id": "offramp-success-view",
|
|
16961
|
+
children: [
|
|
16962
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-6", children: [
|
|
16963
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16964
|
+
"button",
|
|
16965
|
+
{
|
|
16966
|
+
onClick: onClose,
|
|
16967
|
+
className: "flex items-center justify-center w-8 h-8 text-[color:var(--deframe-widget-color-text-secondary)] hover:text-[color:var(--deframe-widget-color-text-primary)] transition mb-4",
|
|
16968
|
+
"aria-label": "Fechar",
|
|
16969
|
+
"data-test-id": "offramp-success-close-button",
|
|
16970
|
+
children: closeIcon || defaultCloseIcon2
|
|
16971
|
+
}
|
|
16972
|
+
),
|
|
16973
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-1 bg-[#1FC16B] rounded-full" })
|
|
16974
|
+
] }),
|
|
16975
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-start justify-start gap-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full space-y-6", children: [
|
|
16976
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center text-center space-y-4", children: [
|
|
16977
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 bg-[#1FC16B]/20 rounded-full flex items-center justify-center", children: arrowUpIcon || defaultArrowUpIcon }),
|
|
16978
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16979
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h3", className: "mb-2", children: "PIX enviado com sucesso!" }),
|
|
16980
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-[color:var(--deframe-widget-color-text-secondary)]", children: "Seu saque foi conclu\xEDdo e o valor j\xE1 est\xE1 na sua conta." })
|
|
16981
|
+
] })
|
|
16982
|
+
] }),
|
|
16983
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ListItem, { children: [
|
|
16984
|
+
/* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: tokenIconUrl, alt: "Token", className: "w-10 h-10 rounded-full" }) }),
|
|
16985
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { className: "ml-4", children: [
|
|
16986
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)] ml-2", children: "Voc\xEA sacou via PIX" }),
|
|
16987
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TextHeading, { variant: "h5", className: "ml-2", children: [
|
|
16988
|
+
amount,
|
|
16989
|
+
" BRLA"
|
|
16990
|
+
] })
|
|
16991
|
+
] })
|
|
16992
|
+
] }),
|
|
16993
|
+
/* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 w-full inline-flex flex-col justify-start items-center gap-2 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex flex-col justify-start items-start gap-2", children: [
|
|
16994
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "self-stretch h-6 border-b border-[var(--deframe-widget-color-border-secondary)] inline-flex justify-between items-start", children: [
|
|
16995
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)] leading-5", children: "Valor do saque" }),
|
|
16996
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TextBody, { variant: "text-small", className: "font-[var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)] leading-5", children: [
|
|
16997
|
+
amount,
|
|
16998
|
+
" BRLA"
|
|
16999
|
+
] })
|
|
17000
|
+
] }),
|
|
17001
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "self-stretch h-6 border-b border-[var(--deframe-widget-color-border-secondary)] inline-flex justify-between items-start", children: [
|
|
17002
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)] leading-5", children: "Taxa" }),
|
|
17003
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "font-[var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)] leading-5", children: feesFormatted })
|
|
17004
|
+
] }),
|
|
17005
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "self-stretch h-6 border-b border-[var(--deframe-widget-color-border-secondary)] inline-flex justify-between items-start", children: [
|
|
17006
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)] leading-5", children: "Metodo" }),
|
|
17007
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "font-[var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)] leading-5", children: "Transferencia banc\xE1ria (PIX)" })
|
|
17008
|
+
] }),
|
|
17009
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "self-stretch h-8 border-b border-[var(--deframe-widget-color-border-secondary)] inline-flex justify-between items-start", children: [
|
|
17010
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)] leading-5", children: "Status" }),
|
|
17011
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-2 py-0.5 bg-[#1FC16B]/10 rounded-3xl flex justify-end items-center gap-2", children: [
|
|
17012
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-primary)] leading-5", children: "Sucesso" }),
|
|
17013
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-2 h-2 bg-teal-600 rounded-full" })
|
|
17014
|
+
] })
|
|
17015
|
+
] }),
|
|
17016
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "self-stretch h-6 border-b border-[var(--deframe-widget-color-border-secondary)] inline-flex justify-between items-start", children: [
|
|
17017
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)] leading-5", children: "ID da Transa\xE7\xE3o" }),
|
|
17018
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-start items-center gap-2", children: transactionId ? /* @__PURE__ */ jsxRuntime.jsx(TransactionIdDisplay, { transactionId }) : /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-primary)] leading-5", children: "-" }) })
|
|
17019
|
+
] }),
|
|
17020
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "self-stretch h-6 border-b border-[var(--deframe-widget-color-border-secondary)] inline-flex justify-between items-start", children: [
|
|
17021
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)] leading-5", children: "Data" }),
|
|
17022
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "font-[var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)] leading-5", children: date })
|
|
17023
|
+
] })
|
|
17024
|
+
] }) }) }),
|
|
17025
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17026
|
+
PrimaryButton,
|
|
17027
|
+
{
|
|
17028
|
+
onClick: onConfirm,
|
|
17029
|
+
"aria-label": "Confirmar",
|
|
17030
|
+
"data-test-id": "offramp-success-confirm-button",
|
|
17031
|
+
children: "Ok, obrigado"
|
|
17032
|
+
}
|
|
17033
|
+
)
|
|
17034
|
+
] }) })
|
|
17035
|
+
]
|
|
17036
|
+
}
|
|
17037
|
+
);
|
|
17038
|
+
}
|
|
17039
|
+
var OfframpSuccessSimpleView = ({
|
|
17040
|
+
onClose
|
|
17041
|
+
}) => {
|
|
17042
|
+
React6__namespace.useEffect(() => {
|
|
17043
|
+
if (!onClose) return;
|
|
17044
|
+
const timer = setTimeout(onClose, 5e3);
|
|
17045
|
+
return () => clearTimeout(timer);
|
|
17046
|
+
}, [onClose]);
|
|
17047
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "offramp-success-simple-view", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17048
|
+
EarnFeedbackOverlaySimpleView,
|
|
17049
|
+
{
|
|
17050
|
+
variant: "success",
|
|
17051
|
+
title: "PIX Enviado com Sucesso!",
|
|
17052
|
+
subtitle: "Seu saque foi conclu\xEDdo e o valor j\xE1 est\xE1 na sua conta."
|
|
17053
|
+
}
|
|
17054
|
+
) });
|
|
17055
|
+
};
|
|
17056
|
+
var OfframpFailedSimpleView = () => {
|
|
17057
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "offramp-failed-simple-view", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17058
|
+
EarnFeedbackOverlaySimpleView,
|
|
17059
|
+
{
|
|
17060
|
+
variant: "error",
|
|
17061
|
+
title: "Saque Falhou",
|
|
17062
|
+
subtitle: "Ocorreu um erro ao processar seu saque. Tente novamente."
|
|
17063
|
+
}
|
|
17064
|
+
) });
|
|
17065
|
+
};
|
|
15103
17066
|
var DashboardCard = ({ children, className }) => {
|
|
15104
17067
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "dashboard-card", className: tailwindMerge.twMerge("bg-[var(--deframe-widget-color-bg-subtle)] rounded", className), children });
|
|
15105
17068
|
};
|
|
@@ -16506,6 +18469,8 @@ exports.KYCStatusItemCard = KYCStatusItemCard;
|
|
|
16506
18469
|
exports.KYCStatusPage = KYCStatusPage;
|
|
16507
18470
|
exports.KYCStatusPanel = KYCStatusPanel;
|
|
16508
18471
|
exports.KYCStepIndicator = KYCStepIndicator;
|
|
18472
|
+
exports.KycLoadingView = KycLoadingView;
|
|
18473
|
+
exports.KycRequiredView = KycRequiredView;
|
|
16509
18474
|
exports.Label = Label;
|
|
16510
18475
|
exports.Link = Link;
|
|
16511
18476
|
exports.ListItem = ListItem;
|
|
@@ -16516,6 +18481,14 @@ exports.LoadingDots = LoadingDots;
|
|
|
16516
18481
|
exports.LowRiskBadge = LowRiskBadge;
|
|
16517
18482
|
exports.MediumRiskBadge = MediumRiskBadge;
|
|
16518
18483
|
exports.Navbar = Navbar;
|
|
18484
|
+
exports.OffchainMethodSelectionView = OffchainMethodSelectionView;
|
|
18485
|
+
exports.OfframpFailedSimpleView = OfframpFailedSimpleView;
|
|
18486
|
+
exports.OfframpInputFormSimpleView = OfframpInputFormSimpleView;
|
|
18487
|
+
exports.OfframpInputFormView = OfframpInputFormView;
|
|
18488
|
+
exports.OfframpProcessingSimpleView = OfframpProcessingSimpleView;
|
|
18489
|
+
exports.OfframpProcessingView = OfframpProcessingView;
|
|
18490
|
+
exports.OfframpSuccessSimpleView = OfframpSuccessSimpleView;
|
|
18491
|
+
exports.OfframpSuccessView = OfframpSuccessView;
|
|
16519
18492
|
exports.OnchainDepositFormSimpleView = OnchainDepositFormSimpleView;
|
|
16520
18493
|
exports.OnchainDepositFormView = OnchainDepositFormView;
|
|
16521
18494
|
exports.OnchainDepositSuccessSimpleView = OnchainDepositSuccessSimpleView;
|
|
@@ -16528,6 +18501,11 @@ exports.OnchainWithdrawProcessingSimpleView = OnchainWithdrawProcessingSimpleVie
|
|
|
16528
18501
|
exports.OnchainWithdrawSignatureWarningSimpleView = OnchainWithdrawSignatureWarningSimpleView;
|
|
16529
18502
|
exports.OnchainWithdrawSignatureWarningView = OnchainWithdrawSignatureWarningView;
|
|
16530
18503
|
exports.OnchainWithdrawSuccessView = OnchainWithdrawSuccessView;
|
|
18504
|
+
exports.OnrampFormSimpleView = OnrampFormSimpleView;
|
|
18505
|
+
exports.OnrampFormView = OnrampFormView;
|
|
18506
|
+
exports.OnrampPixcodeView = OnrampPixcodeView;
|
|
18507
|
+
exports.OnrampSuccessSimpleView = OnrampSuccessSimpleView;
|
|
18508
|
+
exports.OnrampSuccessView = OnrampSuccessView;
|
|
16531
18509
|
exports.PercentageButton = PercentageButton;
|
|
16532
18510
|
exports.PrimaryButton = PrimaryButton;
|
|
16533
18511
|
exports.ProcessingBadge = ProcessingBadge;
|