@gv-tech/ui-web 2.19.0 → 2.21.0

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 (287) hide show
  1. package/dist/accordion-Be1vGv6M.js +1 -0
  2. package/dist/accordion-DXnU0LgU.mjs +221 -0
  3. package/dist/accordion.cjs +1 -1
  4. package/dist/accordion.mjs +3 -259
  5. package/dist/alert-dialog-BXRY0Ghq.js +7 -0
  6. package/dist/alert-dialog-fcZ-sL7h.mjs +164 -0
  7. package/dist/alert-dialog.cjs +1 -7
  8. package/dist/alert-dialog.mjs +4 -171
  9. package/dist/alert.cjs +1 -1
  10. package/dist/alert.mjs +35 -32
  11. package/dist/aspect-ratio-BP5HarYZ.js +1 -0
  12. package/dist/aspect-ratio-Bp8HMg-1.mjs +33 -0
  13. package/dist/aspect-ratio.cjs +1 -1
  14. package/dist/aspect-ratio.mjs +3 -43
  15. package/dist/avatar-klFl8Sqa.js +1 -0
  16. package/dist/avatar-vGm9JN1a.mjs +184 -0
  17. package/dist/avatar.cjs +1 -1
  18. package/dist/avatar.mjs +3 -205
  19. package/dist/badge.cjs +1 -1
  20. package/dist/badge.mjs +21 -24
  21. package/dist/breadcrumb.cjs +1 -1
  22. package/dist/breadcrumb.mjs +60 -68
  23. package/dist/button.cjs +1 -1
  24. package/dist/button.mjs +40 -40
  25. package/dist/calendar-aIuSXzs7.js +1 -0
  26. package/dist/calendar-oitID53a.mjs +3154 -0
  27. package/dist/calendar.cjs +1 -1
  28. package/dist/calendar.mjs +4 -2976
  29. package/dist/card.cjs +1 -1
  30. package/dist/card.mjs +42 -32
  31. package/dist/carousel-BjTSkVh9.js +1 -0
  32. package/dist/carousel-CENzZCXN.mjs +1178 -0
  33. package/dist/carousel.cjs +1 -1
  34. package/dist/carousel.mjs +4 -1403
  35. package/dist/chart.cjs +4 -4
  36. package/dist/chart.d.ts +3 -35
  37. package/dist/chart.mjs +123 -182
  38. package/dist/checkbox-Bwq7mXA2.mjs +170 -0
  39. package/dist/checkbox-DzEO1q4R.js +1 -0
  40. package/dist/checkbox.cjs +1 -1
  41. package/dist/checkbox.mjs +3 -258
  42. package/dist/collapsible.cjs +1 -1
  43. package/dist/collapsible.mjs +6 -7
  44. package/dist/command-D7hksKY6.js +1 -0
  45. package/dist/command-Ws_iF1hM.mjs +531 -0
  46. package/dist/command.cjs +1 -1
  47. package/dist/command.mjs +3 -396
  48. package/dist/context-menu-DJbgNJ7N.js +1 -0
  49. package/dist/context-menu-fu39gePi.mjs +292 -0
  50. package/dist/context-menu.cjs +1 -1
  51. package/dist/context-menu.mjs +3 -328
  52. package/dist/dialog.cjs +1 -1
  53. package/dist/dialog.mjs +50 -66
  54. package/dist/dist-0FXx-pUX.js +1 -0
  55. package/dist/dist-4A0ut6a8.mjs +10 -0
  56. package/dist/dist-ALQAoSGx.mjs +10 -0
  57. package/dist/dist-B4N_7Tps.js +1 -0
  58. package/dist/dist-B5776DvK.js +5 -0
  59. package/dist/dist-B57mzJP3.mjs +28 -0
  60. package/dist/dist-B5VmV2K7.js +1 -0
  61. package/dist/dist-BBRD-Qfb.js +1 -0
  62. package/dist/dist-BC_VB6JL.mjs +25 -0
  63. package/dist/dist-BKFtvTm8.mjs +6 -0
  64. package/dist/dist-BUS_s_6N.js +1 -0
  65. package/dist/dist-BVKPqhkg.js +1 -0
  66. package/dist/dist-Ba7mQG9D.mjs +117 -0
  67. package/dist/dist-BeFCyPgD.js +1 -0
  68. package/dist/dist-Bf4P28CV.js +1 -0
  69. package/dist/dist-BfFVoFJN.js +1 -0
  70. package/dist/dist-BhtQH_6Z.js +1 -0
  71. package/dist/dist-BmjFh8i_.mjs +5 -0
  72. package/dist/dist-BrCTkQXt.mjs +62 -0
  73. package/dist/dist-BxmpAHsT.mjs +219 -0
  74. package/dist/dist-C2ArLRnq.js +1 -0
  75. package/dist/dist-C2pRTcV_.mjs +62 -0
  76. package/dist/dist-C9wnUiS4.mjs +27 -0
  77. package/dist/dist-CIRItnqs.js +1 -0
  78. package/dist/dist-CL1DhkaL.js +1 -0
  79. package/dist/dist-CRe7xawr.js +1 -0
  80. package/dist/dist-CUFjt0cI.js +1 -0
  81. package/dist/dist-CaaGWewc.mjs +557 -0
  82. package/dist/dist-Ci2whnVp.js +1 -0
  83. package/dist/dist-CmBtqW5f.js +1 -0
  84. package/dist/dist-CsEsK2jW.js +1 -0
  85. package/dist/dist-CscAxhT8.js +1 -0
  86. package/dist/dist-CvtF5JdF.mjs +95 -0
  87. package/dist/dist-Cvwtowos.mjs +77 -0
  88. package/dist/dist-D2f83VMO.mjs +73 -0
  89. package/dist/dist-Dh_jWJh-.mjs +11 -0
  90. package/dist/dist-DikyKBU3.mjs +12 -0
  91. package/dist/dist-DmmUjo_P.js +1 -0
  92. package/dist/dist-DqvQ5UFr.mjs +38 -0
  93. package/dist/dist-FGQAMrhH.mjs +29 -0
  94. package/dist/dist-Jtk3jeb9.mjs +18 -0
  95. package/dist/dist-Kqk0oQYU.js +1 -0
  96. package/dist/dist-VI9bl_Wk.mjs +45 -0
  97. package/dist/dist-Z7lEV5Nx.mjs +1282 -0
  98. package/dist/dist-_Osar3kp.js +1 -0
  99. package/dist/dist-bDoR0CBU.mjs +112 -0
  100. package/dist/dist-cRjbOZRf.js +1 -0
  101. package/dist/dist-d_pecHgw.mjs +66 -0
  102. package/dist/dist-r36zVVcK.js +1 -0
  103. package/dist/dist-sRlXdzvf.mjs +152 -0
  104. package/dist/drawer.cjs +1 -1
  105. package/dist/drawer.mjs +48 -54
  106. package/dist/dropdown-menu-BGkQXJ-r.mjs +288 -0
  107. package/dist/dropdown-menu-uGMnmGL-.js +1 -0
  108. package/dist/dropdown-menu.cjs +1 -1
  109. package/dist/dropdown-menu.mjs +3 -316
  110. package/dist/es2015-Cx0gpR1a.js +41 -0
  111. package/dist/es2015-a1b8kENC.mjs +701 -0
  112. package/dist/form.cjs +1 -1
  113. package/dist/form.mjs +76 -67
  114. package/dist/hover-card-DdIYJP-Q.mjs +167 -0
  115. package/dist/hover-card-Ua-2KlY-.js +1 -0
  116. package/dist/hover-card.cjs +1 -1
  117. package/dist/hover-card.mjs +3 -188
  118. package/dist/index.cjs +1 -1
  119. package/dist/index.d.ts +3 -35
  120. package/dist/index.mjs +56 -296
  121. package/dist/input.cjs +1 -1
  122. package/dist/input.mjs +14 -19
  123. package/dist/jsx-runtime-CN3qjQQx.js +6 -0
  124. package/dist/jsx-runtime-CW53Uo-e.mjs +189 -0
  125. package/dist/label-8YSUv4kt.js +1 -0
  126. package/dist/label-Bur66PVg.mjs +22 -0
  127. package/dist/label.cjs +1 -1
  128. package/dist/label.mjs +3 -22
  129. package/dist/menubar-Bq1Sfbf5.js +1 -0
  130. package/dist/menubar-D2fY6zkQ.mjs +410 -0
  131. package/dist/menubar.cjs +1 -1
  132. package/dist/menubar.mjs +3 -473
  133. package/dist/navigation-menu-BuOakbgA.mjs +602 -0
  134. package/dist/navigation-menu-so6EvLAY.js +1 -0
  135. package/dist/navigation-menu.cjs +1 -1
  136. package/dist/navigation-menu.mjs +3 -673
  137. package/dist/pagination.cjs +1 -1
  138. package/dist/pagination.mjs +63 -68
  139. package/dist/popover-BUADXRkO.mjs +201 -0
  140. package/dist/popover-nBrSPqHk.js +1 -0
  141. package/dist/popover.cjs +1 -1
  142. package/dist/popover.mjs +3 -242
  143. package/dist/progress-BTApMbqg.js +6 -0
  144. package/dist/progress-BbN-RNvs.mjs +81 -0
  145. package/dist/progress.cjs +1 -6
  146. package/dist/progress.mjs +3 -99
  147. package/dist/radio-group-C5oprOrt.mjs +193 -0
  148. package/dist/radio-group-FDXr6VLM.js +1 -0
  149. package/dist/radio-group.cjs +1 -1
  150. package/dist/radio-group.mjs +3 -253
  151. package/dist/resizable-ChdgCzzx.mjs +1534 -0
  152. package/dist/resizable-ztiFzq_y.js +1 -0
  153. package/dist/resizable.cjs +1 -1
  154. package/dist/resizable.mjs +3 -1990
  155. package/dist/scroll-area-3o0-cc3n.mjs +520 -0
  156. package/dist/scroll-area-DXZqIKXN.js +1 -0
  157. package/dist/scroll-area.cjs +1 -1
  158. package/dist/scroll-area.mjs +3 -546
  159. package/dist/scroll-to-top.cjs +1 -1
  160. package/dist/scroll-to-top.mjs +71 -84
  161. package/dist/search.cjs +1 -1
  162. package/dist/search.mjs +53 -63
  163. package/dist/select-B2qM503G.mjs +744 -0
  164. package/dist/select-BHCeW-MD.js +1 -0
  165. package/dist/select.cjs +1 -1
  166. package/dist/select.mjs +3 -908
  167. package/dist/separator-BZJ-SDvg.js +1 -0
  168. package/dist/separator-DJ_IwKUQ.mjs +31 -0
  169. package/dist/separator.cjs +1 -1
  170. package/dist/separator.mjs +3 -35
  171. package/dist/sheet.cjs +1 -1
  172. package/dist/sheet.mjs +59 -66
  173. package/dist/skeleton.cjs +1 -1
  174. package/dist/skeleton.mjs +13 -7
  175. package/dist/slider-CJJPQ0fH.mjs +366 -0
  176. package/dist/slider-DHccqrW2.js +1 -0
  177. package/dist/slider.cjs +1 -1
  178. package/dist/slider.mjs +3 -442
  179. package/dist/sonner.cjs +1 -1
  180. package/dist/sonner.mjs +21 -24
  181. package/dist/support-fab.cjs +1 -1
  182. package/dist/support-fab.mjs +81 -117
  183. package/dist/switch-BbcAUYjl.mjs +103 -0
  184. package/dist/switch-DZfRzgWs.js +1 -0
  185. package/dist/switch.cjs +1 -1
  186. package/dist/switch.mjs +3 -149
  187. package/dist/table-of-contents.cjs +1 -1
  188. package/dist/table-of-contents.mjs +159 -155
  189. package/dist/table.cjs +1 -1
  190. package/dist/table.mjs +58 -57
  191. package/dist/tabs-BEy0IIV0.js +1 -0
  192. package/dist/tabs-DqAKyl9T.mjs +136 -0
  193. package/dist/tabs.cjs +1 -1
  194. package/dist/tabs.mjs +3 -195
  195. package/dist/text.cjs +1 -1
  196. package/dist/text.mjs +41 -42
  197. package/dist/textarea.cjs +1 -1
  198. package/dist/textarea.mjs +12 -17
  199. package/dist/theme-provider.cjs +1 -1
  200. package/dist/theme-provider.mjs +15 -7
  201. package/dist/theme-toggle-DKQmD-FO.js +1 -0
  202. package/dist/theme-toggle-dQbFWNI8.mjs +65 -0
  203. package/dist/theme-toggle.cjs +1 -1
  204. package/dist/theme-toggle.mjs +3 -8
  205. package/dist/toast-C84Cpidq.js +1 -0
  206. package/dist/toast-CQbUslcw.mjs +427 -0
  207. package/dist/toast.cjs +1 -1
  208. package/dist/toast.mjs +3 -494
  209. package/dist/toaster-BpcpNRz1.js +1 -0
  210. package/dist/toaster-i6giQYiq.mjs +126 -0
  211. package/dist/toaster.cjs +1 -1
  212. package/dist/toaster.mjs +3 -6
  213. package/dist/toggle-group-B2S7fkhA.mjs +155 -0
  214. package/dist/toggle-group-BNn6MNiJ.js +1 -0
  215. package/dist/toggle-group.cjs +1 -1
  216. package/dist/toggle-group.mjs +3 -170
  217. package/dist/toggle.cjs +1 -1
  218. package/dist/toggle.mjs +19 -14
  219. package/dist/tooltip-CElrNodA.js +1 -0
  220. package/dist/tooltip-oKfTBTbv.mjs +364 -0
  221. package/dist/tooltip.cjs +1 -1
  222. package/dist/tooltip.mjs +3 -342
  223. package/dist/utils-BxDanjP7.js +1 -0
  224. package/dist/utils-yc5uc46c.mjs +11 -0
  225. package/package.json +2 -2
  226. package/src/chart.tsx +7 -7
  227. package/src/setupTests.ts +5 -4
  228. package/dist/index-0ioNhtNM.mjs +0 -10
  229. package/dist/index-3j-XAIXT.mjs +0 -55
  230. package/dist/index-B2XtpfGY.js +0 -1
  231. package/dist/index-B39Lzq0v.js +0 -1
  232. package/dist/index-B7n6fy75.js +0 -1
  233. package/dist/index-B8dxbSWX.js +0 -41
  234. package/dist/index-BGIK9FQF.js +0 -1
  235. package/dist/index-BZPx6jYI.mjs +0 -8
  236. package/dist/index-BoNjHhm4.js +0 -1
  237. package/dist/index-BtZvtDmp.js +0 -1
  238. package/dist/index-Bv7qrYW6.mjs +0 -180
  239. package/dist/index-ByiPJW53.js +0 -5
  240. package/dist/index-C0dlIQIi.js +0 -1
  241. package/dist/index-C1qb0595.mjs +0 -27
  242. package/dist/index-C7HEunrh.mjs +0 -15
  243. package/dist/index-C8ni3LLa.js +0 -1
  244. package/dist/index-CCKe-Mpx.mjs +0 -6
  245. package/dist/index-CD6_IrA-.mjs +0 -10
  246. package/dist/index-CRyCZJLa.mjs +0 -677
  247. package/dist/index-CVx1AgNG.mjs +0 -615
  248. package/dist/index-Ce5TOFAK.js +0 -1
  249. package/dist/index-CeSLNJ60.mjs +0 -32
  250. package/dist/index-CefEQe_4.js +0 -1
  251. package/dist/index-Cj5hzyBi.js +0 -1
  252. package/dist/index-Cjj_rUPu.js +0 -1
  253. package/dist/index-Cl3G0jzM.js +0 -1
  254. package/dist/index-CwfE56Ep.mjs +0 -1545
  255. package/dist/index-CwyAfCwY.js +0 -1
  256. package/dist/index-CzY-WZXL.js +0 -1
  257. package/dist/index-D2HnlO3y.js +0 -1
  258. package/dist/index-DFdF7K7v.mjs +0 -50
  259. package/dist/index-DIsg7zU7.js +0 -1
  260. package/dist/index-DKN_vhyX.mjs +0 -32
  261. package/dist/index-DLcqcWxM.mjs +0 -29
  262. package/dist/index-DSxf1gN6.mjs +0 -118
  263. package/dist/index-DYxWvftI.js +0 -1
  264. package/dist/index-DaILh3TV.mjs +0 -32
  265. package/dist/index-Dfzl8TxY.mjs +0 -136
  266. package/dist/index-Dko2XdTk.js +0 -1
  267. package/dist/index-DlY82G31.mjs +0 -245
  268. package/dist/index-DnFcfnA9.mjs +0 -13
  269. package/dist/index-IZ2gq03c.mjs +0 -68
  270. package/dist/index-K9FzbxYw.mjs +0 -93
  271. package/dist/index-Le8p9oP4.mjs +0 -60
  272. package/dist/index-MQ0c3ZX_.js +0 -1
  273. package/dist/index-_XxjJPRD.js +0 -1
  274. package/dist/index-_wdrnYim.js +0 -1
  275. package/dist/index-jv3B4mTd.js +0 -1
  276. package/dist/index-kaM0u2Q1.js +0 -1
  277. package/dist/index-p6xVFRb4.mjs +0 -52
  278. package/dist/index-rKs9bXHr.mjs +0 -6
  279. package/dist/index-vuPgkS0V.mjs +0 -70
  280. package/dist/jsx-runtime-nZSsnGb7.js +0 -6
  281. package/dist/jsx-runtime-tc70JA_2.mjs +0 -264
  282. package/dist/theme-toggle-DXQGNfCe.js +0 -1
  283. package/dist/theme-toggle-tHXIbr8W.mjs +0 -79
  284. package/dist/toaster-C_S9hnXa.js +0 -1
  285. package/dist/toaster-k5DnQSsh.mjs +0 -118
  286. package/dist/utils-DY6fhrgS.mjs +0 -12
  287. package/dist/utils-cdbZV8DZ.js +0 -1
