@dgshahr/ui-kit 0.0.32 → 0.0.33
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 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),f=require("../../clsx-C11secjj.cjs"),w=require("react"),y=require("../../TextFieldWrapper-BbzQMKCb.cjs"),R=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"})]}),N=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"})]}),I=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"})}),M=w.forwardRef(function(n,j){const{dir:s="rtl",placeholderDir:C=s,containerClassName:k,leftIcon:d,prefix:u,postfix:x,isClearOption:g,onClear:h,...r}=n,[o,v]=w.useState(r.type);function p(a){return e.jsx("button",{onClick:()=>{a(""),typeof h=="function"&&h()},children:e.jsx(R,{className:"dgs-ui-kit-text-gray-600",width:20,height:20})})}return e.jsx(y.TextFieldWrapper,{...n,containerClassName:f.clsx("dgs-ui-kit-items-center",k),children:({handleChangeField:a,value:i,setValue:m})=>e.jsxs(e.Fragment,{children:[u&&e.jsx("span",{className:"dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500",children:u}),g&&i&&i.length>0&&s==="ltr"&&p(m),e.jsx("input",{...r,ref:j,className:f.clsx("dgs-ui-kit-bg-transparent focus:dgs-ui-kit-outline-none dgs-ui-kit-flex-1",s==="rtl"?"dgs-ui-kit-text-right":"!dgs-ui-kit-text-left",C==="rtl"?"placeholder:dgs-ui-kit-text-right":"placeholder:dgs-ui-kit-text-left",{ss02:r.type!="password"},n.className),...s==="ltr"?{style:{direction:"ltr"}}:{},value:i,onChange:a,type:o,onInput:c=>{if(o!=="number")return;const l=c.currentTarget;l.value.length>l.maxLength&&(l.value=l.value.slice(0,l.maxLength))}}),g&&i&&i.length>0&&s==="rtl"&&p(m),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}),r.type==="password"&&e.jsx("button",{onClick:()=>v(c=>c==="text"?"password":"text"),className:"dgs-ui-kit-text-gray-600",children:o==="password"?e.jsx(N,{width:20,height:20}):e.jsx(I,{width:20,height:20})})]})})});module.exports=M;
|
|
@@ -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;AAK1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAExF,UAAU,UACR,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,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,QAAA,MAAM,KAAK,
|
|
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;AAK1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAExF,UAAU,UACR,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,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,QAAA,MAAM,KAAK,yGAuGT,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 c, jsx as e, Fragment as N } from "react/jsx-runtime";
|
|
2
|
+
import { c as w } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { forwardRef as R, useState as I } from "react";
|
|
4
|
+
import { T as M } from "../../TextFieldWrapper-D9d-4wo1.js";
|
|
5
|
+
const b = (t) => /* @__PURE__ */ c(
|
|
6
6
|
"svg",
|
|
7
7
|
{
|
|
8
8
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10,9 +10,9 @@ const M = (e) => /* @__PURE__ */ o(
|
|
|
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 M = (e) => /* @__PURE__ */ o(
|
|
|
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 M = (e) => /* @__PURE__ */ o(
|
|
|
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 M = (e) => /* @__PURE__ */ o(
|
|
|
41
41
|
)
|
|
42
42
|
]
|
|
43
43
|
}
|
|
44
|
-
), z = (
|
|
44
|
+
), z = (t) => /* @__PURE__ */ c(
|
|
45
45
|
"svg",
|
|
46
46
|
{
|
|
47
47
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -49,16 +49,16 @@ const M = (e) => /* @__PURE__ */ o(
|
|
|
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 M = (e) => /* @__PURE__ */ o(
|
|
|
67
67
|
)
|
|
68
68
|
]
|
|
69
69
|
}
|
|
70
|
-
), B = (
|
|
70
|
+
), B = (t) => /* @__PURE__ */ e(
|
|
71
71
|
"svg",
|
|
72
72
|
{
|
|
73
73
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -75,8 +75,8 @@ const M = (e) => /* @__PURE__ */ o(
|
|
|
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,27 @@ const M = (e) => /* @__PURE__ */ o(
|
|
|
86
86
|
}
|
|
87
87
|
)
|
|
88
88
|
}
|
|
89
|
-
), j =
|
|
89
|
+
), j = R(function(s, C) {
|
|
90
90
|
const {
|
|
91
|
-
dir:
|
|
92
|
-
placeholderDir:
|
|
93
|
-
containerClassName:
|
|
94
|
-
leftIcon:
|
|
95
|
-
prefix:
|
|
96
|
-
postfix:
|
|
97
|
-
isClearOption:
|
|
98
|
-
onClear:
|
|
99
|
-
...
|
|
100
|
-
} =
|
|
101
|
-
function
|
|
102
|
-
return /* @__PURE__ */
|
|
91
|
+
dir: l = "rtl",
|
|
92
|
+
placeholderDir: k = l,
|
|
93
|
+
containerClassName: v,
|
|
94
|
+
leftIcon: u,
|
|
95
|
+
prefix: g,
|
|
96
|
+
postfix: h,
|
|
97
|
+
isClearOption: p,
|
|
98
|
+
onClear: m,
|
|
99
|
+
...n
|
|
100
|
+
} = s, [o, y] = I(n.type);
|
|
101
|
+
function f(a) {
|
|
102
|
+
return /* @__PURE__ */ e(
|
|
103
103
|
"button",
|
|
104
104
|
{
|
|
105
105
|
onClick: () => {
|
|
106
|
-
|
|
106
|
+
a(""), typeof m == "function" && m();
|
|
107
107
|
},
|
|
108
|
-
children: /* @__PURE__ */
|
|
109
|
-
|
|
108
|
+
children: /* @__PURE__ */ e(
|
|
109
|
+
b,
|
|
110
110
|
{
|
|
111
111
|
className: "dgs-ui-kit-text-gray-600",
|
|
112
112
|
width: 20,
|
|
@@ -116,49 +116,54 @@ const M = (e) => /* @__PURE__ */ o(
|
|
|
116
116
|
}
|
|
117
117
|
);
|
|
118
118
|
}
|
|
119
|
-
return /* @__PURE__ */
|
|
120
|
-
|
|
119
|
+
return /* @__PURE__ */ e(
|
|
120
|
+
M,
|
|
121
121
|
{
|
|
122
|
-
...
|
|
123
|
-
containerClassName:
|
|
124
|
-
children: ({ handleChangeField:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
/* @__PURE__ */
|
|
122
|
+
...s,
|
|
123
|
+
containerClassName: w("dgs-ui-kit-items-center", v),
|
|
124
|
+
children: ({ handleChangeField: a, value: i, setValue: x }) => /* @__PURE__ */ c(N, { children: [
|
|
125
|
+
g && /* @__PURE__ */ e("span", { className: "dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500", children: g }),
|
|
126
|
+
p && i && i.length > 0 && l === "ltr" && f(x),
|
|
127
|
+
/* @__PURE__ */ e(
|
|
128
128
|
"input",
|
|
129
129
|
{
|
|
130
|
-
...
|
|
131
|
-
ref:
|
|
132
|
-
className:
|
|
130
|
+
...n,
|
|
131
|
+
ref: C,
|
|
132
|
+
className: w(
|
|
133
133
|
"dgs-ui-kit-bg-transparent focus:dgs-ui-kit-outline-none dgs-ui-kit-flex-1",
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
l === "rtl" ? "dgs-ui-kit-text-right" : "!dgs-ui-kit-text-left",
|
|
135
|
+
k === "rtl" ? "placeholder:dgs-ui-kit-text-right" : "placeholder:dgs-ui-kit-text-left",
|
|
136
136
|
{
|
|
137
|
-
ss02:
|
|
137
|
+
ss02: n.type != "password"
|
|
138
138
|
},
|
|
139
|
-
|
|
139
|
+
s.className
|
|
140
140
|
),
|
|
141
|
-
...
|
|
142
|
-
value:
|
|
143
|
-
onChange:
|
|
144
|
-
type:
|
|
141
|
+
...l === "ltr" ? { style: { direction: "ltr" } } : {},
|
|
142
|
+
value: i,
|
|
143
|
+
onChange: a,
|
|
144
|
+
type: o,
|
|
145
|
+
onInput: (d) => {
|
|
146
|
+
if (o !== "number") return;
|
|
147
|
+
const r = d.currentTarget;
|
|
148
|
+
r.value.length > r.maxLength && (r.value = r.value.slice(0, r.maxLength));
|
|
149
|
+
}
|
|
145
150
|
}
|
|
146
151
|
),
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
152
|
+
p && i && i.length > 0 && l === "rtl" && f(x),
|
|
153
|
+
h && /* @__PURE__ */ e("span", { className: "dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500", children: h }),
|
|
154
|
+
u && /* @__PURE__ */ e("div", { className: "dgs-ui-kit-text-gray-600", children: u }),
|
|
155
|
+
n.type === "password" && /* @__PURE__ */ e(
|
|
151
156
|
"button",
|
|
152
157
|
{
|
|
153
|
-
onClick: () =>
|
|
158
|
+
onClick: () => y((d) => d === "text" ? "password" : "text"),
|
|
154
159
|
className: "dgs-ui-kit-text-gray-600",
|
|
155
|
-
children:
|
|
160
|
+
children: o === "password" ? /* @__PURE__ */ e(
|
|
156
161
|
z,
|
|
157
162
|
{
|
|
158
163
|
width: 20,
|
|
159
164
|
height: 20
|
|
160
165
|
}
|
|
161
|
-
) : /* @__PURE__ */
|
|
166
|
+
) : /* @__PURE__ */ e(
|
|
162
167
|
B,
|
|
163
168
|
{
|
|
164
169
|
width: 20,
|