@npm_leadtech/legal-contracts-ui 0.63.0 → 0.63.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.
@@ -1,9 +1,9 @@
1
1
  import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { Select as t } from "./Select.js";
3
- import { Textarea as i } from "./Textarea.js";
4
- import { Checkbox as l } from "./Checkbox.js";
5
- import { CommunicationIcon as n } from "./CommunicationIcon.js";
2
+ import { Textarea as t } from "./Textarea.js";
3
+ import { Checkbox as i } from "./Checkbox.js";
4
+ import { CommunicationIcon as l } from "./CommunicationIcon.js";
6
5
  import { Input as a } from "./Input.js";
6
+ import { Select as n } from "./Select.js";
7
7
  import { Item as o } from "./Item.js";
8
8
  import { Button as s } from "./Button.js";
9
9
  const c = [
@@ -31,7 +31,7 @@ const c = [
31
31
  }
32
32
  ),
33
33
  /* @__PURE__ */ e(
34
- t,
34
+ n,
35
35
  {
36
36
  label: "Subject",
37
37
  id: "subject",
@@ -41,9 +41,9 @@ const c = [
41
41
  required: !0
42
42
  }
43
43
  ),
44
- /* @__PURE__ */ e(i, { label: "Your Message", id: "message", name: "message", placeholder: "Write your message here", required: !0 }),
44
+ /* @__PURE__ */ e(t, { label: "Your Message", id: "message", name: "message", placeholder: "Write your message here", required: !0 }),
45
45
  /* @__PURE__ */ e("p", { className: "text-small text-neutral-600", children: "* Required fields" }),
46
- /* @__PURE__ */ e(l, { id: "privacy", name: "privacy", required: !0, children: /* @__PURE__ */ r("span", { children: [
46
+ /* @__PURE__ */ e(i, { id: "privacy", name: "privacy", required: !0, children: /* @__PURE__ */ r("span", { children: [
47
47
  "I have read and accept the",
48
48
  " ",
49
49
  /* @__PURE__ */ e(
@@ -61,7 +61,7 @@ const c = [
61
61
  o,
62
62
  {
63
63
  id: "ID",
64
- image: /* @__PURE__ */ e(n, { className: "size-5", "aria-hidden": "true" }),
64
+ image: /* @__PURE__ */ e(l, { className: "size-5", "aria-hidden": "true" }),
65
65
  description: "This information is required for the security verification process.",
66
66
  className: "text-small flex items-start gap-3 rounded bg-neutral-50 p-4 text-neutral-600"
67
67
  }
@@ -12,5 +12,6 @@ export declare interface InputProps extends React.InputHTMLAttributes<HTMLInputE
12
12
  required?: boolean;
13
13
  tooltip?: string;
14
14
  onInputChange?: (str: string) => void;
15
+ containerClassName?: string;
15
16
  }
16
17
 
@@ -1,22 +1,23 @@
1
- import { jsxs as e, jsx as t } from "react/jsx-runtime";
2
- const m = ({
1
+ import { jsxs as e, jsx as l } from "react/jsx-runtime";
2
+ const f = ({
3
3
  label: n,
4
- id: l,
4
+ id: t,
5
5
  name: s,
6
6
  type: i = "text",
7
7
  placeholder: u,
8
8
  required: r = !1,
9
9
  tooltip: a,
10
10
  onInputChange: c,
11
- ...d
12
- }) => /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: [
11
+ containerClassName: d = "",
12
+ ...o
13
+ }) => /* @__PURE__ */ e("div", { className: `flex flex-col gap-2 ${d}`, children: [
13
14
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: [
14
- /* @__PURE__ */ e("label", { htmlFor: l, className: "text-medium font-bold text-neutral-800", children: [
15
+ /* @__PURE__ */ e("label", { htmlFor: t, className: "font-bold text-neutral-800", children: [
15
16
  n,
16
17
  " ",
17
- r && /* @__PURE__ */ t("span", { className: "text-red-500", children: "*" })
18
+ r && /* @__PURE__ */ l("span", { className: "text-red-500", children: "*" })
18
19
  ] }),
19
- a && /* @__PURE__ */ t(
20
+ a && /* @__PURE__ */ l(
20
21
  "span",
21
22
  {
22
23
  className: "text-extra-small inline-flex h-5 w-5 items-center justify-center rounded-full border border-neutral-200 text-neutral-400",
@@ -26,22 +27,22 @@ const m = ({
26
27
  }
27
28
  )
28
29
  ] }),
29
- /* @__PURE__ */ t(
30
+ /* @__PURE__ */ l(
30
31
  "input",
31
32
  {
32
- id: l,
33
+ id: t,
33
34
  name: s,
34
35
  type: i,
35
36
  placeholder: u,
36
37
  required: r,
37
38
  className: "bg-neutral-25 text-small focus-visible:outline-primary-500 w-full rounded border border-neutral-400 p-3 text-neutral-800 placeholder:text-neutral-600 focus-visible:outline-2",
38
- onChange: (o) => {
39
- c?.(o.target.value);
39
+ onChange: (x) => {
40
+ c?.(x.target.value);
40
41
  },
41
- ...d
42
+ ...o
42
43
  }
43
44
  )
44
45
  ] });
45
46
  export {
46
- m as Input
47
+ f as Input
47
48
  };
@@ -1,43 +1,57 @@
1
- import { jsx as l, jsxs as s, Fragment as a } from "react/jsx-runtime";
2
- import { TrustedBadge as n } from "./TrustedBadge.js";
1
+ "use client";
2
+ import { jsxs as r, Fragment as n, jsx as l } from "react/jsx-runtime";
3
+ import "react";
4
+ import { PreformMobile as x } from "./PreformMobile.js";
3
5
  import { PreformOption as p } from "./PreformOption.js";
4
- import { Input as o } from "./Input.js";
5
- import { LinkWrapper as t } from "./LinkWrapper.js";
6
- const b = ({ trustedBadge: c, cta: x, inputFieldData: e, radioFieldData: r }) => /* @__PURE__ */ l("section", { className: "bg-neutral-25 pt-10 text-neutral-800 sm:px-6 lg:px-8 xl:px-30", children: /* @__PURE__ */ s("div", { className: "relative mx-auto flex max-w-300 flex-col gap-6 rounded bg-white px-6 pt-8 pb-6 shadow-md sm:items-center sm:gap-8 lg:px-26 xl:px-10", children: [
7
- /* @__PURE__ */ l(n, { ...c }),
8
- r?.isVisible && /* @__PURE__ */ s(a, { children: [
9
- /* @__PURE__ */ l("h2", { className: "text-medium sm:text-large font-bold", children: r.label }),
10
- /* @__PURE__ */ s("div", { className: "flex w-full max-w-272 flex-wrap justify-center gap-2 sm:gap-4", children: [
11
- r.options.map((m) => /* @__PURE__ */ l(
12
- "div",
13
- {
14
- className: "w-[calc(50%-4px)] sm:w-[calc(25%-12px)] lg:w-[calc(20%-13px)] xl:w-[calc(16.66%-14px)]",
15
- children: /* @__PURE__ */ l(
16
- p,
17
- {
18
- ...m,
19
- selected: m.value === r.radioSelected,
20
- onClick: r.onClick
21
- }
22
- )
23
- },
24
- m.value
25
- )),
26
- e?.isVisible && /* @__PURE__ */ l("div", { className: "mt-4 flex basis-full justify-center md:mt-0", children: /* @__PURE__ */ l(
27
- o,
28
- {
29
- id: e.id,
30
- label: e.label,
31
- name: e.name,
32
- placeholder: e.placeholder,
33
- value: e.value,
34
- onInputChange: e.onChange
35
- }
36
- ) }, e.name)
37
- ] })
38
- ] }),
39
- /* @__PURE__ */ l(t, { variant: "primary-green", children: x })
40
- ] }) });
6
+ import { TrustedBadge as a } from "./TrustedBadge.js";
7
+ import { Input as f } from "./Input.js";
8
+ import { LinkWrapper as i } from "./LinkWrapper.js";
9
+ const u = ({ trustedBadge: c, cta: o, inputFieldData: e, radioFieldData: m }) => /* @__PURE__ */ r(n, { children: [
10
+ /* @__PURE__ */ l("section", { className: "bg-neutral-25 hidden pt-10 text-neutral-800 sm:block sm:px-6 lg:px-8 xl:px-30", children: /* @__PURE__ */ r("div", { className: "relative mx-auto flex max-w-300 flex-col gap-6 rounded bg-white px-6 pt-8 pb-6 shadow-md sm:items-center sm:gap-8 lg:px-26 xl:px-10", children: [
11
+ /* @__PURE__ */ l(a, { ...c }),
12
+ m?.isVisible && /* @__PURE__ */ r(n, { children: [
13
+ /* @__PURE__ */ l("h2", { className: "text-medium sm:text-large font-bold", children: m.label }),
14
+ /* @__PURE__ */ r("div", { className: "flex w-full max-w-272 flex-wrap justify-center gap-2 sm:gap-4", children: [
15
+ m.options.map((s) => /* @__PURE__ */ l(
16
+ "div",
17
+ {
18
+ className: "w-[calc(50%-4px)] sm:w-[calc(25%-12px)] lg:w-[calc(20%-13px)] xl:w-[calc(16.66%-14px)]",
19
+ children: /* @__PURE__ */ l(
20
+ p,
21
+ {
22
+ ...s,
23
+ selected: s.value === m.radioSelected,
24
+ onClick: m.onClick
25
+ }
26
+ )
27
+ },
28
+ s.value
29
+ )),
30
+ e?.isVisible && /* @__PURE__ */ l("div", { className: "mt-4 flex basis-full justify-center md:mt-0", children: /* @__PURE__ */ l(
31
+ f,
32
+ {
33
+ id: e.id,
34
+ label: e.label,
35
+ name: e.name,
36
+ placeholder: e.placeholder,
37
+ value: e.value,
38
+ onInputChange: e.onChange
39
+ }
40
+ ) }, e.name)
41
+ ] })
42
+ ] }),
43
+ /* @__PURE__ */ l(i, { variant: "primary-green", children: o })
44
+ ] }) }),
45
+ /* @__PURE__ */ l(
46
+ x,
47
+ {
48
+ cta: o,
49
+ trustedBadge: c,
50
+ inputFieldData: e,
51
+ radioFieldData: m
52
+ }
53
+ )
54
+ ] });
41
55
  export {
42
- b as Preform
56
+ u as Preform
43
57
  };
@@ -0,0 +1,44 @@
1
+ import { FC } from 'react';
2
+ import { ReactNode } from 'react';
3
+
4
+ export type InputFieldData = {
5
+ isVisible: boolean;
6
+ id: string;
7
+ label: string;
8
+ name: string;
9
+ placeholder: string;
10
+ value: string;
11
+ onChange: (str: string) => void;
12
+ };
13
+
14
+ export declare const PreformMobile: FC<PreformMobileProps>;
15
+
16
+ export declare interface PreformMobileProps {
17
+ trustedBadge: TrustedBadgeProps;
18
+ radioFieldData?: RadioFieldData;
19
+ inputFieldData?: InputFieldData;
20
+ cta: ReactNode;
21
+ }
22
+
23
+ export interface PreformOptionProps {
24
+ label: string;
25
+ value: string;
26
+ alternativeUrl: string | null;
27
+ icon: ReactNode;
28
+ selected: boolean;
29
+ onClick?: (str: string) => void;
30
+ }
31
+
32
+ export type RadioFieldData = {
33
+ isVisible: boolean;
34
+ label: string;
35
+ name: string;
36
+ options: PreformOptionProps[];
37
+ radioSelected: string;
38
+ onClick: (str: string) => void;
39
+ };
40
+
41
+ export interface TrustedBadgeProps {
42
+ children: ReactNode;
43
+ }
44
+
@@ -0,0 +1,88 @@
1
+ import { jsxs as o, Fragment as d, jsx as l } from "react/jsx-runtime";
2
+ import { useState as x, useRef as v, useEffect as u } from "react";
3
+ import { TrustedBadge as g } from "./TrustedBadge.js";
4
+ import { Select as w } from "./Select.js";
5
+ import { Input as f } from "./Input.js";
6
+ import { LinkWrapper as N } from "./LinkWrapper.js";
7
+ const y = ({ radioFieldData: r, inputFieldData: e, cta: h, trustedBadge: a }) => {
8
+ const [m, b] = x(!1), c = v(null);
9
+ u(() => {
10
+ const s = c.current;
11
+ if (!s) return;
12
+ const n = new IntersectionObserver(
13
+ ([i]) => {
14
+ b(!i.isIntersecting);
15
+ },
16
+ { threshold: 0 }
17
+ );
18
+ return n.observe(s), () => {
19
+ n.disconnect();
20
+ };
21
+ }, []);
22
+ const t = (s) => /* @__PURE__ */ o(
23
+ "div",
24
+ {
25
+ className: `flex flex-col bg-white px-6 pb-4 ${s ? "border-t border-neutral-100 pt-4 shadow-md" : ""}`,
26
+ children: [
27
+ /* @__PURE__ */ l(
28
+ "label",
29
+ {
30
+ htmlFor: `${r?.name ?? ""}-${s ? "sticky" : "mobile"}`,
31
+ className: "text-small mb-4 font-bold text-neutral-800",
32
+ children: r?.label
33
+ }
34
+ ),
35
+ /* @__PURE__ */ o("div", { className: `flex gap-4 ${s ? "flex-row items-center" : "flex-col"}`, children: [
36
+ r?.isVisible && /* @__PURE__ */ l(
37
+ w,
38
+ {
39
+ id: `${r.name}-${s ? "sticky" : "mobile"}`,
40
+ name: r.name,
41
+ value: r.radioSelected,
42
+ options: r.options,
43
+ containerClassName: "w-full",
44
+ onChange: (n) => {
45
+ r.onClick(n.target.value);
46
+ }
47
+ }
48
+ ),
49
+ e?.isVisible && !s && /* @__PURE__ */ l("div", { className: "flex justify-center", children: /* @__PURE__ */ l(
50
+ f,
51
+ {
52
+ containerClassName: "w-full text-small",
53
+ id: `${e.id}-mobile`,
54
+ label: e.label,
55
+ name: `${e.name}-mobile`,
56
+ placeholder: e.placeholder,
57
+ value: e.value,
58
+ onInputChange: e.onChange
59
+ }
60
+ ) }, e.name),
61
+ /* @__PURE__ */ l(N, { variant: "primary-green", className: `text-small ${s ? "w-fit text-nowrap" : "w-full"}`, children: h })
62
+ ] }),
63
+ e?.isVisible && s && /* @__PURE__ */ l("div", { className: "mt-4 flex w-full justify-center", children: /* @__PURE__ */ l(
64
+ f,
65
+ {
66
+ containerClassName: "w-full text-small",
67
+ id: `${e.id}-mobile-sticky`,
68
+ label: e.label,
69
+ name: `${e.name}-mobile-sticky`,
70
+ placeholder: e.placeholder,
71
+ value: e.value,
72
+ onInputChange: e.onChange
73
+ }
74
+ ) }, e.name)
75
+ ]
76
+ }
77
+ );
78
+ return /* @__PURE__ */ o(d, { children: [
79
+ /* @__PURE__ */ l("section", { className: "bg-neutral-25 pt-10 text-neutral-800 sm:hidden", children: /* @__PURE__ */ o("div", { ref: c, className: "relative flex flex-col rounded bg-white pt-8 shadow", children: [
80
+ /* @__PURE__ */ l("div", { className: "px-6", children: /* @__PURE__ */ l(g, { ...a }) }),
81
+ /* @__PURE__ */ l("div", { className: m ? "hidden" : "block", children: t(!1) })
82
+ ] }) }),
83
+ m && /* @__PURE__ */ l("div", { className: "fixed bottom-0 left-0 z-50 w-full sm:hidden", children: t(!0) })
84
+ ] });
85
+ };
86
+ export {
87
+ y as PreformMobile
88
+ };
@@ -3,7 +3,7 @@ import { FC } from 'react';
3
3
  export declare const Select: FC<SelectProps>;
4
4
 
5
5
  export declare interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
6
- label: string;
6
+ label?: string;
7
7
  id: string;
8
8
  name: string;
9
9
  required?: boolean;
@@ -12,5 +12,6 @@ export declare interface SelectProps extends React.SelectHTMLAttributes<HTMLSele
12
12
  label: string;
13
13
  value: string;
14
14
  }[];
15
+ containerClassName?: string;
15
16
  }
16
17
 
@@ -1,26 +1,38 @@
1
- import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
- const o = ({ label: a, id: t, name: u, required: s = !1, placeholder: d, options: n, ...c }) => /* @__PURE__ */ l("div", { className: "flex flex-col gap-2", children: [
3
- /* @__PURE__ */ l("label", { htmlFor: t, className: "text-medium font-bold text-neutral-800", children: [
4
- a,
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import { ChevronDownIcon as d } from "./ChevronDownIcon.js";
3
+ const v = ({
4
+ label: t,
5
+ id: a,
6
+ name: s,
7
+ required: i = !1,
8
+ placeholder: n,
9
+ options: o,
10
+ containerClassName: c = "",
11
+ ...u
12
+ }) => /* @__PURE__ */ l("div", { className: `flex flex-col gap-2 ${c}`, children: [
13
+ t && /* @__PURE__ */ l("label", { htmlFor: a, className: "text-medium font-bold text-neutral-800", children: [
14
+ t,
5
15
  " ",
6
- s && /* @__PURE__ */ r("span", { className: "text-red-500", children: "*" })
16
+ i && /* @__PURE__ */ e("span", { className: "text-red-500", children: "*" })
7
17
  ] }),
8
- /* @__PURE__ */ l(
9
- "select",
10
- {
11
- id: t,
12
- name: u,
13
- required: !0,
14
- defaultValue: "",
15
- className: "bg-neutral-25 text-small focus-visible:outline-primary-500 w-full rounded border border-neutral-200 px-4 py-2 text-neutral-800 placeholder:text-neutral-400 focus-visible:outline-2",
16
- ...c,
17
- children: [
18
- /* @__PURE__ */ r("option", { value: "", disabled: !0, children: d }),
19
- n.map((e) => /* @__PURE__ */ r("option", { value: e.value, children: e.label }, e.value))
20
- ]
21
- }
22
- )
18
+ /* @__PURE__ */ l("div", { className: "relative", children: [
19
+ /* @__PURE__ */ l(
20
+ "select",
21
+ {
22
+ id: a,
23
+ name: s,
24
+ required: !0,
25
+ className: "bg-neutral-25 text-small focus-visible:outline-primary-500 w-full appearance-none rounded border border-neutral-400 py-2 pr-10 pl-4 text-neutral-800 placeholder:text-neutral-400 focus-visible:outline-2",
26
+ ...u,
27
+ children: [
28
+ n && /* @__PURE__ */ e("option", { value: "", disabled: !0, children: n }),
29
+ o.map((r) => /* @__PURE__ */ e("option", { value: r.value, children: r.label }, r.value))
30
+ ]
31
+ }
32
+ ),
33
+ /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2", children: /* @__PURE__ */ e(d, {}) })
34
+ ] })
23
35
  ] });
24
36
  export {
25
- o as Select
37
+ v as Select
26
38
  };