@dgshahr/ui-kit 0.0.40 → 0.0.42
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/Form/Input/index.cjs +1 -1
- package/dist/Form/Input/index.d.ts +1 -2
- package/dist/Form/Input/index.d.ts.map +1 -1
- package/dist/Form/Input/index.js +75 -65
- package/dist/Form/OtpInput/index.cjs +1 -1
- package/dist/Form/OtpInput/index.d.ts.map +1 -1
- package/dist/Form/OtpInput/index.js +46 -46
- package/dist/Form/Textarea/index.cjs +1 -1
- package/dist/Form/Textarea/index.d.ts.map +1 -1
- package/dist/Form/Textarea/index.js +23 -13
- package/dist/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.d.ts +4 -10
- package/dist/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.d.ts.map +1 -1
- package/dist/TextFieldWrapper-456xYy38.cjs +1 -0
- package/dist/{TextFieldWrapper-D9d-4wo1.js → TextFieldWrapper-DXAGbpBx.js} +62 -62
- package/package.json +1 -1
- package/dist/TextFieldWrapper-BbzQMKCb.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),h=require("../../clsx-C11secjj.cjs"),p=require("react"),f=require("../../TextFieldWrapper-456xYy38.cjs"),C=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...t,children:[e.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m15.456 9.595-5.852 5.852-1.061-1.06 5.853-5.853z",clipRule:"evenodd"}),e.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m9.6 8.532 5.856 5.858-1.06 1.06-5.857-5.857z",clipRule:"evenodd"}),e.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12m10-8.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17",clipRule:"evenodd"})]}),y=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...t,children:[e.jsx("path",{fill:"currentColor",d:"M12.247 20.812c-4.033 0-7.654-2.828-9.686-7.558a.75.75 0 0 1 0-.592c2.034-4.732 5.655-7.557 9.687-7.557s7.657 2.825 9.69 7.557a.75.75 0 0 1 0 .592c-2.032 4.73-5.653 7.554-9.685 7.557zm-8.182-7.853c1.806 3.983 4.846 6.352 8.18 6.352 3.334.002 6.373-2.369 8.18-6.352-1.808-3.986-4.848-6.354-8.182-6.354s-6.37 2.368-8.176 6.354z"}),e.jsx("path",{fill:"currentColor",d:"M12.247 16.789a3.825 3.825 0 1 1 0-7.651 3.825 3.825 0 0 1 0 7.65m0-6.152a2.326 2.326 0 1 0 0 4.651 2.326 2.326 0 0 0 0-4.651"})]}),R=t=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...t,children:e.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20.417 3.22a.75.75 0 0 1 0 1.06L4.643 20.055a.744.744 0 0 1-1.06 0 .75.75 0 0 1 0-1.06l1.972-1.971c-1.413-1.293-2.613-3.036-3.493-5.089a.75.75 0 0 1 0-.593C3.082 8.977 4.52 7.02 6.22 5.683c3.292-2.606 7.621-2.744 11.048-.375l2.088-2.088a.75.75 0 0 1 1.06 0m-.37 4.82c.724.962 1.36 2.073 1.891 3.299a.74.74 0 0 1 0 .595C19.842 16.79 16.128 19.69 12 19.69a8.8 8.8 0 0 1-2.769-.451.75.75 0 0 1 .474-1.424A7.3 7.3 0 0 0 12 18.19c3.428 0 6.561-2.442 8.43-6.553a14.5 14.5 0 0 0-1.58-2.694.75.75 0 0 1 1.197-.902M7.15 6.862c-1.437 1.13-2.67 2.776-3.58 4.778.794 1.752 1.836 3.23 3.047 4.322l2.138-2.138a3.87 3.87 0 0 1-.67-2.184A3.92 3.92 0 0 1 12 7.722a3.9 3.9 0 0 1 2.187.669l2.001-2.002c-2.853-1.844-6.325-1.676-9.038.472m8.088 4.6a.75.75 0 0 1 .606.872 3.92 3.92 0 0 1-3.141 3.147.75.75 0 0 1-.268-1.476 2.41 2.41 0 0 0 1.932-1.937.754.754 0 0 1 .87-.606M12 9.221a2.418 2.418 0 0 0-2.152 3.509l3.245-3.246A2.4 2.4 0 0 0 12 9.222",clipRule:"evenodd"})}),I=p.forwardRef(function(a,m){const{dir:l="rtl",placeholderDir:w=l,containerClassName:v,leftIcon:d,prefix:u,postfix:x,onClear:n,value:r,...s}=a,j=f.omitObject(s,["labelAddon","labelContent","link","rightIcon","isError","errorMessage","hintMessage","wrapperClassName","showMaxLength"]),[c,k]=p.useState(s.type);function g(){return e.jsx("button",{onClick:()=>{typeof n=="function"&&n()},children:e.jsx(C,{className:"dgs-ui-kit-text-gray-600",width:20,height:20})})}return e.jsxs(f.TextFieldWrapper,{...a,containerClassName:h.clsx("dgs-ui-kit-items-center",v),value:r,children:[u&&e.jsx("span",{className:"dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500",children:u}),typeof n=="function"&&r&&l==="ltr"&&g(),e.jsx("input",{...j,ref:m,className:h.clsx("dgs-ui-kit-bg-transparent focus:dgs-ui-kit-outline-none dgs-ui-kit-flex-1",l==="rtl"?"dgs-ui-kit-text-right":"!dgs-ui-kit-text-left",w==="rtl"?"placeholder:dgs-ui-kit-text-right":"placeholder:dgs-ui-kit-text-left",{ss02:s.type!="password"},a.className),...l==="ltr"?{style:{direction:"ltr"}}:{},value:r,type:c,onInput:o=>{if(typeof s.onInput=="function"&&s.onInput(o),c!=="number")return;const i=o.currentTarget;i.value.length>i.maxLength&&(i.value=i.value.slice(0,i.maxLength))}}),typeof n=="function"&&r&&l==="rtl"&&g(),x&&e.jsx("span",{className:"dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500",children:x}),d&&e.jsx("div",{className:"dgs-ui-kit-text-gray-600",children:d}),s.type==="password"&&e.jsx("button",{onClick:()=>k(o=>o==="text"?"password":"text"),className:"dgs-ui-kit-text-gray-600",children:c==="password"?e.jsx(y,{width:20,height:20}):e.jsx(R,{width:20,height:20})})]})});module.exports=I;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
import { TextFieldBaseProps } from '../Wrappers/TextFieldWrapper/TextFieldWrapper';
|
|
3
|
-
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dir'>, TextFieldBaseProps {
|
|
3
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dir'>, TextFieldBaseProps {
|
|
4
4
|
leftIcon?: JSX.Element;
|
|
5
5
|
prefix?: string;
|
|
6
6
|
postfix?: string;
|
|
7
|
-
isClearOption?: boolean;
|
|
8
7
|
onClear?: () => void;
|
|
9
8
|
}
|
|
10
9
|
declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Input/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,mBAAmB,EAAwB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Input/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,mBAAmB,EAAwB,MAAM,OAAO,CAAC;AAM1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAExF,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,EACxD,kBAAkB;IACpB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,QAAA,MAAM,KAAK,yGAsGT,CAAC;AACH,eAAe,KAAK,CAAC"}
|
package/dist/Form/Input/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { T as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { c as f } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { forwardRef as C, useState as y } from "react";
|
|
4
|
+
import { o as I, T as N } from "../../TextFieldWrapper-DXAGbpBx.js";
|
|
5
|
+
const M = (t) => /* @__PURE__ */ d(
|
|
6
6
|
"svg",
|
|
7
7
|
{
|
|
8
8
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10,9 +10,9 @@ const b = (e) => /* @__PURE__ */ c(
|
|
|
10
10
|
height: "1em",
|
|
11
11
|
fill: "none",
|
|
12
12
|
viewBox: "0 0 24 24",
|
|
13
|
-
...
|
|
13
|
+
...t,
|
|
14
14
|
children: [
|
|
15
|
-
/* @__PURE__ */
|
|
15
|
+
/* @__PURE__ */ e(
|
|
16
16
|
"path",
|
|
17
17
|
{
|
|
18
18
|
fill: "currentColor",
|
|
@@ -21,7 +21,7 @@ const b = (e) => /* @__PURE__ */ c(
|
|
|
21
21
|
clipRule: "evenodd"
|
|
22
22
|
}
|
|
23
23
|
),
|
|
24
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ e(
|
|
25
25
|
"path",
|
|
26
26
|
{
|
|
27
27
|
fill: "currentColor",
|
|
@@ -30,7 +30,7 @@ const b = (e) => /* @__PURE__ */ c(
|
|
|
30
30
|
clipRule: "evenodd"
|
|
31
31
|
}
|
|
32
32
|
),
|
|
33
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ e(
|
|
34
34
|
"path",
|
|
35
35
|
{
|
|
36
36
|
fill: "currentColor",
|
|
@@ -41,7 +41,7 @@ const b = (e) => /* @__PURE__ */ c(
|
|
|
41
41
|
)
|
|
42
42
|
]
|
|
43
43
|
}
|
|
44
|
-
),
|
|
44
|
+
), R = (t) => /* @__PURE__ */ d(
|
|
45
45
|
"svg",
|
|
46
46
|
{
|
|
47
47
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -49,16 +49,16 @@ const b = (e) => /* @__PURE__ */ c(
|
|
|
49
49
|
height: "1em",
|
|
50
50
|
fill: "none",
|
|
51
51
|
viewBox: "0 0 24 24",
|
|
52
|
-
...
|
|
52
|
+
...t,
|
|
53
53
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ e(
|
|
55
55
|
"path",
|
|
56
56
|
{
|
|
57
57
|
fill: "currentColor",
|
|
58
58
|
d: "M12.247 20.812c-4.033 0-7.654-2.828-9.686-7.558a.75.75 0 0 1 0-.592c2.034-4.732 5.655-7.557 9.687-7.557s7.657 2.825 9.69 7.557a.75.75 0 0 1 0 .592c-2.032 4.73-5.653 7.554-9.685 7.557zm-8.182-7.853c1.806 3.983 4.846 6.352 8.18 6.352 3.334.002 6.373-2.369 8.18-6.352-1.808-3.986-4.848-6.354-8.182-6.354s-6.37 2.368-8.176 6.354z"
|
|
59
59
|
}
|
|
60
60
|
),
|
|
61
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ e(
|
|
62
62
|
"path",
|
|
63
63
|
{
|
|
64
64
|
fill: "currentColor",
|
|
@@ -67,7 +67,7 @@ const b = (e) => /* @__PURE__ */ c(
|
|
|
67
67
|
)
|
|
68
68
|
]
|
|
69
69
|
}
|
|
70
|
-
),
|
|
70
|
+
), b = (t) => /* @__PURE__ */ e(
|
|
71
71
|
"svg",
|
|
72
72
|
{
|
|
73
73
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -75,8 +75,8 @@ const b = (e) => /* @__PURE__ */ c(
|
|
|
75
75
|
height: "1em",
|
|
76
76
|
fill: "none",
|
|
77
77
|
viewBox: "0 0 24 24",
|
|
78
|
-
...
|
|
79
|
-
children: /* @__PURE__ */
|
|
78
|
+
...t,
|
|
79
|
+
children: /* @__PURE__ */ e(
|
|
80
80
|
"path",
|
|
81
81
|
{
|
|
82
82
|
fill: "currentColor",
|
|
@@ -86,27 +86,37 @@ const b = (e) => /* @__PURE__ */ c(
|
|
|
86
86
|
}
|
|
87
87
|
)
|
|
88
88
|
}
|
|
89
|
-
),
|
|
89
|
+
), T = C(function(a, m) {
|
|
90
90
|
const {
|
|
91
|
-
dir:
|
|
92
|
-
placeholderDir:
|
|
93
|
-
containerClassName:
|
|
91
|
+
dir: i = "rtl",
|
|
92
|
+
placeholderDir: w = i,
|
|
93
|
+
containerClassName: x,
|
|
94
94
|
leftIcon: u,
|
|
95
|
-
prefix:
|
|
96
|
-
postfix:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
...
|
|
100
|
-
} =
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
prefix: p,
|
|
96
|
+
postfix: g,
|
|
97
|
+
onClear: r,
|
|
98
|
+
value: o,
|
|
99
|
+
...l
|
|
100
|
+
} = a, v = I(l, [
|
|
101
|
+
"labelAddon",
|
|
102
|
+
"labelContent",
|
|
103
|
+
"link",
|
|
104
|
+
"rightIcon",
|
|
105
|
+
"isError",
|
|
106
|
+
"errorMessage",
|
|
107
|
+
"hintMessage",
|
|
108
|
+
"wrapperClassName",
|
|
109
|
+
"showMaxLength"
|
|
110
|
+
]), [c, k] = y(l.type);
|
|
111
|
+
function h() {
|
|
112
|
+
return /* @__PURE__ */ e(
|
|
103
113
|
"button",
|
|
104
114
|
{
|
|
105
115
|
onClick: () => {
|
|
106
|
-
|
|
116
|
+
typeof r == "function" && r();
|
|
107
117
|
},
|
|
108
|
-
children: /* @__PURE__ */
|
|
109
|
-
|
|
118
|
+
children: /* @__PURE__ */ e(
|
|
119
|
+
M,
|
|
110
120
|
{
|
|
111
121
|
className: "dgs-ui-kit-text-gray-600",
|
|
112
122
|
width: 20,
|
|
@@ -116,55 +126,55 @@ const b = (e) => /* @__PURE__ */ c(
|
|
|
116
126
|
}
|
|
117
127
|
);
|
|
118
128
|
}
|
|
119
|
-
return /* @__PURE__ */
|
|
120
|
-
|
|
129
|
+
return /* @__PURE__ */ d(
|
|
130
|
+
N,
|
|
121
131
|
{
|
|
122
|
-
...
|
|
123
|
-
containerClassName:
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
p &&
|
|
127
|
-
|
|
132
|
+
...a,
|
|
133
|
+
containerClassName: f("dgs-ui-kit-items-center", x),
|
|
134
|
+
value: o,
|
|
135
|
+
children: [
|
|
136
|
+
p && /* @__PURE__ */ e("span", { className: "dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500", children: p }),
|
|
137
|
+
typeof r == "function" && o && i === "ltr" && h(),
|
|
138
|
+
/* @__PURE__ */ e(
|
|
128
139
|
"input",
|
|
129
140
|
{
|
|
130
|
-
...
|
|
131
|
-
ref:
|
|
132
|
-
className:
|
|
141
|
+
...v,
|
|
142
|
+
ref: m,
|
|
143
|
+
className: f(
|
|
133
144
|
"dgs-ui-kit-bg-transparent focus:dgs-ui-kit-outline-none dgs-ui-kit-flex-1",
|
|
134
|
-
|
|
135
|
-
|
|
145
|
+
i === "rtl" ? "dgs-ui-kit-text-right" : "!dgs-ui-kit-text-left",
|
|
146
|
+
w === "rtl" ? "placeholder:dgs-ui-kit-text-right" : "placeholder:dgs-ui-kit-text-left",
|
|
136
147
|
{
|
|
137
|
-
ss02:
|
|
148
|
+
ss02: l.type != "password"
|
|
138
149
|
},
|
|
139
|
-
|
|
150
|
+
a.className
|
|
140
151
|
),
|
|
141
|
-
...
|
|
142
|
-
value:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
r.value.length > r.maxLength && (r.value = r.value.slice(0, r.maxLength));
|
|
152
|
+
...i === "ltr" ? { style: { direction: "ltr" } } : {},
|
|
153
|
+
value: o,
|
|
154
|
+
type: c,
|
|
155
|
+
onInput: (s) => {
|
|
156
|
+
if (typeof l.onInput == "function" && l.onInput(s), c !== "number") return;
|
|
157
|
+
const n = s.currentTarget;
|
|
158
|
+
n.value.length > n.maxLength && (n.value = n.value.slice(0, n.maxLength));
|
|
149
159
|
}
|
|
150
160
|
}
|
|
151
161
|
),
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
u && /* @__PURE__ */
|
|
155
|
-
|
|
162
|
+
typeof r == "function" && o && i === "rtl" && h(),
|
|
163
|
+
g && /* @__PURE__ */ e("span", { className: "dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500", children: g }),
|
|
164
|
+
u && /* @__PURE__ */ e("div", { className: "dgs-ui-kit-text-gray-600", children: u }),
|
|
165
|
+
l.type === "password" && /* @__PURE__ */ e(
|
|
156
166
|
"button",
|
|
157
167
|
{
|
|
158
|
-
onClick: () =>
|
|
168
|
+
onClick: () => k((s) => s === "text" ? "password" : "text"),
|
|
159
169
|
className: "dgs-ui-kit-text-gray-600",
|
|
160
|
-
children:
|
|
161
|
-
|
|
170
|
+
children: c === "password" ? /* @__PURE__ */ e(
|
|
171
|
+
R,
|
|
162
172
|
{
|
|
163
173
|
width: 20,
|
|
164
174
|
height: 20
|
|
165
175
|
}
|
|
166
|
-
) : /* @__PURE__ */
|
|
167
|
-
|
|
176
|
+
) : /* @__PURE__ */ e(
|
|
177
|
+
b,
|
|
168
178
|
{
|
|
169
179
|
width: 20,
|
|
170
180
|
height: 20
|
|
@@ -172,10 +182,10 @@ const b = (e) => /* @__PURE__ */ c(
|
|
|
172
182
|
)
|
|
173
183
|
}
|
|
174
184
|
)
|
|
175
|
-
]
|
|
185
|
+
]
|
|
176
186
|
}
|
|
177
187
|
);
|
|
178
188
|
});
|
|
179
189
|
export {
|
|
180
|
-
|
|
190
|
+
T as default
|
|
181
191
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";require('../../assets/styles.css');const l=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";require('../../assets/styles.css');const l=require("react/jsx-runtime"),h=require("../../clsx-C11secjj.cjs"),k=require("react"),I=require("../Input/index.cjs"),m=require("../../TextFieldWrapper-456xYy38.cjs");;/* empty css */const v=y=>{const{inputsNumber:u=4,onChange:a,onEnd:f,className:j,inputsContainerClassName:C,labelContent:p,hintMessage:g,errorMessage:c,isError:w,value:n}=y,o=k.useRef(!1);function r(s){const e=document.getElementById(`dgs-ui-kit-otp-input-${s}`);e?.focus(),e?.select()}function E(s,e){const t=[s.code,s.key];if(t.includes("Backspace")||t.includes("Delete")){const i=n.split("");i[e]="",e!==0&&(i[e-1]="",r(e-1)),a(i.join(""))}else t.includes("ArrowLeft")?r(e-1):t.includes("ArrowRight")&&r(e+1)}function N(s,e){const t=s.currentTarget.value,i=n.split("");t.length>1?t.split("").forEach((q,d)=>{d<u&&(i[d]=q)}):i[e]=t,a(i.join("")),e+1!==u&&t&&r(e+1)}return k.useEffect(()=>{n.length===u&&o.current?(o.current=!1,typeof f=="function"&&f(n)):n.length<u&&(o.current=!0)},[n]),l.jsxs("div",{className:h.clsx("dgs-ui-kit-space-y-2",j),children:[p?l.jsx(m.FieldLabel,{labelContent:p}):null,l.jsx("div",{className:h.clsx("dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2 [direction:ltr]",C),children:Array.from(Array(u).keys()).map((s,e)=>l.jsx(I,{containerClassName:"dgs-ui-kit-w-12 dgs-ui-kit-h-12 dgs-ui-kit-p-0",className:"dgs-ui-kit-w-full dgs-ui-kit-h-full !dgs-ui-kit-text-center placeholder:!dgs-ui-kit-text-center",placeholder:"-",type:"tel",autoFocus:e===0,onChange:t=>N(t,e),onKeyUp:t=>E(t,e),id:`dgs-ui-kit-otp-input-${e}`,value:n[e]||"",showMaxLength:!1,isError:!!c||w,autoComplete:"off",maxLength:1},s))}),c||g?l.jsx(m.FieldBottomInfo,{errorMessage:c,hintMessage:g}):null]})};module.exports=v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Form/OtpInput/index.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Form/OtpInput/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuC,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AAIzF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,kBAAkB,CAAC;AAE1B,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,cAAc,GAAG,cAAc,GAAG,SAAS,GAAG,aAAa,CAAC;IAC7F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA2G/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useEffect as
|
|
5
|
-
import
|
|
6
|
-
import { F as
|
|
2
|
+
import { jsxs as I, jsx as u } from "react/jsx-runtime";
|
|
3
|
+
import { c as d } from "../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { useRef as v, useEffect as j } from "react";
|
|
5
|
+
import A from "../Input/index.js";
|
|
6
|
+
import { F as B, a as F } from "../../TextFieldWrapper-DXAGbpBx.js";
|
|
7
7
|
import '../../assets/styles.css';/* empty css */
|
|
8
|
-
const
|
|
8
|
+
const R = (h) => {
|
|
9
9
|
const {
|
|
10
|
-
inputsNumber:
|
|
10
|
+
inputsNumber: l = 4,
|
|
11
11
|
onChange: c,
|
|
12
|
-
onEnd:
|
|
13
|
-
className:
|
|
14
|
-
inputsContainerClassName:
|
|
12
|
+
onEnd: f,
|
|
13
|
+
className: k,
|
|
14
|
+
inputsContainerClassName: y,
|
|
15
15
|
labelContent: p,
|
|
16
|
-
hintMessage:
|
|
16
|
+
hintMessage: g,
|
|
17
17
|
errorMessage: r,
|
|
18
|
-
isError:
|
|
19
|
-
value:
|
|
20
|
-
} =
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
|
|
18
|
+
isError: C,
|
|
19
|
+
value: i
|
|
20
|
+
} = h, a = v(!1);
|
|
21
|
+
function o(s) {
|
|
22
|
+
const e = document.getElementById(`dgs-ui-kit-otp-input-${s}`);
|
|
23
|
+
e?.focus(), e?.select();
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
} else
|
|
25
|
+
function w(s, e) {
|
|
26
|
+
const t = [s.code, s.key];
|
|
27
|
+
if (t.includes("Backspace") || t.includes("Delete")) {
|
|
28
|
+
const n = i.split("");
|
|
29
|
+
n[e] = "", e !== 0 && (n[e - 1] = "", o(e - 1)), c(n.join(""));
|
|
30
|
+
} else t.includes("ArrowLeft") ? o(e - 1) : t.includes("ArrowRight") && o(e + 1);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}) :
|
|
32
|
+
function E(s, e) {
|
|
33
|
+
const t = s.currentTarget.value, n = i.split("");
|
|
34
|
+
t.length > 1 ? t.split("").forEach((N, m) => {
|
|
35
|
+
m < l && (n[m] = N);
|
|
36
|
+
}) : n[e] = t, c(n.join("")), e + 1 !== l && t && o(e + 1);
|
|
37
37
|
}
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
}, [
|
|
41
|
-
p ? /* @__PURE__ */ u(
|
|
38
|
+
return j(() => {
|
|
39
|
+
i.length === l && a.current ? (a.current = !1, typeof f == "function" && f(i)) : i.length < l && (a.current = !0);
|
|
40
|
+
}, [i]), /* @__PURE__ */ I("div", { className: d("dgs-ui-kit-space-y-2", k), children: [
|
|
41
|
+
p ? /* @__PURE__ */ u(B, { labelContent: p }) : null,
|
|
42
42
|
/* @__PURE__ */ u(
|
|
43
43
|
"div",
|
|
44
44
|
{
|
|
45
|
-
className:
|
|
45
|
+
className: d(
|
|
46
46
|
"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2 [direction:ltr]",
|
|
47
|
-
|
|
47
|
+
y
|
|
48
48
|
),
|
|
49
|
-
children: Array.from(Array(
|
|
50
|
-
|
|
49
|
+
children: Array.from(Array(l).keys()).map((s, e) => /* @__PURE__ */ u(
|
|
50
|
+
A,
|
|
51
51
|
{
|
|
52
52
|
containerClassName: "dgs-ui-kit-w-12 dgs-ui-kit-h-12 dgs-ui-kit-p-0",
|
|
53
53
|
className: "dgs-ui-kit-w-full dgs-ui-kit-h-full !dgs-ui-kit-text-center placeholder:!dgs-ui-kit-text-center",
|
|
54
54
|
placeholder: "-",
|
|
55
55
|
type: "tel",
|
|
56
|
-
autoFocus:
|
|
57
|
-
onChange: (
|
|
58
|
-
onKeyUp: (
|
|
59
|
-
id: `dgs-ui-kit-otp-input-${
|
|
60
|
-
value:
|
|
56
|
+
autoFocus: e === 0,
|
|
57
|
+
onChange: (t) => E(t, e),
|
|
58
|
+
onKeyUp: (t) => w(t, e),
|
|
59
|
+
id: `dgs-ui-kit-otp-input-${e}`,
|
|
60
|
+
value: i[e] || "",
|
|
61
61
|
showMaxLength: !1,
|
|
62
|
-
isError: !!r ||
|
|
62
|
+
isError: !!r || C,
|
|
63
63
|
autoComplete: "off",
|
|
64
64
|
maxLength: 1
|
|
65
65
|
},
|
|
@@ -67,15 +67,15 @@ const K = (d) => {
|
|
|
67
67
|
))
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
|
-
r ||
|
|
71
|
-
|
|
70
|
+
r || g ? /* @__PURE__ */ u(
|
|
71
|
+
F,
|
|
72
72
|
{
|
|
73
73
|
errorMessage: r,
|
|
74
|
-
hintMessage:
|
|
74
|
+
hintMessage: g
|
|
75
75
|
}
|
|
76
76
|
) : null
|
|
77
77
|
] });
|
|
78
78
|
};
|
|
79
79
|
export {
|
|
80
|
-
|
|
80
|
+
R as default
|
|
81
81
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),u=require("../../clsx-C11secjj.cjs"),c=require("react"),i=require("../../TextFieldWrapper-456xYy38.cjs"),d=c.forwardRef(function(e,l){const{dir:t="rtl",placeholderDir:a=t,className:n,...r}=e,o=i.omitObject(r,["labelAddon","labelContent","link","rightIcon","isError","errorMessage","hintMessage","wrapperClassName","showMaxLength","containerClassName"]);return s.jsx(i.TextFieldWrapper,{...e,children:s.jsx("textarea",{...o,ref:l,className:u.clsx("dgs-ui-kit-bg-transparent dgs-ui-kit-w-full dgs-ui-kit-h-full focus:dgs-ui-kit-outline-none ss02 dgs-ui-kit-flex-1 dgs-ui-kit-resize-none",t==="rtl"?"dgs-ui-kit-text-right":"!dgs-ui-kit-text-left",a==="rtl"?"placeholder:dgs-ui-kit-text-right":"placeholder:dgs-ui-kit-text-left",n),rows:r.rows??5})})});module.exports=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Textarea/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,iBAAiB,EAEtB,KAAK,sBAAsB,EAC5B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Textarea/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,iBAAiB,EAEtB,KAAK,sBAAsB,EAC5B,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAGxF,UAAU,aACR,SAAQ,IAAI,CACR,iBAAiB,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC,EACnF,KAAK,GAAG,SAAS,CAClB,EACD,kBAAkB;CAAG;AAEzB,QAAA,MAAM,QAAQ,4HAmCZ,CAAC;AAEH,eAAe,QAAQ,CAAC"}
|
|
@@ -1,25 +1,35 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { T as
|
|
5
|
-
const
|
|
6
|
-
const { dir: e = "rtl", placeholderDir:
|
|
7
|
-
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { c as n } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { forwardRef as d } from "react";
|
|
4
|
+
import { o as u, T as g } from "../../TextFieldWrapper-DXAGbpBx.js";
|
|
5
|
+
const h = d(function(t, i) {
|
|
6
|
+
const { dir: e = "rtl", placeholderDir: a = e, className: o, ...r } = t, l = u(r, [
|
|
7
|
+
"labelAddon",
|
|
8
|
+
"labelContent",
|
|
9
|
+
"link",
|
|
10
|
+
"rightIcon",
|
|
11
|
+
"isError",
|
|
12
|
+
"errorMessage",
|
|
13
|
+
"hintMessage",
|
|
14
|
+
"wrapperClassName",
|
|
15
|
+
"showMaxLength",
|
|
16
|
+
"containerClassName"
|
|
17
|
+
]);
|
|
18
|
+
return /* @__PURE__ */ s(g, { ...t, children: /* @__PURE__ */ s(
|
|
8
19
|
"textarea",
|
|
9
20
|
{
|
|
10
|
-
...
|
|
11
|
-
ref:
|
|
12
|
-
className:
|
|
21
|
+
...l,
|
|
22
|
+
ref: i,
|
|
23
|
+
className: n(
|
|
13
24
|
"dgs-ui-kit-bg-transparent dgs-ui-kit-w-full dgs-ui-kit-h-full focus:dgs-ui-kit-outline-none ss02 dgs-ui-kit-flex-1 dgs-ui-kit-resize-none",
|
|
14
25
|
e === "rtl" ? "dgs-ui-kit-text-right" : "!dgs-ui-kit-text-left",
|
|
15
|
-
|
|
26
|
+
a === "rtl" ? "placeholder:dgs-ui-kit-text-right" : "placeholder:dgs-ui-kit-text-left",
|
|
16
27
|
o
|
|
17
28
|
),
|
|
18
|
-
onChange: a,
|
|
19
29
|
rows: r.rows ?? 5
|
|
20
30
|
}
|
|
21
31
|
) });
|
|
22
32
|
});
|
|
23
33
|
export {
|
|
24
|
-
|
|
34
|
+
h as default
|
|
25
35
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as React,
|
|
1
|
+
import { default as React, FC, ReactNode } from 'react';
|
|
2
2
|
export interface TextFieldBaseProps {
|
|
3
3
|
labelContent?: string;
|
|
4
4
|
labelAddon?: React.ReactNode;
|
|
@@ -16,20 +16,14 @@ export interface TextFieldBaseProps {
|
|
|
16
16
|
wrapperClassName?: string;
|
|
17
17
|
showMaxLength?: boolean;
|
|
18
18
|
}
|
|
19
|
-
interface
|
|
20
|
-
handleChangeField: (e: ChangeEvent<T>) => void;
|
|
21
|
-
value: string | undefined;
|
|
22
|
-
setValue: Dispatch<SetStateAction<string>>;
|
|
23
|
-
}
|
|
24
|
-
interface TextFieldWrapperProps<T> extends TextFieldBaseProps {
|
|
19
|
+
interface TextFieldWrapperProps extends TextFieldBaseProps {
|
|
25
20
|
required?: boolean;
|
|
26
21
|
disabled?: boolean;
|
|
27
22
|
maxLength?: number;
|
|
28
23
|
labelAddon?: React.ReactNode;
|
|
29
24
|
value?: string | number | readonly string[];
|
|
30
|
-
|
|
31
|
-
children: (argumants: TextFieldFunctionArgumants<T>) => ReactNode;
|
|
25
|
+
children: ReactNode;
|
|
32
26
|
}
|
|
33
|
-
declare const TextFieldWrapper: <
|
|
27
|
+
declare const TextFieldWrapper: FC<TextFieldWrapperProps>;
|
|
34
28
|
export default TextFieldWrapper;
|
|
35
29
|
//# sourceMappingURL=TextFieldWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFieldWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"TextFieldWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,OAAO,kBAAkB,CAAC;AAE1B,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,IAAI,CAAC,EAAE;QACL,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACxB,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACpB,cAAc,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,UAAU,qBAAsB,SAAQ,kBAAkB;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,QAAA,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAyE/C,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";require('./assets/styles.css');const e=require("react/jsx-runtime"),a=require("./clsx-C11secjj.cjs"),F=require("react");;/* empty css */function M(r,i){const t={...r};for(const s of i)delete t[s];return t}const q=r=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...r,children:[e.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.25 3.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5M2.5 12a9.75 9.75 0 0 1 9.75-9.75A9.75 9.75 0 0 1 22 12c0 5.384-4.365 9.75-9.75 9.75S2.5 17.384 2.5 12",clipRule:"evenodd"}),e.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.25 7.541a.75.75 0 0 1 .75.75v.063a.75.75 0 0 1-1.5 0v-.063a.75.75 0 0 1 .75-.75m.006 3.103a.75.75 0 0 1 .75.75v4.3a.75.75 0 0 1-1.5 0v-4.3a.75.75 0 0 1 .75-.75",clipRule:"evenodd"})]}),p=r=>{const{errorMessage:i,hintMessage:t,maxLength:s,value:d,disabled:n}=r;return e.jsxs("div",{className:a.clsx("dgs-ui-kit-flex dgs-ui-kit-font-p3-regular",{"dgs-ui-kit-justify-between":(i||t)&&s,"dgs-ui-kit-justify-start":(i||t)&&!s,"dgs-ui-kit-justify-end":!(i||t)&&s,"dgs-ui-kit-text-gray-400":n},i?"dgs-ui-kit-text-error-500":"dgs-ui-kit-text-gray-500"),children:[(i||t)&&e.jsxs("div",{className:a.clsx("dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2 dgs-ui-kit-font-light",{"dgs-ui-kit-text-gray-400":n}),children:[e.jsx(q,{width:16,height:16}),e.jsx("span",{children:i||t})]}),s&&e.jsxs("span",{className:"ss02",children:[d?.length??0,"/",s]})]})},j=r=>{const{link:i,labelContent:t,required:s,disabled:d,children:n}=r;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:a.clsx("dgs-ui-kit-flex",{"dgs-ui-kit-justify-between":t&&i?.href,"dgs-ui-kit-mb-2":!n,"dgs-ui-kit-justify-start":t&&!i?.href,"dgs-ui-kit-justify-end":!t&&i?.href,"dgs-ui-kit-text-gray-400":d}),children:[t&&e.jsxs("label",{className:"dgs-ui-kit-px-0 dgs-ui-kit-font-p2-medium md:dgs-ui-kit-mx-0",children:[t,s&&e.jsx("span",{className:"dgs-ui-kit-ms-2 dgs-ui-kit-text-error-500",children:"*"})]}),i?.href&&e.jsx("a",{href:i.href,className:"dgs-ui-kit-font-button-small dgs-ui-kit-text-primary-400",children:i.cnotent})]}),n]})},I=r=>{const{labelContent:i,link:t,containerClassName:s,rightIcon:d,isError:n,errorMessage:u,hintMessage:o,required:v,labelAddon:b,maxLength:g,disabled:l,value:y,wrapperClassName:c,showMaxLength:k,children:w}=r,h=!!(u||o||g&&k),x=!!(i||t?.href),m=h||x?"div":F.Fragment,N=C=>{const f=C.currentTarget.querySelector("textarea, input");f&&f.focus()};return e.jsxs(m,{...m==="div"&&c?{className:c}:{},children:[x&&e.jsx(j,{disabled:l,labelContent:i,link:t,required:v,children:b}),e.jsxs("div",{onClick:N,className:a.clsx(`dgs-ui-kit-relative dgs-ui-kit-cursor-text dgs-ui-kit-border dgs-ui-kit-border-solid dgs-ui-kit-rounded-lg dgs-ui-kit-ring-4 dgs-ui-kit-flex dgs-ui-kit-justify-between dgs-ui-kit-gap-x-3 dgs-ui-kit-p-3 dgs-ui-kit-bg-gray-100 dgs-ui-kit-transition-all dgs-ui-kit-ring-transparent has-[:focus]:dgs-ui-kit-bg-white ${!l&&"hover:dgs-ui-kit-ring-gray-50"}`,n||u?"dgs-ui-kit-border-error-500 has-[:focus]:dgs-ui-kit-ring-error-50":`dgs-ui-kit-border-transparent has-[:focus]:dgs-ui-kit-border-primary-500 has-[:focus]:dgs-ui-kit-ring-primary-50 ${!l&&"hover:dgs-ui-kit-border-gray-300"}`,s,{"dgs-ui-kit-text-gray-400":l}),children:[d&&e.jsx("div",{className:"dgs-ui-kit-text-gray-600",children:d}),w]}),h&&e.jsx(p,{disabled:l,errorMessage:u,hintMessage:o,maxLength:k?g:void 0,value:y?.toString()})]})};exports.FieldBottomInfo=p;exports.FieldLabel=j;exports.TextFieldWrapper=I;exports.omitObject=M;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as r, jsx as n, Fragment as j } from "react/jsx-runtime";
|
|
3
3
|
import { c as o } from "./clsx-OuTLNxxd.js";
|
|
4
|
-
import
|
|
4
|
+
import C from "react";
|
|
5
5
|
import './assets/styles.css';/* empty css */
|
|
6
|
-
|
|
6
|
+
function S(s, i) {
|
|
7
|
+
const e = { ...s };
|
|
8
|
+
for (const t of i)
|
|
9
|
+
delete e[t];
|
|
10
|
+
return e;
|
|
11
|
+
}
|
|
12
|
+
const F = (s) => /* @__PURE__ */ r(
|
|
7
13
|
"svg",
|
|
8
14
|
{
|
|
9
15
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -11,9 +17,9 @@ const S = (n) => /* @__PURE__ */ s(
|
|
|
11
17
|
height: "1em",
|
|
12
18
|
fill: "none",
|
|
13
19
|
viewBox: "0 0 24 24",
|
|
14
|
-
...
|
|
20
|
+
...s,
|
|
15
21
|
children: [
|
|
16
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ n(
|
|
17
23
|
"path",
|
|
18
24
|
{
|
|
19
25
|
fill: "currentColor",
|
|
@@ -22,7 +28,7 @@ const S = (n) => /* @__PURE__ */ s(
|
|
|
22
28
|
clipRule: "evenodd"
|
|
23
29
|
}
|
|
24
30
|
),
|
|
25
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ n(
|
|
26
32
|
"path",
|
|
27
33
|
{
|
|
28
34
|
fill: "currentColor",
|
|
@@ -33,9 +39,9 @@ const S = (n) => /* @__PURE__ */ s(
|
|
|
33
39
|
)
|
|
34
40
|
]
|
|
35
41
|
}
|
|
36
|
-
),
|
|
37
|
-
const { errorMessage: i, hintMessage: e, maxLength: t, value: a, disabled: d } =
|
|
38
|
-
return /* @__PURE__ */
|
|
42
|
+
), M = (s) => {
|
|
43
|
+
const { errorMessage: i, hintMessage: e, maxLength: t, value: a, disabled: d } = s;
|
|
44
|
+
return /* @__PURE__ */ r(
|
|
39
45
|
"div",
|
|
40
46
|
{
|
|
41
47
|
className: o(
|
|
@@ -49,7 +55,7 @@ const S = (n) => /* @__PURE__ */ s(
|
|
|
49
55
|
i ? "dgs-ui-kit-text-error-500" : "dgs-ui-kit-text-gray-500"
|
|
50
56
|
),
|
|
51
57
|
children: [
|
|
52
|
-
(i || e) && /* @__PURE__ */
|
|
58
|
+
(i || e) && /* @__PURE__ */ r(
|
|
53
59
|
"div",
|
|
54
60
|
{
|
|
55
61
|
className: o(
|
|
@@ -59,18 +65,18 @@ const S = (n) => /* @__PURE__ */ s(
|
|
|
59
65
|
}
|
|
60
66
|
),
|
|
61
67
|
children: [
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
68
|
+
/* @__PURE__ */ n(
|
|
69
|
+
F,
|
|
64
70
|
{
|
|
65
71
|
width: 16,
|
|
66
72
|
height: 16
|
|
67
73
|
}
|
|
68
74
|
),
|
|
69
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ n("span", { children: i || e })
|
|
70
76
|
]
|
|
71
77
|
}
|
|
72
78
|
),
|
|
73
|
-
t && /* @__PURE__ */
|
|
79
|
+
t && /* @__PURE__ */ r("span", { className: "ss02", children: [
|
|
74
80
|
a?.length ?? 0,
|
|
75
81
|
"/",
|
|
76
82
|
t
|
|
@@ -78,10 +84,10 @@ const S = (n) => /* @__PURE__ */ s(
|
|
|
78
84
|
]
|
|
79
85
|
}
|
|
80
86
|
);
|
|
81
|
-
},
|
|
82
|
-
const { link: i, labelContent: e, required: t, disabled: a, children: d } =
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
87
|
+
}, I = (s) => {
|
|
88
|
+
const { link: i, labelContent: e, required: t, disabled: a, children: d } = s;
|
|
89
|
+
return /* @__PURE__ */ r(j, { children: [
|
|
90
|
+
/* @__PURE__ */ r(
|
|
85
91
|
"div",
|
|
86
92
|
{
|
|
87
93
|
className: o("dgs-ui-kit-flex", {
|
|
@@ -92,11 +98,11 @@ const S = (n) => /* @__PURE__ */ s(
|
|
|
92
98
|
"dgs-ui-kit-text-gray-400": a
|
|
93
99
|
}),
|
|
94
100
|
children: [
|
|
95
|
-
e && /* @__PURE__ */
|
|
101
|
+
e && /* @__PURE__ */ r("label", { className: "dgs-ui-kit-px-0 dgs-ui-kit-font-p2-medium md:dgs-ui-kit-mx-0", children: [
|
|
96
102
|
e,
|
|
97
|
-
t && /* @__PURE__ */
|
|
103
|
+
t && /* @__PURE__ */ n("span", { className: "dgs-ui-kit-ms-2 dgs-ui-kit-text-error-500", children: "*" })
|
|
98
104
|
] }),
|
|
99
|
-
i?.href && /* @__PURE__ */
|
|
105
|
+
i?.href && /* @__PURE__ */ n(
|
|
100
106
|
"a",
|
|
101
107
|
{
|
|
102
108
|
href: i.href,
|
|
@@ -109,75 +115,68 @@ const S = (n) => /* @__PURE__ */ s(
|
|
|
109
115
|
),
|
|
110
116
|
d
|
|
111
117
|
] });
|
|
112
|
-
},
|
|
118
|
+
}, T = (s) => {
|
|
113
119
|
const {
|
|
114
120
|
labelContent: i,
|
|
115
121
|
link: e,
|
|
116
122
|
containerClassName: t,
|
|
117
123
|
rightIcon: a,
|
|
118
124
|
isError: d,
|
|
119
|
-
errorMessage:
|
|
120
|
-
hintMessage:
|
|
121
|
-
required:
|
|
122
|
-
labelAddon:
|
|
123
|
-
maxLength:
|
|
125
|
+
errorMessage: u,
|
|
126
|
+
hintMessage: g,
|
|
127
|
+
required: v,
|
|
128
|
+
labelAddon: b,
|
|
129
|
+
maxLength: c,
|
|
124
130
|
disabled: l,
|
|
125
|
-
value:
|
|
126
|
-
wrapperClassName:
|
|
127
|
-
showMaxLength:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
typeof u < "u" && u !== null && h(u?.toString());
|
|
133
|
-
}, [u]);
|
|
134
|
-
const M = (g) => {
|
|
135
|
-
h(g.currentTarget.value), x && x(g);
|
|
136
|
-
}, b = !!(c || k || f && p), y = !!(i || e?.href), w = b || y ? "div" : E.Fragment;
|
|
137
|
-
return /* @__PURE__ */ s(
|
|
138
|
-
w,
|
|
131
|
+
value: y,
|
|
132
|
+
wrapperClassName: k,
|
|
133
|
+
showMaxLength: h,
|
|
134
|
+
children: w
|
|
135
|
+
} = s, m = !!(u || g || c && h), f = !!(i || e?.href), p = m || f ? "div" : C.Fragment;
|
|
136
|
+
return /* @__PURE__ */ r(
|
|
137
|
+
p,
|
|
139
138
|
{
|
|
140
|
-
...
|
|
139
|
+
...p === "div" && k ? { className: k } : {},
|
|
141
140
|
children: [
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
f && /* @__PURE__ */ n(
|
|
142
|
+
I,
|
|
144
143
|
{
|
|
145
144
|
disabled: l,
|
|
146
145
|
labelContent: i,
|
|
147
146
|
link: e,
|
|
148
|
-
required:
|
|
149
|
-
children:
|
|
147
|
+
required: v,
|
|
148
|
+
children: b
|
|
150
149
|
}
|
|
151
150
|
),
|
|
152
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ r(
|
|
153
152
|
"div",
|
|
154
153
|
{
|
|
155
|
-
onClick: (
|
|
156
|
-
const
|
|
157
|
-
|
|
154
|
+
onClick: (N) => {
|
|
155
|
+
const x = N.currentTarget.querySelector("textarea, input");
|
|
156
|
+
x && x.focus();
|
|
158
157
|
},
|
|
159
158
|
className: o(
|
|
160
159
|
`dgs-ui-kit-relative dgs-ui-kit-cursor-text dgs-ui-kit-border dgs-ui-kit-border-solid dgs-ui-kit-rounded-lg dgs-ui-kit-ring-4 dgs-ui-kit-flex dgs-ui-kit-justify-between dgs-ui-kit-gap-x-3 dgs-ui-kit-p-3 dgs-ui-kit-bg-gray-100 dgs-ui-kit-transition-all dgs-ui-kit-ring-transparent has-[:focus]:dgs-ui-kit-bg-white ${!l && "hover:dgs-ui-kit-ring-gray-50"}`,
|
|
161
|
-
d ||
|
|
160
|
+
d || u ? "dgs-ui-kit-border-error-500 has-[:focus]:dgs-ui-kit-ring-error-50" : `dgs-ui-kit-border-transparent has-[:focus]:dgs-ui-kit-border-primary-500 has-[:focus]:dgs-ui-kit-ring-primary-50 ${!l && "hover:dgs-ui-kit-border-gray-300"}`,
|
|
162
161
|
t,
|
|
163
162
|
{
|
|
164
163
|
"dgs-ui-kit-text-gray-400": l
|
|
165
164
|
}
|
|
166
165
|
),
|
|
167
166
|
children: [
|
|
168
|
-
a && /* @__PURE__ */
|
|
169
|
-
|
|
167
|
+
a && /* @__PURE__ */ n("div", { className: "dgs-ui-kit-text-gray-600", children: a }),
|
|
168
|
+
w
|
|
170
169
|
]
|
|
171
170
|
}
|
|
172
171
|
),
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
m && /* @__PURE__ */ n(
|
|
173
|
+
M,
|
|
175
174
|
{
|
|
176
175
|
disabled: l,
|
|
177
|
-
errorMessage:
|
|
178
|
-
hintMessage:
|
|
179
|
-
maxLength:
|
|
180
|
-
value:
|
|
176
|
+
errorMessage: u,
|
|
177
|
+
hintMessage: g,
|
|
178
|
+
maxLength: h ? c : void 0,
|
|
179
|
+
value: y?.toString()
|
|
181
180
|
}
|
|
182
181
|
)
|
|
183
182
|
]
|
|
@@ -185,7 +184,8 @@ const S = (n) => /* @__PURE__ */ s(
|
|
|
185
184
|
);
|
|
186
185
|
};
|
|
187
186
|
export {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
I as F,
|
|
188
|
+
T,
|
|
189
|
+
M as a,
|
|
190
|
+
S as o
|
|
191
191
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";require('./assets/styles.css');const e=require("react/jsx-runtime"),g=require("./clsx-C11secjj.cjs"),h=require("react");;/* empty css */const E=r=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...r,children:[e.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.25 3.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5M2.5 12a9.75 9.75 0 0 1 9.75-9.75A9.75 9.75 0 0 1 22 12c0 5.384-4.365 9.75-9.75 9.75S2.5 17.384 2.5 12",clipRule:"evenodd"}),e.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.25 7.541a.75.75 0 0 1 .75.75v.063a.75.75 0 0 1-1.5 0v-.063a.75.75 0 0 1 .75-.75m.006 3.103a.75.75 0 0 1 .75.75v4.3a.75.75 0 0 1-1.5 0v-4.3a.75.75 0 0 1 .75-.75",clipRule:"evenodd"})]}),N=r=>{const{errorMessage:i,hintMessage:t,maxLength:s,value:d,disabled:n}=r;return e.jsxs("div",{className:g.clsx("dgs-ui-kit-flex dgs-ui-kit-font-p3-regular",{"dgs-ui-kit-justify-between":(i||t)&&s,"dgs-ui-kit-justify-start":(i||t)&&!s,"dgs-ui-kit-justify-end":!(i||t)&&s,"dgs-ui-kit-text-gray-400":n},i?"dgs-ui-kit-text-error-500":"dgs-ui-kit-text-gray-500"),children:[(i||t)&&e.jsxs("div",{className:g.clsx("dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2 dgs-ui-kit-font-light",{"dgs-ui-kit-text-gray-400":n}),children:[e.jsx(E,{width:16,height:16}),e.jsx("span",{children:i||t})]}),s&&e.jsxs("span",{className:"ss02",children:[d?.length??0,"/",s]})]})},C=r=>{const{link:i,labelContent:t,required:s,disabled:d,children:n}=r;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:g.clsx("dgs-ui-kit-flex",{"dgs-ui-kit-justify-between":t&&i?.href,"dgs-ui-kit-mb-2":!n,"dgs-ui-kit-justify-start":t&&!i?.href,"dgs-ui-kit-justify-end":!t&&i?.href,"dgs-ui-kit-text-gray-400":d}),children:[t&&e.jsxs("label",{className:"dgs-ui-kit-px-0 dgs-ui-kit-font-p2-medium md:dgs-ui-kit-mx-0",children:[t,s&&e.jsx("span",{className:"dgs-ui-kit-ms-2 dgs-ui-kit-text-error-500",children:"*"})]}),i?.href&&e.jsx("a",{href:i.href,className:"dgs-ui-kit-font-button-small dgs-ui-kit-text-primary-400",children:i.cnotent})]}),n]})},R=r=>{const{labelContent:i,link:t,containerClassName:s,rightIcon:d,isError:n,errorMessage:o,hintMessage:k,required:F,labelAddon:M,maxLength:x,disabled:l,value:a,wrapperClassName:f,showMaxLength:m,onChange:p,children:q}=r,[v,c]=h.useState(a?.toString()??"");h.useEffect(()=>{typeof a<"u"&&a!==null&&c(a?.toString())},[a]);const I=u=>{c(u.currentTarget.value),p&&p(u)},j=!!(o||k||x&&m),b=!!(i||t?.href),y=j||b?"div":h.Fragment,L=u=>{const w=u.currentTarget.querySelector("textarea, input");w&&w.focus()};return e.jsxs(y,{...y==="div"&&f?{className:f}:{},children:[b&&e.jsx(C,{disabled:l,labelContent:i,link:t,required:F,children:M}),e.jsxs("div",{onClick:L,className:g.clsx(`dgs-ui-kit-relative dgs-ui-kit-cursor-text dgs-ui-kit-border dgs-ui-kit-border-solid dgs-ui-kit-rounded-lg dgs-ui-kit-ring-4 dgs-ui-kit-flex dgs-ui-kit-justify-between dgs-ui-kit-gap-x-3 dgs-ui-kit-p-3 dgs-ui-kit-bg-gray-100 dgs-ui-kit-transition-all dgs-ui-kit-ring-transparent has-[:focus]:dgs-ui-kit-bg-white ${!l&&"hover:dgs-ui-kit-ring-gray-50"}`,n||o?"dgs-ui-kit-border-error-500 has-[:focus]:dgs-ui-kit-ring-error-50":`dgs-ui-kit-border-transparent has-[:focus]:dgs-ui-kit-border-primary-500 has-[:focus]:dgs-ui-kit-ring-primary-50 ${!l&&"hover:dgs-ui-kit-border-gray-300"}`,s,{"dgs-ui-kit-text-gray-400":l}),children:[d&&e.jsx("div",{className:"dgs-ui-kit-text-gray-600",children:d}),q({handleChangeField:I,setValue:c,value:v})]}),j&&e.jsx(N,{disabled:l,errorMessage:o,hintMessage:k,maxLength:m?x:void 0,value:v})]})};exports.FieldBottomInfo=N;exports.FieldLabel=C;exports.TextFieldWrapper=R;
|