@dgshahr/ui-kit 0.0.81 → 0.0.82

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.
Files changed (34) hide show
  1. package/dist/FieldBottomInfo-7YeZbp0-.cjs +1 -0
  2. package/dist/FieldBottomInfo-B1n-gK3T.js +78 -0
  3. package/dist/Form/Datepicker/index.cjs +1 -1
  4. package/dist/Form/Datepicker/index.js +1 -1
  5. package/dist/Form/FileUploader/index.cjs +1 -0
  6. package/dist/Form/FileUploader/index.d.ts +3 -1
  7. package/dist/Form/FileUploader/index.d.ts.map +1 -1
  8. package/dist/Form/FileUploader/index.js +608 -0
  9. package/dist/Form/Input/index.cjs +1 -1
  10. package/dist/Form/Input/index.js +166 -7
  11. package/dist/Form/OtpInput/index.cjs +1 -1
  12. package/dist/Form/OtpInput/index.js +23 -22
  13. package/dist/Form/Select/index.cjs +1 -1
  14. package/dist/Form/Select/index.js +2 -2
  15. package/dist/Form/Textarea/index.cjs +1 -1
  16. package/dist/Form/Textarea/index.js +1 -1
  17. package/dist/IconEye-DATABBb3.js +31 -0
  18. package/dist/IconEye-sBk4Mro2.cjs +1 -0
  19. package/dist/{PickerWrapper-ChkVx96j.js → PickerWrapper-BrMn3Ldu.js} +1 -1
  20. package/dist/PickerWrapper-CoDy6coa.cjs +1 -0
  21. package/dist/TextFieldWrapper-44165bs_.js +106 -0
  22. package/dist/TextFieldWrapper-K0g1kAl1.cjs +1 -0
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +51 -650
  27. package/package.json +1 -1
  28. package/dist/Form/FileUploader/FileUploader.d.ts +0 -5
  29. package/dist/Form/FileUploader/FileUploader.d.ts.map +0 -1
  30. package/dist/PickerWrapper-CWSAzbwY.cjs +0 -1
  31. package/dist/TextFieldWrapper-BJEouM80.js +0 -178
  32. package/dist/TextFieldWrapper-BrWmggFz.cjs +0 -1
  33. package/dist/index-BctRb68z.cjs +0 -1
  34. package/dist/index-CXKbrGQV.js +0 -194
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dgshahr/ui-kit",
3
- "version": "0.0.81",
3
+ "version": "0.0.82",
4
4
  "description": "dgshahr ui-kit",
5
5
  "author": "dgshahr",
6
6
  "license": "MIT",
