@planetaexo/design-system 0.91.0 → 0.92.3

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 = {
@@ -13764,6 +13775,8 @@ function SiteHeader({
13764
13775
  const [mobileOpen, setMobileOpen] = React20.useState(false);
13765
13776
  const [openMobileSection, setOpenMobileSection] = React20.useState(null);
13766
13777
  const [activeLang, setActiveLang] = React20.useState(currentLanguage);
13778
+ const [mounted, setMounted] = React20.useState(false);
13779
+ React20.useEffect(() => setMounted(true), []);
13767
13780
  const toggleMobileSection = (label) => setOpenMobileSection((prev) => prev === label ? null : label);
13768
13781
  const menuCloseTimer = React20.useRef(void 0);
13769
13782
  const langCloseTimer = React20.useRef(void 0);
@@ -13968,157 +13981,160 @@ function SiteHeader({
13968
13981
  )
13969
13982
  ] })
13970
13983
  ] }),
13971
- mobileOpen && /* @__PURE__ */ jsxs(
13972
- "div",
13973
- {
13974
- className: cn(
13975
- "fixed inset-0 z-50 lg:hidden flex flex-col",
13976
- variant === "white" ? "bg-white" : "bg-primary-900"
13977
- ),
13978
- children: [
13979
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 h-[72px] shrink-0 border-b border-white/8", children: [
13980
- /* @__PURE__ */ jsx("a", { href: logoHref, className: "shrink-0 flex items-center", onClick: () => setMobileOpen(false), children: /* @__PURE__ */ jsx(
13981
- "img",
13982
- {
13983
- src: resolvedLogo,
13984
- alt: logoAlt,
13985
- className: "h-14 w-auto select-none",
13986
- draggable: false
13987
- }
13988
- ) }),
13989
- /* @__PURE__ */ jsx(
13990
- "button",
13991
- {
13992
- type: "button",
13993
- onClick: () => setMobileOpen(false),
13994
- "aria-label": (_e = labels == null ? void 0 : labels.closeMenu) != null ? _e : "Close menu",
13995
- className: cn(
13996
- "flex h-9 w-9 items-center justify-center rounded-full transition-colors",
13997
- t.mobileTrigger
13998
- ),
13999
- children: /* @__PURE__ */ jsx(XIcon, { className: "h-5 w-5" })
14000
- }
14001
- )
14002
- ] }),
14003
- /* @__PURE__ */ jsx("nav", { className: "flex-1 overflow-y-auto px-6 py-6 flex flex-col gap-1", children: links.map((link) => {
14004
- var _a2, _b2;
14005
- const hasDropdown = !!((_a2 = link.items) == null ? void 0 : _a2.length);
14006
- const isExpanded = openMobileSection === link.label;
14007
- return /* @__PURE__ */ jsxs("div", { children: [
14008
- hasDropdown ? /* @__PURE__ */ jsxs(
14009
- "button",
13984
+ mounted && mobileOpen && createPortal(
13985
+ /* @__PURE__ */ jsxs(
13986
+ "div",
13987
+ {
13988
+ className: cn(
13989
+ "fixed inset-0 z-[1000] lg:hidden flex flex-col",
13990
+ variant === "white" ? "bg-white" : "bg-primary-900"
13991
+ ),
13992
+ children: [
13993
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 h-[72px] shrink-0 border-b border-white/8", children: [
13994
+ /* @__PURE__ */ jsx("a", { href: logoHref, className: "shrink-0 flex items-center", onClick: () => setMobileOpen(false), children: /* @__PURE__ */ jsx(
13995
+ "img",
14010
13996
  {
14011
- type: "button",
14012
- onClick: () => toggleMobileSection(link.label),
14013
- className: cn(
14014
- "flex items-center justify-between w-full py-4 text-xl font-ui font-black transition-colors border-b border-white/8",
14015
- t.mobileLink
14016
- ),
14017
- children: [
14018
- link.label,
14019
- /* @__PURE__ */ jsx(
14020
- ChevronDownIcon,
14021
- {
14022
- className: cn(
14023
- "h-5 w-5 transition-transform duration-200 opacity-40",
14024
- isExpanded && "rotate-180"
14025
- )
14026
- }
14027
- )
14028
- ]
13997
+ src: resolvedLogo,
13998
+ alt: logoAlt,
13999
+ className: "h-14 w-auto select-none",
14000
+ draggable: false
14029
14001
  }
14030
- ) : /* @__PURE__ */ jsx(
14031
- "a",
14002
+ ) }),
14003
+ /* @__PURE__ */ jsx(
14004
+ "button",
14032
14005
  {
14033
- href: (_b2 = link.href) != null ? _b2 : "#",
14006
+ type: "button",
14034
14007
  onClick: () => setMobileOpen(false),
14008
+ "aria-label": (_e = labels == null ? void 0 : labels.closeMenu) != null ? _e : "Close menu",
14035
14009
  className: cn(
14036
- "flex items-center py-4 text-xl font-ui font-black transition-colors border-b border-white/8",
14037
- t.mobileLink
14010
+ "flex h-9 w-9 items-center justify-center rounded-full transition-colors",
14011
+ t.mobileTrigger
14038
14012
  ),
14039
- children: link.label
14013
+ children: /* @__PURE__ */ jsx(XIcon, { className: "h-5 w-5" })
14040
14014
  }
14041
- ),
14042
- hasDropdown && isExpanded && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-0 pl-4 pb-2", children: link.items.map((item) => {
14043
- var _a3;
14044
- return /* @__PURE__ */ jsx(
14015
+ )
14016
+ ] }),
14017
+ /* @__PURE__ */ jsx("nav", { className: "flex-1 overflow-y-auto px-6 py-6 flex flex-col gap-1", children: links.map((link) => {
14018
+ var _a2, _b2;
14019
+ const hasDropdown = !!((_a2 = link.items) == null ? void 0 : _a2.length);
14020
+ const isExpanded = openMobileSection === link.label;
14021
+ return /* @__PURE__ */ jsxs("div", { children: [
14022
+ hasDropdown ? /* @__PURE__ */ jsxs(
14023
+ "button",
14024
+ {
14025
+ type: "button",
14026
+ onClick: () => toggleMobileSection(link.label),
14027
+ className: cn(
14028
+ "flex items-center justify-between w-full py-4 text-xl font-ui font-black transition-colors border-b border-white/8",
14029
+ t.mobileLink
14030
+ ),
14031
+ children: [
14032
+ link.label,
14033
+ /* @__PURE__ */ jsx(
14034
+ ChevronDownIcon,
14035
+ {
14036
+ className: cn(
14037
+ "h-5 w-5 transition-transform duration-200 opacity-40",
14038
+ isExpanded && "rotate-180"
14039
+ )
14040
+ }
14041
+ )
14042
+ ]
14043
+ }
14044
+ ) : /* @__PURE__ */ jsx(
14045
14045
  "a",
14046
14046
  {
14047
- href: (_a3 = item.href) != null ? _a3 : "#",
14047
+ href: (_b2 = link.href) != null ? _b2 : "#",
14048
14048
  onClick: () => setMobileOpen(false),
14049
14049
  className: cn(
14050
- "py-3 text-base font-ui font-bold transition-colors border-b",
14051
- t.mobileSub
14050
+ "flex items-center py-4 text-xl font-ui font-black transition-colors border-b border-white/8",
14051
+ t.mobileLink
14052
14052
  ),
14053
- children: item.label
14054
- },
14055
- item.label
14056
- );
14057
- }) })
14058
- ] }, link.label);
14059
- }) }),
14060
- /* @__PURE__ */ jsxs("div", { className: cn(
14061
- "shrink-0 px-6 py-5 flex items-center justify-between border-t",
14062
- variant === "white" ? "border-border" : "border-white/10"
14063
- ), children: [
14064
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: languages.map((lang, i) => {
14065
- const isActive = lang.code === activeLang;
14066
- return /* @__PURE__ */ jsxs(React20.Fragment, { children: [
14067
- i > 0 && /* @__PURE__ */ jsx("span", { className: cn(
14068
- "text-xs select-none",
14069
- variant === "white" ? "text-border" : "text-white/15"
14070
- ), children: "\xB7" }),
14053
+ children: link.label
14054
+ }
14055
+ ),
14056
+ hasDropdown && isExpanded && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-0 pl-4 pb-2", children: link.items.map((item) => {
14057
+ var _a3;
14058
+ return /* @__PURE__ */ jsx(
14059
+ "a",
14060
+ {
14061
+ href: (_a3 = item.href) != null ? _a3 : "#",
14062
+ onClick: () => setMobileOpen(false),
14063
+ className: cn(
14064
+ "py-3 text-base font-ui font-bold transition-colors border-b",
14065
+ t.mobileSub
14066
+ ),
14067
+ children: item.label
14068
+ },
14069
+ item.label
14070
+ );
14071
+ }) })
14072
+ ] }, link.label);
14073
+ }) }),
14074
+ /* @__PURE__ */ jsxs("div", { className: cn(
14075
+ "shrink-0 px-6 py-5 flex items-center justify-between border-t",
14076
+ variant === "white" ? "border-border" : "border-white/10"
14077
+ ), children: [
14078
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: languages.map((lang, i) => {
14079
+ const isActive = lang.code === activeLang;
14080
+ return /* @__PURE__ */ jsxs(React20.Fragment, { children: [
14081
+ i > 0 && /* @__PURE__ */ jsx("span", { className: cn(
14082
+ "text-xs select-none",
14083
+ variant === "white" ? "text-border" : "text-white/15"
14084
+ ), children: "\xB7" }),
14085
+ /* @__PURE__ */ jsx(
14086
+ "button",
14087
+ {
14088
+ type: "button",
14089
+ onClick: () => handleLangSelect(lang.code),
14090
+ className: cn(
14091
+ "font-ui font-black transition-all duration-150 rounded-full",
14092
+ isActive ? cn(
14093
+ "text-sm px-3 py-1 border",
14094
+ variant === "white" ? "text-primary border-primary bg-primary/8" : "text-primary-400 border-primary-400/50 bg-primary-400/10"
14095
+ ) : cn(
14096
+ "text-xs px-2 py-1",
14097
+ variant === "white" ? "text-muted-foreground hover:text-foreground" : "text-white/35 hover:text-white/70"
14098
+ )
14099
+ ),
14100
+ children: lang.code
14101
+ }
14102
+ )
14103
+ ] }, lang.code);
14104
+ }) }),
14105
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
14071
14106
  /* @__PURE__ */ jsx(
14072
14107
  "button",
14073
14108
  {
14074
14109
  type: "button",
14075
- onClick: () => handleLangSelect(lang.code),
14076
- className: cn(
14077
- "font-ui font-black transition-all duration-150 rounded-full",
14078
- isActive ? cn(
14079
- "text-sm px-3 py-1 border",
14080
- variant === "white" ? "text-primary border-primary bg-primary/8" : "text-primary-400 border-primary-400/50 bg-primary-400/10"
14081
- ) : cn(
14082
- "text-xs px-2 py-1",
14083
- variant === "white" ? "text-muted-foreground hover:text-foreground" : "text-white/35 hover:text-white/70"
14084
- )
14085
- ),
14086
- children: lang.code
14110
+ onClick: () => {
14111
+ onSearch == null ? void 0 : onSearch();
14112
+ setMobileOpen(false);
14113
+ },
14114
+ "aria-label": (_f = labels == null ? void 0 : labels.search) != null ? _f : "Search",
14115
+ className: cn("flex h-9 w-9 items-center justify-center rounded-full transition-colors", t.icon),
14116
+ children: /* @__PURE__ */ jsx(SearchIcon, { className: "h-[18px] w-[18px]" })
14117
+ }
14118
+ ),
14119
+ /* @__PURE__ */ jsx(
14120
+ "button",
14121
+ {
14122
+ type: "button",
14123
+ onClick: () => {
14124
+ onAccount == null ? void 0 : onAccount();
14125
+ setMobileOpen(false);
14126
+ },
14127
+ "aria-label": (_g = labels == null ? void 0 : labels.account) != null ? _g : "Account",
14128
+ className: cn("flex h-9 w-9 items-center justify-center rounded-full transition-colors", t.icon),
14129
+ children: /* @__PURE__ */ jsx(UserIcon, { className: "h-[18px] w-[18px]" })
14087
14130
  }
14088
14131
  )
14089
- ] }, lang.code);
14090
- }) }),
14091
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
14092
- /* @__PURE__ */ jsx(
14093
- "button",
14094
- {
14095
- type: "button",
14096
- onClick: () => {
14097
- onSearch == null ? void 0 : onSearch();
14098
- setMobileOpen(false);
14099
- },
14100
- "aria-label": (_f = labels == null ? void 0 : labels.search) != null ? _f : "Search",
14101
- className: cn("flex h-9 w-9 items-center justify-center rounded-full transition-colors", t.icon),
14102
- children: /* @__PURE__ */ jsx(SearchIcon, { className: "h-[18px] w-[18px]" })
14103
- }
14104
- ),
14105
- /* @__PURE__ */ jsx(
14106
- "button",
14107
- {
14108
- type: "button",
14109
- onClick: () => {
14110
- onAccount == null ? void 0 : onAccount();
14111
- setMobileOpen(false);
14112
- },
14113
- "aria-label": (_g = labels == null ? void 0 : labels.account) != null ? _g : "Account",
14114
- className: cn("flex h-9 w-9 items-center justify-center rounded-full transition-colors", t.icon),
14115
- children: /* @__PURE__ */ jsx(UserIcon, { className: "h-[18px] w-[18px]" })
14116
- }
14117
- )
14132
+ ] })
14118
14133
  ] })
