lawgic-dev-kit 0.24.2 → 0.25.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/_virtual/index2.js +3 -2
- package/dist/_virtual/index3.js +3 -3
- package/dist/_virtual/index4.js +5 -3
- package/dist/_virtual/index5.js +2 -5
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/atoms/SelectInput/SelectInput.d.ts +1 -1
- package/dist/components/atoms/SelectInput/SelectInput.js +84 -78
- package/dist/components/atoms/SelectInput/SelectInput.types.d.ts +2 -0
- package/dist/components/atoms/TextInput/TextInput.d.ts +1 -1
- package/dist/components/atoms/TextInput/TextInput.js +26 -21
- package/dist/components/atoms/TextInput/TextInput.types.d.ts +1 -0
- package/dist/components/atoms/UncontrolledTextInput/UncontrolledTextInput.js +43 -38
- package/dist/components/atoms/UncontrolledTextInput/UncontrolledTextInput.types.d.ts +1 -0
- package/dist/components/atoms/UploadContainer/UploadContainer.js +104 -92
- package/dist/components/atoms/UploadContainer/UploadContainer.types.d.ts +5 -0
- package/dist/components/molecules/DateInput/DateInput.d.ts +2 -1
- package/dist/components/molecules/DateInput/DateInput.js +32 -30
- package/dist/lawgic-dev-kit.css +1 -1
- package/dist/lawgic-dev-kit.umd.js +67 -67
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/toposort/index.js +1 -1
- package/dist/node_modules/yup/index.esm.js +3 -3
- package/dist/src/components/atoms/SelectInput/SelectInput.d.ts +1 -1
- package/dist/src/components/atoms/SelectInput/SelectInput.types.d.ts +2 -0
- package/dist/src/components/atoms/TextInput/TextInput.d.ts +1 -1
- package/dist/src/components/atoms/TextInput/TextInput.types.d.ts +1 -0
- package/dist/src/components/atoms/UncontrolledTextInput/UncontrolledTextInput.types.d.ts +1 -0
- package/dist/src/components/atoms/UploadContainer/UploadContainer.types.d.ts +5 -0
- package/dist/src/components/molecules/DateInput/DateInput.d.ts +2 -1
- package/package.json +1 -1
package/dist/_virtual/index2.js
CHANGED
package/dist/_virtual/index3.js
CHANGED
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as o } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as r } from "../node_modules/toposort/index.js";
|
|
3
|
+
var t = r();
|
|
4
|
+
const s = /* @__PURE__ */ o(t);
|
|
3
5
|
export {
|
|
4
|
-
|
|
6
|
+
s as default
|
|
5
7
|
};
|
package/dist/_virtual/index5.js
CHANGED
package/dist/_virtual/index6.js
CHANGED
package/dist/_virtual/index7.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
2
|
import { SelectInputProps } from './SelectInput.types';
|
|
3
|
-
declare const SelectInput: <T extends FieldValues>({ options, name, control, label, placeholder, className, input, dropdownStyle, innerClassName, showChevron, size, }: SelectInputProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const SelectInput: <T extends FieldValues>({ options, name, control, label, placeholder, className, input, dropdownStyle, innerClassName, showChevron, size, required, }: SelectInputProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export default SelectInput;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useFloating as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useController as
|
|
5
|
-
import { useTheme as
|
|
6
|
-
import { autoUpdate as
|
|
7
|
-
import { offset as
|
|
8
|
-
const
|
|
1
|
+
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useFloating as Y, useClick as _, useDismiss as q, useInteractions as G, useTransitionStyles as J } from "../../../node_modules/@floating-ui/react/dist/floating-ui.react.js";
|
|
3
|
+
import { useState as C, useRef as O, useEffect as K } from "react";
|
|
4
|
+
import { useController as Q } from "react-hook-form";
|
|
5
|
+
import { useTheme as X } from "../../../hooks/useTheme.js";
|
|
6
|
+
import { autoUpdate as Z } from "../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js";
|
|
7
|
+
import { offset as ee, flip as te, shift as se, size as re, arrow as ne } from "../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js";
|
|
8
|
+
const xe = ({
|
|
9
9
|
options: c,
|
|
10
10
|
name: i,
|
|
11
11
|
control: p,
|
|
@@ -16,18 +16,19 @@ const me = ({
|
|
|
16
16
|
dropdownStyle: f = {},
|
|
17
17
|
innerClassName: h = "",
|
|
18
18
|
showChevron: g = !0,
|
|
19
|
-
size: y = "md"
|
|
19
|
+
size: y = "md",
|
|
20
|
+
required: b = !1
|
|
20
21
|
}) => {
|
|
21
22
|
const {
|
|
22
|
-
field: { value:
|
|
23
|
+
field: { value: j, onChange: l },
|
|
23
24
|
fieldState: { error: s }
|
|
24
|
-
} =
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
|
|
25
|
+
} = Q({ name: i, control: p });
|
|
26
|
+
return /* @__PURE__ */ e.jsx(
|
|
27
|
+
le,
|
|
27
28
|
{
|
|
28
29
|
options: c,
|
|
29
|
-
value:
|
|
30
|
-
onChange:
|
|
30
|
+
value: j,
|
|
31
|
+
onChange: l,
|
|
31
32
|
label: d,
|
|
32
33
|
placeholder: m,
|
|
33
34
|
error: s == null ? void 0 : s.message,
|
|
@@ -36,10 +37,11 @@ const me = ({
|
|
|
36
37
|
dropdownStyle: f,
|
|
37
38
|
innerClassName: h,
|
|
38
39
|
showChevron: g,
|
|
39
|
-
size: y
|
|
40
|
+
size: y,
|
|
41
|
+
required: b
|
|
40
42
|
}
|
|
41
43
|
);
|
|
42
|
-
},
|
|
44
|
+
}, le = ({
|
|
43
45
|
options: c,
|
|
44
46
|
value: i,
|
|
45
47
|
onChange: p,
|
|
@@ -51,10 +53,11 @@ const me = ({
|
|
|
51
53
|
dropdownStyle: h = {},
|
|
52
54
|
innerClassName: g = "",
|
|
53
55
|
showChevron: y = !0,
|
|
54
|
-
size: b = "md"
|
|
56
|
+
size: b = "md",
|
|
57
|
+
required: j = !1
|
|
55
58
|
}) => {
|
|
56
|
-
var
|
|
57
|
-
const { t:
|
|
59
|
+
var z;
|
|
60
|
+
const { t: l } = X(), [s, v] = C(!1), [w, S] = C(""), [o, L] = C(i || null), N = O(null), I = O(null), r = {
|
|
58
61
|
sm: {
|
|
59
62
|
container: "px-16 py-8",
|
|
60
63
|
text: "text-sm",
|
|
@@ -71,125 +74,128 @@ const me = ({
|
|
|
71
74
|
gap: "gap-8",
|
|
72
75
|
icon: "w-16 h-16"
|
|
73
76
|
}
|
|
74
|
-
}[b], { x:
|
|
77
|
+
}[b], { x: R, y: F, strategy: M, refs: k, context: $ } = Y({
|
|
75
78
|
open: s,
|
|
76
|
-
onOpenChange:
|
|
79
|
+
onOpenChange: v,
|
|
77
80
|
middleware: [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
apply({ availableHeight:
|
|
81
|
+
ee(8),
|
|
82
|
+
te(),
|
|
83
|
+
se({ padding: 8 }),
|
|
84
|
+
re({
|
|
85
|
+
apply({ availableHeight: t, elements: a }) {
|
|
83
86
|
Object.assign(a.floating.style, {
|
|
84
|
-
maxHeight: `${Math.min(
|
|
87
|
+
maxHeight: `${Math.min(t - 10, 300)}px`
|
|
85
88
|
});
|
|
86
89
|
},
|
|
87
90
|
padding: 8
|
|
88
91
|
}),
|
|
89
|
-
|
|
92
|
+
ne({ element: I })
|
|
90
93
|
],
|
|
91
94
|
placement: "bottom-start",
|
|
92
|
-
whileElementsMounted:
|
|
93
|
-
}),
|
|
95
|
+
whileElementsMounted: Z
|
|
96
|
+
}), P = _($), E = q($), { getReferenceProps: W, getFloatingProps: A } = G([P, E]), { isMounted: B, styles: D } = J($, {
|
|
94
97
|
duration: { open: 200, close: 150 },
|
|
95
98
|
initial: { opacity: 0, transform: "translateY(-4px)" }
|
|
96
|
-
}),
|
|
97
|
-
const
|
|
98
|
-
if (!
|
|
99
|
-
const a =
|
|
100
|
-
return
|
|
99
|
+
}), T = (() => {
|
|
100
|
+
const t = Array.isArray(c) ? c : [];
|
|
101
|
+
if (!w.trim()) return t;
|
|
102
|
+
const a = w.toLowerCase();
|
|
103
|
+
return t.filter(
|
|
101
104
|
(u) => u.label.toLowerCase().includes(a) || u.key.toLowerCase().includes(a)
|
|
102
105
|
);
|
|
103
|
-
})(),
|
|
104
|
-
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
var
|
|
108
|
-
return (
|
|
106
|
+
})(), V = (t) => {
|
|
107
|
+
L(t), v(!1), S(""), p(t);
|
|
108
|
+
}, H = () => {
|
|
109
|
+
v(!s), !s && N.current && setTimeout(() => {
|
|
110
|
+
var t;
|
|
111
|
+
return (t = N.current) == null ? void 0 : t.focus();
|
|
109
112
|
}, 100);
|
|
110
113
|
};
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
K(() => {
|
|
115
|
+
L(i);
|
|
113
116
|
}, [i]);
|
|
114
|
-
const
|
|
115
|
-
onClick:
|
|
117
|
+
const U = W({
|
|
118
|
+
onClick: H
|
|
116
119
|
});
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
-
d && /* @__PURE__ */
|
|
119
|
-
|
|
120
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `relative flex flex-col ${r.gap} ${f}`, children: [
|
|
121
|
+
d && /* @__PURE__ */ e.jsxs("h6", { className: `text-gray-600 font-600 leading-none ${n ? "!text-red-500" : ""} ${r.label}`, children: [
|
|
122
|
+
d,
|
|
123
|
+
j && /* @__PURE__ */ e.jsx("span", { className: "text-red-500 ml-4", children: "*" })
|
|
124
|
+
] }),
|
|
125
|
+
/* @__PURE__ */ e.jsxs(
|
|
120
126
|
"div",
|
|
121
127
|
{
|
|
122
|
-
ref:
|
|
128
|
+
ref: k.setReference,
|
|
123
129
|
className: `${g} flex items-center justify-between bg-light rounded-full border transition-all duration-200
|
|
124
130
|
${r.container} cursor-pointer hover:border-blue-400
|
|
125
131
|
${n ? "border-red-500 hover:border-red-600" : ""}
|
|
126
132
|
${s ? "border-blue-400" : "border-blue-100"}`,
|
|
127
|
-
...
|
|
133
|
+
...U,
|
|
128
134
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
y && /* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center w-full overflow-hidden", children: /* @__PURE__ */ e.jsx("span", { className: `flex-grow font-600 truncate ${r.text} ${o ? "" : "text-gray-400"}`, children: l(o ? o.label : m) }) }),
|
|
136
|
+
y && /* @__PURE__ */ e.jsx(
|
|
131
137
|
"svg",
|
|
132
138
|
{
|
|
133
139
|
className: `${r.icon} transition-transform ${s ? "rotate-180" : ""}`,
|
|
134
140
|
fill: "none",
|
|
135
141
|
stroke: "currentColor",
|
|
136
142
|
viewBox: "0 0 24 24",
|
|
137
|
-
children: /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M19 9l-7 7-7-7" })
|
|
138
144
|
}
|
|
139
145
|
)
|
|
140
146
|
]
|
|
141
147
|
}
|
|
142
148
|
),
|
|
143
|
-
n && /* @__PURE__ */
|
|
144
|
-
|
|
149
|
+
n && /* @__PURE__ */ e.jsx("p", { className: `font-500 text-red-500 leading-none ${r.error}`, children: n }),
|
|
150
|
+
B && /* @__PURE__ */ e.jsxs(
|
|
145
151
|
"div",
|
|
146
152
|
{
|
|
147
|
-
ref:
|
|
153
|
+
ref: k.setFloating,
|
|
148
154
|
style: {
|
|
149
|
-
position:
|
|
150
|
-
top:
|
|
151
|
-
left:
|
|
152
|
-
...
|
|
153
|
-
width: (
|
|
155
|
+
position: M,
|
|
156
|
+
top: F ?? 0,
|
|
157
|
+
left: R ?? 0,
|
|
158
|
+
...D,
|
|
159
|
+
width: (z = k.reference.current) == null ? void 0 : z.clientWidth,
|
|
154
160
|
zIndex: 50,
|
|
155
161
|
...h
|
|
156
162
|
},
|
|
157
163
|
className: "bg-white border border-blue-400 rounded-3xl shadow-lg overflow-hidden",
|
|
158
|
-
...
|
|
164
|
+
...A(),
|
|
159
165
|
children: [
|
|
160
|
-
x && /* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
166
|
+
x && /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 bg-white p-8 border-b border-gray-100 z-20", children: /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
167
|
+
/* @__PURE__ */ e.jsx("div", { className: "absolute inset-y-0 left-0 pl-12 flex items-center pointer-events-none", children: /* @__PURE__ */ e.jsx("svg", { className: "h-16 w-16 text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) }),
|
|
168
|
+
/* @__PURE__ */ e.jsx(
|
|
163
169
|
"input",
|
|
164
170
|
{
|
|
165
|
-
ref:
|
|
171
|
+
ref: N,
|
|
166
172
|
type: "text",
|
|
167
173
|
className: "w-full py-8 pl-40 pr-12 rounded-full focus:outline-none text-body-s",
|
|
168
|
-
placeholder:
|
|
169
|
-
value:
|
|
170
|
-
onChange: (
|
|
171
|
-
onClick: (
|
|
174
|
+
placeholder: l("search_options"),
|
|
175
|
+
value: w,
|
|
176
|
+
onChange: (t) => S(t.target.value),
|
|
177
|
+
onClick: (t) => t.stopPropagation(),
|
|
172
178
|
autoFocus: !0
|
|
173
179
|
}
|
|
174
180
|
)
|
|
175
181
|
] }) }),
|
|
176
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ e.jsx("div", { className: "max-h-[250px] overflow-y-auto", children: T.length > 0 ? /* @__PURE__ */ e.jsx("ul", { className: "py-4", children: T.map((t, a) => /* @__PURE__ */ e.jsx(
|
|
177
183
|
"li",
|
|
178
184
|
{
|
|
179
185
|
className: `flex items-center px-16 py-10 transition-all duration-200 hover:bg-blue-50 cursor-pointer
|
|
180
|
-
${(
|
|
186
|
+
${(o == null ? void 0 : o.key) === t.key ? "bg-blue-100/30 text-blue-500 font-medium" : ""}`,
|
|
181
187
|
onClick: (u) => {
|
|
182
|
-
u.stopPropagation(),
|
|
188
|
+
u.stopPropagation(), V(t);
|
|
183
189
|
},
|
|
184
|
-
children: /* @__PURE__ */
|
|
190
|
+
children: /* @__PURE__ */ e.jsx("span", { className: r.text, children: typeof t.label == "string" ? l(t.label) : t.expandedLabel || t.label })
|
|
185
191
|
},
|
|
186
|
-
`${
|
|
187
|
-
)) }) : /* @__PURE__ */
|
|
192
|
+
`${t.key}-${a}`
|
|
193
|
+
)) }) : /* @__PURE__ */ e.jsx("div", { className: "px-16 py-16 text-center text-gray-500", children: /* @__PURE__ */ e.jsx("p", { className: "text-body-s", children: "No matches found" }) }) })
|
|
188
194
|
]
|
|
189
195
|
}
|
|
190
196
|
)
|
|
191
197
|
] });
|
|
192
198
|
};
|
|
193
199
|
export {
|
|
194
|
-
|
|
200
|
+
xe as default
|
|
195
201
|
};
|
|
@@ -16,6 +16,7 @@ export interface SelectInputProps<T extends FieldValues> {
|
|
|
16
16
|
dropdownStyle?: React.CSSProperties;
|
|
17
17
|
showChevron?: boolean;
|
|
18
18
|
size?: 'sm' | 'md';
|
|
19
|
+
required?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export interface SelectInputFieldProps {
|
|
21
22
|
options: Option[];
|
|
@@ -30,4 +31,5 @@ export interface SelectInputFieldProps {
|
|
|
30
31
|
dropdownStyle?: React.CSSProperties;
|
|
31
32
|
showChevron?: boolean;
|
|
32
33
|
size?: 'sm' | 'md';
|
|
34
|
+
required?: boolean;
|
|
33
35
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { TextInputProps } from './TextInput.types';
|
|
3
3
|
import { FieldValues } from 'react-hook-form';
|
|
4
|
-
declare const TextInput: <T extends FieldValues = FieldValues>({ label, control, name, placeholder, className, disabled, leftSide, rightSide, translateKey, size, ...props }: TextInputProps<T>) => React.ReactElement;
|
|
4
|
+
declare const TextInput: <T extends FieldValues = FieldValues>({ label, control, name, placeholder, className, disabled, leftSide, rightSide, translateKey, size, required, ...props }: TextInputProps<T>) => React.ReactElement;
|
|
5
5
|
export default TextInput;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { j as l } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { useController as
|
|
2
|
+
import { useController as N } from "react-hook-form";
|
|
3
3
|
import { useTheme as v } from "../../../hooks/useTheme.js";
|
|
4
4
|
import "react";
|
|
5
|
-
const
|
|
5
|
+
const T = ({
|
|
6
6
|
label: a,
|
|
7
|
-
control:
|
|
7
|
+
control: d,
|
|
8
8
|
name: e,
|
|
9
|
-
placeholder:
|
|
9
|
+
placeholder: p,
|
|
10
10
|
className: i = "",
|
|
11
11
|
disabled: t = !1,
|
|
12
12
|
leftSide: n,
|
|
13
13
|
rightSide: u,
|
|
14
|
-
translateKey:
|
|
15
|
-
size:
|
|
16
|
-
|
|
14
|
+
translateKey: g = "",
|
|
15
|
+
size: m = "md",
|
|
16
|
+
required: c = !1,
|
|
17
|
+
...f
|
|
17
18
|
}) => {
|
|
18
19
|
const {
|
|
19
|
-
field: { value:
|
|
20
|
+
field: { value: x = "", onChange: b, ref: h, onBlur: $ },
|
|
20
21
|
fieldState: { error: r }
|
|
21
|
-
} =
|
|
22
|
+
} = N({ name: e, control: d }), { t: s } = v(), o = {
|
|
22
23
|
sm: {
|
|
23
24
|
container: "px-16 py-8",
|
|
24
25
|
text: "text-sm",
|
|
@@ -33,18 +34,21 @@ const S = ({
|
|
|
33
34
|
error: "text-sm",
|
|
34
35
|
gap: "gap-8"
|
|
35
36
|
}
|
|
36
|
-
}[
|
|
37
|
+
}[m], y = s(e), j = s(g);
|
|
37
38
|
return /* @__PURE__ */ l.jsxs(
|
|
38
39
|
"label",
|
|
39
40
|
{
|
|
40
41
|
className: `flex flex-col group select-none ${o.gap} ${t && "cursor-not-allowed"} ${i}`,
|
|
41
42
|
htmlFor: e,
|
|
42
43
|
children: [
|
|
43
|
-
a && /* @__PURE__ */ l.
|
|
44
|
+
a && /* @__PURE__ */ l.jsxs(
|
|
44
45
|
"h6",
|
|
45
46
|
{
|
|
46
47
|
className: `text-gray-600 font-600 leading-none group ${r && "text-red-500!"} ${o.label} ${t && "text-gray-300"}`,
|
|
47
|
-
children:
|
|
48
|
+
children: [
|
|
49
|
+
a,
|
|
50
|
+
c && /* @__PURE__ */ l.jsx("span", { className: "text-red-500 ml-4", children: "*" })
|
|
51
|
+
]
|
|
48
52
|
}
|
|
49
53
|
),
|
|
50
54
|
/* @__PURE__ */ l.jsxs(
|
|
@@ -60,7 +64,7 @@ const S = ({
|
|
|
60
64
|
|
|
61
65
|
rounded-full border
|
|
62
66
|
|
|
63
|
-
${
|
|
67
|
+
${x && !t ? "border-blue-200" : "border-blue-100"}
|
|
64
68
|
${!t && "group-hover:border-blue-300"}
|
|
65
69
|
${t && "cursor-not-allowed"}
|
|
66
70
|
|
|
@@ -76,24 +80,25 @@ const S = ({
|
|
|
76
80
|
id: e,
|
|
77
81
|
name: e,
|
|
78
82
|
disabled: t,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
required: c,
|
|
84
|
+
placeholder: p,
|
|
85
|
+
value: x,
|
|
86
|
+
onChange: (w) => b(w.target.value),
|
|
87
|
+
onBlur: $,
|
|
88
|
+
ref: h,
|
|
84
89
|
className: `group bg-transparent w-full h-full font-600 placeholder:font-600 select-text ${o.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-hidden`,
|
|
85
|
-
...
|
|
90
|
+
...f
|
|
86
91
|
}
|
|
87
92
|
),
|
|
88
93
|
u && u
|
|
89
94
|
]
|
|
90
95
|
}
|
|
91
96
|
),
|
|
92
|
-
(r == null ? void 0 : r.message) && /* @__PURE__ */ l.jsx("h4", { className: `font-500 text-red-500 leading-none ${o.error}`, children: s(r.message, { x:
|
|
97
|
+
(r == null ? void 0 : r.message) && /* @__PURE__ */ l.jsx("h4", { className: `font-500 text-red-500 leading-none ${o.error}`, children: s(r.message, { x: j || y }) })
|
|
93
98
|
]
|
|
94
99
|
}
|
|
95
100
|
);
|
|
96
101
|
};
|
|
97
102
|
export {
|
|
98
|
-
|
|
103
|
+
T as default
|
|
99
104
|
};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useTheme as
|
|
1
|
+
import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useTheme as b } from "../../../hooks/useTheme.js";
|
|
3
3
|
import "react";
|
|
4
|
-
const
|
|
5
|
-
label:
|
|
6
|
-
onChange:
|
|
7
|
-
value:
|
|
8
|
-
name:
|
|
4
|
+
const N = ({
|
|
5
|
+
label: s,
|
|
6
|
+
onChange: i,
|
|
7
|
+
value: n,
|
|
8
|
+
name: r,
|
|
9
9
|
error: l,
|
|
10
|
-
placeholder:
|
|
11
|
-
className:
|
|
10
|
+
placeholder: g,
|
|
11
|
+
className: d = "",
|
|
12
12
|
disabled: e = !1,
|
|
13
13
|
disabledInput: a = !1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
required: c = !1,
|
|
15
|
+
size: m = "md",
|
|
16
|
+
leftSide: x,
|
|
17
|
+
rightSide: p,
|
|
18
|
+
...f
|
|
18
19
|
}) => {
|
|
19
|
-
const { t: u } =
|
|
20
|
+
const { t: u } = b(), o = {
|
|
20
21
|
sm: {
|
|
21
22
|
container: "px-16 py-8",
|
|
22
23
|
text: "text-sm",
|
|
@@ -31,28 +32,31 @@ const w = ({
|
|
|
31
32
|
error: "text-14",
|
|
32
33
|
gap: "gap-8"
|
|
33
34
|
}
|
|
34
|
-
}[
|
|
35
|
-
return /* @__PURE__ */
|
|
35
|
+
}[m];
|
|
36
|
+
return /* @__PURE__ */ t.jsxs(
|
|
36
37
|
"label",
|
|
37
38
|
{
|
|
38
|
-
className: `flex flex-col group select-none ${
|
|
39
|
-
htmlFor:
|
|
39
|
+
className: `flex flex-col group select-none ${o.gap} ${e && "cursor-not-allowed"} ${d}`,
|
|
40
|
+
htmlFor: r,
|
|
40
41
|
children: [
|
|
41
|
-
|
|
42
|
+
s && /* @__PURE__ */ t.jsxs(
|
|
42
43
|
"h6",
|
|
43
44
|
{
|
|
44
|
-
className: `text-gray-600 font-600 leading-none group ${l && "!text-red-500"} ${
|
|
45
|
-
children:
|
|
45
|
+
className: `text-gray-600 font-600 leading-none group ${l && "!text-red-500"} ${o.label} ${e && "text-gray-300"}`,
|
|
46
|
+
children: [
|
|
47
|
+
s,
|
|
48
|
+
c && /* @__PURE__ */ t.jsx("span", { className: "text-red-500 ml-4", children: "*" })
|
|
49
|
+
]
|
|
46
50
|
}
|
|
47
51
|
),
|
|
48
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ t.jsxs(
|
|
49
53
|
"label",
|
|
50
54
|
{
|
|
51
|
-
htmlFor:
|
|
55
|
+
htmlFor: r,
|
|
52
56
|
className: `
|
|
53
57
|
flex items-center justify-between gap-8 bg-light
|
|
54
|
-
${
|
|
55
|
-
${
|
|
58
|
+
${o.container} ${l && "!border-red-500"} rounded-full border
|
|
59
|
+
${n && !e ? "border-blue-200" : "border-blue-100"}
|
|
56
60
|
${!e && "group-hover:border-blue-300"}
|
|
57
61
|
${e && "cursor-not-allowed"}
|
|
58
62
|
|
|
@@ -61,31 +65,32 @@ const w = ({
|
|
|
61
65
|
group-disabled:bg-gray-500
|
|
62
66
|
`,
|
|
63
67
|
children: [
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */
|
|
68
|
+
x && x,
|
|
69
|
+
/* @__PURE__ */ t.jsx(
|
|
66
70
|
"input",
|
|
67
71
|
{
|
|
68
|
-
...
|
|
69
|
-
id:
|
|
70
|
-
name:
|
|
72
|
+
...f,
|
|
73
|
+
id: r,
|
|
74
|
+
name: r,
|
|
71
75
|
disabled: e,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
required: c,
|
|
77
|
+
placeholder: g,
|
|
78
|
+
value: n,
|
|
79
|
+
onChange: (h) => {
|
|
80
|
+
i(h.target.value);
|
|
76
81
|
},
|
|
77
|
-
className: `group bg-transparent w-full h-full font-600 placeholder:font-600 select-text ${
|
|
82
|
+
className: `group bg-transparent w-full h-full font-600 placeholder:font-600 select-text ${o.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none ${a && "pointer-events-none !select-none !caret-transparent"}`
|
|
78
83
|
}
|
|
79
84
|
),
|
|
80
|
-
|
|
85
|
+
p && p
|
|
81
86
|
]
|
|
82
87
|
}
|
|
83
88
|
),
|
|
84
|
-
l && /* @__PURE__ */
|
|
89
|
+
l && /* @__PURE__ */ t.jsx("h4", { className: `font-500 text-red-500 leading-none ${o.error}`, children: u(l, { x: u(r) }) })
|
|
85
90
|
]
|
|
86
91
|
}
|
|
87
92
|
);
|
|
88
93
|
};
|
|
89
94
|
export {
|
|
90
|
-
|
|
95
|
+
N as default
|
|
91
96
|
};
|