@@ -1,5 +0,0 @@
1
- import { FC } from 'react';
2
- import { FileUploaderProps } from './types';
3
- declare const FileUploader: FC<FileUploaderProps>;
4
- export default FileUploader;
5
- //# sourceMappingURL=FileUploader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FileUploader.d.ts","sourceRoot":"","sources":["../../../src/components/Form/FileUploader/FileUploader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAA8B,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE7E,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAwCvC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1 +0,0 @@
1
- "use client";"use strict";require('./assets/styles.css');const e=require("react/jsx-runtime"),t=require("./clsx-C11secjj.cjs"),n=require("react"),T=require("./Drawer/index.cjs"),W=require("./IconArrowDown2-C1dLVveG.cjs"),j=require("./index-BctRb68z.cjs");;/* empty css */const h=n.createContext({toggleWrapperVisibility:()=>{}}),y=()=>n.useContext(h),q=a=>{const i=n.useRef(null);return n.useEffect(()=>{const s=r=>{i.current&&!i.current.contains(r.target)&&a()};return document.addEventListener("click",s,!0),()=>{document.removeEventListener("click",s,!0)}},[i,a]),i},f="dgs-ui-kit-duration-300",w=400,E=a=>{const{dropdownType:i="popover",disabled:s,isLoading:r,wrapperClassName:C,customInput:p,children:g,drawerProps:k,inputProps:v,popoverClassName:N}=a,[u,c]=n.useState(!1),[m,l]=n.useState(!1);let o;const b=q(()=>{i==="popover"&&u&&(c(!1),o&&clearTimeout(o),o=setTimeout(()=>{l(!1)},w))});function x(){if(s||r)return;const I=!m;o&&clearTimeout(o),I?(l(!0),o=setTimeout(()=>{c(!0)},0)):(c(!1),o=setTimeout(()=>{l(!1)},w))}const d=t.clsx({"!dgs-ui-kit-cursor-not-allowed":s,"!dgs-ui-kit-cursor-wait":r,"!dgs-ui-kit-cursor-pointer":!r&&!s});return e.jsxs("div",{ref:b,className:t.clsx("dgs-ui-kit-relative",C),children:[e.jsx("button",{type:"button",className:t.clsx("dgs-ui-kit-w-full",d),onClick:x,children:p?p(u):e.jsx(j.Input,{leftIcon:r?e.jsx("div",{className:"dot-flashing dgs-ui-kit-mr-2"}):e.jsx(W.IconArrowDown2,{width:20,height:20,className:t.clsx("dgs-ui-kit-transition",f,{"dgs-ui-kit-rotate-180":u})}),containerClassName:t.clsx(d,{"dgs-ui-kit-items-baseline":r}),className:t.clsx("dgs-ui-kit-caret-transparent",d),disabled:s,...v})}),e.jsx(h.Provider,{value:{toggleWrapperVisibility:x},children:m&&e.jsx(e.Fragment,{children:i==="popover"?e.jsx("div",{className:t.clsx("dgs-ui-kit-absolute dgs-ui-kit-min-w-[300px] dgs-ui-kit-bottom-0 dgs-ui-kit-right-0 dgs-ui-kit-translate-y-[calc(100%+8px)] dgs-ui-kit-overflow-y-auto dgs-ui-kit-overflow-x-hidden dgs-ui-kit-shadow-lg dgs-ui-kit-w-full dgs-ui-kit-max-h-[360px] dgs-ui-kit-transition-all dgs-ui-kit-bg-white dgs-ui-kit-z-50 dgs-ui-kit-rounded-lg dgs-ui-kit-border dgs-ui-kit-border-solid dgs-ui-kit-border-gray-200 dgs-ui-kit-pb-3",f,u?"dgs-ui-kit-opacity-100":"dgs-ui-kit-opacity-0 dgs-ui-kit-max-h-0 dgs-ui-kit-overflow-y-hidden",N),children:g}):e.jsx(T,{...k,open:u,onClose:()=>c(!1),containerClassName:t.clsx("!dgs-ui-kit-pb-3 !dgs-ui-kit-px-0",k?.containerClassName),children:g})})})]})};exports.PickerWrapper=E;exports.usePickerWrapperContext=y;
@@ -1,178 +0,0 @@
1
- "use client";
2
- import { jsxs as t, jsx as s, Fragment as C } from "react/jsx-runtime";
3
- import { c as u } from "./clsx-OuTLNxxd.js";
4
- import j from "react";
5
- import './assets/styles.css';/* empty css */
6
- const F = (d) => /* @__PURE__ */ t(
7
- "svg",
8
- {
9
- xmlns: "http://www.w3.org/2000/svg",
10
- width: "1em",
11
- height: "1em",
12
- fill: "none",
13
- viewBox: "0 0 24 24",
14
- ...d,
15
- children: [
16
- /* @__PURE__ */ s(
17
- "path",
18
- {
19
- fill: "currentColor",
20
- fillRule: "evenodd",
21
- 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",
22
- clipRule: "evenodd"
23
- }
24
- ),
25
- /* @__PURE__ */ s(
26
- "path",
27
- {
28
- fill: "currentColor",
29
- fillRule: "evenodd",
30
- 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",
31
- clipRule: "evenodd"
32
- }
33
- )
34
- ]
35
- }
36
- ), M = (d) => {
37
- const { errorMessage: i, hintMessage: e, extraHelper: r, disabled: n, className: a } = d;
38
- return /* @__PURE__ */ t(
39
- "div",
40
- {
41
- className: u(
42
- "dgs-ui-kit-flex dgs-ui-kit-font-p3-regular",
43
- {
44
- "dgs-ui-kit-justify-between": (i ?? e) && r,
45
- "dgs-ui-kit-justify-start": (i ?? e) && !r,
46
- "dgs-ui-kit-justify-end": !(i ?? e) && r,
47
- "dgs-ui-kit-text-gray-400": n
48
- },
49
- i ? "dgs-ui-kit-text-error-500" : "dgs-ui-kit-text-gray-500",
50
- a
51
- ),
52
- children: [
53
- (i || e) && /* @__PURE__ */ t(
54
- "div",
55
- {
56
- className: u(
57
- "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2 dgs-ui-kit-font-light",
58
- {
59
- "dgs-ui-kit-text-gray-400": n
60
- }
61
- ),
62
- children: [
63
- /* @__PURE__ */ s(
64
- F,
65
- {
66
- width: 16,
67
- height: 16
68
- }
69
- ),
70
- /* @__PURE__ */ s("span", { children: i ?? e })
71
- ]
72
- }
73
- ),
74
- r
75
- ]
76
- }
77
- );
78
- }, I = (d) => {
79
- const { link: i, labelContent: e, required: r, disabled: n, labelAddon: a } = d;
80
- return /* @__PURE__ */ t(C, { children: [
81
- /* @__PURE__ */ t(
82
- "div",
83
- {
84
- className: u("dgs-ui-kit-flex", {
85
- "dgs-ui-kit-justify-between": e && i?.href,
86
- "dgs-ui-kit-mb-2": !a,
87
- "dgs-ui-kit-justify-start": e && !i?.href,
88
- "dgs-ui-kit-justify-end": !e && i?.href,
89
- "dgs-ui-kit-text-gray-400": n
90
- }),
91
- children: [
92
- e && /* @__PURE__ */ t("label", { className: "dgs-ui-kit-px-0 dgs-ui-kit-font-p2-medium md:dgs-ui-kit-mx-0", children: [
93
- e,
94
- r && /* @__PURE__ */ s("span", { className: "dgs-ui-kit-ms-2 dgs-ui-kit-text-error-500", children: "*" })
95
- ] }),
96
- i?.href && /* @__PURE__ */ s(
97
- "a",
98
- {
99
- href: i.href,
100
- className: "dgs-ui-kit-font-button-small dgs-ui-kit-text-primary-400",
101
- children: i.cnotent
102
- }
103
- )
104
- ]
105
- }
106
- ),
107
- a
108
- ] });
109
- }, O = (d) => {
110
- const {
111
- labelContent: i,
112
- link: e,
113
- containerClassName: r,
114
- rightIcon: n,
115
- isError: a,
116
- errorMessage: g,
117
- hintMessage: k,
118
- required: p,
119
- labelAddon: x,
120
- maxLength: o,
121
- disabled: l,
122
- value: b,
123
- wrapperClassName: c,
124
- showMaxLength: v,
125
- children: y
126
- } = d, h = !!(g || k || o && v), m = !!(i || e?.href), w = h || m || c ? "div" : j.Fragment;
127
- return /* @__PURE__ */ t(w, { ...c ? { className: c } : {}, children: [
128
- m && /* @__PURE__ */ s(
129
- I,
130
- {
131
- disabled: l,
132
- labelContent: i,
133
- link: e,
134
- required: p,
135
- labelAddon: x
136
- }
137
- ),
138
- /* @__PURE__ */ t(
139
- "div",
140
- {
141
- onClick: (N) => {
142
- const f = N.currentTarget.querySelector("textarea, input");
143
- f && f.focus();
144
- },
145
- className: u(
146
- `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"}`,
147
- a || g ? "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"}`,
148
- r,
149
- {
150
- "dgs-ui-kit-text-gray-400": l
151
- }
152
- ),
153
- children: [
154
- n && /* @__PURE__ */ s("div", { className: "dgs-ui-kit-text-gray-600", children: n }),
155
- y
156
- ]
157
- }
158
- ),
159
- h && /* @__PURE__ */ s(
160
- M,
161
- {
162
- disabled: l,
163
- errorMessage: g,
164
- hintMessage: k,
165
- extraHelper: o && /* @__PURE__ */ t("span", { className: "ss02", children: [
166
- b?.toString()?.length ?? 0,
167
- "/",
168
- o
169
- ] })
170
- }
171
- )
172
- ] });
173
- };
174
- export {
175
- I as F,
176
- O as T,
177
- M as a
178
- };
@@ -1 +0,0 @@
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 */const M=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"})]}),m=r=>{const{errorMessage:i,hintMessage:s,extraHelper:t,disabled:d,className: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??s)&&t,"dgs-ui-kit-justify-start":(i??s)&&!t,"dgs-ui-kit-justify-end":!(i??s)&&t,"dgs-ui-kit-text-gray-400":d},i?"dgs-ui-kit-text-error-500":"dgs-ui-kit-text-gray-500",n),children:[(i||s)&&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":d}),children:[e.jsx(M,{width:16,height:16}),e.jsx("span",{children:i??s})]}),t]})},f=r=>{const{link:i,labelContent:s,required:t,disabled:d,labelAddon:n}=r;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:a.clsx("dgs-ui-kit-flex",{"dgs-ui-kit-justify-between":s&&i?.href,"dgs-ui-kit-mb-2":!n,"dgs-ui-kit-justify-start":s&&!i?.href,"dgs-ui-kit-justify-end":!s&&i?.href,"dgs-ui-kit-text-gray-400":d}),children:[s&&e.jsxs("label",{className:"dgs-ui-kit-px-0 dgs-ui-kit-font-p2-medium md:dgs-ui-kit-mx-0",children:[s,t&&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]})},q=r=>{const{labelContent:i,link:s,containerClassName:t,rightIcon:d,isError:n,errorMessage:u,hintMessage:c,required:p,labelAddon:j,maxLength:g,disabled:l,value:b,wrapperClassName:o,showMaxLength:v,children:y}=r,k=!!(u||c||g&&v),x=!!(i||s?.href),w=k||x||o?"div":F.Fragment,N=C=>{const h=C.currentTarget.querySelector("textarea, input");h&&h.focus()};return e.jsxs(w,{...o?{className:o}:{},children:[x&&e.jsx(f,{disabled:l,labelContent:i,link:s,required:p,labelAddon:j}),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"}`,t,{"dgs-ui-kit-text-gray-400":l}),children:[d&&e.jsx("div",{className:"dgs-ui-kit-text-gray-600",children:d}),y]}),k&&e.jsx(m,{disabled:l,errorMessage:u,hintMessage:c,extraHelper:g&&e.jsxs("span",{className:"ss02",children:[b?.toString()?.length??0,"/",g]})})]})};exports.FieldBottomInfo=m;exports.FieldLabel=f;exports.TextFieldWrapper=q;
@@ -1 +0,0 @@
1
- "use strict";const e=require("react/jsx-runtime"),g=require("./clsx-C11secjj.cjs"),h=require("react"),y=require("./omitObjects-CtiYo0hv.cjs"),C=require("./TextFieldWrapper-BrWmggFz.cjs"),I=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"})]}),f=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"})}),N=h.forwardRef(function(a,m){const{dir:i="rtl",placeholderDir:w=i,containerClassName:j,leftIcon:u,prefix:d,postfix:p,onClear:l,value:r,...s}=a,v=y.omitObject(s,["labelAddon","labelContent","link","rightIcon","isError","errorMessage","hintMessage","wrapperClassName","showMaxLength"]),[c,k]=h.useState(s.type);function x(){return e.jsx("button",{onClick:()=>{typeof l=="function"&&l()},children:e.jsx(I,{className:"dgs-ui-kit-text-gray-600",width:20,height:20})})}return e.jsxs(C.TextFieldWrapper,{...a,containerClassName:g.clsx("dgs-ui-kit-items-center",j),value:r,children:[d&&e.jsx("span",{className:"dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500",children:d}),typeof l=="function"&&r&&i==="ltr"&&x(),e.jsx("input",{...v,ref:m,className:g.clsx("dgs-ui-kit-bg-transparent focus:dgs-ui-kit-outline-none dgs-ui-kit-flex-1",i==="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),...i==="ltr"?{style:{direction:"ltr"}}:{},value:r,type:c,onInput:o=>{if(typeof s.onInput=="function"&&s.onInput(o)||c!=="number")return;const n=o.currentTarget;n.value.length>n.maxLength&&(n.value=n.value.slice(0,n.maxLength))}}),typeof l=="function"&&r&&i==="rtl"&&x(),p&&e.jsx("span",{className:"dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500",children:p}),u&&e.jsx("div",{className:"dgs-ui-kit-text-gray-600",children:u}),s.type==="password"&&e.jsx("button",{type:"button",onClick:()=>k(o=>o==="text"?"password":"text"),className:"dgs-ui-kit-text-gray-600",children:c==="password"?e.jsx(f,{width:20,height:20}):e.jsx(R,{width:20,height:20})})]})});exports.IconEye=f;exports.Input=N;
@@ -1,194 +0,0 @@
1
- import { jsxs as d, jsx as t } 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 } from "./omitObjects-CxFrrlkX.js";
5
- import { T as N } from "./TextFieldWrapper-BJEouM80.js";
6
- const M = (e) => /* @__PURE__ */ d(
7
- "svg",
8
- {
9
- xmlns: "http://www.w3.org/2000/svg",
10
- width: "1em",
11
- height: "1em",
12
- fill: "none",
13
- viewBox: "0 0 24 24",
14
- ...e,
15
- children: [
16
- /* @__PURE__ */ t(
17
- "path",
18
- {
19
- fill: "currentColor",
20
- fillRule: "evenodd",
21
- d: "m15.456 9.595-5.852 5.852-1.061-1.06 5.853-5.853z",
22
- clipRule: "evenodd"
23
- }
24
- ),
25
- /* @__PURE__ */ t(
26
- "path",
27
- {
28
- fill: "currentColor",
29
- fillRule: "evenodd",
30
- d: "m9.6 8.532 5.856 5.858-1.06 1.06-5.857-5.857z",
31
- clipRule: "evenodd"
32
- }
33
- ),
34
- /* @__PURE__ */ t(
35
- "path",
36
- {
37
- fill: "currentColor",
38
- fillRule: "evenodd",
39
- 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",
40
- clipRule: "evenodd"
41
- }
42
- )
43
- ]
44
- }
45
- ), R = (e) => /* @__PURE__ */ d(
46
- "svg",
47
- {
48
- xmlns: "http://www.w3.org/2000/svg",
49
- width: "1em",
50
- height: "1em",
51
- fill: "none",
52
- viewBox: "0 0 24 24",
53
- ...e,
54
- children: [
55
- /* @__PURE__ */ t(
56
- "path",
57
- {
58
- fill: "currentColor",
59
- 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"
60
- }
61
- ),
62
- /* @__PURE__ */ t(
63
- "path",
64
- {
65
- fill: "currentColor",
66
- 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"
67
- }
68
- )
69
- ]
70
- }
71
- ), b = (e) => /* @__PURE__ */ t(
72
- "svg",
73
- {
74
- xmlns: "http://www.w3.org/2000/svg",
75
- width: "1em",
76
- height: "1em",
77
- fill: "none",
78
- viewBox: "0 0 24 24",
79
- ...e,
80
- children: /* @__PURE__ */ t(
81
- "path",
82
- {
83
- fill: "currentColor",
84
- fillRule: "evenodd",
85
- 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",
86
- clipRule: "evenodd"
87
- }
88
- )
89
- }
90
- ), j = C(function(a, m) {
91
- const {
92
- dir: l = "rtl",
93
- placeholderDir: x = l,
94
- containerClassName: w,
95
- leftIcon: u,
96
- prefix: p,
97
- postfix: g,
98
- onClear: r,
99
- value: o,
100
- ...i
101
- } = a, v = I(i, [
102
- "labelAddon",
103
- "labelContent",
104
- "link",
105
- "rightIcon",
106
- "isError",
107
- "errorMessage",
108
- "hintMessage",
109
- "wrapperClassName",
110
- "showMaxLength"
111
- ]), [c, k] = y(i.type);
112
- function h() {
113
- return /* @__PURE__ */ t(
114
- "button",
115
- {
116
- onClick: () => {
117
- typeof r == "function" && r();
118
- },
119
- children: /* @__PURE__ */ t(
120
- M,
121
- {
122
- className: "dgs-ui-kit-text-gray-600",
123
- width: 20,
124
- height: 20
125
- }
126
- )
127
- }
128
- );
129
- }
130
- return /* @__PURE__ */ d(
131
- N,
132
- {
133
- ...a,
134
- containerClassName: f("dgs-ui-kit-items-center", w),
135
- value: o,
136
- children: [
137
- p && /* @__PURE__ */ t("span", { className: "dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500", children: p }),
138
- typeof r == "function" && o && l === "ltr" && h(),
139
- /* @__PURE__ */ t(
140
- "input",
141
- {
142
- ...v,
143
- ref: m,
144
- className: f(
145
- "dgs-ui-kit-bg-transparent focus:dgs-ui-kit-outline-none dgs-ui-kit-flex-1",
146
- l === "rtl" ? "dgs-ui-kit-text-right" : "!dgs-ui-kit-text-left",
147
- x === "rtl" ? "placeholder:dgs-ui-kit-text-right" : "placeholder:dgs-ui-kit-text-left",
148
- {
149
- ss02: i.type != "password"
150
- },
151
- a.className
152
- ),
153
- ...l === "ltr" ? { style: { direction: "ltr" } } : {},
154
- value: o,
155
- type: c,
156
- onInput: (s) => {
157
- if (typeof i.onInput == "function" && i.onInput(s) || c !== "number") return;
158
- const n = s.currentTarget;
159
- n.value.length > n.maxLength && (n.value = n.value.slice(0, n.maxLength));
160
- }
161
- }
162
- ),
163
- typeof r == "function" && o && l === "rtl" && h(),
164
- g && /* @__PURE__ */ t("span", { className: "dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500", children: g }),
165
- u && /* @__PURE__ */ t("div", { className: "dgs-ui-kit-text-gray-600", children: u }),
166
- i.type === "password" && /* @__PURE__ */ t(
167
- "button",
168
- {
169
- type: "button",
170
- onClick: () => k((s) => s === "text" ? "password" : "text"),
171
- className: "dgs-ui-kit-text-gray-600",
172
- children: c === "password" ? /* @__PURE__ */ t(
173
- R,
174
- {
175
- width: 20,
176
- height: 20
177
- }
178
- ) : /* @__PURE__ */ t(
179
- b,
180
- {
181
- width: 20,
182
- height: 20
183
- }
184
- )
185
- }
186
- )
187
- ]
188
- }
189
- );
190
- });
191
- export {
192
- j as I,
193
- R as a
194
- };