@planetaexo/design-system 0.5.0 → 0.5.1

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.js CHANGED
@@ -4853,106 +4853,108 @@ function RegistrationForm({
4853
4853
  /* @__PURE__ */ jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: traveller.fullName })
4854
4854
  ] })
4855
4855
  ] }) }),
4856
- /* @__PURE__ */ jsx(FormSection2, { title: L.detailsSectionTitle, children: sortedFields.map((field) => {
4857
- var _a2;
4858
- return /* @__PURE__ */ jsxs("div", { id: `rf-${field.id}`, className: "flex flex-col gap-1.5", children: [
4859
- /* @__PURE__ */ jsx(
4860
- FieldRenderer,
4861
- {
4862
- field,
4863
- value: current[field.id],
4864
- onChange: (v) => setField(field.id, v),
4865
- defaultPhoneCountry,
4866
- labels: L,
4867
- error: fieldErrors[field.id],
4868
- disabled: readOnly
4869
- }
4870
- ),
4871
- ((_a2 = field.helpText) == null ? void 0 : _a2.trim()) && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground font-ui leading-relaxed", children: field.helpText.trim() })
4872
- ] }, field.id);
4873
- }) }),
4874
- termsEnabled && terms && /* @__PURE__ */ jsx("div", { id: "rf-terms", children: /* @__PURE__ */ jsxs(FormSection2, { title: L.termsSectionTitle, children: [
4875
- /* @__PURE__ */ jsx("div", { className: "max-h-72 overflow-y-auto rounded-lg border border-border bg-muted/30 p-4", children: /* @__PURE__ */ jsx("div", { className: "whitespace-pre-wrap text-sm leading-relaxed text-foreground font-ui", children: terms.markdown }) }),
4876
- acceptControl === "checkbox" ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
4877
- /* @__PURE__ */ jsxs(
4878
- "label",
4879
- {
4880
- className: cn(
4881
- "flex cursor-pointer items-start gap-2.5 font-ui text-sm",
4882
- termsError ? "text-destructive" : "text-foreground"
4883
- ),
4884
- children: [
4885
- /* @__PURE__ */ jsx(
4886
- "input",
4887
- {
4888
- type: "checkbox",
4889
- checked: termsAccepted,
4890
- required: true,
4891
- disabled: readOnly,
4892
- onChange: (e) => setField(TERMS_ACCEPT_KEY, e.target.checked),
4893
- className: "mt-0.5 h-4 w-4 shrink-0 accent-primary cursor-pointer"
4894
- }
4895
- ),
4896
- /* @__PURE__ */ jsxs("span", { children: [
4897
- L.termsAccept,
4898
- /* @__PURE__ */ jsx("span", { className: "text-primary ml-0.5", children: "*" })
4899
- ] })
4900
- ]
4901
- }
4902
- ),
4903
- termsError && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive font-ui", children: L.requiredFieldError })
4904
- ] }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
4905
- /* @__PURE__ */ jsxs(
4906
- "div",
4907
- {
4908
- role: "radiogroup",
4909
- "aria-label": L.termsSectionTitle,
4910
- className: "flex flex-wrap items-center gap-x-6 gap-y-3",
4911
- children: [
4912
- /* @__PURE__ */ jsxs(
4913
- "label",
4914
- {
4915
- className: cn(
4916
- "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm",
4917
- termsError ? "text-destructive" : "text-foreground"
4918
- ),
4919
- children: [
4920
- /* @__PURE__ */ jsx(
4921
- "input",
4922
- {
4923
- type: "radio",
4924
- name: "registration-terms-accept",
4925
- checked: termsAccepted,
4926
- required: true,
4927
- disabled: readOnly,
4928
- onChange: () => setField(TERMS_ACCEPT_KEY, true),
4929
- className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
4930
- }
4931
- ),
4932
- L.termsAccept,
4933
- /* @__PURE__ */ jsx("span", { className: "text-primary ml-0.5", children: "*" })
4934
- ]
4935
- }
4856
+ /* @__PURE__ */ jsx("div", { className: cn(readOnly && "cursor-not-allowed"), children: /* @__PURE__ */ jsxs("div", { className: cn(readOnly && "pointer-events-none opacity-50 select-none"), children: [
4857
+ /* @__PURE__ */ jsx(FormSection2, { title: L.detailsSectionTitle, children: sortedFields.map((field) => {
4858
+ var _a2;
4859
+ return /* @__PURE__ */ jsxs("div", { id: `rf-${field.id}`, className: "flex flex-col gap-1.5", children: [
4860
+ /* @__PURE__ */ jsx(
4861
+ FieldRenderer,
4862
+ {
4863
+ field,
4864
+ value: current[field.id],
4865
+ onChange: (v) => setField(field.id, v),
4866
+ defaultPhoneCountry,
4867
+ labels: L,
4868
+ error: fieldErrors[field.id],
4869
+ disabled: readOnly
4870
+ }
4871
+ ),
4872
+ ((_a2 = field.helpText) == null ? void 0 : _a2.trim()) && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground font-ui leading-relaxed", children: field.helpText.trim() })
4873
+ ] }, field.id);
4874
+ }) }),
4875
+ termsEnabled && terms && /* @__PURE__ */ jsx("div", { id: "rf-terms", children: /* @__PURE__ */ jsxs(FormSection2, { title: L.termsSectionTitle, children: [
4876
+ /* @__PURE__ */ jsx("div", { className: "max-h-72 overflow-y-auto rounded-lg border border-border bg-muted/30 p-4", children: /* @__PURE__ */ jsx("div", { className: "whitespace-pre-wrap text-sm leading-relaxed text-foreground font-ui", children: terms.markdown }) }),
4877
+ acceptControl === "checkbox" ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
4878
+ /* @__PURE__ */ jsxs(
4879
+ "label",
4880
+ {
4881
+ className: cn(
4882
+ "flex cursor-pointer items-start gap-2.5 font-ui text-sm",
4883
+ termsError ? "text-destructive" : "text-foreground"
4936
4884
  ),
4937
- /* @__PURE__ */ jsxs("label", { className: "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm text-muted-foreground", children: [
4885
+ children: [
4938
4886
  /* @__PURE__ */ jsx(
4939
4887
  "input",
4940
4888
  {
4941
- type: "radio",
4942
- name: "registration-terms-accept",
4943
- checked: current[TERMS_ACCEPT_KEY] === false,
4889
+ type: "checkbox",
4890
+ checked: termsAccepted,
4891
+ required: true,
4944
4892
  disabled: readOnly,
4945
- onChange: () => setField(TERMS_ACCEPT_KEY, false),
4946
- className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
4893
+ onChange: (e) => setField(TERMS_ACCEPT_KEY, e.target.checked),
4894
+ className: "mt-0.5 h-4 w-4 shrink-0 accent-primary cursor-pointer"
4947
4895
  }
4948
4896
  ),
4949
- L.termsDecline
4950
- ] })
4951
- ]
4952
- }
4953
- ),
4954
- termsError && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive font-ui", children: L.requiredFieldError })
4955
- ] })
4897
+ /* @__PURE__ */ jsxs("span", { children: [
4898
+ L.termsAccept,
4899
+ /* @__PURE__ */ jsx("span", { className: "text-primary ml-0.5", children: "*" })
4900
+ ] })
4901
+ ]
4902
+ }
4903
+ ),
4904
+ termsError && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive font-ui", children: L.requiredFieldError })
4905
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
4906
+ /* @__PURE__ */ jsxs(
4907
+ "div",
4908
+ {
4909
+ role: "radiogroup",
4910
+ "aria-label": L.termsSectionTitle,
4911
+ className: "flex flex-wrap items-center gap-x-6 gap-y-3",
4912
+ children: [
4913
+ /* @__PURE__ */ jsxs(
4914
+ "label",
4915
+ {
4916
+ className: cn(
4917
+ "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm",
4918
+ termsError ? "text-destructive" : "text-foreground"
4919
+ ),
4920
+ children: [
4921
+ /* @__PURE__ */ jsx(
4922
+ "input",
4923
+ {
4924
+ type: "radio",
4925
+ name: "registration-terms-accept",
4926
+ checked: termsAccepted,
4927
+ required: true,
4928
+ disabled: readOnly,
4929
+ onChange: () => setField(TERMS_ACCEPT_KEY, true),
4930
+ className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
4931
+ }
4932
+ ),
4933
+ L.termsAccept,
4934
+ /* @__PURE__ */ jsx("span", { className: "text-primary ml-0.5", children: "*" })
4935
+ ]
4936
+ }
4937
+ ),
4938
+ /* @__PURE__ */ jsxs("label", { className: "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm text-muted-foreground", children: [
4939
+ /* @__PURE__ */ jsx(
4940
+ "input",
4941
+ {
4942
+ type: "radio",
4943
+ name: "registration-terms-accept",
4944
+ checked: current[TERMS_ACCEPT_KEY] === false,
4945
+ disabled: readOnly,
4946
+ onChange: () => setField(TERMS_ACCEPT_KEY, false),
4947
+ className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
4948
+ }
4949
+ ),
4950
+ L.termsDecline
4951
+ ] })
4952
+ ]
4953
+ }
4954
+ ),
4955
+ termsError && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive font-ui", children: L.requiredFieldError })
4956
+ ] })
4957
+ ] }) })
4956
4958
  ] }) }),
4957
4959
  error && /* @__PURE__ */ jsx("p", { role: "alert", className: "text-sm text-destructive font-ui", children: error }),
4958
4960
  !readOnly && /* @__PURE__ */ jsx("div", { className: "flex justify-center pt-2", children: /* @__PURE__ */ jsx(