aha-components 1.8.4 → 1.8.5

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.
Files changed (59) hide show
  1. package/dist/Avatar.esm.js +1 -1
  2. package/dist/Avatar.esm.js.map +1 -1
  3. package/dist/Avatar.js +1 -1
  4. package/dist/Avatar.js.map +1 -1
  5. package/dist/Badge.esm.js +1 -1
  6. package/dist/Badge.esm.js.map +1 -1
  7. package/dist/Badge.js +1 -1
  8. package/dist/Badge.js.map +1 -1
  9. package/dist/Button.esm.js +1 -1
  10. package/dist/Button.esm.js.map +1 -1
  11. package/dist/Button.js +1 -1
  12. package/dist/Button.js.map +1 -1
  13. package/dist/Checkbox.esm.js +1 -1
  14. package/dist/Checkbox.esm.js.map +1 -1
  15. package/dist/Checkbox.js +1 -1
  16. package/dist/Checkbox.js.map +1 -1
  17. package/dist/Input.esm.js +1 -1
  18. package/dist/Input.esm.js.map +1 -1
  19. package/dist/Input.js +1 -1
  20. package/dist/Input.js.map +1 -1
  21. package/dist/Loading.esm.js +1 -1
  22. package/dist/Loading.esm.js.map +1 -1
  23. package/dist/Loading.js +1 -1
  24. package/dist/Loading.js.map +1 -1
  25. package/dist/Pagination.esm.js +1 -1
  26. package/dist/Pagination.esm.js.map +1 -1
  27. package/dist/Pagination.js +1 -1
  28. package/dist/Pagination.js.map +1 -1
  29. package/dist/Popover.esm.js +1 -1
  30. package/dist/Popover.esm.js.map +1 -1
  31. package/dist/Popover.js +1 -1
  32. package/dist/Popover.js.map +1 -1
  33. package/dist/Radio.esm.js +1 -1
  34. package/dist/Radio.esm.js.map +1 -1
  35. package/dist/Radio.js +1 -1
  36. package/dist/Radio.js.map +1 -1
  37. package/dist/Table.esm.js +1 -1
  38. package/dist/Table.esm.js.map +1 -1
  39. package/dist/Table.js +1 -1
  40. package/dist/Table.js.map +1 -1
  41. package/dist/Textarea.esm.js +1 -1
  42. package/dist/Textarea.esm.js.map +1 -1
  43. package/dist/Textarea.js +1 -1
  44. package/dist/Textarea.js.map +1 -1
  45. package/dist/components/Badge/index.d.ts +2 -1
  46. package/dist/components/shared/badgeColors.d.ts +25 -0
  47. package/dist/components/shared/buttonStyles.d.ts +18 -0
  48. package/dist/components/shared/colorUtils.d.ts +6 -0
  49. package/dist/components/shared/controlStyles.d.ts +27 -0
  50. package/dist/components/shared/fieldStyles.d.ts +37 -0
  51. package/dist/index.css +1924 -0
  52. package/dist/index.d.ts +26 -1
  53. package/dist/index.esm.css +1924 -0
  54. package/dist/index.esm.js +1 -1
  55. package/dist/index.esm.js.map +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/index.js.map +1 -1
  58. package/dist/tokens.d.ts +14 -14
  59. package/package.json +1 -1
