@planetaexo/design-system 0.5.0 → 0.5.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.cjs CHANGED
@@ -4874,106 +4874,117 @@ function RegistrationForm({
4874
4874
  /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: traveller.fullName })
4875
4875
  ] })
4876
4876
  ] }) }),
4877
- /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: L.detailsSectionTitle, children: sortedFields.map((field) => {
4878
- var _a2;
4879
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { id: `rf-${field.id}`, className: "flex flex-col gap-1.5", children: [
4880
- /* @__PURE__ */ jsxRuntime.jsx(
4881
- FieldRenderer,
4882
- {
4883
- field,
4884
- value: current[field.id],
4885
- onChange: (v) => setField(field.id, v),
4886
- defaultPhoneCountry,
4887
- labels: L,
4888
- error: fieldErrors[field.id],
4889
- disabled: readOnly
4890
- }
4891
- ),
4892
- ((_a2 = field.helpText) == null ? void 0 : _a2.trim()) && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground font-ui leading-relaxed", children: field.helpText.trim() })
4893
- ] }, field.id);
4894
- }) }),
4895
- termsEnabled && terms && /* @__PURE__ */ jsxRuntime.jsx("div", { id: "rf-terms", children: /* @__PURE__ */ jsxRuntime.jsxs(FormSection2, { title: L.termsSectionTitle, children: [
4896
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-72 overflow-y-auto rounded-lg border border-border bg-muted/30 p-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "whitespace-pre-wrap text-sm leading-relaxed text-foreground font-ui", children: terms.markdown }) }),
4897
- acceptControl === "checkbox" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5", children: [
4898
- /* @__PURE__ */ jsxRuntime.jsxs(
4899
- "label",
4900
- {
4901
- className: cn(
4902
- "flex cursor-pointer items-start gap-2.5 font-ui text-sm",
4903
- termsError ? "text-destructive" : "text-foreground"
4904
- ),
4905
- children: [
4906
- /* @__PURE__ */ jsxRuntime.jsx(
4907
- "input",
4908
- {
4909
- type: "checkbox",
4910
- checked: termsAccepted,
4911
- required: true,
4912
- disabled: readOnly,
4913
- onChange: (e) => setField(TERMS_ACCEPT_KEY, e.target.checked),
4914
- className: "mt-0.5 h-4 w-4 shrink-0 accent-primary cursor-pointer"
4915
- }
4916
- ),
4917
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
4918
- L.termsAccept,
4919
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
4920
- ] })
4921
- ]
4922
- }
4923
- ),
4924
- termsError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive font-ui", children: L.requiredFieldError })
4925
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5", children: [
4926
- /* @__PURE__ */ jsxRuntime.jsxs(
4927
- "div",
4928
- {
4929
- role: "radiogroup",
4930
- "aria-label": L.termsSectionTitle,
4931
- className: "flex flex-wrap items-center gap-x-6 gap-y-3",
4932
- children: [
4933
- /* @__PURE__ */ jsxRuntime.jsxs(
4934
- "label",
4935
- {
4936
- className: cn(
4937
- "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm",
4938
- termsError ? "text-destructive" : "text-foreground"
4939
- ),
4940
- children: [
4941
- /* @__PURE__ */ jsxRuntime.jsx(
4942
- "input",
4943
- {
4944
- type: "radio",
4945
- name: "registration-terms-accept",
4946
- checked: termsAccepted,
4947
- required: true,
4948
- disabled: readOnly,
4949
- onChange: () => setField(TERMS_ACCEPT_KEY, true),
4950
- className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
4951
- }
4952
- ),
4953
- L.termsAccept,
4954
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
4955
- ]
4956
- }
4877
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
4878
+ readOnly && [
4879
+ "opacity-50 select-none",
4880
+ "[&_input]:cursor-not-allowed",
4881
+ "[&_select]:cursor-not-allowed",
4882
+ "[&_textarea]:cursor-not-allowed",
4883
+ "[&_button]:cursor-not-allowed",
4884
+ "[&_label]:cursor-not-allowed"
4885
+ ].join(" ")
4886
+ ), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(readOnly && "pointer-events-none"), children: [
4887
+ /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: L.detailsSectionTitle, children: sortedFields.map((field) => {
4888
+ var _a2;
4889
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { id: `rf-${field.id}`, className: "flex flex-col gap-1.5", children: [
4890
+ /* @__PURE__ */ jsxRuntime.jsx(
4891
+ FieldRenderer,
4892
+ {
4893
+ field,
4894
+ value: current[field.id],
4895
+ onChange: (v) => setField(field.id, v),
4896
+ defaultPhoneCountry,
4897
+ labels: L,
4898
+ error: fieldErrors[field.id],
4899
+ disabled: readOnly
4900
+ }
4901
+ ),
4902
+ ((_a2 = field.helpText) == null ? void 0 : _a2.trim()) && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground font-ui leading-relaxed", children: field.helpText.trim() })
4903
+ ] }, field.id);
4904
+ }) }),
4905
+ termsEnabled && terms && /* @__PURE__ */ jsxRuntime.jsx("div", { id: "rf-terms", children: /* @__PURE__ */ jsxRuntime.jsxs(FormSection2, { title: L.termsSectionTitle, children: [
4906
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-72 overflow-y-auto rounded-lg border border-border bg-muted/30 p-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "whitespace-pre-wrap text-sm leading-relaxed text-foreground font-ui", children: terms.markdown }) }),
4907
+ acceptControl === "checkbox" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5", children: [
4908
+ /* @__PURE__ */ jsxRuntime.jsxs(
4909
+ "label",
4910
+ {
4911
+ className: cn(
4912
+ "flex cursor-pointer items-start gap-2.5 font-ui text-sm",
4913
+ termsError ? "text-destructive" : "text-foreground"
4957
4914
  ),
4958
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm text-muted-foreground", children: [
4915
+ children: [
4959
4916
  /* @__PURE__ */ jsxRuntime.jsx(
4960
4917
  "input",
4961
4918
  {
4962
- type: "radio",
4963
- name: "registration-terms-accept",
4964
- checked: current[TERMS_ACCEPT_KEY] === false,
4919
+ type: "checkbox",
4920
+ checked: termsAccepted,
4921
+ required: true,
4965
4922
  disabled: readOnly,
4966
- onChange: () => setField(TERMS_ACCEPT_KEY, false),
4967
- className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
4923
+ onChange: (e) => setField(TERMS_ACCEPT_KEY, e.target.checked),
4924
+ className: "mt-0.5 h-4 w-4 shrink-0 accent-primary cursor-pointer"
4968
4925
  }
4969
4926
  ),
4970
- L.termsDecline
4971
- ] })
4972
- ]
4973
- }
4974
- ),
4975
- termsError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive font-ui", children: L.requiredFieldError })
4976
- ] })
4927
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
4928
+ L.termsAccept,
4929
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
4930
+ ] })
4931
+ ]
4932
+ }
4933
+ ),
4934
+ termsError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive font-ui", children: L.requiredFieldError })
4935
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5", children: [
4936
+ /* @__PURE__ */ jsxRuntime.jsxs(
4937
+ "div",
4938
+ {
4939
+ role: "radiogroup",
4940
+ "aria-label": L.termsSectionTitle,
4941
+ className: "flex flex-wrap items-center gap-x-6 gap-y-3",
4942
+ children: [
4943
+ /* @__PURE__ */ jsxRuntime.jsxs(
4944
+ "label",
4945
+ {
4946
+ className: cn(
4947
+ "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm",
4948
+ termsError ? "text-destructive" : "text-foreground"
4949
+ ),
4950
+ children: [
4951
+ /* @__PURE__ */ jsxRuntime.jsx(
4952
+ "input",
4953
+ {
4954
+ type: "radio",
4955
+ name: "registration-terms-accept",
4956
+ checked: termsAccepted,
4957
+ required: true,
4958
+ disabled: readOnly,
4959
+ onChange: () => setField(TERMS_ACCEPT_KEY, true),
4960
+ className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
4961
+ }
4962
+ ),
4963
+ L.termsAccept,
4964
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
4965
+ ]
4966
+ }
4967
+ ),
4968
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm text-muted-foreground", children: [
4969
+ /* @__PURE__ */ jsxRuntime.jsx(
4970
+ "input",
4971
+ {
4972
+ type: "radio",
4973
+ name: "registration-terms-accept",
4974
+ checked: current[TERMS_ACCEPT_KEY] === false,
4975
+ disabled: readOnly,
4976
+ onChange: () => setField(TERMS_ACCEPT_KEY, false),
4977
+ className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
4978
+ }
4979
+ ),
4980
+ L.termsDecline
4981
+ ] })
4982
+ ]
4983
+ }
4984
+ ),
4985
+ termsError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive font-ui", children: L.requiredFieldError })
4986
+ ] })
4987
+ ] }) })
4977
4988
  ] }) }),
4978
4989
  error && /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "text-sm text-destructive font-ui", children: error }),
4979
4990
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center pt-2", children: /* @__PURE__ */ jsxRuntime.jsx(