@planetaexo/design-system 0.9.1 → 0.9.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
@@ -727,11 +727,16 @@ interface RegistrationFormProps {
727
727
  declare const TERMS_ACCEPT_KEY = "__registrationTermsAccepted";
728
728
  declare function RegistrationForm({ logo, logoAlt, heroImage, heroImageAlt, title, subtitle, adventure, booking, traveller, fields, values, defaultValues, onChange, onSubmit, onValidate, externalErrors, terms, includeTerms, loading, error, defaultPhoneCountry, dateFormatter, labels, className, readOnly, }: RegistrationFormProps): react_jsx_runtime.JSX.Element;
729
729
  interface RegistrationSuccessCardProps {
730
+ /**
731
+ * `"full"` (default): renders trip info, submitted answers and terms sections.
732
+ * `"minimal"`: renders only logo/icon, title, message and the `actions` slot.
733
+ */
734
+ variant?: "full" | "minimal";
730
735
  title?: string;
731
736
  message?: string;
732
737
  answersTitle?: string;
733
- fields: RegistrationField[];
734
- answers: RegistrationFormValues;
738
+ fields?: RegistrationField[];
739
+ answers?: RegistrationFormValues;
735
740
  dateFormatter?: (date: Date | string | undefined) => string;
736
741
  formatAnswer?: (field: RegistrationField, value: RegistrationFieldValue) => string;
737
742
  className?: string;
@@ -755,7 +760,7 @@ interface RegistrationSuccessCardProps {
755
760
  travellerLabel?: string;
756
761
  };
757
762
  }
758
- declare function RegistrationSuccessCard({ title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, logo, logoAlt, terms, adventure, booking, traveller, tripInfoLabels, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
763
+ declare function RegistrationSuccessCard({ variant, title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, logo, logoAlt, terms, adventure, booking, traveller, tripInfoLabels, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
759
764
 
760
765
  interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
761
766
  label: string;
package/dist/index.d.ts CHANGED
@@ -727,11 +727,16 @@ interface RegistrationFormProps {
727
727
  declare const TERMS_ACCEPT_KEY = "__registrationTermsAccepted";
728
728
  declare function RegistrationForm({ logo, logoAlt, heroImage, heroImageAlt, title, subtitle, adventure, booking, traveller, fields, values, defaultValues, onChange, onSubmit, onValidate, externalErrors, terms, includeTerms, loading, error, defaultPhoneCountry, dateFormatter, labels, className, readOnly, }: RegistrationFormProps): react_jsx_runtime.JSX.Element;
729
729
  interface RegistrationSuccessCardProps {
730
+ /**
731
+ * `"full"` (default): renders trip info, submitted answers and terms sections.
732
+ * `"minimal"`: renders only logo/icon, title, message and the `actions` slot.
733
+ */
734
+ variant?: "full" | "minimal";
730
735
  title?: string;
731
736
  message?: string;
732
737
  answersTitle?: string;
733
- fields: RegistrationField[];
734
- answers: RegistrationFormValues;
738
+ fields?: RegistrationField[];
739
+ answers?: RegistrationFormValues;
735
740
  dateFormatter?: (date: Date | string | undefined) => string;
736
741
  formatAnswer?: (field: RegistrationField, value: RegistrationFieldValue) => string;
737
742
  className?: string;
@@ -755,7 +760,7 @@ interface RegistrationSuccessCardProps {
755
760
  travellerLabel?: string;
756
761
  };
757
762
  }
758
- declare function RegistrationSuccessCard({ title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, logo, logoAlt, terms, adventure, booking, traveller, tripInfoLabels, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
763
+ declare function RegistrationSuccessCard({ variant, title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, logo, logoAlt, terms, adventure, booking, traveller, tripInfoLabels, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
759
764
 
760
765
  interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
761
766
  label: string;
package/dist/index.js CHANGED
@@ -5538,11 +5538,12 @@ function isoOrDateToString(v) {
5538
5538
  return d.toISOString().slice(0, 10);
5539
5539
  }
5540
5540
  function RegistrationSuccessCard({
5541
+ variant = "full",
5541
5542
  title = "Thanks \u2014 your answers have been received.",
5542
5543
  message = "We'll get in touch if anything else is needed.",
5543
5544
  answersTitle = "Your submitted answers",
5544
- fields,
5545
- answers,
5545
+ fields = [],
5546
+ answers = {},
5546
5547
  dateFormatter = isoOrDateToString,
5547
5548
  formatAnswer,
5548
5549
  className,
@@ -5556,11 +5557,12 @@ function RegistrationSuccessCard({
5556
5557
  tripInfoLabels
5557
5558
  }) {
5558
5559
  var _a, _b, _c, _d, _e;
5559
- const sorted = [...fields].sort((a, b) => {
5560
+ const isMinimal = variant === "minimal";
5561
+ const sorted = isMinimal ? [] : [...fields].sort((a, b) => {
5560
5562
  var _a2, _b2;
5561
5563
  return ((_a2 = a.order) != null ? _a2 : 0) - ((_b2 = b.order) != null ? _b2 : 0);
5562
5564
  }).filter((f) => Object.prototype.hasOwnProperty.call(answers, f.id));
5563
- const hasTripInfo = !!(adventure || booking || traveller);
5565
+ const hasTripInfo = !isMinimal && !!(adventure || booking || traveller);
5564
5566
  const dateRange = adventure ? formatDateRange(adventure, dateFormatter) : null;
5565
5567
  const TL = {
5566
5568
  sectionTitle: (_a = tripInfoLabels == null ? void 0 : tripInfoLabels.sectionTitle) != null ? _a : "Trip info",
@@ -5614,7 +5616,7 @@ function RegistrationSuccessCard({
5614
5616
  answers[f.id]
5615
5617
  ) })
5616
5618
  ] }, f.id)) }) }),
5617
- terms && /* @__PURE__ */ jsx(FormSection2, { title: "Terms & Conditions", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm font-ui", children: [
5619
+ !isMinimal && terms && /* @__PURE__ */ jsx(FormSection2, { title: "Terms & Conditions", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm font-ui", children: [
5618
5620
  /* @__PURE__ */ jsx("div", { className: cn(
5619
5621
  "inline-flex h-5 w-5 items-center justify-center rounded-full text-white text-xs font-bold",
5620
5622
  terms.accepted ? "bg-primary" : "bg-destructive"