@npm_leadtech/legal-contracts-ui 0.58.5 → 0.58.7

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,33 +1,21 @@
1
1
  import { FC } from 'react';
2
- import { HTMLInputTypeAttribute } from 'react';
3
2
  import { ReactNode } from 'react';
4
3
 
5
- export declare interface BaseOptionProps {
4
+ export declare type InputFieldData = {
6
5
  isVisible: boolean;
7
- }
8
-
9
- export type CreateOption<T, P> = BaseOptionProps & P & {
10
- type: T;
11
- };
12
-
13
- export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
14
- label: string;
15
6
  id: string;
7
+ label: string;
16
8
  name: string;
17
- type?: HTMLInputTypeAttribute;
18
- placeholder?: string;
19
- required?: boolean;
20
- tooltip?: string;
21
- onInputChange?: (str: string) => void;
22
- }
23
-
24
- export declare type OptionProps = CreateOption<'input', InputProps> | CreateOption<'radio', PreformOptionProps>;
9
+ value: string;
10
+ placeholder: string;
11
+ onChange: (str: string) => void;
12
+ };
25
13
 
26
14
  export declare const Preform: FC<PreformProps>;
27
15
 
28
16
  export interface PreformOptionProps {
29
- id: string;
30
17
  label: string;
18
+ value: string;
31
19
  icon: ReactNode;
32
20
  selected: boolean;
33
21
  onClick?: (str: string) => void;
@@ -35,15 +23,20 @@ export interface PreformOptionProps {
35
23
 
36
24
  export declare interface PreformProps {
37
25
  trustedBadge: TrustedBadgeProps;
38
- title?: string;
39
- options: OptionProps[];
40
26
  cta: ReactNode;
41
- radioSelected?: string;
42
- onClickRadio?: (str: string) => void;
43
- inputValue?: string;
44
- onInputChange?: (str: string) => void;
27
+ radioFieldData?: RadioFieldData;
28
+ inputFieldData?: InputFieldData;
45
29
  }
46
30
 
31
+ export declare type RadioFieldData = {
32
+ isVisible: boolean;
33
+ label: string;
34
+ name: string;
35
+ options: PreformOptionProps[];
36
+ radioSelected: string;
37
+ onClick: (str: string) => void;
38
+ };
39
+
47
40
  export interface TrustedBadgeProps {
48
41
  children: ReactNode;
49
42
  }
@@ -1,32 +1,42 @@
1
- import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
- import { TrustedBadge as f } from "./TrustedBadge.js";
3
- import { PreformOption as n } from "./PreformOption.js";
4
- import { Input as u } from "./Input.js";
5
- const v = ({
6
- trustedBadge: r,
7
- title: a,
8
- options: m,
9
- cta: t,
10
- radioSelected: s,
11
- onClickRadio: c,
12
- inputValue: x,
13
- onInputChange: i
14
- }) => /* @__PURE__ */ e("section", { className: "bg-neutral-25 pt-10 text-neutral-800 sm:px-6 lg:px-8 xl:px-30", children: /* @__PURE__ */ p("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: [
15
- /* @__PURE__ */ e(f, { ...r }),
16
- /* @__PURE__ */ e("h2", { className: "text-medium sm:text-large font-bold", children: a }),
17
- /* @__PURE__ */ e("div", { className: "flex w-full max-w-272 flex-wrap justify-center gap-2 sm:gap-4", children: m.map(({ isVisible: d, ...l }) => {
18
- if (d)
19
- return l.type === "radio" ? /* @__PURE__ */ e(
1
+ import { jsx as l, jsxs as c, Fragment as a } from "react/jsx-runtime";
2
+ import { TrustedBadge as n } from "./TrustedBadge.js";
3
+ import { PreformOption as o } from "./PreformOption.js";
4
+ import { Input as p } from "./Input.js";
5
+ const d = ({ trustedBadge: r, cta: x, inputFieldData: e, radioFieldData: m }) => /* @__PURE__ */ l("section", { className: "bg-neutral-25 pt-10 text-neutral-800 sm:px-6 lg:px-8 xl:px-30", children: /* @__PURE__ */ c("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: [
6
+ /* @__PURE__ */ l(n, { ...r }),
7
+ m?.isVisible && /* @__PURE__ */ c(a, { children: [
8
+ /* @__PURE__ */ l("h2", { className: "text-medium sm:text-large font-bold", children: m.label }),
9
+ /* @__PURE__ */ c("div", { className: "flex w-full max-w-272 flex-wrap justify-center gap-2 sm:gap-4", children: [
10
+ m.options.map((s) => /* @__PURE__ */ l(
20
11
  "div",
21
12
  {
22
13
  className: "w-[calc(50%-4px)] sm:w-[calc(25%-12px)] lg:w-[calc(20%-13px)] xl:w-[calc(16.66%-14px)]",
23
- children: /* @__PURE__ */ e(n, { ...l, selected: l.id === s, onClick: c })
14
+ children: /* @__PURE__ */ l(
15
+ o,
16
+ {
17
+ ...s,
18
+ selected: s.value === m.radioSelected,
19
+ onClick: m.onClick
20
+ }
21
+ )
24
22
  },
25
- l.id
26
- ) : /* @__PURE__ */ e("div", { className: "mt-4 flex basis-full justify-center md:mt-0", children: /* @__PURE__ */ e(u, { ...l, value: x, onInputChange: i }) }, l.id);
27
- }) }),
28
- t
23
+ s.value
24
+ )),
25
+ e?.isVisible && /* @__PURE__ */ l("div", { className: "mt-4 flex basis-full justify-center md:mt-0", children: /* @__PURE__ */ l(
26
+ p,
27
+ {
28
+ id: e.id,
29
+ label: e.label,
30
+ name: e.name,
31
+ placeholder: e.placeholder,
32
+ value: e.value,
33
+ onInputChange: e.onChange
34
+ }
35
+ ) }, e.name)
36
+ ] })
37
+ ] }),
38
+ x
29
39
  ] }) });
30
40
  export {
31
- v as Preform
41
+ d as Preform
32
42
  };
@@ -4,8 +4,8 @@ import { ReactNode } from 'react';
4
4
  export declare const PreformOption: FC<PreformOptionProps>;
5
5
 
6
6
  export declare interface PreformOptionProps {
7
- id: string;
8
7
  label: string;
8
+ value: string;
9
9
  icon: ReactNode;
10
10
  selected: boolean;
11
11
  onClick?: (str: string) => void;
@@ -1,6 +1,6 @@
1
1
  import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
2
  import "react";
3
- const m = ({ id: o, label: l, selected: r, icon: n, onClick: t }) => /* @__PURE__ */ i(
3
+ const m = ({ value: o, label: l, selected: r, icon: n, onClick: t }) => /* @__PURE__ */ i(
4
4
  "button",
5
5
  {
6
6
  className: `group flex w-full cursor-pointer items-center gap-2 rounded border-2 p-2 hover:bg-neutral-50 sm:flex-col sm:p-4 ${r ? "border-primary-900" : "border-neutral-200"}`,
@@ -1,16 +1,11 @@
1
1
  import { ComponentPropsWithRef } from 'react';
2
2
  import { FC } from 'react';
3
- import { HTMLInputTypeAttribute } from 'react';
4
3
  import { ReactNode } from 'react';
5
4
 
6
5
  export interface AlternativeSubtypeDocumentProps extends BaseSubtypeDocumentProps {
7
6
  format: 'Alternative';
8
7
  }
9
8
 
10
- export interface BaseOptionProps {
11
- isVisible: boolean;
12
- }
13
-
14
9
  export interface BaseSubtypeDocumentProps {
15
10
  id: string;
16
11
  link: ReactNode;
@@ -56,10 +51,6 @@ export interface ContentItemProps {
56
51
  subtypeDocs: SubtypeDocumentProps[];
57
52
  }
58
53
 
59
- export type CreateOption<T, P> = BaseOptionProps & P & {
60
- type: T;
61
- };
62
-
63
54
  export interface DefaultSubtypeDocumentProps extends BaseSubtypeDocumentProps {
64
55
  format: 'Default';
65
56
  createDocButton: ButtonProps;
@@ -93,16 +84,15 @@ export interface ImageWithPreviewProps {
93
84
  large: ReactNode;
94
85
  }
95
86
 
96
- export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
97
- label: string;
87
+ export type InputFieldData = {
88
+ isVisible: boolean;
98
89
  id: string;
90
+ label: string;
99
91
  name: string;
100
- type?: HTMLInputTypeAttribute;
101
- placeholder?: string;
102
- required?: boolean;
103
- tooltip?: string;
104
- onInputChange?: (str: string) => void;
105
- }
92
+ value: string;
93
+ placeholder: string;
94
+ onChange: (str: string) => void;
95
+ };
106
96
 
107
97
  export interface JumbotronProps {
108
98
  title: string;
@@ -115,11 +105,9 @@ export interface LinkedProductProps {
115
105
  children: ReactNode;
116
106
  }
117
107
 
118
- export type OptionProps = CreateOption<'input', InputProps> | CreateOption<'radio', PreformOptionProps>;
119
-
120
108
  export interface PreformOptionProps {
121
- id: string;
122
109
  label: string;
110
+ value: string;
123
111
  icon: ReactNode;
124
112
  selected: boolean;
125
113
  onClick?: (str: string) => void;
@@ -127,13 +115,9 @@ export interface PreformOptionProps {
127
115
 
128
116
  export interface PreformProps {
129
117
  trustedBadge: TrustedBadgeProps;
130
- title?: string;
131
- options: OptionProps[];
132
118
  cta: ReactNode;
133
- radioSelected?: string;
134
- onClickRadio?: (str: string) => void;
135
- inputValue?: string;
136
- onInputChange?: (str: string) => void;
119
+ radioFieldData?: RadioFieldData;
120
+ inputFieldData?: InputFieldData;
137
121
  }
138
122
 
139
123
  export interface PreviewDownloadProps {
@@ -176,6 +160,15 @@ export declare interface ProductTemplateProps {
176
160
  tryNowSection: TryNowSectionProps;
177
161
  }
178
162
 
163
+ export type RadioFieldData = {
164
+ isVisible: boolean;
165
+ label: string;
166
+ name: string;
167
+ options: PreformOptionProps[];
168
+ radioSelected: string;
169
+ onClick: (str: string) => void;
170
+ };
171
+
179
172
  export type ResponsiveButtonVariant = ButtonVariant | {
180
173
  initial?: ButtonVariant;
181
174
  sm?: ButtonVariant;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-contracts-ui",
3
- "version": "0.58.5",
3
+ "version": "0.58.7",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",