14119
- ] })
14120
- ]
14121
- }
14134
+ ]
14135
+ }
14136
+ ),
14137
+ document.body
14122
14138
  )
14123
14139
  ]
14124
14140
  }
@@ -19907,7 +19923,7 @@ function ExpeditionsRail({ eyebrow, title, subtitle, link, trips }) {
19907
19923
  type: "button",
19908
19924
  onClick: () => scrollByCard(-1),
19909
19925
  "aria-label": "Previous expeditions",
19910
- className: "flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background text-foreground transition-colors hover:border-primary hover:bg-primary hover:text-primary-foreground",
19926
+ className: "hidden h-11 w-11 items-center justify-center rounded-full border border-border bg-background text-foreground transition-colors hover:border-primary hover:bg-primary hover:text-primary-foreground lg:flex",
19911
19927
  children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "h-5 w-5" })
19912
19928
  }
19913
19929
  ),
@@ -19917,7 +19933,7 @@ function ExpeditionsRail({ eyebrow, title, subtitle, link, trips }) {
19917
19933
  type: "button",
19918
19934
  onClick: () => scrollByCard(1),
19919
19935
  "aria-label": "Next expeditions",
19920
- className: "flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background text-foreground transition-colors hover:border-primary hover:bg-primary hover:text-primary-foreground",
19936
+ className: "hidden h-11 w-11 items-center justify-center rounded-full border border-border bg-background text-foreground transition-colors hover:border-primary hover:bg-primary hover:text-primary-foreground lg:flex",
19921
19937
  children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-5 w-5" })
19922
19938
  }
19923
19939
  )