@bzync/rui 0.0.5 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/README.md +5 -0
  2. package/dist/autocomplete-D6z5B-WU.cjs +1 -0
  3. package/dist/{autocomplete-BgKbj6M4.js → autocomplete-bgySuP8X.js} +149 -142
  4. package/dist/calendar-CQumLNgS.cjs +1 -0
  5. package/dist/{calendar-j2_zvum1.js → calendar-nkYCMEy3.js} +9 -9
  6. package/dist/charts-Cot5lCgC.cjs +1 -0
  7. package/dist/{charts-CxEy2c3M.js → charts-Dscl6UC3.js} +122 -145
  8. package/dist/cn-B6R3HKzx.cjs +1 -0
  9. package/dist/{cn-DpgY2leY.js → cn-BJyZJP-y.js} +389 -389
  10. package/dist/{component-styles-Bgy44fc8.js → component-styles-C2CbHEEA.js} +2 -2
  11. package/dist/component-styles-DY4wigiq.cjs +1 -0
  12. package/dist/components/accordion.cjs +1 -1
  13. package/dist/components/accordion.js +2 -2
  14. package/dist/components/alert.cjs +1 -1
  15. package/dist/components/alert.js +3 -3
  16. package/dist/components/aspect-ratio.cjs +1 -1
  17. package/dist/components/aspect-ratio.js +1 -1
  18. package/dist/components/auth-backdrop.cjs +1 -1
  19. package/dist/components/auth-backdrop.d.ts +4 -1
  20. package/dist/components/auth-backdrop.js +12 -8
  21. package/dist/components/autocomplete/dropdown.d.ts +4 -1
  22. package/dist/components/autocomplete/multi-trigger.d.ts +3 -1
  23. package/dist/components/autocomplete/single-trigger.d.ts +3 -1
  24. package/dist/components/autocomplete/types.d.ts +15 -0
  25. package/dist/components/autocomplete.cjs +1 -1
  26. package/dist/components/autocomplete.js +1 -1
  27. package/dist/components/avatar-group.cjs +1 -1
  28. package/dist/components/avatar-group.js +1 -1
  29. package/dist/components/avatar.cjs +1 -1
  30. package/dist/components/avatar.js +2 -2
  31. package/dist/components/badge.cjs +1 -1
  32. package/dist/components/badge.js +1 -1
  33. package/dist/components/billing-interval-toggle.cjs +1 -1
  34. package/dist/components/billing-interval-toggle.d.ts +4 -6
  35. package/dist/components/billing-interval-toggle.js +26 -19
  36. package/dist/components/blockquote.cjs +1 -1
  37. package/dist/components/blockquote.js +3 -3
  38. package/dist/components/breadcrumb.cjs +1 -1
  39. package/dist/components/breadcrumb.js +2 -2
  40. package/dist/components/button-group.cjs +1 -1
  41. package/dist/components/button-group.js +1 -1
  42. package/dist/components/button.cjs +1 -1
  43. package/dist/components/button.d.ts +2 -0
  44. package/dist/components/button.js +79 -36
  45. package/dist/components/calendar.cjs +1 -1
  46. package/dist/components/calendar.js +1 -1
  47. package/dist/components/callout.cjs +1 -1
  48. package/dist/components/callout.js +14 -14
  49. package/dist/components/card.cjs +1 -1
  50. package/dist/components/card.js +1 -1
  51. package/dist/components/charts/shared.d.ts +15 -0
  52. package/dist/components/charts.cjs +1 -1
  53. package/dist/components/charts.js +1 -1
  54. package/dist/components/checkbox.cjs +1 -1
  55. package/dist/components/checkbox.js +3 -3
  56. package/dist/components/code.cjs +3 -3
  57. package/dist/components/code.js +4 -4
  58. package/dist/components/command.cjs +1 -1
  59. package/dist/components/command.d.ts +8 -1
  60. package/dist/components/command.js +84 -83
  61. package/dist/components/confirm-dialog.cjs +1 -1
  62. package/dist/components/confirm-dialog.d.ts +8 -1
  63. package/dist/components/confirm-dialog.js +37 -31
  64. package/dist/components/copy-button.cjs +1 -1
  65. package/dist/components/copy-button.js +3 -2
  66. package/dist/components/currency.cjs +1 -1
  67. package/dist/components/currency.js +1 -1
  68. package/dist/components/datatable/types.d.ts +4 -0
  69. package/dist/components/datatable.cjs +1 -1
  70. package/dist/components/datatable.d.ts +1 -5
  71. package/dist/components/datatable.js +1 -1
  72. package/dist/components/datepicker.cjs +1 -1
  73. package/dist/components/datepicker.d.ts +3 -3
  74. package/dist/components/datepicker.js +234 -105
  75. package/dist/components/description-list.cjs +1 -1
  76. package/dist/components/description-list.js +1 -1
  77. package/dist/components/divider.cjs +1 -1
  78. package/dist/components/divider.js +1 -1
  79. package/dist/components/drawer.cjs +1 -1
  80. package/dist/components/drawer.d.ts +6 -1
  81. package/dist/components/drawer.js +128 -2
  82. package/dist/components/dropdown-menu-panel.cjs +1 -0
  83. package/dist/components/dropdown-menu-panel.d.ts +24 -0
  84. package/dist/components/dropdown-menu-panel.js +84 -0
  85. package/dist/components/dropdown-menu.cjs +1 -1
  86. package/dist/components/dropdown-menu.d.ts +5 -1
  87. package/dist/components/dropdown-menu.js +38 -93
  88. package/dist/components/empty-state.cjs +1 -1
  89. package/dist/components/empty-state.d.ts +5 -1
  90. package/dist/components/empty-state.js +9 -9
  91. package/dist/components/error-state.cjs +1 -1
  92. package/dist/components/error-state.js +2 -2
  93. package/dist/components/file-upload.cjs +1 -1
  94. package/dist/components/file-upload.js +4 -4
  95. package/dist/components/form-field.cjs +1 -1
  96. package/dist/components/form-field.d.ts +9 -0
  97. package/dist/components/form-field.js +49 -14
  98. package/dist/components/info-button.cjs +1 -1
  99. package/dist/components/info-button.d.ts +5 -3
  100. package/dist/components/info-button.js +33 -29
  101. package/dist/components/input.cjs +1 -1
  102. package/dist/components/input.js +3 -3
  103. package/dist/components/kbd.cjs +1 -1
  104. package/dist/components/kbd.js +1 -1
  105. package/dist/components/label.cjs +1 -1
  106. package/dist/components/label.js +2 -2
  107. package/dist/components/layout.cjs +1 -1
  108. package/dist/components/layout.js +1 -1
  109. package/dist/components/link.cjs +1 -1
  110. package/dist/components/link.js +1 -1
  111. package/dist/components/list.cjs +1 -1
  112. package/dist/components/list.js +1 -1
  113. package/dist/components/modal.cjs +1 -1
  114. package/dist/components/modal.d.ts +8 -1
  115. package/dist/components/modal.js +74 -120
  116. package/dist/components/navigation.cjs +1 -1
  117. package/dist/components/navigation.js +2 -2
  118. package/dist/components/number-input.cjs +1 -1
  119. package/dist/components/number-input.js +3 -3
  120. package/dist/components/otp-input.cjs +1 -1
  121. package/dist/components/otp-input.js +2 -2
  122. package/dist/components/overlay.cjs +1 -0
  123. package/dist/components/overlay.d.ts +52 -0
  124. package/dist/components/overlay.js +87 -0
  125. package/dist/components/pagination.cjs +1 -1
  126. package/dist/components/pagination.js +2 -2
  127. package/dist/components/popover.cjs +1 -1
  128. package/dist/components/popover.d.ts +2 -1
  129. package/dist/components/popover.js +41 -40
  130. package/dist/components/progressbar.cjs +1 -1
  131. package/dist/components/progressbar.js +1 -1
  132. package/dist/components/radio.cjs +1 -1
  133. package/dist/components/radio.js +3 -3
  134. package/dist/components/rating.cjs +1 -1
  135. package/dist/components/rating.js +3 -3
  136. package/dist/components/richtext.cjs +1 -1
  137. package/dist/components/richtext.js +2 -2
  138. package/dist/components/scroll-area.cjs +1 -1
  139. package/dist/components/scroll-area.js +3 -3
  140. package/dist/components/select/option-list.d.ts +3 -1
  141. package/dist/components/select/types.d.ts +4 -0
  142. package/dist/components/select.cjs +1 -1
  143. package/dist/components/select.js +1 -1
  144. package/dist/components/seo.cjs +1 -1
  145. package/dist/components/seo.js +1 -1
  146. package/dist/components/separator.cjs +1 -1
  147. package/dist/components/separator.js +1 -1
  148. package/dist/components/skeleton.cjs +1 -1
  149. package/dist/components/skeleton.d.ts +14 -1
  150. package/dist/components/skeleton.js +56 -4
  151. package/dist/components/slider.cjs +1 -1
  152. package/dist/components/slider.js +2 -2
  153. package/dist/components/slot.cjs +1 -0
  154. package/dist/components/slot.d.ts +12 -0
  155. package/dist/components/slot.js +16 -0
  156. package/dist/components/snackbar-viewport.cjs +1 -0
  157. package/dist/components/snackbar-viewport.d.ts +27 -0
  158. package/dist/components/snackbar-viewport.js +181 -0
  159. package/dist/components/snackbar.cjs +1 -1
  160. package/dist/components/snackbar.d.ts +5 -1
  161. package/dist/components/snackbar.js +36 -200
  162. package/dist/components/spinner.cjs +1 -1
  163. package/dist/components/spinner.js +1 -1
  164. package/dist/components/stat.cjs +1 -1
  165. package/dist/components/stat.js +1 -1
  166. package/dist/components/status-dot.cjs +1 -1
  167. package/dist/components/status-dot.js +1 -1
  168. package/dist/components/stepper.cjs +1 -1
  169. package/dist/components/stepper.js +5 -5
  170. package/dist/components/switch.cjs +1 -1
  171. package/dist/components/switch.js +37 -43
  172. package/dist/components/table.cjs +1 -1
  173. package/dist/components/table.js +1 -1
  174. package/dist/components/tabs.cjs +1 -1
  175. package/dist/components/tabs.d.ts +6 -4
  176. package/dist/components/tabs.js +51 -81
  177. package/dist/components/tag.cjs +1 -1
  178. package/dist/components/tag.js +1 -1
  179. package/dist/components/terminal.cjs +1 -1
  180. package/dist/components/terminal.js +1 -1
  181. package/dist/components/textarea.cjs +1 -1
  182. package/dist/components/textarea.js +3 -3
  183. package/dist/components/theme-provider.cjs +1 -1
  184. package/dist/components/theme-provider.js +1 -1
  185. package/dist/components/theme-toggle.cjs +1 -1
  186. package/dist/components/theme-toggle.js +27 -3
  187. package/dist/components/time-picker.cjs +1 -1
  188. package/dist/components/time-picker.d.ts +2 -0
  189. package/dist/components/time-picker.js +206 -148
  190. package/dist/components/timeline.cjs +1 -1
  191. package/dist/components/timeline.js +1 -1
  192. package/dist/components/toggle.cjs +1 -1
  193. package/dist/components/toggle.js +2 -2
  194. package/dist/components/tooltip.cjs +1 -1
  195. package/dist/components/tooltip.d.ts +2 -1
  196. package/dist/components/tooltip.js +37 -36
  197. package/dist/components/tree.cjs +1 -1
  198. package/dist/components/tree.js +1 -1
  199. package/dist/components/typography.cjs +1 -1
  200. package/dist/components/typography.d.ts +2 -3
  201. package/dist/components/typography.js +37 -24
  202. package/dist/components/visually-hidden.cjs +1 -0
  203. package/dist/components/visually-hidden.d.ts +16 -0
  204. package/dist/components/visually-hidden.js +13 -0
  205. package/dist/{datatable-yBN4M3UV.js → datatable-BJoZMrKI.js} +6 -6
  206. package/dist/datatable-t0U7t_xh.cjs +1 -0
  207. package/dist/icons-Dfetr1L2.cjs +1 -0
  208. package/dist/icons-Dk7VZ4Ph.js +51 -0
  209. package/dist/index.cjs +1 -1
  210. package/dist/index.d.ts +4 -0
  211. package/dist/index.js +126 -99
  212. package/dist/lib/cn.d.ts +13 -1
  213. package/dist/lib/component-styles.d.ts +14 -2
  214. package/dist/lib/icons.d.ts +12 -0
  215. package/dist/lib/motion.d.ts +58 -0
  216. package/dist/motion-B2shivEB.cjs +1 -0
  217. package/dist/motion-gnRzFS5f.js +62 -0
  218. package/dist/select-ByjnuEcE.cjs +1 -0
  219. package/dist/{select-ClWrcj3R.js → select-CiMzLhUK.js} +128 -122
  220. package/dist/styles.css +1 -1
  221. package/dist/{terminal-CpraMs50.cjs → terminal-1U0ftG3i.cjs} +2 -2
  222. package/dist/{terminal-BOR2cFi1.js → terminal-VXdxVoAv.js} +4 -4
  223. package/dist/use-focus-trap-CPLT49gN.cjs +1 -0
  224. package/dist/use-focus-trap-CS6BXJAB.js +77 -0
  225. package/dist/{utils-CQ8pvCtk.js → utils-DEw5mQrH.js} +1 -1
  226. package/dist/{utils-DOFJTw8o.cjs → utils-MnnCTelh.cjs} +1 -1
  227. package/package.json +56 -9
  228. package/dist/autocomplete-Bk4pRQ2R.cjs +0 -1
  229. package/dist/calendar-CUXpVrVE.cjs +0 -1
  230. package/dist/charts-UDqS1BH1.cjs +0 -1
  231. package/dist/cn-BdjraxxU.cjs +0 -1
  232. package/dist/component-styles-DOUctc8_.cjs +0 -1
  233. package/dist/createLucideIcon-DDY8HuQR.js +0 -42
  234. package/dist/createLucideIcon-b_X_3fj-.cjs +0 -1
  235. package/dist/datatable-rzDgQ3r6.cjs +0 -1
  236. package/dist/drawer-CTeBsYrO.cjs +0 -1
  237. package/dist/drawer-ixuzyLVS.js +0 -189
  238. package/dist/select-BFwx--uK.cjs +0 -1
  239. package/dist/theme-toggle-Bb0BYo51.js +0 -71
  240. package/dist/theme-toggle-Cld8tktJ.cjs +0 -1