package/dist/slider.cjs CHANGED
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./jsx-runtime-nZSsnGb7.js"),le=require("react"),L=require("./index-C8ni3LLa.js"),E=require("./index-BtZvtDmp.js"),C=require("./index-_XxjJPRD.js"),de=require("./index-D2HnlO3y.js"),ue=require("./index-Ce5TOFAK.js"),fe=require("./index-Dko2XdTk.js"),me=require("./index-DYxWvftI.js"),pe=require("./index-Cjj_rUPu.js"),xe=require("./index-BGIK9FQF.js"),Se=require("./utils-cdbZV8DZ.js");function he(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=he(le);var U=["PageUp","PageDown"],F=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Y={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},_="Slider",[k,ge,ve]=xe.createCollection(_),[X]=de.createContextScope(_,[ve]),[Re,A]=X(_),G=l.forwardRef((e,t)=>{const{name:n,min:o=0,max:i=100,step:c=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:f=0,defaultValue:v=[o],value:S,onValueChange:s=()=>{},onValueCommit:u=()=>{},inverted:g=!1,form:w,...h}=e,p=l.useRef(new Set),m=l.useRef(0),R=r==="horizontal"?be:we,[x=[],M]=ue.useControllableState({prop:S,defaultProp:v,onChange:b=>{[...p.current][m.current]?.focus(),s(b)}}),T=l.useRef(x);function V(b){const y=De(x,b);K(b,y)}function ae(b){K(b,m.current)}function ce(){const b=T.current[m.current];x[m.current]!==b&&u(x)}function K(b,y,{commit:B}={commit:!1}){const $=Ke(c),N=Ie(Math.round((b-o)/c)*c+o,$),I=L.clamp(N,[o,i]);M((D=[])=>{const P=Pe(D,I,y);if(Me(P,f*c)){m.current=P.indexOf(I);const q=String(P)!==String(D);return q&&B&&u(P),q?P:D}else return D})}return d.jsxRuntimeExports.jsx(Re,{scope:e.__scopeSlider,name:n,disabled:a,min:o,max:i,valueIndexToChangeRef:m,thumbs:p.current,values:x,orientation:r,form:w,children:d.jsxRuntimeExports.jsx(k.Provider,{scope:e.__scopeSlider,children:d.jsxRuntimeExports.jsx(k.Slot,{scope:e.__scopeSlider,children:d.jsxRuntimeExports.jsx(R,{"aria-disabled":a,"data-disabled":a?"":void 0,...h,ref:t,onPointerDown:E.composeEventHandlers(h.onPointerDown,()=>{a||(T.current=x)}),min:o,max:i,inverted:g,onSlideStart:a?void 0:V,onSlideMove:a?void 0:ae,onSlideEnd:a?void 0:ce,onHomeKeyDown:()=>!a&&K(o,0,{commit:!0}),onEndKeyDown:()=>!a&&K(i,x.length-1,{commit:!0}),onStepKeyDown:({event:b,direction:y})=>{if(!a){const N=U.includes(b.key)||b.shiftKey&&F.includes(b.key)?10:1,I=m.current,D=x[I],P=c*N*y;K(D+P,I,{commit:!0})}}})})})})});G.displayName=_;var[W,J]=X(_,{startEdge:"left",endEdge:"right",size:"width",direction:1}),be=l.forwardRef((e,t)=>{const{min:n,max:o,dir:i,inverted:c,onSlideStart:r,onSlideMove:a,onSlideEnd:f,onStepKeyDown:v,...S}=e,[s,u]=l.useState(null),g=C.useComposedRefs(t,R=>u(R)),w=l.useRef(void 0),h=fe.useDirection(i),p=h==="ltr",m=p&&!c||!p&&c;function j(R){const x=w.current||s.getBoundingClientRect(),M=[0,x.width],V=z(M,m?[n,o]:[o,n]);return w.current=x,V(R-x.left)}return d.jsxRuntimeExports.jsx(W,{scope:e.__scopeSlider,startEdge:m?"left":"right",endEdge:m?"right":"left",direction:m?1:-1,size:"width",children:d.jsxRuntimeExports.jsx(Q,{dir:h,"data-orientation":"horizontal",...S,ref:g,style:{...S.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:R=>{const x=j(R.clientX);r?.(x)},onSlideMove:R=>{const x=j(R.clientX);a?.(x)},onSlideEnd:()=>{w.current=void 0,f?.()},onStepKeyDown:R=>{const M=Y[m?"from-left":"from-right"].includes(R.key);v?.({event:R,direction:M?-1:1})}})})}),we=l.forwardRef((e,t)=>{const{min:n,max:o,inverted:i,onSlideStart:c,onSlideMove:r,onSlideEnd:a,onStepKeyDown:f,...v}=e,S=l.useRef(null),s=C.useComposedRefs(t,S),u=l.useRef(void 0),g=!i;function w(h){const p=u.current||S.current.getBoundingClientRect(),m=[0,p.height],R=z(m,g?[o,n]:[n,o]);return u.current=p,R(h-p.top)}return d.jsxRuntimeExports.jsx(W,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:d.jsxRuntimeExports.jsx(Q,{"data-orientation":"vertical",...v,ref:s,style:{...v.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:h=>{const p=w(h.clientY);c?.(p)},onSlideMove:h=>{const p=w(h.clientY);r?.(p)},onSlideEnd:()=>{u.current=void 0,a?.()},onStepKeyDown:h=>{const m=Y[g?"from-bottom":"from-top"].includes(h.key);f?.({event:h,direction:m?-1:1})}})})}),Q=l.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:o,onSlideMove:i,onSlideEnd:c,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:f,...v}=e,S=A(_,n);return d.jsxRuntimeExports.jsx(E.Primitive.span,{...v,ref:t,onKeyDown:E.composeEventHandlers(e.onKeyDown,s=>{s.key==="Home"?(r(s),s.preventDefault()):s.key==="End"?(a(s),s.preventDefault()):U.concat(F).includes(s.key)&&(f(s),s.preventDefault())}),onPointerDown:E.composeEventHandlers(e.onPointerDown,s=>{const u=s.target;u.setPointerCapture(s.pointerId),s.preventDefault(),S.thumbs.has(u)?u.focus():o(s)}),onPointerMove:E.composeEventHandlers(e.onPointerMove,s=>{s.target.hasPointerCapture(s.pointerId)&&i(s)}),onPointerUp:E.composeEventHandlers(e.onPointerUp,s=>{const u=s.target;u.hasPointerCapture(s.pointerId)&&(u.releasePointerCapture(s.pointerId),c(s))})})}),Z="SliderTrack",ee=l.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,i=A(Z,n);return d.jsxRuntimeExports.jsx(E.Primitive.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...o,ref:t})});ee.displayName=Z;var H="SliderRange",te=l.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,i=A(H,n),c=J(H,n),r=l.useRef(null),a=C.useComposedRefs(t,r),f=i.values.length,v=i.values.map(u=>re(u,i.min,i.max)),S=f>1?Math.min(...v):0,s=100-Math.max(...v);return d.jsxRuntimeExports.jsx(E.Primitive.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...o,ref:a,style:{...e.style,[c.startEdge]:S+"%",[c.endEdge]:s+"%"}})});te.displayName=H;var O="SliderThumb",ne=l.forwardRef((e,t)=>{const n=ge(e.__scopeSlider),[o,i]=l.useState(null),c=C.useComposedRefs(t,a=>i(a)),r=l.useMemo(()=>o?n().findIndex(a=>a.ref.current===o):-1,[n,o]);return d.jsxRuntimeExports.jsx(Ee,{...e,ref:c,index:r})}),Ee=l.forwardRef((e,t)=>{const{__scopeSlider:n,index:o,name:i,...c}=e,r=A(O,n),a=J(O,n),[f,v]=l.useState(null),S=C.useComposedRefs(t,j=>v(j)),s=f?r.form||!!f.closest("form"):!0,u=pe.useSize(f),g=r.values[o],w=g===void 0?0:re(g,r.min,r.max),h=je(o,r.values.length),p=u?.[a.size],m=p?Ce(p,w,a.direction):0;return l.useEffect(()=>{if(f)return r.thumbs.add(f),()=>{r.thumbs.delete(f)}},[f,r.thumbs]),d.jsxRuntimeExports.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${w}% + ${m}px)`},children:[d.jsxRuntimeExports.jsx(k.ItemSlot,{scope:e.__scopeSlider,children:d.jsxRuntimeExports.jsx(E.Primitive.span,{role:"slider","aria-label":e["aria-label"]||h,"aria-valuemin":r.min,"aria-valuenow":g,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...c,ref:S,style:g===void 0?{display:"none"}:e.style,onFocus:E.composeEventHandlers(e.onFocus,()=>{r.valueIndexToChangeRef.current=o})})}),s&&d.jsxRuntimeExports.jsx(oe,{name:i??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:g},o)]})});ne.displayName=O;var ye="RadioBubbleInput",oe=l.forwardRef(({__scopeSlider:e,value:t,...n},o)=>{const i=l.useRef(null),c=C.useComposedRefs(i,o),r=me.usePrevious(t);return l.useEffect(()=>{const a=i.current;if(!a)return;const f=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(f,"value").set;if(r!==t&&S){const s=new Event("input",{bubbles:!0});S.call(a,t),a.dispatchEvent(s)}},[r,t]),d.jsxRuntimeExports.jsx(E.Primitive.input,{style:{display:"none"},...n,ref:c,defaultValue:t})});oe.displayName=ye;function Pe(e=[],t,n){const o=[...e];return o[n]=t,o.sort((i,c)=>i-c)}function re(e,t,n){const c=100/(n-t)*(e-t);return L.clamp(c,[0,100])}function je(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function De(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),o=Math.min(...n);return n.indexOf(o)}function Ce(e,t,n){const o=e/2,c=z([0,50],[0,o]);return(o-c(t)*n)*n}function _e(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Me(e,t){if(t>0){const n=_e(e);return Math.min(...n)>=t}return!0}function z(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function Ke(e){return(String(e).split(".")[1]||"").length}function Ie(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var se=G,Ae=ee,Te=te,Ve=ne;const ie=l.forwardRef(({className:e,...t},n)=>d.jsxRuntimeExports.jsxs(se,{ref:n,className:Se.cn("relative flex w-full touch-none items-center select-none",e),...t,children:[d.jsxRuntimeExports.jsx(Ae,{className:"bg-primary/20 relative h-1.5 w-full grow overflow-hidden rounded-full",children:d.jsxRuntimeExports.jsx(Te,{className:"bg-primary absolute h-full"})}),d.jsxRuntimeExports.jsx(Ve,{className:"border-primary/50 bg-background focus-visible:ring-ring block h-4 w-4 rounded-full border shadow transition-colors focus-visible:ring-1 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"})]}));ie.displayName=se?.displayName||"Slider";exports.Slider=ie;
1
+ "use client";"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./slider-DHccqrW2.js`);exports.Slider=e.t;
package/dist/slider.mjs CHANGED
@@ -1,443 +1,4 @@
1
1
  "use client";