package/dist/Input.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react"),r=function(){return r=Object.assign||function(e){for(var o,r=1,t=arguments.length;r<t;r++)for(var n in o=arguments[r])Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);return e},r.apply(this,arguments)};function t(e,o){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)o.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r}function n(e,o,r){if(r||2===arguments.length)for(var t,n=0,i=o.length;n<i;n++)!t&&n in o||(t||(t=Array.prototype.slice.call(o,0,n)),t[n]=o[n]);return e.concat(t||Array.prototype.slice.call(o))}"function"==typeof SuppressedError&&SuppressedError;var i="var(--shadow-xs)",l={small:{pt:"5px",pb:"5px"},mediumSmall:{pt:"7px",pb:"7px"},medium:{pt:"9px",pb:"9px"},large:{pt:"11px",pb:"11px"}},a=o.forwardRef(function(n,a){var d=n.size,s=void 0===d?"mediumSmall":d,c=n.error,p=void 0!==c&&c,u=n.disabled,x=void 0!==u&&u,f=n.readOnly,h=void 0!==f&&f,b=n.prefix,g=n.suffix,v=n.leadingText,y=n.trailingText,m=n.leadingAddon,F=n.trailingAddon,S=n.className,w=void 0===S?"":S,C=n.style,k=n.onFocus,z=n.onBlur,j=n.onKeyDown,E=n.onPressEnter,B=n.value,O=n.defaultValue,D=n.onChange,P=n.placeholder,I=n.type,A=void 0===I?"text":I,R=n.label,T=n.required,L=n.hintText,W=t(n,["size","error","disabled","readOnly","prefix","suffix","leadingText","trailingText","leadingAddon","trailingAddon","className","style","onFocus","onBlur","onKeyDown","onPressEnter","value","defaultValue","onChange","placeholder","type","label","required","hintText"]),H=o.useRef(null),G=o.useState(!1),N=G[0],M=G[1],q=o.useState(null!=O?O:""),_=q[0],V=q[1];o.useEffect(function(){"function"==typeof a?a(H.current):a&&(a.current=H.current)},[a]);var K=void 0!==B,Y=K?B:_,J=x?{border:"1px solid var(--color-border-disabled)",boxShadow:i,outline:"none"}:p&&N?{border:"1px solid var(--color-border-error)",boxShadow:i,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:p?{border:"1px solid var(--color-border-error_subtle)",boxShadow:i,outline:"none"}:N?{border:"1px solid var(--color-border-brand)",boxShadow:i,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:i,outline:"none"},Q=J.border,U=J.boxShadow,X=J.outline,Z=J.outlineOffset,$=l[s],ee=$.pt,oe=$.pb,re=x?"var(--color-border-disabled)":"var(--color-border-primary)",te=!!b,ne=!!g,ie={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:x?"var(--color-fg-disabled)":"var(--color-fg-quaternary)",zIndex:1,pointerEvents:"none"},le={display:"flex",alignItems:"center",paddingTop:ee,paddingBottom:oe,paddingLeft:"14px",paddingRight:"12px",color:"var(--color-text-tertiary)",fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-md)",lineHeight:"var(--line-height-text-md)",whiteSpace:"nowrap",flexShrink:0,backgroundColor:x?"var(--color-bg-disabled_subtle)":"transparent"},ae=e.jsxs("div",{className:"aha-input-group ".concat(w),style:r({display:"flex",alignItems:"stretch",width:"100%",border:Q,boxShadow:U,outline:X,outlineOffset:Z,borderRadius:"var(--radius-md)",backgroundColor:x||h?"var(--color-bg-disabled_subtle)":"var(--color-bg-primary)",overflow:"hidden",boxSizing:"border-box",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},C),children:[void 0!==v&&e.jsx("div",{style:r(r({},le),{borderRight:"1px solid ".concat(re)}),children:v}),void 0!==m&&e.jsx("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderRight:"1px solid ".concat(re)},children:m}),e.jsxs("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"stretch",minWidth:0},children:[te&&e.jsx("span",{style:r(r({},ie),{left:"14px"}),children:b}),e.jsx("input",r({ref:H,type:A,value:Y,placeholder:P,disabled:x,readOnly:h,onChange:function(e){K||V(e.target.value),null==D||D(e)},onFocus:function(e){M(!0),null==k||k(e)},onBlur:function(e){M(!1),null==z||z(e)},onKeyDown:function(e){"Enter"===e.key&&E&&E(e),null==j||j(e)},style:{flex:1,border:"none",outline:"none",width:"100%",boxSizing:"border-box",fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-md)",fontWeight:400,lineHeight:"var(--line-height-text-md)",backgroundColor:"transparent",color:x?"var(--color-text-disabled)":"var(--color-text-primary)",paddingTop:ee,paddingBottom:oe,paddingLeft:te?"40px":"14px",paddingRight:ne?"40px":"14px"},autoComplete:W.autoComplete||"off"},W)),ne&&e.jsx("span",{style:r(r({},ie),{right:"14px"}),children:g})]}),void 0!==y&&e.jsx("div",{style:r(r({},le),{paddingLeft:"12px",paddingRight:"14px",borderLeft:"1px solid ".concat(re)}),children:y}),void 0!==F&&e.jsx("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderLeft:"1px solid ".concat(re)},children:F})]});if(!R&&!L)return ae;var de={margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:p?"var(--color-error-600)":"var(--color-text-tertiary)"};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[R&&e.jsxs("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)"},children:[R,T&&e.jsx("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"})]}),ae,L&&e.jsx("p",{style:de,children:L})]})});a.displayName="InputGroup";var d={primaryColor:"#FB6011"},s=o.createContext(d),c={Green:{light:{bg:"#ECFDF5",text:"#006045",border:"#A4F4CF"},fill:{bg:"#00BC7D",text:"#FFFFFF"}},Red:{light:{bg:"#FEF2F2",text:"#9F0712",border:"#FFC9C9"},fill:{bg:"#FB2C36",text:"#FFFFFF"}},Orange:{light:{bg:"#FFF6ED",text:"#9B2911",border:"#FFD1A9"},fill:{bg:"#FB6011",text:"#FFFFFF"}},Cyan:{light:{bg:"#ECFEFF",text:"#005F78",border:"#A2F4FD"},fill:{bg:"#00B8DB",text:"#FFFFFF"}},Violet:{light:{bg:"#F5F3FF",text:"#5D0EC0",border:"#DDD6FF"},fill:{bg:"#8E51FF",text:"#FFFFFF"}},Pink:{light:{bg:"#FDF2F8",text:"#A3004C",border:"#FCCEE8"},fill:{bg:"#F6339A",text:"#FFFFFF"}},Gray:{light:{bg:"#F5F5F4",text:"#292524",border:"#E7E5E4"},fill:{bg:"#292524",text:"#FFFFFF"}},Yellow:{light:{bg:"#FFFBEB",text:"#973C00",border:"#FEE685"},fill:{bg:"#FE9A00",text:"#FFFFFF"}},Blue:{light:{bg:"#EFF6FF",text:"#193CB8",border:"#BEDBFF"},fill:{bg:"#2B7FFF",text:"#FFFFFF"}}},p={sm:{basePx:8,basePy:3,plCheckbox:5,plAvatar:4,plDot:6,plIcon:4,prClose:4,prCount:4,fontSize:12,lineHeight:"18px",height:24,avatarSize:16,checkboxSize:14,contentGap:4,rootGap:3,countPx:4,countFontSize:12,closeSize:10,closePad:2},md:{basePx:9,basePy:2,plCheckbox:4,plAvatar:5,plDot:7,plIcon:5,prClose:4,prCount:3,fontSize:14,lineHeight:"20px",height:24,avatarSize:16,checkboxSize:16,contentGap:5,rootGap:4,countPx:5,countFontSize:12,closeSize:12,closePad:2},lg:{basePx:10,basePy:4,plCheckbox:5,plAvatar:7,plDot:9,plIcon:7,prClose:4,prCount:4,fontSize:14,lineHeight:"20px",height:28,avatarSize:18,checkboxSize:18,contentGap:6,rootGap:4,countPx:6,countFontSize:14,closeSize:14,closePad:3}},u=function(r){var t=r.src,n=r.alt,i=void 0===n?"Avatar":n,l=r.size,a=void 0===l?16:l,d=o.useState(!1),s=d[0],c=d[1];return e.jsx("div",{style:{width:a,height:a,borderRadius:"50%",overflow:"hidden",flexShrink:0,border:"0.667px solid rgba(0,0,0,0.08)",background:"#e5e5e4",display:"flex",alignItems:"center",justifyContent:"center"},children:t&&!s?e.jsx("img",{src:t,alt:i,onError:function(){return c(!0)},style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):e.jsxs("svg",{width:.625*a,height:.625*a,viewBox:"0 0 10 10",fill:"none",children:[e.jsx("circle",{cx:"5",cy:"3.5",r:"2",stroke:"#999",strokeWidth:"1.2"}),e.jsx("path",{d:"M1 9.5c0-2.2 1.8-4 4-4s4 1.8 4 4",stroke:"#999",strokeWidth:"1.2",strokeLinecap:"round"})]})})},x=function(n){var i=n.children,l=n.color,a=n.variant,x=void 0===a?"light":a,f=n.size,h=void 0===f?"md":f,b=n.stroke,g=void 0!==b&&b,v=n.iconType,y=n.icon,m=n.avatarSrc,F=n.dotColor,S=n.action,w=void 0===S?"none":S,C=n.count,k=n.onClose,z=n.checkbox,j=void 0!==z&&z,E=n.checked,B=n.onCheckedChange,O=n.iconPosition,D=n.className,P=void 0===D?"":D,I=n.onClick,A=t(n,["children","color","variant","size","stroke","iconType","icon","avatarSrc","dotColor","action","count","onClose","checkbox","checked","onCheckedChange","iconPosition","className","onClick"]),R=(o.useContext(s)||d).primaryColor,T=o.useState(!1),L=T[0],W=T[1],H=function(e){return"large"===e?"lg":"small"===e?"sm":e}(h),G=p[H],N=void 0!==E?E:L,M=null!=v?v:y&&"leading"===O?"icon":"none",q="none"!==w?w:void 0,_=j?G.plCheckbox:"dot"===M?G.plDot:"avatar"===M||"icon"===M?G.plAvatar:G.basePx,V="x-close"===q?G.prClose:"count"===q?G.prCount:G.basePx,K={display:"inline-flex",alignItems:"center",gap:"x-close"===q?G.rootGap:0,paddingLeft:_,paddingRight:V,paddingTop:G.basePy,paddingBottom:G.basePy,height:G.height,borderRadius:6,fontFamily:"DM Sans, sans-serif",fontWeight:500,fontSize:G.fontSize,lineHeight:G.lineHeight,transition:"all 0.2s",cursor:I?"pointer":"default",boxSizing:"border-box",backgroundColor:"#ffffff",color:"#44403c",outline:"1px solid #d7d3d0",outlineOffset:"-1px"};if(l){var Y=function(e,o){if(e in c){var t=c[e];return"Orange"===e&&o?r(r({},t),{fill:r(r({},t.fill),{bg:o})}):t}if(e.startsWith("#")){var n=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),l=parseInt(e.slice(5,7),16);return{light:{bg:"rgba(".concat(n,",").concat(i,",").concat(l,",0.1)"),text:e,border:"rgba(".concat(n,",").concat(i,",").concat(l,",0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return c.Gray}(l,R);"light"===x?(K.backgroundColor=Y.light.bg,K.color=Y.light.text,K.outline=g?"1px solid ".concat(function(e){var o={Green:"#A4F4CF",Red:"#FFC9C9",Orange:"#FFD1A9",Blue:"#BEDBFF",Yellow:"#FFD1A9",Cyan:"#A2F4FD",Violet:"#DDD6FF",Pink:"#FCCEE8",Gray:"#E7E5E4"};if(e in o)return o[e];if(e.startsWith("#")){var r=parseInt(e.slice(1,3),16),t=parseInt(e.slice(3,5),16),n=parseInt(e.slice(5,7),16);return"rgba(".concat(r,",").concat(t,",").concat(n,",0.3)")}return"#E7E5E4"}(l)):"none",K.outlineOffset=g?"-1px":void 0):(K.backgroundColor=Y.fill.bg,K.color=Y.fill.text,K.outline="none")}I&&(K.cursor="pointer");return e.jsxs("div",r({className:P,style:K,onClick:I},A,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:G.contentGap,flexShrink:0},children:[j&&e.jsx("div",{role:"checkbox","aria-checked":N,onClick:function(e){e.stopPropagation();var o=!N;void 0===E&&W(o),null==B||B(o)},style:{width:G.checkboxSize,height:G.checkboxSize,borderRadius:4,flexShrink:0,border:N?"none":"1px solid #d7d3d0",background:N?R||"#7F56D9":"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:N&&e.jsx("svg",{width:Math.round(.65*G.checkboxSize),height:Math.round(.65*G.checkboxSize),viewBox:"0 0 10 10",fill:"none",children:e.jsx("path",{d:"M8.5 2L4 7.5 1.5 5",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),"avatar"===M?e.jsx(u,{src:m,size:G.avatarSize}):"dot"===M?e.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",fill:"none",style:{flexShrink:0},children:e.jsx("circle",{cx:4,cy:4,r:3.5,fill:F||"currentColor"})}):"icon"===M&&y?e.jsx("span",{style:{display:"flex",alignItems:"center",flexShrink:0},children:o.cloneElement(y,{width:G.avatarSize,height:G.avatarSize})}):null,e.jsx("span",{style:{whiteSpace:"nowrap"},children:i}),"count"===q&&"number"==typeof C&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",paddingLeft:G.countPx,paddingRight:G.countPx,paddingTop:1,paddingBottom:1,background:"rgba(0,0,0,0.07)",borderRadius:3,fontSize:G.countFontSize,fontWeight:500,lineHeight:"16px",flexShrink:0},children:C})]}),"x-close"===q&&e.jsx("button",{"aria-label":"Remove",onClick:function(e){e.stopPropagation(),null==k||k()},style:{display:"flex",alignItems:"center",justifyContent:"center",padding:G.closePad,borderRadius:3,border:"none",background:"transparent",cursor:"pointer",flexShrink:0,color:"inherit",opacity:.55,lineHeight:0},children:e.jsx("svg",{width:G.closeSize,height:G.closeSize,viewBox:"0 0 10 10",fill:"none",children:e.jsx("path",{d:"M7.5 2.5l-5 5M2.5 2.5l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),"after"===O&&y&&!v&&e.jsx("span",{style:{display:"flex",alignItems:"center",flexShrink:0,marginLeft:G.contentGap},children:y})]}))},f="var(--shadow-xs)",h={small:"4px",mediumSmall:"6px",medium:"8px",large:"10px"},b={small:"sm",mediumSmall:"sm",medium:"md",large:"lg"},g={small:{height:"36px",paddingTop:"5px",paddingBottom:"5px"},mediumSmall:{height:"40px",paddingTop:"7px",paddingBottom:"7px"},medium:{height:"44px",paddingTop:"9px",paddingBottom:"9px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px"}},v="var(--shadow-xs)",y=function(o){var r=o.onClick;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:r,style:{cursor:"pointer",flexShrink:0},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},m=o.forwardRef(function(n,i){var l=n.size,a=void 0===l?"mediumSmall":l,d=n.disabled,s=void 0!==d&&d,c=n.error,p=void 0!==c&&c,u=n.readOnly,x=void 0!==u&&u,f=n.prefix,h=n.suffix,b=n.allowClear,m=void 0!==b&&b,F=n.onClear,S=n.className,w=void 0===S?"":S,C=n.style,k=n.type,z=void 0===k?"text":k,j=n.placeholder,E=n.value,B=n.defaultValue,O=n.onChange,D=n.onFocus,P=n.onBlur,I=n.onPressEnter,A=n.label,R=n.required,T=n.hintText,L=t(n,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter","label","required","hintText"]),W=o.useRef(null),H=o.useState(B||E||""),G=H[0],N=H[1],M=o.useState(!1),q=M[0],_=M[1];o.useEffect(function(){"function"==typeof i?i(W.current):i&&(i.current=W.current)},[i]);var V=void 0!==E,K=V?E:G,Y=m&&K&&!s,J=s?{border:"1px solid var(--color-border-disabled)",boxShadow:v,outline:"none"}:p&&q?{border:"1px solid var(--color-border-error)",boxShadow:v,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:p?{border:"1px solid var(--color-border-error_subtle)",boxShadow:v,outline:"none"}:q?{border:"1px solid var(--color-border-brand)",boxShadow:v,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:v,outline:"none"},Q=J.border,U=J.boxShadow,X=J.outline,Z=J.outlineOffset,$=g[a],ee=$.height,oe=$.paddingTop,re=$.paddingBottom,te=r({width:"100%",height:ee,boxSizing:"border-box",fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-md)",fontWeight:400,lineHeight:"var(--line-height-text-md)",borderRadius:"var(--radius-md)",border:Q,boxShadow:U,backgroundColor:s||x?"var(--color-bg-disabled_subtle)":"var(--color-bg-primary)",color:s?"var(--color-text-disabled)":"var(--color-text-primary)",paddingTop:oe,paddingBottom:re,paddingLeft:f?"40px":"14px",paddingRight:h||Y?"40px":"14px",transition:"border-color 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease",outline:X,outlineOffset:Z,WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},C),ne={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:s?"var(--color-fg-disabled)":"var(--color-fg-quaternary)",zIndex:1},ie=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:'\n .aha-input-wrapper input::placeholder {\n color: var(--color-text-placeholder);\n font-size: var(--font-size-text-md);\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-webkit-input-placeholder { color: var(--color-text-placeholder); }\n .aha-input-wrapper input::-moz-placeholder { color: var(--color-text-placeholder); }\n .aha-input-wrapper input:-ms-input-placeholder { color: var(--color-text-placeholder); }\n .aha-input-wrapper input {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n .aha-input-wrapper input[type="number"]::-webkit-inner-spin-button,\n .aha-input-wrapper input[type="number"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n .aha-input-wrapper input[type="number"] { -moz-appearance: textfield; }\n '}),e.jsxs("div",{className:"aha-input-wrapper ".concat(w),style:{position:"relative",display:"block",width:"100%"},children:[f&&e.jsx("span",{style:r(r({},ne),{left:"14px",pointerEvents:"none"}),children:f}),e.jsx("input",r({ref:W,type:z,value:K,placeholder:j,disabled:s,readOnly:x,onChange:function(e){V||N(e.target.value),null==O||O(e)},onFocus:function(e){_(!0),null==D||D(e)},onBlur:function(e){_(!1),null==P||P(e)},onKeyDown:function(e){var o;"Enter"===e.key&&I&&I(e),null===(o=L.onKeyDown)||void 0===o||o.call(L,e)},style:te,autoComplete:L.autoComplete||"off",autoCorrect:L.autoCorrect||"off",autoCapitalize:L.autoCapitalize||"off",spellCheck:L.spellCheck||!1},L)),(h||Y)&&e.jsxs("span",{style:r(r({},ne),{right:"14px",gap:"var(--spacing-xs)"}),children:[Y&&e.jsx(y,{onClick:function(e){var o;e.stopPropagation(),V||N("");null==O||O({target:{value:""},currentTarget:{value:""}}),null==F||F(),null===(o=W.current)||void 0===o||o.focus()}}),h]})]})]});return A||T?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[A&&e.jsxs("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)"},children:[A,R&&e.jsx("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"})]}),ie,T&&e.jsx("p",{style:{margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:p?"var(--color-error-600)":"var(--color-text-tertiary)"},children:T})]}):ie});m.displayName="Input",exports.InputGroup=a,exports.InputTags=function(t){var i=t.value,l=t.defaultValue,a=void 0===l?[]:l,d=t.onChange,s=t.placeholder,c=void 0===s?"Add tag...":s,p=t.disabled,u=void 0!==p&&p,g=t.error,v=void 0!==g&&g,y=t.size,m=void 0===y?"mediumSmall":y,F=t.className,S=void 0===F?"":F,w=t.style,C=t.label,k=t.required,z=t.hintText,j=o.useState(a),E=j[0],B=j[1],O=o.useState(""),D=O[0],P=O[1],I=o.useState(!1),A=I[0],R=I[1],T=o.useRef(null),L=void 0!==i,W=L?i:E,H=function(e){L||B(e),null==d||d(e)},G=function(e){var o=e.trim();o&&!W.includes(o)&&(H(n(n([],W,!0),[o],!1)),P(""))},N=function(e){H(W.filter(function(o,r){return r!==e}))},M=u?{border:"1px solid var(--color-border-disabled)",boxShadow:f,outline:"none"}:v&&A?{border:"1px solid var(--color-border-error)",boxShadow:f,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:v?{border:"1px solid var(--color-border-error_subtle)",boxShadow:f,outline:"none"}:A?{border:"1px solid var(--color-border-brand)",boxShadow:f,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:f,outline:"none"},q=M.border,_=M.boxShadow,V=M.outline,K=M.outlineOffset,Y=h[m],J=b[m],Q=e.jsxs("div",{className:"aha-input-tags ".concat(S),onClick:function(){var e;return null===(e=T.current)||void 0===e?void 0:e.focus()},style:r({display:"flex",flexWrap:"wrap",alignItems:"center",gap:"6px",padding:Y,border:q,boxShadow:_,outline:V,outlineOffset:K,borderRadius:"var(--radius-md)",backgroundColor:u?"var(--color-bg-disabled_subtle)":"var(--color-bg-primary)",boxSizing:"border-box",width:"100%",transition:"border-color 0.15s ease, box-shadow 0.15s ease",cursor:u?"not-allowed":"text"},w),children:[W.map(function(o,r){return e.jsx(x,{size:J,action:u?"none":"x-close",onClose:function(){return N(r)},children:o},r)}),e.jsx("input",{ref:T,value:D,onChange:function(e){return P(e.target.value)},onKeyDown:function(e){"Enter"!==e.key&&","!==e.key||!D||(e.preventDefault(),G(D)),"Backspace"===e.key&&!D&&W.length>0&&N(W.length-1)},onFocus:function(){return R(!0)},onBlur:function(){R(!1),D&&G(D)},disabled:u,placeholder:0===W.length?c:"",style:{flex:1,minWidth:"80px",border:"none",outline:"none",padding:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-md)",lineHeight:"var(--line-height-text-md)",color:u?"var(--color-text-disabled)":"var(--color-text-primary)",backgroundColor:"transparent"}}),e.jsx("style",{children:"\n .aha-input-tags input::placeholder { color: var(--color-text-placeholder); }\n "})]});return C||z?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[C&&e.jsxs("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)"},children:[C,k&&e.jsx("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"})]}),Q,z&&e.jsx("p",{style:{margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:v?"var(--color-error-600)":"var(--color-text-tertiary)"},children:z})]}):Q},exports.default=m;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=function(){return o=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},o.apply(this,arguments)};function n(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}function r(e,t,o){if(o||2===arguments.length)for(var n,r=0,i=t.length;r<i;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var i={primaryColor:"#FB6011"},l=t.createContext(i),a=function(){var e=t.useContext(l);return e||i},d="#1c1917",s="#44403c",c="#57534e",p="#79716b",u="#79716b",x="#d7d3d0",f="#fb6011",h="#f04438",g="#fda29b",b="#d7d3d0",y="#ffffff",m="#fafaf9",F="#a9a29d",v="#a9a29d",C={xs:"12px",sm:"14px",base:"16px",md:"16px",lg:"18px",xl:"20px",displayXs:"24px",displaySm:"30px",displayMd:"36px",displayLg:"48px",displayXl:"60px",display2xl:"72px"},S={xs:"18px",sm:"20px",base:"24px",md:"24px",lg:"28px",xl:"30px",displayXs:"32px",displaySm:"38px",displayMd:"44px",displayLg:"60px",displayXl:"72px",display2xl:"90px"},k={display:'"DM Sans", system-ui, -apple-system, sans-serif',body:'"DM Sans", system-ui, -apple-system, sans-serif',base:'"DM Sans", system-ui, -apple-system, sans-serif'}.body,w=C.md,j=C.sm,z=S.md,D=S.sm,E="8px",P={textPrimary:d,textSecondary:s,textTertiary:c,textDisabled:p,textPlaceholder:u,borderPrimary:x,borderDisabled:b,borderBrand:f,borderError:h,borderErrorSubtle:g,bgPrimary:y,bgDisabledSubtle:m,fgDisabled:v,fgQuaternary:F,error600:"#d92d20"};function B(e){var t=e.disabled,o=void 0!==t&&t,n=e.error,r=void 0!==n&&n,i=e.focused,l=void 0!==i&&i,a=e.brandColor,d=P,s="0px 1px 2px 0px #0a0d120d",c=a||d.borderBrand;return o?{border:"1px solid ".concat(d.borderDisabled),boxShadow:s,outline:"none"}:r&&l?{border:"1px solid ".concat(d.borderError),boxShadow:s,outline:"2px solid ".concat(d.borderError),outlineOffset:"-2px"}:r?{border:"1px solid ".concat(d.borderErrorSubtle),boxShadow:s,outline:"none"}:l?{border:"1px solid ".concat(c),boxShadow:s,outline:"2px solid ".concat(c),outlineOffset:"-2px"}:{border:"1px solid ".concat(d.borderPrimary),boxShadow:s,outline:"none"}}function I(){return{fontFamily:k,fontSize:j,fontWeight:500,lineHeight:D,color:P.textSecondary}}function O(e){return void 0===e&&(e=!1),{margin:0,fontFamily:k,fontSize:j,fontWeight:400,lineHeight:D,color:e?P.error600:P.textTertiary}}function T(e,t,o){return void 0===t&&(t=""),void 0===o&&(o=P.textPlaceholder),"\n ".concat(e,"::placeholder {\n color: ").concat(o,";\n font-size: ").concat(w,";\n font-weight: 400;\n opacity: 1;\n }\n ").concat(e,"::-webkit-input-placeholder { color: ").concat(o,"; }\n ").concat(e,"::-moz-placeholder { color: ").concat(o,"; }\n ").concat(e,":-ms-input-placeholder { color: ").concat(o,"; }\n ").concat(t,"\n ")}var A={small:{pt:"5px",pb:"5px"},mediumSmall:{pt:"7px",pb:"7px"},medium:{pt:"9px",pb:"9px"},large:{pt:"11px",pb:"11px"}},R=t.forwardRef(function(r,i){var l=r.size,d=void 0===l?"mediumSmall":l,s=r.error,c=void 0!==s&&s,p=r.disabled,u=void 0!==p&&p,x=r.readOnly,f=void 0!==x&&x,h=r.prefix,g=r.suffix,b=r.leadingText,y=r.trailingText,m=r.leadingAddon,F=r.trailingAddon,v=r.className,C=void 0===v?"":v,S=r.style,j=r.onFocus,D=r.onBlur,T=r.onKeyDown,R=r.onPressEnter,L=r.value,W=r.defaultValue,G=r.onChange,M=r.placeholder,H=r.type,N=void 0===H?"text":H,q=r.label,V=r.required,K=r.hintText,X=n(r,["size","error","disabled","readOnly","prefix","suffix","leadingText","trailingText","leadingAddon","trailingAddon","className","style","onFocus","onBlur","onKeyDown","onPressEnter","value","defaultValue","onChange","placeholder","type","label","required","hintText"]),Y=t.useRef(null),Q=t.useState(!1),_=Q[0],J=Q[1],U=t.useState(null!=W?W:""),Z=U[0],$=U[1],ee=a().primaryColor;t.useEffect(function(){"function"==typeof i?i(Y.current):i&&(i.current=Y.current)},[i]);var te=void 0!==L,oe=te?L:Z,ne=B({disabled:u,error:c,focused:_,brandColor:ee}),re=ne.border,ie=ne.boxShadow,le=ne.outline,ae=ne.outlineOffset,de=A[d],se=de.pt,ce=de.pb,pe=u?P.borderDisabled:P.borderPrimary,ue=!!h,xe=!!g,fe={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:u?P.fgDisabled:P.fgQuaternary,zIndex:1,pointerEvents:"none"},he={display:"flex",alignItems:"center",paddingTop:se,paddingBottom:ce,paddingLeft:"14px",paddingRight:"12px",color:P.textTertiary,fontFamily:k,fontSize:w,lineHeight:z,whiteSpace:"nowrap",flexShrink:0,backgroundColor:u?P.bgDisabledSubtle:"transparent"},ge=e.jsxs("div",{className:"aha-input-group ".concat(C),style:o({display:"flex",alignItems:"stretch",width:"100%",border:re,boxShadow:ie,outline:le,outlineOffset:ae,borderRadius:E,backgroundColor:u||f?P.bgDisabledSubtle:P.bgPrimary,overflow:"hidden",boxSizing:"border-box",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},S),children:[void 0!==b&&e.jsx("div",{style:o(o({},he),{borderRight:"1px solid ".concat(pe)}),children:b}),void 0!==m&&e.jsx("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderRight:"1px solid ".concat(pe)},children:m}),e.jsxs("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"stretch",minWidth:0},children:[ue&&e.jsx("span",{style:o(o({},fe),{left:"14px"}),children:h}),e.jsx("input",o({ref:Y,type:N,value:oe,placeholder:M,disabled:u,readOnly:f,onChange:function(e){te||$(e.target.value),null==G||G(e)},onFocus:function(e){J(!0),null==j||j(e)},onBlur:function(e){J(!1),null==D||D(e)},onKeyDown:function(e){"Enter"===e.key&&R&&R(e),null==T||T(e)},style:{flex:1,border:"none",outline:"none",width:"100%",boxSizing:"border-box",fontFamily:k,fontSize:w,fontWeight:400,lineHeight:z,backgroundColor:"transparent",color:u?P.textDisabled:P.textPrimary,paddingTop:se,paddingBottom:ce,paddingLeft:ue?"40px":"14px",paddingRight:xe?"40px":"14px"},autoComplete:X.autoComplete||"off"},X)),xe&&e.jsx("span",{style:o(o({},fe),{right:"14px"}),children:g})]}),void 0!==y&&e.jsx("div",{style:o(o({},he),{paddingLeft:"12px",paddingRight:"14px",borderLeft:"1px solid ".concat(pe)}),children:y}),void 0!==F&&e.jsx("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderLeft:"1px solid ".concat(pe)},children:F})]});return q||K?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[q&&e.jsxs("label",{style:I(),children:[q,V&&e.jsx("span",{style:{color:P.error600,marginLeft:"2px"},children:"*"})]}),ge,K&&e.jsx("p",{style:O(c),children:K})]}):ge});R.displayName="InputGroup";var L={Green:{light:{bg:"#ECFDF5",text:"#006045",border:"#A4F4CF"},fill:{bg:"#00BC7D",text:"#FFFFFF"}},Red:{light:{bg:"#FEF2F2",text:"#9F0712",border:"#FFC9C9"},fill:{bg:"#FB2C36",text:"#FFFFFF"}},Orange:{light:{bg:"#FFF6ED",text:"#9B2911",border:"#FFD1A9"},fill:{bg:"#FB6011",text:"#FFFFFF"}},Cyan:{light:{bg:"#ECFEFF",text:"#005F78",border:"#A2F4FD"},fill:{bg:"#00B8DB",text:"#FFFFFF"}},Violet:{light:{bg:"#F5F3FF",text:"#5D0EC0",border:"#DDD6FF"},fill:{bg:"#8E51FF",text:"#FFFFFF"}},Pink:{light:{bg:"#FDF2F8",text:"#A3004C",border:"#FCCEE8"},fill:{bg:"#F6339A",text:"#FFFFFF"}},Gray:{light:{bg:"#F5F5F4",text:"#292524",border:"#E7E5E4"},fill:{bg:"#292524",text:"#FFFFFF"}},Yellow:{light:{bg:"#FFFBEB",text:"#973C00",border:"#FEE685"},fill:{bg:"#FE9A00",text:"#FFFFFF"}},Blue:{light:{bg:"#EFF6FF",text:"#193CB8",border:"#BEDBFF"},fill:{bg:"#2B7FFF",text:"#FFFFFF"}}},W={sm:{basePx:8,basePy:3,plCheckbox:5,plAvatar:4,plDot:6,plIcon:4,prClose:4,prCount:4,fontSize:12,lineHeight:"18px",height:24,avatarSize:16,checkboxSize:14,contentGap:4,rootGap:3,countPx:4,countFontSize:12,closeSize:10,closePad:2},md:{basePx:9,basePy:2,plCheckbox:4,plAvatar:5,plDot:7,plIcon:5,prClose:4,prCount:3,fontSize:14,lineHeight:"20px",height:24,avatarSize:16,checkboxSize:16,contentGap:5,rootGap:4,countPx:5,countFontSize:12,closeSize:12,closePad:2},lg:{basePx:10,basePy:4,plCheckbox:5,plAvatar:7,plDot:9,plIcon:7,prClose:4,prCount:4,fontSize:14,lineHeight:"20px",height:28,avatarSize:18,checkboxSize:18,contentGap:6,rootGap:4,countPx:6,countFontSize:14,closeSize:14,closePad:3}},G=function(o){var n=o.src,r=o.alt,i=void 0===r?"Avatar":r,l=o.size,a=void 0===l?16:l,d=t.useState(!1),s=d[0],c=d[1];return e.jsx("div",{style:{width:a,height:a,borderRadius:"50%",overflow:"hidden",flexShrink:0,border:"0.667px solid rgba(0,0,0,0.08)",background:"#e5e5e4",display:"flex",alignItems:"center",justifyContent:"center"},children:n&&!s?e.jsx("img",{src:n,alt:i,onError:function(){return c(!0)},style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):e.jsxs("svg",{width:.625*a,height:.625*a,viewBox:"0 0 10 10",fill:"none",children:[e.jsx("circle",{cx:"5",cy:"3.5",r:"2",stroke:"#999",strokeWidth:"1.2"}),e.jsx("path",{d:"M1 9.5c0-2.2 1.8-4 4-4s4 1.8 4 4",stroke:"#999",strokeWidth:"1.2",strokeLinecap:"round"})]})})},M=function(r){var i=r.children,l=r.color,d=r.variant,s=void 0===d?"light":d,c=r.size,p=void 0===c?"md":c,u=r.stroke,x=void 0!==u&&u,f=r.iconType,h=r.icon,g=r.avatarSrc,b=r.dotColor,y=r.action,m=void 0===y?"none":y,F=r.count,v=r.onClose,C=r.checkbox,S=void 0!==C&&C,k=r.checked,w=r.onCheckedChange,j=r.iconPosition,z=r.className,D=void 0===z?"":z,E=r.onClick,P=n(r,["children","color","variant","size","stroke","iconType","icon","avatarSrc","dotColor","action","count","onClose","checkbox","checked","onCheckedChange","iconPosition","className","onClick"]),B=a().primaryColor,I=t.useState(!1),O=I[0],T=I[1],A=function(e){return"large"===e?"lg":"small"===e?"sm":e}(p),R=W[A],M=void 0!==k?k:O,H=null!=f?f:h&&"leading"===j?"icon":"none",N="none"!==m?m:void 0,q=S?R.plCheckbox:"dot"===H?R.plDot:"avatar"===H||"icon"===H?R.plAvatar:R.basePx,V="x-close"===N?R.prClose:"count"===N?R.prCount:R.basePx,K={display:"inline-flex",alignItems:"center",gap:"x-close"===N?R.rootGap:0,paddingLeft:q,paddingRight:V,paddingTop:R.basePy,paddingBottom:R.basePy,height:R.height,borderRadius:6,fontFamily:"DM Sans, sans-serif",fontWeight:500,fontSize:R.fontSize,lineHeight:R.lineHeight,transition:"all 0.2s",cursor:E?"pointer":"default",boxSizing:"border-box",backgroundColor:"#ffffff",color:"#44403c",outline:"1px solid #d7d3d0",outlineOffset:"-1px"};if(l){var X=function(e,t){if(e in L){var n=L[e];return"Orange"===e&&t?o(o({},n),{fill:o(o({},n.fill),{bg:t})}):n}if(e.startsWith("#")){var r=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),l=parseInt(e.slice(5,7),16);return{light:{bg:"rgba(".concat(r,",").concat(i,",").concat(l,",0.1)"),text:e,border:"rgba(".concat(r,",").concat(i,",").concat(l,",0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return L.Gray}(l,B);"light"===s?(K.backgroundColor=X.light.bg,K.color=X.light.text,K.outline=x?"1px solid ".concat(function(e){var t={Green:"#A4F4CF",Red:"#FFC9C9",Orange:"#FFD1A9",Blue:"#BEDBFF",Yellow:"#FFD1A9",Cyan:"#A2F4FD",Violet:"#DDD6FF",Pink:"#FCCEE8",Gray:"#E7E5E4"};if(e in t)return t[e];if(e.startsWith("#")){var o=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return"rgba(".concat(o,",").concat(n,",").concat(r,",0.3)")}return"#E7E5E4"}(l)):"none",K.outlineOffset=x?"-1px":void 0):(K.backgroundColor=X.fill.bg,K.color=X.fill.text,K.outline="none")}E&&(K.cursor="pointer");return e.jsxs("div",o({className:D,style:K,onClick:E},P,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R.contentGap,flexShrink:0},children:[S&&e.jsx("div",{role:"checkbox","aria-checked":M,onClick:function(e){e.stopPropagation();var t=!M;void 0===k&&T(t),null==w||w(t)},style:{width:R.checkboxSize,height:R.checkboxSize,borderRadius:4,flexShrink:0,border:M?"none":"1px solid #d7d3d0",background:M?B||"#7F56D9":"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:M&&e.jsx("svg",{width:Math.round(.65*R.checkboxSize),height:Math.round(.65*R.checkboxSize),viewBox:"0 0 10 10",fill:"none",children:e.jsx("path",{d:"M8.5 2L4 7.5 1.5 5",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),"avatar"===H?e.jsx(G,{src:g,size:R.avatarSize}):"dot"===H?e.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",fill:"none",style:{flexShrink:0},children:e.jsx("circle",{cx:4,cy:4,r:3.5,fill:b||"currentColor"})}):"icon"===H&&h?e.jsx("span",{style:{display:"flex",alignItems:"center",flexShrink:0},children:t.cloneElement(h,{width:R.avatarSize,height:R.avatarSize})}):null,e.jsx("span",{style:{whiteSpace:"nowrap"},children:i}),"count"===N&&"number"==typeof F&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",paddingLeft:R.countPx,paddingRight:R.countPx,paddingTop:1,paddingBottom:1,background:"rgba(0,0,0,0.07)",borderRadius:3,fontSize:R.countFontSize,fontWeight:500,lineHeight:"16px",flexShrink:0},children:F})]}),"x-close"===N&&e.jsx("button",{"aria-label":"Remove",onClick:function(e){e.stopPropagation(),null==v||v()},style:{display:"flex",alignItems:"center",justifyContent:"center",padding:R.closePad,borderRadius:3,border:"none",background:"transparent",cursor:"pointer",flexShrink:0,color:"inherit",opacity:.55,lineHeight:0},children:e.jsx("svg",{width:R.closeSize,height:R.closeSize,viewBox:"0 0 10 10",fill:"none",children:e.jsx("path",{d:"M7.5 2.5l-5 5M2.5 2.5l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),"after"===j&&h&&!f&&e.jsx("span",{style:{display:"flex",alignItems:"center",flexShrink:0,marginLeft:R.contentGap},children:h})]}))},H={small:"4px",mediumSmall:"6px",medium:"8px",large:"10px"},N={small:"sm",mediumSmall:"sm",medium:"md",large:"lg"},q={small:{height:"36px",paddingTop:"5px",paddingBottom:"5px"},mediumSmall:{height:"40px",paddingTop:"7px",paddingBottom:"7px"},medium:{height:"44px",paddingTop:"9px",paddingBottom:"9px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px"}},V=function(t){var o=t.onClick;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:o,style:{cursor:"pointer",flexShrink:0},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},K=t.forwardRef(function(r,i){var l=r.size,d=void 0===l?"mediumSmall":l,s=r.disabled,c=void 0!==s&&s,p=r.error,u=void 0!==p&&p,x=r.readOnly,f=void 0!==x&&x,h=r.prefix,g=r.suffix,b=r.allowClear,y=void 0!==b&&b,m=r.onClear,F=r.className,v=void 0===F?"":F,C=r.style,S=r.type,j=void 0===S?"text":S,D=r.placeholder,A=r.value,R=r.defaultValue,L=r.onChange,W=r.onFocus,G=r.onBlur,M=r.onPressEnter,H=r.label,N=r.required,K=r.hintText,X=n(r,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter","label","required","hintText"]),Y=t.useRef(null),Q=t.useState(R||A||""),_=Q[0],J=Q[1],U=t.useState(!1),Z=U[0],$=U[1],ee=a().primaryColor;t.useEffect(function(){"function"==typeof i?i(Y.current):i&&(i.current=Y.current)},[i]);var te=void 0!==A,oe=te?A:_,ne=y&&oe&&!c,re=B({disabled:c,error:u,focused:Z,brandColor:ee}),ie=q[d],le=ie.height,ae=ie.paddingTop,de=ie.paddingBottom,se=h?"40px":"14px",ce=g||ne?"40px":"14px",pe=o(o(o({width:"100%",height:le,boxSizing:"border-box",fontFamily:k,fontSize:w,fontWeight:400,lineHeight:z,borderRadius:E},re),{backgroundColor:c||f?P.bgDisabledSubtle:P.bgPrimary,color:c?P.textDisabled:P.textPrimary,paddingTop:ae,paddingBottom:de,paddingLeft:se,paddingRight:ce,transition:"border-color 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"}),C),ue=T(".aha-input-wrapper input",'\n .aha-input-wrapper input {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n .aha-input-wrapper input[type="number"]::-webkit-inner-spin-button,\n .aha-input-wrapper input[type="number"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n .aha-input-wrapper input[type="number"] { -moz-appearance: textfield; }\n '),xe={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:c?P.fgDisabled:P.fgQuaternary,zIndex:1},fe=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:ue}),e.jsxs("div",{className:"aha-input-wrapper ".concat(v),style:{position:"relative",display:"block",width:"100%"},children:[h&&e.jsx("span",{style:o(o({},xe),{left:"14px",pointerEvents:"none"}),children:h}),e.jsx("input",o({ref:Y,type:j,value:oe,placeholder:D,disabled:c,readOnly:f,onChange:function(e){te||J(e.target.value),null==L||L(e)},onFocus:function(e){$(!0),null==W||W(e)},onBlur:function(e){$(!1),null==G||G(e)},onKeyDown:function(e){var t;"Enter"===e.key&&M&&M(e),null===(t=X.onKeyDown)||void 0===t||t.call(X,e)},style:pe,autoComplete:X.autoComplete||"off",autoCorrect:X.autoCorrect||"off",autoCapitalize:X.autoCapitalize||"off",spellCheck:X.spellCheck||!1},X)),(g||ne)&&e.jsxs("span",{style:o(o({},xe),{right:"14px",gap:"4px"}),children:[ne&&e.jsx(V,{onClick:function(e){var t;e.stopPropagation(),te||J("");null==L||L({target:{value:""},currentTarget:{value:""}}),null==m||m(),null===(t=Y.current)||void 0===t||t.focus()}}),g]})]})]});return H||K?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[H&&e.jsxs("label",{style:I(),children:[H,N&&e.jsx("span",{style:{color:P.error600,marginLeft:"2px"},children:"*"})]}),fe,K&&e.jsx("p",{style:O(u),children:K})]}):fe});K.displayName="Input",exports.InputGroup=R,exports.InputTags=function(n){var i=n.value,l=n.defaultValue,d=void 0===l?[]:l,s=n.onChange,c=n.placeholder,p=void 0===c?"Add tag...":c,u=n.disabled,x=void 0!==u&&u,f=n.error,h=void 0!==f&&f,g=n.size,b=void 0===g?"mediumSmall":g,y=n.className,m=void 0===y?"":y,F=n.style,v=n.label,C=n.required,S=n.hintText,j=t.useState(d),D=j[0],A=j[1],R=t.useState(""),L=R[0],W=R[1],G=t.useState(!1),q=G[0],V=G[1],K=t.useRef(null),X=a().primaryColor,Y=void 0!==i,Q=Y?i:D,_=function(e){Y||A(e),null==s||s(e)},J=function(e){var t=e.trim();t&&!Q.includes(t)&&(_(r(r([],Q,!0),[t],!1)),W(""))},U=function(e){_(Q.filter(function(t,o){return o!==e}))},Z=B({disabled:x,error:h,focused:q,brandColor:X}),$=Z.border,ee=Z.boxShadow,te=Z.outline,oe=Z.outlineOffset,ne=H[b],re=N[b],ie=e.jsxs("div",{className:"aha-input-tags ".concat(m),onClick:function(){var e;return null===(e=K.current)||void 0===e?void 0:e.focus()},style:o({display:"flex",flexWrap:"wrap",alignItems:"center",gap:"6px",padding:ne,border:$,boxShadow:ee,outline:te,outlineOffset:oe,borderRadius:E,backgroundColor:x?P.bgDisabledSubtle:P.bgPrimary,boxSizing:"border-box",width:"100%",transition:"border-color 0.15s ease, box-shadow 0.15s ease",cursor:x?"not-allowed":"text"},F),children:[Q.map(function(t,o){return e.jsx(M,{size:re,action:x?"none":"x-close",onClose:function(){return U(o)},children:t},o)}),e.jsx("input",{ref:K,value:L,onChange:function(e){return W(e.target.value)},onKeyDown:function(e){"Enter"!==e.key&&","!==e.key||!L||(e.preventDefault(),J(L)),"Backspace"===e.key&&!L&&Q.length>0&&U(Q.length-1)},onFocus:function(){return V(!0)},onBlur:function(){V(!1),L&&J(L)},disabled:x,placeholder:0===Q.length?p:"",style:{flex:1,minWidth:"80px",border:"none",outline:"none",padding:0,fontFamily:k,fontSize:w,lineHeight:z,color:x?P.textDisabled:P.textPrimary,backgroundColor:"transparent"}}),e.jsx("style",{children:T(".aha-input-tags input")})]});return v||S?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[v&&e.jsxs("label",{style:I(),children:[v,C&&e.jsx("span",{style:{color:P.error600,marginLeft:"2px"},children:"*"})]}),ie,S&&e.jsx("p",{style:O(h),children:S})]}):ie},exports.default=K;
2
2
  //# sourceMappingURL=Input.js.map