package/README.md CHANGED
@@ -72,6 +72,11 @@ The component documentation and live demos are published to
72
72
  the latest documentation through GitHub Pages; maintainers can also run the
73
73
  **Deploy documentation** workflow manually from the Actions tab.
74
74
 
75
+ ## Maintainer
76
+
77
+ `@bzync/rui` is maintained by [Rayan Reynaldo](https://www.bzync.com), Founder of Bzync
78
+ ([www.bzync.com](https://www.bzync.com)).
79
+
75
80
  ## Support
76
81
 
77
82
  If `@bzync/rui` is useful to you, you can support its continued development on
@@ -0,0 +1 @@
1
+ const e=require("./cn-B6R3HKzx.cjs"),t=require("./component-styles-DY4wigiq.cjs"),n=require("./utils-MnnCTelh.cjs"),r=require("./use-event-callback-Du9_9eAi.cjs");let i=require("framer-motion"),a=require("react"),o=require("react/jsx-runtime"),s=require("react-dom");var c=({size:e=12})=>(0,o.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,o.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})}),l=()=>(0,o.jsxs)(`svg`,{className:`animate-spin shrink-0 w-3.5 h-3.5 text-slate-500`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,o.jsx)(`circle`,{className:`opacity-20`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`}),(0,o.jsx)(`path`,{className:`opacity-70`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]});function u({text:e,query:t}){if(!t)return(0,o.jsx)(o.Fragment,{children:e});let n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?(0,o.jsx)(o.Fragment,{children:e}):(0,o.jsxs)(o.Fragment,{children:[e.slice(0,n),(0,o.jsx)(`mark`,{className:`bg-accent-500/25 text-accent-700 dark:text-accent-200 rounded-sm not-italic`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function d({inputRef:n,inputId:r,listId:i,open:a,activeIdx:s,inputText:u,prefix:d,placeholder:f,disabled:p,error:m,loading:h,showClear:g,onInputChange:_,onFocus:v,onKeyDown:y,onClear:b,messageId:x,inputProps:S,className:C,inputClassName:w}){return(0,o.jsxs)(`div`,{className:e.t(`flex h-9 items-center gap-2 rounded-[var(--radius-md)] px-3`,t.t,m&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25`,p&&`opacity-50 cursor-not-allowed`,C),children:[d&&(0,o.jsx)(`span`,{className:`text-slate-500 shrink-0 text-sm`,children:d}),(0,o.jsx)(`input`,{...S,ref:n,id:r,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":a,"aria-controls":i,"aria-activedescendant":s>=0?`${i}-opt-${s}`:void 0,"aria-invalid":m?!0:void 0,"aria-describedby":x,autoComplete:`off`,value:u,onChange:_,onFocus:v,onKeyDown:y,placeholder:f,disabled:p,className:e.t(`flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed`,w)}),h&&(0,o.jsx)(l,{}),g&&!h&&(0,o.jsx)(`button`,{type:`button`,onClick:b,className:`shrink-0 text-slate-500 hover:text-slate-600 dark:hover:text-slate-300 cursor-pointer transition-colors`,children:(0,o.jsx)(c,{})})]})}function f({inputRef:n,inputId:r,listId:i,open:a,activeIdx:s,inputText:u,prefix:d,placeholder:f,disabled:p,error:m,loading:h,showClear:g,selected:_,onContainerClick:v,onInputChange:y,onFocus:b,onKeyDown:x,onRemove:S,onClearAll:C,messageId:w,inputProps:T,className:ee,inputClassName:E}){return(0,o.jsxs)(`div`,{onClick:v,className:e.t(`flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-[var(--radius-md)] px-2.5 py-1.5 cursor-text`,t.t,m&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25`,p&&`opacity-50 cursor-not-allowed`,ee),children:[d&&(0,o.jsx)(`span`,{className:`text-slate-500 shrink-0 text-sm`,children:d}),_.map(e=>(0,o.jsxs)(`span`,{className:`inline-flex max-w-[200px] items-center gap-1 rounded-md border border-border bg-surface-muted px-2 py-0.5 text-xs font-medium text-foreground`,children:[e.icon&&(0,o.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400`,children:e.icon}),(0,o.jsx)(`span`,{className:`truncate`,children:e.label}),(0,o.jsx)(`button`,{type:`button`,tabIndex:-1,onMouseDown:e=>e.preventDefault(),onClick:t=>{t.stopPropagation(),S(e)},disabled:p,className:`shrink-0 text-slate-500 dark:text-slate-400 hover:text-foreground transition-colors cursor-pointer ml-0.5`,"aria-label":`Remove ${e.label}`,children:(0,o.jsx)(c,{size:10})})]},String(e.value))),(0,o.jsx)(`input`,{...T,ref:n,id:r,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":a,"aria-controls":i,"aria-activedescendant":s>=0?`${i}-opt-${s}`:void 0,"aria-invalid":m?!0:void 0,"aria-describedby":w,autoComplete:`off`,value:u,onChange:y,onFocus:b,onKeyDown:x,placeholder:_.length===0?f:void 0,disabled:p,className:e.t(`flex-1 min-w-[80px] bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed py-0.5`,E)}),(0,o.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5 shrink-0`,children:[h&&(0,o.jsx)(l,{}),g&&!h&&(0,o.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:e=>{e.stopPropagation(),C()},className:`text-slate-500 hover:text-slate-600 dark:hover:text-slate-300 transition-colors`,"aria-label":`Clear all`,children:(0,o.jsx)(c,{})}),_.length>0&&(0,o.jsx)(`span`,{className:`text-[10px] font-medium text-slate-500 tabular-nums`,children:_.length})]})]})}function p({listRef:t,listId:n,open:r,pos:a,multiple:c,loading:d,filtered:f,emptyMessage:p,activeIdx:m,setActiveIdx:h,inputText:g,selectedValues:_,singleValue:v,onSelectSingle:y,onToggleMulti:b,className:x,optionClassName:S,loadingClassName:C,emptyClassName:w}){return typeof document>`u`?null:(0,s.createPortal)((0,o.jsx)(i.AnimatePresence,{children:r&&a&&(0,o.jsx)(i.motion.ul,{ref:t,id:n,role:`listbox`,"aria-multiselectable":c,initial:{opacity:0,y:a.placement===`bottom`?-4:4},animate:{opacity:1,y:0},exit:{opacity:0,y:a.placement===`bottom`?-4:4},transition:{duration:.13},style:{position:`fixed`,top:a.top,left:a.left,width:a.width,maxHeight:a.maxHeight},className:e.t(`z-[110] overflow-y-auto rounded-[var(--radius-lg)] border border-border bg-surface-raised py-1 shadow-floating`,x),children:d?(0,o.jsxs)(`li`,{className:e.t(`px-4 py-3 text-sm text-slate-600 flex items-center gap-2`,C),children:[(0,o.jsx)(l,{}),`Loading…`]}):f.length===0?(0,o.jsx)(`li`,{className:e.t(`px-4 py-3 text-sm text-slate-600`,w),children:p}):f.map((t,r)=>{let i=r===m,a=c?_.includes(t.value):t.value===v;return(0,o.jsxs)(`li`,{id:`${n}-opt-${r}`,role:`option`,"aria-selected":a,onMouseDown:e=>e.preventDefault(),onClick:()=>c?b(t):y(t),onMouseEnter:()=>h(r),className:e.t(`flex min-h-9 items-center gap-3 px-3 py-2 cursor-pointer transition-colors`,i&&`bg-surface-muted`,a&&!i&&`bg-accent-50 dark:bg-accent-500/10`,S),children:[t.icon&&(0,o.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400`,children:t.icon}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`p`,{className:e.t(`text-sm`,a?`text-accent-700 dark:text-accent-300 font-medium`:`text-foreground`),children:(0,o.jsx)(u,{text:t.label,query:g})}),t.description&&(0,o.jsx)(`p`,{className:`text-xs text-slate-500 mt-0.5 truncate`,children:t.description})]}),a&&(0,o.jsx)(`svg`,{"aria-hidden":`true`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-accent-600 shrink-0`,children:(0,o.jsx)(`path`,{d:`m20 6-11 11-5-5`})})]},String(t.value))})})}),document.body)}function m(i,s){let{options:c,inputValue:l,onInputChange:u,label:m,hint:h,error:g,prefix:_,clearable:v=!0,loading:y=!1,emptyMessage:b=`No results`,maxVisible:x=8,className:S,wrapperClassName:C,triggerClassName:w,inputClassName:T,labelClassName:ee,messageClassName:E,listClassName:te,optionClassName:ne,loadingClassName:re,emptyClassName:ie,placeholder:D,disabled:O,id:ae,multiple:k,unstyled:oe=!1,...se}=i,{value:ce,onSelect:le,onDeselect:ue,...A}=se,de=(0,a.useId)(),j=ae??de,M=`${j}-list`,N=`${j}-message`,[fe,pe]=(0,a.useState)(``),P=l===void 0?fe:l,me=r.t(e=>u?.(e)),F=(0,a.useCallback)(e=>{l===void 0?pe(e):me(e)},[l,me]),[he,I]=(0,a.useState)([]),L=(0,a.useMemo)(()=>{if(!k)return[];let e=i;return e.value===void 0?he:c.filter(t=>e.value.includes(t.value))},[k,c,i,he]),R=(0,a.useMemo)(()=>L.map(e=>e.value),[L]),[z,B]=(0,a.useState)(!1),[V,H]=(0,a.useState)(-1),U=(0,a.useRef)(null),W=(0,a.useRef)(null),G=(0,a.useRef)(null),[K,q]=(0,a.useState)(``),J=(0,a.useMemo)(()=>{let e=K.trim().toLowerCase();return c.filter(t=>!t.disabled&&t.label.toLowerCase().includes(e)).slice(0,x)},[c,K,x]),Y=(0,a.useCallback)(e=>{i.onSelect?.(e),F(e.label),B(!1),H(-1)},[i,F]),ge=(0,a.useCallback)(e=>{let t=i,n=[...L,e];t.value===void 0&&I(n),t.onSelect?.(e,n),F(``),H(-1),W.current?.focus()},[L,i,F]),X=(0,a.useCallback)(e=>{let t=i,n=L.filter(t=>t.value!==e.value);t.value===void 0&&I(n),t.onDeselect?.(e,n)},[L,i]),Z=(0,a.useCallback)(e=>{R.includes(e.value)?X(e):ge(e)},[R,X,ge]),_e=(0,a.useCallback)(()=>{F(``),i.onSelect?.({value:``,label:``}),B(!1)},[i,F]),ve=(0,a.useCallback)(()=>{i.value===void 0&&I([]),F(``)},[i,F]),ye=(0,a.useCallback)(e=>{if(k&&e.key===`Backspace`&&P===``&&L.length>0){X(L[L.length-1]);return}if(!z){(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(B(!0),q(``));return}if(e.key===`ArrowDown`)e.preventDefault(),H(e=>Math.min(e+1,J.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),H(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let t=J[V];if(!t)return;k?Z(t):Y(t)}else e.key===`Escape`&&(B(!1),H(-1))},[k,P,L,z,J,V,Z,Y,X]);(0,a.useEffect)(()=>{V<0||!G.current||G.current.children[V]?.scrollIntoView({block:`nearest`})},[V]),(0,a.useEffect)(()=>{function e(e){let t=e.target;!U.current?.contains(t)&&!G.current?.contains(t)&&B(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let be=k?void 0:i.value,xe=!!(!k&&v&&P.length>0&&!O),Se=!!(k&&v&&(L.length>0||P.length>0)&&!O),Ce=n.o(z,U),Q=(0,a.useCallback)(e=>{F(e.target.value),q(e.target.value),B(!0),H(-1)},[F]),$=(0,a.useCallback)(()=>{B(!0),q(``)},[]);return oe?(0,o.jsxs)(`div`,{ref:U,className:e.t(S,C),children:[(0,o.jsx)(`input`,{ref:s,id:j,value:P,onChange:Q,placeholder:D,disabled:O}),z&&(0,o.jsx)(`ul`,{ref:G,id:M,className:te,children:J.map(e=>(0,o.jsx)(`li`,{onClick:()=>k?Z(e):Y(e),children:e.label},String(e.value)))})]}):(0,o.jsxs)(`div`,{ref:U,className:e.t(`relative`,t.o,C,S),children:[m&&(0,o.jsxs)(`label`,{htmlFor:j,className:e.t(`text-xs font-semibold leading-5 text-foreground`,ee),children:[m,se.required&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 text-destructive`,children:`*`}),(0,o.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),!k&&(0,o.jsx)(d,{inputRef:s,inputId:j,listId:M,open:z,activeIdx:V,inputText:P,prefix:_,placeholder:D,disabled:O,error:g,loading:y,showClear:xe,onInputChange:Q,onFocus:$,onKeyDown:ye,onClear:_e,messageId:g||h?N:void 0,inputProps:A,className:w,inputClassName:T}),k&&(0,o.jsx)(f,{inputRef:e=>{W.current=e,typeof s==`function`?s(e):s&&(s.current=e)},inputId:j,listId:M,open:z,activeIdx:V,inputText:P,prefix:_,placeholder:D,disabled:O,error:g,loading:y,showClear:Se,selected:L,onContainerClick:()=>{O||(W.current?.focus(),B(!0),q(``))},onInputChange:Q,onFocus:$,onKeyDown:ye,onRemove:X,onClearAll:ve,messageId:g||h?N:void 0,inputProps:A,className:w,inputClassName:T}),(0,o.jsx)(p,{listRef:G,listId:M,open:z,pos:Ce,multiple:k,loading:y,filtered:J,emptyMessage:b,activeIdx:V,setActiveIdx:H,inputText:K,selectedValues:R,singleValue:be,onSelectSingle:Y,onToggleMulti:Z,className:te,optionClassName:ne,loadingClassName:re,emptyClassName:ie}),g&&(0,o.jsx)(`p`,{id:N,"aria-live":`polite`,className:e.t(`text-xs leading-5 text-destructive`,E),children:g}),h&&!g&&(0,o.jsx)(`p`,{id:N,className:e.t(`text-xs leading-5 text-muted-foreground`,E),children:h})]})}var h=(0,a.forwardRef)(m);Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
@@ -1,6 +1,6 @@
1
- import { t as e } from "./cn-DpgY2leY.js";
2
- import { o as t, t as n } from "./component-styles-Bgy44fc8.js";
3
- import { o as r } from "./utils-CQ8pvCtk.js";
1
+ import { t as e } from "./cn-BJyZJP-y.js";
2
+ import { o as t, t as n } from "./component-styles-C2CbHEEA.js";
3
+ import { o as r } from "./utils-DEw5mQrH.js";
4
4
  import { t as i } from "./use-event-callback-DGkfO_uu.js";