2
- import { j as d } from "./jsx-runtime-tc70JA_2.mjs";
3
- import * as c from "react";
4
- import { c as Y } from "./index-rKs9bXHr.mjs";
5
- import { c as _, P as A } from "./index-K9FzbxYw.mjs";
6
- import { u as C } from "./index-DLcqcWxM.mjs";
7
- import { c as ce } from "./index-IZ2gq03c.mjs";
8
- import { u as de } from "./index-p6xVFRb4.mjs";
9
- import { u as ue } from "./index-CD6_IrA-.mjs";
10
- import { u as fe } from "./index-BZPx6jYI.mjs";
11
- import { u as me } from "./index-C1qb0595.mjs";
12
- import { c as pe } from "./index-DFdF7K7v.mjs";
13
- import { c as Se } from "./utils-DY6fhrgS.mjs";
14
- var $ = ["PageUp", "PageDown"], X = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], G = {
15
- "from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
16
- "from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
17
- "from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
18
- "from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
19
- }, M = "Slider", [z, he, ge] = pe(M), [W] = ce(M, [
20
- ge
21
- ]), [ve, V] = W(M), q = c.forwardRef(
22
- (e, t) => {
23
- const {
24
- name: n,
25
- min: o = 0,
26
- max: s = 100,
27
- step: l = 1,
28
- orientation: r = "horizontal",
29
- disabled: a = !1,
30
- minStepsBetweenThumbs: f = 0,
31
- defaultValue: w = [o],
32
- value: h,
33
- onValueChange: i = () => {
34
- },
35
- onValueCommit: u = () => {
36
- },
37
- inverted: v = !1,
38
- form: y,
39
- ...g
40
- } = e, p = c.useRef(/* @__PURE__ */ new Set()), m = c.useRef(0), b = r === "horizontal" ? we : be, [S = [], j] = de({
41
- prop: h,
42
- defaultProp: w,
43
- onChange: (x) => {
44
- [...p.current][m.current]?.focus(), i(x);
45
- }
46
- }), B = c.useRef(S);
47
- function T(x) {
48
- const R = De(S, x);
49
- K(x, R);
50
- }
51
- function ae(x) {
52
- K(x, m.current);
53
- }
54
- function le() {
55
- const x = B.current[m.current];
56
- S[m.current] !== x && u(S);
57
- }
58
- function K(x, R, { commit: N } = { commit: !1 }) {
59
- const U = Me(l), k = je(Math.round((x - o) / l) * l + o, U), I = Y(k, [o, s]);
60
- j((E = []) => {
61
- const P = Re(E, I, R);
62
- if (Ce(P, f * l)) {
63
- m.current = P.indexOf(I);
64
- const F = String(P) !== String(E);
65
- return F && N && u(P), F ? P : E;
66
- } else
67
- return E;
68
- });
69
- }
70
- return /* @__PURE__ */ d.jsx(
71
- ve,
72
- {
73
- scope: e.__scopeSlider,
74
- name: n,
75
- disabled: a,
76
- min: o,
77
- max: s,
78
- valueIndexToChangeRef: m,
79
- thumbs: p.current,
80
- values: S,
81
- orientation: r,
82
- form: y,
83
- children: /* @__PURE__ */ d.jsx(z.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ d.jsx(z.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ d.jsx(
84
- b,
85
- {
86
- "aria-disabled": a,
87
- "data-disabled": a ? "" : void 0,
88
- ...g,
89
- ref: t,
90
- onPointerDown: _(g.onPointerDown, () => {
91
- a || (B.current = S);
92
- }),
93
- min: o,
94
- max: s,
95
- inverted: v,
96
- onSlideStart: a ? void 0 : T,
97
- onSlideMove: a ? void 0 : ae,
98
- onSlideEnd: a ? void 0 : le,
99
- onHomeKeyDown: () => !a && K(o, 0, { commit: !0 }),
100
- onEndKeyDown: () => !a && K(s, S.length - 1, { commit: !0 }),
101
- onStepKeyDown: ({ event: x, direction: R }) => {
102
- if (!a) {
103
- const k = $.includes(x.key) || x.shiftKey && X.includes(x.key) ? 10 : 1, I = m.current, E = S[I], P = l * k * R;
104
- K(E + P, I, { commit: !0 });
105
- }
106
- }
107
- }
108
- ) }) })
109
- }
110
- );
111
- }
112
- );
113
- q.displayName = M;
114
- var [J, Q] = W(M, {
115
- startEdge: "left",
116
- endEdge: "right",
117
- size: "width",
118
- direction: 1
119
- }), we = c.forwardRef(
120
- (e, t) => {
121
- const {
122
- min: n,
123
- max: o,
124
- dir: s,
125
- inverted: l,
126
- onSlideStart: r,
127
- onSlideMove: a,
128
- onSlideEnd: f,
129
- onStepKeyDown: w,
130
- ...h
131
- } = e, [i, u] = c.useState(null), v = C(t, (b) => u(b)), y = c.useRef(void 0), g = ue(s), p = g === "ltr", m = p && !l || !p && l;
132
- function D(b) {
133
- const S = y.current || i.getBoundingClientRect(), j = [0, S.width], T = O(j, m ? [n, o] : [o, n]);
134
- return y.current = S, T(b - S.left);
135
- }
136
- return /* @__PURE__ */ d.jsx(
137
- J,
138
- {
139
- scope: e.__scopeSlider,
140
- startEdge: m ? "left" : "right",
141
- endEdge: m ? "right" : "left",
142
- direction: m ? 1 : -1,
143
- size: "width",
144
- children: /* @__PURE__ */ d.jsx(
145
- Z,
146
- {
147
- dir: g,
148
- "data-orientation": "horizontal",
149
- ...h,
150
- ref: v,
151
- style: {
152
- ...h.style,
153
- "--radix-slider-thumb-transform": "translateX(-50%)"
154
- },
155
- onSlideStart: (b) => {
156
- const S = D(b.clientX);
157
- r?.(S);
158
- },
159
- onSlideMove: (b) => {
160
- const S = D(b.clientX);
161
- a?.(S);
162
- },
163
- onSlideEnd: () => {
164
- y.current = void 0, f?.();
165
- },
166
- onStepKeyDown: (b) => {
167
- const j = G[m ? "from-left" : "from-right"].includes(b.key);
168
- w?.({ event: b, direction: j ? -1 : 1 });
169
- }
170
- }
171
- )
172
- }
173
- );
174
- }
175
- ), be = c.forwardRef(
176
- (e, t) => {
177
- const {
178
- min: n,
179
- max: o,
180
- inverted: s,
181
- onSlideStart: l,
182
- onSlideMove: r,
183
- onSlideEnd: a,
184
- onStepKeyDown: f,
185
- ...w
186
- } = e, h = c.useRef(null), i = C(t, h), u = c.useRef(void 0), v = !s;
187
- function y(g) {
188
- const p = u.current || h.current.getBoundingClientRect(), m = [0, p.height], b = O(m, v ? [o, n] : [n, o]);
189
- return u.current = p, b(g - p.top);
190
- }
191
- return /* @__PURE__ */ d.jsx(
192
- J,
193
- {
194
- scope: e.__scopeSlider,
195
- startEdge: v ? "bottom" : "top",
196
- endEdge: v ? "top" : "bottom",
197
- size: "height",
198
- direction: v ? 1 : -1,
199
- children: /* @__PURE__ */ d.jsx(
200
- Z,
201
- {
202
- "data-orientation": "vertical",
203
- ...w,
204
- ref: i,
205
- style: {
206
- ...w.style,
207
- "--radix-slider-thumb-transform": "translateY(50%)"
208
- },
209
- onSlideStart: (g) => {
210
- const p = y(g.clientY);
211
- l?.(p);
212
- },
213
- onSlideMove: (g) => {
214
- const p = y(g.clientY);
215
- r?.(p);
216
- },
217
- onSlideEnd: () => {
218
- u.current = void 0, a?.();
219
- },
220
- onStepKeyDown: (g) => {
221
- const m = G[v ? "from-bottom" : "from-top"].includes(g.key);
222
- f?.({ event: g, direction: m ? -1 : 1 });
223
- }
224
- }
225
- )
226
- }
227
- );
228
- }
229
- ), Z = c.forwardRef(
230
- (e, t) => {
231
- const {
232
- __scopeSlider: n,
233
- onSlideStart: o,
234
- onSlideMove: s,
235
- onSlideEnd: l,
236
- onHomeKeyDown: r,
237
- onEndKeyDown: a,
238
- onStepKeyDown: f,
239
- ...w
240
- } = e, h = V(M, n);
241
- return /* @__PURE__ */ d.jsx(
242
- A.span,
243
- {
244
- ...w,
245
- ref: t,
246
- onKeyDown: _(e.onKeyDown, (i) => {
247
- i.key === "Home" ? (r(i), i.preventDefault()) : i.key === "End" ? (a(i), i.preventDefault()) : $.concat(X).includes(i.key) && (f(i), i.preventDefault());
248
- }),
249
- onPointerDown: _(e.onPointerDown, (i) => {
250
- const u = i.target;
251
- u.setPointerCapture(i.pointerId), i.preventDefault(), h.thumbs.has(u) ? u.focus() : o(i);
252
- }),
253
- onPointerMove: _(e.onPointerMove, (i) => {
254
- i.target.hasPointerCapture(i.pointerId) && s(i);
255
- }),
256
- onPointerUp: _(e.onPointerUp, (i) => {
257
- const u = i.target;
258
- u.hasPointerCapture(i.pointerId) && (u.releasePointerCapture(i.pointerId), l(i));
259
- })
260
- }
261
- );
262
- }
263
- ), ee = "SliderTrack", te = c.forwardRef(
264
- (e, t) => {
265
- const { __scopeSlider: n, ...o } = e, s = V(ee, n);
266
- return /* @__PURE__ */ d.jsx(
267
- A.span,
268
- {
269
- "data-disabled": s.disabled ? "" : void 0,
270
- "data-orientation": s.orientation,
271
- ...o,
272
- ref: t
273
- }
274
- );
275
- }
276
- );
277
- te.displayName = ee;
278
- var H = "SliderRange", ne = c.forwardRef(
279
- (e, t) => {
280
- const { __scopeSlider: n, ...o } = e, s = V(H, n), l = Q(H, n), r = c.useRef(null), a = C(t, r), f = s.values.length, w = s.values.map(
281
- (u) => ie(u, s.min, s.max)
282
- ), h = f > 1 ? Math.min(...w) : 0, i = 100 - Math.max(...w);
283
- return /* @__PURE__ */ d.jsx(
284
- A.span,
285
- {
286
- "data-orientation": s.orientation,
287
- "data-disabled": s.disabled ? "" : void 0,
288
- ...o,
289
- ref: a,
290
- style: {
291
- ...e.style,
292
- [l.startEdge]: h + "%",
293
- [l.endEdge]: i + "%"
294
- }
295
- }
296
- );
297
- }
298
- );
299
- ne.displayName = H;
300
- var L = "SliderThumb", oe = c.forwardRef(
301
- (e, t) => {
302
- const n = he(e.__scopeSlider), [o, s] = c.useState(null), l = C(t, (a) => s(a)), r = c.useMemo(
303
- () => o ? n().findIndex((a) => a.ref.current === o) : -1,
304
- [n, o]
305
- );
306
- return /* @__PURE__ */ d.jsx(xe, { ...e, ref: l, index: r });
307
- }
308
- ), xe = c.forwardRef(
309
- (e, t) => {
310
- const { __scopeSlider: n, index: o, name: s, ...l } = e, r = V(L, n), a = Q(L, n), [f, w] = c.useState(null), h = C(t, (D) => w(D)), i = f ? r.form || !!f.closest("form") : !0, u = me(f), v = r.values[o], y = v === void 0 ? 0 : ie(v, r.min, r.max), g = Pe(o, r.values.length), p = u?.[a.size], m = p ? Ee(p, y, a.direction) : 0;
311
- return c.useEffect(() => {
312
- if (f)
313
- return r.thumbs.add(f), () => {
314
- r.thumbs.delete(f);
315
- };
316
- }, [f, r.thumbs]), /* @__PURE__ */ d.jsxs(
317
- "span",
318
- {
319
- style: {
320
- transform: "var(--radix-slider-thumb-transform)",
321
- position: "absolute",
322
- [a.startEdge]: `calc(${y}% + ${m}px)`
323
- },
324
- children: [
325
- /* @__PURE__ */ d.jsx(z.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ d.jsx(
326
- A.span,
327
- {
328
- role: "slider",
329
- "aria-label": e["aria-label"] || g,
330
- "aria-valuemin": r.min,
331
- "aria-valuenow": v,
332
- "aria-valuemax": r.max,
333
- "aria-orientation": r.orientation,
334
- "data-orientation": r.orientation,
335
- "data-disabled": r.disabled ? "" : void 0,
336
- tabIndex: r.disabled ? void 0 : 0,
337
- ...l,
338
- ref: h,
339
- style: v === void 0 ? { display: "none" } : e.style,
340
- onFocus: _(e.onFocus, () => {
341
- r.valueIndexToChangeRef.current = o;
342
- })
343
- }
344
- ) }),
345
- i && /* @__PURE__ */ d.jsx(
346
- re,
347
- {
348
- name: s ?? (r.name ? r.name + (r.values.length > 1 ? "[]" : "") : void 0),
349
- form: r.form,
350
- value: v
351
- },
352
- o
353
- )
354
- ]
355
- }
356
- );
357
- }
358
- );
359
- oe.displayName = L;
360
- var ye = "RadioBubbleInput", re = c.forwardRef(
361
- ({ __scopeSlider: e, value: t, ...n }, o) => {
362
- const s = c.useRef(null), l = C(s, o), r = fe(t);
363
- return c.useEffect(() => {
364
- const a = s.current;
365
- if (!a) return;
366
- const f = window.HTMLInputElement.prototype, h = Object.getOwnPropertyDescriptor(f, "value").set;
367
- if (r !== t && h) {
368
- const i = new Event("input", { bubbles: !0 });
369
- h.call(a, t), a.dispatchEvent(i);
370
- }
371
- }, [r, t]), /* @__PURE__ */ d.jsx(
372
- A.input,
373
- {
374
- style: { display: "none" },
375
- ...n,
376
- ref: l,
377
- defaultValue: t
378
- }
379
- );
380
- }
381
- );
382
- re.displayName = ye;
383
- function Re(e = [], t, n) {
384
- const o = [...e];
385
- return o[n] = t, o.sort((s, l) => s - l);
386
- }
387
- function ie(e, t, n) {
388
- const l = 100 / (n - t) * (e - t);
389
- return Y(l, [0, 100]);
390
- }
391
- function Pe(e, t) {
392
- return t > 2 ? `Value ${e + 1} of ${t}` : t === 2 ? ["Minimum", "Maximum"][e] : void 0;
393
- }
394
- function De(e, t) {
395
- if (e.length === 1) return 0;
396
- const n = e.map((s) => Math.abs(s - t)), o = Math.min(...n);
397
- return n.indexOf(o);
398
- }
399
- function Ee(e, t, n) {
400
- const o = e / 2, l = O([0, 50], [0, o]);
401
- return (o - l(t) * n) * n;
402
- }
403
- function _e(e) {
404
- return e.slice(0, -1).map((t, n) => e[n + 1] - t);
405
- }
406
- function Ce(e, t) {
407
- if (t > 0) {
408
- const n = _e(e);
409
- return Math.min(...n) >= t;
410
- }
411
- return !0;
412
- }
413
- function O(e, t) {
414
- return (n) => {
415
- if (e[0] === e[1] || t[0] === t[1]) return t[0];
416
- const o = (t[1] - t[0]) / (e[1] - e[0]);
417
- return t[0] + o * (n - e[0]);
418
- };
419
- }
420
- function Me(e) {
421
- return (String(e).split(".")[1] || "").length;
422
- }
423
- function je(e, t) {
424
- const n = Math.pow(10, t);
425
- return Math.round(e * n) / n;
426
- }
427
- var se = q, Ke = te, Ie = ne, Ae = oe;
428
- const Ve = c.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsxs(
429
- se,
430
- {
431
- ref: n,
432
- className: Se("relative flex w-full touch-none items-center select-none", e),
433
- ...t,
434
- children: [
435
- /* @__PURE__ */ d.jsx(Ke, { className: "bg-primary/20 relative h-1.5 w-full grow overflow-hidden rounded-full", children: /* @__PURE__ */ d.jsx(Ie, { className: "bg-primary absolute h-full" }) }),
436
- /* @__PURE__ */ d.jsx(Ae, { className: "border-primary/50 bg-background focus-visible:ring-ring block h-4 w-4 rounded-full border shadow transition-colors focus-visible:ring-1 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50" })
437
- ]
438
- }
439
- ));
440
- Ve.displayName = se?.displayName || "Slider";
441
- export {
442
- Ve as Slider
443
- };
2
+ "use client";
3
+ import { t as e } from "./slider-CJJPQ0fH.mjs";
4
+ export { e as Slider };
package/dist/sonner.cjs CHANGED
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-nZSsnGb7.js"),r=require("next-themes"),s=require("sonner"),u=({...t})=>{const{theme:o="system"}=r.useTheme();return e.jsxRuntimeExports.jsx(s.Toaster,{theme:o,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};exports.Toaster=u;
1
+ "use client";"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./jsx-runtime-CN3qjQQx.js`);let t=require(`react`);t=e.i(t);let n=require(`next-themes`),r=require(`sonner`);var i=e.t(),a=({...e})=>{let{theme:t=`system`}=(0,n.useTheme)();return(0,i.jsx)(r.Toaster,{theme:t,className:`toaster group`,toastOptions:{classNames:{toast:`group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg`,description:`group-[.toast]:text-muted-foreground`,actionButton:`group-[.toast]:bg-primary group-[.toast]:text-primary-foreground`,cancelButton:`group-[.toast]:bg-muted group-[.toast]:text-muted-foreground`}},...e})};exports.Toaster=a;
package/dist/sonner.mjs CHANGED
@@ -1,26 +1,23 @@
1
1
  "use client";
