aravint-ui-form-controls 1.0.7 → 1.0.8

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.
@@ -160,4 +160,4 @@
160
160
  .cdp-calendar .react-datepicker__day--today {
161
161
  font-weight: 700 !important;
162
162
  }
163
- `}),y.jsx("div",{className:"w-full [&_.react-datepicker-wrapper]:w-full [&_.react-datepicker__input-container]:w-full",children:y.jsx(Nu,{ref:E,...S?{selectsRange:!0}:{},dateFormat:b,placeholderText:s||R,selected:S?e??void 0:a??void 0,startDate:S?e??void 0:void 0,endDate:S?r??void 0:void 0,onChange:I,shouldCloseOnSelect:!S,calendarClassName:"cdp-calendar",minDate:l??void 0,maxDate:c??void 0,disabled:u,filterDate:P,showPopperArrow:!1,popperPlacement:"bottom-start",renderCustomHeader:({date:F,decreaseMonth:L,increaseMonth:B,prevMonthButtonDisabled:W,nextMonthButtonDisabled:Y})=>y.jsxs("div",{className:"flex items-center justify-between px-1",children:[y.jsx("button",{onClick:L,disabled:W,style:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"none",background:"transparent",cursor:"pointer",fontSize:"24px",lineHeight:1,color:"#4B5563",opacity:W?.3:1},children:"‹"}),y.jsxs("span",{className:"text-[14px] font-bold text-gray-900",children:[Fu[F.getMonth()]," ",F.getFullYear()]}),y.jsx("button",{onClick:B,disabled:Y,style:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"none",background:"transparent",cursor:"pointer",fontSize:"24px",lineHeight:1,color:"#4B5563",opacity:Y?.3:1},children:"›"})]}),calendarContainer:({className:F,children:L})=>y.jsxs("div",{className:F,children:[L,S&&y.jsxs("div",{className:"border-t border-gray-100 mt-2 px-1 py-2 text-[11px] text-gray-500",children:[y.jsx("span",{className:"font-semibold text-gray-700",children:"Note:"})," ","Date range selection is limited to ",i," year."]})]}),customInput:y.jsx(Iu,{value:S?_:a?er(a):"",placeholder:s||R,onClear:j,showClear:S?!!e:!!a,className:v})},n)})]})});var so={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},aa=m.createContext&&m.createContext(so),Au=["attr","size","title"];function Wu(n,a){if(n==null)return{};var t,e,r=Hu(n,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(e=0;e<o.length;e++)t=o[e],a.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Hu(n,a){if(n==null)return{};var t={};for(var e in n)if({}.hasOwnProperty.call(n,e)){if(a.indexOf(e)!==-1)continue;t[e]=n[e]}return t}function yr(){return yr=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var e in t)({}).hasOwnProperty.call(t,e)&&(n[e]=t[e])}return n},yr.apply(null,arguments)}function oa(n,a){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);a&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,e)}return t}function xr(n){for(var a=1;a<arguments.length;a++){var t=arguments[a]!=null?arguments[a]:{};a%2?oa(Object(t),!0).forEach(function(e){ju(n,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):oa(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))})}return n}function ju(n,a,t){return(a=Bu(a))in n?Object.defineProperty(n,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[a]=t,n}function Bu(n){var a=Qu(n,"string");return typeof a=="symbol"?a:a+""}function Qu(n,a){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var e=t.call(n,a);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(n)}function io(n){return n&&n.map((a,t)=>m.createElement(a.tag,xr({key:t},a.attr),io(a.child)))}function pn(n){return a=>m.createElement(zu,yr({attr:xr({},n.attr)},a),io(n.child))}function zu(n){var a=t=>{var{attr:e,size:r,title:o}=n,s=Wu(n,Au),i=r||t.size||"1em",l;return t.className&&(l=t.className),n.className&&(l=(l?l+" ":"")+n.className),m.createElement("svg",yr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,e,s,{className:l,style:xr(xr({color:n.color||t.color},t.style),n.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),o&&m.createElement("title",null,o),n.children)};return aa!==void 0?m.createElement(aa.Consumer,null,t=>a(t)):a(so)}function Vu(n){return pn({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 428 339.92 303.9a160.48 160.48 0 0 0 30.72-94.58C370.64 120.37 298.27 48 209.32 48S48 120.37 48 209.32s72.37 161.32 161.32 161.32a160.48 160.48 0 0 0 94.58-30.72L428 464zM209.32 319.69a110.38 110.38 0 1 1 110.37-110.37 110.5 110.5 0 0 1-110.37 110.37z"},child:[]}]})(n)}function $u(n){return pn({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6 1.41 1.41z"},child:[]}]})(n)}function Ku(n){return pn({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},child:[]}]})(n)}const qu=Vu,Uu=Ku,Gu=$u,Xu=({label:n,options:a,value:t,placeholder:e="Select",onChange:r,disabled:o=!1,hoverOptionStyle:s={backgroundColor:"#BEFFDB",color:"#13785F"},selectedOptionStyle:i={backgroundColor:"#13785F",color:"#FFFFFF",fontWeight:500,borderLeftWidth:5,borderLeftColor:"#10B981",borderLeftStyle:"solid"},searchPlaceholder:l="Search...",showSearch:c=!0,ArrowDownIcon:u,ArrowUpIcon:d})=>{const[p,f]=m.useState(!1),[h,v]=m.useState(""),[g,w]=m.useState(null),x=m.useRef(null),D=a.find(b=>String(b.value)===String(t)),C=a.filter(b=>b.label.toLowerCase().includes(h.toLowerCase())),R=p?d||Gu:u||Uu;return m.useEffect(()=>{const b=_=>{x.current&&!x.current.contains(_.target)&&f(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[]),y.jsxs("div",{className:"relative w-full",ref:x,children:[n&&y.jsx("label",{children:n}),y.jsxs("div",{className:" h-8 w-full border border-[#9CA3AF] rounded-md bg-white px-2 flex items-center justify-between cursor-pointer text-xs",onClick:()=>!o&&f(!p),children:[y.jsx("span",{className:"truncate text-xs text-gray-700",children:(D==null?void 0:D.label)||e}),y.jsx(R,{className:"transition duration-200 text-gray-500 text-[16px]"})]}),p&&!o&&y.jsxs("div",{className:" absolute left-0 top-full mt-1 w-full bg-white border border-[#9CA3AF] rounded-md shadow-lg",style:{zIndex:9999},children:[c&&y.jsx("div",{className:"p-2 border-b bg-white",children:y.jsxs("div",{className:"relative bg-amber-900",children:[y.jsx("div",{className:"absolute left-5 top-1/2 -translate-y-1/2 flex items-center justify-center w-5 h-5 pointer-events-none",children:y.jsx(qu,{className:"w-4 h-4 text-slate-400"})}),y.jsx("input",{type:"text",placeholder:l,value:h,onChange:b=>v(b.target.value),className:"w-full h-9 rounded-lg border border-[#D1D5DB] bg-white text-sm text-slate-700 placeholder:text-slate-400 outline-none transition focus:border-[#10B981] focus:ring-1 focus:ring-[#10B981]/20",style:{paddingLeft:24,paddingRight:16,fontSize:12,lineHeight:"16px",height:36}})]})}),y.jsx("div",{className:"max-h-52 overflow-y-auto overflow-x-hidden bg-white",children:C.map(b=>{const _=String(t)===String(b.value),I=g===b.value,j=_?i:I?s:void 0;return y.jsx("div",{className:`px-3 py-2 text-xs cursor-pointer transition-all duration-150 shadow-[0px_1px_2px_0px_#0000000D] ${_?"":"hover:translate-x-[2px] hover:font-bold"}`,style:j,onMouseEnter:()=>w(b.value),onMouseLeave:()=>w(null),onClick:()=>{r(b.value),f(!1),v("")},children:b.label},b.value)})})]})]})},Zu=({value:n,icon:a})=>{const[t,e]=m.useState(!1);return y.jsxs("div",{className:"relative inline-flex items-center justify-center",onMouseEnter:()=>e(!0),onMouseLeave:()=>e(!1),children:[a,t&&y.jsxs("div",{className:"absolute left-1/2 -translate-x-1/2 z-[99999]",style:{top:"calc(100% + 8px)",background:"#202124",color:"#FFFFFF",padding:"6px 10px",borderRadius:"4px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",width:"max-content",boxShadow:"0 2px 8px rgba(0,0,0,0.25)"},children:[n,y.jsx("div",{style:{position:"absolute",top:"-5px",left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderBottom:"5px solid #202124"}})]})]})};exports.Checkbox=ho;exports.CustomDatePicker=Lu;exports.DragDropUpload=Go;exports.Input=xa;exports.MultiSelect=Uo;exports.Radio=po;exports.Select=Zo;exports.SingleSelect=Xu;exports.Textarea=wa;exports.ToggleSwitch=fo;exports.Tooltip=Zu;
163
+ `}),y.jsx("div",{className:"w-full [&_.react-datepicker-wrapper]:w-full [&_.react-datepicker__input-container]:w-full",children:y.jsx(Nu,{ref:E,...S?{selectsRange:!0}:{},dateFormat:b,placeholderText:s||R,selected:S?e??void 0:a??void 0,startDate:S?e??void 0:void 0,endDate:S?r??void 0:void 0,onChange:I,shouldCloseOnSelect:!S,calendarClassName:"cdp-calendar",minDate:l??void 0,maxDate:c??void 0,disabled:u,filterDate:P,showPopperArrow:!1,popperPlacement:"bottom-start",renderCustomHeader:({date:F,decreaseMonth:L,increaseMonth:B,prevMonthButtonDisabled:W,nextMonthButtonDisabled:Y})=>y.jsxs("div",{className:"flex items-center justify-between px-1",children:[y.jsx("button",{onClick:L,disabled:W,style:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"none",background:"transparent",cursor:"pointer",fontSize:"24px",lineHeight:1,color:"#4B5563",opacity:W?.3:1},children:"‹"}),y.jsxs("span",{className:"text-[14px] font-bold text-gray-900",children:[Fu[F.getMonth()]," ",F.getFullYear()]}),y.jsx("button",{onClick:B,disabled:Y,style:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"none",background:"transparent",cursor:"pointer",fontSize:"24px",lineHeight:1,color:"#4B5563",opacity:Y?.3:1},children:"›"})]}),calendarContainer:({className:F,children:L})=>y.jsxs("div",{className:F,children:[L,S&&y.jsxs("div",{className:"border-t border-gray-100 mt-2 px-1 py-2 text-[11px] text-gray-500",children:[y.jsx("span",{className:"font-semibold text-gray-700",children:"Note:"})," ","Date range selection is limited to ",i," year."]})]}),customInput:y.jsx(Iu,{value:S?_:a?er(a):"",placeholder:s||R,onClear:j,showClear:S?!!e:!!a,className:v})},n)})]})});var so={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},aa=m.createContext&&m.createContext(so),Au=["attr","size","title"];function Wu(n,a){if(n==null)return{};var t,e,r=Hu(n,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(e=0;e<o.length;e++)t=o[e],a.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Hu(n,a){if(n==null)return{};var t={};for(var e in n)if({}.hasOwnProperty.call(n,e)){if(a.indexOf(e)!==-1)continue;t[e]=n[e]}return t}function yr(){return yr=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var e in t)({}).hasOwnProperty.call(t,e)&&(n[e]=t[e])}return n},yr.apply(null,arguments)}function oa(n,a){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);a&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,e)}return t}function xr(n){for(var a=1;a<arguments.length;a++){var t=arguments[a]!=null?arguments[a]:{};a%2?oa(Object(t),!0).forEach(function(e){ju(n,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):oa(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))})}return n}function ju(n,a,t){return(a=Bu(a))in n?Object.defineProperty(n,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[a]=t,n}function Bu(n){var a=Qu(n,"string");return typeof a=="symbol"?a:a+""}function Qu(n,a){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var e=t.call(n,a);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(n)}function io(n){return n&&n.map((a,t)=>m.createElement(a.tag,xr({key:t},a.attr),io(a.child)))}function pn(n){return a=>m.createElement(zu,yr({attr:xr({},n.attr)},a),io(n.child))}function zu(n){var a=t=>{var{attr:e,size:r,title:o}=n,s=Wu(n,Au),i=r||t.size||"1em",l;return t.className&&(l=t.className),n.className&&(l=(l?l+" ":"")+n.className),m.createElement("svg",yr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,e,s,{className:l,style:xr(xr({color:n.color||t.color},t.style),n.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),o&&m.createElement("title",null,o),n.children)};return aa!==void 0?m.createElement(aa.Consumer,null,t=>a(t)):a(so)}function Vu(n){return pn({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 428 339.92 303.9a160.48 160.48 0 0 0 30.72-94.58C370.64 120.37 298.27 48 209.32 48S48 120.37 48 209.32s72.37 161.32 161.32 161.32a160.48 160.48 0 0 0 94.58-30.72L428 464zM209.32 319.69a110.38 110.38 0 1 1 110.37-110.37 110.5 110.5 0 0 1-110.37 110.37z"},child:[]}]})(n)}function $u(n){return pn({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6 1.41 1.41z"},child:[]}]})(n)}function Ku(n){return pn({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},child:[]}]})(n)}const qu=Vu,Uu=Ku,Gu=$u,Xu=({label:n,options:a,value:t,placeholder:e="Select",onChange:r,disabled:o=!1,hoverOptionStyle:s={backgroundColor:"#BEFFDB",color:"#13785F"},selectedOptionStyle:i={backgroundColor:"#13785F",color:"#FFFFFF",fontWeight:500,borderLeftWidth:5,borderLeftColor:"#10B981",borderLeftStyle:"solid"},searchPlaceholder:l="Search...",showSearch:c=!0,ArrowDownIcon:u,ArrowUpIcon:d})=>{const[p,f]=m.useState(!1),[h,v]=m.useState(""),[g,w]=m.useState(null),x=m.useRef(null),D=a.find(b=>String(b.value)===String(t)),C=a.filter(b=>b.label.toLowerCase().includes(h.toLowerCase())),R=p?d||Gu:u||Uu;return m.useEffect(()=>{const b=_=>{x.current&&!x.current.contains(_.target)&&f(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[]),y.jsxs("div",{className:"relative w-full",ref:x,children:[n&&y.jsx("label",{children:n}),y.jsxs("div",{className:" h-8 w-full border border-[#9CA3AF] rounded-md bg-white px-2 flex items-center justify-between cursor-pointer text-xs",onClick:()=>!o&&f(!p),children:[y.jsx("span",{className:"truncate text-xs text-gray-700",children:(D==null?void 0:D.label)||e}),y.jsx(R,{className:"transition duration-200 text-gray-500 text-[16px]"})]}),p&&!o&&y.jsxs("div",{className:" absolute left-0 top-full mt-1 w-full bg-white border border-[#9CA3AF] rounded-md shadow-lg",style:{zIndex:9999},children:[c&&y.jsx("div",{className:"p-2 border-b bg-white",children:y.jsxs("div",{className:"relative bg-amber-900",children:[y.jsx("div",{className:"absolute left-5 top-1/2 -translate-y-1/2 flex items-center justify-center w-5 h-5 pointer-events-none",children:y.jsx(qu,{className:"w-4 h-4 text-slate-400"})}),y.jsx("input",{type:"text",placeholder:l,value:h,onChange:b=>v(b.target.value),className:"w-full h-9 rounded-lg border border-[#D1D5DB] text-sm text-slate-700 placeholder:text-slate-400 outline-none transition focus:border-[#10B981] focus:ring-1 focus:ring-[#10B981]/20",style:{paddingLeft:24,paddingRight:16,fontSize:12,lineHeight:"16px",height:28,backgroundColor:"#F9F9F9"}})]})}),y.jsx("div",{className:"max-h-52 overflow-y-auto overflow-x-hidden bg-white",children:C.map(b=>{const _=String(t)===String(b.value),I=g===b.value,j=_?i:I?s:void 0;return y.jsx("div",{className:`px-3 py-2 text-xs cursor-pointer transition-all duration-150 shadow-[0px_1px_2px_0px_#0000000D] ${_?"":"hover:translate-x-[2px] hover:font-bold"}`,style:j,onMouseEnter:()=>w(b.value),onMouseLeave:()=>w(null),onClick:()=>{r(b.value),f(!1),v("")},children:b.label},b.value)})})]})]})},Zu=({value:n,icon:a})=>{const[t,e]=m.useState(!1);return y.jsxs("div",{className:"relative inline-flex items-center justify-center",onMouseEnter:()=>e(!0),onMouseLeave:()=>e(!1),children:[a,t&&y.jsxs("div",{className:"absolute left-1/2 -translate-x-1/2 z-[99999]",style:{top:"calc(100% + 8px)",background:"#202124",color:"#FFFFFF",padding:"6px 10px",borderRadius:"4px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",width:"max-content",boxShadow:"0 2px 8px rgba(0,0,0,0.25)"},children:[n,y.jsx("div",{style:{position:"absolute",top:"-5px",left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderBottom:"5px solid #202124"}})]})]})};exports.Checkbox=ho;exports.CustomDatePicker=Lu;exports.DragDropUpload=Go;exports.Input=xa;exports.MultiSelect=Uo;exports.Radio=po;exports.Select=Zo;exports.SingleSelect=Xu;exports.Textarea=wa;exports.ToggleSwitch=fo;exports.Tooltip=Zu;
@@ -11530,8 +11530,8 @@ const ed = Xu, td = Ju, rd = Zu, md = ({
11530
11530
  placeholder: l,
11531
11531
  value: h,
11532
11532
  onChange: (v) => g(v.target.value),
11533
- className: "w-full h-9 rounded-lg border border-[#D1D5DB] bg-white text-sm text-slate-700 placeholder:text-slate-400 outline-none transition focus:border-[#10B981] focus:ring-1 focus:ring-[#10B981]/20",
11534
- style: { paddingLeft: 24, paddingRight: 16, fontSize: 12, lineHeight: "16px", height: 36 }
11533
+ className: "w-full h-9 rounded-lg border border-[#D1D5DB] text-sm text-slate-700 placeholder:text-slate-400 outline-none transition focus:border-[#10B981] focus:ring-1 focus:ring-[#10B981]/20",
11534
+ style: { paddingLeft: 24, paddingRight: 16, fontSize: 12, lineHeight: "16px", height: 28, backgroundColor: "#F9F9F9" }
11535
11535
  }
11536
11536
  )
11537
11537
  ] }) }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aravint-ui-form-controls",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "main": "dist/form-controls.cjs.js",
5
5
  "module": "dist/form-controls.es.js",
6
6
  "types": "dist/types/index.d.ts",