@planetaexo/design-system 0.59.2 → 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 +8 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -19
- package/dist/index.d.ts +29 -19
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2052,6 +2052,23 @@ interface BookingFormProps {
|
|
|
2052
2052
|
}
|
|
2053
2053
|
declare function BookingForm({ defaultValues, onSubmit, submitLabel, loading, showHeader, title, subtitle, className, }: BookingFormProps): react_jsx_runtime.JSX.Element;
|
|
2054
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
|
+
|
|
2055
2072
|
type RegistrationFieldType = "text" | "textarea" | "number" | "date" | "birthDate" | "select" | "radio" | "checkbox" | "name" | "phone" | "nationality" | "emergencyContact"
|
|
2056
2073
|
/** Texto longo semântico: a resposta do viajante a "expectativas" da aventura.
|
|
2057
2074
|
* Renderiza como `textarea`; identificado pelo tipo (não por id/label). */
|
|
@@ -2175,11 +2192,16 @@ interface RegistrationFormProps {
|
|
|
2175
2192
|
defaultPhoneCountry?: string;
|
|
2176
2193
|
dateFormatter?: (iso: string | undefined) => string;
|
|
2177
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[];
|
|
2178
2200
|
className?: string;
|
|
2179
2201
|
readOnly?: boolean;
|
|
2180
2202
|
}
|
|
2181
2203
|
declare const TERMS_ACCEPT_KEY = "__registrationTermsAccepted";
|
|
2182
|
-
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;
|
|
2183
2205
|
interface RegistrationSuccessCardProps {
|
|
2184
2206
|
/**
|
|
2185
2207
|
* `"full"` (default): renders trip info, submitted answers and terms sections.
|
|
@@ -2193,6 +2215,11 @@ interface RegistrationSuccessCardProps {
|
|
|
2193
2215
|
answers?: RegistrationFormValues;
|
|
2194
2216
|
dateFormatter?: (date: Date | string | undefined) => string;
|
|
2195
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[];
|
|
2196
2223
|
className?: string;
|
|
2197
2224
|
actions?: React.ReactNode;
|
|
2198
2225
|
/** Logo URL displayed above the title. Pass `null` to hide the logo. */
|
|
@@ -2282,7 +2309,7 @@ interface RegistrationSuccessCardProps {
|
|
|
2282
2309
|
*/
|
|
2283
2310
|
termsTypography?: "default" | "compact-serif";
|
|
2284
2311
|
}
|
|
2285
|
-
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;
|
|
2286
2313
|
|
|
2287
2314
|
interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
2288
2315
|
label: string;
|
|
@@ -2309,23 +2336,6 @@ interface OTPCodeInputProps {
|
|
|
2309
2336
|
}
|
|
2310
2337
|
declare const OTPCodeInput: React.FC<OTPCodeInputProps>;
|
|
2311
2338
|
|
|
2312
|
-
interface CountryOption {
|
|
2313
|
-
code: string;
|
|
2314
|
-
name: string;
|
|
2315
|
-
}
|
|
2316
|
-
interface CountrySearchFieldProps {
|
|
2317
|
-
value: string;
|
|
2318
|
-
onChange: (code: string) => void;
|
|
2319
|
-
required?: boolean;
|
|
2320
|
-
label?: string;
|
|
2321
|
-
countries?: CountryOption[];
|
|
2322
|
-
placeholder?: string;
|
|
2323
|
-
className?: string;
|
|
2324
|
-
disabled?: boolean;
|
|
2325
|
-
}
|
|
2326
|
-
declare const COUNTRIES: CountryOption[];
|
|
2327
|
-
declare function CountrySearchField({ value, onChange, required, label, countries, placeholder, className, disabled, }: CountrySearchFieldProps): react_jsx_runtime.JSX.Element;
|
|
2328
|
-
|
|
2329
2339
|
interface PhoneCountrySelectProps {
|
|
2330
2340
|
value: string;
|
|
2331
2341
|
onChange: (code: string) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -2052,6 +2052,23 @@ interface BookingFormProps {
|
|
|
2052
2052
|
}
|
|
2053
2053
|
declare function BookingForm({ defaultValues, onSubmit, submitLabel, loading, showHeader, title, subtitle, className, }: BookingFormProps): react_jsx_runtime.JSX.Element;
|
|
2054
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
|
+
|
|
2055
2072
|
type RegistrationFieldType = "text" | "textarea" | "number" | "date" | "birthDate" | "select" | "radio" | "checkbox" | "name" | "phone" | "nationality" | "emergencyContact"
|
|
2056
2073
|
/** Texto longo semântico: a resposta do viajante a "expectativas" da aventura.
|
|
2057
2074
|
* Renderiza como `textarea`; identificado pelo tipo (não por id/label). */
|
|
@@ -2175,11 +2192,16 @@ interface RegistrationFormProps {
|
|
|
2175
2192
|
defaultPhoneCountry?: string;
|
|
2176
2193
|
dateFormatter?: (iso: string | undefined) => string;
|
|
2177
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[];
|
|
2178
2200
|
className?: string;
|
|
2179
2201
|
readOnly?: boolean;
|
|
2180
2202
|
}
|
|
2181
2203
|
declare const TERMS_ACCEPT_KEY = "__registrationTermsAccepted";
|
|
2182
|
-
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;
|
|
2183
2205
|
interface RegistrationSuccessCardProps {
|
|
2184
2206
|
/**
|
|
2185
2207
|
* `"full"` (default): renders trip info, submitted answers and terms sections.
|
|
@@ -2193,6 +2215,11 @@ interface RegistrationSuccessCardProps {
|
|
|
2193
2215
|
answers?: RegistrationFormValues;
|
|
2194
2216
|
dateFormatter?: (date: Date | string | undefined) => string;
|
|
2195
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[];
|
|
2196
2223
|
className?: string;
|
|
2197
2224
|
actions?: React.ReactNode;
|
|
2198
2225
|
/** Logo URL displayed above the title. Pass `null` to hide the logo. */
|
|
@@ -2282,7 +2309,7 @@ interface RegistrationSuccessCardProps {
|
|
|
2282
2309
|
*/
|
|
2283
2310
|
termsTypography?: "default" | "compact-serif";
|
|
2284
2311
|
}
|
|
2285
|
-
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;
|
|
2286
2313
|
|
|
2287
2314
|
interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
2288
2315
|
label: string;
|
|
@@ -2309,23 +2336,6 @@ interface OTPCodeInputProps {
|
|
|
2309
2336
|
}
|
|
2310
2337
|
declare const OTPCodeInput: React.FC<OTPCodeInputProps>;
|
|
2311
2338
|
|
|
2312
|
-
interface CountryOption {
|
|
2313
|
-
code: string;
|
|
2314
|
-
name: string;
|
|
2315
|
-
}
|
|
2316
|
-
interface CountrySearchFieldProps {
|
|
2317
|
-
value: string;
|
|
2318
|
-
onChange: (code: string) => void;
|
|
2319
|
-
required?: boolean;
|
|
2320
|
-
label?: string;
|
|
2321
|
-
countries?: CountryOption[];
|
|
2322
|
-
placeholder?: string;
|
|
2323
|
-
className?: string;
|
|
2324
|
-
disabled?: boolean;
|
|
2325
|
-
}
|
|
2326
|
-
declare const COUNTRIES: CountryOption[];
|
|
2327
|
-
declare function CountrySearchField({ value, onChange, required, label, countries, placeholder, className, disabled, }: CountrySearchFieldProps): react_jsx_runtime.JSX.Element;
|
|
2328
|
-
|
|
2329
2339
|
interface PhoneCountrySelectProps {
|
|
2330
2340
|
value: string;
|
|
2331
2341
|
onChange: (code: string) => void;
|
package/dist/index.js
CHANGED
|
@@ -8311,6 +8311,7 @@ function FieldRenderer({
|
|
|
8311
8311
|
onChange,
|
|
8312
8312
|
defaultPhoneCountry,
|
|
8313
8313
|
labels,
|
|
8314
|
+
countries,
|
|
8314
8315
|
error,
|
|
8315
8316
|
disabled
|
|
8316
8317
|
}) {
|
|
@@ -8545,6 +8546,7 @@ function FieldRenderer({
|
|
|
8545
8546
|
required: field.required,
|
|
8546
8547
|
value: typeof value === "string" ? value : "",
|
|
8547
8548
|
onChange: (code) => onChange(code),
|
|
8549
|
+
countries,
|
|
8548
8550
|
disabled
|
|
8549
8551
|
}
|
|
8550
8552
|
);
|
|
@@ -8690,6 +8692,7 @@ function RegistrationForm({
|
|
|
8690
8692
|
defaultPhoneCountry = "BR",
|
|
8691
8693
|
dateFormatter,
|
|
8692
8694
|
labels,
|
|
8695
|
+
countries,
|
|
8693
8696
|
className,
|
|
8694
8697
|
readOnly = false
|
|
8695
8698
|
}) {
|
|
@@ -8875,6 +8878,7 @@ function RegistrationForm({
|
|
|
8875
8878
|
onChange: (v) => setField(field.id, v),
|
|
8876
8879
|
defaultPhoneCountry,
|
|
8877
8880
|
labels: L,
|
|
8881
|
+
countries,
|
|
8878
8882
|
error: fieldErrors[field.id],
|
|
8879
8883
|
disabled: readOnly
|
|
8880
8884
|
}
|
|
@@ -9022,7 +9026,7 @@ function phoneCountryDial(code) {
|
|
|
9022
9026
|
var _a, _b;
|
|
9023
9027
|
return (_b = (_a = PHONE_COUNTRIES.find((c) => c.code === code)) == null ? void 0 : _a.dial) != null ? _b : code;
|
|
9024
9028
|
}
|
|
9025
|
-
function defaultFormatAnswer(field, value, fmtDate, yesNoLabels) {
|
|
9029
|
+
function defaultFormatAnswer(field, value, fmtDate, yesNoLabels, countries) {
|
|
9026
9030
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
9027
9031
|
if (value == null || value === "") return "\u2014";
|
|
9028
9032
|
if (value instanceof Date) return fmtDate(value);
|
|
@@ -9051,7 +9055,7 @@ function defaultFormatAnswer(field, value, fmtDate, yesNoLabels) {
|
|
|
9051
9055
|
}
|
|
9052
9056
|
}
|
|
9053
9057
|
if (field.type === "nationality" && typeof value === "string") {
|
|
9054
|
-
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;
|
|
9055
9059
|
}
|
|
9056
9060
|
if (field.type === "select" && field.options) {
|
|
9057
9061
|
return (_f = (_e = field.options.find((o) => o.value === value)) == null ? void 0 : _e.label) != null ? _f : String(value);
|
|
@@ -9077,6 +9081,7 @@ function RegistrationSuccessCard({
|
|
|
9077
9081
|
answers = {},
|
|
9078
9082
|
dateFormatter = isoOrDateToString,
|
|
9079
9083
|
formatAnswer,
|
|
9084
|
+
countries,
|
|
9080
9085
|
className,
|
|
9081
9086
|
actions,
|
|
9082
9087
|
logo,
|
|
@@ -9186,7 +9191,7 @@ function RegistrationSuccessCard({
|
|
|
9186
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, {
|
|
9187
9192
|
yesLabel: scLabels == null ? void 0 : scLabels.yesLabel,
|
|
9188
9193
|
noLabel: scLabels == null ? void 0 : scLabels.noLabel
|
|
9189
|
-
})))(
|
|
9194
|
+
}, countries)))(
|
|
9190
9195
|
f,
|
|
9191
9196
|
answers[f.id]
|
|
9192
9197
|
) })
|