@dgshahr/ui-kit 0.0.26 → 0.0.27

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"),u=require("../../clsx-C11secjj.cjs"),x=require("react"),C=require("../../TextFieldWrapper-51P2QftA.cjs"),v=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"})}),N=x.forwardRef(function(i,h){const{dir:l="rtl",placeholderDir:g=l,containerClassName:p,leftIcon:n,prefix:o,postfix:a,isClearOption:f,onClear:c,...s}=i,[d,m]=x.useState(s.type);return e.jsx(C.TextFieldWrapper,{...i,containerClassName:u.clsx("dgs-ui-kit-items-center",p),children:({handleChangeField:w,value:r,setValue:j})=>e.jsxs(e.Fragment,{children:[o&&e.jsx("span",{className:"dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500",children:o}),e.jsx("input",{...s,ref:h,className:u.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",g==="rtl"?"placeholder:dgs-ui-kit-text-right":"placeholder:dgs-ui-kit-text-left",{ss02:s.type!="password"},i.className),...l==="ltr"?{style:{direction:"ltr"}}:{},value:r,onChange:w,type:d}),f&&r&&r.length>0&&e.jsx("button",{onClick:()=>{j(""),typeof c=="function"&&c()},children:e.jsx(v,{className:"dgs-ui-kit-text-gray-600",width:20,height:20})}),a&&e.jsx("span",{className:"dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500",children:a}),n&&e.jsx("div",{className:"dgs-ui-kit-text-gray-600",children:n}),s.type==="password"&&e.jsx("button",{onClick:()=>m(k=>k==="text"?"password":"text"),className:"dgs-ui-kit-text-gray-600",children:d==="password"?e.jsx(y,{width:20,height:20}):e.jsx(R,{width:20,height:20})})]})})});module.exports=N;
1
+ "use strict";const e=require("react/jsx-runtime"),u=require("../../clsx-C11secjj.cjs"),x=require("react"),C=require("../../TextFieldWrapper-BC0mP63G.cjs"),v=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"})}),N=x.forwardRef(function(i,h){const{dir:l="rtl",placeholderDir:g=l,containerClassName:p,leftIcon:n,prefix:o,postfix:a,isClearOption:f,onClear:c,...s}=i,[d,m]=x.useState(s.type);return e.jsx(C.TextFieldWrapper,{...i,containerClassName:u.clsx("dgs-ui-kit-items-center",p),children:({handleChangeField:w,value:r,setValue:j})=>e.jsxs(e.Fragment,{children:[o&&e.jsx("span",{className:"dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500",children:o}),e.jsx("input",{...s,ref:h,className:u.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",g==="rtl"?"placeholder:dgs-ui-kit-text-right":"placeholder:dgs-ui-kit-text-left",{ss02:s.type!="password"},i.className),...l==="ltr"?{style:{direction:"ltr"}}:{},value:r,onChange:w,type:d}),f&&r&&r.length>0&&e.jsx("button",{onClick:()=>{j(""),typeof c=="function"&&c()},children:e.jsx(v,{className:"dgs-ui-kit-text-gray-600",width:20,height:20})}),a&&e.jsx("span",{className:"dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500",children:a}),n&&e.jsx("div",{className:"dgs-ui-kit-text-gray-600",children:n}),s.type==="password"&&e.jsx("button",{onClick:()=>m(k=>k==="text"?"password":"text"),className:"dgs-ui-kit-text-gray-600",children:d==="password"?e.jsx(y,{width:20,height:20}):e.jsx(R,{width:20,height:20})})]})})});module.exports=N;
@@ -1,7 +1,7 @@
1
1
  import { jsxs as n, jsx as e, Fragment as v } from "react/jsx-runtime";
2
2
  import { c as g } from "../../clsx-OuTLNxxd.js";
3
3
  import { forwardRef as y, useState as N } from "react";
