@suportepos/split-checkout 0.3.1 → 0.3.2

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.es.js CHANGED
@@ -2,6 +2,7 @@ import * as React from "react";
2
2
  import React__default, { isValidElement, cloneElement, Children, useState, useEffect, useMemo } from "react";
3
3
  import { Global, ThemeContext as ThemeContext$1, keyframes, css } from "@emotion/react";
4
4
  import emStyled from "@emotion/styled";
5
+ import { CardActions } from "@mui/material";
5
6
  import * as ReactDOM from "react-dom";
6
7
  import ReactDOM__default from "react-dom";
7
8
  function getDefaultExportFromCjs(x) {
@@ -21639,54 +21640,49 @@ const theme = createTheme({
21639
21640
  });
21640
21641
  const BRL$1 = new Intl.NumberFormat("pt-BR", { style: "currency", currency: "BRL" });
21641
21642
  function OrderSummary({ amount, merchantName, sticky, items = [] }) {
21642
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
21643
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
21643
21644
  Card,
21644
21645
  {
21645
21646
  elevation: 0,
21646
21647
  sx: {
21647
- background: "#f9fafb",
21648
21648
  border: `1px solid ${brand.border}`,
21649
21649
  position: "sticky",
21650
21650
  top: 24,
21651
21651
  minWidth: 400,
21652
- // 🔥 largura mínima
21653
- height: "100%"
21652
+ // largura mínima
21653
+ height: "100%",
21654
21654
  // estica até alinhar com o outro card
21655
+ display: "flex",
21656
+ flexDirection: "column"
21655
21657
  },
21656
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { children: [
21657
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "subtitle2", color: "text.secondary", sx: { mb: 1 }, children: merchantName }),
21658
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", color: "text.secondary", sx: { mb: 2 }, children: "Enviou uma solicitação de pagamento" }),
21659
- /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { sx: { mb: 2 } }),
21660
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", color: "text.primary", sx: { mb: 0.5 }, children: "Descrição do produto ou serviço" }),
21661
- items.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Stack, { spacing: 1.2, sx: { mb: 1 }, children: items.map((p, i) => {
21662
- const qty = p.quantity ?? 1;
21663
- const line = p.unitPrice * qty;
21664
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [
21665
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography, { variant: "body2", color: "text.secondary", children: [
21666
- qty > 1 ? `${qty}× ` : "",
21667
- p.name
21668
- ] }),
21669
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", children: BRL$1.format(line) })
21670
- ] }, p.id ?? `${p.name}-${i}`);
21671
- }) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(Stack, { direction: "row", justifyContent: "space-between", sx: { mb: 1 }, children: [
21672
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", color: "text.secondary", children: "(1) Pagamento" }),
21673
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", children: BRL$1.format(amount) })
21674
- ] }),
21675
- /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { sx: { my: 2 } }),
21676
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [
21677
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "h5", sx: { fontWeight: 800 }, children: "Valor total" }),
21678
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "h5", sx: { fontWeight: 800 }, children: BRL$1.format(amount) })
21658
+ children: [
21659
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { sx: { flexGrow: 1 }, children: [
21660
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "subtitle2", color: "text.secondary", sx: { mb: 1 }, children: merchantName }),
21661
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", color: "text.secondary", sx: { mb: 2 }, children: "Enviou uma solicitação de pagamento" }),
21662
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { sx: { mb: 2 } }),
21663
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", color: "text.primary", sx: { mb: 0.5 }, children: "Descrição do produto ou serviço" }),
21664
+ items.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Stack, { spacing: 1.2, sx: { mb: 1 }, children: items.map((p, i) => {
21665
+ const qty = p.quantity ?? 1;
21666
+ const line = p.unitPrice * qty;
21667
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [
21668
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography, { variant: "body2", color: "text.secondary", children: [
21669
+ qty > 1 ? `${qty}× ` : "",
21670
+ p.name
21671
+ ] }),
21672
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", children: BRL$1.format(line) })
21673
+ ] }, p.id ?? `${p.name}-${i}`);
21674
+ }) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(Stack, { direction: "row", justifyContent: "space-between", sx: { mb: 1 }, children: [
21675
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", color: "text.secondary", children: "(1) Pagamento" }),
21676
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", children: BRL$1.format(amount) })
21677
+ ] }),
21678
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { sx: { my: 2 } }),
21679
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [
21680
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "h5", sx: { fontWeight: 800 }, children: "Valor total" }),
21681
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "h5", sx: { fontWeight: 800 }, children: BRL$1.format(amount) })
21682
+ ] })
21679
21683
  ] }),
