@unizap/uniui 1.0.35 → 1.0.36

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.
package/dist/uniui.js CHANGED
@@ -3883,7 +3883,7 @@ const xr = {
3883
3883
  }, h) => {
3884
3884
  const C = p ? "border-color-red-500 focus-within:ring-color-red-500" : "border-color-gray-200", E = p ? "text-color-red-500" : l;
3885
3885
  return /* @__PURE__ */ a.jsxs("div", { className: "w-full", children: [
3886
- v && /* @__PURE__ */ a.jsx("label", { className: `text-sm text-color-gray-500 mb-2 block ${g}`, children: v }),
3886
+ v && /* @__PURE__ */ a.jsx("label", { className: `text-sm font-medium text-color-gray-700 mb-1 block ${g}`, children: v }),
3887
3887
  /* @__PURE__ */ a.jsxs("div", { className: `flex items-center w-full rounded-md border focus-within:ring-1 ${C} ${vr[d]} ${r}`, children: [
3888
3888
  s && /* @__PURE__ */ a.jsx("span", { className: `pl-3 ${E}`, children: s }),
3889
3889
  /* @__PURE__ */ a.jsx(
@@ -3913,6 +3913,7 @@ const hr = Te((e, n) => {
3913
3913
  {
3914
3914
  ...e,
3915
3915
  ref: n,
3916
+ label: e.label,
3916
3917
  type: t ? "text" : "password",
3917
3918
  inputClass: e.inputClass,
3918
3919
  startIcon: e.startIcon ?? /* @__PURE__ */ a.jsx("svg", { className: "size-5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ 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" }) }),
@@ -6056,7 +6057,7 @@ const li = {
6056
6057
  size: l = "medium",
6057
6058
  ...s
6058
6059
  }) => /* @__PURE__ */ a.jsxs("div", { className: `flex flex-col gap-1 ${t}`, children: [
6059
- e && /* @__PURE__ */ a.jsx("label", { className: `text-sm font-medium ${r}`, children: e }),
6060
+ e && /* @__PURE__ */ a.jsx("label", { className: `text-sm font-medium text-color-gray-700 mb-1 block ${r}`, children: e }),
6060
6061
  /* @__PURE__ */ a.jsx(
6061
6062
  "textarea",
6062
6063
  {
@@ -94,7 +94,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
94
94
  ${xr[c]}
95
95
  ${mr[p]}
96
96
  ${n}
97
- `,value:t[b]||"",onChange:S=>d(S,b),onKeyDown:S=>x(S,b),...u},b))})});$n.displayName="OtpInput";const vr={small:"p-2 text-sm",medium:"p-3 text-base",large:"p-4 text-lg"},hr={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border-color-gray-200 bg-color-transparent"},gt=h.forwardRef(({placeholder:e,value:n,onChange:t,type:o="text",className:r="",inputClass:i="",iconStyle:l="",startIcon:s,endIcon:c,error:p,maxLength:u,label:v,labelClassName:f="",variant:d="outlined",size:x="medium",...m},b)=>{const S=p?"border-color-red-500 focus-within:ring-color-red-500":"border-color-gray-200",M=p?"text-color-red-500":l;return a.jsxs("div",{className:"w-full",children:[v&&a.jsx("label",{className:`text-sm text-color-gray-500 mb-2 block ${f}`,children:v}),a.jsxs("div",{className:`flex items-center w-full rounded-md border focus-within:ring-1 ${S} ${hr[d]} ${r}`,children:[s&&a.jsx("span",{className:`pl-3 ${M}`,children:s}),a.jsx("input",{...m,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 ${vr[x]} ${i}`}),c&&a.jsx("span",{className:`pr-3 ${M}`,children:c})]}),p&&a.jsx("p",{className:"text-color-red-500 text-xs mt-1",children:p})]})});gt.displayName="TextInput";const _n=h.forwardRef((e,n)=>{const[t,o]=h.useState(!1);return a.jsx(gt,{...e,ref:n,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"})})})})});_n.displayName="PasswordInput";const mt=({src:e,alt:n,size:t="medium",fallback:o,className:r="",color:i="pearl",shape:l="circle"})=>{var p;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]} ${de[i].filled} ${r}`,children:e?a.jsx("img",{src:e,alt:n,className:`object-cover w-full h-full ${c[l]}`}):o||((p=n==null?void 0:n[0])==null?void 0:p.toUpperCase())||"?"})},he=({variant:e="filled",color:n="blue",icon:t,onClick:o,className:r="",disabled:i=!1,roundedFull:l=!1,size:s="medium",autoFocus:c=!1,...p})=>{var d;const u=h.useRef(null),v=x=>{const m=u.current;if(!m)return;const b=document.createElement("span"),S=m.getBoundingClientRect(),M=Math.max(S.width,S.height);b.style.width=b.style.height=`${M}px`,b.style.left=`${x.clientX-S.left-M/2}px`,b.style.top=`${x.clientY-S.top-M/2}px`,b.className="ripple_small",m.appendChild(b),setTimeout(()=>b.remove(),600),o==null||o(x)},f=((d=de[n])==null?void 0:d[e==="filled"?"filled":e==="outlined"?"outline":"transparent"])||"";return a.jsx("button",{ref:u,type:"button",disabled:i,onClick:v,className:`relative overflow-hidden flex items-center justify-center gap-1 transition-all focus:outline-0
97
+ `,value:t[b]||"",onChange:S=>d(S,b),onKeyDown:S=>x(S,b),...u},b))})});$n.displayName="OtpInput";const vr={small:"p-2 text-sm",medium:"p-3 text-base",large:"p-4 text-lg"},hr={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border-color-gray-200 bg-color-transparent"},gt=h.forwardRef(({placeholder:e,value:n,onChange:t,type:o="text",className:r="",inputClass:i="",iconStyle:l="",startIcon:s,endIcon:c,error:p,maxLength:u,label:v,labelClassName:f="",variant:d="outlined",size:x="medium",...m},b)=>{const S=p?"border-color-red-500 focus-within:ring-color-red-500":"border-color-gray-200",M=p?"text-color-red-500":l;return a.jsxs("div",{className:"w-full",children:[v&&a.jsx("label",{className:`text-sm font-medium text-color-gray-700 mb-1 block ${f}`,children:v}),a.jsxs("div",{className:`flex items-center w-full rounded-md border focus-within:ring-1 ${S} ${hr[d]} ${r}`,children:[s&&a.jsx("span",{className:`pl-3 ${M}`,children:s}),a.jsx("input",{...m,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 ${vr[x]} ${i}`}),c&&a.jsx("span",{className:`pr-3 ${M}`,children:c})]}),p&&a.jsx("p",{className:"text-color-red-500 text-xs mt-1",children:p})]})});gt.displayName="TextInput";const _n=h.forwardRef((e,n)=>{const[t,o]=h.useState(!1);return a.jsx(gt,{...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"})})})})});_n.displayName="PasswordInput";const mt=({src:e,alt:n,size:t="medium",fallback:o,className:r="",color:i="pearl",shape:l="circle"})=>{var p;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]} ${de[i].filled} ${r}`,children:e?a.jsx("img",{src:e,alt:n,className:`object-cover w-full h-full ${c[l]}`}):o||((p=n==null?void 0:n[0])==null?void 0:p.toUpperCase())||"?"})},he=({variant:e="filled",color:n="blue",icon:t,onClick:o,className:r="",disabled:i=!1,roundedFull:l=!1,size:s="medium",autoFocus:c=!1,...p})=>{var d;const u=h.useRef(null),v=x=>{const m=u.current;if(!m)return;const b=document.createElement("span"),S=m.getBoundingClientRect(),M=Math.max(S.width,S.height);b.style.width=b.style.height=`${M}px`,b.style.left=`${x.clientX-S.left-M/2}px`,b.style.top=`${x.clientY-S.top-M/2}px`,b.className="ripple_small",m.appendChild(b),setTimeout(()=>b.remove(),600),o==null||o(x)},f=((d=de[n])==null?void 0:d[e==="filled"?"filled":e==="outlined"?"outline":"transparent"])||"";return a.jsx("button",{ref:u,type:"button",disabled:i,onClick:v,className:`relative overflow-hidden flex items-center justify-center gap-1 transition-all focus:outline-0
98
98
  ${f}
99
99
  ${e==="outlined"&&"border"}
100
100
  ${r}
@@ -129,7 +129,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
129
129
  50% { transform: translateX(100%); }
130
130
  100% { transform: translateX(100%); }
131
131
  }
132
- `})]})})},ri={small:"p-2 text-sm",medium:"p-3 text-base",large:"p-4 text-lg"},ii={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border border-color-gray-200 bg-color-transparent"},ai=({label:e,error:n,className:t="",inputClass:o="",labelClass:r="",variant:i="outlined",size:l="medium",...s})=>a.jsxs("div",{className:`flex flex-col gap-1 ${t}`,children:[e&&a.jsx("label",{className:`text-sm font-medium ${r}`,children:e}),a.jsx("textarea",{className:`
132
+ `})]})})},ri={small:"p-2 text-sm",medium:"p-3 text-base",large:"p-4 text-lg"},ii={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border border-color-gray-200 bg-color-transparent"},ai=({label:e,error:n,className:t="",inputClass:o="",labelClass:r="",variant:i="outlined",size:l="medium",...s})=>a.jsxs("div",{className:`flex flex-col gap-1 ${t}`,children:[e&&a.jsx("label",{className:`text-sm font-medium text-color-gray-700 mb-1 block ${r}`,children:e}),a.jsx("textarea",{className:`
133
133
  rounded-md resize-none focus:ring-1 focus:outline-none
134
134
  ${ri[l]}
135
135
  ${ii[i]}
@@ -10,9 +10,10 @@ export declare const COLOR_MAP: Record<CompColor, {
10
10
  export declare const extendColorMap: (newColors: Record<string, {
11
11
  filled: string;
12
12
  outline: string;
13
- text: string;
13
+ transparent: string;
14
14
  accent: string;
15
15
  peer: string;
16
+ text: string;
16
17
  }>) => void;
17
18
  export declare const RANGE_COLOR_MAP: Record<CompColor, {
18
19
  track: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unizap/uniui",
3
- "version": "1.0.35",
3
+ "version": "1.0.36",
4
4
  "description": "A UI component library for React",
5
5
  "type": "module",
6
6
  "files": [