@unizap/uniui 1.0.46 → 1.0.47

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.
@@ -3,6 +3,7 @@ export interface ITextInputProps extends Omit<React.InputHTMLAttributes<HTMLInpu
3
3
  value?: string;
4
4
  onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
5
5
  type?: string;
6
+ inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode'];
6
7
  labelClass?: string;
7
8
  className?: string;
8
9
  inputClass?: string;
package/dist/uniui.js CHANGED
@@ -3868,40 +3868,42 @@ const xr = {
3868
3868
  value: n,
3869
3869
  onChange: t,
3870
3870
  type: o = "text",
3871
- className: r = "",
3872
- inputClass: i = "",
3873
- iconStyle: l = "",
3874
- startIcon: s,
3875
- endIcon: c,
3876
- error: d,
3877
- maxLength: u,
3878
- label: m,
3879
- labelClass: p = "",
3880
- variant: g = "outlined",
3881
- size: v = "medium",
3882
- ...f
3883
- }, h) => {
3884
- const C = d ? "border-color-red-500 focus-within:ring-color-red-500" : "border-color-gray-200", P = d ? "text-color-red-500" : l;
3871
+ inputMode: r = "text",
3872
+ className: i = "",
3873
+ inputClass: l = "",
3874
+ iconStyle: s = "",
3875
+ startIcon: c,
3876
+ endIcon: d,
3877
+ error: u,
3878
+ maxLength: m,
3879
+ label: p,
3880
+ labelClass: g = "",
3881
+ variant: v = "outlined",
3882
+ size: f = "medium",
3883
+ ...h
3884
+ }, C) => {
3885
+ const P = u ? "border-color-red-500 focus-within:ring-color-red-500" : "border-color-gray-200", j = u ? "text-color-red-500" : s;
3885
3886
  return /* @__PURE__ */ a.jsxs("div", { className: "w-full", children: [
3886
- m && /* @__PURE__ */ a.jsx("label", { className: `text-sm font-medium text-color-gray-700 mb-1 block ${p}`, children: m }),
3887
- /* @__PURE__ */ a.jsxs("div", { className: `flex items-center w-full rounded-md border focus-within:ring-1 ${C} ${vr[g]} ${r}`, children: [
3888
- s && /* @__PURE__ */ a.jsx("span", { className: `pl-3 ${P}`, children: s }),
3887
+ p && /* @__PURE__ */ a.jsx("label", { className: `text-sm font-medium text-color-gray-700 mb-1 block ${g}`, children: p }),
3888
+ /* @__PURE__ */ a.jsxs("div", { className: `flex items-center w-full rounded-md border focus-within:ring-1 ${P} ${vr[v]} ${i}`, children: [
3889
+ c && /* @__PURE__ */ a.jsx("span", { className: `pl-3 ${j}`, children: c }),
3889
3890
  /* @__PURE__ */ a.jsx(
3890
3891
  "input",
3891
3892
  {
3892
- ...f,
3893
- ref: h,
3893
+ ...h,
3894
+ ref: C,
3894
3895
  type: o,
3896
+ inputMode: r,
3895
3897
  placeholder: e,
3896
3898
  defaultValue: n,
3897
- maxLength: u,
3899
+ maxLength: m,
3898
3900
  onChange: t,
3899
- className: `grow outline-0 w-full font-medium placeholder:font-normal bg-color-transparent ${xr[v]} ${i}`
3901
+ className: `grow outline-0 w-full font-medium placeholder:font-normal bg-color-transparent ${xr[f]} ${l}`
3900
3902
  }
3901
3903
  ),
3902
- c && /* @__PURE__ */ a.jsx("span", { className: `pr-3 ${P}`, children: c })
3904
+ d && /* @__PURE__ */ a.jsx("span", { className: `pr-3 ${j}`, children: d })
3903
3905
  ] }),
3904
- d && /* @__PURE__ */ a.jsx("p", { className: "text-color-red-500 text-xs mt-1", children: d })
3906
+ u && /* @__PURE__ */ a.jsx("p", { className: "text-color-red-500 text-xs mt-1", children: u })
3905
3907
  ] });
3906
3908
  }
3907
3909
  );
@@ -94,7 +94,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
94
94
  ${hr[c]}
95
95
  ${xr[d]}
96
96
  ${n}
97
- `,value:t[b]||"",onChange:S=>f(S,b),onKeyDown:S=>x(S,b),...u},b))})});Rn.displayName="OtpInput";const br={small:"p-2 text-sm",medium:"p-3 text-base",large:"p-4 text-lg"},wr={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border-color-gray-200 bg-color-transparent"},vt=h.forwardRef(({placeholder:e,value:n,onChange:t,type:o="text",className:r="",inputClass:i="",iconStyle:l="",startIcon:s,endIcon:c,error:d,maxLength:u,label:m,labelClass:p="",variant:f="outlined",size:x="medium",...g},b)=>{const S=d?"border-color-red-500 focus-within:ring-color-red-500":"border-color-gray-200",F=d?"text-color-red-500":l;return a.jsxs("div",{className:"w-full",children:[m&&a.jsx("label",{className:`text-sm font-medium text-color-gray-700 mb-1 block ${p}`,children:m}),a.jsxs("div",{className:`flex items-center w-full rounded-md border focus-within:ring-1 ${S} ${wr[f]} ${r}`,children:[s&&a.jsx("span",{className:`pl-3 ${F}`,children:s}),a.jsx("input",{...g,ref:b,type:o,placeholder:e,defaultValue:n,maxLength:u,onChange:t,className:`grow outline-0 w-full font-medium placeholder:font-normal bg-color-transparent ${br[x]} ${i}`}),c&&a.jsx("span",{className:`pr-3 ${F}`,children:c})]}),d&&a.jsx("p",{className:"text-color-red-500 text-xs mt-1",children:d})]})});vt.displayName="TextInput";const En=h.forwardRef((e,n)=>{const[t,o]=h.useState(!1);return a.jsx(vt,{...e,ref:n,label:e.label,type:t?"text":"password",inputClass:e.inputClass,startIcon:e.startIcon??a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M19 10H20C20.5523 10 21 10.4477 21 11V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V11C3 10.4477 3.44772 10 4 10H5V9C5 5.13401 8.13401 2 12 2C15.866 2 19 5.13401 19 9V10ZM5 12V20H19V12H5ZM11 14H13V18H11V14ZM17 10V9C17 6.23858 14.7614 4 12 4C9.23858 4 7 6.23858 7 9V10H17Z"})}),endIcon:a.jsx("span",{onClick:()=>o(!t),className:"cursor-pointer",children:t?a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3ZM12.0003 19C16.2359 19 19.8603 16.052 20.7777 12C19.8603 7.94803 16.2359 5 12.0003 5C7.7646 5 4.14022 7.94803 3.22278 12C4.14022 16.052 7.7646 19 12.0003 19ZM12.0003 16.5C9.51498 16.5 7.50026 14.4853 7.50026 12C7.50026 9.51472 9.51498 7.5 12.0003 7.5C14.4855 7.5 16.5003 9.51472 16.5003 12C16.5003 14.4853 14.4855 16.5 12.0003 16.5ZM12.0003 14.5C13.381 14.5 14.5003 13.3807 14.5003 12C14.5003 10.6193 13.381 9.5 12.0003 9.5C10.6196 9.5 9.50026 10.6193 9.50026 12C9.50026 13.3807 10.6196 14.5 12.0003 14.5Z"})}):a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968ZM5.9356 7.3497C4.60673 8.56015 3.6378 10.1672 3.22278 12.0002C4.14022 16.0521 7.7646 19.0002 12.0003 19.0002C13.5997 19.0002 15.112 18.5798 16.4243 17.8384L14.396 15.8101C13.7023 16.2472 12.8808 16.5002 12.0003 16.5002C9.51498 16.5002 7.50026 14.4854 7.50026 12.0002C7.50026 11.1196 7.75317 10.2981 8.19031 9.60442L5.9356 7.3497ZM12.9139 14.328L9.67246 11.0866C9.5613 11.3696 9.50026 11.6777 9.50026 12.0002C9.50026 13.3809 10.6196 14.5002 12.0003 14.5002C12.3227 14.5002 12.6309 14.4391 12.9139 14.328ZM20.8068 16.5925L19.376 15.1617C20.0319 14.2268 20.5154 13.1586 20.7777 12.0002C19.8603 7.94818 16.2359 5.00016 12.0003 5.00016C11.1544 5.00016 10.3329 5.11773 9.55249 5.33818L7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925ZM11.7229 7.50857C11.8146 7.50299 11.9071 7.50016 12.0003 7.50016C14.4855 7.50016 16.5003 9.51488 16.5003 12.0002C16.5003 12.0933 16.4974 12.1858 16.4919 12.2775L11.7229 7.50857Z"})})})})});En.displayName="PasswordInput";const xt=({src:e,alt:n,size:t="medium",fallback:o,className:r="",color:i="pearl",shape:l="circle"})=>{var d;const s={small:"w-8 h-8 text-sm",medium:"w-10 h-10 text-base",large:"w-14 h-14 text-lg","extra-large":"w-20 h-20 text-xl"},c={circle:"rounded-full",rounded:"rounded-md",square:"rounded-none"};return a.jsx("div",{className:`inline-flex items-center justify-center font-medium overflow-hidden ${s[t]} ${c[l]} ${fe[i].filled} ${r}`,children:e?a.jsx("img",{src:e,alt:n,className:`object-cover w-full h-full ${c[l]}`}):o||((d=n==null?void 0:n[0])==null?void 0:d.toUpperCase())||"?"})},we=({variant:e="filled",color:n="blue",icon:t,onClick:o,className:r="",disabled:i=!1,roundedFull:l=!1,size:s="medium",autoFocus:c=!1,...d})=>{var f;const u=h.useRef(null),m=x=>{const g=u.current;if(!g)return;const b=document.createElement("span"),S=g.getBoundingClientRect(),F=Math.max(S.width,S.height);b.style.width=b.style.height=`${F}px`,b.style.left=`${x.clientX-S.left-F/2}px`,b.style.top=`${x.clientY-S.top-F/2}px`,b.className="ripple_small",g.appendChild(b),setTimeout(()=>b.remove(),600),o==null||o(x)},p=((f=fe[n])==null?void 0:f[e==="filled"?"filled":e==="outlined"?"outline":"transparent"])||"";return a.jsx("button",{ref:u,type:"button",disabled:i,onClick:m,className:`relative overflow-hidden flex items-center justify-center gap-1 transition-all focus:outline-0
97
+ `,value:t[b]||"",onChange:S=>f(S,b),onKeyDown:S=>x(S,b),...u},b))})});Rn.displayName="OtpInput";const br={small:"p-2 text-sm",medium:"p-3 text-base",large:"p-4 text-lg"},wr={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border-color-gray-200 bg-color-transparent"},vt=h.forwardRef(({placeholder:e,value:n,onChange:t,type:o="text",inputMode:r="text",className:i="",inputClass:l="",iconStyle:s="",startIcon:c,endIcon:d,error:u,maxLength:m,label:p,labelClass:f="",variant:x="outlined",size:g="medium",...b},S)=>{const F=u?"border-color-red-500 focus-within:ring-color-red-500":"border-color-gray-200",j=u?"text-color-red-500":s;return a.jsxs("div",{className:"w-full",children:[p&&a.jsx("label",{className:`text-sm font-medium text-color-gray-700 mb-1 block ${f}`,children:p}),a.jsxs("div",{className:`flex items-center w-full rounded-md border focus-within:ring-1 ${F} ${wr[x]} ${i}`,children:[c&&a.jsx("span",{className:`pl-3 ${j}`,children:c}),a.jsx("input",{...b,ref:S,type:o,inputMode:r,placeholder:e,defaultValue:n,maxLength:m,onChange:t,className:`grow outline-0 w-full font-medium placeholder:font-normal bg-color-transparent ${br[g]} ${l}`}),d&&a.jsx("span",{className:`pr-3 ${j}`,children:d})]}),u&&a.jsx("p",{className:"text-color-red-500 text-xs mt-1",children:u})]})});vt.displayName="TextInput";const En=h.forwardRef((e,n)=>{const[t,o]=h.useState(!1);return a.jsx(vt,{...e,ref:n,label:e.label,type:t?"text":"password",inputClass:e.inputClass,startIcon:e.startIcon??a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M19 10H20C20.5523 10 21 10.4477 21 11V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V11C3 10.4477 3.44772 10 4 10H5V9C5 5.13401 8.13401 2 12 2C15.866 2 19 5.13401 19 9V10ZM5 12V20H19V12H5ZM11 14H13V18H11V14ZM17 10V9C17 6.23858 14.7614 4 12 4C9.23858 4 7 6.23858 7 9V10H17Z"})}),endIcon:a.jsx("span",{onClick:()=>o(!t),className:"cursor-pointer",children:t?a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3ZM12.0003 19C16.2359 19 19.8603 16.052 20.7777 12C19.8603 7.94803 16.2359 5 12.0003 5C7.7646 5 4.14022 7.94803 3.22278 12C4.14022 16.052 7.7646 19 12.0003 19ZM12.0003 16.5C9.51498 16.5 7.50026 14.4853 7.50026 12C7.50026 9.51472 9.51498 7.5 12.0003 7.5C14.4855 7.5 16.5003 9.51472 16.5003 12C16.5003 14.4853 14.4855 16.5 12.0003 16.5ZM12.0003 14.5C13.381 14.5 14.5003 13.3807 14.5003 12C14.5003 10.6193 13.381 9.5 12.0003 9.5C10.6196 9.5 9.50026 10.6193 9.50026 12C9.50026 13.3807 10.6196 14.5 12.0003 14.5Z"})}):a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968ZM5.9356 7.3497C4.60673 8.56015 3.6378 10.1672 3.22278 12.0002C4.14022 16.0521 7.7646 19.0002 12.0003 19.0002C13.5997 19.0002 15.112 18.5798 16.4243 17.8384L14.396 15.8101C13.7023 16.2472 12.8808 16.5002 12.0003 16.5002C9.51498 16.5002 7.50026 14.4854 7.50026 12.0002C7.50026 11.1196 7.75317 10.2981 8.19031 9.60442L5.9356 7.3497ZM12.9139 14.328L9.67246 11.0866C9.5613 11.3696 9.50026 11.6777 9.50026 12.0002C9.50026 13.3809 10.6196 14.5002 12.0003 14.5002C12.3227 14.5002 12.6309 14.4391 12.9139 14.328ZM20.8068 16.5925L19.376 15.1617C20.0319 14.2268 20.5154 13.1586 20.7777 12.0002C19.8603 7.94818 16.2359 5.00016 12.0003 5.00016C11.1544 5.00016 10.3329 5.11773 9.55249 5.33818L7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925ZM11.7229 7.50857C11.8146 7.50299 11.9071 7.50016 12.0003 7.50016C14.4855 7.50016 16.5003 9.51488 16.5003 12.0002C16.5003 12.0933 16.4974 12.1858 16.4919 12.2775L11.7229 7.50857Z"})})})})});En.displayName="PasswordInput";const xt=({src:e,alt:n,size:t="medium",fallback:o,className:r="",color:i="pearl",shape:l="circle"})=>{var d;const s={small:"w-8 h-8 text-sm",medium:"w-10 h-10 text-base",large:"w-14 h-14 text-lg","extra-large":"w-20 h-20 text-xl"},c={circle:"rounded-full",rounded:"rounded-md",square:"rounded-none"};return a.jsx("div",{className:`inline-flex items-center justify-center font-medium overflow-hidden ${s[t]} ${c[l]} ${fe[i].filled} ${r}`,children:e?a.jsx("img",{src:e,alt:n,className:`object-cover w-full h-full ${c[l]}`}):o||((d=n==null?void 0:n[0])==null?void 0:d.toUpperCase())||"?"})},we=({variant:e="filled",color:n="blue",icon:t,onClick:o,className:r="",disabled:i=!1,roundedFull:l=!1,size:s="medium",autoFocus:c=!1,...d})=>{var f;const u=h.useRef(null),m=x=>{const g=u.current;if(!g)return;const b=document.createElement("span"),S=g.getBoundingClientRect(),F=Math.max(S.width,S.height);b.style.width=b.style.height=`${F}px`,b.style.left=`${x.clientX-S.left-F/2}px`,b.style.top=`${x.clientY-S.top-F/2}px`,b.className="ripple_small",g.appendChild(b),setTimeout(()=>b.remove(),600),o==null||o(x)},p=((f=fe[n])==null?void 0:f[e==="filled"?"filled":e==="outlined"?"outline":"transparent"])||"";return a.jsx("button",{ref:u,type:"button",disabled:i,onClick:m,className:`relative overflow-hidden flex items-center justify-center gap-1 transition-all focus:outline-0
98
98
  ${p}
99
99
  ${e==="outlined"&&"border"}
100
100
  ${r}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unizap/uniui",
3
- "version": "1.0.46",
3
+ "version": "1.0.47",
4
4
  "description": "UniUi helps developers and designers build beautiful, responsive UIs faster with ready-made, customizable components. Simplify your workflow and create stunning user interfaces effortlessly.",
5
5
  "type": "module",
6
6
  "files": [