@dgshahr/ui-kit 1.3.0 → 1.3.1

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
- {"version":3,"file":"Options.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Select/Options.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAgD,MAAM,SAAS,CAAC;AAOzF,QAAA,MAAM,OAAO,GAAI,CAAC,EAAG,OAAO,WAAW,CAAC,CAAC,CAAC,4CAiMzC,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Options.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Select/Options.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAgD,MAAM,SAAS,CAAC;AAOzF,QAAA,MAAM,OAAO,GAAI,CAAC,EAAG,OAAO,WAAW,CAAC,CAAC,CAAC,4CAmMzC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1 +1 @@
1
- "use strict";require('../../assets/styles.css');const i=require("react/jsx-runtime"),d=require("../../clsx-C11secjj.cjs"),E=require("../../index-BCqGGELs.cjs"),a=require("react"),_=require("../../IconSearch-BeVs-gUu.cjs"),H=require("../Checkbox/index.cjs"),V=require("../../Button/index.cjs"),M=require("../../PickerWrapper-DW8CAD-G.cjs"),$=require("../../Chip/index.cjs");;/* empty css */function z({label:r,isMultiple:s,isActive:n,disabled:u}){return s?i.jsx(H,{checked:n,label:r,readOnly:!0,disabled:u}):r}const D=r=>{const{option:s,onClick:n,value:u,mode:c,optionCellClassName:g,optionCell:t}=r;function l(){return Array.isArray(u)?u.includes(s.value):s.value===u}return i.jsx("button",{type:"button",onClick:n,className:d.clsx("dgsuikit:w-full dgsuikit:text-start dgsuikit:px-3 dgsuikit:disabled:cursor-not-allowed dgsuikit:py-3 dgsuikit:font-p1-regular dgsuikit:disabled:bg-gray-50 dgsuikit:transition",l()?"dgsuikit:bg-primary-50 dgsuikit:text-primary-500":"dgsuikit:text-gray-700 dgsuikit:disabled:text-gray-400",g),disabled:s.disabled,children:t?t(s,l()):z({label:s.label,isMultiple:c==="multiple",isActive:l(),disabled:s.disabled??!1})})},A=a.memo(D),U=20,G=r=>{const{options:s,mode:n="single",afterOptions:u,beforeOptions:c,onChange:g,searchable:t=!0,separateSelectedOptions:l=!0,optionsTitle:f="عنوان‌ها",value:p,optionCellClassName:y,emptyContent:F="نتیجه‌ای یافت نشد !",showClearButtonOnEmpty:R=!0}=r,[m,I]=a.useState(""),[x,B]=a.useState(0),k=a.useRef(null),v=a.useRef(null),{toggleWrapperVisibility:L}=M.usePickerWrapperContext(),O=d.clsx("dgsuikit:border-t dgsuikit:border-solid dgsuikit:border-gray-100",(!t&&!c||n==="multiple"&&l)&&"dgsuikit:first-of-type:border-t-0",!!u&&"dgsuikit:last-of-type:border-b");let h;const b=t;typeof t=="boolean"?h=t:h=Object.keys(t).length>0;const N=a.useMemo(()=>{if(!Array.isArray(s))throw new Error("options should be array");return m?s?.filter(e=>e.label.includes(m)):s},[m,s]),j=a.useMemo(()=>n==="multiple"&&l?s?.filter(e=>p.includes(e.value))??[]:[],[s,p]),S=a.useMemo(()=>{let e=N;n==="multiple"&&l&&(e=e?.filter(P=>!p.includes(P.value)));const o=Math.min(x+U,e?.length??0);return e?.slice(x,o)},[N,x,p]),C=k?.current?.children[0]?.clientHeight??50,W=(N?.length??0)*C,w=a.useCallback(()=>{const e=k?.current?.parentElement;if(!e)return;const o=e.scrollTop,P=k.current.offsetTop,T=Math.floor((o-P)/C);B(T>=0?T:0)},[C]);a.useEffect(()=>{const e=k.current?.parentElement;if(e)return e.addEventListener("scroll",w),()=>e.removeEventListener("scroll",w)},[w]),a.useEffect(()=>{!h||b.autoFocus===!1||!v.current||setTimeout(()=>{v.current?.focus()},300)},[]);const q=a.useCallback(e=>{if(typeof g=="function")if(n==="multiple"){const o=[...p??[]];o.includes(e)?o.splice(o.indexOf(e),1):o.push(e),g(o)}else g(e),L()},[p]);return i.jsxs(i.Fragment,{children:[h&&i.jsx(E.Input,{ref:v,id:"search-input",wrapperClassName:d.clsx("dgsuikit:sticky dgsuikit:top-0 dgsuikit:pt-3 dgsuikit:right-0 dgsuikit:bg-white dgsuikit:z-10 dgsuikit:px-3",c?"dgsuikit:pb-2":"dgsuikit:pb-3",b?.wrapperClassName),placeholder:b?.placeholder??"جستجوی عنوان",value:m,onChange:e=>I(e.currentTarget.value),rightIcon:b?.rightIcon??i.jsx(_.IconSearch,{width:20,height:20}),...typeof t=="object"?t:{}}),c,n==="multiple"&&l&&j.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"dgsuikit:font-p2-regular dgsuikit:text-gray-400 dgsuikit:px-3 dgsuikit:py-2",children:`${f}‌ی انتخاب شده`}),j.map(e=>i.jsx(A,{onClick:()=>q(e.value),option:e,optionCellClassName:d.clsx(O,y),...r},e.value))]}),i.jsxs(i.Fragment,{children:[n==="multiple"&&l&&i.jsx("p",{className:"dgsuikit:font-p2-regular dgsuikit:text-gray-400 dgsuikit:px-3 dgsuikit:py-2",children:f}),i.jsx("div",{ref:k,className:"dgsuikit:relative",style:{height:W},children:S?.map((e,o)=>i.jsx("div",{className:d.clsx("dgsuikit:absolute dgsuikit:w-full",O),style:{top:`${(x+o)*C}px`},children:i.jsx(A,{onClick:()=>q(e.value),option:e,...r})},e.value))}),!S?.length&&!j.length&&i.jsxs("div",{className:"dgsuikit:text-center dgsuikit:flex dgsuikit:flex-col dgsuikit:items-center dgsuikit:mt-2",children:[i.jsx("p",{className:"dgsuikit:text-gray-500 dgsuikit:font-p3-medium",children:F}),R&&i.jsx(V,{type:"button",className:"dgsuikit:mt-1",variant:"text",size:"small",onClick:()=>I(""),children:"پاک کردن"})]})]}),u]})};function J(r,s){if(!Array.isArray(r))return s.find(n=>n.value===r)?.label??""}const K=r=>{const{searchable:s=!0,value:n,options:u}=r,c=Array.isArray(n)&&n.length>0;function g(){return r.inputProps?.prefix?r.inputProps.prefix:c?n.map(l=>i.jsx($,{label:u.find(f=>f.value===l)?.label,clickable:!0,leftIcon:i.jsx(E.IconCloseSquare,{}),onClick:f=>{f.stopPropagation();const p=n.filter(y=>y!==l);r.onChange?.(p)}},l)):null}const t={...r};return t.dropdownType==="popover"&&!s&&(t.popoverClassName=d.clsx("dgsuikit:pt-3",t.popoverClassName)),t.dropdownType==="drawer"&&(t.drawerProps={...t.drawerProps,containerClassName:d.clsx(s?"dgsuikit:!pt-0":"dgsuikit:!pt-3",t.drawerProps?.containerClassName)}),t.customInput||(t.inputProps={...t.inputProps,value:J(n,u),prefix:g(),prefixClassName:c?d.clsx("dgsuikit:flex dgsuikit:items-center flex dgsuikit:flex-wrap dgsuikit:gap-2 dgsuikit:w-full",t.inputProps?.prefixClassName):t.inputProps?.prefixClassName,className:c?"dgsuikit:hidden":t.inputProps?.className,containerClassName:c?d.clsx("dgsuikit:items-baseline",t.inputProps?.containerClassName):t.inputProps?.containerClassName}),i.jsx(M.PickerWrapper,{...t,children:i.jsx(G,{...r})})};module.exports=K;
1
+ "use strict";require('../../assets/styles.css');const i=require("react/jsx-runtime"),d=require("../../clsx-C11secjj.cjs"),E=require("../../index-BCqGGELs.cjs"),a=require("react"),_=require("../../IconSearch-BeVs-gUu.cjs"),H=require("../Checkbox/index.cjs"),V=require("../../Button/index.cjs"),M=require("../../PickerWrapper-DW8CAD-G.cjs"),$=require("../../Chip/index.cjs");;/* empty css */function z({label:n,isMultiple:s,isActive:r,disabled:u}){return s?i.jsx(H,{checked:r,label:n,readOnly:!0,disabled:u}):n}const D=n=>{const{option:s,onClick:r,value:u,mode:c,optionCellClassName:g,optionCell:t}=n;function l(){return Array.isArray(u)?u.includes(s.value):s.value===u}return i.jsx("button",{type:"button",onClick:r,className:d.clsx("dgsuikit:w-full dgsuikit:text-start dgsuikit:px-3 dgsuikit:disabled:cursor-not-allowed dgsuikit:py-3 dgsuikit:font-p1-regular dgsuikit:disabled:bg-gray-50 dgsuikit:transition",l()?"dgsuikit:bg-primary-50 dgsuikit:text-primary-500":"dgsuikit:text-gray-700 dgsuikit:disabled:text-gray-400",g),disabled:s.disabled,children:t?t(s,l()):z({label:s.label,isMultiple:c==="multiple",isActive:l(),disabled:s.disabled??!1})})},A=a.memo(D),U=20,G=n=>{const{options:s,mode:r="single",afterOptions:u,beforeOptions:c,onChange:g,searchable:t=!0,separateSelectedOptions:l=!0,optionsTitle:f="عنوان‌ها",value:p,optionCellClassName:v,emptyContent:F="نتیجه‌ای یافت نشد !",showClearButtonOnEmpty:R=!0}=n,[k,I]=a.useState(""),[x,B]=a.useState(0),m=a.useRef(null),N=a.useRef(null),{toggleWrapperVisibility:L}=M.usePickerWrapperContext(),O=d.clsx("dgsuikit:border-t dgsuikit:border-solid dgsuikit:border-gray-100",(!t&&!c||r==="multiple"&&l)&&"dgsuikit:first-of-type:border-t-0",!!u&&"dgsuikit:last-of-type:border-b");let h;const b=t;typeof t=="boolean"?h=t:h=Object.keys(t).length>0;const j=a.useMemo(()=>{if(!Array.isArray(s))throw new Error("options should be array");return k?s?.filter(e=>e.label.includes(k)):s},[k,s]),C=a.useMemo(()=>r==="multiple"&&l?s?.filter(e=>p.includes(e.value))??[]:[],[s,p]),S=a.useMemo(()=>{let e=j;r==="multiple"&&l&&(e=e?.filter(P=>!p.includes(P.value)));const o=Math.min(x+U,e?.length??0);return e?.slice(x,o)},[j,x,p]),y=m?.current?.children[0]?.clientHeight??50,W=((j?.length??0)-(r==="multiple"?C.length??0:0))*y,w=a.useCallback(()=>{const e=m?.current?.parentElement;if(!e)return;const o=e.scrollTop,P=m.current.offsetTop,T=Math.floor((o-P)/y);B(T>=0?T:0)},[y]);a.useEffect(()=>{const e=m.current?.parentElement;if(e)return e.addEventListener("scroll",w),()=>e.removeEventListener("scroll",w)},[w]),a.useEffect(()=>{!h||b.autoFocus===!1||!N.current||setTimeout(()=>{N.current?.focus()},300)},[]);const q=a.useCallback(e=>{if(typeof g=="function")if(r==="multiple"){const o=[...p??[]];o.includes(e)?o.splice(o.indexOf(e),1):o.push(e),g(o)}else g(e),L()},[p]);return i.jsxs(i.Fragment,{children:[h&&i.jsx(E.Input,{ref:N,id:"search-input",wrapperClassName:d.clsx("dgsuikit:sticky dgsuikit:top-0 dgsuikit:pt-3 dgsuikit:right-0 dgsuikit:bg-white dgsuikit:z-10 dgsuikit:px-3",c?"dgsuikit:pb-2":"dgsuikit:pb-3",b?.wrapperClassName),placeholder:b?.placeholder??"جستجوی عنوان",value:k,onChange:e=>I(e.currentTarget.value),rightIcon:b?.rightIcon??i.jsx(_.IconSearch,{width:20,height:20}),...typeof t=="object"?t:{}}),c,r==="multiple"&&l&&C.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"dgsuikit:font-p2-regular dgsuikit:text-gray-400 dgsuikit:px-3 dgsuikit:py-2",children:`${f}‌ی انتخاب شده`}),C.map(e=>i.jsx(A,{onClick:()=>q(e.value),option:e,optionCellClassName:d.clsx(O,v),...n},e.value))]}),i.jsxs(i.Fragment,{children:[r==="multiple"&&l&&i.jsx("p",{className:"dgsuikit:font-p2-regular dgsuikit:text-gray-400 dgsuikit:px-3 dgsuikit:py-2",children:f}),i.jsx("div",{ref:m,className:"dgsuikit:relative",style:{height:W},children:S?.map((e,o)=>i.jsx("div",{className:d.clsx("dgsuikit:absolute dgsuikit:w-full",O),style:{top:`${(x+o)*y}px`},children:i.jsx(A,{onClick:()=>q(e.value),option:e,...n})},e.value))}),!S?.length&&!C.length&&i.jsxs("div",{className:"dgsuikit:text-center dgsuikit:flex dgsuikit:flex-col dgsuikit:items-center dgsuikit:mt-2",children:[i.jsx("p",{className:"dgsuikit:text-gray-500 dgsuikit:font-p3-medium",children:F}),R&&i.jsx(V,{type:"button",className:"dgsuikit:mt-1",variant:"text",size:"small",onClick:()=>I(""),children:"پاک کردن"})]})]}),u]})};function J(n,s){if(!Array.isArray(n))return s.find(r=>r.value===n)?.label??""}const K=n=>{const{searchable:s=!0,value:r,options:u}=n,c=Array.isArray(r)&&r.length>0;function g(){return n.inputProps?.prefix?n.inputProps.prefix:c?r.map(l=>i.jsx($,{label:u.find(f=>f.value===l)?.label,clickable:!0,leftIcon:i.jsx(E.IconCloseSquare,{}),onClick:f=>{f.stopPropagation();const p=r.filter(v=>v!==l);n.onChange?.(p)}},l)):null}const t={...n};return t.dropdownType==="popover"&&!s&&(t.popoverClassName=d.clsx("dgsuikit:pt-3",t.popoverClassName)),t.dropdownType==="drawer"&&(t.drawerProps={...t.drawerProps,containerClassName:d.clsx(s?"dgsuikit:!pt-0":"dgsuikit:!pt-3",t.drawerProps?.containerClassName)}),t.customInput||(t.inputProps={...t.inputProps,value:J(r,u),prefix:g(),prefixClassName:c?d.clsx("dgsuikit:flex dgsuikit:items-center flex dgsuikit:flex-wrap dgsuikit:gap-2 dgsuikit:w-full",t.inputProps?.prefixClassName):t.inputProps?.prefixClassName,className:c?"dgsuikit:hidden":t.inputProps?.className,containerClassName:c?d.clsx("dgsuikit:items-baseline",t.inputProps?.containerClassName):t.inputProps?.containerClassName}),i.jsx(M.PickerWrapper,{...t,children:i.jsx(G,{...n})})};module.exports=K;
@@ -1,4 +1,4 @@
1
- import { jsx as n, jsxs as C, Fragment as O } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as x, Fragment as O } from "react/jsx-runtime";
2
2
  import { c } from "../../clsx-OuTLNxxd.js";