5
5
  import { AnimatePresence as a, motion as o } from "framer-motion";
6
6
  import { forwardRef as s, useCallback as c, useEffect as l, useId as u, useMemo as d, useRef as f, useState as p } from "react";
@@ -40,7 +40,7 @@ function b({ text: e, query: t }) {
40
40
  return n === -1 ? /* @__PURE__ */ h(m, { children: e }) : /* @__PURE__ */ g(m, { children: [
41
41
  e.slice(0, n),
42
42
  /* @__PURE__ */ h("mark", {
43
- className: "bg-blue-500/25 text-blue-700 dark:text-blue-200 rounded-sm not-italic",
43
+ className: "bg-accent-500/25 text-accent-700 dark:text-accent-200 rounded-sm not-italic",
44
44
  children: e.slice(n, n + t.length)
45
45
  }),
46
46
  e.slice(n + t.length)
@@ -48,9 +48,9 @@ function b({ text: e, query: t }) {
48
48
  }
49
49
  //#endregion
50
50
  //#region src/components/autocomplete/single-trigger.tsx
51
- function x({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputText: s, prefix: c, placeholder: l, disabled: u, error: d, loading: f, showClear: p, onInputChange: m, onFocus: _, onKeyDown: b, onClear: x, messageId: S, inputProps: C }) {
51
+ function x({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputText: s, prefix: c, placeholder: l, disabled: u, error: d, loading: f, showClear: p, onInputChange: m, onFocus: _, onKeyDown: b, onClear: x, messageId: S, inputProps: C, className: w, inputClassName: T }) {
52
52
  return /* @__PURE__ */ g("div", {
53
- className: e("flex h-9 items-center gap-2 rounded-[var(--radius-md)] px-3", n, d && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20", u && "opacity-50 cursor-not-allowed"),
53
+ className: e("flex h-9 items-center gap-2 rounded-[var(--radius-md)] px-3", n, d && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25", u && "opacity-50 cursor-not-allowed", w),
54
54
  children: [
55
55
  c && /* @__PURE__ */ h("span", {
56
56
  className: "text-slate-500 shrink-0 text-sm",
@@ -74,7 +74,7 @@ function x({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputTex
74
74
  onKeyDown: b,
75
75
  placeholder: l,
76
76
  disabled: u,
77
- className: "flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed"
77
+ className: e("flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed", T)
78
78
  }),
79
79
  f && /* @__PURE__ */ h(y, {}),
80
80
  p && !f && /* @__PURE__ */ h("button", {
@@ -88,10 +88,10 @@ function x({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputTex
88
88
  }
89
89
  //#endregion
90
90
  //#region src/components/autocomplete/multi-trigger.tsx
91
- function S({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputText: s, prefix: c, placeholder: l, disabled: u, error: d, loading: f, showClear: p, selected: m, onContainerClick: _, onInputChange: b, onFocus: x, onKeyDown: S, onRemove: C, onClearAll: w, messageId: T, inputProps: E }) {
91
+ function S({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputText: s, prefix: c, placeholder: l, disabled: u, error: d, loading: f, showClear: p, selected: m, onContainerClick: _, onInputChange: b, onFocus: x, onKeyDown: S, onRemove: C, onClearAll: w, messageId: T, inputProps: E, className: ee, inputClassName: D }) {
92
92
  return /* @__PURE__ */ g("div", {
93
93
  onClick: _,
94
- className: e("flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-[var(--radius-md)] px-2.5 py-1.5 cursor-text", n, d && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20", u && "opacity-50 cursor-not-allowed"),
94
+ className: e("flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-[var(--radius-md)] px-2.5 py-1.5 cursor-text", n, d && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25", u && "opacity-50 cursor-not-allowed", ee),
95
95
  children: [
96
96
  c && /* @__PURE__ */ h("span", {
97
97
  className: "text-slate-500 shrink-0 text-sm",
@@ -116,7 +116,7 @@ function S({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputTex
116
116
  t.stopPropagation(), C(e);
117
117
  },
118
118
  disabled: u,
119
- className: "shrink-0 text-slate-500 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white transition-colors cursor-pointer ml-0.5",
119
+ className: "shrink-0 text-slate-500 dark:text-slate-400 hover:text-foreground transition-colors cursor-pointer ml-0.5",
120
120
  "aria-label": `Remove ${e.label}`,
121
121
  children: /* @__PURE__ */ h(v, { size: 10 })
122
122
  })
@@ -140,7 +140,7 @@ function S({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputTex
140
140
  onKeyDown: S,
141
141
  placeholder: m.length === 0 ? l : void 0,
142
142
  disabled: u,
143
- className: "flex-1 min-w-[80px] bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed py-0.5"
143
+ className: e("flex-1 min-w-[80px] bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed py-0.5", D)
144
144
  }),
145
145
  /* @__PURE__ */ g("span", {
146
146
  className: "ml-auto flex items-center gap-1.5 shrink-0",
@@ -167,7 +167,7 @@ function S({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputTex
167
167
  }
168
168
  //#endregion
169
169
  //#region src/components/autocomplete/dropdown.tsx
170
- function C({ listRef: t, listId: n, open: r, pos: i, multiple: s, loading: c, filtered: l, emptyMessage: u, activeIdx: d, setActiveIdx: f, inputText: p, selectedValues: m, singleValue: v, onSelectSingle: x, onToggleMulti: S, className: C }) {
170
+ function C({ listRef: t, listId: n, open: r, pos: i, multiple: s, loading: c, filtered: l, emptyMessage: u, activeIdx: d, setActiveIdx: f, inputText: p, selectedValues: m, singleValue: v, onSelectSingle: x, onToggleMulti: S, className: C, optionClassName: w, loadingClassName: T, emptyClassName: E }) {
171
171
  return typeof document > "u" ? null : _(/* @__PURE__ */ h(a, { children: r && i && /* @__PURE__ */ h(o.ul, {
172
172
  ref: t,
173
173
  id: n,
@@ -195,10 +195,10 @@ function C({ listRef: t, listId: n, open: r, pos: i, multiple: s, loading: c, fi
195
195
  },
196
196
  className: e("z-[110] overflow-y-auto rounded-[var(--radius-lg)] border border-border bg-surface-raised py-1 shadow-floating", C),
197
197
  children: c ? /* @__PURE__ */ g("li", {
198
- className: "px-4 py-3 text-sm text-slate-600 flex items-center gap-2",
198
+ className: e("px-4 py-3 text-sm text-slate-600 flex items-center gap-2", T),
199
199
  children: [/* @__PURE__ */ h(y, {}), "Loading…"]
200
200
  }) : l.length === 0 ? /* @__PURE__ */ h("li", {
201
- className: "px-4 py-3 text-sm text-slate-600",
201
+ className: e("px-4 py-3 text-sm text-slate-600", E),
202
202
  children: u
203
203
  }) : l.map((t, r) => {
204
204
  let i = r === d, a = s ? m.includes(t.value) : t.value === v;
@@ -209,7 +209,7 @@ function C({ listRef: t, listId: n, open: r, pos: i, multiple: s, loading: c, fi
209
209
  onMouseDown: (e) => e.preventDefault(),
210
210
  onClick: () => s ? S(t) : x(t),
211
211
  onMouseEnter: () => f(r),
212
- className: e("flex min-h-9 items-center gap-3 px-3 py-2 cursor-pointer transition-colors", i && "bg-surface-muted", a && !i && "bg-accent-50 dark:bg-accent-500/10"),
212
+ className: e("flex min-h-9 items-center gap-3 px-3 py-2 cursor-pointer transition-colors", i && "bg-surface-muted", a && !i && "bg-accent-50 dark:bg-accent-500/10", w),
213
213
  children: [
214
214
  t.icon && /* @__PURE__ */ h("span", {
215
215
  className: "shrink-0 text-slate-500 dark:text-slate-400",
@@ -249,118 +249,118 @@ function C({ listRef: t, listId: n, open: r, pos: i, multiple: s, loading: c, fi
249
249
  //#endregion
250
250
  //#region src/components/autocomplete.tsx
251
251
  function w(n, a) {
252
- let { options: o, inputValue: s, onInputChange: _, label: v, hint: y, error: b, prefix: w, clearable: T = !0, loading: E = !1, emptyMessage: ee = "No results", maxVisible: te = 8, className: ne, wrapperClassName: re, listClassName: ie, placeholder: D, disabled: O, id: ae, multiple: k, unstyled: oe = !1, ...A } = n, { value: se, onSelect: ce, onDeselect: le, ...j } = A, ue = u(), M = ae ?? ue, N = `${M}-list`, P = `${M}-message`, [de, fe] = p(""), F = s === void 0 ? de : s, pe = i((e) => _?.(e)), I = c((e) => {
253
- s === void 0 ? fe(e) : pe(e);
254
- }, [s, pe]), [me, L] = p([]), R = d(() => {
255
- if (!k) return [];
252
+ let { options: o, inputValue: s, onInputChange: _, label: v, hint: y, error: b, prefix: w, clearable: T = !0, loading: E = !1, emptyMessage: ee = "No results", maxVisible: D = 8, className: te, wrapperClassName: ne, triggerClassName: re, inputClassName: ie, labelClassName: ae, messageClassName: oe, listClassName: se, optionClassName: ce, loadingClassName: le, emptyClassName: ue, placeholder: O, disabled: k, id: de, multiple: A, unstyled: fe = !1, ...pe } = n, { value: me, onSelect: he, onDeselect: ge, ..._e } = pe, ve = u(), j = de ?? ve, M = `${j}-list`, N = `${j}-message`, [ye, be] = p(""), P = s === void 0 ? ye : s, xe = i((e) => _?.(e)), F = c((e) => {
253
+ s === void 0 ? be(e) : xe(e);
254
+ }, [s, xe]), [Se, I] = p([]), L = d(() => {
255
+ if (!A) return [];
256
256
  let e = n;
257
- return e.value === void 0 ? me : o.filter((t) => e.value.includes(t.value));
257
+ return e.value === void 0 ? Se : o.filter((t) => e.value.includes(t.value));
258
258
  }, [
259
- k,
259
+ A,
260
260
  o,
261
261
  n,
262
- me
263
- ]), z = d(() => R.map((e) => e.value), [R]), [B, V] = p(!1), [H, U] = p(-1), W = f(null), G = f(null), K = f(null), [q, J] = p(""), Y = d(() => {
264
- let e = q.trim().toLowerCase();
265
- return o.filter((t) => !t.disabled && t.label.toLowerCase().includes(e)).slice(0, te);
262
+ Se
263
+ ]), R = d(() => L.map((e) => e.value), [L]), [z, B] = p(!1), [V, H] = p(-1), U = f(null), W = f(null), G = f(null), [K, q] = p(""), J = d(() => {
264
+ let e = K.trim().toLowerCase();
265
+ return o.filter((t) => !t.disabled && t.label.toLowerCase().includes(e)).slice(0, D);
266
266
  }, [
267
267
  o,
268
- q,
269
- te
270
- ]), X = c((e) => {
271
- n.onSelect?.(e), I(e.label), V(!1), U(-1);
272
- }, [n, I]), he = c((e) => {
273
- let t = n, r = [...R, e];
274
- t.value === void 0 && L(r), t.onSelect?.(e, r), I(""), U(-1), G.current?.focus();
268
+ K,
269
+ D
270
+ ]), Y = c((e) => {
271
+ n.onSelect?.(e), F(e.label), B(!1), H(-1);
272
+ }, [n, F]), Ce = c((e) => {
273
+ let t = n, r = [...L, e];
274
+ t.value === void 0 && I(r), t.onSelect?.(e, r), F(""), H(-1), W.current?.focus();
275
275
  }, [
276
- R,
276
+ L,
277
277
  n,
278
- I
279
- ]), Z = c((e) => {
280
- let t = n, r = R.filter((t) => t.value !== e.value);
281
- t.value === void 0 && L(r), t.onDeselect?.(e, r);
282
- }, [R, n]), Q = c((e) => {
283
- z.includes(e.value) ? Z(e) : he(e);
278
+ F
279
+ ]), X = c((e) => {
280
+ let t = n, r = L.filter((t) => t.value !== e.value);
281
+ t.value === void 0 && I(r), t.onDeselect?.(e, r);
282
+ }, [L, n]), Z = c((e) => {
283
+ R.includes(e.value) ? X(e) : Ce(e);
284
284
  }, [
285
- z,
286
- Z,
287
- he
288
- ]), ge = c(() => {
289
- I(""), n.onSelect?.({
285
+ R,
286
+ X,
287
+ Ce
288
+ ]), we = c(() => {
289
+ F(""), n.onSelect?.({
290
290
  value: "",
291
291
  label: ""
292
- }), V(!1);
293
- }, [n, I]), _e = c(() => {
294
- n.value === void 0 && L([]), I("");
295
- }, [n, I]), ve = c((e) => {
296
- if (k && e.key === "Backspace" && F === "" && R.length > 0) {
297
- Z(R[R.length - 1]);
292
+ }), B(!1);
293
+ }, [n, F]), Te = c(() => {
294
+ n.value === void 0 && I([]), F("");
295
+ }, [n, F]), Ee = c((e) => {
296
+ if (A && e.key === "Backspace" && P === "" && L.length > 0) {
297
+ X(L[L.length - 1]);
298
298
  return;
299
299
  }
300
- if (!B) {
301
- (e.key === "ArrowDown" || e.key === "ArrowUp") && (V(!0), J(""));
300
+ if (!z) {
301
+ (e.key === "ArrowDown" || e.key === "ArrowUp") && (B(!0), q(""));
302
302
  return;
303
303
  }
304
- if (e.key === "ArrowDown") e.preventDefault(), U((e) => Math.min(e + 1, Y.length - 1));
305
- else if (e.key === "ArrowUp") e.preventDefault(), U((e) => Math.max(e - 1, 0));
304
+ if (e.key === "ArrowDown") e.preventDefault(), H((e) => Math.min(e + 1, J.length - 1));
305
+ else if (e.key === "ArrowUp") e.preventDefault(), H((e) => Math.max(e - 1, 0));
306
306
  else if (e.key === "Enter") {
307
307
  e.preventDefault();
308
- let t = Y[H];
308
+ let t = J[V];
309
309
  if (!t) return;
310
- k ? Q(t) : X(t);
311
- } else e.key === "Escape" && (V(!1), U(-1));
310
+ A ? Z(t) : Y(t);
311
+ } else e.key === "Escape" && (B(!1), H(-1));
312
312
  }, [
313
- k,
314
- F,
315
- R,
316
- B,
313
+ A,
314
+ P,
315
+ L,
316
+ z,
317
+ J,
318
+ V,
319
+ Z,
317
320
  Y,
318
- H,
319
- Q,
320
- X,
321
- Z
321
+ X
322
322
  ]);
323
323
  l(() => {
324
- H < 0 || !K.current || K.current.children[H]?.scrollIntoView({ block: "nearest" });
325
- }, [H]), l(() => {
324
+ V < 0 || !G.current || G.current.children[V]?.scrollIntoView({ block: "nearest" });
325
+ }, [V]), l(() => {
326
326
  function e(e) {
327
327
  let t = e.target;
328
- !W.current?.contains(t) && !K.current?.contains(t) && V(!1);
328
+ !U.current?.contains(t) && !G.current?.contains(t) && B(!1);
329
329
  }
330
330
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
331
331
  }, []);
332
- let ye = k ? void 0 : n.value, be = !!(!k && T && F.length > 0 && !O), xe = !!(k && T && (R.length > 0 || F.length > 0) && !O), Se = r(B, W), $ = c((e) => {
333
- I(e.target.value), J(e.target.value), V(!0), U(-1);
334
- }, [I]), Ce = c(() => {
335
- V(!0), J("");
332
+ let De = A ? void 0 : n.value, Oe = !!(!A && T && P.length > 0 && !k), ke = !!(A && T && (L.length > 0 || P.length > 0) && !k), Ae = r(z, U), Q = c((e) => {
333
+ F(e.target.value), q(e.target.value), B(!0), H(-1);
334
+ }, [F]), $ = c(() => {
335
+ B(!0), q("");
336
336
  }, []);
337
- return oe ? /* @__PURE__ */ g("div", {
338
- ref: W,
339
- className: e(ne, re),
337
+ return fe ? /* @__PURE__ */ g("div", {
338
+ ref: U,
339
+ className: e(te, ne),
340
340
  children: [/* @__PURE__ */ h("input", {
341
341
  ref: a,
342
+ id: j,
343
+ value: P,
344
+ onChange: Q,
345
+ placeholder: O,
346
+ disabled: k
347
+ }), z && /* @__PURE__ */ h("ul", {
348
+ ref: G,
342
349
  id: M,
343
- value: F,
344
- onChange: $,
345
- placeholder: D,
346
- disabled: O
347
- }), B && /* @__PURE__ */ h("ul", {
348
- ref: K,
349
- id: N,
350
- className: ie,
351
- children: Y.map((e) => /* @__PURE__ */ h("li", {
352
- onClick: () => k ? Q(e) : X(e),
350
+ className: se,
351
+ children: J.map((e) => /* @__PURE__ */ h("li", {
352
+ onClick: () => A ? Z(e) : Y(e),
353
353
  children: e.label
354
354
  }, String(e.value)))
355
355
  })]
356
356
  }) : /* @__PURE__ */ g("div", {
357
- ref: W,
358
- className: e("relative", t, re, ne),
357
+ ref: U,
358
+ className: e("relative", t, ne, te),
359
359
  children: [
360
360
  v && /* @__PURE__ */ g("label", {
361
- htmlFor: M,
362
- className: "text-xs font-semibold leading-5 text-foreground",
363
- children: [v, A.required && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
361
+ htmlFor: j,
362
+ className: e("text-xs font-semibold leading-5 text-foreground", ae),
363
+ children: [v, pe.required && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
364
364
  "aria-hidden": "true",
365
365
  className: "ml-1 text-destructive",
366
366
  children: "*"
@@ -369,80 +369,87 @@ function w(n, a) {
369
369
  children: " (required)"
370
370
  })] })]
371
371
  }),
372
- !k && /* @__PURE__ */ h(x, {
372
+ !A && /* @__PURE__ */ h(x, {
373
373
  inputRef: a,
374
- inputId: M,
375
- listId: N,
376
- open: B,
377
- activeIdx: H,
378
- inputText: F,
374
+ inputId: j,
375
+ listId: M,
376
+ open: z,
377
+ activeIdx: V,
378
+ inputText: P,
379
379
  prefix: w,
380
- placeholder: D,
381
- disabled: O,
380
+ placeholder: O,
381
+ disabled: k,
382
382
  error: b,
383
383
  loading: E,
384
- showClear: be,
385
- onInputChange: $,
386
- onFocus: Ce,
387
- onKeyDown: ve,
388
- onClear: ge,
389
- messageId: b || y ? P : void 0,
390
- inputProps: j
384
+ showClear: Oe,
385
+ onInputChange: Q,
386
+ onFocus: $,
387
+ onKeyDown: Ee,
388
+ onClear: we,
389
+ messageId: b || y ? N : void 0,
390
+ inputProps: _e,
391
+ className: re,
392
+ inputClassName: ie
391
393
  }),
392
- k && /* @__PURE__ */ h(S, {
394
+ A && /* @__PURE__ */ h(S, {
393
395
  inputRef: (e) => {
394
- G.current = e, typeof a == "function" ? a(e) : a && (a.current = e);
396
+ W.current = e, typeof a == "function" ? a(e) : a && (a.current = e);
395
397
  },
396
- inputId: M,
397
- listId: N,
398
- open: B,
399
- activeIdx: H,
400
- inputText: F,
398
+ inputId: j,
399
+ listId: M,
400
+ open: z,
401
+ activeIdx: V,
402
+ inputText: P,
401
403
  prefix: w,
402
- placeholder: D,
403
- disabled: O,
404
+ placeholder: O,
405
+ disabled: k,
404
406
  error: b,
405
407
  loading: E,
406
- showClear: xe,
407
- selected: R,
408
+ showClear: ke,
409
+ selected: L,
408
410
  onContainerClick: () => {
409
- O || (G.current?.focus(), V(!0), J(""));
411
+ k || (W.current?.focus(), B(!0), q(""));
410
412
  },
411
- onInputChange: $,
412
- onFocus: Ce,
413
- onKeyDown: ve,
414
- onRemove: Z,
415
- onClearAll: _e,
416
- messageId: b || y ? P : void 0,
417
- inputProps: j
413
+ onInputChange: Q,
414
+ onFocus: $,
415
+ onKeyDown: Ee,
416
+ onRemove: X,
417
+ onClearAll: Te,
418
+ messageId: b || y ? N : void 0,
419
+ inputProps: _e,
420
+ className: re,
421
+ inputClassName: ie
418
422
  }),
419
423
  /* @__PURE__ */ h(C, {
420
- listRef: K,
421
- listId: N,
422
- open: B,
423
- pos: Se,
424
- multiple: k,
424
+ listRef: G,
425
+ listId: M,
426
+ open: z,
427
+ pos: Ae,
428
+ multiple: A,
425
429
  loading: E,
426
- filtered: Y,
430
+ filtered: J,
427
431
  emptyMessage: ee,
428
- activeIdx: H,
429
- setActiveIdx: U,
430
- inputText: q,
431
- selectedValues: z,
432
- singleValue: ye,
433
- onSelectSingle: X,
434
- onToggleMulti: Q,
435
- className: ie
432
+ activeIdx: V,
433
+ setActiveIdx: H,
434
+ inputText: K,
435
+ selectedValues: R,
436
+ singleValue: De,
437
+ onSelectSingle: Y,
438
+ onToggleMulti: Z,
439
+ className: se,
440
+ optionClassName: ce,
441
+ loadingClassName: le,
442
+ emptyClassName: ue
436
443
  }),
437
444
  b && /* @__PURE__ */ h("p", {
438
- id: P,
445
+ id: N,
439
446
  "aria-live": "polite",
440
- className: "text-xs leading-5 text-destructive",
447
+ className: e("text-xs leading-5 text-destructive", oe),
441
448
  children: b
442
449
  }),
443
450
  y && !b && /* @__PURE__ */ h("p", {
444
- id: P,
445
- className: "text-xs leading-5 text-muted-foreground",
451
+ id: N,
452
+ className: e("text-xs leading-5 text-muted-foreground", oe),
446
453
  children: y
447
454
  })
448
455
  ]
@@ -0,0 +1 @@
1
+ const e=require("./cn-B6R3HKzx.cjs"),t=require("./component-styles-DY4wigiq.cjs");let n=require("framer-motion"),r=require("react"),i=require("react/jsx-runtime");var a=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],o=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],s=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],c={blue:`bg-blue-500/12 text-blue-400 border-blue-500/20`,green:`bg-emerald-500/12 text-emerald-400 border-emerald-500/20`,red:`bg-red-500/12 text-red-400 border-red-500/20`,yellow:`bg-amber-500/12 text-amber-400 border-amber-500/20`,purple:`bg-violet-500/12 text-violet-400 border-violet-500/20`,orange:`bg-orange-500/12 text-orange-400 border-orange-500/20`};function l(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function u(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function d(e){let t=new Date(e);return t.setDate(t.getDate()-t.getDay()),t}var f={enter:e=>({opacity:0,x:e*16}),center:{opacity:1,x:0},exit:e=>({opacity:0,x:e*-16})};function p({viewDate:t,today:n,value:r,events:o,onSelect:s,onEventClick:u,isDateDisabled:d,onEventCreate:f,onEventDelete:p,editingId:m,onEditToggle:h,onUpdateTitle:g}){let _=t.getFullYear(),v=t.getMonth(),y=new Date(_,v+1,0).getDate(),b=new Date(_,v,1).getDay(),x=[...Array(b).fill(null),...Array.from({length:y},(e,t)=>new Date(_,v,t+1))];for(;x.length%7!=0;)x.push(null);function S(e){return o.filter(t=>l(t.date,e))}return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{role:`row`,className:`grid grid-cols-7 border-b border-border`,children:a.map(e=>(0,i.jsx)(`div`,{role:`columnheader`,className:`py-2.5 text-center text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e},e))}),(0,i.jsx)(`div`,{role:`grid`,className:`grid grid-cols-7`,style:{gridTemplateRows:`repeat(${x.length/7}, minmax(80px, 1fr))`},children:x.map((t,a)=>{let o=a%7==6,h=a>=x.length-7;if(!t)return(0,i.jsx)(`div`,{role:`gridcell`,className:e.t(`border-black/6 dark:border-white/6 bg-black/[0.015] dark:bg-white/[0.015]`,!o&&`border-r`,!h&&`border-b`)},`e${a}`);let g=S(t),_=n?l(t,n):!1,y=r?l(t,r):!1,b=t.getMonth()===v,C=d?.(t)??!1;return(0,i.jsxs)(`div`,{role:`gridcell`,tabIndex:C?void 0:0,"aria-label":t.toLocaleDateString(void 0,{dateStyle:`full`}),"aria-disabled":C||void 0,"aria-selected":y,onClick:()=>!C&&s(t),onKeyDown:e=>{!C&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(t))},className:e.t(`p-1.5 transition-colors group/cell`,`border-border focus-visible:z-10 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-focus-ring/35`,!o&&`border-r`,!h&&`border-b`,!b&&`bg-black/[0.015] dark:bg-white/[0.015]`,C?`cursor-not-allowed opacity-40`:`cursor-pointer hover:bg-surface-muted`),children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,i.jsx)(`span`,{className:e.t(`w-6 h-6 rounded-full flex items-center justify-center text-xs font-medium`,y?`bg-primary text-primary-foreground`:_?`border border-accent-500/50 text-accent-600 dark:text-accent-300`:b?`text-slate-700 dark:text-slate-200`:`text-slate-400 dark:text-slate-600`),children:t.getDate()}),f&&!C&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Add event on ${t.toLocaleDateString()}`,onClick:e=>{e.stopPropagation(),f(t)},className:`opacity-0 group-hover/cell:opacity-100 focus:opacity-100 w-5 h-5 rounded-md bg-primary text-primary-foreground flex items-center justify-center text-[10px] hover:bg-primary-hover transition-opacity`,children:`+`})]}),(0,i.jsxs)(`div`,{className:`space-y-0.5`,children:[g.slice(0,2).map(t=>{let n=m===t.id;return(0,i.jsxs)(`div`,{className:e.t(`group/ev flex items-center gap-0.5 rounded border px-1 py-0.5`,c[t.color??`blue`],n&&`ring-1 ring-focus-ring`),children:[(0,i.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),u?.(t)},className:`min-w-0 flex-1 truncate text-left text-[10px] font-medium`,children:[t.time&&(0,i.jsx)(`span`,{className:`opacity-60 mr-1`,children:t.time}),t.title]}),p&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Delete ${t.title}`,onClick:e=>{e.stopPropagation(),p(t.id)},className:`flex size-4 shrink-0 items-center justify-center rounded text-[10px] leading-none opacity-60 hover:bg-muted hover:opacity-100`,children:`×`})]},t.id)}),g.length>2&&(0,i.jsxs)(`p`,{className:`text-[10px] text-slate-500 px-1`,children:[`+`,g.length-2,` more`]})]})]},t.toISOString())})})]})}function m({viewDate:t,today:n,value:r,events:a,onSelect:s,onEventClick:f,isDateDisabled:p,onEventCreate:m,onEventDelete:h,editingId:g,onEditToggle:_,onUpdateTitle:v}){let y=d(t),b=Array.from({length:7},(e,t)=>u(y,t));function x(e){return a.filter(t=>l(t.date,e))}return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{role:`row`,className:`grid grid-cols-7 border-b border-border`,children:b.map(t=>{let a=n?l(t,n):!1,c=r?l(t,r):!1,u=p?.(t)??!1;return(0,i.jsxs)(`div`,{role:`gridcell`,tabIndex:u?void 0:0,"aria-selected":c,"aria-disabled":u||void 0,"aria-label":t.toLocaleDateString(void 0,{dateStyle:`full`}),onClick:()=>!u&&s(t),onKeyDown:e=>{!u&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(t))},className:e.t(`group/whead flex flex-col items-center gap-1 py-3 transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-focus-ring/35`,u?`cursor-not-allowed opacity-40`:`cursor-pointer hover:bg-surface-muted`),children:[(0,i.jsx)(`span`,{className:`text-[10px] font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wide`,children:o[t.getDay()]}),(0,i.jsx)(`span`,{className:e.t(`w-8 h-8 rounded-full flex items-center justify-center text-sm font-semibold transition-colors`,c?`bg-primary text-primary-foreground`:a?`border border-accent-500/50 text-accent-600 dark:text-accent-300`:`text-slate-700 dark:text-slate-200`),children:t.getDate()}),m&&!u&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Add event on ${t.toLocaleDateString()}`,onClick:e=>{e.stopPropagation(),m(t)},className:`opacity-0 group-hover/whead:opacity-100 focus:opacity-100 h-5 px-1.5 rounded-md bg-primary text-primary-foreground text-[10px] hover:bg-primary-hover`,children:`+ Add`})]},t.toISOString())})}),(0,i.jsx)(`div`,{className:`grid grid-cols-7 min-h-[200px]`,children:b.map((t,n)=>{let r=x(t),a=n===6,o=p?.(t)??!1;return(0,i.jsx)(`div`,{role:`gridcell`,tabIndex:o?void 0:0,"aria-disabled":o||void 0,"aria-label":`${t.toLocaleDateString(void 0,{dateStyle:`full`})} events`,onClick:()=>!o&&s(t),onKeyDown:e=>{!o&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(t))},className:e.t(`space-y-1.5 p-2 transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-focus-ring/35`,!a&&`border-r border-border`,o?`cursor-not-allowed opacity-40`:`cursor-pointer hover:bg-surface-muted/70`),children:r.map(t=>(0,i.jsxs)(`div`,{className:e.t(`group/wev flex items-start gap-1 rounded-[var(--radius-md)] border px-2 py-1.5`,c[t.color??`blue`],g===t.id&&`ring-1 ring-focus-ring`),children:[(0,i.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),f?.(t)},className:`min-w-0 flex-1 text-left`,children:[t.time&&(0,i.jsx)(`div`,{className:`text-[10px] opacity-60 mb-0.5`,children:t.time}),(0,i.jsx)(`div`,{className:`text-xs font-medium truncate`,children:t.title})]}),h&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Delete ${t.title}`,onClick:e=>{e.stopPropagation(),h(t.id)},className:`flex size-5 shrink-0 items-center justify-center rounded text-xs opacity-60 hover:bg-muted hover:opacity-100`,children:`×`})]},t.id))},t.toISOString())})})]})}function h({value:a,defaultValue:o=null,onChange:c,events:l,defaultEvents:h=[],onEventsChange:g,onEventClick:_,onEventCreate:v,onEventUpdate:y,onEventDelete:b,editable:x=!1,view:S,defaultView:C=`month`,onViewChange:ee,viewDate:w,defaultViewDate:T,onViewDateChange:te,minDate:E,maxDate:D,disabledDates:O,className:ne}){let[re,ie]=(0,r.useState)(null),[ae,oe]=(0,r.useState)(o),[se,ce]=(0,r.useState)(C),[k,A]=(0,r.useState)(T??null),[le,ue]=(0,r.useState)(()=>l??h),[j,M]=(0,r.useState)(1),[N,P]=(0,r.useState)(null),[F,I]=(0,r.useState)(``),[L,de]=(0,r.useState)(`blue`),[R,z]=(0,r.useState)(`09:00`),[B,V]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=new Date;ie(e),T===void 0&&w===void 0&&A(new Date(e.getFullYear(),e.getMonth(),1))},[]),(0,r.useEffect)(()=>{w===void 0&&T!==void 0&&k===null&&A(T?new Date(T):null)},[T]);let fe=a===void 0?ae:a,H=S===void 0?se:S,U=w===void 0?k:w,W=l!==void 0,G=W?l:le;function K(e){return!!(E&&e<new Date(E.getFullYear(),E.getMonth(),E.getDate())||D&&e>new Date(D.getFullYear(),D.getMonth(),D.getDate(),23,59,59,999)||O?.(e))}function pe(e){S===void 0&&ce(e),ee?.(e)}function q(e){e!==null&&(w===void 0&&A(e),te?.(e))}function J(e){K(e)||(a===void 0&&oe(e),c?.(e))}function me(e){return e&&(H===`month`?new Date(e.getFullYear(),e.getMonth()-1,1):u(e,-7))}function he(e){return e&&(H===`month`?new Date(e.getFullYear(),e.getMonth()+1,1):u(e,7))}function ge(){M(-1),q(me(U))}function _e(){M(1),q(he(U))}function ve(){let e=new Date;M(0),q(new Date(e.getFullYear(),e.getMonth(),1)),J(e)}function Y(e){W||ue(e),g?.(e)}function X(e,t){if(K(e))return;let n={id:typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():String(Date.now()+Math.random()),title:t?.trim()||F.trim()||`New event`,date:new Date(e),color:L,time:R||void 0};Y([...G,n]),v?.(n),P(null),I(``),z(`09:00`)}function Z(e){Y(G.filter(t=>t.id!==e)),b?.(e),B===e&&V(null)}function Q(e){Y(G.map(t=>t.id===e.id?e:t)),y?.(e),V(null)}function ye(e){x&&V(t=>t===e.id?null:e.id),_?.(e)}let $=``;if(U){if(H===`month`)$=`${s[U.getMonth()]} ${U.getFullYear()}`;else{let e=d(U),t=u(e,6);$=e.getMonth()===t.getMonth()?`${s[e.getMonth()].slice(0,3)} ${e.getDate()} \u2013 ${t.getDate()}, ${e.getFullYear()}`:`${s[e.getMonth()].slice(0,3)} ${e.getDate()} \u2013 ${s[t.getMonth()].slice(0,3)} ${t.getDate()}, ${e.getFullYear()}`}}let be=x||!!v||!!y||!!b||!!g,xe={today:re,value:fe,events:G,onSelect:J,onEventClick:ye,onEventCreate:be?e=>P(e):void 0,onEventDelete:be||b?Z:void 0,onEventUpdate:y,editingId:B,onEditToggle:e=>V(t=>t===e?null:e),onUpdateTitle:(e,t)=>{let n=G.find(t=>t.id===e);n&&Q({...n,title:t})},minDate:E,maxDate:D,disabledDates:O,isDateDisabled:K},Se=U?`${H}-${U.toISOString()}`:null;return(0,i.jsxs)(`div`,{className:e.t(`flex flex-col overflow-hidden rounded-[var(--radius-lg)] border border-border bg-surface`,ne),children:[(0,i.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-border px-3 py-3 sm:px-4`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,i.jsx)(`button`,{type:`button`,onClick:ge,"aria-label":`Previous ${H}`,className:e.t(t.c,`size-8`),children:(0,i.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`m15 18-6-6 6-6`})})}),(0,i.jsx)(`button`,{type:`button`,onClick:_e,"aria-label":`Next ${H}`,className:e.t(t.c,`size-8`),children:(0,i.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`m9 18 6-6-6-6`})})})]}),(0,i.jsx)(`span`,{"aria-live":`polite`,className:`min-w-[9rem] flex-1 select-none text-sm font-semibold text-foreground`,children:$}),(0,i.jsx)(`button`,{type:`button`,onClick:ve,className:e.t(`h-8 rounded-[var(--radius-md)] border border-border px-3 text-xs font-medium text-muted-foreground transition-colors hover:border-border-strong hover:bg-muted hover:text-foreground`,t.s),children:`Today`}),(0,i.jsx)(`div`,{role:`group`,"aria-label":`Calendar view`,className:`flex overflow-hidden rounded-[var(--radius-md)] border border-border`,children:[`month`,`week`].map(n=>(0,i.jsx)(`button`,{type:`button`,onClick:()=>pe(n),"aria-pressed":H===n,className:e.t(`h-8 px-3 text-xs capitalize transition-colors focus-visible:z-10`,t.s,H===n?`bg-muted text-foreground font-medium`:`text-muted-foreground hover:bg-surface-muted hover:text-foreground`),children:n},n))})]}),N&&(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border bg-warning/8 px-3 py-3 sm:px-4`,children:[(0,i.jsxs)(`span`,{className:`text-xs font-medium text-foreground`,children:[`New event on `,N.toLocaleDateString(),`:`]}),(0,i.jsx)(`input`,{autoFocus:!0,value:F,onChange:e=>I(e.target.value),onKeyDown:e=>{e.key===`Enter`&&X(N),e.key===`Escape`&&(P(null),I(``),z(`09:00`))},placeholder:`Event title`,className:`h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25`}),(0,i.jsx)(`input`,{type:`time`,value:R,onChange:e=>z(e.target.value),className:`h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25`}),(0,i.jsxs)(`select`,{"aria-label":`Event color`,value:L,onChange:e=>de(e.target.value),className:`h-7 rounded-[var(--radius-md)] border border-border bg-surface px-2 text-xs text-foreground`,children:[(0,i.jsx)(`option`,{value:`blue`,children:`Blue`}),(0,i.jsx)(`option`,{value:`green`,children:`Green`}),(0,i.jsx)(`option`,{value:`red`,children:`Red`}),(0,i.jsx)(`option`,{value:`yellow`,children:`Yellow`}),(0,i.jsx)(`option`,{value:`purple`,children:`Purple`}),(0,i.jsx)(`option`,{value:`orange`,children:`Orange`})]}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>X(N),className:`h-7 px-3 rounded-md bg-primary text-xs font-medium text-primary-foreground hover:bg-primary-hover`,children:`Add`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>{P(null),I(``),z(`09:00`)},className:`h-7 rounded-[var(--radius-md)] border border-border bg-surface px-2.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:`Cancel`})]}),B&&(()=>{let e=G.find(e=>e.id===B);return e?(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border bg-surface-muted px-3 py-3 sm:px-4`,children:[(0,i.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Edit event:`}),(0,i.jsx)(`input`,{autoFocus:!0,defaultValue:e.title,onKeyDown:t=>{if(t.key===`Enter`){let n=t.target.value,r=document.getElementById(`cal-edit-time-${e.id}`)?.value??e.time??``;n.trim()&&Q({...e,title:n.trim(),time:r||void 0})}t.key===`Escape`&&V(null)},id:`cal-edit-${e.id}`,placeholder:`Title`,className:`h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25`}),(0,i.jsx)(`input`,{type:`time`,defaultValue:e.time??``,id:`cal-edit-time-${e.id}`,className:`h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>{let t=document.getElementById(`cal-edit-${e.id}`),n=document.getElementById(`cal-edit-time-${e.id}`),r=t?.value??e.title,i=n?.value??``;r.trim()&&Q({...e,title:r.trim(),time:i||void 0})},className:`h-7 px-3 rounded-md bg-primary text-xs font-medium text-primary-foreground hover:bg-primary-hover`,children:`Save`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>Z(e.id),className:`h-7 rounded-[var(--radius-md)] bg-destructive px-2.5 text-xs font-medium text-destructive-foreground hover:bg-destructive-hover`,children:`Delete`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>V(null),className:`h-7 rounded-[var(--radius-md)] border border-border bg-surface px-2.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:`Cancel`})]}):null})(),(0,i.jsx)(`div`,{className:`relative flex-1 overflow-x-auto`,children:(0,i.jsx)(`div`,{className:`min-w-[42rem]`,children:(0,i.jsx)(n.AnimatePresence,{mode:`popLayout`,initial:!1,custom:j,children:Se!==null&&U!==null&&(0,i.jsx)(n.motion.div,{custom:j,variants:f,initial:`enter`,animate:`center`,exit:`exit`,transition:{duration:.18,ease:`easeInOut`},children:H===`month`?(0,i.jsx)(p,{viewDate:U,...xe}):(0,i.jsx)(m,{viewDate:U,...xe})},Se)})})})]})}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
@@ -1,5 +1,5 @@
1
- import { t as e } from "./cn-DpgY2leY.js";
2
- import { c as t, s as n } from "./component-styles-Bgy44fc8.js";
1
+ import { t as e } from "./cn-BJyZJP-y.js";
2
+ import { c as t, s as n } from "./component-styles-C2CbHEEA.js";
3
3
  import { AnimatePresence as r, motion as i } from "framer-motion";
4
4
  import { useEffect as a, useState as o } from "react";
5
5
  import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
@@ -103,7 +103,7 @@ function v({ viewDate: t, today: n, value: r, events: i, onSelect: a, onEventCli
103
103
  onKeyDown: (e) => {
104
104
  !S && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a(t));
105
105
  },
106
- className: e("p-1.5 transition-colors group/cell", "border-border focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring/35", !s && "border-r", !u && "border-b", !x && "bg-black/[0.015] dark:bg-white/[0.015]", S ? "cursor-not-allowed opacity-40" : "cursor-pointer hover:bg-surface-muted"),
106
+ className: e("p-1.5 transition-colors group/cell", "border-border focus-visible:z-10 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-focus-ring/35", !s && "border-r", !u && "border-b", !x && "bg-black/[0.015] dark:bg-white/[0.015]", S ? "cursor-not-allowed opacity-40" : "cursor-pointer hover:bg-surface-muted"),
107
107
  children: [/* @__PURE__ */ l("div", {
108
108
  className: "flex items-center justify-between mb-1",
109
109
  children: [/* @__PURE__ */ c("span", {
@@ -179,7 +179,7 @@ function y({ viewDate: t, today: n, value: r, events: i, onSelect: a, onEventCli
179
179
  onKeyDown: (e) => {
180
180
  !s && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a(t));
181
181
  },
182
- className: e("group/whead flex flex-col items-center gap-1 py-3 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring/35", s ? "cursor-not-allowed opacity-40" : "cursor-pointer hover:bg-surface-muted"),
182
+ className: e("group/whead flex flex-col items-center gap-1 py-3 transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-focus-ring/35", s ? "cursor-not-allowed opacity-40" : "cursor-pointer hover:bg-surface-muted"),
183
183
  children: [
184
184
  /* @__PURE__ */ c("span", {
185
185
  className: "text-[10px] font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wide",
@@ -214,7 +214,7 @@ function y({ viewDate: t, today: n, value: r, events: i, onSelect: a, onEventCli
214
214
  onKeyDown: (e) => {
215
215
  !s && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a(t));
216
216
  },
217
- className: e("space-y-1.5 p-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring/35", !i && "border-r border-border", s ? "cursor-not-allowed opacity-40" : "cursor-pointer hover:bg-surface-muted/70"),
217
+ className: e("space-y-1.5 p-2 transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-focus-ring/35", !i && "border-r border-border", s ? "cursor-not-allowed opacity-40" : "cursor-pointer hover:bg-surface-muted/70"),
218
218
  children: r.map((t) => /* @__PURE__ */ l("div", {
219
219
  className: e("group/wev flex items-start gap-1 rounded-[var(--radius-md)] border px-2 py-1.5", p[t.color ?? "blue"], v === t.id && "ring-1 ring-focus-ring"),
220
220
  children: [/* @__PURE__ */ l("button", {
@@ -423,13 +423,13 @@ function b({ value: s, defaultValue: u = null, onChange: d, events: p, defaultEv
423
423
  e.key === "Enter" && Ce(P), e.key === "Escape" && (F(null), L(""), B("09:00"));
424
424
  },
425
425
  placeholder: "Event title",
426
- className: "h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-focus-ring/25"
426
+ className: "h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25"
427
427
  }),
428
428
  /* @__PURE__ */ c("input", {
429
429
  type: "time",
430
430
  value: z,
431
431
  onChange: (e) => B(e.target.value),
432
- className: "h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-focus-ring/25"
432
+ className: "h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25"
433
433
  }),
434
434
  /* @__PURE__ */ l("select", {
435
435
  "aria-label": "Event color",
@@ -504,13 +504,13 @@ function b({ value: s, defaultValue: u = null, onChange: d, events: p, defaultEv
504
504
  },
505
505
  id: `cal-edit-${e.id}`,
506
506
  placeholder: "Title",
507
- className: "h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-focus-ring/25"
507
+ className: "h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25"
508
508
  }),
509
509
  /* @__PURE__ */ c("input", {
510
510
  type: "time",
511
511
  defaultValue: e.time ?? "",
512
512
  id: `cal-edit-time-${e.id}`,
513
- className: "h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-focus-ring/25"
513
+ className: "h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25"
514
514
  }),
515
515
  /* @__PURE__ */ c("button", {
516
516
  type: "button",