@planetaexo/design-system 0.89.0 → 0.92.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.d.cts CHANGED
@@ -517,13 +517,27 @@ interface PaymentAmountSelectorProps {
517
517
  fullLabel: string;
518
518
  value: "deposit" | "full";
519
519
  onChange: (value: "deposit" | "full") => void;
520
+ /**
521
+ * Quando true, o seletor fica ESMAECIDO e não-clicável (escolha já travada — ex.:
522
+ * após a 1ª parcela do sinal no checkout dividido). Mantém AMBAS as opções visíveis,
523
+ * com a selecionada destacada, em vez de ocultar a opção não escolhida.
524
+ */
525
+ disabled?: boolean;
520
526
  }
521
- declare function PaymentAmountSelector({ title, depositLabel, fullLabel, value, onChange, }: PaymentAmountSelectorProps): react_jsx_runtime.JSX.Element;
527
+ declare function PaymentAmountSelector({ title, depositLabel, fullLabel, value, onChange, disabled, }: PaymentAmountSelectorProps): react_jsx_runtime.JSX.Element;
522
528
  interface PaymentMethodOption {
523
529
  id: string;
524
530
  label: string;
525
531
  description?: string;
526
532
  disabled?: boolean;
533
+ /**
534
+ * Conteúdo renderizado QUANDO este método está selecionado (`value === id`),
535
+ * no RODAPÉ do bloco "Forma de pagamento" — abaixo de TODAS as opções, não
536
+ * entre elas. Use para detalhes específicos do método selecionado — ex.: o
537
+ * campo de valor da parcela "neste cartão" no checkout dividido. Renderizado
538
+ * FORA do `<button>` (não aninhar controles interativos dentro de um button).
539
+ */
540
+ expandedContent?: React.ReactNode;
527
541
  }
528
542
  interface PaymentMethodSelectorProps {
529
543
  title?: string;
package/dist/index.d.ts CHANGED
@@ -517,13 +517,27 @@ interface PaymentAmountSelectorProps {
517
517
  fullLabel: string;
518
518
  value: "deposit" | "full";
519
519
  onChange: (value: "deposit" | "full") => void;
520
+ /**
521
+ * Quando true, o seletor fica ESMAECIDO e não-clicável (escolha já travada — ex.:
522
+ * após a 1ª parcela do sinal no checkout dividido). Mantém AMBAS as opções visíveis,
523
+ * com a selecionada destacada, em vez de ocultar a opção não escolhida.
524
+ */
525
+ disabled?: boolean;
520
526
  }
521
- declare function PaymentAmountSelector({ title, depositLabel, fullLabel, value, onChange, }: PaymentAmountSelectorProps): react_jsx_runtime.JSX.Element;
527
+ declare function PaymentAmountSelector({ title, depositLabel, fullLabel, value, onChange, disabled, }: PaymentAmountSelectorProps): react_jsx_runtime.JSX.Element;
522
528
  interface PaymentMethodOption {
523
529
  id: string;
524
530
  label: string;
525
531
  description?: string;
526
532
  disabled?: boolean;
533
+ /**
534
+ * Conteúdo renderizado QUANDO este método está selecionado (`value === id`),
535
+ * no RODAPÉ do bloco "Forma de pagamento" — abaixo de TODAS as opções, não
536
+ * entre elas. Use para detalhes específicos do método selecionado — ex.: o
537
+ * campo de valor da parcela "neste cartão" no checkout dividido. Renderizado
538
+ * FORA do `<button>` (não aninhar controles interativos dentro de um button).
539
+ */
540
+ expandedContent?: React.ReactNode;
527
541
  }
528
542
  interface PaymentMethodSelectorProps {
529
543
  title?: string;
package/dist/index.js CHANGED
@@ -1846,18 +1846,25 @@ function PaymentAmountSelector({
1846
1846
  depositLabel,
1847
1847
  fullLabel,
1848
1848
  value,
1849
- onChange
1849
+ onChange,
1850
+ disabled = false
1850
1851
  }) {
1851
1852
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1852
1853
  /* @__PURE__ */ jsx("p", { className: "text-sm font-bold text-foreground font-heading", children: title }),
1853
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-2", children: ["deposit", "full"].map((opt) => /* @__PURE__ */ jsx(
1854
+ /* @__PURE__ */ jsx("div", { className: cn("grid grid-cols-1 sm:grid-cols-2 gap-2", disabled && "opacity-60"), children: ["deposit", "full"].map((opt) => /* @__PURE__ */ jsx(
1854
1855
  "button",
1855
1856
  {
1856
1857
  type: "button",
1857
- onClick: () => onChange(opt),
1858
+ disabled,
1859
+ "aria-disabled": disabled,
1860
+ onClick: () => !disabled && onChange(opt),
1858
1861
  className: cn(
1859
1862
  "rounded-lg border-2 px-4 py-3 text-sm text-left font-sans transition-colors",
1860
- value === opt ? "border-primary bg-primary/5 text-foreground font-semibold" : "border-border bg-background text-muted-foreground hover:border-primary/40"
1863
+ disabled && "cursor-not-allowed",
1864
+ value === opt ? "border-primary bg-primary/5 text-foreground font-semibold" : cn(
1865
+ "border-border bg-background text-muted-foreground",
1866
+ !disabled && "hover:border-primary/40"
1867
+ )
1861
1868
  ),
1862
1869
  children: opt === "deposit" ? depositLabel : fullLabel
1863
1870
  },
@@ -1911,7 +1918,11 @@ function PaymentMethodSelector({
1911
1918
  ]
1912
1919
  },
1913
1920
  m.id
1914
- )) })
1921
+ )) }),
1922
+ (() => {
1923
+ const selected = methods.find((m) => m.id === value);
1924
+ return (selected == null ? void 0 : selected.expandedContent) ? /* @__PURE__ */ jsx("div", { children: selected.expandedContent }) : null;
1925
+ })()
1915
1926
  ] });
1916
1927
  }
1917
1928
  var TERMS_I18N = {
@@ -14419,7 +14430,8 @@ function TripCardEditorial(props) {
14419
14430
  {
14420
14431
  href,
14421
14432
  "aria-label": title,
14422
- className: "absolute inset-0 z-[1] rounded-2xl focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
14433
+ className: "absolute inset-0 z-[1] rounded-2xl focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
14434
+ children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: title })
14423
14435
  }
14424
14436
  )
14425
14437
  ] });
@@ -18725,7 +18737,8 @@ function HomeHeader({
18725
18737
  target: "_blank",
18726
18738
  rel: "noopener noreferrer",
18727
18739
  "aria-label": "Read our reviews on Trustpilot",
18728
- className: "absolute inset-0 z-10"
18740
+ className: "absolute inset-0 z-10",
18741
+ children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Read our reviews on Trustpilot" })
18729
18742
  }
18730
18743
  )
18731
18744
  ]