@npm_leadtech/legal-contracts-ui 0.58.3 → 0.58.4
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,4 +1,3 @@
|
|
|
1
|
-
import { ComponentPropsWithRef } from 'react';
|
|
2
1
|
import { FC } from 'react';
|
|
3
2
|
import { HTMLInputTypeAttribute } from 'react';
|
|
4
3
|
import { ReactNode } from 'react';
|
|
@@ -7,23 +6,10 @@ export declare interface BaseOptionProps {
|
|
|
7
6
|
isVisible: boolean;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
|
-
export interface ButtonProps extends Omit<ComponentPropsWithRef<'button'>, 'children'> {
|
|
11
|
-
children: ReactNode;
|
|
12
|
-
size?: ButtonSize;
|
|
13
|
-
variant?: ResponsiveButtonVariant;
|
|
14
|
-
iconPosition?: IconPosition;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type ButtonSize = 'small' | 'default' | 'large';
|
|
18
|
-
|
|
19
|
-
export type ButtonVariant = 'primary-green' | 'primary-darkgreen' | 'primary-yellow' | 'primary-white' | 'secondary-green' | 'secondary-yellow' | 'secondary-red' | 'secondary-black' | 'tertiary-bold' | 'tertiary-thin' | 'tertiary-icon' | 'tertiary-link' | 'icon-black' | 'icon-grey' | 'icon-mobile';
|
|
20
|
-
|
|
21
9
|
export type CreateOption<T, P> = BaseOptionProps & P & {
|
|
22
10
|
type: T;
|
|
23
11
|
};
|
|
24
12
|
|
|
25
|
-
export type IconPosition = 'left' | 'right' | 'top';
|
|
26
|
-
|
|
27
13
|
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
28
14
|
label: string;
|
|
29
15
|
id: string;
|
|
@@ -44,28 +30,20 @@ export interface PreformOptionProps {
|
|
|
44
30
|
label: string;
|
|
45
31
|
icon: ReactNode;
|
|
46
32
|
selected: boolean;
|
|
47
|
-
onClick
|
|
33
|
+
onClick?: (str: string) => void;
|
|
48
34
|
}
|
|
49
35
|
|
|
50
36
|
export declare interface PreformProps {
|
|
51
37
|
trustedBadge: TrustedBadgeProps;
|
|
52
38
|
title?: string;
|
|
53
39
|
options: OptionProps[];
|
|
54
|
-
cta:
|
|
55
|
-
radioSelected
|
|
56
|
-
onClickRadio
|
|
40
|
+
cta: ReactNode;
|
|
41
|
+
radioSelected?: string;
|
|
42
|
+
onClickRadio?: (str: string) => void;
|
|
57
43
|
inputValue?: string;
|
|
58
44
|
onInputChange?: (str: string) => void;
|
|
59
45
|
}
|
|
60
46
|
|
|
61
|
-
export type ResponsiveButtonVariant = ButtonVariant | {
|
|
62
|
-
initial?: ButtonVariant;
|
|
63
|
-
sm?: ButtonVariant;
|
|
64
|
-
md?: ButtonVariant;
|
|
65
|
-
lg?: ButtonVariant;
|
|
66
|
-
xl?: ButtonVariant;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
47
|
export interface TrustedBadgeProps {
|
|
70
48
|
children: ReactNode;
|
|
71
49
|
}
|
|
@@ -2,32 +2,31 @@ import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
|
2
2
|
import { TrustedBadge as p } from "./TrustedBadge.js";
|
|
3
3
|
import { PreformOption as f } from "./PreformOption.js";
|
|
4
4
|
import { Input as n } from "./Input.js";
|
|
5
|
-
|
|
6
|
-
const v = ({
|
|
5
|
+
const h = ({
|
|
7
6
|
trustedBadge: r,
|
|
8
|
-
title:
|
|
9
|
-
options:
|
|
10
|
-
cta:
|
|
11
|
-
radioSelected:
|
|
7
|
+
title: a,
|
|
8
|
+
options: s,
|
|
9
|
+
cta: m,
|
|
10
|
+
radioSelected: t,
|
|
12
11
|
onClickRadio: c,
|
|
13
12
|
inputValue: i,
|
|
14
13
|
onInputChange: x
|
|
15
14
|
}) => /* @__PURE__ */ e("section", { className: "bg-neutral-25 pt-10 text-neutral-800 sm:px-6 lg:px-8 xl:px-30", children: /* @__PURE__ */ d("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: [
|
|
16
15
|
/* @__PURE__ */ e(p, { ...r }),
|
|
17
|
-
/* @__PURE__ */ e("h2", { className: "text-medium sm:text-large font-bold", children:
|
|
18
|
-
/* @__PURE__ */ e("div", { className: "flex w-full max-w-272 flex-wrap justify-center gap-2 sm:gap-4", children:
|
|
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: s.map((l) => {
|
|
19
18
|
if (l.isVisible)
|
|
20
19
|
return l.type === "radio" ? /* @__PURE__ */ e(
|
|
21
20
|
"div",
|
|
22
21
|
{
|
|
23
22
|
className: "w-[calc(50%-4px)] sm:w-[calc(25%-12px)] lg:w-[calc(20%-13px)] xl:w-[calc(16.66%-14px)]",
|
|
24
|
-
children: /* @__PURE__ */ e(f, { ...l, selected: l.id ===
|
|
23
|
+
children: /* @__PURE__ */ e(f, { ...l, selected: l.id === t, onClick: c })
|
|
25
24
|
},
|
|
26
25
|
l.id
|
|
27
26
|
) : /* @__PURE__ */ e("div", { className: "mt-4 flex basis-full justify-center md:mt-0", children: /* @__PURE__ */ e(n, { ...l, value: i, onInputChange: x }) }, l.id);
|
|
28
27
|
}) }),
|
|
29
|
-
|
|
28
|
+
m
|
|
30
29
|
] }) });
|
|
31
30
|
export {
|
|
32
|
-
|
|
31
|
+
h as Preform
|
|
33
32
|
};
|
|
@@ -5,7 +5,7 @@ const m = ({ id: o, label: l, selected: r, icon: n, onClick: t }) => /* @__PURE_
|
|
|
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"}`,
|
|
7
7
|
onClick: () => {
|
|
8
|
-
t(o);
|
|
8
|
+
t?.(o);
|
|
9
9
|
},
|
|
10
10
|
children: [
|
|
11
11
|
/* @__PURE__ */ e("div", { className: "size-6 sm:size-12", children: n }),
|
|
@@ -122,16 +122,16 @@ export interface PreformOptionProps {
|
|
|
122
122
|
label: string;
|
|
123
123
|
icon: ReactNode;
|
|
124
124
|
selected: boolean;
|
|
125
|
-
onClick
|
|
125
|
+
onClick?: (str: string) => void;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
export interface PreformProps {
|
|
129
129
|
trustedBadge: TrustedBadgeProps;
|
|
130
130
|
title?: string;
|
|
131
131
|
options: OptionProps[];
|
|
132
|
-
cta:
|
|
133
|
-
radioSelected
|
|
134
|
-
onClickRadio
|
|
132
|
+
cta: ReactNode;
|
|
133
|
+
radioSelected?: string;
|
|
134
|
+
onClickRadio?: (str: string) => void;
|
|
135
135
|
inputValue?: string;
|
|
136
136
|
onInputChange?: (str: string) => void;
|
|
137
137
|
}
|