aha-components 1.8.3 → 1.8.4
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/Avatar.esm.js.map +1 -1
- package/dist/Avatar.js.map +1 -1
- package/dist/Badge.esm.js.map +1 -1
- package/dist/Badge.js.map +1 -1
- package/dist/Button.esm.js +1 -1
- package/dist/Button.esm.js.map +1 -1
- package/dist/Button.js +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Checkbox.esm.js.map +1 -1
- package/dist/Checkbox.js.map +1 -1
- package/dist/DatePicker.esm.js.map +1 -1
- package/dist/DatePicker.js.map +1 -1
- package/dist/Drawer.esm.js.map +1 -1
- package/dist/Drawer.js.map +1 -1
- package/dist/Form.esm.js.map +1 -1
- package/dist/Form.js.map +1 -1
- package/dist/Input.esm.js.map +1 -1
- package/dist/Input.js.map +1 -1
- package/dist/MenuList.esm.js.map +1 -1
- package/dist/MenuList.js.map +1 -1
- package/dist/Pagination.esm.js +1 -1
- package/dist/Pagination.esm.js.map +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/Pagination.js.map +1 -1
- package/dist/Popover.esm.js.map +1 -1
- package/dist/Popover.js.map +1 -1
- package/dist/Progress.esm.js.map +1 -1
- package/dist/Progress.js.map +1 -1
- package/dist/Radio.esm.js.map +1 -1
- package/dist/Radio.js.map +1 -1
- package/dist/Select.esm.js.map +1 -1
- package/dist/Select.js.map +1 -1
- package/dist/Switch.esm.js.map +1 -1
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.esm.js.map +1 -1
- package/dist/Tab.js.map +1 -1
- package/dist/Table.esm.js +1 -1
- package/dist/Table.esm.js.map +1 -1
- package/dist/Table.js +1 -1
- package/dist/Table.js.map +1 -1
- package/dist/Tag.esm.js.map +1 -1
- package/dist/Tag.js.map +1 -1
- package/dist/Textarea.esm.js.map +1 -1
- package/dist/Textarea.js.map +1 -1
- package/dist/Toast.esm.js.map +1 -1
- package/dist/Toast.js.map +1 -1
- package/dist/Tooltip.esm.js.map +1 -1
- package/dist/Tooltip.js.map +1 -1
- package/dist/components/Alert/icon.d.ts +5 -5
- package/dist/components/Button/index.d.ts +2 -2
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Toast/icon.d.ts +5 -5
- package/dist/index.css +1924 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.esm.css +1924 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/Pagination.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as o,Fragment as r}from"react/jsx-runtime";import n,{createContext as t,useContext as i,useState as a,forwardRef as l,useRef as d,useEffect as s,useCallback as c,useMemo as p}from"react";import{createPortal as u}from"react-dom";var f=function(){return f=Object.assign||function(e){for(var o,r=1,n=arguments.length;r<n;r++)for(var t in o=arguments[r])Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t]);return e},f.apply(this,arguments)};function h(e,o){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)o.indexOf(n[t])<0&&Object.prototype.propertyIsEnumerable.call(e,n[t])&&(r[n[t]]=e[n[t]])}return r}function g(e,o,r){if(r||2===arguments.length)for(var n,t=0,i=o.length;t<i;t++)!n&&t in o||(n||(n=Array.prototype.slice.call(o,0,t)),n[t]=o[t]);return e.concat(n||Array.prototype.slice.call(o))}"function"==typeof SuppressedError&&SuppressedError;var x={primaryColor:"#FB6011"},v=t(x),m=function(){var e=i(v);return e||x},b={sm:"sm",md:"md",lg:"lg",xl:"xl",small:"sm",mediumSmall:"sm",medium:"md",large:"xl"},y={primary:"primary",secondary:"secondary",tertiary:"tertiary","link-color":"link-color","link-gray":"link-gray","destructive-primary":"destructive-primary","destructive-secondary":"destructive-secondary","destructive-tertiary":"destructive-tertiary","destructive-link":"destructive-link",default:"secondary"},w={sm:{height:36,paddingX:12,paddingXLg:12,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:8},md:{height:40,paddingX:14,paddingXLg:14,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:10},lg:{height:44,paddingX:16,paddingXLg:16,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:12},xl:{height:48,paddingX:18,paddingXLg:18,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:14}},S=function(n){var t=n.size,i=n.color;return e(r,{children:[o("style",{children:"@keyframes aha-button-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}"}),e("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-button-spin 1s linear infinite",flexShrink:0},children:[o("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",opacity:"0.25"}),o("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:i,strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})]})},k=function(r){var n=r.children,t=r.type,i=void 0===t?"secondary":t,l=r.size,d=void 0===l?"md":l,s=r.disabled,c=void 0!==s&&s,p=r.loading,u=void 0!==p&&p,g=r.iconOnly,x=r.focused,v=void 0!==x&&x,k=r.onClick,C=r.htmlType,z=void 0===C?"button":C,F=r.className,L=void 0===F?"":F,A=r.style,E=r.icon,B=r.iconPosition,O=void 0===B?"left":B,W=h(r,["children","type","size","disabled","loading","iconOnly","focused","onClick","htmlType","className","style","icon","iconPosition"]),M=m().primaryColor,H=a(!1),T=H[0],D=H[1],I=a(!1),R=I[0],j=I[1],N=y[i]||"secondary",P=w[b[d]||"md"],_=null!=g?g:!!E&&null==n,q="link-color"===N||"link-gray"===N||"destructive-link"===N,X=c||u,Y=v,V=M,K=function(){if(c)return"primary"===N||"secondary"===N||"destructive-primary"===N||"destructive-secondary"===N?{bg:"var(--color-bg-disabled, #f5f5f4)",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"1px solid var(--color-border-disabled_subtle, #e7e5e4)",boxShadow:"none"}:{bg:"transparent",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"none",boxShadow:"none"};var e=T||R;return"primary"===N?{bg:e?"var(--color-bg-brand-solid_hover, #ec470a)":V||"var(--color-bg-brand-solid, #fb6011)",color:"var(--color-text-white, #ffffff)",iconColor:"var(--color-brand-300, #feb073)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic, 0 1px 2px 0 rgba(10,13,18,.05))"}:"secondary"===N?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",color:e?"var(--color-text-secondary_hover, #292524)":"var(--color-text-secondary, #44403c)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"tertiary"===N?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none"}:"link-color"===N?{bg:"transparent",color:e?"var(--color-text-brand-secondary_hover, #c4330a)":"var(--color-text-brand-secondary, #ec470a)",iconColor:"var(--color-fg-brand-secondary_alt, #fb6011)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"link-gray"===N?{bg:"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"destructive-primary"===N?{bg:e?"var(--color-error-600)":"var(--color-error-500)",color:"var(--color-text-white)",iconColor:e?"var(--color-error-200)":"var(--color-error-300)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"destructive-secondary"===N?{bg:e?"var(--color-bg-error-primary)":"var(--color-bg-primary)",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"inset 0 0 0 1px var(--color-border-error_subtle), inset 0 -2px 0 0 rgba(10,13,18,0.05), 0 1px 2px 0 rgba(10,13,18,0.05)"}:"destructive-tertiary"===N?{bg:e?"var(--color-bg-error-primary)":"transparent",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none"}:{bg:"transparent",color:e?"var(--color-text-error-primary_hover)":"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}}(),G=function(){if(Y)return"destructive-primary"===N||"destructive-secondary"===N||"destructive-tertiary"===N||"destructive-link"===N?"destructive-primary"===N||"destructive-secondary"===N?"var(--focus-ring-error-shadow-xs-skeuomorphic)":"var(--focus-ring-error)":"primary"===N||"secondary"===N?"var(--focus-ring-shadow-xs-skeuomorphic, 0 0 0 2px #fff, 0 0 0 4px #fb6011)":"var(--focus-ring, 0 0 0 2px #fff, 0 0 0 4px #fb6011)"}(),U=f({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:P.gap,fontFamily:'var(--font-family-body, "DM Sans", system-ui, sans-serif)',fontWeight:600,fontSize:P.fontSize,lineHeight:"".concat(P.lineHeight,"px"),cursor:X?"not-allowed":"pointer",outline:"none",transition:"background-color .15s ease, color .15s ease, box-shadow .15s ease",userSelect:"none",WebkitTapHighlightColor:"transparent",whiteSpace:"nowrap",backgroundColor:K.bg,color:K.color,border:K.border,boxShadow:null!=G?G:K.boxShadow,textDecoration:K.textDecoration},A);q?(U.borderRadius="4px",U.overflow="hidden",_?(U.width=P.height,U.height=P.height,U.padding=0):(U.height=P.height,U.paddingLeft=P.paddingX,U.paddingRight=P.paddingX)):(U.borderRadius="var(--radius-md, 8px)",_?(U.width=P.height,U.height=P.height,U.padding=0):(U.height=P.height,U.paddingLeft=P.paddingX,U.paddingRight=P.paddingX));var J=function(){return u?o(S,{size:P.iconSize,color:K.iconColor}):E?o("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:P.iconSize,height:P.iconSize,color:K.iconColor,flexShrink:0},children:E}):null},Q=u||E&&"left"===O,Z=!u&&E&&"right"===O;return e("button",f({type:z,className:["aha-button","aha-button--".concat(N),"aha-button--".concat(b[d]||"md"),_&&"aha-button--icon-only",X&&"aha-button--disabled",u&&"aha-button--loading",Y&&"aha-button--focused",L].filter(Boolean).join(" "),disabled:X,onClick:function(e){X?e.preventDefault():null==k||k(e)},onMouseEnter:function(){return!X&&D(!0)},onMouseLeave:function(){D(!1),j(!1)},onMouseDown:function(){return!X&&j(!0)},onMouseUp:function(){return j(!1)},style:U},W,{children:[Q&&J(),!_&&n,Z&&J(),_&&!E&&!u&&n]}))};k.displayName="Button";var C="var(--shadow-xs)",z={small:{pt:"5px",pb:"5px"},mediumSmall:{pt:"7px",pb:"7px"},medium:{pt:"9px",pb:"9px"},large:{pt:"11px",pb:"11px"}};l(function(r,n){var t=r.size,i=void 0===t?"mediumSmall":t,l=r.error,c=void 0!==l&&l,p=r.disabled,u=void 0!==p&&p,g=r.readOnly,x=void 0!==g&&g,v=r.prefix,m=r.suffix,b=r.leadingText,y=r.trailingText,w=r.leadingAddon,S=r.trailingAddon,k=r.className,F=void 0===k?"":k,L=r.style,A=r.onFocus,E=r.onBlur,B=r.onKeyDown,O=r.onPressEnter,W=r.value,M=r.defaultValue,H=r.onChange,T=r.placeholder,D=r.type,I=void 0===D?"text":D,R=r.label,j=r.required,N=r.hintText,P=h(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"]),_=d(null),q=a(!1),X=q[0],Y=q[1],V=a(null!=M?M:""),K=V[0],G=V[1];s(function(){"function"==typeof n?n(_.current):n&&(n.current=_.current)},[n]);var U=void 0!==W,J=U?W:K,Q=u?{border:"1px solid var(--color-border-disabled)",boxShadow:C,outline:"none"}:c&&X?{border:"1px solid var(--color-border-error)",boxShadow:C,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:c?{border:"1px solid var(--color-border-error_subtle)",boxShadow:C,outline:"none"}:X?{border:"1px solid var(--color-border-brand)",boxShadow:C,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:C,outline:"none"},Z=Q.border,$=Q.boxShadow,ee=Q.outline,oe=Q.outlineOffset,re=z[i],ne=re.pt,te=re.pb,ie=u?"var(--color-border-disabled)":"var(--color-border-primary)",ae=!!v,le=!!m,de={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:u?"var(--color-fg-disabled)":"var(--color-fg-quaternary)",zIndex:1,pointerEvents:"none"},se={display:"flex",alignItems:"center",paddingTop:ne,paddingBottom:te,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:u?"var(--color-bg-disabled_subtle)":"transparent"},ce=e("div",{className:"aha-input-group ".concat(F),style:f({display:"flex",alignItems:"stretch",width:"100%",border:Z,boxShadow:$,outline:ee,outlineOffset:oe,borderRadius:"var(--radius-md)",backgroundColor:u||x?"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"},L),children:[void 0!==b&&o("div",{style:f(f({},se),{borderRight:"1px solid ".concat(ie)}),children:b}),void 0!==w&&o("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderRight:"1px solid ".concat(ie)},children:w}),e("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"stretch",minWidth:0},children:[ae&&o("span",{style:f(f({},de),{left:"14px"}),children:v}),o("input",f({ref:_,type:I,value:J,placeholder:T,disabled:u,readOnly:x,onChange:function(e){U||G(e.target.value),null==H||H(e)},onFocus:function(e){Y(!0),null==A||A(e)},onBlur:function(e){Y(!1),null==E||E(e)},onKeyDown:function(e){"Enter"===e.key&&O&&O(e),null==B||B(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:u?"var(--color-text-disabled)":"var(--color-text-primary)",paddingTop:ne,paddingBottom:te,paddingLeft:ae?"40px":"14px",paddingRight:le?"40px":"14px"},autoComplete:P.autoComplete||"off"},P)),le&&o("span",{style:f(f({},de),{right:"14px"}),children:m})]}),void 0!==y&&o("div",{style:f(f({},se),{paddingLeft:"12px",paddingRight:"14px",borderLeft:"1px solid ".concat(ie)}),children:y}),void 0!==S&&o("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderLeft:"1px solid ".concat(ie)},children:S})]});if(!R&&!N)return ce;var pe={margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:c?"var(--color-error-600)":"var(--color-text-tertiary)"};return e("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[R&&e("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)"},children:[R,j&&o("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"})]}),ce,N&&o("p",{style:pe,children:N})]})}).displayName="InputGroup";var F={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"}},L="var(--shadow-xs)",A=function(e){var r=e.onClick;return o("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:o("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},E=l(function(t,i){var a=t.size,l=void 0===a?"mediumSmall":a,c=t.disabled,p=void 0!==c&&c,u=t.error,g=void 0!==u&&u,x=t.readOnly,v=void 0!==x&&x,m=t.prefix,b=t.suffix,y=t.allowClear,w=void 0!==y&&y,S=t.onClear,k=t.className,C=void 0===k?"":k,z=t.style,E=t.type,B=void 0===E?"text":E,O=t.placeholder,W=t.value,M=t.defaultValue,H=t.onChange,T=t.onFocus,D=t.onBlur,I=t.onPressEnter,R=t.label,j=t.required,N=t.hintText,P=h(t,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter","label","required","hintText"]),_=d(null),q=n.useState(M||W||""),X=q[0],Y=q[1],V=n.useState(!1),K=V[0],G=V[1];s(function(){"function"==typeof i?i(_.current):i&&(i.current=_.current)},[i]);var U=void 0!==W,J=U?W:X,Q=w&&J&&!p,Z=p?{border:"1px solid var(--color-border-disabled)",boxShadow:L,outline:"none"}:g&&K?{border:"1px solid var(--color-border-error)",boxShadow:L,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:g?{border:"1px solid var(--color-border-error_subtle)",boxShadow:L,outline:"none"}:K?{border:"1px solid var(--color-border-brand)",boxShadow:L,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:L,outline:"none"},$=Z.border,ee=Z.boxShadow,oe=Z.outline,re=Z.outlineOffset,ne=F[l],te=ne.height,ie=ne.paddingTop,ae=ne.paddingBottom,le=f({width:"100%",height:te,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:$,boxShadow:ee,backgroundColor:p||v?"var(--color-bg-disabled_subtle)":"var(--color-bg-primary)",color:p?"var(--color-text-disabled)":"var(--color-text-primary)",paddingTop:ie,paddingBottom:ae,paddingLeft:m?"40px":"14px",paddingRight:b||Q?"40px":"14px",transition:"border-color 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease",outline:oe,outlineOffset:re,WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},z),de={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:p?"var(--color-fg-disabled)":"var(--color-fg-quaternary)",zIndex:1},se=e(r,{children:[o("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("div",{className:"aha-input-wrapper ".concat(C),style:{position:"relative",display:"block",width:"100%"},children:[m&&o("span",{style:f(f({},de),{left:"14px",pointerEvents:"none"}),children:m}),o("input",f({ref:_,type:B,value:J,placeholder:O,disabled:p,readOnly:v,onChange:function(e){U||Y(e.target.value),null==H||H(e)},onFocus:function(e){G(!0),null==T||T(e)},onBlur:function(e){G(!1),null==D||D(e)},onKeyDown:function(e){var o;"Enter"===e.key&&I&&I(e),null===(o=P.onKeyDown)||void 0===o||o.call(P,e)},style:le,autoComplete:P.autoComplete||"off",autoCorrect:P.autoCorrect||"off",autoCapitalize:P.autoCapitalize||"off",spellCheck:P.spellCheck||!1},P)),(b||Q)&&e("span",{style:f(f({},de),{right:"14px",gap:"var(--spacing-xs)"}),children:[Q&&o(A,{onClick:function(e){var o;e.stopPropagation(),U||Y("");null==H||H({target:{value:""},currentTarget:{value:""}}),null==S||S(),null===(o=_.current)||void 0===o||o.focus()}}),b]})]})]});return R||N?e("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[R&&e("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)"},children:[R,j&&o("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"})]}),se,N&&o("p",{style:{margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:g?"var(--color-error-600)":"var(--color-text-tertiary)"},children:N})]}):se});E.displayName="Input";var B=function(t){var i,l=t.value,h=t.defaultValue,x=t.options,v=void 0===x?[]:x,b=t.mode,y=t.disabled,w=void 0!==y&&y,S=t.error,k=void 0!==S&&S,C=t.placeholder,z=void 0===C?"Please select":C,F=t.size,L=void 0===F?"medium":F,A=t.showSearch,E=void 0!==A&&A,B=t.filterOption,O=void 0===B||B,W=t.allowClear,M=void 0!==W&&W,H=t.onChange,T=t.onSelect,D=t.onDeselect,I=t.onSearch,R=t.onFocus,j=t.onBlur,N=t.onDropdownVisibleChange,P=t.className,_=void 0===P?"":P,q=t.style,X=t.dropdownClassName,Y=void 0===X?"":X,V=t.dropdownStyle,K=t.defaultOpen,G=void 0!==K&&K,U=t.open,J=t.maxTagCount,Q=t.tagRender,Z=t.optionRender,$=m().primaryColor,ee=void 0===$?"#FB6011":$,oe=a(void 0!==h?h:b?[]:void 0),re=oe[0],ne=oe[1],te=a(G),ie=te[0],ae=te[1],le=a(""),de=le[0],se=le[1],ce=a(-1),pe=ce[0],ue=ce[1],fe=d(null),he=d(null),ge=d(null),xe=a(null),ve=xe[0],me=xe[1],be=void 0!==l,ye=void 0!==U,we=be?l:re,Se=ye?U:ie,ke="multiple"===b||"tags"===b,Ce=c(function(){if(!we)return[];var e=Array.isArray(we)?we:[we];return v.filter(function(o){return e.includes(o.value)})},[we,v]),ze=c(function(){return E&&de?!1===O?v:"function"==typeof O?v.filter(function(e){return O(de,e)}):v.filter(function(e){var o=String(e.label||"").toLowerCase(),r=de.toLowerCase();return o.includes(r)}):v},[v,de,E,O]),Fe=p(function(){return ze()},[ze]);s(function(){if(Se&&fe.current){var e=function(){var e,o;if(fe.current){var r=fe.current.getBoundingClientRect(),n=null!==(o=null===(e=ge.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==o?o:Math.min(256,Math.max(40,40*Fe.length)),t=window.innerHeight-r.bottom,i=r.top,a=t<n+4&&i>t,l=a?r.top+window.scrollY-n-4:r.bottom+window.scrollY+4;me({top:l,left:r.left+window.scrollX,width:r.width,placement:a?"top":"bottom"})}};return e(),requestAnimationFrame(e),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}me(null)},[Se,Fe.length]),s(function(){var e=function(e){var o=e.target;fe.current&&!fe.current.contains(o)&&ge.current&&!ge.current.contains(o)&&(ye||ae(!1),null==N||N(!1),se(""))};if(Se)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Se,ye,N]),s(function(){if(Se){var e=function(e){var o;if("ArrowDown"===e.key)e.preventDefault(),ue(function(e){return e<Fe.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),ue(function(e){return e>0?e-1:0});else if("Enter"===e.key&&pe>=0){e.preventDefault();var r=Fe[pe];r&&!r.disabled&&Le(r)}else"Escape"===e.key&&(e.preventDefault(),ye||ae(!1),null==N||N(!1),null===(o=fe.current)||void 0===o||o.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[Se,Fe,pe,ye,N]),s(function(){if(pe>=0&&ge.current){var e=ge.current.querySelectorAll(".aha-select-option")[pe];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[pe]);var Le=c(function(e){var o;if(!e.disabled)if(ke){var r,n=Array.isArray(we)?we:[];n.includes(e.value)?(r=n.filter(function(o){return o!==e.value}),null==D||D(e.value,e)):(r=g(g([],n,!0),[e.value],!1),null==T||T(e.value,e)),be||ne(r);var t=v.filter(function(e){return r.includes(e.value)});null==H||H(r,t)}else be||ne(e.value),null==H||H(e.value,e),null==T||T(e.value,e),ye||ae(!1),null==N||N(!1),se(""),null===(o=fe.current)||void 0===o||o.focus()},[ke,we,be,ye,v,H,T,D,N]),Ae=c(function(e,o){if(e.stopPropagation(),ke&&Array.isArray(we)){var r=we.filter(function(e){return e!==o}),n=v.find(function(e){return e.value===o});be||ne(r),null==H||H(r,Ce()),null==D||D(o,n)}},[ke,we,be,v,H,D,Ce]),Ee=function(e){e.stopPropagation();var o=ke?[]:void 0;be||ne(o),null==H||H(o,[]),se("")},Be={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},Oe=p(function(){return Ce()},[Ce]),We=p(function(){return M&&we&&!w},[M,we,w]),Me=p(function(){return ke?Array.isArray(we)&&we.length>0:null!=we&&""!==we},[ke,we]),He=p(function(){if(!ke||!Array.isArray(we)||0===we.length)return null;var r="responsive"===J?Oe.slice(0,2):J?Oe.slice(0,J):Oe,t=J&&Oe.length>r.length?Oe.length-r.length:0;return e("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[r.map(function(r){var t={label:r.label,value:r.value,closable:!w,onClose:function(){return Ae({},r.value)}};return Q?o(n.Fragment,{children:Q(t)},r.value):e("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"#F5F5F4",borderRadius:"4px",fontSize:"12px",lineHeight:"18px",color:"#101828",fontFamily:"DM Sans, sans-serif",maxWidth:"100%"},children:[o("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.label}),!w&&o("span",{onClick:function(e){return Ae(e,r.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:o("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},r.value)}),t>0&&e("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",t]})]})},[ke,we,Oe,J,w,Q]);return e(r,{children:[o("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e("div",{ref:fe,className:"aha-select ".concat(_),style:f({position:"relative",display:"inline-flex",alignItems:"center",width:"100%",minWidth:"120px",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(k?"#F04438":Se?ee:"#D7D3D0"),backgroundColor:w?"#FAFAF9":"#FFFFFF",cursor:w?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:Be[L].paddingTop,paddingBottom:Be[L].paddingBottom,fontSize:Be[L].fontSize,lineHeight:Be[L].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},q),onClick:function(){if(!w){var e=!Se;ye||ae(e),null==N||N(e),e&&E?setTimeout(function(){var e;null===(e=he.current)||void 0===e||e.focus()},0):se("")}},onFocus:function(e){null==R||R(e)},onBlur:function(e){null==j||j(e)},onTouchStart:function(e){w||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:w?-1:0,children:[o("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:ke?He||o("span",z?{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:z}:{style:{flex:1,minHeight:"24px"}}):E&&Se?o("input",{ref:he,type:"text",value:de,onChange:function(e){var o=e.target.value;se(o),null==I||I(o),ue(-1)},onClick:function(e){return e.stopPropagation()},onFocus:function(e){return e.stopPropagation()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:w?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Me?void 0:z,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):o("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Me?w?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Me?(null===(i=Oe[0])||void 0===i?void 0:i.label)||we:z||" "})}),e("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[We&&o(function(){return o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:Ee,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:o("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),o(function(e){var r=e.isOpen;return o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:r?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out",flexShrink:0},children:o("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:Se})]})]}),Se&&ve&&u(o("div",{ref:ge,className:"aha-select-dropdown ".concat(Y),style:f({position:"absolute",top:"".concat(ve.top,"px"),left:"".concat(ve.left,"px"),width:"".concat(ve.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"top"===ve.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===ve.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},V),children:0===Fe.length?o("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):Fe.map(function(r,n){var t=ke?Array.isArray(we)&&we.includes(r.value):we===r.value,i=n===pe;return Z?o("div",{className:"aha-select-option ".concat(r.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(t?"bg-[#FAFAF9]":""),onClick:function(){return!r.disabled&&Le(r)},style:{cursor:r.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:Z(r,{selected:t,focused:i,disabled:r.disabled||!1})},r.value):e("div",{className:"aha-select-option ".concat(r.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(t?"bg-[#FAFAF9]":""),onClick:function(){return Le(r)},style:{padding:"8px 16px",cursor:r.disabled?"not-allowed":"pointer",color:r.disabled?"#98A2B3":"#101828",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.2s"},children:[o("span",{children:r.label}),t&&o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i?"hidden":"",children:o("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:ee,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},r.value)})}),document.body)]})};B.displayName="Select";var O=function(e){var r=e.className,n=e.style;return o("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r,style:n,children:o("path",{d:"M15.8334 10H4.16675M4.16675 10L10.0001 15.8334M4.16675 10L10.0001 4.16669",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},W=function(e){var r=e.className,n=e.style;return o("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r,style:n,children:o("path",{d:"M4.16675 10H15.8334M15.8334 10L10.0001 4.16669M15.8334 10L10.0001 15.8334",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},M=function(n){var t=n.current,i=n.defaultCurrent,l=void 0===i?1:i,d=n.total,c=void 0===d?0:d,u=n.pageSize,h=n.defaultPageSize,g=void 0===h?10:h,x=n.showSizeChanger,v=void 0!==x&&x,b=n.pageSizeOptions,y=void 0===b?["10","20","50","100"]:b,w=n.showQuickJumper,S=void 0!==w&&w,C=n.showTotal,z=n.onChange,F=n.onShowSizeChange,L=n.simple,A=void 0!==L&&L,M=n.disabled,H=void 0!==M&&M,T=n.hideOnSinglePage,D=void 0!==T&&T,I=n.className,R=void 0===I?"":I,j=n.style,N=n.size,P=void 0===N?"default":N,_=n.responsive,q=void 0!==_&&_;n.showLessItems;var X=n.itemRender,Y=m().primaryColor,V=void 0===Y?"#FB6011":Y,K=a(l),G=K[0],U=K[1],J=a(g),Q=J[0],Z=J[1],$=a(""),ee=$[0],oe=$[1],re=null!=t?t:G,ne=null!=u?u:Q,te=p(function(){return Math.ceil(c/ne)},[c,ne]);s(function(){void 0!==t&&U(t)},[t]),s(function(){void 0!==u&&Z(u)},[u]);var ie=function(e){e<1||e>te||e===re||H||(void 0===t&&U(e),null==z||z(e,ne))},ae=function(){var e=parseInt(ee,10);e>=1&&e<=te&&(ie(e),oe(""))};if(D&&te<=1)return null;if(A)return e("div",{className:"aha-pagination aha-pagination-simple ".concat(R),style:j,children:[o(k,{onClick:function(){return ie(re-1)},disabled:H||1===re,type:"default",size:"default"===P?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:o(O,{})}),e("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[re," / ",te]}),o(k,{onClick:function(){return ie(re+1)},disabled:H||re===te,type:"default",size:"default"===P?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:o(W,{})})]});var le=(re-1)*ne+1,de=Math.min(re*ne,c);return e("div",{className:"aha-pagination w-full ".concat(R),style:f({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:q?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},j),children:[C&&o("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:C(c,[le,de])}),e("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[c>0&&o(r,{children:X?X(re-1,"prev",o(k,{onClick:function(){return ie(re-1)},disabled:H||1===re,type:"default",size:"default"===P?"medium":"small",style:{height:"small"===P?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:o(O,{})})):o(k,{onClick:function(){return ie(re-1)},disabled:H||1===re,type:"default",size:"default"===P?"medium":"small",style:{height:"small"===P?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:o(O,{})})}),o("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(te<=7)return Array.from({length:te},function(e,o){return o+1});var e=[];if(re<=4){for(var o=1;o<=5;o++)e.push(o);e.push("jump-next"),e.push(te)}else if(re>=te-3){e.push(1),e.push("jump-prev");for(o=te-4;o<=te;o++)e.push(o)}else{e.push(1),e.push("jump-prev");for(o=re-1;o<=re+1;o++)e.push(o);e.push("jump-next"),e.push(te)}return e}().map(function(e){return function(e){if("number"==typeof e){var r=e===re,n=o(k,{onClick:function(){return ie(e)},disabled:H,type:r?"primary":"default",size:"default"===P?"medium":"small",style:{minWidth:"small"===P?"32px":"36px",height:"small"===P?"32px":"36px",padding:"0 12px",margin:0,fontWeight:r?500:400,border:r?"1px solid ".concat(V):void 0,boxShadow:"none",borderRadius:"8px"},children:e},e);return X?X(e,"page",n):n}if("jump-prev"===e)return n=o(k,{onClick:function(){return ie(Math.max(1,re-5))},disabled:H,type:"default",size:"default"===P?"medium":"small",style:{minWidth:"small"===P?"32px":"36px",height:"small"===P?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),X?X(re-5,"jump-prev",n):n;if("jump-next"===e)return n=o(k,{onClick:function(){return ie(Math.min(te,re+5))},disabled:H,type:"default",size:"default"===P?"medium":"small",style:{minWidth:"small"===P?"32px":"36px",height:"small"===P?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),X?X(re+5,"jump-next",n):n;return null}(e)})}),c>0&&o(r,{children:X?X(re+1,"next",o(k,{onClick:function(){return ie(re+1)},disabled:H||re===te,type:"default",size:"default"===P?"medium":"small",style:{height:"small"===P?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:o(W,{})})):o(k,{onClick:function(){return ie(re+1)},disabled:H||re===te,type:"default",size:"default"===P?"medium":"small",style:{height:"small"===P?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:o(W,{})})}),v&&o(B,{value:ne,options:y.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return o=Number(e),r=Math.ceil(c/o),n=re>r?r:re,void 0===u&&Z(o),void 0===t&&U(n),null==F||F(n,o),void(null==z||z(n,o));var o,r,n},disabled:H,size:"small"===P?"small":"medium",style:{minWidth:"small"===P?80:96}}),S&&e("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[o("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),o(E,{type:"number",min:1,value:ee,onChange:function(e){return oe(e.target.value)},onPressEnter:ae,disabled:H,size:"small"===P?"small":"medium",style:{width:56,minWidth:56}}),o("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof S&&S.goButton?o(k,{onClick:ae,disabled:H,type:"default",size:"default"===P?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:S.goButton}):o(k,{onClick:ae,disabled:H,type:"default",size:"default"===P?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})};export{M as default};
|
|
1
|
+
import{jsxs as e,jsx as o,Fragment as r}from"react/jsx-runtime";import n,{createContext as t,useContext as i,useState as a,forwardRef as l,useRef as d,useEffect as s,useCallback as c,useMemo as p}from"react";import{createPortal as u}from"react-dom";var f=function(){return f=Object.assign||function(e){for(var o,r=1,n=arguments.length;r<n;r++)for(var t in o=arguments[r])Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t]);return e},f.apply(this,arguments)};function h(e,o){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)o.indexOf(n[t])<0&&Object.prototype.propertyIsEnumerable.call(e,n[t])&&(r[n[t]]=e[n[t]])}return r}function g(e,o,r){if(r||2===arguments.length)for(var n,t=0,i=o.length;t<i;t++)!n&&t in o||(n||(n=Array.prototype.slice.call(o,0,t)),n[t]=o[t]);return e.concat(n||Array.prototype.slice.call(o))}"function"==typeof SuppressedError&&SuppressedError;var v={primaryColor:"#FB6011"},x=t(v),m=function(){var e=i(x);return e||v},b={sm:"sm",md:"md",lg:"lg",xl:"xl",small:"sm",mediumSmall:"sm",medium:"md",large:"xl"},y={default:"default",primary:"primary",secondary:"secondary",tertiary:"tertiary","link-color":"link-color","link-gray":"link-gray","destructive-primary":"destructive-primary","destructive-secondary":"destructive-secondary","destructive-tertiary":"destructive-tertiary","destructive-link":"destructive-link"},w={sm:{height:36,paddingX:12,paddingXLg:12,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:8},md:{height:40,paddingX:14,paddingXLg:14,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:10},lg:{height:44,paddingX:16,paddingXLg:16,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:12},xl:{height:48,paddingX:18,paddingXLg:18,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:14}},S=function(n){var t=n.size,i=n.color;return e(r,{children:[o("style",{children:"@keyframes aha-button-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}"}),e("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-button-spin 1s linear infinite",flexShrink:0},children:[o("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",opacity:"0.25"}),o("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:i,strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})]})},k=function(r){var n=r.children,t=r.type,i=void 0===t?"default":t,l=r.size,d=void 0===l?"md":l,s=r.disabled,c=void 0!==s&&s,p=r.loading,u=void 0!==p&&p,g=r.iconOnly,v=r.focused,x=void 0!==v&&v,k=r.onClick,C=r.htmlType,z=void 0===C?"button":C,F=r.className,L=void 0===F?"":F,A=r.style,E=r.icon,B=r.iconPosition,O=void 0===B?"left":B,W=h(r,["children","type","size","disabled","loading","iconOnly","focused","onClick","htmlType","className","style","icon","iconPosition"]),M=m().primaryColor,H=a(!1),T=H[0],D=H[1],I=a(!1),R=I[0],j=I[1],N=y[i]||"default",P=w[b[d]||"md"],_=null!=g?g:!!E&&null==n,q="link-color"===N||"link-gray"===N||"destructive-link"===N,X=c||u,Y=x,V=M,K=function(){if(c)return"default"===N||"primary"===N||"secondary"===N||"destructive-primary"===N||"destructive-secondary"===N?{bg:"var(--color-bg-disabled, #f5f5f4)",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"1px solid var(--color-border-disabled_subtle, #e7e5e4)",boxShadow:"none"}:{bg:"transparent",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"none",boxShadow:"none"};var e=T||R;return"default"===N?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",color:e?"var(--color-text-brand-secondary, #ec470a)":"var(--color-text-secondary, #44403c)",iconColor:e?"var(--color-fg-brand-secondary_alt, #fb6011)":"var(--color-fg-quaternary, #a9a29d)",border:e?"1px solid var(--color-border-brand, #fb6011)":"1px solid var(--color-border-primary, #d7d3d0)",boxShadow:"none"}:"primary"===N?{bg:e?"var(--color-bg-brand-solid_hover, #ec470a)":V||"var(--color-bg-brand-solid, #fb6011)",color:"var(--color-text-white, #ffffff)",iconColor:"var(--color-brand-300, #feb073)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic, 0 1px 2px 0 rgba(10,13,18,.05))"}:"secondary"===N?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",color:e?"var(--color-text-secondary_hover, #292524)":"var(--color-text-secondary, #44403c)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"tertiary"===N?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none"}:"link-color"===N?{bg:"transparent",color:e?"var(--color-text-brand-secondary_hover, #c4330a)":"var(--color-text-brand-secondary, #ec470a)",iconColor:"var(--color-fg-brand-secondary_alt, #fb6011)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"link-gray"===N?{bg:"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"destructive-primary"===N?{bg:e?"var(--color-error-600)":"var(--color-error-500)",color:"var(--color-text-white)",iconColor:e?"var(--color-error-200)":"var(--color-error-300)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"destructive-secondary"===N?{bg:e?"var(--color-bg-error-primary)":"var(--color-bg-primary)",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"inset 0 0 0 1px var(--color-border-error_subtle), inset 0 -2px 0 0 rgba(10,13,18,0.05), 0 1px 2px 0 rgba(10,13,18,0.05)"}:"destructive-tertiary"===N?{bg:e?"var(--color-bg-error-primary)":"transparent",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none"}:{bg:"transparent",color:e?"var(--color-text-error-primary_hover)":"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}}(),G=function(){if(Y)return"destructive-primary"===N||"destructive-secondary"===N||"destructive-tertiary"===N||"destructive-link"===N?"destructive-primary"===N||"destructive-secondary"===N?"var(--focus-ring-error-shadow-xs-skeuomorphic)":"var(--focus-ring-error)":"primary"===N||"secondary"===N?"var(--focus-ring-shadow-xs-skeuomorphic, 0 0 0 2px #fff, 0 0 0 4px #fb6011)":"var(--focus-ring, 0 0 0 2px #fff, 0 0 0 4px #fb6011)"}(),U=f({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:P.gap,fontFamily:'var(--font-family-body, "DM Sans", system-ui, sans-serif)',fontWeight:600,fontSize:P.fontSize,lineHeight:"".concat(P.lineHeight,"px"),cursor:X?"not-allowed":"pointer",outline:"none",transition:"background-color .15s ease, color .15s ease, box-shadow .15s ease",userSelect:"none",WebkitTapHighlightColor:"transparent",whiteSpace:"nowrap",backgroundColor:K.bg,color:K.color,border:K.border,boxShadow:null!=G?G:K.boxShadow,textDecoration:K.textDecoration},A);q?(U.borderRadius="4px",U.overflow="hidden",_?(U.width=P.height,U.height=P.height,U.padding=0):(U.height=P.height,U.paddingLeft=P.paddingX,U.paddingRight=P.paddingX)):(U.borderRadius="var(--radius-md, 8px)",_?(U.width=P.height,U.height=P.height,U.padding=0):(U.height=P.height,U.paddingLeft=P.paddingX,U.paddingRight=P.paddingX));var J=function(){return u?o(S,{size:P.iconSize,color:K.iconColor}):E?o("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:P.iconSize,height:P.iconSize,color:K.iconColor,flexShrink:0},children:E}):null},Q=u||E&&"left"===O,Z=!u&&E&&"right"===O;return e("button",f({type:z,className:["aha-button","aha-button--".concat(N),"aha-button--".concat(b[d]||"md"),_&&"aha-button--icon-only",X&&"aha-button--disabled",u&&"aha-button--loading",Y&&"aha-button--focused",L].filter(Boolean).join(" "),disabled:X,onClick:function(e){X?e.preventDefault():null==k||k(e)},onMouseEnter:function(){return!X&&D(!0)},onMouseLeave:function(){D(!1),j(!1)},onMouseDown:function(){return!X&&j(!0)},onMouseUp:function(){return j(!1)},style:U},W,{children:[Q&&J(),!_&&n,Z&&J(),_&&!E&&!u&&n]}))};k.displayName="Button";var C="var(--shadow-xs)",z={small:{pt:"5px",pb:"5px"},mediumSmall:{pt:"7px",pb:"7px"},medium:{pt:"9px",pb:"9px"},large:{pt:"11px",pb:"11px"}};l(function(r,n){var t=r.size,i=void 0===t?"mediumSmall":t,l=r.error,c=void 0!==l&&l,p=r.disabled,u=void 0!==p&&p,g=r.readOnly,v=void 0!==g&&g,x=r.prefix,m=r.suffix,b=r.leadingText,y=r.trailingText,w=r.leadingAddon,S=r.trailingAddon,k=r.className,F=void 0===k?"":k,L=r.style,A=r.onFocus,E=r.onBlur,B=r.onKeyDown,O=r.onPressEnter,W=r.value,M=r.defaultValue,H=r.onChange,T=r.placeholder,D=r.type,I=void 0===D?"text":D,R=r.label,j=r.required,N=r.hintText,P=h(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"]),_=d(null),q=a(!1),X=q[0],Y=q[1],V=a(null!=M?M:""),K=V[0],G=V[1];s(function(){"function"==typeof n?n(_.current):n&&(n.current=_.current)},[n]);var U=void 0!==W,J=U?W:K,Q=u?{border:"1px solid var(--color-border-disabled)",boxShadow:C,outline:"none"}:c&&X?{border:"1px solid var(--color-border-error)",boxShadow:C,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:c?{border:"1px solid var(--color-border-error_subtle)",boxShadow:C,outline:"none"}:X?{border:"1px solid var(--color-border-brand)",boxShadow:C,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:C,outline:"none"},Z=Q.border,$=Q.boxShadow,ee=Q.outline,oe=Q.outlineOffset,re=z[i],ne=re.pt,te=re.pb,ie=u?"var(--color-border-disabled)":"var(--color-border-primary)",ae=!!x,le=!!m,de={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:u?"var(--color-fg-disabled)":"var(--color-fg-quaternary)",zIndex:1,pointerEvents:"none"},se={display:"flex",alignItems:"center",paddingTop:ne,paddingBottom:te,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:u?"var(--color-bg-disabled_subtle)":"transparent"},ce=e("div",{className:"aha-input-group ".concat(F),style:f({display:"flex",alignItems:"stretch",width:"100%",border:Z,boxShadow:$,outline:ee,outlineOffset:oe,borderRadius:"var(--radius-md)",backgroundColor:u||v?"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"},L),children:[void 0!==b&&o("div",{style:f(f({},se),{borderRight:"1px solid ".concat(ie)}),children:b}),void 0!==w&&o("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderRight:"1px solid ".concat(ie)},children:w}),e("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"stretch",minWidth:0},children:[ae&&o("span",{style:f(f({},de),{left:"14px"}),children:x}),o("input",f({ref:_,type:I,value:J,placeholder:T,disabled:u,readOnly:v,onChange:function(e){U||G(e.target.value),null==H||H(e)},onFocus:function(e){Y(!0),null==A||A(e)},onBlur:function(e){Y(!1),null==E||E(e)},onKeyDown:function(e){"Enter"===e.key&&O&&O(e),null==B||B(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:u?"var(--color-text-disabled)":"var(--color-text-primary)",paddingTop:ne,paddingBottom:te,paddingLeft:ae?"40px":"14px",paddingRight:le?"40px":"14px"},autoComplete:P.autoComplete||"off"},P)),le&&o("span",{style:f(f({},de),{right:"14px"}),children:m})]}),void 0!==y&&o("div",{style:f(f({},se),{paddingLeft:"12px",paddingRight:"14px",borderLeft:"1px solid ".concat(ie)}),children:y}),void 0!==S&&o("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderLeft:"1px solid ".concat(ie)},children:S})]});if(!R&&!N)return ce;var pe={margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:c?"var(--color-error-600)":"var(--color-text-tertiary)"};return e("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[R&&e("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)"},children:[R,j&&o("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"})]}),ce,N&&o("p",{style:pe,children:N})]})}).displayName="InputGroup";var F={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"}},L="var(--shadow-xs)",A=function(e){var r=e.onClick;return o("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:o("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},E=l(function(t,i){var a=t.size,l=void 0===a?"mediumSmall":a,c=t.disabled,p=void 0!==c&&c,u=t.error,g=void 0!==u&&u,v=t.readOnly,x=void 0!==v&&v,m=t.prefix,b=t.suffix,y=t.allowClear,w=void 0!==y&&y,S=t.onClear,k=t.className,C=void 0===k?"":k,z=t.style,E=t.type,B=void 0===E?"text":E,O=t.placeholder,W=t.value,M=t.defaultValue,H=t.onChange,T=t.onFocus,D=t.onBlur,I=t.onPressEnter,R=t.label,j=t.required,N=t.hintText,P=h(t,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter","label","required","hintText"]),_=d(null),q=n.useState(M||W||""),X=q[0],Y=q[1],V=n.useState(!1),K=V[0],G=V[1];s(function(){"function"==typeof i?i(_.current):i&&(i.current=_.current)},[i]);var U=void 0!==W,J=U?W:X,Q=w&&J&&!p,Z=p?{border:"1px solid var(--color-border-disabled)",boxShadow:L,outline:"none"}:g&&K?{border:"1px solid var(--color-border-error)",boxShadow:L,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:g?{border:"1px solid var(--color-border-error_subtle)",boxShadow:L,outline:"none"}:K?{border:"1px solid var(--color-border-brand)",boxShadow:L,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:L,outline:"none"},$=Z.border,ee=Z.boxShadow,oe=Z.outline,re=Z.outlineOffset,ne=F[l],te=ne.height,ie=ne.paddingTop,ae=ne.paddingBottom,le=f({width:"100%",height:te,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:$,boxShadow:ee,backgroundColor:p||x?"var(--color-bg-disabled_subtle)":"var(--color-bg-primary)",color:p?"var(--color-text-disabled)":"var(--color-text-primary)",paddingTop:ie,paddingBottom:ae,paddingLeft:m?"40px":"14px",paddingRight:b||Q?"40px":"14px",transition:"border-color 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease",outline:oe,outlineOffset:re,WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},z),de={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:p?"var(--color-fg-disabled)":"var(--color-fg-quaternary)",zIndex:1},se=e(r,{children:[o("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("div",{className:"aha-input-wrapper ".concat(C),style:{position:"relative",display:"block",width:"100%"},children:[m&&o("span",{style:f(f({},de),{left:"14px",pointerEvents:"none"}),children:m}),o("input",f({ref:_,type:B,value:J,placeholder:O,disabled:p,readOnly:x,onChange:function(e){U||Y(e.target.value),null==H||H(e)},onFocus:function(e){G(!0),null==T||T(e)},onBlur:function(e){G(!1),null==D||D(e)},onKeyDown:function(e){var o;"Enter"===e.key&&I&&I(e),null===(o=P.onKeyDown)||void 0===o||o.call(P,e)},style:le,autoComplete:P.autoComplete||"off",autoCorrect:P.autoCorrect||"off",autoCapitalize:P.autoCapitalize||"off",spellCheck:P.spellCheck||!1},P)),(b||Q)&&e("span",{style:f(f({},de),{right:"14px",gap:"var(--spacing-xs)"}),children:[Q&&o(A,{onClick:function(e){var o;e.stopPropagation(),U||Y("");null==H||H({target:{value:""},currentTarget:{value:""}}),null==S||S(),null===(o=_.current)||void 0===o||o.focus()}}),b]})]})]});return R||N?e("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[R&&e("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)"},children:[R,j&&o("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"})]}),se,N&&o("p",{style:{margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:g?"var(--color-error-600)":"var(--color-text-tertiary)"},children:N})]}):se});E.displayName="Input";var B=function(t){var i,l=t.value,h=t.defaultValue,v=t.options,x=void 0===v?[]:v,b=t.mode,y=t.disabled,w=void 0!==y&&y,S=t.error,k=void 0!==S&&S,C=t.placeholder,z=void 0===C?"Please select":C,F=t.size,L=void 0===F?"medium":F,A=t.showSearch,E=void 0!==A&&A,B=t.filterOption,O=void 0===B||B,W=t.allowClear,M=void 0!==W&&W,H=t.onChange,T=t.onSelect,D=t.onDeselect,I=t.onSearch,R=t.onFocus,j=t.onBlur,N=t.onDropdownVisibleChange,P=t.className,_=void 0===P?"":P,q=t.style,X=t.dropdownClassName,Y=void 0===X?"":X,V=t.dropdownStyle,K=t.defaultOpen,G=void 0!==K&&K,U=t.open,J=t.maxTagCount,Q=t.tagRender,Z=t.optionRender,$=m().primaryColor,ee=void 0===$?"#FB6011":$,oe=a(void 0!==h?h:b?[]:void 0),re=oe[0],ne=oe[1],te=a(G),ie=te[0],ae=te[1],le=a(""),de=le[0],se=le[1],ce=a(-1),pe=ce[0],ue=ce[1],fe=d(null),he=d(null),ge=d(null),ve=a(null),xe=ve[0],me=ve[1],be=void 0!==l,ye=void 0!==U,we=be?l:re,Se=ye?U:ie,ke="multiple"===b||"tags"===b,Ce=c(function(){if(!we)return[];var e=Array.isArray(we)?we:[we];return x.filter(function(o){return e.includes(o.value)})},[we,x]),ze=c(function(){return E&&de?!1===O?x:"function"==typeof O?x.filter(function(e){return O(de,e)}):x.filter(function(e){var o=String(e.label||"").toLowerCase(),r=de.toLowerCase();return o.includes(r)}):x},[x,de,E,O]),Fe=p(function(){return ze()},[ze]);s(function(){if(Se&&fe.current){var e=function(){var e,o;if(fe.current){var r=fe.current.getBoundingClientRect(),n=null!==(o=null===(e=ge.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==o?o:Math.min(256,Math.max(40,40*Fe.length)),t=window.innerHeight-r.bottom,i=r.top,a=t<n+4&&i>t,l=a?r.top+window.scrollY-n-4:r.bottom+window.scrollY+4;me({top:l,left:r.left+window.scrollX,width:r.width,placement:a?"top":"bottom"})}};return e(),requestAnimationFrame(e),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}me(null)},[Se,Fe.length]),s(function(){var e=function(e){var o=e.target;fe.current&&!fe.current.contains(o)&&ge.current&&!ge.current.contains(o)&&(ye||ae(!1),null==N||N(!1),se(""))};if(Se)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Se,ye,N]),s(function(){if(Se){var e=function(e){var o;if("ArrowDown"===e.key)e.preventDefault(),ue(function(e){return e<Fe.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),ue(function(e){return e>0?e-1:0});else if("Enter"===e.key&&pe>=0){e.preventDefault();var r=Fe[pe];r&&!r.disabled&&Le(r)}else"Escape"===e.key&&(e.preventDefault(),ye||ae(!1),null==N||N(!1),null===(o=fe.current)||void 0===o||o.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[Se,Fe,pe,ye,N]),s(function(){if(pe>=0&&ge.current){var e=ge.current.querySelectorAll(".aha-select-option")[pe];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[pe]);var Le=c(function(e){var o;if(!e.disabled)if(ke){var r,n=Array.isArray(we)?we:[];n.includes(e.value)?(r=n.filter(function(o){return o!==e.value}),null==D||D(e.value,e)):(r=g(g([],n,!0),[e.value],!1),null==T||T(e.value,e)),be||ne(r);var t=x.filter(function(e){return r.includes(e.value)});null==H||H(r,t)}else be||ne(e.value),null==H||H(e.value,e),null==T||T(e.value,e),ye||ae(!1),null==N||N(!1),se(""),null===(o=fe.current)||void 0===o||o.focus()},[ke,we,be,ye,x,H,T,D,N]),Ae=c(function(e,o){if(e.stopPropagation(),ke&&Array.isArray(we)){var r=we.filter(function(e){return e!==o}),n=x.find(function(e){return e.value===o});be||ne(r),null==H||H(r,Ce()),null==D||D(o,n)}},[ke,we,be,x,H,D,Ce]),Ee=function(e){e.stopPropagation();var o=ke?[]:void 0;be||ne(o),null==H||H(o,[]),se("")},Be={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},Oe=p(function(){return Ce()},[Ce]),We=p(function(){return M&&we&&!w},[M,we,w]),Me=p(function(){return ke?Array.isArray(we)&&we.length>0:null!=we&&""!==we},[ke,we]),He=p(function(){if(!ke||!Array.isArray(we)||0===we.length)return null;var r="responsive"===J?Oe.slice(0,2):J?Oe.slice(0,J):Oe,t=J&&Oe.length>r.length?Oe.length-r.length:0;return e("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[r.map(function(r){var t={label:r.label,value:r.value,closable:!w,onClose:function(){return Ae({},r.value)}};return Q?o(n.Fragment,{children:Q(t)},r.value):e("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"#F5F5F4",borderRadius:"4px",fontSize:"12px",lineHeight:"18px",color:"#101828",fontFamily:"DM Sans, sans-serif",maxWidth:"100%"},children:[o("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.label}),!w&&o("span",{onClick:function(e){return Ae(e,r.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:o("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},r.value)}),t>0&&e("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",t]})]})},[ke,we,Oe,J,w,Q]);return e(r,{children:[o("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e("div",{ref:fe,className:"aha-select ".concat(_),style:f({position:"relative",display:"inline-flex",alignItems:"center",width:"100%",minWidth:"120px",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(k?"#F04438":Se?ee:"#D7D3D0"),backgroundColor:w?"#FAFAF9":"#FFFFFF",cursor:w?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:Be[L].paddingTop,paddingBottom:Be[L].paddingBottom,fontSize:Be[L].fontSize,lineHeight:Be[L].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},q),onClick:function(){if(!w){var e=!Se;ye||ae(e),null==N||N(e),e&&E?setTimeout(function(){var e;null===(e=he.current)||void 0===e||e.focus()},0):se("")}},onFocus:function(e){null==R||R(e)},onBlur:function(e){null==j||j(e)},onTouchStart:function(e){w||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:w?-1:0,children:[o("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:ke?He||o("span",z?{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:z}:{style:{flex:1,minHeight:"24px"}}):E&&Se?o("input",{ref:he,type:"text",value:de,onChange:function(e){var o=e.target.value;se(o),null==I||I(o),ue(-1)},onClick:function(e){return e.stopPropagation()},onFocus:function(e){return e.stopPropagation()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:w?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Me?void 0:z,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):o("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Me?w?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Me?(null===(i=Oe[0])||void 0===i?void 0:i.label)||we:z||" "})}),e("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[We&&o(function(){return o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:Ee,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:o("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),o(function(e){var r=e.isOpen;return o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:r?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out",flexShrink:0},children:o("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:Se})]})]}),Se&&xe&&u(o("div",{ref:ge,className:"aha-select-dropdown ".concat(Y),style:f({position:"absolute",top:"".concat(xe.top,"px"),left:"".concat(xe.left,"px"),width:"".concat(xe.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"top"===xe.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===xe.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},V),children:0===Fe.length?o("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):Fe.map(function(r,n){var t=ke?Array.isArray(we)&&we.includes(r.value):we===r.value,i=n===pe;return Z?o("div",{className:"aha-select-option ".concat(r.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(t?"bg-[#FAFAF9]":""),onClick:function(){return!r.disabled&&Le(r)},style:{cursor:r.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:Z(r,{selected:t,focused:i,disabled:r.disabled||!1})},r.value):e("div",{className:"aha-select-option ".concat(r.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(t?"bg-[#FAFAF9]":""),onClick:function(){return Le(r)},style:{padding:"8px 16px",cursor:r.disabled?"not-allowed":"pointer",color:r.disabled?"#98A2B3":"#101828",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.2s"},children:[o("span",{children:r.label}),t&&o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i?"hidden":"",children:o("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:ee,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},r.value)})}),document.body)]})};B.displayName="Select";var O=function(e){var r=e.className,n=e.style;return o("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r,style:n,children:o("path",{d:"M15.8334 10H4.16675M4.16675 10L10.0001 15.8334M4.16675 10L10.0001 4.16669",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},W=function(e){var r=e.className,n=e.style;return o("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r,style:n,children:o("path",{d:"M4.16675 10H15.8334M15.8334 10L10.0001 4.16669M15.8334 10L10.0001 15.8334",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},M=function(n){var t=n.current,i=n.defaultCurrent,l=void 0===i?1:i,d=n.total,c=void 0===d?0:d,u=n.pageSize,h=n.defaultPageSize,g=void 0===h?10:h,v=n.showSizeChanger,x=void 0!==v&&v,b=n.pageSizeOptions,y=void 0===b?["10","20","50","100"]:b,w=n.showQuickJumper,S=void 0!==w&&w,C=n.showTotal,z=n.onChange,F=n.onShowSizeChange,L=n.simple,A=void 0!==L&&L,M=n.disabled,H=void 0!==M&&M,T=n.hideOnSinglePage,D=void 0!==T&&T,I=n.className,R=void 0===I?"":I,j=n.style,N=n.size,P=void 0===N?"default":N,_=n.responsive,q=void 0!==_&&_;n.showLessItems;var X=n.itemRender,Y=m().primaryColor,V=void 0===Y?"#FB6011":Y,K=a(l),G=K[0],U=K[1],J=a(g),Q=J[0],Z=J[1],$=a(""),ee=$[0],oe=$[1],re=null!=t?t:G,ne=null!=u?u:Q,te=p(function(){return Math.ceil(c/ne)},[c,ne]);s(function(){void 0!==t&&U(t)},[t]),s(function(){void 0!==u&&Z(u)},[u]);var ie=function(e){e<1||e>te||e===re||H||(void 0===t&&U(e),null==z||z(e,ne))},ae=function(){var e=parseInt(ee,10);e>=1&&e<=te&&(ie(e),oe(""))};if(D&&te<=1)return null;if(A)return e("div",{className:"aha-pagination aha-pagination-simple ".concat(R),style:j,children:[o(k,{onClick:function(){return ie(re-1)},disabled:H||1===re,type:"default",size:"default"===P?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:o(O,{})}),e("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[re," / ",te]}),o(k,{onClick:function(){return ie(re+1)},disabled:H||re===te,type:"default",size:"default"===P?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:o(W,{})})]});var le=(re-1)*ne+1,de=Math.min(re*ne,c);return e("div",{className:"aha-pagination w-full ".concat(R),style:f({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:q?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},j),children:[C&&o("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:C(c,[le,de])}),e("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[c>0&&o(r,{children:X?X(re-1,"prev",o(k,{onClick:function(){return ie(re-1)},disabled:H||1===re,type:"default",size:"default"===P?"medium":"small",style:{height:"small"===P?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:o(O,{})})):o(k,{onClick:function(){return ie(re-1)},disabled:H||1===re,type:"default",size:"default"===P?"medium":"small",style:{height:"small"===P?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:o(O,{})})}),o("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(te<=7)return Array.from({length:te},function(e,o){return o+1});var e=[];if(re<=4){for(var o=1;o<=5;o++)e.push(o);e.push("jump-next"),e.push(te)}else if(re>=te-3){e.push(1),e.push("jump-prev");for(o=te-4;o<=te;o++)e.push(o)}else{e.push(1),e.push("jump-prev");for(o=re-1;o<=re+1;o++)e.push(o);e.push("jump-next"),e.push(te)}return e}().map(function(e){return function(e){if("number"==typeof e){var r=e===re,n=o(k,{onClick:function(){return ie(e)},disabled:H,type:r?"primary":"default",size:"default"===P?"medium":"small",style:{minWidth:"small"===P?"32px":"36px",height:"small"===P?"32px":"36px",padding:"0 12px",margin:0,fontWeight:r?500:400,border:r?"1px solid ".concat(V):void 0,boxShadow:"none",borderRadius:"8px"},children:e},e);return X?X(e,"page",n):n}if("jump-prev"===e)return n=o(k,{onClick:function(){return ie(Math.max(1,re-5))},disabled:H,type:"default",size:"default"===P?"medium":"small",style:{minWidth:"small"===P?"32px":"36px",height:"small"===P?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),X?X(re-5,"jump-prev",n):n;if("jump-next"===e)return n=o(k,{onClick:function(){return ie(Math.min(te,re+5))},disabled:H,type:"default",size:"default"===P?"medium":"small",style:{minWidth:"small"===P?"32px":"36px",height:"small"===P?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),X?X(re+5,"jump-next",n):n;return null}(e)})}),c>0&&o(r,{children:X?X(re+1,"next",o(k,{onClick:function(){return ie(re+1)},disabled:H||re===te,type:"default",size:"default"===P?"medium":"small",style:{height:"small"===P?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:o(W,{})})):o(k,{onClick:function(){return ie(re+1)},disabled:H||re===te,type:"default",size:"default"===P?"medium":"small",style:{height:"small"===P?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:o(W,{})})}),x&&o(B,{value:ne,options:y.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return o=Number(e),r=Math.ceil(c/o),n=re>r?r:re,void 0===u&&Z(o),void 0===t&&U(n),null==F||F(n,o),void(null==z||z(n,o));var o,r,n},disabled:H,size:"small"===P?"small":"medium",style:{minWidth:"small"===P?80:96}}),S&&e("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[o("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),o(E,{type:"number",min:1,value:ee,onChange:function(e){return oe(e.target.value)},onPressEnter:ae,disabled:H,size:"small"===P?"small":"medium",style:{width:56,minWidth:56}}),o("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof S&&S.goButton?o(k,{onClick:ae,disabled:H,type:"default",size:"default"===P?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:S.goButton}):o(k,{onClick:ae,disabled:H,type:"default",size:"default"===P?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})};export{M as default};
|
|
2
2
|
//# sourceMappingURL=Pagination.esm.js.map
|