@dgshahr/ui-kit 0.0.41 → 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.
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),m=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"})]}),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",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"})]}),N=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(o,j){const{dir:s="rtl",placeholderDir:C=s,containerClassName:k,leftIcon:d,prefix:u,postfix:x,isClearOption:g,onClear:h,...i}=o,[c,v]=w.useState(i.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,{...o,containerClassName:m.clsx("dgs-ui-kit-items-center",k),children:({handleChangeField:a,value:l,setValue:f})=>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&&l&&l.length>0&&s==="ltr"&&p(f),e.jsx("input",{...i,ref:j,className:m.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:i.type!="password"},o.className),...s==="ltr"?{style:{direction:"ltr"}}:{},value:l,onChange:a,type:c,onInput:r=>{if(typeof i.onInput=="function"&&i.onInput(r),c!=="number")return;const n=r.currentTarget;n.value.length>n.maxLength&&(n.value=n.value.slice(0,n.maxLength))}}),g&&l&&l.length>0&&s==="rtl"&&p(f),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}),i.type==="password"&&e.jsx("button",{onClick:()=>v(r=>r==="text"?"password":"text"),className:"dgs-ui-kit-text-gray-600",children:c==="password"?e.jsx(I,{width:20,height:20}):e.jsx(N,{width:20,height:20})})]})})});module.exports=M;
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;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,yGAwGT,CAAC;AACH,eAAe,KAAK,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"}
@@ -1,8 +1,8 @@
1
- import { jsxs as c, jsx as t, Fragment as I } from "react/jsx-runtime";
2
- import { c as w } from "../../clsx-OuTLNxxd.js";
3
- import { forwardRef as N, useState as R } from "react";
4
- import { T as M } from "../../TextFieldWrapper-D9d-4wo1.js";
5
- const b = (e) => /* @__PURE__ */ c(
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
- ...e,
13
+ ...t,
14
14
  children: [
15
- /* @__PURE__ */ t(
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__ */ t(
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__ */ t(
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
- ), z = (e) => /* @__PURE__ */ c(
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
- ...e,
52
+ ...t,
53
53
  children: [
54
- /* @__PURE__ */ t(
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__ */ t(
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
- ), B = (e) => /* @__PURE__ */ t(
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
- ...e,
79
- children: /* @__PURE__ */ t(
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
- ), j = N(function(s, C) {
89
+ ), T = C(function(a, m) {
90
90
  const {
91
- dir: l = "rtl",
92
- placeholderDir: k = l,
93
- containerClassName: v,
91
+ dir: i = "rtl",
92
+ placeholderDir: w = i,
93
+ containerClassName: x,
94
94
  leftIcon: u,
95
- prefix: g,
96
- postfix: h,
97
- isClearOption: p,
98
- onClear: f,
99
- ...i
100
- } = s, [a, y] = R(i.type);
101
- function m(d) {
102
- return /* @__PURE__ */ t(
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
- d(""), typeof f == "function" && f();
116
+ typeof r == "function" && r();
107
117
  },
108
- children: /* @__PURE__ */ t(
109
- b,
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__ */ t(
120
- M,
129
+ return /* @__PURE__ */ d(
130
+ N,
121
131
  {
122
- ...s,
123
- containerClassName: w("dgs-ui-kit-items-center", v),
124
- children: ({ handleChangeField: d, value: n, setValue: x }) => /* @__PURE__ */ c(I, { children: [
125
- g && /* @__PURE__ */ t("span", { className: "dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500", children: g }),
126
- p && n && n.length > 0 && l === "ltr" && m(x),
127
- /* @__PURE__ */ t(
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
- ...i,
131
- ref: C,
132
- className: w(
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
- 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",
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: i.type != "password"
148
+ ss02: l.type != "password"
138
149
  },
139
- s.className
150
+ a.className
140
151
  ),
141
- ...l === "ltr" ? { style: { direction: "ltr" } } : {},
142
- value: n,
143
- onChange: d,
144
- type: a,
145
- onInput: (o) => {
146
- if (typeof i.onInput == "function" && i.onInput(o), a !== "number") return;
147
- const r = o.currentTarget;
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
- p && n && n.length > 0 && l === "rtl" && m(x),
153
- h && /* @__PURE__ */ t("span", { className: "dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500", children: h }),
154
- u && /* @__PURE__ */ t("div", { className: "dgs-ui-kit-text-gray-600", children: u }),
155
- i.type === "password" && /* @__PURE__ */ t(
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: () => y((o) => o === "text" ? "password" : "text"),
168
+ onClick: () => k((s) => s === "text" ? "password" : "text"),
159
169
  className: "dgs-ui-kit-text-gray-600",
160
- children: a === "password" ? /* @__PURE__ */ t(
161
- z,
170
+ children: c === "password" ? /* @__PURE__ */ e(
171
+ R,
162
172
  {
163
173
  width: 20,
164
174
  height: 20
165
175
  }
166
- ) : /* @__PURE__ */ t(
167
- B,
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
- j as default
190
+ T as default
181
191
  };
@@ -1 +1 @@
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-BbzQMKCb.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
+ "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;
@@ -3,7 +3,7 @@ import { jsxs as I, jsx as u } from "react/jsx-runtime";
3
3
  import { c as d } from "../../clsx-OuTLNxxd.js";
4
4
  import { useRef as v, useEffect as j } from "react";
5
5
  import A from "../Input/index.js";
6
- import { F as B, a as F } from "../../TextFieldWrapper-D9d-4wo1.js";
6
+ import { F as B, a as F } from "../../TextFieldWrapper-DXAGbpBx.js";
7
7
  import '../../assets/styles.css';/* empty css */
8
8
  const R = (h) => {
9
9
  const {
@@ -1 +1 @@
1
- "use strict";const i=require("react/jsx-runtime"),n=require("../../clsx-C11secjj.cjs"),o=require("react"),c=require("../../TextFieldWrapper-BbzQMKCb.cjs"),d=o.forwardRef(function(e,s){const{dir:t="rtl",placeholderDir:l=t,className:u,...r}=e;return i.jsx(c.TextFieldWrapper,{...e,children:({handleChangeField:a})=>i.jsx("textarea",{...r,ref:s,className:n.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",l==="rtl"?"placeholder:dgs-ui-kit-text-right":"placeholder:dgs-ui-kit-text-left",u),onChange:a,rows:r.rows??5})})});module.exports=d;
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;AACf,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,4HA0BZ,CAAC;AAEH,eAAe,QAAQ,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 i } from "react/jsx-runtime";
2
- import { c as d } from "../../clsx-OuTLNxxd.js";
3
- import { forwardRef as u } from "react";
4
- import { T as n } from "../../TextFieldWrapper-D9d-4wo1.js";
5
- const m = u(function(t, s) {
6
- const { dir: e = "rtl", placeholderDir: l = e, className: o, ...r } = t;
7
- return /* @__PURE__ */ i(n, { ...t, children: ({ handleChangeField: a }) => /* @__PURE__ */ i(
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
- ...r,
11
- ref: s,
12
- className: d(
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
- l === "rtl" ? "placeholder:dgs-ui-kit-text-right" : "placeholder:dgs-ui-kit-text-left",
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
- m as default
34
+ h as default
25
35
  };
@@ -1,4 +1,4 @@
1
- import { default as React, ChangeEvent, ChangeEventHandler, Dispatch, ReactNode, SetStateAction } from '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 TextFieldFunctionArgumants<T> {
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
- onChange?: ChangeEventHandler<T>;
31
- children: (argumants: TextFieldFunctionArgumants<T>) => ReactNode;
25
+ children: ReactNode;
32
26
  }
33
- declare const TextFieldWrapper: <T extends HTMLTextAreaElement | HTMLInputElement>(props: TextFieldWrapperProps<T>) => import("react/jsx-runtime").JSX.Element;
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,EAGZ,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAIf,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,0BAA0B,CAAC,CAAC;IACpC,iBAAiB,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC/C,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;CAC5C;AAED,UAAU,qBAAqB,CAAC,CAAC,CAAE,SAAQ,kBAAkB;IAC3D,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,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IACjC,QAAQ,EAAE,CAAC,SAAS,EAAE,0BAA0B,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;CACnE;AAED,QAAA,MAAM,gBAAgB,GAAI,CAAC,SAAS,mBAAmB,GAAG,gBAAgB,SACjE,qBAAqB,CAAC,CAAC,CAAC,4CAyFhC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
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 s, jsx as r, Fragment as I } from "react/jsx-runtime";
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 E, { useState as L, useEffect as R } from "react";
4
+ import C from "react";
5
5
  import './assets/styles.css';/* empty css */
6
- const S = (n) => /* @__PURE__ */ s(
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
- ...n,
20
+ ...s,
15
21
  children: [
16
- /* @__PURE__ */ r(
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__ */ r(
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
- ), B = (n) => {
37
- const { errorMessage: i, hintMessage: e, maxLength: t, value: a, disabled: d } = n;
38
- return /* @__PURE__ */ s(
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__ */ s(
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__ */ r(
63
- S,
68
+ /* @__PURE__ */ n(
69
+ F,
64
70
  {
65
71
  width: 16,
66
72
  height: 16
67
73
  }
68
74
  ),
69
- /* @__PURE__ */ r("span", { children: i || e })
75
+ /* @__PURE__ */ n("span", { children: i || e })
70
76
  ]
71
77
  }
72
78
  ),
73
- t && /* @__PURE__ */ s("span", { className: "ss02", children: [
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
- }, T = (n) => {
82
- const { link: i, labelContent: e, required: t, disabled: a, children: d } = n;
83
- return /* @__PURE__ */ s(I, { children: [
84
- /* @__PURE__ */ s(
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__ */ s("label", { className: "dgs-ui-kit-px-0 dgs-ui-kit-font-p2-medium md:dgs-ui-kit-mx-0", children: [
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__ */ r("span", { className: "dgs-ui-kit-ms-2 dgs-ui-kit-text-error-500", children: "*" })
103
+ t && /* @__PURE__ */ n("span", { className: "dgs-ui-kit-ms-2 dgs-ui-kit-text-error-500", children: "*" })
98
104
  ] }),
99
- i?.href && /* @__PURE__ */ r(
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
- }, z = (n) => {
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: c,
120
- hintMessage: k,
121
- required: N,
122
- labelAddon: j,
123
- maxLength: f,
125
+ errorMessage: u,
126
+ hintMessage: g,
127
+ required: v,
128
+ labelAddon: b,
129
+ maxLength: c,
124
130
  disabled: l,
125
- value: u,
126
- wrapperClassName: m,
127
- showMaxLength: p,
128
- onChange: x,
129
- children: F
130
- } = n, [v, h] = L(u?.toString() ?? "");
131
- R(() => {
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
- ...w === "div" && m ? { className: m } : {},
139
+ ...p === "div" && k ? { className: k } : {},
141
140
  children: [
142
- y && /* @__PURE__ */ r(
143
- T,
141
+ f && /* @__PURE__ */ n(
142
+ I,
144
143
  {
145
144
  disabled: l,
146
145
  labelContent: i,
147
146
  link: e,
148
- required: N,
149
- children: j
147
+ required: v,
148
+ children: b
150
149
  }
151
150
  ),
152
- /* @__PURE__ */ s(
151
+ /* @__PURE__ */ r(
153
152
  "div",
154
153
  {
155
- onClick: (g) => {
156
- const C = g.currentTarget.querySelector("textarea, input");
157
- C && C.focus();
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 || c ? "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"}`,
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__ */ r("div", { className: "dgs-ui-kit-text-gray-600", children: a }),
169
- F({ handleChangeField: M, setValue: h, value: v })
167
+ a && /* @__PURE__ */ n("div", { className: "dgs-ui-kit-text-gray-600", children: a }),
168
+ w
170
169
  ]
171
170
  }
172
171
  ),
173
- b && /* @__PURE__ */ r(
174
- B,
172
+ m && /* @__PURE__ */ n(
173
+ M,
175
174
  {
176
175
  disabled: l,
177
- errorMessage: c,
178
- hintMessage: k,
179
- maxLength: p ? f : void 0,
180
- value: v
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
- T as F,
189
- z as T,
190
- B as a
187
+ I as F,
188
+ T,
189
+ M as a,
190
+ S as o
191
191
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dgshahr/ui-kit",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
4
4
  "description": "dgshahr ui-kit",
5
5
  "author": "dgshahr",
6
6
  "license": "MIT",
@@ -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;