3
3
  import { I as q, a as D } from "../../index-Cj_9z9UD.js";
4
4
  import { memo as U, useState as B, useRef as L, useMemo as S, useCallback as H, useEffect as R } from "react";
@@ -9,23 +9,23 @@ import { u as Q, P as X } from "../../PickerWrapper-D84kUgJt.js";
9
9
  import Y from "../../Chip/index.mjs";
10
10
  import '../../assets/styles.css';/* empty css */
11
11
  function Z({
12
- label: s,
12
+ label: r,
13
13
  isMultiple: i,
14
- isActive: r,
14
+ isActive: s,
15
15
  disabled: a
16
16
  }) {
17
17
  return i ? /* @__PURE__ */ n(
18
18
  J,
19
19
  {
20
- checked: r,
21
- label: s,
20
+ checked: s,
21
+ label: r,
22
22
  readOnly: !0,
23
23
  disabled: a
24
24
  }
25
- ) : s;
25
+ ) : r;
26
26
  }
27
- const ee = (s) => {
28
- const { option: i, onClick: r, value: a, mode: u, optionCellClassName: p, optionCell: t } = s;
27
+ const ee = (r) => {
28
+ const { option: i, onClick: s, value: a, mode: u, optionCellClassName: p, optionCell: t } = r;
29
29
  function l() {
30
30
  return Array.isArray(a) ? a.includes(i.value) : i.value === a;
31
31
  }
@@ -33,7 +33,7 @@ const ee = (s) => {
33
33
  "button",
34
34
  {
35
35
  type: "button",
36
- onClick: r,
36
+ onClick: s,
37
37
  className: c(
38
38
  "dgsuikit:w-full dgsuikit:text-start dgsuikit:px-3 dgsuikit:disabled:cursor-not-allowed dgsuikit:py-3 dgsuikit:font-p1-regular dgsuikit:disabled:bg-gray-50 dgsuikit:transition",
39
39
  l() ? "dgsuikit:bg-primary-50 dgsuikit:text-primary-500" : "dgsuikit:text-gray-700 dgsuikit:disabled:text-gray-400",
@@ -48,10 +48,10 @@ const ee = (s) => {
48
48
  })
49
49
  }
50
50
  );
51
- }, V = U(ee), te = 20, ie = (s) => {
51
+ }, V = U(ee), te = 20, ie = (r) => {
52
52
  const {
53
53
  options: i,
54
- mode: r = "single",
54
+ mode: s = "single",
55
55
  afterOptions: a,
56
56
  beforeOptions: u,
57
57
  onChange: p,
@@ -59,45 +59,45 @@ const ee = (s) => {
59
59
  separateSelectedOptions: l = !0,
60
60
  optionsTitle: g = "عنوان‌ها",
61
61
  value: d,
62
- optionCellClassName: x,
62
+ optionCellClassName: v,
63
63
  emptyContent: W = "نتیجه‌ای یافت نشد !",
64
64
  showClearButtonOnEmpty: $ = !0
65
- } = s, [m, T] = B(""), [k, z] = B(0), f = L(null), v = L(null), { toggleWrapperVisibility: F } = Q(), A = c(
65
+ } = r, [m, T] = B(""), [k, z] = B(0), f = L(null), N = L(null), { toggleWrapperVisibility: F } = Q(), A = c(
66
66
  "dgsuikit:border-t dgsuikit:border-solid dgsuikit:border-gray-100",
67
- (!t && !u || r === "multiple" && l) && "dgsuikit:first-of-type:border-t-0",
67
+ (!t && !u || s === "multiple" && l) && "dgsuikit:first-of-type:border-t-0",
68
68
  !!a && "dgsuikit:last-of-type:border-b"
69
69
  );
70
70
  let h;
71
71
  const b = t;
72
72
  typeof t == "boolean" ? h = t : h = Object.keys(t).length > 0;
73
- const N = S(() => {
73
+ const w = S(() => {
74
74
  if (!Array.isArray(i))
75
75
  throw new Error("options should be array");
76
76
  return m ? i?.filter((e) => e.label.includes(m)) : i;
77
- }, [m, i]), w = S(() => r === "multiple" && l ? i?.filter((e) => d.includes(e.value)) ?? [] : [], [i, d]), E = S(() => {
78
- let e = N;
79
- r === "multiple" && l && (e = e?.filter((I) => !d.includes(I.value)));
77
+ }, [m, i]), y = S(() => s === "multiple" && l ? i?.filter((e) => d.includes(e.value)) ?? [] : [], [i, d]), E = S(() => {
78
+ let e = w;
79
+ s === "multiple" && l && (e = e?.filter((I) => !d.includes(I.value)));
80
80
  const o = Math.min(k + te, e?.length ?? 0);
81
81
  return e?.slice(k, o);
82
- }, [N, k, d]), y = f?.current?.children[0]?.clientHeight ?? 50, _ = (N?.length ?? 0) * y, P = H(() => {
82
+ }, [w, k, d]), C = f?.current?.children[0]?.clientHeight ?? 50, _ = ((w?.length ?? 0) - (s === "multiple" ? y.length ?? 0 : 0)) * C, P = H(() => {
83
83
  const e = f?.current?.parentElement;
84
84
  if (!e) return;
85
- const o = e.scrollTop, I = f.current.offsetTop, j = Math.floor((o - I) / y);
85
+ const o = e.scrollTop, I = f.current.offsetTop, j = Math.floor((o - I) / C);
86
86
  z(j >= 0 ? j : 0);
87
- }, [y]);
87
+ }, [C]);
88
88
  R(() => {
89
89
  const e = f.current?.parentElement;
90
90
  if (e)
91
91
  return e.addEventListener("scroll", P), () => e.removeEventListener("scroll", P);
92
92
  }, [P]), R(() => {
93
- !h || b.autoFocus === !1 || !v.current || setTimeout(() => {
94
- v.current?.focus();
93
+ !h || b.autoFocus === !1 || !N.current || setTimeout(() => {
94
+ N.current?.focus();
95
95
  }, 300);
96
96
  }, []);
97
97
  const M = H(
98
98
  (e) => {
99
99
  if (typeof p == "function")
100
- if (r === "multiple") {
100
+ if (s === "multiple") {
101
101
  const o = [...d ?? []];
102
102
  o.includes(e) ? o.splice(o.indexOf(e), 1) : o.push(e), p(o);
103
103
  } else
@@ -105,11 +105,11 @@ const ee = (s) => {
105
105
  },
106
106
  [d]
107
107
  );
108
- return /* @__PURE__ */ C(O, { children: [
108
+ return /* @__PURE__ */ x(O, { children: [
109
109
  h && /* @__PURE__ */ n(
110
110
  q,
111
111
  {
112
- ref: v,
112
+ ref: N,
113
113
  id: "search-input",
114
114
  wrapperClassName: c(
115
115
  "dgsuikit:sticky dgsuikit:top-0 dgsuikit:pt-3 dgsuikit:right-0 dgsuikit:bg-white dgsuikit:z-10 dgsuikit:px-3",
@@ -130,21 +130,21 @@ const ee = (s) => {
130
130
  }
131
131
  ),
132
132
  u,
133
- r === "multiple" && l && w.length > 0 && /* @__PURE__ */ C(O, { children: [
133
+ s === "multiple" && l && y.length > 0 && /* @__PURE__ */ x(O, { children: [
134
134
  /* @__PURE__ */ n("p", { className: "dgsuikit:font-p2-regular dgsuikit:text-gray-400 dgsuikit:px-3 dgsuikit:py-2", children: `${g}‌ی انتخاب شده` }),
135
- w.map((e) => /* @__PURE__ */ n(
135
+ y.map((e) => /* @__PURE__ */ n(
136
136
  V,
137
137
  {
138
138
  onClick: () => M(e.value),
139
139
  option: e,
140
- optionCellClassName: c(A, x),
141
- ...s
140
+ optionCellClassName: c(A, v),
141
+ ...r
142
142
  },
143
143
  e.value
144
144
  ))
145
145
  ] }),
146
- /* @__PURE__ */ C(O, { children: [
147
- r === "multiple" && l && /* @__PURE__ */ n("p", { className: "dgsuikit:font-p2-regular dgsuikit:text-gray-400 dgsuikit:px-3 dgsuikit:py-2", children: g }),
146
+ /* @__PURE__ */ x(O, { children: [
147
+ s === "multiple" && l && /* @__PURE__ */ n("p", { className: "dgsuikit:font-p2-regular dgsuikit:text-gray-400 dgsuikit:px-3 dgsuikit:py-2", children: g }),
148
148
  /* @__PURE__ */ n(
149
149
  "div",
150
150
  {
@@ -155,13 +155,13 @@ const ee = (s) => {
155
155
  "div",
156
156
  {
157
157
  className: c("dgsuikit:absolute dgsuikit:w-full", A),
158
- style: { top: `${(k + o) * y}px` },
158
+ style: { top: `${(k + o) * C}px` },
159
159
  children: /* @__PURE__ */ n(
160
160
  V,
161
161
  {
162
162
  onClick: () => M(e.value),
163
163
  option: e,
164
- ...s
164
+ ...r
165
165
  }
166
166
  )
167
167
  },
@@ -169,7 +169,7 @@ const ee = (s) => {
169
169
  ))
170
170
  }
171
171
  ),
172
- !E?.length && !w.length && /* @__PURE__ */ C("div", { className: "dgsuikit:text-center dgsuikit:flex dgsuikit:flex-col dgsuikit:items-center dgsuikit:mt-2", children: [
172
+ !E?.length && !y.length && /* @__PURE__ */ x("div", { className: "dgsuikit:text-center dgsuikit:flex dgsuikit:flex-col dgsuikit:items-center dgsuikit:mt-2", children: [
173
173
  /* @__PURE__ */ n("p", { className: "dgsuikit:text-gray-500 dgsuikit:font-p3-medium", children: W }),
174
174
  $ && /* @__PURE__ */ n(
175
175
  K,
@@ -187,14 +187,14 @@ const ee = (s) => {
187
187
  a
188
188
  ] });
189
189
  };
190
- function se(s, i) {
191
- if (!Array.isArray(s))
192
- return i.find((r) => r.value === s)?.label ?? "";
190
+ function se(r, i) {
191
+ if (!Array.isArray(r))
192
+ return i.find((s) => s.value === r)?.label ?? "";
193
193
  }
194
- const fe = (s) => {
195
- const { searchable: i = !0, value: r, options: a } = s, u = Array.isArray(r) && r.length > 0;
194
+ const fe = (r) => {
195
+ const { searchable: i = !0, value: s, options: a } = r, u = Array.isArray(s) && s.length > 0;
196
196
  function p() {
197
- return s.inputProps?.prefix ? s.inputProps.prefix : u ? r.map((l) => /* @__PURE__ */ n(
197
+ return r.inputProps?.prefix ? r.inputProps.prefix : u ? s.map((l) => /* @__PURE__ */ n(
198
198
  Y,
199
199
  {
200
200
  label: a.find((g) => g.value === l)?.label,
@@ -202,14 +202,14 @@ const fe = (s) => {
202
202
  leftIcon: /* @__PURE__ */ n(D, {}),
203
203
  onClick: (g) => {
204
204
  g.stopPropagation();
205
- const d = r.filter((x) => x !== l);
206
- s.onChange?.(d);
205
+ const d = s.filter((v) => v !== l);
206
+ r.onChange?.(d);
207
207
  }
208
208
  },
209
209
  l
210
210
  )) : null;
211
211
  }
212
- const t = { ...s };
212
+ const t = { ...r };
213
213
  return t.dropdownType === "popover" && !i && (t.popoverClassName = c("dgsuikit:pt-3", t.popoverClassName)), t.dropdownType === "drawer" && (t.drawerProps = {
214
214
  ...t.drawerProps,
215
215
  containerClassName: c(
@@ -218,7 +218,7 @@ const fe = (s) => {
218
218
  )
219
219
  }), t.customInput || (t.inputProps = {
220
220
  ...t.inputProps,
221
- value: se(r, a),
221
+ value: se(s, a),
222
222
  prefix: p(),
223
223
  prefixClassName: u ? c(
224
224
  "dgsuikit:flex dgsuikit:items-center flex dgsuikit:flex-wrap dgsuikit:gap-2 dgsuikit:w-full",
@@ -226,7 +226,7 @@ const fe = (s) => {
226
226
  ) : t.inputProps?.prefixClassName,
227
227
  className: u ? "dgsuikit:hidden" : t.inputProps?.className,
228
228
  containerClassName: u ? c("dgsuikit:items-baseline", t.inputProps?.containerClassName) : t.inputProps?.containerClassName
229
- }), /* @__PURE__ */ n(X, { ...t, children: /* @__PURE__ */ n(ie, { ...s }) });
229
+ }), /* @__PURE__ */ n(X, { ...t, children: /* @__PURE__ */ n(ie, { ...r }) });
230
230
  };
231
231
  export {
232
232
  fe as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dgshahr/ui-kit",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "A modern, accessible, and customizable React component library",
5
5
  "author": "dgshahr",
6
6
  "contributes": [