@bricks-toolkit/toolkit 0.1.0 → 0.1.1

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 (149) hide show
  1. package/dist/Button.types-BsQYqZml.d.ts +27 -0
  2. package/dist/Button.types-D-srlWFf.d.mts +27 -0
  3. package/dist/TextInput.types-DRI8HQza.d.mts +32 -0
  4. package/dist/TextInput.types-DRI8HQza.d.ts +32 -0
  5. package/dist/Tooltip.types-PbUasE3C.d.mts +36 -0
  6. package/dist/Tooltip.types-PbUasE3C.d.ts +36 -0
  7. package/dist/avatar/index.cjs +1 -0
  8. package/dist/avatar/index.d.mts +29 -0
  9. package/dist/avatar/index.d.ts +29 -0
  10. package/dist/avatar/index.mjs +1 -0
  11. package/dist/badge/index.cjs +1 -0
  12. package/dist/badge/index.d.mts +57 -0
  13. package/dist/badge/index.d.ts +57 -0
  14. package/dist/badge/index.mjs +1 -0
  15. package/dist/breadcrumbs/index.cjs +1 -0
  16. package/dist/breadcrumbs/index.d.mts +32 -0
  17. package/dist/breadcrumbs/index.d.ts +32 -0
  18. package/dist/breadcrumbs/index.mjs +1 -0
  19. package/dist/button/index.cjs +2 -0
  20. package/dist/button/index.d.mts +8 -0
  21. package/dist/button/index.d.ts +8 -0
  22. package/dist/button/index.mjs +2 -0
  23. package/dist/card/index.cjs +1 -0
  24. package/dist/card/index.d.mts +42 -0
  25. package/dist/card/index.d.ts +42 -0
  26. package/dist/card/index.mjs +1 -0
  27. package/dist/checkbox/index.cjs +1 -0
  28. package/dist/checkbox/index.d.mts +36 -0
  29. package/dist/checkbox/index.d.ts +36 -0
  30. package/dist/checkbox/index.mjs +1 -0
  31. package/dist/combo-box/index.cjs +1 -0
  32. package/dist/combo-box/index.d.mts +62 -0
  33. package/dist/combo-box/index.d.ts +62 -0
  34. package/dist/combo-box/index.mjs +1 -0
  35. package/dist/date-picker/index.cjs +2 -0
  36. package/dist/date-picker/index.d.mts +32 -0
  37. package/dist/date-picker/index.d.ts +32 -0
  38. package/dist/date-picker/index.mjs +2 -0
  39. package/dist/dialog/index.cjs +1 -0
  40. package/dist/dialog/index.d.mts +61 -0
  41. package/dist/dialog/index.d.ts +61 -0
  42. package/dist/dialog/index.mjs +1 -0
  43. package/dist/dropdown-menu/index.cjs +1 -0
  44. package/dist/dropdown-menu/index.d.mts +34 -0
  45. package/dist/dropdown-menu/index.d.ts +34 -0
  46. package/dist/dropdown-menu/index.mjs +1 -0
  47. package/dist/email/index.cjs +2 -0
  48. package/dist/email/index.d.mts +38 -0
  49. package/dist/email/index.d.ts +38 -0
  50. package/dist/email/index.mjs +2 -0
  51. package/dist/file-upload/index.cjs +1 -0
  52. package/dist/file-upload/index.d.mts +27 -0
  53. package/dist/file-upload/index.d.ts +27 -0
  54. package/dist/file-upload/index.mjs +1 -0
  55. package/dist/header/index.cjs +2 -0
  56. package/dist/header/index.d.mts +28 -0
  57. package/dist/header/index.d.ts +28 -0
  58. package/dist/header/index.mjs +2 -0
  59. package/dist/icon-button/index.cjs +2 -0
  60. package/dist/icon-button/index.d.mts +16 -0
  61. package/dist/icon-button/index.d.ts +16 -0
  62. package/dist/icon-button/index.mjs +2 -0
  63. package/dist/image/index.cjs +1 -0
  64. package/dist/image/index.d.mts +48 -0
  65. package/dist/image/index.d.ts +48 -0
  66. package/dist/image/index.mjs +1 -0
  67. package/dist/index.cjs +2 -0
  68. package/dist/index.d.mts +141 -0
  69. package/dist/index.mjs +2 -0
  70. package/dist/link/index.cjs +1 -0
  71. package/dist/link/index.d.mts +25 -0
  72. package/dist/link/index.d.ts +25 -0
  73. package/dist/link/index.mjs +1 -0
  74. package/dist/loader/index.cjs +2 -0
  75. package/dist/loader/index.d.mts +21 -0
  76. package/dist/loader/index.d.ts +21 -0
  77. package/dist/loader/index.mjs +2 -0
  78. package/dist/modal/index.cjs +1 -0
  79. package/dist/modal/index.d.mts +116 -0
  80. package/dist/modal/index.d.ts +116 -0
  81. package/dist/modal/index.mjs +1 -0
  82. package/dist/multi-select/index.cjs +2 -0
  83. package/dist/multi-select/index.d.mts +59 -0
  84. package/dist/multi-select/index.d.ts +59 -0
  85. package/dist/multi-select/index.mjs +2 -0
  86. package/dist/otp-input/index.cjs +1 -0
  87. package/dist/otp-input/index.d.mts +57 -0
  88. package/dist/otp-input/index.d.ts +57 -0
  89. package/dist/otp-input/index.mjs +1 -0
  90. package/dist/password-input/index.cjs +2 -0
  91. package/dist/password-input/index.d.mts +32 -0
  92. package/dist/password-input/index.d.ts +32 -0
  93. package/dist/password-input/index.mjs +2 -0
  94. package/dist/phone/index.cjs +2 -0
  95. package/dist/phone/index.d.mts +41 -0
  96. package/dist/phone/index.d.ts +41 -0
  97. package/dist/phone/index.mjs +2 -0
  98. package/dist/radio-button/index.cjs +1 -0
  99. package/dist/radio-button/index.d.mts +56 -0
  100. package/dist/radio-button/index.d.ts +56 -0
  101. package/dist/radio-button/index.mjs +1 -0
  102. package/dist/search-input/index.cjs +2 -0
  103. package/dist/search-input/index.d.mts +22 -0
  104. package/dist/search-input/index.d.ts +22 -0
  105. package/dist/search-input/index.mjs +2 -0
  106. package/dist/select/index.cjs +2 -0
  107. package/dist/select/index.d.mts +36 -0
  108. package/dist/select/index.d.ts +36 -0
  109. package/dist/select/index.mjs +2 -0
  110. package/dist/sidebar/index.cjs +1 -0
  111. package/dist/sidebar/index.d.mts +96 -0
  112. package/dist/sidebar/index.d.ts +96 -0
  113. package/dist/sidebar/index.mjs +1 -0
  114. package/dist/skeleton/index.cjs +1 -0
  115. package/dist/skeleton/index.d.mts +76 -0
  116. package/dist/skeleton/index.d.ts +76 -0
  117. package/dist/skeleton/index.mjs +1 -0
  118. package/dist/styles.css +2 -0
  119. package/dist/styles.d.mts +2 -0
  120. package/dist/styles.d.ts +2 -0
  121. package/dist/table/index.cjs +1 -0
  122. package/dist/table/index.d.mts +92 -0
  123. package/dist/table/index.d.ts +92 -0
  124. package/dist/table/index.mjs +1 -0
  125. package/dist/tabs/index.cjs +2 -0
  126. package/dist/tabs/index.d.mts +26 -0
  127. package/dist/tabs/index.d.ts +26 -0
  128. package/dist/tabs/index.mjs +2 -0
  129. package/dist/text-input/index.cjs +2 -0
  130. package/dist/text-input/index.d.mts +7 -0
  131. package/dist/text-input/index.d.ts +7 -0
  132. package/dist/text-input/index.mjs +2 -0
  133. package/dist/theme-provider/index.cjs +1 -0
  134. package/dist/theme-provider/index.d.mts +122 -0
  135. package/dist/theme-provider/index.d.ts +122 -0
  136. package/dist/theme-provider/index.mjs +1 -0
  137. package/dist/time-picker/index.cjs +2 -0
  138. package/dist/time-picker/index.d.mts +32 -0
  139. package/dist/time-picker/index.d.ts +32 -0
  140. package/dist/time-picker/index.mjs +2 -0
  141. package/dist/toaster/index.cjs +1 -0
  142. package/dist/toaster/index.d.mts +28 -0
  143. package/dist/toaster/index.d.ts +28 -0
  144. package/dist/toaster/index.mjs +1 -0
  145. package/dist/tooltip/index.cjs +1 -0
  146. package/dist/tooltip/index.d.mts +7 -0
  147. package/dist/tooltip/index.d.ts +7 -0
  148. package/dist/tooltip/index.mjs +1 -0
  149. package/package.json +56 -54
