tailwind-ux-kit 1.0.51 → 1.0.52

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.
@@ -61,56 +61,62 @@ const H = {
61
61
  () => ie(S, a, g),
62
62
  [S, a, g]
63
63
  ), _ = $(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), B = $(() => d ? o === "start" || o === "left" ? "ps-10" : "pe-10" : "", [d, o]);
64
- return /* @__PURE__ */ y("div", { className: `w-full relative ${m ? "z-0" : ""}`, children: [
65
- !m && t && /* @__PURE__ */ f(
66
- "label",
67
- {
68
- htmlFor: v,
69
- className: `block mb-1 text-sm ${a ? "text-green-700 dark:text-green-500" : g ? "text-red-700 dark:text-red-500" : "text-gray-700"}`,
70
- children: t
71
- }
72
- ),
73
- /* @__PURE__ */ y("div", { className: "relative w-full", children: [
74
- d && /* @__PURE__ */ f(
75
- "div",
76
- {
77
- className: `absolute inset-y-0 flex items-center ${_}`,
78
- "aria-hidden": "true",
79
- children: /* @__PURE__ */ f("span", { className: "text-gray-500", children: d })
80
- }
81
- ),
82
- /* @__PURE__ */ f(
83
- "input",
84
- {
85
- ...w,
86
- id: v,
87
- ref: n,
88
- placeholder: m ? " " : w.placeholder,
89
- onChange: O,
90
- className: `border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-900 placeholder-gray-600 border-gray-400
64
+ return /* @__PURE__ */ y(
65
+ "div",
66
+ {
67
+ className: `w-full relative ${m ? "z-0" : ""} tailwind-ux-input`,
68
+ children: [
69
+ !m && t && /* @__PURE__ */ f(
70
+ "label",
71
+ {
72
+ htmlFor: v,
73
+ className: `block mb-1 text-sm ${a ? "text-green-700 dark:text-green-500" : g ? "text-red-700 dark:text-red-500" : "text-gray-700"}`,
74
+ children: t
75
+ }
76
+ ),
77
+ /* @__PURE__ */ y("div", { className: "relative w-full", children: [
78
+ d && /* @__PURE__ */ f(
79
+ "div",
80
+ {
81
+ className: `absolute inset-y-0 flex items-center ${_}`,
82
+ "aria-hidden": "true",
83
+ children: /* @__PURE__ */ f("span", { className: "text-gray-500", children: d })
84
+ }
85
+ ),
86
+ /* @__PURE__ */ f(
87
+ "input",
88
+ {
89
+ ...w,
90
+ id: v,
91
+ ref: n,
92
+ placeholder: m ? " " : w.placeholder,
93
+ onChange: O,
94
+ className: `border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-900 placeholder-gray-600 border-gray-400
91
95
  ${C}
92
96
  ${m && l && ae[l]}
93
97
  ${B} ${k} ${j} ${i}`
94
- }
95
- ),
96
- m && t && l && /* @__PURE__ */ f(
97
- "label",
98
- {
99
- htmlFor: v,
100
- className: `ms-1 ${le[l]} ${i}`,
101
- children: t
102
- }
103
- )
104
- ] }),
105
- x && /* @__PURE__ */ f(
106
- "p",
107
- {
108
- className: `mt-1 text-xs ${h === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
109
- role: h === "invalid" ? "alert" : void 0,
110
- children: x
111
- }
112
- )
113
- ] });
98
+ }
99
+ ),
100
+ m && t && l && /* @__PURE__ */ f(
101
+ "label",
102
+ {
103
+ htmlFor: v,
104
+ className: `ms-1 ${le[l]} ${i}`,
105
+ children: t
106
+ }
107
+ )
108
+ ] }),
109
+ x && /* @__PURE__ */ f(
110
+ "p",
111
+ {
112
+ className: `mt-1 text-xs ${h === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
113
+ role: h === "invalid" ? "alert" : void 0,
114
+ children: x
115
+ }
116
+ )
117
+ ]
118
+ }
119
+ );
114
120
  });
115
121
  ce.displayName = "Input";
116
122
  const de = {
@@ -1,5 +1,5 @@
1
1
  (function(x,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],n):(x=typeof globalThis<"u"?globalThis:x||self,n(x.TailwindUiKit={},x.jsxRuntime,x.React))})(this,function(x,n,s){"use strict";"use client";var F=document.createElement("style");F.textContent=`/*! tailwindcss v4.1.10 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}.btn-primary{background-color:var(--color-blue-600,oklch(54.6% .245 262.881));color:var(--color-white,#fff)}@media (hover:hover){.btn-primary:hover{background-color:var(--color-blue-700,oklch(48.8% .243 264.376))}}.btn-outline-primary{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-blue-600,oklch(54.6% .245 262.881));color:var(--color-blue-600,oklch(54.6% .245 262.881))}@media (hover:hover){.btn-outline-primary:hover{background-color:var(--color-blue-50,oklch(97% .014 254.604))}}.btn-soft-primary{background-color:var(--color-blue-100,oklch(93.2% .032 255.585));color:var(--color-blue-700,oklch(48.8% .243 264.376))}@media (hover:hover){.btn-soft-primary:hover{background-color:var(--color-blue-200,oklch(88.2% .059 254.128))}}.btn-secondary{background-color:var(--color-gray-600,oklch(44.6% .03 256.802));color:var(--color-white,#fff)}@media (hover:hover){.btn-secondary:hover{background-color:var(--color-gray-700,oklch(37.3% .034 259.733))}}.btn-outline-secondary{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-gray-600,oklch(44.6% .03 256.802));color:var(--color-gray-600,oklch(44.6% .03 256.802))}@media (hover:hover){.btn-outline-secondary:hover{background-color:var(--color-gray-50,oklch(98.5% .002 247.839))}}.btn-soft-secondary{background-color:var(--color-gray-100,oklch(96.7% .003 264.542));color:var(--color-gray-700,oklch(37.3% .034 259.733))}@media (hover:hover){.btn-soft-secondary:hover{background-color:var(--color-gray-200,oklch(92.8% .006 264.531))}}.btn-danger{background-color:var(--color-red-600,oklch(57.7% .245 27.325));color:var(--color-white,#fff)}@media (hover:hover){.btn-danger:hover{background-color:var(--color-red-700,oklch(50.5% .213 27.518))}}.btn-outline-danger{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-red-600,oklch(57.7% .245 27.325));color:var(--color-red-600,oklch(57.7% .245 27.325))}@media (hover:hover){.btn-outline-danger:hover{background-color:var(--color-red-50,oklch(97.1% .013 17.38))}}.btn-soft-danger{background-color:var(--color-red-100,oklch(93.6% .032 17.717));color:var(--color-red-700,oklch(50.5% .213 27.518))}@media (hover:hover){.btn-soft-danger:hover{background-color:var(--color-red-200,oklch(88.5% .062 18.334))}}.btn-link{padding:calc(var(--spacing,.25rem)*0);color:var(--color-blue-600,oklch(54.6% .245 262.881));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000}@media (hover:hover){.btn-link:hover{text-decoration-line:underline}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
2
- /*$vite$:1*/`,document.head.appendChild(F);const Z={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},G={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},R={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},ee={filled:"absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",outlined:"absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",standard:"absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"},te=(e,o,t)=>{if(t)return"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";if(o)return"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";switch(e){case"error":return"border-red-500 bg-red-50 focus:ring-red-500";case"warning":return"border-yellow-500 bg-yellow-50 focus:ring-yellow-500";case"success":return"border-green-500 bg-green-50 focus:ring-green-500";default:return"border-gray-300 focus:ring-blue-500"}},q=s.forwardRef((e,o)=>{const{label:t,id:r,inputSize:l="md",shape:b="rounded",validate:p,onValidatedChange:u,className:d="",icon:f,iconPosition:a="left",floatingLabelStyle:c,onChange:h,isValid:i,isInvalid:g,feedback:m,feedbackType:w="invalid",...v}=e,[S,N]=s.useState("default"),$=s.useCallback(M=>{const B=M.target.value,O=(p==null?void 0:p(B))??"default";N(O),u==null||u(M,O),h==null||h(M)},[p,u,h]),k=s.useMemo(()=>r||(typeof t=="string"?`input-${t.toLowerCase().replace(/\s+/g,"-")}`:`input-${Math.random().toString(36).slice(2)}`),[r,t]),y=!!c,C=Z[l]||Z.md,E=G[b]||G.flat,L=s.useMemo(()=>te(S,i,g),[S,i,g]),_=s.useMemo(()=>a==="start"||a==="left"?"left-0 ps-3.5":"right-0 pe-3.5",[a]),D=s.useMemo(()=>f?a==="start"||a==="left"?"ps-10":"pe-10":"",[f,a]);return n.jsxs("div",{className:`w-full relative ${y?"z-0":""}`,children:[!y&&t&&n.jsx("label",{htmlFor:k,className:`block mb-1 text-sm ${i?"text-green-700 dark:text-green-500":g?"text-red-700 dark:text-red-500":"text-gray-700"}`,children:t}),n.jsxs("div",{className:"relative w-full",children:[f&&n.jsx("div",{className:`absolute inset-y-0 flex items-center ${_}`,"aria-hidden":"true",children:n.jsx("span",{className:"text-gray-500",children:f})}),n.jsx("input",{...v,id:k,ref:o,placeholder:y?" ":v.placeholder,onChange:$,className:`border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-900 placeholder-gray-600 border-gray-400
2
+ /*$vite$:1*/`,document.head.appendChild(F);const Z={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},G={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},R={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},ee={filled:"absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",outlined:"absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",standard:"absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"},te=(e,o,t)=>{if(t)return"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";if(o)return"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";switch(e){case"error":return"border-red-500 bg-red-50 focus:ring-red-500";case"warning":return"border-yellow-500 bg-yellow-50 focus:ring-yellow-500";case"success":return"border-green-500 bg-green-50 focus:ring-green-500";default:return"border-gray-300 focus:ring-blue-500"}},q=s.forwardRef((e,o)=>{const{label:t,id:r,inputSize:l="md",shape:b="rounded",validate:p,onValidatedChange:u,className:d="",icon:f,iconPosition:a="left",floatingLabelStyle:c,onChange:h,isValid:i,isInvalid:g,feedback:m,feedbackType:w="invalid",...v}=e,[S,N]=s.useState("default"),$=s.useCallback(M=>{const B=M.target.value,O=(p==null?void 0:p(B))??"default";N(O),u==null||u(M,O),h==null||h(M)},[p,u,h]),k=s.useMemo(()=>r||(typeof t=="string"?`input-${t.toLowerCase().replace(/\s+/g,"-")}`:`input-${Math.random().toString(36).slice(2)}`),[r,t]),y=!!c,C=Z[l]||Z.md,E=G[b]||G.flat,L=s.useMemo(()=>te(S,i,g),[S,i,g]),_=s.useMemo(()=>a==="start"||a==="left"?"left-0 ps-3.5":"right-0 pe-3.5",[a]),D=s.useMemo(()=>f?a==="start"||a==="left"?"ps-10":"pe-10":"",[f,a]);return n.jsxs("div",{className:`w-full relative ${y?"z-0":""} tailwind-ux-input`,children:[!y&&t&&n.jsx("label",{htmlFor:k,className:`block mb-1 text-sm ${i?"text-green-700 dark:text-green-500":g?"text-red-700 dark:text-red-500":"text-gray-700"}`,children:t}),n.jsxs("div",{className:"relative w-full",children:[f&&n.jsx("div",{className:`absolute inset-y-0 flex items-center ${_}`,"aria-hidden":"true",children:n.jsx("span",{className:"text-gray-500",children:f})}),n.jsx("input",{...v,id:k,ref:o,placeholder:y?" ":v.placeholder,onChange:$,className:`border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-900 placeholder-gray-600 border-gray-400
3
3
  ${C}
4
4
  ${y&&c&&R[c]}
5
5
  ${D} ${E} ${L} ${d}`}),y&&t&&c&&n.jsx("label",{htmlFor:k,className:`ms-1 ${ee[c]} ${d}`,children:t})]}),m&&n.jsx("p",{className:`mt-1 text-xs ${w==="invalid"?"text-red-600 dark:text-red-500":"text-green-600 dark:text-green-500"}`,role:w==="invalid"?"alert":void 0,children:m})]})});q.displayName="Input";const re={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},oe={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},ne={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},se={filled:"absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",outlined:"absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",standard:"absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"},ae=(e,o,t)=>{if(t)return"border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";if(o)return"border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";const r="focus:ring focus:border";switch(e){case"error":return`${r}-red-500 border-red-500 bg-red-50`;case"warning":return`${r}-yellow-500 border-yellow-500 bg-yellow-50`;case"success":return`${r}-green-500 border-green-500 bg-green-50`;default:return"border-gray-300 focus:ring-blue-500"}},H=s.forwardRef((e,o)=>{const{label:t,id:r,inputSize:l="md",shape:b="rounded",validate:p,onValidatedChange:u,className:d="",icon:f,iconPosition:a="left",floatingLabelStyle:c,onChange:h,isValid:i,isInvalid:g,feedback:m,feedbackType:w="invalid",children:v,...S}=e,[N,$]=s.useState("default"),k=s.useId(),y=s.useMemo(()=>r||(typeof t=="string"?`select-${t.toLowerCase().replace(/\s+/g,"-")}`:k),[r,t,k]),C=O=>{const _e=O.target.value,V=(p==null?void 0:p(_e))??"default";$(V),u==null||u(O,V),h==null||h(O)},E=!!c,L=re[l],_=oe[b],D=ae(N,i,g),M=f&&(a==="start"||a==="left")?"ps-10":f?"pe-10":"",B=a==="start"||a==="left"?"left-0 ps-3.5":"right-0 pe-3.5";return n.jsxs("div",{className:`w-full relative ${E?"z-0":""}`,children:[!E&&t&&n.jsx("label",{htmlFor:y,className:`block mb-1 text-sm ${i?"text-green-700":g?"text-red-700":"text-gray-700"}`,children:t}),n.jsxs("div",{className:"relative w-full",children:[f&&n.jsx("div",{className:`absolute inset-y-0 flex items-center ${B}`,children:n.jsx("span",{className:"text-gray-500",children:f})}),n.jsx("select",{...S,id:y,ref:o,onChange:C,className:`border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-600 placeholder-[#798ba5] border-gray-400
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwind-ux-kit",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "main": "lib/tailwind-ux-kit.es.js",
5
5
  "module": "lib/tailwind-ux-kit.umd.js",
6
6
  "types": "lib/tailwind-ux-kit.es.d.ts",