2
- import { j as r } from "./jsx-runtime-tc70JA_2.mjs";
3
- import { useTheme as e } from "next-themes";
4
- import { Toaster as s } from "sonner";
5
- const p = ({ ...t }) => {
6
- const { theme: o = "system" } = e();
7
- return /* @__PURE__ */ r.jsx(
8
- s,
9
- {
10
- theme: o,
11
- className: "toaster group",
12
- toastOptions: {
13
- classNames: {
14
- toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
15
- description: "group-[.toast]:text-muted-foreground",
16
- actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
17
- cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"
18
- }
19
- },
20
- ...t
21
- }
22
- );
23
- };
24
- export {
25
- p as Toaster
2
+ "use client";
3
+ import { t as e } from "./jsx-runtime-CW53Uo-e.mjs";
4
+ import "react";
5
+ import { useTheme as t } from "next-themes";
6
+ import { Toaster as n } from "sonner";
7
+ //#region src/sonner.tsx
8
+ var r = e(), i = ({ ...e }) => {
9
+ let { theme: i = "system" } = t();
10
+ return /* @__PURE__ */ (0, r.jsx)(n, {
11
+ theme: i,
12
+ className: "toaster group",
13
+ toastOptions: { classNames: {
14
+ toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
15
+ description: "group-[.toast]:text-muted-foreground",
16
+ actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
17
+ cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"
18
+ } },
19
+ ...e
20
+ });
26
21
  };
22
+ //#endregion
23
+ export { i as Toaster };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-nZSsnGb7.js"),g=require("lucide-react"),P=require("react"),z=require("./button.cjs"),a=require("./dialog.cjs"),c=require("./drawer.cjs"),x=require("./utils-cdbZV8DZ.js");function I(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(s,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return s.default=t,Object.freeze(s)}const i=I(P),w="(max-width: 767px)",E=t=>{const s=t.trim();return s.endsWith("/")?s.slice(0,-1):s},R=t=>t.trim().replace(/^@+/,""),U=(t,s)=>{const n=E(t),r=encodeURIComponent(R(s));return`${n}/${r}`},F=(t,s)=>{const n=E(t),r=encodeURIComponent(R(s));return`${n}/widget/page/${r}`},L=()=>{const t=()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(w).matches,[s,n]=i.useState(t);return i.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const r=window.matchMedia(w),l=u=>n(u.matches);return n(r.matches),r.addEventListener("change",l),()=>{r.removeEventListener("change",l)}},[]),s};function T({supportUrl:t="https://www.buymeacoffee.com",creatorId:s,title:n="Buy me a coffee",description:r="Support the project directly from this panel.",iframeTitle:l="Buy Me a Coffee support form",open:u,defaultOpen:y=!1,onOpenChange:p,positionClassName:v,buttonClassName:M,panelClassName:f,className:D,type:N,onClick:C,...O}){const S=L(),d=u!==void 0,[_,k]=i.useState(y),j=d?u:_,m=i.useCallback(o=>{d||k(o),p?.(o)},[d,p]),q=i.useMemo(()=>U(t,s),[s,t]),B=i.useMemo(()=>F(t,s),[s,t]),h=e.jsxRuntimeExports.jsxs("div",{className:"flex max-h-[75vh] flex-col gap-3",children:[e.jsxRuntimeExports.jsx("div",{className:"overflow-hidden rounded-md border",children:e.jsxRuntimeExports.jsx("iframe",{title:l,src:B,className:"h-[560px] w-full border-0",loading:"lazy",referrerPolicy:"strict-origin-when-cross-origin"})}),e.jsxRuntimeExports.jsxs("div",{className:"text-muted-foreground flex items-center justify-between gap-2 text-xs",children:[e.jsxRuntimeExports.jsx("span",{children:"If the embedded checkout is unavailable, open the support page directly."}),e.jsxRuntimeExports.jsxs("a",{href:q,target:"_blank",rel:"noopener noreferrer",className:"text-foreground inline-flex items-center gap-1 font-medium underline underline-offset-2",children:["Open Buy Me a Coffee",e.jsxRuntimeExports.jsx(g.ExternalLink,{className:"h-3.5 w-3.5"})]})]})]}),b=e.jsxRuntimeExports.jsx("div",{className:x.cn("fixed right-6 bottom-6 z-50",v),children:e.jsxRuntimeExports.jsxs(z.Button,{"aria-label":"Support this project",type:N??"button",className:x.cn("inline-flex h-14 w-14 rounded-full border border-black/15 bg-[#ffdd00] text-black shadow-[0_16px_36px_-18px_rgba(0,0,0,0.8)] transition hover:-translate-y-0.5 hover:scale-105 hover:bg-[#ffe347] focus-visible:ring-2 focus-visible:ring-offset-2 active:translate-y-0 active:scale-95",M,D),onClick:o=>{C?.(o),o.defaultPrevented||m(!0)},...O,children:[e.jsxRuntimeExports.jsx(g.Coffee,{className:"h-6 w-6"}),e.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Support this project"})]})});return S?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[b,e.jsxRuntimeExports.jsx(c.Drawer,{open:j,onOpenChange:m,children:e.jsxRuntimeExports.jsxs(c.DrawerContent,{className:x.cn("mx-auto w-full max-w-xl",f),children:[e.jsxRuntimeExports.jsxs(c.DrawerHeader,{children:[e.jsxRuntimeExports.jsx(c.DrawerTitle,{children:n}),e.jsxRuntimeExports.jsx(c.DrawerDescription,{children:r})]}),e.jsxRuntimeExports.jsx("div",{className:"px-4 pb-4",children:h})]})})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[b,e.jsxRuntimeExports.jsx(a.Dialog,{open:j,onOpenChange:m,children:e.jsxRuntimeExports.jsxs(a.DialogContent,{className:x.cn("max-w-xl p-5",f),children:[e.jsxRuntimeExports.jsxs(a.DialogHeader,{children:[e.jsxRuntimeExports.jsx(a.DialogTitle,{children:n}),e.jsxRuntimeExports.jsx(a.DialogDescription,{children:r})]}),h]})})]})}exports.SupportFab=T;
1
+ "use client";"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./jsx-runtime-CN3qjQQx.js`),t=require(`./utils-BxDanjP7.js`),n=require(`./button.cjs`),r=require(`./dialog.cjs`),i=require(`./drawer.cjs`);let a=require(`react`);a=e.i(a);let o=require(`lucide-react`);var s=e.t(),c=`(max-width: 767px)`,l=e=>{let t=e.trim();return t.endsWith(`/`)?t.slice(0,-1):t},u=e=>e.trim().replace(/^@+/,``),d=(e,t)=>`${l(e)}/${encodeURIComponent(u(t))}`,f=(e,t)=>`${l(e)}/widget/page/${encodeURIComponent(u(t))}`,p=()=>{let[e,t]=a.useState(()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(c).matches);return a.useEffect(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(c),n=e=>t(e.matches);return t(e.matches),e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)}},[]),e};function m({supportUrl:e=`https://www.buymeacoffee.com`,creatorId:c,title:l=`Buy me a coffee`,description:u=`Support the project directly from this panel.`,iframeTitle:m=`Buy Me a Coffee support form`,open:h,defaultOpen:g=!1,onOpenChange:_,positionClassName:v,buttonClassName:y,panelClassName:b,className:x,type:S,onClick:C,...w}){let T=p(),E=h!==void 0,[D,O]=a.useState(g),k=E?h:D,A=a.useCallback(e=>{E||O(e),_?.(e)},[E,_]),j=a.useMemo(()=>d(e,c),[c,e]),M=(0,s.jsxs)(`div`,{className:`flex max-h-[75vh] flex-col gap-3`,children:[(0,s.jsx)(`div`,{className:`overflow-hidden rounded-md border`,children:(0,s.jsx)(`iframe`,{title:m,src:a.useMemo(()=>f(e,c),[c,e]),className:`h-[560px] w-full border-0`,loading:`lazy`,referrerPolicy:`strict-origin-when-cross-origin`})}),(0,s.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-between gap-2 text-xs`,children:[(0,s.jsx)(`span`,{children:`If the embedded checkout is unavailable, open the support page directly.`}),(0,s.jsxs)(`a`,{href:j,target:`_blank`,rel:`noopener noreferrer`,className:`text-foreground inline-flex items-center gap-1 font-medium underline underline-offset-2`,children:[`Open Buy Me a Coffee`,(0,s.jsx)(o.ExternalLink,{className:`h-3.5 w-3.5`})]})]})]}),N=(0,s.jsx)(`div`,{className:t.t(`fixed right-6 bottom-6 z-50`,v),children:(0,s.jsxs)(n.Button,{"aria-label":`Support this project`,type:S??`button`,className:t.t(`inline-flex h-14 w-14 rounded-full border border-black/15 bg-[#ffdd00] text-black shadow-[0_16px_36px_-18px_rgba(0,0,0,0.8)] transition hover:-translate-y-0.5 hover:scale-105 hover:bg-[#ffe347] focus-visible:ring-2 focus-visible:ring-offset-2 active:translate-y-0 active:scale-95`,y,x),onClick:e=>{C?.(e),e.defaultPrevented||A(!0)},...w,children:[(0,s.jsx)(o.Coffee,{className:`h-6 w-6`}),(0,s.jsx)(`span`,{className:`sr-only`,children:`Support this project`})]})});return T?(0,s.jsxs)(s.Fragment,{children:[N,(0,s.jsx)(i.Drawer,{open:k,onOpenChange:A,children:(0,s.jsxs)(i.DrawerContent,{className:t.t(`mx-auto w-full max-w-xl`,b),children:[(0,s.jsxs)(i.DrawerHeader,{children:[(0,s.jsx)(i.DrawerTitle,{children:l}),(0,s.jsx)(i.DrawerDescription,{children:u})]}),(0,s.jsx)(`div`,{className:`px-4 pb-4`,children:M})]})})]}):(0,s.jsxs)(s.Fragment,{children:[N,(0,s.jsx)(r.Dialog,{open:k,onOpenChange:A,children:(0,s.jsxs)(r.DialogContent,{className:t.t(`max-w-xl p-5`,b),children:[(0,s.jsxs)(r.DialogHeader,{children:[(0,s.jsx)(r.DialogTitle,{children:l}),(0,s.jsx)(r.DialogDescription,{children:u})]}),M]})})]})}exports.SupportFab=m;