21680
- /* @__PURE__ */ jsxRuntimeExports.jsx(
21681
- Typography,
21682
- {
21683
- variant: "caption",
21684
- color: "text.secondary",
21685
- sx: { display: "block", mt: 2, textAlign: "center" },
21686
- children: "Desenvolvido por SuportePOS | Pagamento Seguro"
21687
- }
21688
- )
21689
- ] })
21684
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CardActions, { sx: { justifyContent: "center", p: 2 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "caption", color: "text.secondary", children: "Desenvolvido por SuportePOS | Pagamento Seguro" }) })
21685
+ ]
21690
21686
  }
21691
21687
  );
21692
21688
  }
@@ -21960,7 +21956,7 @@ function SplitCheckoutForm({
21960
21956
  };
21961
21957
  window.bpSop_silentOrderPost(options);
21962
21958
  };
21963
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { bgcolor: "background.default", minHeight: "100vh" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Container, { maxWidth: "lg", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { container: true, spacing: 3, children: [
21959
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { bgcolor: "background.default", minHeight: "100vh" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Container, { maxWidth: "lg", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { container: true, spacing: 3, children: [
21964
21960
  /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, xs: 12, md: 7, size: 7, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { elevation: 0, sx: { border: "1px solid #e2e8f0" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { children: [
21965
21961
  /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { display: step === "card" ? "block" : "none" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
21966
21962
  /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "h6", sx: { mb: 2 }, children: "Pagamento com cartão de crédito" }),
@@ -22237,7 +22233,7 @@ function SplitCheckoutForm({
22237
22233
  items: summaryItems
22238
22234
  }
22239
22235
  ) })
22240
- ] }) }) }) });
22236
+ ] }) }) });
22241
22237
  }
22242
22238
  const ContentCopyIcon = createSvgIcon(/* @__PURE__ */ jsxRuntimeExports.jsx("path", {
22243
22239
  d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"
@@ -22348,7 +22344,7 @@ function SplitPixForm({
22348
22344
  } catch {
22349
22345
  }
22350
22346
  };
22351
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { bgcolor: "background.default", minHeight: "100%", py: 0 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Container, { maxWidth: "lg", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { container: true, spacing: 3, children: [
22347
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { bgcolor: "background.default", minHeight: "100%", py: 0 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Container, { maxWidth: "lg", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { container: true, spacing: 3, children: [
22352
22348
  /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, xs: 12, md: 7, size: 7, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { elevation: 0, sx: { border: "1px solid #e2e8f0" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { children: [
22353
22349
  !pixData && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
22354
22350
  /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "h6", sx: { mb: 2 }, children: "Preencha seus dados para gerar o PIX" }),
@@ -22505,7 +22501,7 @@ function SplitPixForm({
22505
22501
  sticky: !isSm
22506
22502
  }
22507
22503
  ) })
22508
- ] }) }) }) });
22504
+ ] }) }) });
22509
22505
  }
22510
22506
  function CheckoutFlowContent({
22511
22507
  step,
@@ -22601,7 +22597,6 @@ function CheckoutFlowContent({
22601
22597
  alignItems: "stretch",
22602
22598
  children: [
22603
22599
  /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, xs: 12, md: 7, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { elevation: 0, sx: {
22604
- background: "#f9fafb",
22605
22600
  border: `1px solid ${brand.border}`,
22606
22601
  position: "sticky",
22607
22602
  top: 24,