@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.cjs
CHANGED
|
@@ -8332,6 +8332,7 @@ function FieldRenderer({
|
|
|
8332
8332
|
onChange,
|
|
8333
8333
|
defaultPhoneCountry,
|
|
8334
8334
|
labels,
|
|
8335
|
+
countries,
|
|
8335
8336
|
error,
|
|
8336
8337
|
disabled
|
|
8337
8338
|
}) {
|
|
@@ -8566,6 +8567,7 @@ function FieldRenderer({
|
|
|
8566
8567
|
required: field.required,
|
|
8567
8568
|
value: typeof value === "string" ? value : "",
|
|
8568
8569
|
onChange: (code) => onChange(code),
|
|
8570
|
+
countries,
|
|
8569
8571
|
disabled
|
|
8570
8572
|
}
|
|
8571
8573
|
);
|
|
@@ -8711,6 +8713,7 @@ function RegistrationForm({
|
|
|
8711
8713
|
defaultPhoneCountry = "BR",
|
|
8712
8714
|
dateFormatter,
|
|
8713
8715
|
labels,
|
|
8716
|
+
countries,
|
|
8714
8717
|
className,
|
|
8715
8718
|
readOnly = false
|
|
8716
8719
|
}) {
|
|
@@ -8896,6 +8899,7 @@ function RegistrationForm({
|
|
|
8896
8899
|
onChange: (v) => setField(field.id, v),
|
|
8897
8900
|
defaultPhoneCountry,
|
|
8898
8901
|
labels: L,
|
|
8902
|
+
countries,
|
|
8899
8903
|
error: fieldErrors[field.id],
|
|
8900
8904
|
disabled: readOnly
|
|
8901
8905
|
}
|
|
@@ -9043,7 +9047,7 @@ function phoneCountryDial(code) {
|
|
|
9043
9047
|
var _a, _b;
|
|
9044
9048
|
return (_b = (_a = PHONE_COUNTRIES.find((c) => c.code === code)) == null ? void 0 : _a.dial) != null ? _b : code;
|
|
9045
9049
|
}
|
|
9046
|
-
function defaultFormatAnswer(field, value, fmtDate, yesNoLabels) {
|
|
9050
|
+
function defaultFormatAnswer(field, value, fmtDate, yesNoLabels, countries) {
|
|
9047
9051
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
9048
9052
|
if (value == null || value === "") return "\u2014";
|
|
9049
9053
|
if (value instanceof Date) return fmtDate(value);
|
|
@@ -9072,7 +9076,7 @@ function defaultFormatAnswer(field, value, fmtDate, yesNoLabels) {
|
|
|
9072
9076
|
}
|
|
9073
9077
|
}
|
|
9074
9078
|
if (field.type === "nationality" && typeof value === "string") {
|
|
9075
|
-
return (_d = (_c = COUNTRIES.find((c) => c.code === value)) == null ? void 0 : _c.name) != null ? _d : value;
|
|
9079
|
+
return (_d = (_c = (countries != null ? countries : COUNTRIES).find((c) => c.code === value)) == null ? void 0 : _c.name) != null ? _d : value;
|
|
9076
9080
|
}
|
|
9077
9081
|
if (field.type === "select" && field.options) {
|
|
9078
9082
|
return (_f = (_e = field.options.find((o) => o.value === value)) == null ? void 0 : _e.label) != null ? _f : String(value);
|
|
@@ -9098,6 +9102,7 @@ function RegistrationSuccessCard({
|
|
|
9098
9102
|
answers = {},
|
|
9099
9103
|
dateFormatter = isoOrDateToString,
|
|
9100
9104
|
formatAnswer,
|
|
9105
|
+
countries,
|
|
9101
9106
|
className,
|
|
9102
9107
|
actions,
|
|
9103
9108
|
logo,
|
|
@@ -9207,7 +9212,7 @@ function RegistrationSuccessCard({
|
|
|
9207
9212
|
/* @__PURE__ */ jsxRuntime.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, {
|
|
9208
9213
|
yesLabel: scLabels == null ? void 0 : scLabels.yesLabel,
|
|
9209
9214
|
noLabel: scLabels == null ? void 0 : scLabels.noLabel
|
|
9210
|
-
})))(
|
|
9215
|
+
}, countries)))(
|
|
9211
9216
|
f,
|
|
9212
9217
|
answers[f.id]
|
|
9213
9218
|
) })
|