@@ -0,0 +1,2 @@
1
+ import {forwardRef,useState,useRef,useEffect,useId,useCallback,useLayoutEffect}from'react';import {ChevronLeftIcon,ChevronRightIcon}from'@heroicons/react/24/outline';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {createPortal}from'react-dom';import {jsxs,jsx,Fragment}from'react/jsx-runtime';function r(...B){return twMerge(clsx(B))}var ce=150,ye={top:"-translate-x-1/2 -translate-y-full",bottom:"-translate-x-1/2",left:"-translate-x-full -translate-y-1/2",right:"-translate-y-1/2"},we={top:"top-full left-1/2 -translate-x-1/2",bottom:"bottom-full left-1/2 -translate-x-1/2",left:"left-full top-1/2 -translate-y-1/2",right:"right-full top-1/2 -translate-y-1/2"},Te={top:"border-l-transparent border-r-transparent border-b-transparent",bottom:"border-l-transparent border-r-transparent border-t-transparent",left:"border-t-transparent border-b-transparent border-r-transparent",right:"border-t-transparent border-b-transparent border-l-transparent"},Re={top:"translate-y-1",bottom:"-translate-y-1",left:"translate-x-1",right:"-translate-x-1"},Ce={sm:"px-2 py-1 text-xs rounded-md",md:"px-3 py-1.5 text-sm rounded-lg",lg:"px-4 py-2 text-sm rounded-xl"},Ee={dark:["bg-gray-900 text-gray-50","shadow-[0_4px_16px_rgba(0,0,0,0.35)]","ring-1 ring-white/10"].join(" "),primary:["bg-gradient-to-b from-blue-500 to-blue-600 text-white","shadow-[0_4px_16px_rgba(59,130,246,0.45)]","ring-1 ring-blue-400/30"].join(" "),light:["bg-white text-gray-800","border border-gray-200/80","shadow-[0_4px_16px_rgba(0,0,0,0.10)]"].join(" ")},Be={dark:{top:"border-t-gray-900",bottom:"border-b-gray-900",left:"border-l-gray-900",right:"border-r-gray-900"},primary:{top:"border-t-blue-600",bottom:"border-b-blue-500",left:"border-l-blue-600",right:"border-r-blue-500"},light:{top:"border-t-gray-200",bottom:"border-b-gray-200",left:"border-l-gray-200",right:"border-r-gray-200"}};function ue({content:B,children:u,placement:o="top",trigger:i="hover",showDelay:f=0,hideDelay:l=100,size:c="md",variant:m="dark",open:z,disabled:d=false,maxWidth:P=240,className:S,wrapperClassName:I}){let[_,w]=useState(false),[V,n]=useState(false),[L,k]=useState(false),[K,J]=useState({top:0,left:0}),[T,A]=useState(o),v=z!==void 0,s=v?z:_,M=useRef(null),j=useRef(null),t=useRef(null),a=useRef(null),p=useRef(null),Z=useId(),b=useCallback(()=>{t.current&&clearTimeout(t.current),a.current&&clearTimeout(a.current),p.current&&clearTimeout(p.current);},[]),ee=useCallback(()=>{if(d||v)return;b();let e=()=>{w(true);};f>0?t.current=setTimeout(e,f):e();},[d,v,b,f]),te=useCallback(()=>{v||(b(),a.current=setTimeout(()=>{w(false);},l));},[v,b,l]),re=useCallback(()=>{d||v||w(e=>!e);},[d,v]);useEffect(()=>{let e=null;return s&&!d?(b(),e=requestAnimationFrame(()=>{n(true),e=requestAnimationFrame(()=>{k(true);});})):(e=requestAnimationFrame(()=>{k(false);}),p.current=setTimeout(()=>{n(false);},ce)),()=>{e&&cancelAnimationFrame(e),p.current&&clearTimeout(p.current);}},[s,d,b]);let oe=useCallback(()=>{if(!M.current||!s)return;let e=M.current.getBoundingClientRect(),g=j.current,R=8,y=o,ne=C=>{switch(C){case "top":return {t:e.top-R,l:e.left+e.width/2};case "bottom":return {t:e.bottom+R,l:e.left+e.width/2};case "left":return {t:e.top+e.height/2,l:e.left-R};case "right":return {t:e.top+e.height/2,l:e.right+R}}},se=ne(o),q=se.t,O=se.l;if(g){let C=g.getBoundingClientRect(),E=12;if(o==="top"&&e.top-C.height-R<E?y="bottom":o==="bottom"&&e.bottom+C.height+R>window.innerHeight-E?y="top":o==="left"&&e.left-C.width-R<E?y="right":o==="right"&&e.right+C.width+R>window.innerWidth-E&&(y="left"),y!==o){let le=ne(y);q=le.t,O=le.l;}let ae=C.width/2,ie=C.height/2;y==="top"||y==="bottom"?O=Math.max(E+ae,Math.min(window.innerWidth-E-ae,O)):q=Math.max(E+ie,Math.min(window.innerHeight-E-ie,q));}A(y),J({top:q,left:O});},[s,o]);useLayoutEffect(()=>{if(!s)return;let e=null,g=()=>{e=requestAnimationFrame(oe);};return g(),window.addEventListener("resize",g),window.addEventListener("scroll",g,true),()=>{e!==null&&cancelAnimationFrame(e),window.removeEventListener("resize",g),window.removeEventListener("scroll",g,true);}},[s,oe]),useEffect(()=>{if(!s)return;let e=g=>{g.key==="Escape"&&(b(),w(false));};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e);}},[s,b]),useEffect(()=>b,[b]);let N={};(i==="hover"||i==="focus")&&(N.onFocus=ee,N.onBlur=te),i==="hover"?(N.onMouseEnter=ee,N.onMouseLeave=te):i==="click"&&(N.onClick=re),N.onKeyDown=e=>{(e.key==="Enter"||e.key===" ")&&re();};let me=u;return jsxs("span",{ref:M,className:r("relative inline-flex isolate z-0",I),"aria-describedby":s&&!d?Z:void 0,...N,children:[jsx("span",{className:"relative z-0",children:me}),V&&!d&&createPortal(jsx("div",{ref:j,className:r("pointer-events-none fixed z-[9999]",ye[T]),style:{top:K.top,left:K.left},children:jsxs("div",{id:Z,role:"tooltip",style:{maxWidth:P,transitionDuration:`${ce.toString()}ms`},className:r("relative min-w-max whitespace-normal break-words","font-sans font-medium tracking-tight text-center leading-snug","transition-[opacity,transform] ease-out",L?"opacity-100 translate-x-0 translate-y-0":["opacity-0",Re[T]].join(" "),Ee[m],Ce[c],S),children:[jsx("div",{"aria-hidden":"true",className:r("absolute border-[6px]","drop-shadow-sm",we[T],Te[T],Be[m][T])}),B]})}),document.body)]})}var Ne={xs:"h-6 px-2.5 text-xs",sm:"h-8 px-3 text-sm",md:"h-10 px-4 text-sm",lg:"h-11 px-6 text-base",xl:"h-12 px-8 text-lg"},ze={xs:"w-3 h-3",sm:"w-3.5 h-3.5",md:"w-4 h-4",lg:"w-5 h-5",xl:"w-5 h-5"},Pe={primary:"bg-primary text-text-inverse hover:bg-primary-hover hover:shadow-xl hover:shadow-primary/20 active:scale-95 border border-transparent shadow-md focus-visible:ring-primary/40 transition-all duration-normal",secondary:"bg-secondary text-text hover:bg-secondary-hover border border-transparent focus-visible:ring-primary/40",outline:"bg-transparent text-text border border-border hover:bg-hover hover:text-text focus-visible:ring-primary/40",ghost:"bg-transparent text-text border border-transparent hover:bg-hover hover:text-text focus-visible:ring-primary/40",danger:"bg-error text-text-inverse hover:bg-error/90 border border-transparent shadow-sm focus-visible:ring-error/40",success:"bg-success text-text-inverse hover:bg-success/90 border border-transparent shadow-sm focus-visible:ring-success/40",warning:"bg-warning text-text-inverse hover:bg-warning/90 border border-transparent shadow-sm focus-visible:ring-warning/40",info:"bg-info text-text-inverse hover:bg-info/90 border border-transparent shadow-sm focus-visible:ring-info/40"},Se="opacity-50 cursor-not-allowed shadow-none",Q=forwardRef(function({children:u,className:o,variant:i="primary",size:f="md",fullWidth:l=false,isLoading:c=false,loadingText:m,disabled:z=false,leftIcon:d,rightIcon:P,tooltip:S,tooltipPlacement:I="top",type:_="button",...w},V){let n=z||c,L=jsxs("div",{className:r("relative flex items-center justify-center",ze[f]),children:[jsx("div",{className:"absolute inset-0 rounded-full border-1 border-current opacity-20 animate-ping"}),jsxs("svg",{className:"animate-spin relative z-10 w-full h-full",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",role:"status",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-90",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})]}),k=jsx("button",{ref:V,type:_,disabled:n,"aria-disabled":n,"aria-busy":c,className:r("relative inline-flex items-center justify-center gap-2 font-bold rounded-md transition-[background-color,border-color,color,box-shadow,transform,opacity] duration-normal focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-surface",Ne[f],Pe[i],l?"w-full":"",n?Se:"",o),...w,children:c&&m?jsxs(Fragment,{children:[L,jsx("span",{children:m})]}):jsxs(Fragment,{children:[d&&jsx("span",{className:r("inline-flex shrink-0",c&&"invisible opacity-0"),children:d}),jsx("span",{className:r("truncate flex items-center justify-center",c&&"invisible opacity-0"),children:u}),P&&jsx("span",{className:r("inline-flex shrink-0",c&&"invisible opacity-0"),children:P}),c&&!m&&jsx("span",{className:"absolute inset-0 flex items-center justify-center",children:L})]})});return S?jsx(ue,{content:S,placement:I,wrapperClassName:l?"w-full":"",children:k}):k});Q.displayName="Button";var Me={xs:"w-6 h-6",sm:"w-8 h-8",md:"w-10 h-10",lg:"w-11 h-11",xl:"w-12 h-12"},U=forwardRef(({icon:B,"aria-label":u,isRound:o,className:i,size:f="md",...l},c)=>jsx(Q,{ref:c,size:f,className:r("p-0 flex-shrink-0 min-w-0",Me[f],o&&"rounded-full",i),"aria-label":u,...l,children:B}));U.displayName="IconButton";var Fe={xs:"h-8 px-3 text-xs tracking-tight",sm:"h-9 px-4 text-sm tracking-tight",md:"h-10 px-5 text-sm font-medium tracking-tight",lg:"h-11 px-6 text-base font-medium tracking-tight",xl:"h-12 px-8 text-lg font-medium tracking-tight"},De={default:"border-b border-border/60 bg-transparent gap-2",filled:"bg-surface-secondary/80 p-1.5 rounded-xl gap-1.5 border border-border/40 shadow-inner backdrop-blur-sm",flushed:"border-b border-border/60 bg-transparent gap-8",unstyled:"gap-4"},Ke={default:{default:"border border-transparent text-text-muted hover:text-text hover:bg-hover/5 rounded-t-lg mb-[-1px] transition-all duration-normal",selected:"border border-border border-b-surface text-primary rounded-t-lg mb-[-1px] bg-surface font-bold shadow-[0_-4px_12px_-4px_rgba(0,0,0,0.08)]"},filled:{default:"text-text-muted hover:text-text rounded-lg hover:bg-hover/30 transition-all duration-normal px-4",selected:"bg-surface text-primary shadow-md rounded-lg font-bold scale-[1.02] px-4"},flushed:{default:"border-b-2 border-transparent text-text-muted hover:text-text hover:border-border/40 mb-[-1px] transition-all duration-normal px-1",selected:"border-b-2 border-primary text-primary mb-[-1px] font-bold px-1 tracking-normal"},unstyled:{default:"text-text-muted hover:text-text transition-all duration-normal opacity-70 hover:opacity-100",selected:"text-primary font-bold"}},je=forwardRef(function({items:u,defaultSelectedId:o,selectedId:i,onChange:f,variant:l="default",size:c="md",fullWidth:m=false,className:z,tabListClassName:d,tabClassName:P,tabPanelClassName:S,...I},_){let[w,V]=useState(()=>i!==void 0?i:o!==void 0?o:u.length>0?u[0]?.id??"":""),n=useRef(null),[L,k]=useState(false),[K,J]=useState(false),T=i!==void 0,A=T?i:w,v=(t,a)=>{a||(T||V(t),f?.(t));},s=()=>{if(n.current){let{scrollLeft:t,scrollWidth:a,clientWidth:p}=n.current;k(t>5),J(t<a-p-5);}};useEffect(()=>{let t=n.current;if(!t)return;s(),t.addEventListener("scroll",s),window.addEventListener("resize",s);let a=setTimeout(s,100);return ()=>{t.removeEventListener("scroll",s),window.removeEventListener("resize",s),clearTimeout(a);}},[u,m]);let M=t=>{if(n.current){let a=n.current.clientWidth/2;n.current.scrollBy({left:t==="left"?-a:a,behavior:"smooth"});}};useEffect(()=>{if(n.current){let t=n.current.querySelector('[aria-selected="true"]');t&&t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"});}},[A]);let j=u.find(t=>t.id===A);return u.length===0?null:jsxs("div",{ref:_,className:r("w-full",z),...I,children:[jsxs("div",{className:"relative group/tabs flex items-center",children:[L&&jsxs("div",{className:"absolute left-0 z-20 flex h-full items-center pl-1 lg:hidden pointer-events-none",children:[jsx(U,{icon:jsx(ChevronLeftIcon,{className:"w-4 h-4"}),"aria-label":"Scroll left",variant:"ghost",size:"xs",isRound:true,onClick:()=>{M("left");},className:"pointer-events-auto shadow-xl border border-border/20 bg-surface/98 backdrop-blur-xl hover:bg-primary hover:text-surface transition-all duration-300"}),jsx("div",{className:"w-12 h-full bg-gradient-to-r from-surface/80 to-transparent pointer-events-none -ml-6"})]}),jsx("div",{ref:n,className:r("flex-1 overflow-x-auto scrollbar-none scroll-smooth",l==="filled"?"py-1":"",m&&"w-full"),children:jsx("div",{role:"tablist",className:r("flex flex-nowrap",(m||l!=="filled")&&"min-w-full",l==="filled"&&"w-max mx-auto lg:mx-0",De[l],d),children:u.map(t=>{let a=t.id===A,p=t.disabled;return jsx("button",{type:"button",role:"tab","aria-selected":a,"aria-disabled":p,disabled:p,onClick:()=>{v(t.id,p);},className:r("flex items-center justify-center font-medium transition-all duration-normal outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-surface whitespace-nowrap shrink-0",Fe[c],Ke[l][a?"selected":"default"],m&&"flex-1",p&&"opacity-50 cursor-not-allowed pointer-events-none",P),children:t.label},t.id)})})}),K&&jsxs("div",{className:"absolute right-0 z-20 flex h-full items-center pr-1 lg:hidden pointer-events-none",children:[jsx("div",{className:"w-8 h-full bg-gradient-to-l from-surface to-transparent pointer-events-none -mr-4"}),jsx(U,{icon:jsx(ChevronRightIcon,{className:"w-4 h-4"}),"aria-label":"Scroll right",variant:"ghost",size:"xs",isRound:true,onClick:()=>{M("right");},className:"pointer-events-auto shadow-xl border border-border/20 bg-surface/98 backdrop-blur-xl hover:bg-primary hover:text-surface transition-all duration-300"})]})]}),jsx("div",{role:"tabpanel",className:r("pt-4",S),tabIndex:0,children:j?.content})]})});je.displayName="Tabs";
2
+ export{je as Tabs};
@@ -0,0 +1,2 @@
1
+ 'use strict';var react=require('react'),outline=require('@heroicons/react/24/outline'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function t(...n){return tailwindMerge.twMerge(clsx.clsx(n))}var ie={xs:"h-6 px-2 text-xs",sm:"h-8 px-3 text-sm",md:"h-10 px-3 text-sm",lg:"h-11 px-4 text-base",xl:"h-12 px-4 text-lg"},ue={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-sm",xl:"text-base"},le={default:"rounded-md border border-border bg-surface shadow-sm focus:outline-none",filled:"rounded-md border border-transparent bg-surface-secondary focus:bg-surface focus:outline-none",flushed:"rounded-none border-0 border-b border-border bg-transparent focus:outline-none",unstyled:"border-0 bg-transparent p-0 focus:outline-none"},ce={default:{default:"border-border focus:border-primary",filled:"focus:border-primary",flushed:"border-border focus:border-primary",unstyled:""},error:{default:"border-error focus:border-error",filled:"bg-error/5 focus:border-error",flushed:"border-error focus:border-error",unstyled:""},success:{default:"border-success focus:border-success",filled:"bg-success/5 focus:border-success",flushed:"border-success focus:border-success",unstyled:""},warning:{default:"border-warning focus:border-warning",filled:"bg-warning/5 focus:border-warning",flushed:"border-warning focus:border-warning",unstyled:""}},pe={default:"text-text-muted",error:"text-error",success:"text-success",warning:"text-warning"};function fe(n,s,i,a){if(n==="error"&&s)return s;if(n==="success"&&i)return i;if(n==="warning"&&a)return a}function z({children:n,side:s}){return jsxRuntime.jsx("span",{"aria-hidden":"true",className:t("inline-flex items-center border border-border bg-surface-secondary px-3 text-sm text-text-secondary select-none",s==="left"?"rounded-l-md border-r-0":"rounded-r-md border-l-0"),children:n})}var B=react.forwardRef(function({label:s,required:i=false,helperText:a,errorMessage:j,successMessage:D,warningMessage:F,variant:w="default",size:h="md",state:u="default",fullWidth:y=true,leftElement:T,rightElement:I,prefix:v,suffix:R,wrapperClassName:K,inputGroupClassName:O,inputClassName:$,labelClassName:X,helperClassName:N,id:q,disabled:E,className:G,clearable:J,isLoading:x,multiline:o,rows:Q=4,type:c="text",value:p,onChange:m,...M},d){let U=react.useId(),f=q??U,H=`${f}-helper`,S=`${f}-state`,[b,W]=react.useState(c),C=c==="password",A=J&&(typeof p=="string"||typeof p=="number")&&String(p).length>0,L=T!==void 0,k=I!==void 0||!!A||!!x||C,g=fe(u,j,D,F),Y=[a?H:null,g?S:null].filter(Boolean).join(" ")||void 0,Z=()=>{let r=d&&typeof d=="object"&&"current"in d?d.current:null;if(r){Object.getOwnPropertyDescriptor((o?window.HTMLTextAreaElement:window.HTMLInputElement).prototype,"value")?.set?.call(r,"");let V=new Event("input",{bubbles:true});r.dispatchEvent(V);}else m&&m({target:{value:""},currentTarget:{value:""},preventDefault:()=>{},stopPropagation:()=>{}});},_=()=>x?jsxRuntime.jsxs("svg",{className:"animate-spin h-5 w-5 text-text-muted",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):A?jsxRuntime.jsx("button",{type:"button",onClick:Z,className:"flex items-center justify-center rounded-full text-text-muted hover:text-text hover:bg-interaction-hover p-0.5 transition w-6 h-6 border-0 bg-transparent cursor-pointer","aria-label":"Clear input",children:jsxRuntime.jsx(outline.XMarkIcon,{className:"w-[18px] h-[18px]"})}):C?jsxRuntime.jsx("button",{type:"button",onClick:()=>{W(r=>r==="password"?"text":"password");},className:"flex items-center justify-center rounded-full text-text-muted hover:text-text transition w-6 h-6 border-0 bg-transparent cursor-pointer","aria-label":b==="password"?"Show password":"Hide password",children:b==="password"?jsxRuntime.jsx(outline.EyeIcon,{className:"w-5 h-5"}):jsxRuntime.jsx(outline.EyeSlashIcon,{className:"w-5 h-5"})}):I,P={id:f,disabled:!!E||!!x,value:p,onChange:m,"aria-invalid":u==="error"?true:void 0,"aria-describedby":Y,"aria-required":i,className:t("w-full bg-transparent border-0 focus:outline-none focus:ring-0 outline-none h-full",!o&&ie[h],o&&"py-3 px-4 resize-none",c==="number"&&"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",$),style:{paddingLeft:L?"0.5rem":void 0,paddingRight:k?"0.5rem":void 0},...M};return jsxRuntime.jsxs("div",{className:t("flex flex-col gap-1",y?"w-full":"w-fit",K,G),children:[s!==void 0&&jsxRuntime.jsxs("label",{htmlFor:f,className:t("font-black leading-none text-text mb-2 uppercase tracking-widest",ue[h],X),children:[s,i&&jsxRuntime.jsx("span",{"aria-hidden":"true",className:"ml-1 text-error",children:"*"})]}),jsxRuntime.jsxs("div",{className:t("flex items-stretch transition-all duration-150 overflow-hidden",le[w],ce[u][w],y?"w-full":"w-fit","focus-within:ring-4 focus-within:ring-primary/20 focus-within:border-primary",E&&"opacity-50 cursor-not-allowed bg-surface-secondary",o&&"h-auto",O),children:[v!==void 0&&jsxRuntime.jsx(z,{side:"left",children:v}),jsxRuntime.jsxs("div",{className:"flex flex-1 items-center min-w-0",children:[L&&jsxRuntime.jsx("div",{className:t("pl-3 shrink-0 flex items-center justify-center",o&&"self-start mt-3"),"aria-hidden":"true",children:T}),jsxRuntime.jsx("div",{className:"flex-1 min-w-0 h-full",children:o?jsxRuntime.jsx("textarea",{ref:d,rows:Q,...P}):jsxRuntime.jsx("input",{ref:d,type:b,...P,onKeyDown:r=>{c==="number"&&["e","E","+"].includes(r.key)&&r.preventDefault(),M.onKeyDown?.(r);}})}),k&&jsxRuntime.jsx("div",{className:t("pr-3 shrink-0 flex items-center justify-center text-text-secondary",o&&"self-start mt-3"),style:{width:"2.5rem"},"aria-hidden":"true",children:_()})]}),R!==void 0&&jsxRuntime.jsx(z,{side:"right",children:R})]}),a!==void 0&&jsxRuntime.jsx("p",{id:H,className:t("text-xs leading-tight text-text-muted ",N),children:a}),g!==void 0&&jsxRuntime.jsx("p",{id:S,role:u==="error"?"alert":void 0,className:t("text-xs leading-tight mt-1",pe[u],N),children:g})]})});B.displayName="TextInput";
2
+ exports.TextInput=B;
@@ -0,0 +1,7 @@
1
+ import { T as TextInputProps } from '../TextInput.types-DRI8HQza.mjs';
2
+ export { a as TextInputSize, b as TextInputState, c as TextInputVariant } from '../TextInput.types-DRI8HQza.mjs';
3
+ import 'react';
4
+
5
+ declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
6
+
7
+ export { TextInput, TextInputProps };
@@ -0,0 +1,7 @@
1
+ import { T as TextInputProps } from '../TextInput.types-DRI8HQza.js';
2
+ export { a as TextInputSize, b as TextInputState, c as TextInputVariant } from '../TextInput.types-DRI8HQza.js';
3
+ import 'react';
4
+
5
+ declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
6
+
7
+ export { TextInput, TextInputProps };
@@ -0,0 +1,2 @@
1
+ import {forwardRef,useId,useState}from'react';import {XMarkIcon,EyeIcon,EyeSlashIcon}from'@heroicons/react/24/outline';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx}from'react/jsx-runtime';function t(...n){return twMerge(clsx(n))}var ie={xs:"h-6 px-2 text-xs",sm:"h-8 px-3 text-sm",md:"h-10 px-3 text-sm",lg:"h-11 px-4 text-base",xl:"h-12 px-4 text-lg"},ue={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-sm",xl:"text-base"},le={default:"rounded-md border border-border bg-surface shadow-sm focus:outline-none",filled:"rounded-md border border-transparent bg-surface-secondary focus:bg-surface focus:outline-none",flushed:"rounded-none border-0 border-b border-border bg-transparent focus:outline-none",unstyled:"border-0 bg-transparent p-0 focus:outline-none"},ce={default:{default:"border-border focus:border-primary",filled:"focus:border-primary",flushed:"border-border focus:border-primary",unstyled:""},error:{default:"border-error focus:border-error",filled:"bg-error/5 focus:border-error",flushed:"border-error focus:border-error",unstyled:""},success:{default:"border-success focus:border-success",filled:"bg-success/5 focus:border-success",flushed:"border-success focus:border-success",unstyled:""},warning:{default:"border-warning focus:border-warning",filled:"bg-warning/5 focus:border-warning",flushed:"border-warning focus:border-warning",unstyled:""}},pe={default:"text-text-muted",error:"text-error",success:"text-success",warning:"text-warning"};function fe(n,s,i,a){if(n==="error"&&s)return s;if(n==="success"&&i)return i;if(n==="warning"&&a)return a}function z({children:n,side:s}){return jsx("span",{"aria-hidden":"true",className:t("inline-flex items-center border border-border bg-surface-secondary px-3 text-sm text-text-secondary select-none",s==="left"?"rounded-l-md border-r-0":"rounded-r-md border-l-0"),children:n})}var B=forwardRef(function({label:s,required:i=false,helperText:a,errorMessage:j,successMessage:D,warningMessage:F,variant:w="default",size:h="md",state:u="default",fullWidth:y=true,leftElement:T,rightElement:I,prefix:v,suffix:R,wrapperClassName:K,inputGroupClassName:O,inputClassName:$,labelClassName:X,helperClassName:N,id:q,disabled:E,className:G,clearable:J,isLoading:x,multiline:o,rows:Q=4,type:c="text",value:p,onChange:m,...M},d){let U=useId(),f=q??U,H=`${f}-helper`,S=`${f}-state`,[b,W]=useState(c),C=c==="password",A=J&&(typeof p=="string"||typeof p=="number")&&String(p).length>0,L=T!==void 0,k=I!==void 0||!!A||!!x||C,g=fe(u,j,D,F),Y=[a?H:null,g?S:null].filter(Boolean).join(" ")||void 0,Z=()=>{let r=d&&typeof d=="object"&&"current"in d?d.current:null;if(r){Object.getOwnPropertyDescriptor((o?window.HTMLTextAreaElement:window.HTMLInputElement).prototype,"value")?.set?.call(r,"");let V=new Event("input",{bubbles:true});r.dispatchEvent(V);}else m&&m({target:{value:""},currentTarget:{value:""},preventDefault:()=>{},stopPropagation:()=>{}});},_=()=>x?jsxs("svg",{className:"animate-spin h-5 w-5 text-text-muted",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):A?jsx("button",{type:"button",onClick:Z,className:"flex items-center justify-center rounded-full text-text-muted hover:text-text hover:bg-interaction-hover p-0.5 transition w-6 h-6 border-0 bg-transparent cursor-pointer","aria-label":"Clear input",children:jsx(XMarkIcon,{className:"w-[18px] h-[18px]"})}):C?jsx("button",{type:"button",onClick:()=>{W(r=>r==="password"?"text":"password");},className:"flex items-center justify-center rounded-full text-text-muted hover:text-text transition w-6 h-6 border-0 bg-transparent cursor-pointer","aria-label":b==="password"?"Show password":"Hide password",children:b==="password"?jsx(EyeIcon,{className:"w-5 h-5"}):jsx(EyeSlashIcon,{className:"w-5 h-5"})}):I,P={id:f,disabled:!!E||!!x,value:p,onChange:m,"aria-invalid":u==="error"?true:void 0,"aria-describedby":Y,"aria-required":i,className:t("w-full bg-transparent border-0 focus:outline-none focus:ring-0 outline-none h-full",!o&&ie[h],o&&"py-3 px-4 resize-none",c==="number"&&"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",$),style:{paddingLeft:L?"0.5rem":void 0,paddingRight:k?"0.5rem":void 0},...M};return jsxs("div",{className:t("flex flex-col gap-1",y?"w-full":"w-fit",K,G),children:[s!==void 0&&jsxs("label",{htmlFor:f,className:t("font-black leading-none text-text mb-2 uppercase tracking-widest",ue[h],X),children:[s,i&&jsx("span",{"aria-hidden":"true",className:"ml-1 text-error",children:"*"})]}),jsxs("div",{className:t("flex items-stretch transition-all duration-150 overflow-hidden",le[w],ce[u][w],y?"w-full":"w-fit","focus-within:ring-4 focus-within:ring-primary/20 focus-within:border-primary",E&&"opacity-50 cursor-not-allowed bg-surface-secondary",o&&"h-auto",O),children:[v!==void 0&&jsx(z,{side:"left",children:v}),jsxs("div",{className:"flex flex-1 items-center min-w-0",children:[L&&jsx("div",{className:t("pl-3 shrink-0 flex items-center justify-center",o&&"self-start mt-3"),"aria-hidden":"true",children:T}),jsx("div",{className:"flex-1 min-w-0 h-full",children:o?jsx("textarea",{ref:d,rows:Q,...P}):jsx("input",{ref:d,type:b,...P,onKeyDown:r=>{c==="number"&&["e","E","+"].includes(r.key)&&r.preventDefault(),M.onKeyDown?.(r);}})}),k&&jsx("div",{className:t("pr-3 shrink-0 flex items-center justify-center text-text-secondary",o&&"self-start mt-3"),style:{width:"2.5rem"},"aria-hidden":"true",children:_()})]}),R!==void 0&&jsx(z,{side:"right",children:R})]}),a!==void 0&&jsx("p",{id:H,className:t("text-xs leading-tight text-text-muted ",N),children:a}),g!==void 0&&jsx("p",{id:S,role:u==="error"?"alert":void 0,className:t("text-xs leading-tight mt-1",pe[u],N),children:g})]})});B.displayName="TextInput";
2
+ export{B as TextInput};
@@ -0,0 +1 @@
1
+ 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var c=react.createContext(void 0),T=({children:n,defaultTheme:i="system",storageKey:m="ui-theme",themeConfig:r,...p})=>{let[t,v]=react.useState(()=>{if(typeof window>"u")return i;let e=localStorage.getItem(m);return e||i});react.useEffect(()=>{let e=window.document.documentElement,a=()=>{e.classList.remove("light","dark");let o=t==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t;if(e.classList.add(o),r){let s=r[o]??{};Object.entries(s).forEach(([P,h])=>{if(h){let f=`--${P.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`;e.style.setProperty(f,h);}});}};if(a(),t==="system"){let o=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>{a();};return o.addEventListener("change",s),()=>{o.removeEventListener("change",s);}}},[t,r]);let d={theme:t,setTheme:e=>{localStorage.setItem(m,e),v(e);}};return r!==void 0&&(d.themeConfig=r),jsxRuntime.jsx(c.Provider,{...p,value:d,children:n})},w=()=>{let n=react.useContext(c);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n};T.displayName="ThemeProvider";exports.ThemeProvider=T;exports.useTheme=w;
@@ -0,0 +1,122 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ /** Theme modes supported by the library. */
4
+ type ThemeMode = 'light' | 'dark' | 'system';
5
+ /** A record of semantic design tokens for a single theme (light or dark). */
6
+ interface SemanticColors {
7
+ /** Main primary color used for actions and highlights. */
8
+ primary?: string;
9
+ /** Hover state for primary actions. */
10
+ primaryHover?: string;
11
+ /** Active/pressed state for primary actions. */
12
+ primaryActive?: string;
13
+ /** Secondary actions or secondary emphasis. */
14
+ secondary?: string;
15
+ /** Hover state for secondary actions. */
16
+ secondaryHover?: string;
17
+ /** A vibrant accent color for specific focus or brand elements. */
18
+ accent?: string;
19
+ /** Main application background. */
20
+ background?: string;
21
+ /** Primary surface color for cards, modals, and navigation. */
22
+ surface?: string;
23
+ /** A darker/lighter alternate surface for contrast. */
24
+ surfaceSecondary?: string;
25
+ /** Default border color for elements like inputs or cards. */
26
+ border?: string;
27
+ /** A more subtle border for secondary grouping. */
28
+ borderLight?: string;
29
+ /** Explicit divider color between content blocks. */
30
+ divider?: string;
31
+ /** Standard high-contrast text for body and headings. */
32
+ text?: string;
33
+ /** Slightly lower contrast text for secondary descriptions. */
34
+ textSecondary?: string;
35
+ /** Muted text for captions, metadata, or disabled labels. */
36
+ textMuted?: string;
37
+ /** High-contrast text to be used on dark背景 (e.g. on primary buttons). */
38
+ textInverse?: string;
39
+ /** Color representing success (often green). */
40
+ success?: string;
41
+ /** Color representing warnings (often amber). */
42
+ warning?: string;
43
+ /** Color representing errors or destructive actions (often red). */
44
+ error?: string;
45
+ /** Color representing informational messages (often blue). */
46
+ info?: string;
47
+ /** Background color for item hover states (e.g. list items). */
48
+ hover?: string;
49
+ /** Background color for item active/selected states. */
50
+ active?: string;
51
+ /** Ring or outline color for focus states. */
52
+ focus?: string;
53
+ /** Color for disabled backgrounds or indicators. */
54
+ disabled?: string;
55
+ /** A subtle, tight shadow for small components. */
56
+ shadowSm?: string;
57
+ /** The standard shadow for cards and modals. */
58
+ shadowMd?: string;
59
+ /** A large, diffuse shadow for overlays. */
60
+ shadowLg?: string;
61
+ /** For quick interactions like hover entry. */
62
+ transitionFast?: string;
63
+ /** The default transition for most entry/exit animations. */
64
+ transitionNormal?: string;
65
+ /** For large surface changes or fade-ins. */
66
+ transitionSlow?: string;
67
+ /** Layer for dropdowns and popovers. */
68
+ zIndexDropdown?: string | number;
69
+ /** Layer for sticky headers or nav. */
70
+ zIndexSticky?: string | number;
71
+ /** Layer for modals and drawers. */
72
+ zIndexModal?: string | number;
73
+ /** Highest layer for tooltips and alerts. */
74
+ zIndexTooltip?: string | number;
75
+ primaryForeground?: string;
76
+ secondaryForeground?: string;
77
+ muted?: string;
78
+ mutedForeground?: string;
79
+ accentForeground?: string;
80
+ destructive?: string;
81
+ destructiveForeground?: string;
82
+ card?: string;
83
+ cardForeground?: string;
84
+ input?: string;
85
+ ring?: string;
86
+ }
87
+ /** Theme configuration that allows overriding light and dark properties. */
88
+ interface ThemeConfig {
89
+ /** Light theme overrides. */
90
+ light?: SemanticColors;
91
+ /** Dark theme overrides. */
92
+ dark?: SemanticColors;
93
+ }
94
+ /** Props for the ThemeProvider component. */
95
+ interface ThemeProviderProps {
96
+ /** The children to render within the provider. */
97
+ children: ReactNode;
98
+ /** The default theme mode ('light', 'dark', or 'system'). Default is 'system'. */
99
+ defaultTheme?: ThemeMode;
100
+ /** The key used to store the theme mode in localStorage. Default is 'ui-theme'. */
101
+ storageKey?: string;
102
+ /** Optional custom theme configuration to override default tokens. */
103
+ themeConfig?: ThemeConfig;
104
+ }
105
+ /** Context state provided by the ThemeProvider. */
106
+ interface ThemeProviderState {
107
+ /** The currently active theme mode. */
108
+ theme: ThemeMode;
109
+ /** Function to update the theme mode. */
110
+ setTheme: (theme: ThemeMode) => void;
111
+ /** The currently active theme configuration (including overrides). */
112
+ themeConfig?: ThemeConfig;
113
+ }
114
+
115
+ interface ThemeProviderComponent {
116
+ (props: ThemeProviderProps): React.JSX.Element;
117
+ displayName?: string;
118
+ }
119
+ declare const ThemeProvider: ThemeProviderComponent;
120
+ declare const useTheme: () => ThemeProviderState;
121
+
122
+ export { type SemanticColors, type ThemeConfig, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeProviderState, useTheme };
@@ -0,0 +1,122 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ /** Theme modes supported by the library. */
4
+ type ThemeMode = 'light' | 'dark' | 'system';
5
+ /** A record of semantic design tokens for a single theme (light or dark). */
6
+ interface SemanticColors {
7
+ /** Main primary color used for actions and highlights. */
8
+ primary?: string;
9
+ /** Hover state for primary actions. */
10
+ primaryHover?: string;
11
+ /** Active/pressed state for primary actions. */
12
+ primaryActive?: string;
13
+ /** Secondary actions or secondary emphasis. */
14
+ secondary?: string;
15
+ /** Hover state for secondary actions. */
16
+ secondaryHover?: string;
17
+ /** A vibrant accent color for specific focus or brand elements. */
18
+ accent?: string;
19
+ /** Main application background. */
20
+ background?: string;
21
+ /** Primary surface color for cards, modals, and navigation. */
22
+ surface?: string;
23
+ /** A darker/lighter alternate surface for contrast. */
24
+ surfaceSecondary?: string;
25
+ /** Default border color for elements like inputs or cards. */
26
+ border?: string;
27
+ /** A more subtle border for secondary grouping. */
28
+ borderLight?: string;
29
+ /** Explicit divider color between content blocks. */
30
+ divider?: string;
31
+ /** Standard high-contrast text for body and headings. */
32
+ text?: string;
33
+ /** Slightly lower contrast text for secondary descriptions. */
34
+ textSecondary?: string;
35
+ /** Muted text for captions, metadata, or disabled labels. */
36
+ textMuted?: string;
37
+ /** High-contrast text to be used on dark背景 (e.g. on primary buttons). */
38
+ textInverse?: string;
39
+ /** Color representing success (often green). */
40
+ success?: string;
41
+ /** Color representing warnings (often amber). */
42
+ warning?: string;
43
+ /** Color representing errors or destructive actions (often red). */
44
+ error?: string;
45
+ /** Color representing informational messages (often blue). */
46
+ info?: string;
47
+ /** Background color for item hover states (e.g. list items). */
48
+ hover?: string;
49
+ /** Background color for item active/selected states. */
50
+ active?: string;
51
+ /** Ring or outline color for focus states. */
52
+ focus?: string;
53
+ /** Color for disabled backgrounds or indicators. */
54
+ disabled?: string;
55
+ /** A subtle, tight shadow for small components. */
56
+ shadowSm?: string;
57
+ /** The standard shadow for cards and modals. */
58
+ shadowMd?: string;
59
+ /** A large, diffuse shadow for overlays. */
60
+ shadowLg?: string;
61
+ /** For quick interactions like hover entry. */
62
+ transitionFast?: string;
63
+ /** The default transition for most entry/exit animations. */
64
+ transitionNormal?: string;
65
+ /** For large surface changes or fade-ins. */
66
+ transitionSlow?: string;
67
+ /** Layer for dropdowns and popovers. */
68
+ zIndexDropdown?: string | number;
69
+ /** Layer for sticky headers or nav. */
70
+ zIndexSticky?: string | number;
71
+ /** Layer for modals and drawers. */
72
+ zIndexModal?: string | number;
73
+ /** Highest layer for tooltips and alerts. */
74
+ zIndexTooltip?: string | number;
75
+ primaryForeground?: string;
76
+ secondaryForeground?: string;
77
+ muted?: string;
78
+ mutedForeground?: string;
79
+ accentForeground?: string;
80
+ destructive?: string;
81
+ destructiveForeground?: string;
82
+ card?: string;
83
+ cardForeground?: string;
84
+ input?: string;
85
+ ring?: string;
86
+ }
87
+ /** Theme configuration that allows overriding light and dark properties. */
88
+ interface ThemeConfig {
89
+ /** Light theme overrides. */
90
+ light?: SemanticColors;
91
+ /** Dark theme overrides. */
92
+ dark?: SemanticColors;
93
+ }
94
+ /** Props for the ThemeProvider component. */
95
+ interface ThemeProviderProps {
96
+ /** The children to render within the provider. */
97
+ children: ReactNode;
98
+ /** The default theme mode ('light', 'dark', or 'system'). Default is 'system'. */
99
+ defaultTheme?: ThemeMode;
100
+ /** The key used to store the theme mode in localStorage. Default is 'ui-theme'. */
101
+ storageKey?: string;
102
+ /** Optional custom theme configuration to override default tokens. */
103
+ themeConfig?: ThemeConfig;
104
+ }
105
+ /** Context state provided by the ThemeProvider. */
106
+ interface ThemeProviderState {
107
+ /** The currently active theme mode. */
108
+ theme: ThemeMode;
109
+ /** Function to update the theme mode. */
110
+ setTheme: (theme: ThemeMode) => void;
111
+ /** The currently active theme configuration (including overrides). */
112
+ themeConfig?: ThemeConfig;
113
+ }
114
+
115
+ interface ThemeProviderComponent {
116
+ (props: ThemeProviderProps): React.JSX.Element;
117
+ displayName?: string;
118
+ }
119
+ declare const ThemeProvider: ThemeProviderComponent;
120
+ declare const useTheme: () => ThemeProviderState;
121
+
122
+ export { type SemanticColors, type ThemeConfig, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeProviderState, useTheme };
@@ -0,0 +1 @@
1
+ import {createContext,useState,useEffect,useContext}from'react';import {jsx}from'react/jsx-runtime';var c=createContext(void 0),T=({children:n,defaultTheme:i="system",storageKey:m="ui-theme",themeConfig:r,...p})=>{let[t,v]=useState(()=>{if(typeof window>"u")return i;let e=localStorage.getItem(m);return e||i});useEffect(()=>{let e=window.document.documentElement,a=()=>{e.classList.remove("light","dark");let o=t==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t;if(e.classList.add(o),r){let s=r[o]??{};Object.entries(s).forEach(([P,h])=>{if(h){let f=`--${P.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`;e.style.setProperty(f,h);}});}};if(a(),t==="system"){let o=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>{a();};return o.addEventListener("change",s),()=>{o.removeEventListener("change",s);}}},[t,r]);let d={theme:t,setTheme:e=>{localStorage.setItem(m,e),v(e);}};return r!==void 0&&(d.themeConfig=r),jsx(c.Provider,{...p,value:d,children:n})},w=()=>{let n=useContext(c);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n};T.displayName="ThemeProvider";export{T as ThemeProvider,w as useTheme};
@@ -0,0 +1,2 @@
1
+ 'use strict';var react=require('react'),outline=require('@heroicons/react/24/outline'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function i(...r){return tailwindMerge.twMerge(clsx.clsx(r))}var re={xs:"h-6 px-2 text-xs",sm:"h-8 px-3 text-sm",md:"h-10 px-3 text-sm",lg:"h-11 px-4 text-base",xl:"h-12 px-4 text-lg"},te={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-sm",xl:"text-base"},ne={default:"rounded-md border border-border bg-surface shadow-sm focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-0 transition-all duration-normal",filled:"rounded-md border border-transparent bg-surface-secondary focus:bg-surface focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-0 transition-all duration-normal",flushed:"rounded-none border-0 border-b border-border bg-transparent focus:outline-none focus:ring-0",unstyled:"border-0 bg-transparent p-0 focus:outline-none focus:ring-0"},oe={default:{default:"border-border focus:border-primary focus:ring-primary/40",filled:"focus:border-primary focus:ring-primary/40",flushed:"border-border focus:border-primary",unstyled:""},error:{default:"border-error focus:border-error focus:ring-error/20",filled:"bg-error/5 focus:border-error focus:ring-error/20",flushed:"border-error focus:border-error",unstyled:""},success:{default:"border-success focus:border-success focus:ring-success/20",filled:"bg-success/5 focus:border-success focus:ring-success/20",flushed:"border-success focus:border-success",unstyled:""},warning:{default:"border-warning focus:border-warning focus:ring-warning/20",filled:"bg-warning/5 focus:border-warning focus:ring-warning/20",flushed:"border-warning focus:border-warning",unstyled:""}},ie={default:"text-text-muted",error:"text-error font-medium",success:"text-success font-medium",warning:"text-warning font-medium"},se="disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-surface-secondary";function de(r,t,n){let o={xs:"pl-6",sm:"pl-8",md:"pl-9",lg:"pl-10",xl:"pl-11"},u={xs:"pr-8",sm:"pr-10",md:"pr-11",lg:"pr-12",xl:"pr-12"},d=[];return r&&d.push(o[n]),t&&d.push(u[n]),d.join(" ")}function ae(r,t,n,o){if(r==="error"&&t)return t;if(r==="success"&&n)return n;if(r==="warning"&&o)return o}function z({children:r,side:t,size:n,pointerEvents:o=false}){return jsxRuntime.jsx("span",{"aria-hidden":"true",className:i("absolute top-1/2 -translate-y-1/2 text-text-secondary flex items-center justify-center",!o&&"pointer-events-none",t==="left"?"left-3":"right-3",{xs:"w-3.5 h-3.5",sm:"w-4 h-4",md:"w-4 h-4",lg:"w-5 h-5",xl:"w-5 h-5"}[n]),children:r})}function A({children:r,side:t}){return jsxRuntime.jsx("span",{"aria-hidden":"true",className:i("inline-flex items-center border border-border bg-surface-secondary px-3 text-sm text-text-secondary select-none",t==="left"?"rounded-l-md border-r-0":"rounded-r-md border-l-0"),children:r})}var V=react.forwardRef(function({label:t,required:n=false,helperText:o,errorMessage:u,successMessage:d,warningMessage:E,variant:k="default",size:a="md",state:c="default",fullWidth:P=true,leftElement:T,rightElement:g,prefix:f,suffix:m,wrapperClassName:B,inputGroupClassName:M,inputClassName:H,labelClassName:j,helperClassName:v,id:L,disabled:D,className:F,clearable:$,isLoading:b,value:x,onChange:h,...O},s){let W=react.useId(),p=L??W,R=`${p}-helper`,N=`${p}-state`,y=$&&typeof x=="string"&&x.length>0,S=T!==void 0,C=g!==void 0||!!y||!!b,w=ae(c,u,d,E),X=[o?R:null,w?N:null].filter(Boolean).join(" ")||void 0,q=()=>{if(s&&typeof s!="function"&&s.current){let I=Reflect.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set;I&&Reflect.apply(I,s.current,[""]);let Q=new Event("input",{bubbles:true});s.current.dispatchEvent(Q);}else h&&h({target:{value:""},currentTarget:{value:""},preventDefault:()=>{},stopPropagation:()=>{}});},G=()=>b?jsxRuntime.jsxs("svg",{className:"animate-spin h-full w-full text-text-muted",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):y?jsxRuntime.jsx("button",{type:"button",onClick:q,className:"pointer-events-auto flex items-center justify-center rounded-full text-text-muted hover:text-text hover:bg-hover p-0.5 transition-all duration-fast","aria-label":"Clear time",children:jsxRuntime.jsx(outline.XMarkIcon,{className:"w-full h-full",strokeWidth:2.5})}):g,J=jsxRuntime.jsx("input",{ref:s,id:p,disabled:!!D||!!b,type:"time",value:x,onChange:h,"aria-invalid":c==="error"?true:void 0,"aria-describedby":X,"aria-required":n,className:i("w-full transition-colors duration-150","[&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:opacity-60 hover:[&::-webkit-calendar-picker-indicator]:opacity-100",re[a],ne[k],oe[c][k],se,de(S,C,a),H),...O});return jsxRuntime.jsxs("div",{className:i("flex flex-col gap-1",P?"w-full":"w-fit",B,F),children:[t!==void 0&&jsxRuntime.jsxs("label",{htmlFor:p,className:i("font-black leading-none text-text uppercase tracking-widest",te[a],j),children:[t,n&&jsxRuntime.jsx("span",{"aria-hidden":"true",className:"ml-1 text-error",children:"*"})]}),jsxRuntime.jsxs("div",{className:i("flex items-stretch",P?"w-full":"w-fit",M),children:[f!==void 0&&jsxRuntime.jsx(A,{side:"left",children:f}),jsxRuntime.jsxs("div",{className:"relative flex flex-1 items-center",children:[S&&jsxRuntime.jsx(z,{side:"left",size:a,children:T}),jsxRuntime.jsx("div",{className:i("flex-1",f!==void 0&&m!==void 0?"[&>input]:rounded-none":f!==void 0?"[&>input]:rounded-l-none":m!==void 0?"[&>input]:rounded-r-none":""),children:J}),C&&jsxRuntime.jsx(z,{side:"right",size:a,pointerEvents:!g&&!!y,children:G()})]}),m!==void 0&&jsxRuntime.jsx(A,{side:"right",children:m})]}),o!==void 0&&jsxRuntime.jsx("p",{id:R,className:i("text-xs leading-tight text-text-muted font-medium",v),children:o}),w!==void 0&&jsxRuntime.jsx("p",{id:N,role:c==="error"?"alert":void 0,className:i("text-xs leading-tight mt-1 font-medium",ie[c],v),children:w})]})});V.displayName="TimePicker";
2
+ exports.TimePicker=V;
@@ -0,0 +1,32 @@
1
+ import { InputHTMLAttributes, ReactNode } from 'react';
2
+
3
+ type TimePickerVariant = 'default' | 'filled' | 'flushed' | 'unstyled';
4
+ type TimePickerSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
+ type TimePickerState = 'default' | 'error' | 'success' | 'warning';
6
+ interface TimePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
7
+ label?: string;
8
+ required?: boolean;
9
+ helperText?: string;
10
+ errorMessage?: string;
11
+ successMessage?: string;
12
+ warningMessage?: string;
13
+ variant?: TimePickerVariant;
14
+ size?: TimePickerSize;
15
+ state?: TimePickerState;
16
+ fullWidth?: boolean;
17
+ leftElement?: ReactNode;
18
+ rightElement?: ReactNode;
19
+ prefix?: ReactNode;
20
+ suffix?: ReactNode;
21
+ wrapperClassName?: string;
22
+ inputGroupClassName?: string;
23
+ inputClassName?: string;
24
+ labelClassName?: string;
25
+ helperClassName?: string;
26
+ clearable?: boolean;
27
+ isLoading?: boolean;
28
+ }
29
+
30
+ declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLInputElement>>;
31
+
32
+ export { TimePicker, type TimePickerProps, type TimePickerSize, type TimePickerState, type TimePickerVariant };
@@ -0,0 +1,32 @@
1
+ import { InputHTMLAttributes, ReactNode } from 'react';
2
+
3
+ type TimePickerVariant = 'default' | 'filled' | 'flushed' | 'unstyled';
4
+ type TimePickerSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
+ type TimePickerState = 'default' | 'error' | 'success' | 'warning';
6
+ interface TimePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
7
+ label?: string;
8
+ required?: boolean;
9
+ helperText?: string;
10
+ errorMessage?: string;
11
+ successMessage?: string;
12
+ warningMessage?: string;
13
+ variant?: TimePickerVariant;
14
+ size?: TimePickerSize;
15
+ state?: TimePickerState;
16
+ fullWidth?: boolean;
17
+ leftElement?: ReactNode;
18
+ rightElement?: ReactNode;
19
+ prefix?: ReactNode;
20
+ suffix?: ReactNode;
21
+ wrapperClassName?: string;
22
+ inputGroupClassName?: string;
23
+ inputClassName?: string;
24
+ labelClassName?: string;
25
+ helperClassName?: string;
26
+ clearable?: boolean;
27
+ isLoading?: boolean;
28
+ }
29
+
30
+ declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLInputElement>>;
31
+
32
+ export { TimePicker, type TimePickerProps, type TimePickerSize, type TimePickerState, type TimePickerVariant };
@@ -0,0 +1,2 @@
1
+ import {forwardRef,useId}from'react';import {XMarkIcon}from'@heroicons/react/24/outline';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs}from'react/jsx-runtime';function i(...r){return twMerge(clsx(r))}var re={xs:"h-6 px-2 text-xs",sm:"h-8 px-3 text-sm",md:"h-10 px-3 text-sm",lg:"h-11 px-4 text-base",xl:"h-12 px-4 text-lg"},te={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-sm",xl:"text-base"},ne={default:"rounded-md border border-border bg-surface shadow-sm focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-0 transition-all duration-normal",filled:"rounded-md border border-transparent bg-surface-secondary focus:bg-surface focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-0 transition-all duration-normal",flushed:"rounded-none border-0 border-b border-border bg-transparent focus:outline-none focus:ring-0",unstyled:"border-0 bg-transparent p-0 focus:outline-none focus:ring-0"},oe={default:{default:"border-border focus:border-primary focus:ring-primary/40",filled:"focus:border-primary focus:ring-primary/40",flushed:"border-border focus:border-primary",unstyled:""},error:{default:"border-error focus:border-error focus:ring-error/20",filled:"bg-error/5 focus:border-error focus:ring-error/20",flushed:"border-error focus:border-error",unstyled:""},success:{default:"border-success focus:border-success focus:ring-success/20",filled:"bg-success/5 focus:border-success focus:ring-success/20",flushed:"border-success focus:border-success",unstyled:""},warning:{default:"border-warning focus:border-warning focus:ring-warning/20",filled:"bg-warning/5 focus:border-warning focus:ring-warning/20",flushed:"border-warning focus:border-warning",unstyled:""}},ie={default:"text-text-muted",error:"text-error font-medium",success:"text-success font-medium",warning:"text-warning font-medium"},se="disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-surface-secondary";function de(r,t,n){let o={xs:"pl-6",sm:"pl-8",md:"pl-9",lg:"pl-10",xl:"pl-11"},u={xs:"pr-8",sm:"pr-10",md:"pr-11",lg:"pr-12",xl:"pr-12"},d=[];return r&&d.push(o[n]),t&&d.push(u[n]),d.join(" ")}function ae(r,t,n,o){if(r==="error"&&t)return t;if(r==="success"&&n)return n;if(r==="warning"&&o)return o}function z({children:r,side:t,size:n,pointerEvents:o=false}){return jsx("span",{"aria-hidden":"true",className:i("absolute top-1/2 -translate-y-1/2 text-text-secondary flex items-center justify-center",!o&&"pointer-events-none",t==="left"?"left-3":"right-3",{xs:"w-3.5 h-3.5",sm:"w-4 h-4",md:"w-4 h-4",lg:"w-5 h-5",xl:"w-5 h-5"}[n]),children:r})}function A({children:r,side:t}){return jsx("span",{"aria-hidden":"true",className:i("inline-flex items-center border border-border bg-surface-secondary px-3 text-sm text-text-secondary select-none",t==="left"?"rounded-l-md border-r-0":"rounded-r-md border-l-0"),children:r})}var V=forwardRef(function({label:t,required:n=false,helperText:o,errorMessage:u,successMessage:d,warningMessage:E,variant:k="default",size:a="md",state:c="default",fullWidth:P=true,leftElement:T,rightElement:g,prefix:f,suffix:m,wrapperClassName:B,inputGroupClassName:M,inputClassName:H,labelClassName:j,helperClassName:v,id:L,disabled:D,className:F,clearable:$,isLoading:b,value:x,onChange:h,...O},s){let W=useId(),p=L??W,R=`${p}-helper`,N=`${p}-state`,y=$&&typeof x=="string"&&x.length>0,S=T!==void 0,C=g!==void 0||!!y||!!b,w=ae(c,u,d,E),X=[o?R:null,w?N:null].filter(Boolean).join(" ")||void 0,q=()=>{if(s&&typeof s!="function"&&s.current){let I=Reflect.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set;I&&Reflect.apply(I,s.current,[""]);let Q=new Event("input",{bubbles:true});s.current.dispatchEvent(Q);}else h&&h({target:{value:""},currentTarget:{value:""},preventDefault:()=>{},stopPropagation:()=>{}});},G=()=>b?jsxs("svg",{className:"animate-spin h-full w-full text-text-muted",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):y?jsx("button",{type:"button",onClick:q,className:"pointer-events-auto flex items-center justify-center rounded-full text-text-muted hover:text-text hover:bg-hover p-0.5 transition-all duration-fast","aria-label":"Clear time",children:jsx(XMarkIcon,{className:"w-full h-full",strokeWidth:2.5})}):g,J=jsx("input",{ref:s,id:p,disabled:!!D||!!b,type:"time",value:x,onChange:h,"aria-invalid":c==="error"?true:void 0,"aria-describedby":X,"aria-required":n,className:i("w-full transition-colors duration-150","[&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:opacity-60 hover:[&::-webkit-calendar-picker-indicator]:opacity-100",re[a],ne[k],oe[c][k],se,de(S,C,a),H),...O});return jsxs("div",{className:i("flex flex-col gap-1",P?"w-full":"w-fit",B,F),children:[t!==void 0&&jsxs("label",{htmlFor:p,className:i("font-black leading-none text-text uppercase tracking-widest",te[a],j),children:[t,n&&jsx("span",{"aria-hidden":"true",className:"ml-1 text-error",children:"*"})]}),jsxs("div",{className:i("flex items-stretch",P?"w-full":"w-fit",M),children:[f!==void 0&&jsx(A,{side:"left",children:f}),jsxs("div",{className:"relative flex flex-1 items-center",children:[S&&jsx(z,{side:"left",size:a,children:T}),jsx("div",{className:i("flex-1",f!==void 0&&m!==void 0?"[&>input]:rounded-none":f!==void 0?"[&>input]:rounded-l-none":m!==void 0?"[&>input]:rounded-r-none":""),children:J}),C&&jsx(z,{side:"right",size:a,pointerEvents:!g&&!!y,children:G()})]}),m!==void 0&&jsx(A,{side:"right",children:m})]}),o!==void 0&&jsx("p",{id:R,className:i("text-xs leading-tight text-text-muted font-medium",v),children:o}),w!==void 0&&jsx("p",{id:N,role:c==="error"?"alert":void 0,className:i("text-xs leading-tight mt-1 font-medium",ie[c],v),children:w})]})});V.displayName="TimePicker";
2
+ export{V as TimePicker};
@@ -0,0 +1 @@
1
+ 'use strict';var react=require('react'),outline=require('@heroicons/react/24/outline'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function r(...o){return tailwindMerge.twMerge(clsx.clsx(o))}var N={success:jsxRuntime.jsx(outline.CheckCircleIcon,{className:"w-5 h-5"}),error:jsxRuntime.jsx(outline.ExclamationCircleIcon,{className:"w-5 h-5"}),warning:jsxRuntime.jsx(outline.ExclamationTriangleIcon,{className:"w-5 h-5"}),info:jsxRuntime.jsx(outline.InformationCircleIcon,{className:"w-5 h-5"})},C={success:"bg-white/20",error:"bg-white/20",warning:"bg-white/20",info:"bg-white/20"},R={success:"bg-success/20 text-success",error:"bg-error/20 text-error",warning:"bg-warning/20 text-warning",info:"bg-info/20 text-info"},y={success:"bg-success/10 text-success",error:"bg-error/10 text-error",warning:"bg-warning/10 text-warning",info:"bg-info/10 text-info"},I={solid:{success:"bg-success text-text border-transparent shadow-[0_8px_32px_rgba(16,185,129,0.3)]",error:"bg-error text-text border-transparent shadow-[0_8px_32px_rgba(239,68,68,0.3)]",warning:"bg-warning text-text border-transparent shadow-[0_8px_32px_rgba(245,158,11,0.3)]",info:"bg-info text-text border-transparent shadow-[0_8px_32px_rgba(59,130,246,0.3)]"},subtle:{success:"bg-success/10 text-text border-success/25 shadow-[0_8px_32px_rgba(16,185,129,0.12)]",error:"bg-error/10 text-text border-error/25 shadow-[0_8px_32px_rgba(239,68,68,0.12)]",warning:"bg-warning/10 text-text border-warning/25 shadow-[0_8px_32px_rgba(245,158,11,0.12)]",info:"bg-info/10 text-text border-info/25 shadow-[0_8px_32px_rgba(59,130,246,0.12)]"},"left-accent":{success:"bg-surface border-border border-l-success shadow-[0_8px_24px_rgba(0,0,0,0.08)] text-text",error:"bg-surface border-border border-l-error shadow-[0_8px_24px_rgba(0,0,0,0.08)] text-text",warning:"bg-surface border-border border-l-warning shadow-[0_8px_24px_rgba(0,0,0,0.08)] text-text",info:"bg-surface border-border border-l-info shadow-[0_8px_24px_rgba(0,0,0,0.08)] text-text"}},k={success:"text-success",error:"text-error",warning:"text-warning",info:"text-info"},S=react.forwardRef((o,d)=>{let{title:n,description:i,status:t="info",variant:a="solid",isClosable:l=true,onClose:g,className:b}=o,s=a==="solid",c=a==="left-accent",p=s?C[t]:c?y[t]:R[t];return jsxRuntime.jsxs("div",{ref:d,role:"alert",className:r("relative flex w-full min-w-80 max-w-sm items-start gap-3 px-4 py-3.5 rounded-xl border overflow-hidden transition-all duration-200",c&&"border-l-4 rounded-l-none",I[a][t],b),children:[jsxRuntime.jsx("div",{className:r("flex-shrink-0 flex items-center justify-center w-8 h-8 rounded-lg mt-0.5",p),children:N[t]}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[n&&jsxRuntime.jsx("p",{className:r("text-sm font-bold leading-tight tracking-wide",!s&&k[t]),children:n}),i&&jsxRuntime.jsx("p",{className:r("text-sm leading-relaxed mt-0.5",s?"opacity-90":"text-text-secondary"),children:i})]}),l&&jsxRuntime.jsx("button",{type:"button",onClick:g,className:r("flex-shrink-0 flex items-center justify-center w-6 h-6 rounded-md transition-all duration-150 active:scale-90",s?"hover:bg-white/20 text-text-inverse":"hover:bg-black/10 dark:hover:bg-white/10 text-text-secondary hover:text-text"),"aria-label":"Close",children:jsxRuntime.jsx(outline.XMarkIcon,{className:"w-4 h-4 stroke-2"})})]})});S.displayName="Toaster";exports.Toaster=S;
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ type ToasterStatus = 'success' | 'error' | 'warning' | 'info';
4
+ type ToasterVariant = 'solid' | 'subtle' | 'left-accent';
5
+ interface ToasterProps {
6
+ /** The unique identifier of the toaster */
7
+ id?: string;
8
+ /** The title of the toaster */
9
+ title?: string;
10
+ /** The description text of the toaster */
11
+ description?: ReactNode;
12
+ /** The status of the toaster, affects color and icon */
13
+ status?: ToasterStatus;
14
+ /** The visual variant of the toaster */
15
+ variant?: ToasterVariant;
16
+ /** Whether the toaster is closable */
17
+ isClosable?: boolean;
18
+ /** Callback function called when the toaster is closed */
19
+ onClose?: () => void;
20
+ /** Custom class name for the toaster container */
21
+ className?: string;
22
+ /** Custom duration in ms before toaster closes automatically (if managed by a provider) */
23
+ duration?: number;
24
+ }
25
+
26
+ declare const Toaster: React.ForwardRefExoticComponent<ToasterProps & React.RefAttributes<HTMLDivElement>>;
27
+
28
+ export { Toaster, type ToasterProps, type ToasterStatus, type ToasterVariant };
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ type ToasterStatus = 'success' | 'error' | 'warning' | 'info';
4
+ type ToasterVariant = 'solid' | 'subtle' | 'left-accent';
5
+ interface ToasterProps {
6
+ /** The unique identifier of the toaster */
7
+ id?: string;
8
+ /** The title of the toaster */
9
+ title?: string;
10
+ /** The description text of the toaster */
11
+ description?: ReactNode;
12
+ /** The status of the toaster, affects color and icon */
13
+ status?: ToasterStatus;
14
+ /** The visual variant of the toaster */
15
+ variant?: ToasterVariant;
16
+ /** Whether the toaster is closable */
17
+ isClosable?: boolean;
18
+ /** Callback function called when the toaster is closed */
19
+ onClose?: () => void;
20
+ /** Custom class name for the toaster container */
21
+ className?: string;
22
+ /** Custom duration in ms before toaster closes automatically (if managed by a provider) */
23
+ duration?: number;
24
+ }
25
+
26
+ declare const Toaster: React.ForwardRefExoticComponent<ToasterProps & React.RefAttributes<HTMLDivElement>>;
27
+
28
+ export { Toaster, type ToasterProps, type ToasterStatus, type ToasterVariant };
@@ -0,0 +1 @@
1
+ import {forwardRef}from'react';import {InformationCircleIcon,ExclamationTriangleIcon,ExclamationCircleIcon,CheckCircleIcon,XMarkIcon}from'@heroicons/react/24/outline';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs}from'react/jsx-runtime';function r(...o){return twMerge(clsx(o))}var N={success:jsx(CheckCircleIcon,{className:"w-5 h-5"}),error:jsx(ExclamationCircleIcon,{className:"w-5 h-5"}),warning:jsx(ExclamationTriangleIcon,{className:"w-5 h-5"}),info:jsx(InformationCircleIcon,{className:"w-5 h-5"})},C={success:"bg-white/20",error:"bg-white/20",warning:"bg-white/20",info:"bg-white/20"},R={success:"bg-success/20 text-success",error:"bg-error/20 text-error",warning:"bg-warning/20 text-warning",info:"bg-info/20 text-info"},y={success:"bg-success/10 text-success",error:"bg-error/10 text-error",warning:"bg-warning/10 text-warning",info:"bg-info/10 text-info"},I={solid:{success:"bg-success text-text border-transparent shadow-[0_8px_32px_rgba(16,185,129,0.3)]",error:"bg-error text-text border-transparent shadow-[0_8px_32px_rgba(239,68,68,0.3)]",warning:"bg-warning text-text border-transparent shadow-[0_8px_32px_rgba(245,158,11,0.3)]",info:"bg-info text-text border-transparent shadow-[0_8px_32px_rgba(59,130,246,0.3)]"},subtle:{success:"bg-success/10 text-text border-success/25 shadow-[0_8px_32px_rgba(16,185,129,0.12)]",error:"bg-error/10 text-text border-error/25 shadow-[0_8px_32px_rgba(239,68,68,0.12)]",warning:"bg-warning/10 text-text border-warning/25 shadow-[0_8px_32px_rgba(245,158,11,0.12)]",info:"bg-info/10 text-text border-info/25 shadow-[0_8px_32px_rgba(59,130,246,0.12)]"},"left-accent":{success:"bg-surface border-border border-l-success shadow-[0_8px_24px_rgba(0,0,0,0.08)] text-text",error:"bg-surface border-border border-l-error shadow-[0_8px_24px_rgba(0,0,0,0.08)] text-text",warning:"bg-surface border-border border-l-warning shadow-[0_8px_24px_rgba(0,0,0,0.08)] text-text",info:"bg-surface border-border border-l-info shadow-[0_8px_24px_rgba(0,0,0,0.08)] text-text"}},k={success:"text-success",error:"text-error",warning:"text-warning",info:"text-info"},S=forwardRef((o,d)=>{let{title:n,description:i,status:t="info",variant:a="solid",isClosable:l=true,onClose:g,className:b}=o,s=a==="solid",c=a==="left-accent",p=s?C[t]:c?y[t]:R[t];return jsxs("div",{ref:d,role:"alert",className:r("relative flex w-full min-w-80 max-w-sm items-start gap-3 px-4 py-3.5 rounded-xl border overflow-hidden transition-all duration-200",c&&"border-l-4 rounded-l-none",I[a][t],b),children:[jsx("div",{className:r("flex-shrink-0 flex items-center justify-center w-8 h-8 rounded-lg mt-0.5",p),children:N[t]}),jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[n&&jsx("p",{className:r("text-sm font-bold leading-tight tracking-wide",!s&&k[t]),children:n}),i&&jsx("p",{className:r("text-sm leading-relaxed mt-0.5",s?"opacity-90":"text-text-secondary"),children:i})]}),l&&jsx("button",{type:"button",onClick:g,className:r("flex-shrink-0 flex items-center justify-center w-6 h-6 rounded-md transition-all duration-150 active:scale-90",s?"hover:bg-white/20 text-text-inverse":"hover:bg-black/10 dark:hover:bg-white/10 text-text-secondary hover:text-text"),"aria-label":"Close",children:jsx(XMarkIcon,{className:"w-4 h-4 stroke-2"})})]})});S.displayName="Toaster";export{S as Toaster};
@@ -0,0 +1 @@
1
+ 'use strict';var react=require('react'),reactDom=require('react-dom'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function f(...v){return tailwindMerge.twMerge(clsx.clsx(v))}var X=150,ut={top:"-translate-x-1/2 -translate-y-full",bottom:"-translate-x-1/2",left:"-translate-x-full -translate-y-1/2",right:"-translate-y-1/2"},dt={top:"top-full left-1/2 -translate-x-1/2",bottom:"bottom-full left-1/2 -translate-x-1/2",left:"left-full top-1/2 -translate-y-1/2",right:"right-full top-1/2 -translate-y-1/2"},pt={top:"border-l-transparent border-r-transparent border-b-transparent",bottom:"border-l-transparent border-r-transparent border-t-transparent",left:"border-t-transparent border-b-transparent border-r-transparent",right:"border-t-transparent border-b-transparent border-l-transparent"},mt={top:"translate-y-1",bottom:"-translate-y-1",left:"translate-x-1",right:"-translate-x-1"},ft={sm:"px-2 py-1 text-xs rounded-md",md:"px-3 py-1.5 text-sm rounded-lg",lg:"px-4 py-2 text-sm rounded-xl"},bt={dark:["bg-gray-900 text-gray-50","shadow-[0_4px_16px_rgba(0,0,0,0.35)]","ring-1 ring-white/10"].join(" "),primary:["bg-gradient-to-b from-blue-500 to-blue-600 text-white","shadow-[0_4px_16px_rgba(59,130,246,0.45)]","ring-1 ring-blue-400/30"].join(" "),light:["bg-white text-gray-800","border border-gray-200/80","shadow-[0_4px_16px_rgba(0,0,0,0.10)]"].join(" ")},gt={dark:{top:"border-t-gray-900",bottom:"border-b-gray-900",left:"border-l-gray-900",right:"border-r-gray-900"},primary:{top:"border-t-blue-600",bottom:"border-b-blue-500",left:"border-l-blue-600",right:"border-r-blue-500"},light:{top:"border-t-gray-200",bottom:"border-b-gray-200",left:"border-l-gray-200",right:"border-r-gray-200"}};function Rt({content:v,children:J,placement:o="top",trigger:y="hover",showDelay:R=0,hideDelay:_=100,size:$="md",variant:L="dark",open:z,disabled:a=false,maxWidth:G=240,className:Q,wrapperClassName:Y}){let[Z,w]=react.useState(false),[tt,A]=react.useState(false),[et,B]=react.useState(false),[F,rt]=react.useState({top:0,left:0}),[p,ot]=react.useState(o),u=z!==void 0,n=u?z:Z,E=react.useRef(null),I=react.useRef(null),P=react.useRef(null),C=react.useRef(null),m=react.useRef(null),S=react.useId(),e=react.useCallback(()=>{P.current&&clearTimeout(P.current),C.current&&clearTimeout(C.current),m.current&&clearTimeout(m.current);},[]),V=react.useCallback(()=>{if(a||u)return;e();let t=()=>{w(true);};R>0?P.current=setTimeout(t,R):t();},[a,u,e,R]),K=react.useCallback(()=>{u||(e(),C.current=setTimeout(()=>{w(false);},_));},[u,e,_]),N=react.useCallback(()=>{a||u||w(t=>!t);},[a,u]);react.useEffect(()=>{let t=null;return n&&!a?(e(),t=requestAnimationFrame(()=>{A(true),t=requestAnimationFrame(()=>{B(true);});})):(t=requestAnimationFrame(()=>{B(false);}),m.current=setTimeout(()=>{A(false);},X)),()=>{t&&cancelAnimationFrame(t),m.current&&clearTimeout(m.current);}},[n,a,e]);let H=react.useCallback(()=>{if(!E.current||!n)return;let t=E.current.getBoundingClientRect(),r=I.current,s=8,i=o,q=l=>{switch(l){case "top":return {t:t.top-s,l:t.left+t.width/2};case "bottom":return {t:t.bottom+s,l:t.left+t.width/2};case "left":return {t:t.top+t.height/2,l:t.left-s};case "right":return {t:t.top+t.height/2,l:t.right+s}}},j=q(o),T=j.t,x=j.l;if(r){let l=r.getBoundingClientRect(),c=12;if(o==="top"&&t.top-l.height-s<c?i="bottom":o==="bottom"&&t.bottom+l.height+s>window.innerHeight-c?i="top":o==="left"&&t.left-l.width-s<c?i="right":o==="right"&&t.right+l.width+s>window.innerWidth-c&&(i="left"),i!==o){let U=q(i);T=U.t,x=U.l;}let O=l.width/2,W=l.height/2;i==="top"||i==="bottom"?x=Math.max(c+O,Math.min(window.innerWidth-c-O,x)):T=Math.max(c+W,Math.min(window.innerHeight-c-W,T));}ot(i),rt({top:T,left:x});},[n,o]);react.useLayoutEffect(()=>{if(!n)return;let t=null,r=()=>{t=requestAnimationFrame(H);};return r(),window.addEventListener("resize",r),window.addEventListener("scroll",r,true),()=>{t!==null&&cancelAnimationFrame(t),window.removeEventListener("resize",r),window.removeEventListener("scroll",r,true);}},[n,H]),react.useEffect(()=>{if(!n)return;let t=r=>{r.key==="Escape"&&(e(),w(false));};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t);}},[n,e]),react.useEffect(()=>e,[e]);let d={};(y==="hover"||y==="focus")&&(d.onFocus=V,d.onBlur=K),y==="hover"?(d.onMouseEnter=V,d.onMouseLeave=K):y==="click"&&(d.onClick=N),d.onKeyDown=t=>{(t.key==="Enter"||t.key===" ")&&N();};let nt=J;return jsxRuntime.jsxs("span",{ref:E,className:f("relative inline-flex isolate z-0",Y),"aria-describedby":n&&!a?S:void 0,...d,children:[jsxRuntime.jsx("span",{className:"relative z-0",children:nt}),tt&&!a&&reactDom.createPortal(jsxRuntime.jsx("div",{ref:I,className:f("pointer-events-none fixed z-[9999]",ut[p]),style:{top:F.top,left:F.left},children:jsxRuntime.jsxs("div",{id:S,role:"tooltip",style:{maxWidth:G,transitionDuration:`${X.toString()}ms`},className:f("relative min-w-max whitespace-normal break-words","font-sans font-medium tracking-tight text-center leading-snug","transition-[opacity,transform] ease-out",et?"opacity-100 translate-x-0 translate-y-0":["opacity-0",mt[p]].join(" "),bt[L],ft[$],Q),children:[jsxRuntime.jsx("div",{"aria-hidden":"true",className:f("absolute border-[6px]","drop-shadow-sm",dt[p],pt[p],gt[L][p])}),v]})}),document.body)]})}exports.Tooltip=Rt;
@@ -0,0 +1,7 @@
1
+ import { a as TooltipProps } from '../Tooltip.types-PbUasE3C.mjs';
2
+ export { T as TooltipPlacement, b as TooltipSize, c as TooltipTrigger, d as TooltipVariant } from '../Tooltip.types-PbUasE3C.mjs';
3
+ import 'react';
4
+
5
+ declare function Tooltip({ content, children, placement, trigger, showDelay, hideDelay, size, variant, open: controlledOpen, disabled, maxWidth, className, wrapperClassName, }: TooltipProps): React.JSX.Element;
6
+
7
+ export { Tooltip, TooltipProps };
@@ -0,0 +1,7 @@
1
+ import { a as TooltipProps } from '../Tooltip.types-PbUasE3C.js';
2
+ export { T as TooltipPlacement, b as TooltipSize, c as TooltipTrigger, d as TooltipVariant } from '../Tooltip.types-PbUasE3C.js';
3
+ import 'react';
4
+
5
+ declare function Tooltip({ content, children, placement, trigger, showDelay, hideDelay, size, variant, open: controlledOpen, disabled, maxWidth, className, wrapperClassName, }: TooltipProps): React.JSX.Element;
6
+
7
+ export { Tooltip, TooltipProps };
@@ -0,0 +1 @@
1
+ import {useState,useRef,useId,useCallback,useEffect,useLayoutEffect}from'react';import {createPortal}from'react-dom';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx}from'react/jsx-runtime';function f(...v){return twMerge(clsx(v))}var X=150,ut={top:"-translate-x-1/2 -translate-y-full",bottom:"-translate-x-1/2",left:"-translate-x-full -translate-y-1/2",right:"-translate-y-1/2"},dt={top:"top-full left-1/2 -translate-x-1/2",bottom:"bottom-full left-1/2 -translate-x-1/2",left:"left-full top-1/2 -translate-y-1/2",right:"right-full top-1/2 -translate-y-1/2"},pt={top:"border-l-transparent border-r-transparent border-b-transparent",bottom:"border-l-transparent border-r-transparent border-t-transparent",left:"border-t-transparent border-b-transparent border-r-transparent",right:"border-t-transparent border-b-transparent border-l-transparent"},mt={top:"translate-y-1",bottom:"-translate-y-1",left:"translate-x-1",right:"-translate-x-1"},ft={sm:"px-2 py-1 text-xs rounded-md",md:"px-3 py-1.5 text-sm rounded-lg",lg:"px-4 py-2 text-sm rounded-xl"},bt={dark:["bg-gray-900 text-gray-50","shadow-[0_4px_16px_rgba(0,0,0,0.35)]","ring-1 ring-white/10"].join(" "),primary:["bg-gradient-to-b from-blue-500 to-blue-600 text-white","shadow-[0_4px_16px_rgba(59,130,246,0.45)]","ring-1 ring-blue-400/30"].join(" "),light:["bg-white text-gray-800","border border-gray-200/80","shadow-[0_4px_16px_rgba(0,0,0,0.10)]"].join(" ")},gt={dark:{top:"border-t-gray-900",bottom:"border-b-gray-900",left:"border-l-gray-900",right:"border-r-gray-900"},primary:{top:"border-t-blue-600",bottom:"border-b-blue-500",left:"border-l-blue-600",right:"border-r-blue-500"},light:{top:"border-t-gray-200",bottom:"border-b-gray-200",left:"border-l-gray-200",right:"border-r-gray-200"}};function Rt({content:v,children:J,placement:o="top",trigger:y="hover",showDelay:R=0,hideDelay:_=100,size:$="md",variant:L="dark",open:z,disabled:a=false,maxWidth:G=240,className:Q,wrapperClassName:Y}){let[Z,w]=useState(false),[tt,A]=useState(false),[et,B]=useState(false),[F,rt]=useState({top:0,left:0}),[p,ot]=useState(o),u=z!==void 0,n=u?z:Z,E=useRef(null),I=useRef(null),P=useRef(null),C=useRef(null),m=useRef(null),S=useId(),e=useCallback(()=>{P.current&&clearTimeout(P.current),C.current&&clearTimeout(C.current),m.current&&clearTimeout(m.current);},[]),V=useCallback(()=>{if(a||u)return;e();let t=()=>{w(true);};R>0?P.current=setTimeout(t,R):t();},[a,u,e,R]),K=useCallback(()=>{u||(e(),C.current=setTimeout(()=>{w(false);},_));},[u,e,_]),N=useCallback(()=>{a||u||w(t=>!t);},[a,u]);useEffect(()=>{let t=null;return n&&!a?(e(),t=requestAnimationFrame(()=>{A(true),t=requestAnimationFrame(()=>{B(true);});})):(t=requestAnimationFrame(()=>{B(false);}),m.current=setTimeout(()=>{A(false);},X)),()=>{t&&cancelAnimationFrame(t),m.current&&clearTimeout(m.current);}},[n,a,e]);let H=useCallback(()=>{if(!E.current||!n)return;let t=E.current.getBoundingClientRect(),r=I.current,s=8,i=o,q=l=>{switch(l){case "top":return {t:t.top-s,l:t.left+t.width/2};case "bottom":return {t:t.bottom+s,l:t.left+t.width/2};case "left":return {t:t.top+t.height/2,l:t.left-s};case "right":return {t:t.top+t.height/2,l:t.right+s}}},j=q(o),T=j.t,x=j.l;if(r){let l=r.getBoundingClientRect(),c=12;if(o==="top"&&t.top-l.height-s<c?i="bottom":o==="bottom"&&t.bottom+l.height+s>window.innerHeight-c?i="top":o==="left"&&t.left-l.width-s<c?i="right":o==="right"&&t.right+l.width+s>window.innerWidth-c&&(i="left"),i!==o){let U=q(i);T=U.t,x=U.l;}let O=l.width/2,W=l.height/2;i==="top"||i==="bottom"?x=Math.max(c+O,Math.min(window.innerWidth-c-O,x)):T=Math.max(c+W,Math.min(window.innerHeight-c-W,T));}ot(i),rt({top:T,left:x});},[n,o]);useLayoutEffect(()=>{if(!n)return;let t=null,r=()=>{t=requestAnimationFrame(H);};return r(),window.addEventListener("resize",r),window.addEventListener("scroll",r,true),()=>{t!==null&&cancelAnimationFrame(t),window.removeEventListener("resize",r),window.removeEventListener("scroll",r,true);}},[n,H]),useEffect(()=>{if(!n)return;let t=r=>{r.key==="Escape"&&(e(),w(false));};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t);}},[n,e]),useEffect(()=>e,[e]);let d={};(y==="hover"||y==="focus")&&(d.onFocus=V,d.onBlur=K),y==="hover"?(d.onMouseEnter=V,d.onMouseLeave=K):y==="click"&&(d.onClick=N),d.onKeyDown=t=>{(t.key==="Enter"||t.key===" ")&&N();};let nt=J;return jsxs("span",{ref:E,className:f("relative inline-flex isolate z-0",Y),"aria-describedby":n&&!a?S:void 0,...d,children:[jsx("span",{className:"relative z-0",children:nt}),tt&&!a&&createPortal(jsx("div",{ref:I,className:f("pointer-events-none fixed z-[9999]",ut[p]),style:{top:F.top,left:F.left},children:jsxs("div",{id:S,role:"tooltip",style:{maxWidth:G,transitionDuration:`${X.toString()}ms`},className:f("relative min-w-max whitespace-normal break-words","font-sans font-medium tracking-tight text-center leading-snug","transition-[opacity,transform] ease-out",et?"opacity-100 translate-x-0 translate-y-0":["opacity-0",mt[p]].join(" "),bt[L],ft[$],Q),children:[jsx("div",{"aria-hidden":"true",className:f("absolute border-[6px]","drop-shadow-sm",dt[p],pt[p],gt[L][p])}),v]})}),document.body)]})}export{Rt as Tooltip};