formica-ui-lib 1.0.340 → 1.0.341

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
@@ -9636,28 +9636,43 @@ var Zo = ({ id: e, name: t, type: n = "text", value: r = "", placeholder: i = ""
9636
9636
  }) : null
9637
9637
  ]
9638
9638
  });
9639
- }, $ = ({ id: e, label: t, errorMessage: n, hasError: r = !1, linkText: i, linkHref: a, onLinkClick: o, ...s }) => /* @__PURE__ */ u("div", {
9640
- className: "flex w-full flex-col gap-2",
9641
- children: [t || i ? /* @__PURE__ */ u("div", {
9642
- className: "flex items-center justify-between gap-4",
9643
- children: [t ? /* @__PURE__ */ u(v, {
9644
- as: "label",
9645
- htmlFor: e,
9646
- className: `text-sm ${r ? "text-accent!" : "text-primary"}`,
9647
- children: [r ? null : `${t}`, r && n ? `${n}` : null]
9648
- }) : /* @__PURE__ */ l("span", {}), i ? /* @__PURE__ */ l(v, {
9649
- as: "a",
9650
- href: a || "#",
9651
- onClick: o,
9652
- className: "text-xs text-secondaryActive underline underline-offset-2",
9653
- children: i
9654
- }) : null]
9655
- }) : null, /* @__PURE__ */ l(Zo, {
9656
- id: e,
9657
- hasError: r,
9658
- ...s
9659
- })]
9660
- }), zl = ({ title: e = "Personal & Project Information", idPrefix: t = "salesforce-customer", firstName: n = "", lastName: r = "", profession: i = "", companyName: a = "", projectType: o = "", projectSquareMetres: s = "", projectName: c = "", projectDetails: d = "", phoneNumber: f = "", email: p = "", confirmEmail: m = "", firstNamePlaceholder: h = "First Name*", lastNamePlaceholder: g = "Last Name*", professionPlaceholder: _ = "Profession*", companyNamePlaceholder: y = "Company Name*", projectTypePlaceholder: b = "Project Type", projectSquareMetresPlaceholder: x = "Project Square Metres", projectNamePlaceholder: S = "Project Name", projectDetailsPlaceholder: C = "Project Details", phoneNumberPlaceholder: w = "Phone Number*", emailPlaceholder: T = "Email*", confirmEmailPlaceholder: E = "Confirm Email*", professionOptions: D = [], projectTypeOptions: O = [], projectSquareMetresOptions: k = [], errors: A = {}, onFirstNameChange: j, onLastNameChange: M, onProfessionChange: N, onCompanyNameChange: P, onProjectTypeChange: F, onProjectSquareMetresChange: I, onProjectNameChange: L, onProjectDetailsChange: R, onPhoneNumberChange: z, onEmailChange: B, onConfirmEmailChange: V }) => /* @__PURE__ */ u("section", {
9639
+ }, $ = ({ id: e, label: t, errorMessage: n, hasError: i = !1, linkText: a, linkHref: o, onLinkClick: s, ariaDescribedBy: c, ...d }) => {
9640
+ let f = r(), p = i && !!n, m = `${e || f}-field-error`, h = [c, p ? m : void 0].filter(Boolean).join(" ") || void 0;
9641
+ return /* @__PURE__ */ u("div", {
9642
+ className: "flex w-full flex-col gap-2",
9643
+ children: [
9644
+ t || a ? /* @__PURE__ */ u("div", {
9645
+ className: "flex items-center justify-between gap-4",
9646
+ children: [t ? /* @__PURE__ */ l(v, {
9647
+ as: "label",
9648
+ htmlFor: e,
9649
+ id: p ? m : void 0,
9650
+ className: `text-sm ${i ? "text-accent!" : "text-primary"}`,
9651
+ children: p ? n : t
9652
+ }) : /* @__PURE__ */ l("span", {}), a ? /* @__PURE__ */ l(v, {
9653
+ as: "a",
9654
+ href: o || "#",
9655
+ onClick: s,
9656
+ className: "text-xs text-secondaryActive underline underline-offset-2",
9657
+ children: a
9658
+ }) : null]
9659
+ }) : null,
9660
+ /* @__PURE__ */ l(Zo, {
9661
+ id: e,
9662
+ hasError: i,
9663
+ ...d,
9664
+ ariaDescribedBy: h
9665
+ }),
9666
+ !t && p ? /* @__PURE__ */ l(v, {
9667
+ id: m,
9668
+ role: "alert",
9669
+ variant: "free",
9670
+ className: "text-sm text-accent",
9671
+ children: n
9672
+ }) : null
9673
+ ]
9674
+ });
9675
+ }, zl = ({ title: e = "Personal & Project Information", idPrefix: t = "salesforce-customer", firstName: n = "", lastName: r = "", profession: i = "", companyName: a = "", projectType: o = "", projectSquareMetres: s = "", projectName: c = "", projectDetails: d = "", phoneNumber: f = "", email: p = "", confirmEmail: m = "", firstNamePlaceholder: h = "First Name*", lastNamePlaceholder: g = "Last Name*", professionPlaceholder: _ = "Profession*", companyNamePlaceholder: y = "Company Name*", projectTypePlaceholder: b = "Project Type", projectSquareMetresPlaceholder: x = "Project Square Metres", projectNamePlaceholder: S = "Project Name", projectDetailsPlaceholder: C = "Project Details", phoneNumberPlaceholder: w = "Phone Number*", emailPlaceholder: T = "Email*", confirmEmailPlaceholder: E = "Confirm Email*", professionOptions: D = [], projectTypeOptions: O = [], projectSquareMetresOptions: k = [], errors: A = {}, onFirstNameChange: j, onLastNameChange: M, onProfessionChange: N, onCompanyNameChange: P, onProjectTypeChange: F, onProjectSquareMetresChange: I, onProjectNameChange: L, onProjectDetailsChange: R, onPhoneNumberChange: z, onEmailChange: B, onConfirmEmailChange: V }) => /* @__PURE__ */ u("section", {
9661
9676
  className: "flex flex-col gap-6",
9662
9677
  children: [/* @__PURE__ */ l(v, {
9663
9678
  as: "h2",
@@ -13792,60 +13807,69 @@ var ld = (e, t = [], n = null) => t.map((t) => e[t]).filter((e) => !!e).map((e)
13792
13807
  })
13793
13808
  ]
13794
13809
  });
13795
- }, ef = ({ paymentTypeTitle: e = "Select Payment Type", paymentTypeSelectorProps: t, cardNumber: n = "", expirationDate: r = "", securityCode: i = "", errors: a = {}, onCardNumberChange: o, onExpirationDateChange: s, onSecurityCodeChange: c, onCardNumberBlur: d, onExpirationDateBlur: f, onSecurityCodeBlur: p }) => /* @__PURE__ */ u("section", {
13810
+ }, ef = ({ paymentTypeTitle: e = "Select Payment Type", paymentTypeSelectorProps: t, cardNumber: n = "", expirationDate: r = "", securityCode: i = "", errors: a = {}, submitError: o, onCardNumberChange: s, onExpirationDateChange: c, onSecurityCodeChange: d, onCardNumberBlur: f, onExpirationDateBlur: p, onSecurityCodeBlur: m }) => /* @__PURE__ */ u("section", {
13796
13811
  className: "flex w-full flex-col gap-6",
13797
- children: [/* @__PURE__ */ u("div", {
13798
- className: "flex flex-col gap-3",
13799
- children: [/* @__PURE__ */ l(v, {
13800
- as: "h2",
13801
- variant: "bold",
13802
- className: "text-primary",
13803
- children: e
13804
- }), /* @__PURE__ */ l(qd, { ...t })]
13805
- }), /* @__PURE__ */ u("div", {
13806
- className: "mt-10 flex flex-col gap-4",
13807
- children: [/* @__PURE__ */ l($, {
13808
- id: "payment-card-number",
13809
- name: "cardNumber",
13810
- placeholder: "Card Number",
13811
- ariaLabel: "Card number",
13812
- mask: "cardNumber",
13813
- autoComplete: "cc-number",
13814
- value: n,
13815
- hasError: !!a.cardNumber,
13816
- errorMessage: a.cardNumber,
13817
- onChange: o,
13818
- onBlur: d
13819
- }), /* @__PURE__ */ u("div", {
13820
- className: "grid grid-cols-2 gap-4",
13812
+ children: [
13813
+ /* @__PURE__ */ u("div", {
13814
+ className: "flex flex-col gap-3",
13815
+ children: [/* @__PURE__ */ l(v, {
13816
+ as: "h2",
13817
+ variant: "bold",
13818
+ className: "text-primary",
13819
+ children: e
13820
+ }), /* @__PURE__ */ l(qd, { ...t })]
13821
+ }),
13822
+ /* @__PURE__ */ u("div", {
13823
+ className: "mt-10 flex flex-col gap-4",
13821
13824
  children: [/* @__PURE__ */ l($, {
13822
- id: "payment-expiration-date",
13823
- name: "expirationDate",
13824
- placeholder: "MM/YY",
13825
- ariaLabel: "Expiration date (MM/YY)",
13826
- mask: "expirationDate",
13827
- autoComplete: "cc-exp",
13828
- value: r,
13829
- hasError: !!a.expirationDate,
13830
- errorMessage: a.expirationDate,
13825
+ id: "payment-card-number",
13826
+ name: "cardNumber",
13827
+ placeholder: "Card Number",
13828
+ ariaLabel: "Card number",
13829
+ mask: "cardNumber",
13830
+ autoComplete: "cc-number",
13831
+ value: n,
13832
+ hasError: !!a.cardNumber,
13833
+ errorMessage: a.cardNumber,
13831
13834
  onChange: s,
13832
13835
  onBlur: f
13833
- }), /* @__PURE__ */ l($, {
13834
- id: "payment-security-code",
13835
- name: "securityCode",
13836
- placeholder: "CVC",
13837
- ariaLabel: "Security code (3 or 4 digits)",
13838
- mask: "digits",
13839
- maxDigits: 4,
13840
- autoComplete: "cc-csc",
13841
- value: i,
13842
- hasError: !!a.securityCode,
13843
- errorMessage: a.securityCode,
13844
- onChange: c,
13845
- onBlur: p
13836
+ }), /* @__PURE__ */ u("div", {
13837
+ className: "grid grid-cols-2 gap-4",
13838
+ children: [/* @__PURE__ */ l($, {
13839
+ id: "payment-expiration-date",
13840
+ name: "expirationDate",
13841
+ placeholder: "MM/YY",
13842
+ ariaLabel: "Expiration date (MM/YY)",
13843
+ mask: "expirationDate",
13844
+ autoComplete: "cc-exp",
13845
+ value: r,
13846
+ hasError: !!a.expirationDate,
13847
+ errorMessage: a.expirationDate,
13848
+ onChange: c,
13849
+ onBlur: p
13850
+ }), /* @__PURE__ */ l($, {
13851
+ id: "payment-security-code",
13852
+ name: "securityCode",
13853
+ placeholder: "CVC",
13854
+ ariaLabel: "Security code (3 or 4 digits)",
13855
+ mask: "digits",
13856
+ maxDigits: 4,
13857
+ autoComplete: "cc-csc",
13858
+ value: i,
13859
+ hasError: !!a.securityCode,
13860
+ errorMessage: a.securityCode,
13861
+ onChange: d,
13862
+ onBlur: m
13863
+ })]
13846
13864
  })]
13847
- })]
13848
- })]
13865
+ }),
13866
+ o ? /* @__PURE__ */ l(v, {
13867
+ role: "alert",
13868
+ variant: "free",
13869
+ className: "rounded-md border border-accent bg-accent/10 p-4 text-sm text-accent",
13870
+ children: o
13871
+ }) : null
13872
+ ]
13849
13873
  }), tf = ({ requiresPayment: e = !0, shippingMethodSelectorProps: t, cartPaymentPanelProps: n, checkoutProgressIndicatorProps: r, cartTotalsPanelProps: i }) => /* @__PURE__ */ l("section", {
13850
13874
  className: "w-full flex justify-center mt-10 pb-16",
13851
13875
  children: /* @__PURE__ */ u("div", {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "formica-ui-lib",
3
3
  "private": false,
4
- "version": "1.0.340",
4
+ "version": "1.0.341",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "style": "dist/tailwind.css",