@planetaexo/design-system 0.59.1 → 0.60.0
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.cjs +9 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -19
- package/dist/index.d.ts +33 -19
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1050,6 +1050,10 @@ interface ConfirmationAdventure {
|
|
|
1050
1050
|
lineItems?: ConfirmationLineItem[];
|
|
1051
1051
|
subtotal?: string;
|
|
1052
1052
|
travellers?: ConfirmationTraveller[];
|
|
1053
|
+
/** Quartos selecionados para esta aventura (catalogo Accommodation->Room).
|
|
1054
|
+
* Quando presente e nao-vazio, BookingAdventureCard renderiza o bloco
|
|
1055
|
+
* "ACCOMMODATIONS" entre details e prices. */
|
|
1056
|
+
rooms?: AccommodationRoomItem[];
|
|
1053
1057
|
}
|
|
1054
1058
|
interface ConfirmationDepositInfo {
|
|
1055
1059
|
depositPercent: number;
|
|
@@ -2048,6 +2052,23 @@ interface BookingFormProps {
|
|
|
2048
2052
|
}
|
|
2049
2053
|
declare function BookingForm({ defaultValues, onSubmit, submitLabel, loading, showHeader, title, subtitle, className, }: BookingFormProps): react_jsx_runtime.JSX.Element;
|
|
2050
2054
|
|
|
2055
|
+
interface CountryOption {
|
|
2056
|
+
code: string;
|
|
2057
|
+
name: string;
|
|
2058
|
+
}
|
|
2059
|
+
interface CountrySearchFieldProps {
|
|
2060
|
+
value: string;
|
|
2061
|
+
onChange: (code: string) => void;
|
|
2062
|
+
required?: boolean;
|
|
2063
|
+
label?: string;
|
|
2064
|
+
countries?: CountryOption[];
|
|
2065
|
+
placeholder?: string;
|
|
2066
|
+
className?: string;
|
|
2067
|
+
disabled?: boolean;
|
|
2068
|
+
}
|
|
2069
|
+
declare const COUNTRIES: CountryOption[];
|
|
2070
|
+
declare function CountrySearchField({ value, onChange, required, label, countries, placeholder, className, disabled, }: CountrySearchFieldProps): react_jsx_runtime.JSX.Element;
|
|
2071
|
+
|
|
2051
2072
|
type RegistrationFieldType = "text" | "textarea" | "number" | "date" | "birthDate" | "select" | "radio" | "checkbox" | "name" | "phone" | "nationality" | "emergencyContact"
|
|
2052
2073
|
/** Texto longo semântico: a resposta do viajante a "expectativas" da aventura.
|
|
2053
2074
|
* Renderiza como `textarea`; identificado pelo tipo (não por id/label). */
|
|
@@ -2171,11 +2192,16 @@ interface RegistrationFormProps {
|
|
|
2171
2192
|
defaultPhoneCountry?: string;
|
|
2172
2193
|
dateFormatter?: (iso: string | undefined) => string;
|
|
2173
2194
|
labels?: RegistrationFormLabels;
|
|
2195
|
+
/**
|
|
2196
|
+
* Lista localizada para o campo `nationality` (CountrySearchField).
|
|
2197
|
+
* Ausente → COUNTRIES (nomes de país em inglês) — comportamento atual (retrocompat).
|
|
2198
|
+
*/
|
|
2199
|
+
countries?: CountryOption[];
|
|
2174
2200
|
className?: string;
|
|
2175
2201
|
readOnly?: boolean;
|
|
2176
2202
|
}
|
|
2177
2203
|
declare const TERMS_ACCEPT_KEY = "__registrationTermsAccepted";
|
|
2178
|
-
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;
|
|
2204
|
+
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, countries, className, readOnly, }: RegistrationFormProps): react_jsx_runtime.JSX.Element;
|
|
2179
2205
|
interface RegistrationSuccessCardProps {
|
|
2180
2206
|
/**
|
|
2181
2207
|
* `"full"` (default): renders trip info, submitted answers and terms sections.
|
|
@@ -2189,6 +2215,11 @@ interface RegistrationSuccessCardProps {
|
|
|
2189
2215
|
answers?: RegistrationFormValues;
|
|
2190
2216
|
dateFormatter?: (date: Date | string | undefined) => string;
|
|
2191
2217
|
formatAnswer?: (field: RegistrationField, value: RegistrationFieldValue) => string;
|
|
2218
|
+
/**
|
|
2219
|
+
* Lista localizada para resolver `nationality` no defaultFormatAnswer (PDF/readonly summary).
|
|
2220
|
+
* Ausente → COUNTRIES (EN). Ignorado se `formatAnswer` for passado.
|
|
2221
|
+
*/
|
|
2222
|
+
countries?: CountryOption[];
|
|
2192
2223
|
className?: string;
|
|
2193
2224
|
actions?: React.ReactNode;
|
|
2194
2225
|
/** Logo URL displayed above the title. Pass `null` to hide the logo. */
|
|
@@ -2278,7 +2309,7 @@ interface RegistrationSuccessCardProps {
|
|
|
2278
2309
|
*/
|
|
2279
2310
|
termsTypography?: "default" | "compact-serif";
|
|
2280
2311
|
}
|
|
2281
|
-
declare function RegistrationSuccessCard({ variant, title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, logo, logoAlt, showSuccessIcon, terms, termsLayout, termsLabels, adventure, booking, traveller, tripInfoLabels, density, submissionTimestamps, submissionTimestampsLabels, labels: scLabels, sectionsBreakInside, termsTypography, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
2312
|
+
declare function RegistrationSuccessCard({ variant, title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, countries, className, actions, logo, logoAlt, showSuccessIcon, terms, termsLayout, termsLabels, adventure, booking, traveller, tripInfoLabels, density, submissionTimestamps, submissionTimestampsLabels, labels: scLabels, sectionsBreakInside, termsTypography, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
2282
2313
|
|
|
2283
2314
|
interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
2284
2315
|
label: string;
|
|
@@ -2305,23 +2336,6 @@ interface OTPCodeInputProps {
|
|
|
2305
2336
|
}
|
|
2306
2337
|
declare const OTPCodeInput: React.FC<OTPCodeInputProps>;
|
|
2307
2338
|
|
|
2308
|
-
interface CountryOption {
|
|
2309
|
-
code: string;
|
|
2310
|
-
name: string;
|
|
2311
|
-
}
|
|
2312
|
-
interface CountrySearchFieldProps {
|
|
2313
|
-
value: string;
|
|
2314
|
-
onChange: (code: string) => void;
|
|
2315
|
-
required?: boolean;
|
|
2316
|
-
label?: string;
|
|
2317
|
-
countries?: CountryOption[];
|
|
2318
|
-
placeholder?: string;
|
|
2319
|
-
className?: string;
|
|
2320
|
-
disabled?: boolean;
|
|
2321
|
-
}
|
|
2322
|
-
declare const COUNTRIES: CountryOption[];
|
|
2323
|
-
declare function CountrySearchField({ value, onChange, required, label, countries, placeholder, className, disabled, }: CountrySearchFieldProps): react_jsx_runtime.JSX.Element;
|
|
2324
|
-
|
|
2325
2339
|
interface PhoneCountrySelectProps {
|
|
2326
2340
|
value: string;
|
|
2327
2341
|
onChange: (code: string) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1050,6 +1050,10 @@ interface ConfirmationAdventure {
|
|
|
1050
1050
|
lineItems?: ConfirmationLineItem[];
|
|
1051
1051
|
subtotal?: string;
|
|
1052
1052
|
travellers?: ConfirmationTraveller[];
|
|
1053
|
+
/** Quartos selecionados para esta aventura (catalogo Accommodation->Room).
|
|
1054
|
+
* Quando presente e nao-vazio, BookingAdventureCard renderiza o bloco
|
|
1055
|
+
* "ACCOMMODATIONS" entre details e prices. */
|
|
1056
|
+
rooms?: AccommodationRoomItem[];
|
|
1053
1057
|
}
|
|
1054
1058
|
interface ConfirmationDepositInfo {
|
|
1055
1059
|
depositPercent: number;
|
|
@@ -2048,6 +2052,23 @@ interface BookingFormProps {
|
|
|
2048
2052
|
}
|
|
2049
2053
|
declare function BookingForm({ defaultValues, onSubmit, submitLabel, loading, showHeader, title, subtitle, className, }: BookingFormProps): react_jsx_runtime.JSX.Element;
|
|
2050
2054
|
|
|
2055
|
+
interface CountryOption {
|
|
2056
|
+
code: string;
|
|
2057
|
+
name: string;
|
|
2058
|
+
}
|
|
2059
|
+
interface CountrySearchFieldProps {
|
|
2060
|
+
value: string;
|
|
2061
|
+
onChange: (code: string) => void;
|
|
2062
|
+
required?: boolean;
|
|
2063
|
+
label?: string;
|
|
2064
|
+
countries?: CountryOption[];
|
|
2065
|
+
placeholder?: string;
|
|
2066
|
+
className?: string;
|
|
2067
|
+
disabled?: boolean;
|
|
2068
|
+
}
|
|
2069
|
+
declare const COUNTRIES: CountryOption[];
|
|
2070
|
+
declare function CountrySearchField({ value, onChange, required, label, countries, placeholder, className, disabled, }: CountrySearchFieldProps): react_jsx_runtime.JSX.Element;
|
|
2071
|
+
|
|
2051
2072
|
type RegistrationFieldType = "text" | "textarea" | "number" | "date" | "birthDate" | "select" | "radio" | "checkbox" | "name" | "phone" | "nationality" | "emergencyContact"
|
|
2052
2073
|
/** Texto longo semântico: a resposta do viajante a "expectativas" da aventura.
|
|
2053
2074
|
* Renderiza como `textarea`; identificado pelo tipo (não por id/label). */
|
|
@@ -2171,11 +2192,16 @@ interface RegistrationFormProps {
|
|
|
2171
2192
|
defaultPhoneCountry?: string;
|
|
2172
2193
|
dateFormatter?: (iso: string | undefined) => string;
|
|
2173
2194
|
labels?: RegistrationFormLabels;
|
|
2195
|
+
/**
|
|
2196
|
+
* Lista localizada para o campo `nationality` (CountrySearchField).
|
|
2197
|
+
* Ausente → COUNTRIES (nomes de país em inglês) — comportamento atual (retrocompat).
|
|
2198
|
+
*/
|
|
2199
|
+
countries?: CountryOption[];
|
|
2174
2200
|
className?: string;
|
|
2175
2201
|
readOnly?: boolean;
|
|
2176
2202
|
}
|
|
2177
2203
|
declare const TERMS_ACCEPT_KEY = "__registrationTermsAccepted";
|
|
2178
|
-
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;
|
|
2204
|
+
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, countries, className, readOnly, }: RegistrationFormProps): react_jsx_runtime.JSX.Element;
|
|
2179
2205
|
interface RegistrationSuccessCardProps {
|
|
2180
2206
|
/**
|
|
2181
2207
|
* `"full"` (default): renders trip info, submitted answers and terms sections.
|
|
@@ -2189,6 +2215,11 @@ interface RegistrationSuccessCardProps {
|
|
|
2189
2215
|
answers?: RegistrationFormValues;
|
|
2190
2216
|
dateFormatter?: (date: Date | string | undefined) => string;
|
|
2191
2217
|
formatAnswer?: (field: RegistrationField, value: RegistrationFieldValue) => string;
|
|
2218
|
+
/**
|
|
2219
|
+
* Lista localizada para resolver `nationality` no defaultFormatAnswer (PDF/readonly summary).
|
|
2220
|
+
* Ausente → COUNTRIES (EN). Ignorado se `formatAnswer` for passado.
|
|
2221
|
+
*/
|
|
2222
|
+
countries?: CountryOption[];
|
|
2192
2223
|
className?: string;
|
|
2193
2224
|
actions?: React.ReactNode;
|
|
2194
2225
|
/** Logo URL displayed above the title. Pass `null` to hide the logo. */
|
|
@@ -2278,7 +2309,7 @@ interface RegistrationSuccessCardProps {
|
|
|
2278
2309
|
*/
|
|
2279
2310
|
termsTypography?: "default" | "compact-serif";
|
|
2280
2311
|
}
|
|
2281
|
-
declare function RegistrationSuccessCard({ variant, title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, logo, logoAlt, showSuccessIcon, terms, termsLayout, termsLabels, adventure, booking, traveller, tripInfoLabels, density, submissionTimestamps, submissionTimestampsLabels, labels: scLabels, sectionsBreakInside, termsTypography, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
2312
|
+
declare function RegistrationSuccessCard({ variant, title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, countries, className, actions, logo, logoAlt, showSuccessIcon, terms, termsLayout, termsLabels, adventure, booking, traveller, tripInfoLabels, density, submissionTimestamps, submissionTimestampsLabels, labels: scLabels, sectionsBreakInside, termsTypography, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
2282
2313
|
|
|
2283
2314
|
interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
2284
2315
|
label: string;
|
|
@@ -2305,23 +2336,6 @@ interface OTPCodeInputProps {
|
|
|
2305
2336
|
}
|
|
2306
2337
|
declare const OTPCodeInput: React.FC<OTPCodeInputProps>;
|
|
2307
2338
|
|
|
2308
|
-
interface CountryOption {
|
|
2309
|
-
code: string;
|
|
2310
|
-
name: string;
|
|
2311
|
-
}
|
|
2312
|
-
interface CountrySearchFieldProps {
|
|
2313
|
-
value: string;
|
|
2314
|
-
onChange: (code: string) => void;
|
|
2315
|
-
required?: boolean;
|
|
2316
|
-
label?: string;
|
|
2317
|
-
countries?: CountryOption[];
|
|
2318
|
-
placeholder?: string;
|
|
2319
|
-
className?: string;
|
|
2320
|
-
disabled?: boolean;
|
|
2321
|
-
}
|
|
2322
|
-
declare const COUNTRIES: CountryOption[];
|
|
2323
|
-
declare function CountrySearchField({ value, onChange, required, label, countries, placeholder, className, disabled, }: CountrySearchFieldProps): react_jsx_runtime.JSX.Element;
|
|
2324
|
-
|
|
2325
2339
|
interface PhoneCountrySelectProps {
|
|
2326
2340
|
value: string;
|
|
2327
2341
|
onChange: (code: string) => void;
|
package/dist/index.js
CHANGED
|
@@ -5284,6 +5284,7 @@ function BookingPaymentConfirmationEmail({
|
|
|
5284
5284
|
notIncluded: adventure.notIncluded,
|
|
5285
5285
|
lineItems: lineItemsToPass,
|
|
5286
5286
|
subtotal: adventure.subtotal,
|
|
5287
|
+
rooms: adventure.rooms,
|
|
5287
5288
|
labels: {
|
|
5288
5289
|
travellersHeading: l.travellersLabel,
|
|
5289
5290
|
detailsHeading: l.itineraryLabel,
|
|
@@ -8310,6 +8311,7 @@ function FieldRenderer({
|
|
|
8310
8311
|
onChange,
|
|
8311
8312
|
defaultPhoneCountry,
|
|
8312
8313
|
labels,
|
|
8314
|
+
countries,
|
|
8313
8315
|
error,
|
|
8314
8316
|
disabled
|
|
8315
8317
|
}) {
|
|
@@ -8544,6 +8546,7 @@ function FieldRenderer({
|
|
|
8544
8546
|
required: field.required,
|
|
8545
8547
|
value: typeof value === "string" ? value : "",
|
|
8546
8548
|
onChange: (code) => onChange(code),
|
|
8549
|
+
countries,
|
|
8547
8550
|
disabled
|
|
8548
8551
|
}
|
|
8549
8552
|
);
|
|
@@ -8689,6 +8692,7 @@ function RegistrationForm({
|
|
|
8689
8692
|
defaultPhoneCountry = "BR",
|
|
8690
8693
|
dateFormatter,
|
|
8691
8694
|
labels,
|
|
8695
|
+
countries,
|
|
8692
8696
|
className,
|
|
8693
8697
|
readOnly = false
|
|
8694
8698
|
}) {
|
|
@@ -8874,6 +8878,7 @@ function RegistrationForm({
|
|
|
8874
8878
|
onChange: (v) => setField(field.id, v),
|
|
8875
8879
|
defaultPhoneCountry,
|
|
8876
8880
|
labels: L,
|
|
8881
|
+
countries,
|
|
8877
8882
|
error: fieldErrors[field.id],
|
|
8878
8883
|
disabled: readOnly
|
|
8879
8884
|
}
|
|
@@ -9021,7 +9026,7 @@ function phoneCountryDial(code) {
|
|
|
9021
9026
|
var _a, _b;
|
|
9022
9027
|
return (_b = (_a = PHONE_COUNTRIES.find((c) => c.code === code)) == null ? void 0 : _a.dial) != null ? _b : code;
|
|
9023
9028
|
}
|
|
9024
|
-
function defaultFormatAnswer(field, value, fmtDate, yesNoLabels) {
|
|
9029
|
+
function defaultFormatAnswer(field, value, fmtDate, yesNoLabels, countries) {
|
|
9025
9030
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
9026
9031
|
if (value == null || value === "") return "\u2014";
|
|
9027
9032
|
if (value instanceof Date) return fmtDate(value);
|
|
@@ -9050,7 +9055,7 @@ function defaultFormatAnswer(field, value, fmtDate, yesNoLabels) {
|
|
|
9050
9055
|
}
|
|
9051
9056
|
}
|
|
9052
9057
|
if (field.type === "nationality" && typeof value === "string") {
|
|
9053
|
-
return (_d = (_c = COUNTRIES.find((c) => c.code === value)) == null ? void 0 : _c.name) != null ? _d : value;
|
|
9058
|
+
return (_d = (_c = (countries != null ? countries : COUNTRIES).find((c) => c.code === value)) == null ? void 0 : _c.name) != null ? _d : value;
|
|
9054
9059
|
}
|
|
9055
9060
|
if (field.type === "select" && field.options) {
|
|
9056
9061
|
return (_f = (_e = field.options.find((o) => o.value === value)) == null ? void 0 : _e.label) != null ? _f : String(value);
|
|
@@ -9076,6 +9081,7 @@ function RegistrationSuccessCard({
|
|
|
9076
9081
|
answers = {},
|
|
9077
9082
|
dateFormatter = isoOrDateToString,
|
|
9078
9083
|
formatAnswer,
|
|
9084
|
+
countries,
|
|
9079
9085
|
className,
|
|
9080
9086
|
actions,
|
|
9081
9087
|
logo,
|
|
@@ -9185,7 +9191,7 @@ function RegistrationSuccessCard({
|
|
|
9185
9191
|
/* @__PURE__ */ jsx("dd", { className: "w-1/2 text-foreground text-right min-w-0 break-words", children: (formatAnswer != null ? formatAnswer : ((field, v) => defaultFormatAnswer(field, v, dateFormatter, {
|
|
9186
9192
|
yesLabel: scLabels == null ? void 0 : scLabels.yesLabel,
|
|
9187
9193
|
noLabel: scLabels == null ? void 0 : scLabels.noLabel
|
|
9188
|
-
})))(
|
|
9194
|
+
}, countries)))(
|
|
9189
9195
|
f,
|
|
9190
9196
|
answers[f.id]
|
|
9191
9197
|
) })
|