4
- import { T as R } from "../../TextFieldWrapper-BNiYlOSW.js";
4
+ import { T as R } from "../../TextFieldWrapper-Dva9vxfn.js";
5
5
  const I = (t) => /* @__PURE__ */ n(
6
6
  "svg",
7
7
  {
@@ -1 +1 @@
1
- "use client";"use strict";require('../../assets/styles.css');const i=require("react/jsx-runtime"),k=require("../../clsx-C11secjj.cjs"),h=require("react"),q=require("../Input/index.cjs"),m=require("../../TextFieldWrapper-51P2QftA.cjs");;/* empty css */const V=y=>{const{inputsNumber:c=4,onChange:p,onEnd:f,className:j,inputsContainerClassName:v,labelContent:g,hintMessage:d,errorMessage:l,isError:w,value:o}=y,[r,a]=h.useState([]);function u(s){const e=document.getElementById(`dgs-ui-kit-otp-input-${s}`);e?.focus(),e?.select()}function C(s,e){const t=[s.code,s.key];if(t.includes("Backspace")||t.includes("Delete")){const n=[...r];n[e]="",e!==0&&(n[e-1]="",u(e-1)),a(n)}else t.includes("ArrowLeft")?u(e+1):t.includes("ArrowRight")&&u(e-1)}function I(s,e){const t=s.currentTarget.value,n=[...r];n[e]=t,e+1!==c&&t?u(e+1):typeof f=="function"&&n.every(N=>!!N)&&f(n.join("")),a(n),typeof p=="function"&&p(n.join(""))}return h.useEffect(()=>{if(o){const s=o.split("");a(s)}},[o]),i.jsxs("div",{className:k.clsx("dgs-ui-kit-space-y-2",j),children:[g?i.jsx(m.FieldLabel,{labelContent:g}):null,i.jsx("div",{className:k.clsx("dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2",v),children:Array.from(Array(c).keys()).map((s,e)=>i.jsx(q,{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=>I(t,e),onKeyUp:t=>C(t,e),id:`dgs-ui-kit-otp-input-${e}`,maxLength:1,value:r[e],showMaxLength:!1,isError:!!l||w},s))}),l||d?i.jsx(m.FieldBottomInfo,{errorMessage:l,hintMessage:d}):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"),q=require("../Input/index.cjs"),m=require("../../TextFieldWrapper-BC0mP63G.cjs");;/* empty css */const v=y=>{const{inputsNumber:o=4,onChange:p,onEnd:f,className:I,inputsContainerClassName:j,labelContent:g,hintMessage:d,errorMessage:c,isError:w,value:i}=y,[r,a]=k.useState([]);function u(s){const e=document.getElementById(`dgs-ui-kit-otp-input-${s}`);e?.focus(),e?.select()}function C(s,e){const t=[s.code,s.key];if(t.includes("Backspace")||t.includes("Delete")){const n=[...r];n[e]="",e!==0&&(n[e-1]="",u(e-1)),a(n)}else t.includes("ArrowLeft")?u(e+1):t.includes("ArrowRight")&&u(e-1)}function N(s,e){const t=s.currentTarget.value,n=[...r];n[e]=t,e+1!==o&&t&&u(e+1),a(n),typeof p=="function"&&p(n.join(""))}return k.useEffect(()=>{if(i){const s=i.split("");a(s);const e=o===i.length;u(i.length),e&&typeof f=="function"&&f(i)}},[i]),l.jsxs("div",{className:h.clsx("dgs-ui-kit-space-y-2",I),children:[g?l.jsx(m.FieldLabel,{labelContent:g}):null,l.jsx("div",{className:h.clsx("dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2",j),children:Array.from(Array(o).keys()).map((s,e)=>l.jsx(q,{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=>C(t,e),id:`dgs-ui-kit-otp-input-${e}`,maxLength:1,value:r[e],showMaxLength:!1,isError:!!c||w},s))}),c||d?l.jsx(m.FieldBottomInfo,{errorMessage:c,hintMessage:d}):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,EAAyC,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AAI3F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,kBAAkB,CAAC;AAE1B,UAAU,aACR,SAAQ,IAAI,CAAC,kBAAkB,EAAE,cAAc,GAAG,cAAc,GAAG,SAAS,GAAG,aAAa,CAAC;IAC7F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA2F/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Form/OtpInput/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAyC,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AAI3F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,kBAAkB,CAAC;AAE1B,UAAU,aACR,SAAQ,IAAI,CAAC,kBAAkB,EAAE,cAAc,GAAG,cAAc,GAAG,SAAS,GAAG,aAAa,CAAC;IAC7F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA4F/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,81 +1,83 @@
1
1
  "use client";
2
- import { jsxs as N, jsx as o } from "react/jsx-runtime";
2
+ import { jsxs as N, jsx as l } from "react/jsx-runtime";
3
3
  import { c as d } from "../../clsx-OuTLNxxd.js";
4
- import { useState as V, useEffect as B } from "react";
4
+ import { useState as v, useEffect as V } from "react";
5
5
  import E from "../Input/index.js";
6
- import { F as j, a as A } from "../../TextFieldWrapper-BNiYlOSW.js";
6
+ import { F, a as A } from "../../TextFieldWrapper-Dva9vxfn.js";
7
7
  import '../../assets/styles.css';/* empty css */
8
- const U = (k) => {
8
+ const O = (h) => {
9
9
  const {
10
- inputsNumber: c = 4,
10
+ inputsNumber: u = 4,
11
11
  onChange: p,
12
12
  onEnd: f,
13
- className: h,
13
+ className: k,
14
14
  inputsContainerClassName: y,
15
- labelContent: m,
16
- hintMessage: g,
17
- errorMessage: u,
18
- isError: v,
19
- value: a
20
- } = k, [l, r] = V([]);
21
- function n(s) {
22
- const e = document.getElementById(`dgs-ui-kit-otp-input-${s}`);
23
- e?.focus(), e?.select();
15
+ labelContent: g,
16
+ hintMessage: m,
17
+ errorMessage: a,
18
+ isError: I,
19
+ value: n
20
+ } = h, [r, c] = v([]);
21
+ function o(s) {
22
+ const t = document.getElementById(`dgs-ui-kit-otp-input-${s}`);
23
+ t?.focus(), t?.select();
24
24
  }
25
- function w(s, e) {
26
- const t = [s.code, s.key];
27
- if (t.includes("Backspace") || t.includes("Delete")) {
28
- const i = [...l];
29
- i[e] = "", e !== 0 && (i[e - 1] = "", n(e - 1)), r(i);
30
- } else t.includes("ArrowLeft") ? n(e + 1) : t.includes("ArrowRight") && n(e - 1);
25
+ function w(s, t) {
26
+ const e = [s.code, s.key];
27
+ if (e.includes("Backspace") || e.includes("Delete")) {
28
+ const i = [...r];
29
+ i[t] = "", t !== 0 && (i[t - 1] = "", o(t - 1)), c(i);
30
+ } else e.includes("ArrowLeft") ? o(t + 1) : e.includes("ArrowRight") && o(t - 1);
31
31
  }
32
- function C(s, e) {
33
- const t = s.currentTarget.value, i = [...l];
34
- i[e] = t, e + 1 !== c && t ? n(e + 1) : typeof f == "function" && i.every((I) => !!I) && f(i.join("")), r(i), typeof p == "function" && p(i.join(""));
32
+ function C(s, t) {
33
+ const e = s.currentTarget.value, i = [...r];
34
+ i[t] = e, t + 1 !== u && e && o(t + 1), c(i), typeof p == "function" && p(i.join(""));
35
35
  }
36
- return B(() => {
37
- if (a) {
38
- const s = a.split("");
39
- r(s);
36
+ return V(() => {
37
+ if (n) {
38
+ const s = n.split("");
39
+ c(s);
40
+ const t = u === n.length;
41
+ o(n.length), t && typeof f == "function" && f(n);
40
42
  }
41
- }, [a]), /* @__PURE__ */ N("div", { className: d("dgs-ui-kit-space-y-2", h), children: [
42
- m ? /* @__PURE__ */ o(j, { labelContent: m }) : null,
43
- /* @__PURE__ */ o(
43
+ }, [n]), /* @__PURE__ */ N("div", { className: d("dgs-ui-kit-space-y-2", k), children: [
44
+ g ? /* @__PURE__ */ l(F, { labelContent: g }) : null,
45
+ /* @__PURE__ */ l(
44
46
  "div",
45
47
  {
46
48
  className: d(
47
49
  "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2",
48
50
  y
49
51
  ),
50
- children: Array.from(Array(c).keys()).map((s, e) => /* @__PURE__ */ o(
52
+ children: Array.from(Array(u).keys()).map((s, t) => /* @__PURE__ */ l(
51
53
  E,
52
54
  {
53
55
  containerClassName: "dgs-ui-kit-w-12 dgs-ui-kit-h-12 dgs-ui-kit-p-0",
54
56
  className: "dgs-ui-kit-w-full dgs-ui-kit-h-full !dgs-ui-kit-text-center placeholder:!dgs-ui-kit-text-center",
55
57
  placeholder: "-",
56
58
  type: "tel",
57
- autoFocus: e === 0,
58
- onChange: (t) => C(t, e),
59
- onKeyUp: (t) => w(t, e),
60
- id: `dgs-ui-kit-otp-input-${e}`,
59
+ autoFocus: t === 0,
60
+ onChange: (e) => C(e, t),
61
+ onKeyUp: (e) => w(e, t),
62
+ id: `dgs-ui-kit-otp-input-${t}`,
61
63
  maxLength: 1,
62
- value: l[e],
64
+ value: r[t],
63
65
  showMaxLength: !1,
64
- isError: !!u || v
66
+ isError: !!a || I
65
67
  },
66
68
  s
67
69
  ))
68
70
  }
69
71
  ),
70
- u || g ? /* @__PURE__ */ o(
72
+ a || m ? /* @__PURE__ */ l(
71
73
  A,
72
74
  {
73
- errorMessage: u,
74
- hintMessage: g
75
+ errorMessage: a,
76
+ hintMessage: m
75
77
  }
76
78
  ) : null
77
79
  ] });
78
80
  };
79
81
  export {
80
- U as default
82
+ O as default
81
83
  };
@@ -1 +1 @@
1
- "use strict";const i=require("react/jsx-runtime"),n=require("../../clsx-C11secjj.cjs"),o=require("react"),c=require("../../TextFieldWrapper-51P2QftA.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 i=require("react/jsx-runtime"),n=require("../../clsx-C11secjj.cjs"),o=require("react"),c=require("../../TextFieldWrapper-BC0mP63G.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,7 +1,7 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { c as d } from "../../clsx-OuTLNxxd.js";
3
3
  import { forwardRef as u } from "react";
4
- import { T as n } from "../../TextFieldWrapper-BNiYlOSW.js";
4
+ import { T as n } from "../../TextFieldWrapper-Dva9vxfn.js";
5
5
  const m = u(function(t, s) {
6
6
  const { dir: e = "rtl", placeholderDir: l = e, className: o, ...r } = t;
7
7
  return /* @__PURE__ */ i(n, { ...t, children: ({ handleChangeField: a }) => /* @__PURE__ */ i(
@@ -1,8 +1,9 @@
1
+ import { FC, PropsWithChildren } from 'react';
1
2
  import { TextFieldBaseProps } from './TextFieldWrapper';
2
3
  interface FieldLabelProps extends Pick<TextFieldBaseProps, 'link' | 'labelContent'> {
3
4
  required?: boolean;
4
5
  disabled?: boolean;
5
6
  }
6
- declare const FieldLabel: (props: FieldLabelProps) => import("react/jsx-runtime").JSX.Element;
7
+ declare const FieldLabel: FC<PropsWithChildren<FieldLabelProps>>;
7
8
  export default FieldLabel;
8
9
  //# sourceMappingURL=FieldLabel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FieldLabel.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/Wrappers/TextFieldWrapper/FieldLabel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,UAAU,eAAgB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,cAAc,CAAC;IACjF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,UAAU,UAAW,eAAe,4CA4BzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"FieldLabel.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/Wrappers/TextFieldWrapper/FieldLabel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,UAAU,eAAgB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,cAAc,CAAC;IACjF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAgCtD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,6 +1,7 @@
1
- import { ChangeEvent, ChangeEventHandler, Dispatch, ReactNode, SetStateAction } from 'react';
1
+ import { default as React, ChangeEvent, ChangeEventHandler, Dispatch, ReactNode, SetStateAction } from 'react';
2
2
  export interface TextFieldBaseProps {
3
3
  labelContent?: string;
4
+ labelAddon?: React.ReactNode;
4
5
  link?: {
5
6
  cnotent: string;
6
7
  href: string;
@@ -24,6 +25,7 @@ interface TextFieldWrapperProps<T> extends TextFieldBaseProps {
24
25
  required?: boolean;
25
26
  disabled?: boolean;
26
27
  maxLength?: number;
28
+ labelAddon?: React.ReactNode;
27
29
  value?: string | number | readonly string[];
28
30
  onChange?: ChangeEventHandler<T>;
29
31
  children: (argumants: TextFieldFunctionArgumants<T>) => ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"TextFieldWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.tsx"],"names":[],"mappings":"AAEA,OAAc,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,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,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,4CAsFhC,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,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"}
@@ -167,7 +167,7 @@ const $ = (e) => {
167
167
  Object.entries(n).filter(([o]) => o !== "children")
168
168
  ), h = j(null), m = Math.ceil(L / Math.floor(s)), B = (f || c && c !== "hide" || k) && m > 1;
169
169
  function D(o) {
170
- if (Math.ceil(Math.abs(o.currentTarget.scrollLeft)) + o.currentTarget.clientWidth === o.currentTarget.scrollWidth) {
170
+ if (Math.ceil(Math.abs(o.currentTarget.scrollLeft)) + o.currentTarget.clientWidth + 1 === o.currentTarget.scrollWidth) {
171
171
  b(m - 1);
172
172
  return;
173
173
  }
@@ -1 +1 @@
1
- "use client";"use strict";const e=require("react/jsx-runtime"),x=require("./clsx-C11secjj.cjs"),r=require("react"),W=require("./ArrowLeft2-B76dkC-C.cjs"),B=require("./ArrowRight2-CYowPzS8.cjs"),T=require("./Button/index.cjs"),P=r.createContext({slidesPerView:1,spaceBetween:0,navigationVariant:"outside",showNavigationDots:!0,showPaginationText:!1}),b=()=>r.useContext(P);function D({active:i,autoplay:s,variant:n="outside"}){return[{inside:"dgs-ui-kit-bg-gray-500/50 hover:dgs-ui-kit-bg-gray-500/80",outside:"dgs-ui-kit-bg-gray-200 hover:dgs-ui-kit-bg-gray-300"}[n],i?"dgs-ui-kit-w-[22px]":"dgs-ui-kit-w-[6px]",s?"dgs-ui-kit-p-[1px]":""]}const q=i=>{const{active:s,onClick:n,onNavigateToNext:a}=i,{autoplay:t,navigationVariant:l="outside"}=b(),[k,o]=r.useState(0);return r.useEffect(()=>{if(!s||!t)return;const g=typeof t=="boolean"?7e3:t?.delay??7e3;let u=Date.now();const v=setInterval(()=>{const f=Date.now()-u,c=f/g*100;o(Math.min(c,100)),f>=g&&typeof a=="function"&&a()},100);return function(){return o(0),u=Date.now(),clearInterval(v)}},[s,t,a]),e.jsx("button",{className:x.clsx("dgs-ui-kit-rounded-full dgs-ui-kit-overflow-hidden dgs-ui-kit-transition-all dgs-ui-kit-h-[6px]",D({active:s,autoplay:t,variant:l})),onClick:n,children:s&&e.jsx("div",{className:x.clsx("dgs-ui-kit-h-full dgs-ui-kit-rounded-full",{"dgs-ui-kit-bg-white":l==="inside","dgs-ui-kit-bg-gray-700":l==="outside"}),style:{width:t?`${k}%`:"100%"}})})},O=i=>{const{onNavigate:s,slideIndex:n,slidesCount:a}=i,{navigationButtonsShowType:t="hide",dotsClassName:l,navigationContainerClassName:k,navigationVariant:o="outside",showNavigationDots:g=!0,showPaginationText:u}=b(),v=e.jsxs("div",{className:x.clsx("dgs-ui-kit-flex dgs-ui-kit-gap-2",{"dgs-ui-kit-absolute dgs-ui-kit-bottom-0 dgs-ui-kit-left-[5.5%]":o==="inside"&&t!=="onSides","dgs-ui-kit-absolute dgs-ui-kit-justify-between dgs-ui-kit-top-1/2 -dgs-ui-kit-translate-y-1/2 dgs-ui-kit-w-full dgs-ui-kit-px-[5.5%]":t==="onSides","dgs-ui-kit-opacity-0 group-hover:dgs-ui-kit-opacity-100 dgs-ui-kit-transition":t==="hover"||t==="onSides"}),children:[e.jsx(T,{type:"button",variant:"secondary",onClick:()=>s(n-1),rightIcon:e.jsx(B.ArrowRight2Icon,{})}),e.jsx(T,{type:"button",variant:"secondary",onClick:()=>s(n+1),rightIcon:e.jsx(W.ArrowLeft2Icon,{})})]});return e.jsxs(e.Fragment,{children:[t&&t!=="hide"&&t==="onSides"&&v,e.jsxs("div",{className:x.clsx("dgs-ui-kit-flex",{"dgs-ui-kit-items-center dgs-ui-kit-mt-2":o==="outside","dgs-ui-kit-absolute dgs-ui-kit-bottom-4 dgs-ui-kit-w-full dgs-ui-kit-justify-center":o==="inside","dgs-ui-kit-justify-between":o==="outside"&&t!=="hide"&&t!=="onSides","dgs-ui-kit-justify-center":o==="outside"&&(t==="hide"||t==="onSides")},k),children:[t&&t!=="hide"&&t!=="onSides"&&v,(g||u)&&e.jsxs("div",{className:"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-3",children:[u&&e.jsxs("div",{className:"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-1 dgs-ui-kit-font-caption-regular dgs-ui-kit-text-gray-400 ss02",children:[e.jsx("span",{className:x.clsx("dgs-ui-kit-font-bold",{"dgs-ui-kit-text-gray-600":o==="outside","dgs-ui-kit-text-white":o==="inside"}),children:n+1}),e.jsx("span",{children:"از"}),e.jsx("span",{children:a})]}),g&&e.jsx("div",{className:x.clsx("dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-justify-center dgs-ui-kit-gap-2",l),children:Array.from(Array(a).keys()).map((f,c)=>e.jsx(q,{active:n===c,onClick:()=>s(c),onNavigateToNext:()=>s(n+1)},f+a))})]})]})]})},I=r.forwardRef((i,s)=>{const[n,a]=r.useState(i),{className:t="",containerClassName:l="",showNavigationDots:k=!0,slidesPerView:o=1,navigationButtonsShowType:g="hide",spaceBetween:u=0,showPaginationText:v,onSlideIndexChange:f,initialSlide:c}=n,[w,N]=r.useState(0),[R,A]=r.useState(0),L=Object.fromEntries(Object.entries(n).filter(([d])=>d!=="children")),h=r.useRef(null),m=Math.ceil(R/Math.floor(o)),M=(k||g&&g!=="hide"||v)&&m>1;function E(d){if(Math.ceil(Math.abs(d.currentTarget.scrollLeft))+d.currentTarget.clientWidth===d.currentTarget.scrollWidth){N(m-1);return}const p=d.currentTarget.scrollWidth/m,y=(d.currentTarget.scrollWidth-d.currentTarget.scrollLeft)/p;if(y<=m){N(0);return}N(Math.round(y%m))}function j(d){if(!h.current)return;const p=h.current.offsetWidth,S=(w-d)*p;d<0?h.current.scrollTo({behavior:"smooth",left:-(p*m)}):d>=m?h.current.scrollTo({behavior:"smooth",left:0}):h.current.scrollBy({behavior:"smooth",left:S})}function C(){const p=Object.keys(i.responsive).sort().findLast(S=>Number(S)<=window.innerWidth),y=p?i.responsive[Number(p)]:null;a(y?{...n,...y}:i)}return r.useImperativeHandle(s,()=>({element:h.current,navigate:d=>j(Math.max(0,d-1))})),r.useEffect(()=>{h.current&&A(h.current.childNodes.length)},[i.children]),r.useEffect(()=>{if(!(!i.responsive||Object.keys(i.responsive).length<=0))return C(),window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}},[i.responsive]),r.useEffect(()=>{f&&typeof f=="function"&&f(w)},[w]),r.useEffect(()=>{typeof c=="number"&&h.current&&j(Math.max(0,c-1))},[c,h.current]),e.jsx(P.Provider,{value:L,children:e.jsxs("div",{className:x.clsx("dgs-ui-kit-overflow-hidden dgs-ui-kit-relative dgs-ui-kit-group",t),style:{direction:"rtl"},children:[e.jsx("div",{className:x.clsx("dgs-ui-kit-flex dgs-ui-kit-snap-x dgs-ui-kit-snap-mandatory dgs-ui-kit-overflow-x-auto no-scrollbar",l),style:{marginLeft:-u},onScroll:E,ref:h,children:i.children}),M&&e.jsx(O,{onNavigate:j,slideIndex:w,slidesCount:m})]})})});I.displayName="Slider";function V({slidesPerView:i,childIndex:s,centerMode:n,childrenCount:a}){const t=s%Math.floor(i)===0,l=i%1!==0,k=s===0,o=s===a-1;return t?n&&l?k?"start":o?"end":"center":"start":"none"}const F=i=>{const{children:s,className:n,style:a,...t}=i,{slidesPerView:l=1,spaceBetween:k=0,centerMode:o=!1,containerXPadding:g=0}=b(),u=r.useRef(null),[v,f]=r.useState(0),c=u.current?.parentNode?.children.length;return r.useEffect(()=>{u.current&&f(Array.prototype.indexOf.call(u.current.parentNode?.children,u.current))},[u]),e.jsx("div",{...t,ref:u,className:x.clsx("dgs-ui-kit-shrink-0 dgs-ui-kit-snap-normal",n),style:{width:100/(l??1)+"%",paddingLeft:c&&v===c-1?g+k:k,paddingRight:v===0?g:0,scrollSnapAlign:V({slidesPerView:l,childIndex:v,centerMode:o,childrenCount:c||0}),...a},children:s})};exports.Slide=F;exports.Slider=I;
1
+ "use client";"use strict";const e=require("react/jsx-runtime"),x=require("./clsx-C11secjj.cjs"),r=require("react"),W=require("./ArrowLeft2-B76dkC-C.cjs"),B=require("./ArrowRight2-CYowPzS8.cjs"),T=require("./Button/index.cjs"),P=r.createContext({slidesPerView:1,spaceBetween:0,navigationVariant:"outside",showNavigationDots:!0,showPaginationText:!1}),b=()=>r.useContext(P);function D({active:i,autoplay:s,variant:n="outside"}){return[{inside:"dgs-ui-kit-bg-gray-500/50 hover:dgs-ui-kit-bg-gray-500/80",outside:"dgs-ui-kit-bg-gray-200 hover:dgs-ui-kit-bg-gray-300"}[n],i?"dgs-ui-kit-w-[22px]":"dgs-ui-kit-w-[6px]",s?"dgs-ui-kit-p-[1px]":""]}const q=i=>{const{active:s,onClick:n,onNavigateToNext:a}=i,{autoplay:t,navigationVariant:l="outside"}=b(),[k,o]=r.useState(0);return r.useEffect(()=>{if(!s||!t)return;const g=typeof t=="boolean"?7e3:t?.delay??7e3;let u=Date.now();const v=setInterval(()=>{const f=Date.now()-u,c=f/g*100;o(Math.min(c,100)),f>=g&&typeof a=="function"&&a()},100);return function(){return o(0),u=Date.now(),clearInterval(v)}},[s,t,a]),e.jsx("button",{className:x.clsx("dgs-ui-kit-rounded-full dgs-ui-kit-overflow-hidden dgs-ui-kit-transition-all dgs-ui-kit-h-[6px]",D({active:s,autoplay:t,variant:l})),onClick:n,children:s&&e.jsx("div",{className:x.clsx("dgs-ui-kit-h-full dgs-ui-kit-rounded-full",{"dgs-ui-kit-bg-white":l==="inside","dgs-ui-kit-bg-gray-700":l==="outside"}),style:{width:t?`${k}%`:"100%"}})})},O=i=>{const{onNavigate:s,slideIndex:n,slidesCount:a}=i,{navigationButtonsShowType:t="hide",dotsClassName:l,navigationContainerClassName:k,navigationVariant:o="outside",showNavigationDots:g=!0,showPaginationText:u}=b(),v=e.jsxs("div",{className:x.clsx("dgs-ui-kit-flex dgs-ui-kit-gap-2",{"dgs-ui-kit-absolute dgs-ui-kit-bottom-0 dgs-ui-kit-left-[5.5%]":o==="inside"&&t!=="onSides","dgs-ui-kit-absolute dgs-ui-kit-justify-between dgs-ui-kit-top-1/2 -dgs-ui-kit-translate-y-1/2 dgs-ui-kit-w-full dgs-ui-kit-px-[5.5%]":t==="onSides","dgs-ui-kit-opacity-0 group-hover:dgs-ui-kit-opacity-100 dgs-ui-kit-transition":t==="hover"||t==="onSides"}),children:[e.jsx(T,{type:"button",variant:"secondary",onClick:()=>s(n-1),rightIcon:e.jsx(B.ArrowRight2Icon,{})}),e.jsx(T,{type:"button",variant:"secondary",onClick:()=>s(n+1),rightIcon:e.jsx(W.ArrowLeft2Icon,{})})]});return e.jsxs(e.Fragment,{children:[t&&t!=="hide"&&t==="onSides"&&v,e.jsxs("div",{className:x.clsx("dgs-ui-kit-flex",{"dgs-ui-kit-items-center dgs-ui-kit-mt-2":o==="outside","dgs-ui-kit-absolute dgs-ui-kit-bottom-4 dgs-ui-kit-w-full dgs-ui-kit-justify-center":o==="inside","dgs-ui-kit-justify-between":o==="outside"&&t!=="hide"&&t!=="onSides","dgs-ui-kit-justify-center":o==="outside"&&(t==="hide"||t==="onSides")},k),children:[t&&t!=="hide"&&t!=="onSides"&&v,(g||u)&&e.jsxs("div",{className:"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-3",children:[u&&e.jsxs("div",{className:"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-1 dgs-ui-kit-font-caption-regular dgs-ui-kit-text-gray-400 ss02",children:[e.jsx("span",{className:x.clsx("dgs-ui-kit-font-bold",{"dgs-ui-kit-text-gray-600":o==="outside","dgs-ui-kit-text-white":o==="inside"}),children:n+1}),e.jsx("span",{children:"از"}),e.jsx("span",{children:a})]}),g&&e.jsx("div",{className:x.clsx("dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-justify-center dgs-ui-kit-gap-2",l),children:Array.from(Array(a).keys()).map((f,c)=>e.jsx(q,{active:n===c,onClick:()=>s(c),onNavigateToNext:()=>s(n+1)},f+a))})]})]})]})},I=r.forwardRef((i,s)=>{const[n,a]=r.useState(i),{className:t="",containerClassName:l="",showNavigationDots:k=!0,slidesPerView:o=1,navigationButtonsShowType:g="hide",spaceBetween:u=0,showPaginationText:v,onSlideIndexChange:f,initialSlide:c}=n,[w,N]=r.useState(0),[R,A]=r.useState(0),L=Object.fromEntries(Object.entries(n).filter(([d])=>d!=="children")),h=r.useRef(null),m=Math.ceil(R/Math.floor(o)),M=(k||g&&g!=="hide"||v)&&m>1;function E(d){if(Math.ceil(Math.abs(d.currentTarget.scrollLeft))+d.currentTarget.clientWidth+1===d.currentTarget.scrollWidth){N(m-1);return}const p=d.currentTarget.scrollWidth/m,y=(d.currentTarget.scrollWidth-d.currentTarget.scrollLeft)/p;if(y<=m){N(0);return}N(Math.round(y%m))}function j(d){if(!h.current)return;const p=h.current.offsetWidth,S=(w-d)*p;d<0?h.current.scrollTo({behavior:"smooth",left:-(p*m)}):d>=m?h.current.scrollTo({behavior:"smooth",left:0}):h.current.scrollBy({behavior:"smooth",left:S})}function C(){const p=Object.keys(i.responsive).sort().findLast(S=>Number(S)<=window.innerWidth),y=p?i.responsive[Number(p)]:null;a(y?{...n,...y}:i)}return r.useImperativeHandle(s,()=>({element:h.current,navigate:d=>j(Math.max(0,d-1))})),r.useEffect(()=>{h.current&&A(h.current.childNodes.length)},[i.children]),r.useEffect(()=>{if(!(!i.responsive||Object.keys(i.responsive).length<=0))return C(),window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}},[i.responsive]),r.useEffect(()=>{f&&typeof f=="function"&&f(w)},[w]),r.useEffect(()=>{typeof c=="number"&&h.current&&j(Math.max(0,c-1))},[c,h.current]),e.jsx(P.Provider,{value:L,children:e.jsxs("div",{className:x.clsx("dgs-ui-kit-overflow-hidden dgs-ui-kit-relative dgs-ui-kit-group",t),style:{direction:"rtl"},children:[e.jsx("div",{className:x.clsx("dgs-ui-kit-flex dgs-ui-kit-snap-x dgs-ui-kit-snap-mandatory dgs-ui-kit-overflow-x-auto no-scrollbar",l),style:{marginLeft:-u},onScroll:E,ref:h,children:i.children}),M&&e.jsx(O,{onNavigate:j,slideIndex:w,slidesCount:m})]})})});I.displayName="Slider";function V({slidesPerView:i,childIndex:s,centerMode:n,childrenCount:a}){const t=s%Math.floor(i)===0,l=i%1!==0,k=s===0,o=s===a-1;return t?n&&l?k?"start":o?"end":"center":"start":"none"}const F=i=>{const{children:s,className:n,style:a,...t}=i,{slidesPerView:l=1,spaceBetween:k=0,centerMode:o=!1,containerXPadding:g=0}=b(),u=r.useRef(null),[v,f]=r.useState(0),c=u.current?.parentNode?.children.length;return r.useEffect(()=>{u.current&&f(Array.prototype.indexOf.call(u.current.parentNode?.children,u.current))},[u]),e.jsx("div",{...t,ref:u,className:x.clsx("dgs-ui-kit-shrink-0 dgs-ui-kit-snap-normal",n),style:{width:100/(l??1)+"%",paddingLeft:c&&v===c-1?g+k:k,paddingRight:v===0?g:0,scrollSnapAlign:V({slidesPerView:l,childIndex:v,centerMode:o,childrenCount:c||0}),...a},children:s})};exports.Slide=F;exports.Slider=I;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../assets/styles.css');;/* empty css */const e=require("../Slide-Cr0SfMFS.cjs");exports.Slide=e.Slide;exports.Slider=e.Slider;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../assets/styles.css');;/* empty css */const e=require("../Slide-DlUl47v_.cjs");exports.Slide=e.Slide;exports.Slider=e.Slider;
@@ -1,5 +1,5 @@
1
1
  import '../assets/styles.css';/* empty css */
2
- import { a as i, S as o } from "../Slide-DV9RZ3-5.js";
2
+ import { a as i, S as o } from "../Slide-CdflnA1A.js";
3
3
  export {
4
4
  i as Slide,
5
5
  o as Slider
@@ -0,0 +1 @@
1
+ "use client";"use strict";require('./assets/styles.css');const e=require("react/jsx-runtime"),u=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:u.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:u.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:u.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:g,hintMessage:k,required:F,labelAddon:M,maxLength:x,disabled:o,value:l,wrapperClassName:f,showMaxLength:m,onChange:p,children:q}=r,[v,c]=h.useState(l?.toString()??"");h.useEffect(()=>{typeof l<"u"&&l!==null&&c(l?.toString())},[l]);const I=a=>{c(a.currentTarget.value),p&&p(a)},j=!!(g||k||x&&m),b=!!(i||t?.href),y=j||b?"div":h.Fragment,L=a=>{const w=a.currentTarget.querySelector("textarea, input");w&&w.focus()};return e.jsxs(y,{...y==="div"&&f?{className:f}:{},children:[b&&e.jsx(C,{disabled:o,labelContent:i,link:t,required:F,children:M}),e.jsxs("div",{onClick:L,className:u.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 hover:dgs-ui-kit-ring-gray-50 has-[:focus]:dgs-ui-kit-bg-white ",n||g?"dgs-ui-kit-border-error-500 has-[:focus]:dgs-ui-kit-ring-error-50":"dgs-ui-kit-border-transparent hover:dgs-ui-kit-border-gray-300 has-[:focus]:dgs-ui-kit-border-primary-500 has-[:focus]:dgs-ui-kit-ring-primary-50",s,{"dgs-ui-kit-text-gray-400":o}),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:o,errorMessage:g,hintMessage:k,maxLength:m?x:void 0,value:v})]})};exports.FieldBottomInfo=N;exports.FieldLabel=C;exports.TextFieldWrapper=R;
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { jsxs as r, jsx as s } from "react/jsx-runtime";
2
+ import { jsxs as s, jsx as r, Fragment as I } from "react/jsx-runtime";
3
3
  import { c as g } from "./clsx-OuTLNxxd.js";
4
- import M, { useState as I, useEffect as E } from "react";
4
+ import E, { useState as L, useEffect as R } from "react";
5
5
  import './assets/styles.css';/* empty css */
6
- const L = (n) => /* @__PURE__ */ r(
6
+ const S = (n) => /* @__PURE__ */ s(
7
7
  "svg",
8
8
  {
9
9
  xmlns: "http://www.w3.org/2000/svg",
@@ -13,7 +13,7 @@ const L = (n) => /* @__PURE__ */ r(
13
13
  viewBox: "0 0 24 24",
14
14
  ...n,
15
15
  children: [
16
- /* @__PURE__ */ s(
16
+ /* @__PURE__ */ r(
17
17
  "path",
18
18
  {
19
19
  fill: "currentColor",
@@ -22,7 +22,7 @@ const L = (n) => /* @__PURE__ */ r(
22
22
  clipRule: "evenodd"
23
23
  }
24
24
  ),
25
- /* @__PURE__ */ s(
25
+ /* @__PURE__ */ r(
26
26
  "path",
27
27
  {
28
28
  fill: "currentColor",
@@ -33,9 +33,9 @@ const L = (n) => /* @__PURE__ */ r(
33
33
  )
34
34
  ]
35
35
  }
36
- ), R = (n) => {
37
- const { errorMessage: i, hintMessage: e, maxLength: t, value: d, disabled: l } = n;
38
- return /* @__PURE__ */ r(
36
+ ), B = (n) => {
37
+ const { errorMessage: i, hintMessage: e, maxLength: t, value: a, disabled: d } = n;
38
+ return /* @__PURE__ */ s(
39
39
  "div",
40
40
  {
41
41
  className: g(
@@ -44,106 +44,112 @@ const L = (n) => /* @__PURE__ */ r(
44
44
  "dgs-ui-kit-justify-between": (i || e) && t,
45
45
  "dgs-ui-kit-justify-start": (i || e) && !t,
46
46
  "dgs-ui-kit-justify-end": !(i || e) && t,
47
- "dgs-ui-kit-text-gray-400": l
47
+ "dgs-ui-kit-text-gray-400": d
48
48
  },
49
49
  i ? "dgs-ui-kit-text-error-500" : "dgs-ui-kit-text-gray-500"
50
50
  ),
51
51
  children: [
52
- (i || e) && /* @__PURE__ */ r(
52
+ (i || e) && /* @__PURE__ */ s(
53
53
  "div",
54
54
  {
55
55
  className: g(
56
56
  "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2 dgs-ui-kit-font-light",
57
57
  {
58
- "dgs-ui-kit-text-gray-400": l
58
+ "dgs-ui-kit-text-gray-400": d
59
59
  }
60
60
  ),
61
61
  children: [
62
- /* @__PURE__ */ s(
63
- L,
62
+ /* @__PURE__ */ r(
63
+ S,
64
64
  {
65
65
  width: 16,
66
66
  height: 16
67
67
  }
68
68
  ),
69
- /* @__PURE__ */ s("span", { children: i || e })
69
+ /* @__PURE__ */ r("span", { children: i || e })
70
70
  ]
71
71
  }
72
72
  ),
73
- t && /* @__PURE__ */ r("span", { className: "ss02", children: [
74
- d?.length ?? 0,
73
+ t && /* @__PURE__ */ s("span", { className: "ss02", children: [
74
+ a?.length ?? 0,
75
75
  "/",
76
76
  t
77
77
  ] })
78
78
  ]
79
79
  }
80
80
  );
81
- }, S = (n) => {
82
- const { link: i, labelContent: e, required: t, disabled: d } = n;
83
- return /* @__PURE__ */ r(
84
- "div",
85
- {
86
- className: g("dgs-ui-kit-flex dgs-ui-kit-mb-2", {
87
- "dgs-ui-kit-justify-between": e && i?.href,
88
- "dgs-ui-kit-justify-start": e && !i?.href,
89
- "dgs-ui-kit-justify-end": !e && i?.href,
90
- "dgs-ui-kit-text-gray-400": d
91
- }),
92
- children: [
93
- e && /* @__PURE__ */ r("label", { className: "dgs-ui-kit-px-0 dgs-ui-kit-font-p2-medium md:dgs-ui-kit-mx-0", children: [
94
- e,
95
- t && /* @__PURE__ */ s("span", { className: "dgs-ui-kit-ms-2 dgs-ui-kit-text-error-500", children: "*" })
96
- ] }),
97
- i?.href && /* @__PURE__ */ s(
98
- "a",
99
- {
100
- href: i.href,
101
- className: "dgs-ui-kit-font-button-small dgs-ui-kit-text-primary-400",
102
- children: i.cnotent
103
- }
104
- )
105
- ]
106
- }
107
- );
108
- }, A = (n) => {
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(
85
+ "div",
86
+ {
87
+ className: g("dgs-ui-kit-flex", {
88
+ "dgs-ui-kit-justify-between": e && i?.href,
89
+ "dgs-ui-kit-mb-2": !d,
90
+ "dgs-ui-kit-justify-start": e && !i?.href,
91
+ "dgs-ui-kit-justify-end": !e && i?.href,
92
+ "dgs-ui-kit-text-gray-400": a
93
+ }),
94
+ 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: [
96
+ e,
97
+ t && /* @__PURE__ */ r("span", { className: "dgs-ui-kit-ms-2 dgs-ui-kit-text-error-500", children: "*" })
98
+ ] }),
99
+ i?.href && /* @__PURE__ */ r(
100
+ "a",
101
+ {
102
+ href: i.href,
103
+ className: "dgs-ui-kit-font-button-small dgs-ui-kit-text-primary-400",
104
+ children: i.cnotent
105
+ }
106
+ )
107
+ ]
108
+ }
109
+ ),
110
+ d
111
+ ] });
112
+ }, D = (n) => {
109
113
  const {
110
114
  labelContent: i,
111
115
  link: e,
112
116
  containerClassName: t,
113
- rightIcon: d,
114
- isError: l,
117
+ rightIcon: a,
118
+ isError: d,
115
119
  errorMessage: o,
116
- hintMessage: h,
120
+ hintMessage: k,
117
121
  required: N,
122
+ labelAddon: j,
118
123
  maxLength: f,
119
124
  disabled: c,
120
- value: a,
125
+ value: l,
121
126
  wrapperClassName: m,
122
127
  showMaxLength: p,
123
128
  onChange: x,
124
- children: j
125
- } = n, [v, k] = I(a?.toString() ?? "");
126
- E(() => {
127
- typeof a < "u" && a !== null && k(a?.toString());
128
- }, [a]);
129
- const F = (u) => {
130
- k(u.currentTarget.value), x && x(u);
131
- }, b = !!(o || h || f && p), y = !!(i || e?.href), w = b || y ? "div" : M.Fragment;
132
- return /* @__PURE__ */ r(
129
+ children: F
130
+ } = n, [v, h] = L(l?.toString() ?? "");
131
+ R(() => {
132
+ typeof l < "u" && l !== null && h(l?.toString());
133
+ }, [l]);
134
+ const M = (u) => {
135
+ h(u.currentTarget.value), x && x(u);
136
+ }, b = !!(o || k || f && p), y = !!(i || e?.href), w = b || y ? "div" : E.Fragment;
137
+ return /* @__PURE__ */ s(
133
138
  w,
134
139
  {
135
140
  ...w === "div" && m ? { className: m } : {},
136
141
  children: [
137
- y && /* @__PURE__ */ s(
138
- S,
142
+ y && /* @__PURE__ */ r(
143
+ T,
139
144
  {
140
145
  disabled: c,
141
146
  labelContent: i,
142
147
  link: e,
143
- required: N
148
+ required: N,
149
+ children: j
144
150
  }
145
151
  ),
146
- /* @__PURE__ */ r(
152
+ /* @__PURE__ */ s(
147
153
  "div",
148
154
  {
149
155
  onClick: (u) => {
@@ -152,24 +158,24 @@ const L = (n) => /* @__PURE__ */ r(
152
158
  },
153
159
  className: g(
154
160
  "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 hover:dgs-ui-kit-ring-gray-50 has-[:focus]:dgs-ui-kit-bg-white ",
155
- l || o ? "dgs-ui-kit-border-error-500 has-[:focus]:dgs-ui-kit-ring-error-50" : "dgs-ui-kit-border-transparent hover:dgs-ui-kit-border-gray-300 has-[:focus]:dgs-ui-kit-border-primary-500 has-[:focus]:dgs-ui-kit-ring-primary-50",
161
+ d || o ? "dgs-ui-kit-border-error-500 has-[:focus]:dgs-ui-kit-ring-error-50" : "dgs-ui-kit-border-transparent hover:dgs-ui-kit-border-gray-300 has-[:focus]:dgs-ui-kit-border-primary-500 has-[:focus]:dgs-ui-kit-ring-primary-50",
156
162
  t,
157
163
  {
158
164
  "dgs-ui-kit-text-gray-400": c
159
165
  }
160
166
  ),
161
167
  children: [
162
- d && /* @__PURE__ */ s("div", { className: "dgs-ui-kit-text-gray-600", children: d }),
163
- j({ handleChangeField: F, setValue: k, value: v })
168
+ a && /* @__PURE__ */ r("div", { className: "dgs-ui-kit-text-gray-600", children: a }),
169
+ F({ handleChangeField: M, setValue: h, value: v })
164
170
  ]
165
171
  }
166
172
  ),
167
- b && /* @__PURE__ */ s(
168
- R,
173
+ b && /* @__PURE__ */ r(
174
+ B,
169
175
  {
170
176
  disabled: c,
171
177
  errorMessage: o,
172
- hintMessage: h,
178
+ hintMessage: k,
173
179
  maxLength: p ? f : void 0,
174
180
  value: v
175
181
  }
@@ -179,7 +185,7 @@ const L = (n) => /* @__PURE__ */ r(
179
185
  );
180
186
  };
181
187
  export {
182
- S as F,
183
- A as T,
184
- R as a
188
+ T as F,
189
+ D as T,
190
+ B as a
185
191
  };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/styles.css');;/* empty css */const r=require("./AccordionItem-AwBSlD0h.cjs"),o=require("./Alert/index.cjs"),t=require("./Badge/index.cjs"),i=require("./Breadcrumb/index.cjs"),n=require("./Button/index.cjs"),c=require("./Divider/index.cjs"),u=require("./Drawer/index.cjs"),s=require("./Form/Checkbox/index.cjs"),a=require("./Form/Input/index.cjs"),d=require("./Form/OtpInput/index.cjs"),q=require("./Form/RadioButton/index.cjs"),m=require("./Form/Textarea/index.cjs"),l=require("./Pagination/index.cjs"),B=require("./Progress/Bar/index.cjs"),e=require("./Slide-Cr0SfMFS.cjs"),p=require("./Tabs/index.cjs");exports.AccordionGroup=r.AccordionGroup;exports.AccordionItem=r.AccordionItem;exports.Alert=o;exports.Badge=t;exports.Breadcrumb=i;exports.Button=n;exports.Divider=c;exports.Drawer=u;exports.Checkbox=s;exports.Input=a;exports.OtpInput=d;exports.RadioButton=q;exports.Textarea=m;exports.Pagination=l;exports.ProgressBar=B;exports.Slide=e.Slide;exports.Slider=e.Slider;exports.Tabs=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/styles.css');;/* empty css */const r=require("./AccordionItem-AwBSlD0h.cjs"),o=require("./Alert/index.cjs"),t=require("./Badge/index.cjs"),i=require("./Breadcrumb/index.cjs"),n=require("./Button/index.cjs"),c=require("./Divider/index.cjs"),u=require("./Drawer/index.cjs"),s=require("./Form/Checkbox/index.cjs"),a=require("./Form/Input/index.cjs"),d=require("./Form/OtpInput/index.cjs"),q=require("./Form/RadioButton/index.cjs"),m=require("./Form/Textarea/index.cjs"),l=require("./Pagination/index.cjs"),B=require("./Progress/Bar/index.cjs"),e=require("./Slide-DlUl47v_.cjs"),p=require("./Tabs/index.cjs");exports.AccordionGroup=r.AccordionGroup;exports.AccordionItem=r.AccordionItem;exports.Alert=o;exports.Badge=t;exports.Breadcrumb=i;exports.Button=n;exports.Divider=c;exports.Drawer=u;exports.Checkbox=s;exports.Input=a;exports.OtpInput=d;exports.RadioButton=q;exports.Textarea=m;exports.Pagination=l;exports.ProgressBar=B;exports.Slide=e.Slide;exports.Slider=e.Slider;exports.Tabs=p;
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import { default as T } from "./Form/RadioButton/index.js";
13
13
  import { default as k } from "./Form/Textarea/index.js";
14
14
  import { default as w } from "./Pagination/index.js";
15
15
  import { default as G } from "./Progress/Bar/index.js";
16
- import { a as R, S as j } from "./Slide-DV9RZ3-5.js";
16
+ import { a as R, S as j } from "./Slide-CdflnA1A.js";
17
17
  import { default as y } from "./Tabs/index.js";
18
18
  export {
19
19
  e as AccordionGroup,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dgshahr/ui-kit",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
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"),u=require("./clsx-C11secjj.cjs"),k=require("react");;/* empty css */const L=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:n,disabled:a}=r;return e.jsxs("div",{className:u.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":a},i?"dgs-ui-kit-text-error-500":"dgs-ui-kit-text-gray-500"),children:[(i||t)&&e.jsxs("div",{className:u.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":a}),children:[e.jsx(L,{width:16,height:16}),e.jsx("span",{children:i||t})]}),s&&e.jsxs("span",{className:"ss02",children:[n?.length??0,"/",s]})]})},C=r=>{const{link:i,labelContent:t,required:s,disabled:n}=r;return e.jsxs("div",{className:u.clsx("dgs-ui-kit-flex dgs-ui-kit-mb-2",{"dgs-ui-kit-justify-between":t&&i?.href,"dgs-ui-kit-justify-start":t&&!i?.href,"dgs-ui-kit-justify-end":!t&&i?.href,"dgs-ui-kit-text-gray-400":n}),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})]})},E=r=>{const{labelContent:i,link:t,containerClassName:s,rightIcon:n,isError:a,errorMessage:g,hintMessage:h,required:F,maxLength:x,disabled:o,value:d,wrapperClassName:f,showMaxLength:m,onChange:p,children:M}=r,[v,c]=k.useState(d?.toString()??"");k.useEffect(()=>{typeof d<"u"&&d!==null&&c(d?.toString())},[d]);const q=l=>{c(l.currentTarget.value),p&&p(l)},j=!!(g||h||x&&m),b=!!(i||t?.href),y=j||b?"div":k.Fragment,I=l=>{const w=l.currentTarget.querySelector("textarea, input");w&&w.focus()};return e.jsxs(y,{...y==="div"&&f?{className:f}:{},children:[b&&e.jsx(C,{disabled:o,labelContent:i,link:t,required:F}),e.jsxs("div",{onClick:I,className:u.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 hover:dgs-ui-kit-ring-gray-50 has-[:focus]:dgs-ui-kit-bg-white ",a||g?"dgs-ui-kit-border-error-500 has-[:focus]:dgs-ui-kit-ring-error-50":"dgs-ui-kit-border-transparent hover:dgs-ui-kit-border-gray-300 has-[:focus]:dgs-ui-kit-border-primary-500 has-[:focus]:dgs-ui-kit-ring-primary-50",s,{"dgs-ui-kit-text-gray-400":o}),children:[n&&e.jsx("div",{className:"dgs-ui-kit-text-gray-600",children:n}),M({handleChangeField:q,setValue:c,value:v})]}),j&&e.jsx(N,{disabled:o,errorMessage:g,hintMessage:h,maxLength:m?x:void 0,value:v})]})};exports.FieldBottomInfo=N;exports.FieldLabel=C;exports.TextFieldWrapper=E;