@definable/ui 0.1.13 → 0.1.15

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 (300) hide show
  1. package/README.md +0 -7
  2. package/dist/components/alert-dialog.js +55 -2
  3. package/dist/components/alert.js +63 -2
  4. package/dist/components/avatar.js +41 -2
  5. package/dist/components/badge.js +26 -2
  6. package/dist/components/button.d.ts +2 -2
  7. package/dist/components/button.js +49 -2
  8. package/dist/components/calendar.js +86 -2
  9. package/dist/components/card.js +61 -2
  10. package/dist/components/carousel.js +100 -2
  11. package/dist/components/checkbox.js +31 -2
  12. package/dist/components/collapse.js +49 -2
  13. package/dist/components/command-menu.js +89 -2
  14. package/dist/components/command.js +115 -2
  15. package/dist/components/confirmation-modal.js +44 -2
  16. package/dist/components/context-menu.js +185 -2
  17. package/dist/components/dialog.js +121 -2
  18. package/dist/components/dropdown-menu.js +48 -2
  19. package/dist/components/dropzone.js +44 -2
  20. package/dist/components/image-cropper-modal.js +250 -2
  21. package/dist/components/image-cropper.js +130 -2
  22. package/dist/components/input.js +21 -2
  23. package/dist/components/label.js +19 -2
  24. package/dist/components/loader.js +69 -2
  25. package/dist/components/loading-placeholder.js +24 -2
  26. package/dist/components/mention.js +153 -2
  27. package/dist/components/modal.js +135 -2
  28. package/dist/components/notification.js +25 -2
  29. package/dist/components/popover.js +23 -2
  30. package/dist/components/progress.js +34 -2
  31. package/dist/components/radio-group.js +47 -2
  32. package/dist/components/scroll-area.js +46 -2
  33. package/dist/components/select.js +130 -2
  34. package/dist/components/selection-bar.js +53 -2
  35. package/dist/components/separator.js +24 -2
  36. package/dist/components/sheet.js +128 -2
  37. package/dist/components/skeleton.js +17 -2
  38. package/dist/components/slider.js +32 -2
  39. package/dist/components/stepper/index.d.ts +4 -0
  40. package/dist/components/stepper/step-layout.d.ts +8 -0
  41. package/dist/components/stepper/stepper-modal.d.ts +26 -0
  42. package/dist/components/stepper/stepper.d.ts +7 -0
  43. package/dist/components/stepper/types.d.ts +6 -0
  44. package/dist/components/stepper.js +6 -2
  45. package/dist/components/switch.js +35 -2
  46. package/dist/components/table-empty.js +22 -2
  47. package/dist/components/table-mobile.js +91 -2
  48. package/dist/components/table.js +156 -2
  49. package/dist/components/tabs.js +46 -2
  50. package/dist/components/terminal.js +49 -2
  51. package/dist/components/textarea.js +20 -2
  52. package/dist/components/tooltip.js +75 -2
  53. package/dist/components/use-toast.js +64 -2
  54. package/dist/icons/icons.d.ts +8 -0
  55. package/dist/icons/index.d.ts +1 -0
  56. package/dist/icons/providers/anthropic.d.ts +2 -0
  57. package/dist/icons/providers/claude.d.ts +2 -0
  58. package/dist/icons/providers/deepseek.d.ts +2 -0
  59. package/dist/icons/providers/gemini.d.ts +2 -0
  60. package/dist/icons/providers/grok.d.ts +2 -0
  61. package/dist/icons/providers/index.d.ts +6 -0
  62. package/dist/icons/providers/openai.d.ts +2 -0
  63. package/dist/icons/providers/types.d.ts +4 -0
  64. package/dist/index.d.ts +48 -962
  65. package/dist/index.js +444 -2
  66. package/dist/lib/icons.d.ts +14 -0
  67. package/dist/lib/index.d.ts +2 -0
  68. package/dist/lib/utils.js +8 -2
  69. package/dist/{stepper-modal-SYU9mbXs.js → stepper-modal-JXpOXOV2.js} +90 -91
  70. package/dist/styles.css +1 -1
  71. package/package.json +180 -134
  72. package/dist/MonacoEditor-COZcVMEj.cjs +0 -8
  73. package/dist/MonacoEditor-COZcVMEj.cjs.map +0 -1
  74. package/dist/MonacoEditor-D3QSSKa4.js +0 -295
  75. package/dist/MonacoEditor-D3QSSKa4.js.map +0 -1
  76. package/dist/alert-dialog.d.ts +0 -18
  77. package/dist/alert.d.ts +0 -25
  78. package/dist/avatar.d.ts +0 -9
  79. package/dist/badge.d.ts +0 -15
  80. package/dist/button.d.ts +0 -16
  81. package/dist/calendar.d.ts +0 -21
  82. package/dist/card.d.ts +0 -15
  83. package/dist/carousel.d.ts +0 -18
  84. package/dist/charts.d.ts +0 -26
  85. package/dist/checkbox.d.ts +0 -6
  86. package/dist/collapse.d.ts +0 -15
  87. package/dist/command-menu.d.ts +0 -12
  88. package/dist/command.d.ts +0 -89
  89. package/dist/components/alert-dialog.esm.js +0 -59
  90. package/dist/components/alert-dialog.esm.js.map +0 -1
  91. package/dist/components/alert-dialog.js.map +0 -1
  92. package/dist/components/alert.esm.js +0 -64
  93. package/dist/components/alert.esm.js.map +0 -1
  94. package/dist/components/alert.js.map +0 -1
  95. package/dist/components/avatar.esm.js +0 -42
  96. package/dist/components/avatar.esm.js.map +0 -1
  97. package/dist/components/avatar.js.map +0 -1
  98. package/dist/components/badge.esm.js +0 -27
  99. package/dist/components/badge.esm.js.map +0 -1
  100. package/dist/components/badge.js.map +0 -1
  101. package/dist/components/button.esm.js +0 -48
  102. package/dist/components/button.esm.js.map +0 -1
  103. package/dist/components/button.js.map +0 -1
  104. package/dist/components/calendar.esm.js +0 -5562
  105. package/dist/components/calendar.esm.js.map +0 -1
  106. package/dist/components/calendar.js.map +0 -1
  107. package/dist/components/card.esm.js +0 -62
  108. package/dist/components/card.esm.js.map +0 -1
  109. package/dist/components/card.js.map +0 -1
  110. package/dist/components/carousel.esm.js +0 -101
  111. package/dist/components/carousel.esm.js.map +0 -1
  112. package/dist/components/carousel.js.map +0 -1
  113. package/dist/components/charts.d.ts +0 -17
  114. package/dist/components/charts.esm.js +0 -48
  115. package/dist/components/charts.esm.js.map +0 -1
  116. package/dist/components/charts.js +0 -2
  117. package/dist/components/charts.js.map +0 -1
  118. package/dist/components/checkbox.esm.js +0 -32
  119. package/dist/components/checkbox.esm.js.map +0 -1
  120. package/dist/components/checkbox.js.map +0 -1
  121. package/dist/components/collapse.esm.js +0 -50
  122. package/dist/components/collapse.esm.js.map +0 -1
  123. package/dist/components/collapse.js.map +0 -1
  124. package/dist/components/command-menu.esm.js +0 -90
  125. package/dist/components/command-menu.esm.js.map +0 -1
  126. package/dist/components/command-menu.js.map +0 -1
  127. package/dist/components/command.esm.js +0 -425
  128. package/dist/components/command.esm.js.map +0 -1
  129. package/dist/components/command.js.map +0 -1
  130. package/dist/components/confirmation-modal.esm.js +0 -46
  131. package/dist/components/confirmation-modal.esm.js.map +0 -1
  132. package/dist/components/confirmation-modal.js.map +0 -1
  133. package/dist/components/context-menu.esm.js +0 -186
  134. package/dist/components/context-menu.esm.js.map +0 -1
  135. package/dist/components/context-menu.js.map +0 -1
  136. package/dist/components/dialog.esm.js +0 -122
  137. package/dist/components/dialog.esm.js.map +0 -1
  138. package/dist/components/dialog.js.map +0 -1
  139. package/dist/components/dropdown-menu.esm.js +0 -49
  140. package/dist/components/dropdown-menu.esm.js.map +0 -1
  141. package/dist/components/dropdown-menu.js.map +0 -1
  142. package/dist/components/dropzone.esm.js +0 -45
  143. package/dist/components/dropzone.esm.js.map +0 -1
  144. package/dist/components/dropzone.js.map +0 -1
  145. package/dist/components/image-cropper-modal.esm.js +0 -251
  146. package/dist/components/image-cropper-modal.esm.js.map +0 -1
  147. package/dist/components/image-cropper-modal.js.map +0 -1
  148. package/dist/components/image-cropper.esm.js +0 -131
  149. package/dist/components/image-cropper.esm.js.map +0 -1
  150. package/dist/components/image-cropper.js.map +0 -1
  151. package/dist/components/input.esm.js +0 -22
  152. package/dist/components/input.esm.js.map +0 -1
  153. package/dist/components/input.js.map +0 -1
  154. package/dist/components/label.esm.js +0 -20
  155. package/dist/components/label.esm.js.map +0 -1
  156. package/dist/components/label.js.map +0 -1
  157. package/dist/components/loader.esm.js +0 -70
  158. package/dist/components/loader.esm.js.map +0 -1
  159. package/dist/components/loader.js.map +0 -1
  160. package/dist/components/loading-placeholder.esm.js +0 -25
  161. package/dist/components/loading-placeholder.esm.js.map +0 -1
  162. package/dist/components/loading-placeholder.js.map +0 -1
  163. package/dist/components/markdown.d.ts +0 -2
  164. package/dist/components/markdown.esm.js +0 -12066
  165. package/dist/components/markdown.esm.js.map +0 -1
  166. package/dist/components/markdown.js +0 -18
  167. package/dist/components/markdown.js.map +0 -1
  168. package/dist/components/mention.esm.js +0 -154
  169. package/dist/components/mention.esm.js.map +0 -1
  170. package/dist/components/mention.js.map +0 -1
  171. package/dist/components/modal.esm.js +0 -136
  172. package/dist/components/modal.esm.js.map +0 -1
  173. package/dist/components/modal.js.map +0 -1
  174. package/dist/components/monaco-editor.d.ts +0 -2
  175. package/dist/components/monaco-editor.esm.js +0 -9
  176. package/dist/components/monaco-editor.esm.js.map +0 -1
  177. package/dist/components/monaco-editor.js +0 -2
  178. package/dist/components/monaco-editor.js.map +0 -1
  179. package/dist/components/notification.esm.js +0 -26
  180. package/dist/components/notification.esm.js.map +0 -1
  181. package/dist/components/notification.js.map +0 -1
  182. package/dist/components/popover.esm.js +0 -24
  183. package/dist/components/popover.esm.js.map +0 -1
  184. package/dist/components/popover.js.map +0 -1
  185. package/dist/components/progress.esm.js +0 -35
  186. package/dist/components/progress.esm.js.map +0 -1
  187. package/dist/components/progress.js.map +0 -1
  188. package/dist/components/radio-group.esm.js +0 -48
  189. package/dist/components/radio-group.esm.js.map +0 -1
  190. package/dist/components/radio-group.js.map +0 -1
  191. package/dist/components/scroll-area.esm.js +0 -47
  192. package/dist/components/scroll-area.esm.js.map +0 -1
  193. package/dist/components/scroll-area.js.map +0 -1
  194. package/dist/components/select.esm.js +0 -131
  195. package/dist/components/select.esm.js.map +0 -1
  196. package/dist/components/select.js.map +0 -1
  197. package/dist/components/selection-bar.esm.js +0 -54
  198. package/dist/components/selection-bar.esm.js.map +0 -1
  199. package/dist/components/selection-bar.js.map +0 -1
  200. package/dist/components/separator.esm.js +0 -25
  201. package/dist/components/separator.esm.js.map +0 -1
  202. package/dist/components/separator.js.map +0 -1
  203. package/dist/components/sheet.esm.js +0 -129
  204. package/dist/components/sheet.esm.js.map +0 -1
  205. package/dist/components/sheet.js.map +0 -1
  206. package/dist/components/skeleton.esm.js +0 -18
  207. package/dist/components/skeleton.esm.js.map +0 -1
  208. package/dist/components/skeleton.js.map +0 -1
  209. package/dist/components/slider.esm.js +0 -33
  210. package/dist/components/slider.esm.js.map +0 -1
  211. package/dist/components/slider.js.map +0 -1
  212. package/dist/components/stepper.d.ts +0 -2
  213. package/dist/components/stepper.esm.js +0 -7
  214. package/dist/components/stepper.esm.js.map +0 -1
  215. package/dist/components/stepper.js.map +0 -1
  216. package/dist/components/switch.esm.js +0 -36
  217. package/dist/components/switch.esm.js.map +0 -1
  218. package/dist/components/switch.js.map +0 -1
  219. package/dist/components/table-empty.esm.js +0 -23
  220. package/dist/components/table-empty.esm.js.map +0 -1
  221. package/dist/components/table-empty.js.map +0 -1
  222. package/dist/components/table-mobile.esm.js +0 -92
  223. package/dist/components/table-mobile.esm.js.map +0 -1
  224. package/dist/components/table-mobile.js.map +0 -1
  225. package/dist/components/table.esm.js +0 -157
  226. package/dist/components/table.esm.js.map +0 -1
  227. package/dist/components/table.js.map +0 -1
  228. package/dist/components/tabs.esm.js +0 -47
  229. package/dist/components/tabs.esm.js.map +0 -1
  230. package/dist/components/tabs.js.map +0 -1
  231. package/dist/components/terminal.esm.js +0 -50
  232. package/dist/components/terminal.esm.js.map +0 -1
  233. package/dist/components/terminal.js.map +0 -1
  234. package/dist/components/textarea.esm.js +0 -21
  235. package/dist/components/textarea.esm.js.map +0 -1
  236. package/dist/components/textarea.js.map +0 -1
  237. package/dist/components/tooltip.esm.js +0 -76
  238. package/dist/components/tooltip.esm.js.map +0 -1
  239. package/dist/components/tooltip.js.map +0 -1
  240. package/dist/components/use-toast.esm.js +0 -65
  241. package/dist/components/use-toast.esm.js.map +0 -1
  242. package/dist/components/use-toast.js.map +0 -1
  243. package/dist/confirmation-modal.d.ts +0 -16
  244. package/dist/context-menu.d.ts +0 -41
  245. package/dist/dialog.d.ts +0 -33
  246. package/dist/dropdown-menu.d.ts +0 -16
  247. package/dist/dropzone.d.ts +0 -16
  248. package/dist/image-cropper-modal.d.ts +0 -14
  249. package/dist/image-cropper.d.ts +0 -15
  250. package/dist/index-DACAHwoB.js +0 -35
  251. package/dist/index-DACAHwoB.js.map +0 -1
  252. package/dist/index-Deooizx8.cjs +0 -2
  253. package/dist/index-Deooizx8.cjs.map +0 -1
  254. package/dist/index.esm.js +0 -458
  255. package/dist/index.esm.js.map +0 -1
  256. package/dist/index.js.map +0 -1
  257. package/dist/input.d.ts +0 -8
  258. package/dist/jsx-runtime-BYECrxsp.cjs +0 -31
  259. package/dist/jsx-runtime-BYECrxsp.cjs.map +0 -1
  260. package/dist/jsx-runtime-DGlMoOmv.js +0 -631
  261. package/dist/jsx-runtime-DGlMoOmv.js.map +0 -1
  262. package/dist/label.d.ts +0 -6
  263. package/dist/lib/utils.esm.js +0 -5
  264. package/dist/lib/utils.esm.js.map +0 -1
  265. package/dist/lib/utils.js.map +0 -1
  266. package/dist/loader.d.ts +0 -14
  267. package/dist/loading-placeholder.d.ts +0 -12
  268. package/dist/markdown.d.ts +0 -122
  269. package/dist/mention.d.ts +0 -29
  270. package/dist/modal.d.ts +0 -28
  271. package/dist/monaco-editor.d.ts +0 -76
  272. package/dist/notification.d.ts +0 -9
  273. package/dist/popover.d.ts +0 -10
  274. package/dist/progress.d.ts +0 -6
  275. package/dist/radio-group.d.ts +0 -8
  276. package/dist/scroll-area.d.ts +0 -8
  277. package/dist/select.d.ts +0 -31
  278. package/dist/selection-bar.d.ts +0 -15
  279. package/dist/separator.d.ts +0 -6
  280. package/dist/sheet.d.ts +0 -17
  281. package/dist/skeleton.d.ts +0 -5
  282. package/dist/slider.d.ts +0 -6
  283. package/dist/stepper-modal-CPlBpxWy.cjs +0 -2
  284. package/dist/stepper-modal-CPlBpxWy.cjs.map +0 -1
  285. package/dist/stepper-modal-SYU9mbXs.js.map +0 -1
  286. package/dist/stepper.d.ts +0 -75
  287. package/dist/switch.d.ts +0 -6
  288. package/dist/table-empty.d.ts +0 -13
  289. package/dist/table-mobile.d.ts +0 -37
  290. package/dist/table.d.ts +0 -37
  291. package/dist/tabs.d.ts +0 -12
  292. package/dist/terminal.d.ts +0 -47
  293. package/dist/textarea.d.ts +0 -8
  294. package/dist/tooltip.d.ts +0 -12
  295. package/dist/use-toast.d.ts +0 -28
  296. package/dist/utils-DSKoFOjv.cjs +0 -2
  297. package/dist/utils-DSKoFOjv.cjs.map +0 -1
  298. package/dist/utils-qaFjX9_3.js +0 -2279
  299. package/dist/utils-qaFjX9_3.js.map +0 -1
  300. package/dist/utils.d.ts +0 -5
@@ -1,2 +1,100 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../jsx-runtime-BYECrxsp.cjs"),i=require("react"),l=require("framer-motion");function R({slides:n,interval:o=5e3,showIndicators:g=!0,className:j=""}){const[r,a]=i.useState(0),[u,c]=i.useState(0),[x,m]=i.useState(!1);i.useEffect(()=>{if(x)return;const t=setInterval(()=>{c(1),a(e=>(e+1)%n.length)},o);return()=>clearInterval(t)},[o,n.length,x]);const h={enter:t=>({x:t>0?1e3:-1e3,opacity:0}),center:{zIndex:1,x:0,opacity:1},exit:t=>({zIndex:0,x:t<0?1e3:-1e3,opacity:0})},d=1e4,b=(t,e)=>Math.abs(t)*e,f=t=>{c(t),a(e=>(e+t+n.length)%n.length)},y=t=>{m(!0);const e=t>r?1:-1;c(e),a(t),setTimeout(()=>m(!1),o)};return s.jsxRuntimeExports.jsxs("div",{className:`relative overflow-hidden ${j}`,children:[s.jsxRuntimeExports.jsx(l.AnimatePresence,{initial:!1,custom:u,children:s.jsxRuntimeExports.jsxs(l.motion.div,{custom:u,variants:h,initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.2}},drag:"x",dragConstraints:{left:0,right:0},dragElastic:1,onDragEnd:(t,{offset:e,velocity:E})=>{const p=b(e.x,E.x);p<-d?f(1):p>d&&f(-1)},className:"absolute inset-0",children:[s.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-primary/20",children:s.jsxRuntimeExports.jsx("img",{src:n[r].image,alt:"carousel",className:"w-full h-full object-cover"})}),s.jsxRuntimeExports.jsx("div",{className:"absolute bottom-20 left-8 text-foreground",children:s.jsxRuntimeExports.jsxs(l.motion.h1,{className:"text-4xl font-semibold",initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.2},children:[n[r].title,s.jsxRuntimeExports.jsx("br",{}),n[r].subtitle]})})]},r)}),g&&s.jsxRuntimeExports.jsx("div",{className:"absolute bottom-8 left-8 flex gap-2 z-10",children:n.map((t,e)=>s.jsxRuntimeExports.jsx("button",{onClick:()=>y(e),className:`w-8 h-1 rounded-full transition-all duration-300 ${e===r?"bg-foreground":"bg-foreground/30 hover:bg-foreground/50"}`},e))})]})}exports.Carousel=R;
2
- //# sourceMappingURL=carousel.js.map
1
+ import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
+ import { useState as c, useEffect as C } from "react";
3
+ import { AnimatePresence as I, motion as p } from "framer-motion";
4
+ function E({
5
+ slides: n,
6
+ interval: i = 5e3,
7
+ showIndicators: b = !0,
8
+ className: x = ""
9
+ }) {
10
+ const [a, o] = c(0), [u, s] = c(0), [d, m] = c(!1);
11
+ C(() => {
12
+ if (d) return;
13
+ const e = setInterval(() => {
14
+ s(1), o((t) => (t + 1) % n.length);
15
+ }, i);
16
+ return () => clearInterval(e);
17
+ }, [i, n.length, d]);
18
+ const y = {
19
+ enter: (e) => ({
20
+ x: e > 0 ? 1e3 : -1e3,
21
+ opacity: 0
22
+ }),
23
+ center: {
24
+ zIndex: 1,
25
+ x: 0,
26
+ opacity: 1
27
+ },
28
+ exit: (e) => ({
29
+ zIndex: 0,
30
+ x: e < 0 ? 1e3 : -1e3,
31
+ opacity: 0
32
+ })
33
+ }, f = 1e4, v = (e, t) => Math.abs(e) * t, g = (e) => {
34
+ s(e), o((t) => (t + e + n.length) % n.length);
35
+ }, N = (e) => {
36
+ m(!0);
37
+ const t = e > a ? 1 : -1;
38
+ s(t), o(e), setTimeout(() => m(!1), i);
39
+ };
40
+ return /* @__PURE__ */ l("div", { className: `relative overflow-hidden ${x}`, children: [
41
+ /* @__PURE__ */ r(I, { initial: !1, custom: u, children: /* @__PURE__ */ l(
42
+ p.div,
43
+ {
44
+ custom: u,
45
+ variants: y,
46
+ initial: "enter",
47
+ animate: "center",
48
+ exit: "exit",
49
+ transition: {
50
+ x: { type: "spring", stiffness: 300, damping: 30 },
51
+ opacity: { duration: 0.2 }
52
+ },
53
+ drag: "x",
54
+ dragConstraints: { left: 0, right: 0 },
55
+ dragElastic: 1,
56
+ onDragEnd: (e, { offset: t, velocity: w }) => {
57
+ const h = v(t.x, w.x);
58
+ h < -f ? g(1) : h > f && g(-1);
59
+ },
60
+ className: "absolute inset-0",
61
+ children: [
62
+ /* @__PURE__ */ r("div", { className: "absolute inset-0 bg-gradient-to-b from-primary/20", children: /* @__PURE__ */ r(
63
+ "img",
64
+ {
65
+ src: n[a].image,
66
+ alt: "carousel",
67
+ className: "w-full h-full object-cover"
68
+ }
69
+ ) }),
70
+ /* @__PURE__ */ r("div", { className: "absolute bottom-20 left-8 text-foreground", children: /* @__PURE__ */ l(
71
+ p.h1,
72
+ {
73
+ className: "text-4xl font-semibold",
74
+ initial: { y: 20, opacity: 0 },
75
+ animate: { y: 0, opacity: 1 },
76
+ transition: { delay: 0.2 },
77
+ children: [
78
+ n[a].title,
79
+ /* @__PURE__ */ r("br", {}),
80
+ n[a].subtitle
81
+ ]
82
+ }
83
+ ) })
84
+ ]
85
+ },
86
+ a
87
+ ) }),
88
+ b && /* @__PURE__ */ r("div", { className: "absolute bottom-8 left-8 flex gap-2 z-10", children: n.map((e, t) => /* @__PURE__ */ r(
89
+ "button",
90
+ {
91
+ onClick: () => N(t),
92
+ className: `w-8 h-1 rounded-full transition-all duration-300 ${t === a ? "bg-foreground" : "bg-foreground/30 hover:bg-foreground/50"}`
93
+ },
94
+ t
95
+ )) })
96
+ ] });
97
+ }
98
+ export {
99
+ E as Carousel
100
+ };
@@ -1,2 +1,31 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../jsx-runtime-BYECrxsp.cjs"),u=require("react"),l=require("@radix-ui/react-checkbox"),d=require("lucide-react"),c=require("../utils-DSKoFOjv.cjs"),m=require("framer-motion");function n(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return i.default=e,Object.freeze(i)}const f=n(u),o=n(l),a=f.forwardRef(({className:e,...i},t)=>r.jsxRuntimeExports.jsx(o.Root,{ref:t,className:c.cn("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...i,children:r.jsxRuntimeExports.jsx(o.Indicator,{className:c.cn("flex items-center justify-center text-current"),children:r.jsxRuntimeExports.jsx(m.motion.div,{initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.5,opacity:0},transition:{duration:.15,ease:"easeOut"},children:r.jsxRuntimeExports.jsx(d.Check,{className:"h-4 w-4"})})})}));a.displayName=o.Root.displayName;exports.Checkbox=a;
2
- //# sourceMappingURL=checkbox.js.map
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import * as i from "@radix-ui/react-checkbox";
4
+ import { Check as c } from "lucide-react";
5
+ import { cn as r } from "../lib/utils.js";
6
+ import { motion as n } from "framer-motion";
7
+ const m = s.forwardRef(({ className: o, ...t }, a) => /* @__PURE__ */ e(
8
+ i.Root,
9
+ {
10
+ ref: a,
11
+ className: r(
12
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
13
+ o
14
+ ),
15
+ ...t,
16
+ children: /* @__PURE__ */ e(i.Indicator, { className: r("flex items-center justify-center text-current"), children: /* @__PURE__ */ e(
17
+ n.div,
18
+ {
19
+ initial: { scale: 0.5, opacity: 0 },
20
+ animate: { scale: 1, opacity: 1 },
21
+ exit: { scale: 0.5, opacity: 0 },
22
+ transition: { duration: 0.15, ease: "easeOut" },
23
+ children: /* @__PURE__ */ e(c, { className: "h-4 w-4" })
24
+ }
25
+ ) })
26
+ }
27
+ ));
28
+ m.displayName = i.Root.displayName;
29
+ export {
30
+ m as Checkbox
31
+ };
@@ -1,2 +1,49 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../jsx-runtime-BYECrxsp.cjs"),m=require("react"),o=require("framer-motion"),x=require("lucide-react"),a=require("../utils-DSKoFOjv.cjs");function d(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(s,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return s.default=t,Object.freeze(s)}const p=d(m);function j({title:t,children:s,defaultOpen:n=!1,className:i,titleClassName:c,contentClassName:l}){const[r,u]=p.useState(n);return e.jsxRuntimeExports.jsxs("div",{className:a.cn("border rounded-lg",i),children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>u(!r),className:"flex items-center justify-between w-full text-left",children:[e.jsxRuntimeExports.jsx("h3",{className:a.cn("text-sm font-sm",c),children:t}),e.jsxRuntimeExports.jsx(o.motion.div,{animate:{rotate:r?180:0},transition:{duration:.2},children:e.jsxRuntimeExports.jsx(x.ChevronDown,{className:"h-5 w-5 text-muted-foreground"})})]}),e.jsxRuntimeExports.jsx(o.AnimatePresence,{initial:!1,children:r&&e.jsxRuntimeExports.jsx(o.motion.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:e.jsxRuntimeExports.jsx("div",{className:a.cn("p-4 pt-0",l),children:s})})})]})}exports.Collapse=j;
2
- //# sourceMappingURL=collapse.js.map
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import * as h from "react";
3
+ import { motion as o, AnimatePresence as f } from "framer-motion";
4
+ import { ChevronDown as p } from "lucide-react";
5
+ import { cn as i } from "../lib/utils.js";
6
+ function g({
7
+ title: a,
8
+ children: r,
9
+ defaultOpen: s = !1,
10
+ className: l,
11
+ titleClassName: m,
12
+ contentClassName: c
13
+ }) {
14
+ const [t, d] = h.useState(s);
15
+ return /* @__PURE__ */ n("div", { className: i("border rounded-lg", l), children: [
16
+ /* @__PURE__ */ n(
17
+ "button",
18
+ {
19
+ onClick: () => d(!t),
20
+ className: "flex items-center justify-between w-full text-left",
21
+ children: [
22
+ /* @__PURE__ */ e("h3", { className: i("text-sm font-sm", m), children: a }),
23
+ /* @__PURE__ */ e(
24
+ o.div,
25
+ {
26
+ animate: { rotate: t ? 180 : 0 },
27
+ transition: { duration: 0.2 },
28
+ children: /* @__PURE__ */ e(p, { className: "h-5 w-5 text-muted-foreground" })
29
+ }
30
+ )
31
+ ]
32
+ }
33
+ ),
34
+ /* @__PURE__ */ e(f, { initial: !1, children: t && /* @__PURE__ */ e(
35
+ o.div,
36
+ {
37
+ initial: { height: 0, opacity: 0 },
38
+ animate: { height: "auto", opacity: 1 },
39
+ exit: { height: 0, opacity: 0 },
40
+ transition: { duration: 0.2 },
41
+ className: "overflow-hidden",
42
+ children: /* @__PURE__ */ e("div", { className: i("p-4 pt-0", c), children: r })
43
+ }
44
+ ) })
45
+ ] });
46
+ }
47
+ export {
48
+ g as Collapse
49
+ };
@@ -1,2 +1,89 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../jsx-runtime-BYECrxsp.cjs"),s=require("./command.js"),i=require("react"),o=require("lucide-react");function c({open:n,onOpenChange:t}){i.useEffect(()=>{const m=x=>{x.key==="k"&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),t(!n))};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[n,t]);const r=i.useCallback(m=>{t(!1),m()},[t]);return e.jsxRuntimeExports.jsx(s.CommandDialog,{open:n,onOpenChange:t,children:e.jsxRuntimeExports.jsxs(s.Command,{className:"rounded-lg border shadow-md",children:[e.jsxRuntimeExports.jsx(s.CommandInput,{placeholder:"Type a command or search..."}),e.jsxRuntimeExports.jsxs(s.CommandList,{children:[e.jsxRuntimeExports.jsx(s.CommandEmpty,{children:"No results found."}),e.jsxRuntimeExports.jsxs(s.CommandGroup,{heading:"Suggestions",children:[e.jsxRuntimeExports.jsxs(s.CommandItem,{onSelect:()=>r(()=>console.log("Home")),children:[e.jsxRuntimeExports.jsx(o.Home,{className:"mr-2 h-4 w-4"}),e.jsxRuntimeExports.jsx("span",{children:"Home"})]}),e.jsxRuntimeExports.jsxs(s.CommandItem,{onSelect:()=>r(()=>console.log("Documents")),children:[e.jsxRuntimeExports.jsx(o.FileText,{className:"mr-2 h-4 w-4"}),e.jsxRuntimeExports.jsx("span",{children:"Documents"})]}),e.jsxRuntimeExports.jsxs(s.CommandItem,{onSelect:()=>r(()=>console.log("Projects")),children:[e.jsxRuntimeExports.jsx(o.FolderOpen,{className:"mr-2 h-4 w-4"}),e.jsxRuntimeExports.jsx("span",{children:"Projects"})]})]}),e.jsxRuntimeExports.jsx(s.CommandSeparator,{}),e.jsxRuntimeExports.jsx(s.CommandGroup,{heading:"Settings",children:e.jsxRuntimeExports.jsxs(s.CommandItem,{onSelect:()=>r(()=>console.log("Settings")),children:[e.jsxRuntimeExports.jsx(o.Settings,{className:"mr-2 h-4 w-4"}),e.jsxRuntimeExports.jsx("span",{children:"Settings"})]})})]})]})})}function d(){const[n,t]=i.useState(!1);return e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>t(!0),className:"inline-flex items-center justify-center gap-1 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground hover:bg-accent hover:text-accent-foreground",children:[e.jsxRuntimeExports.jsx(o.Search,{className:"h-4 w-4"}),e.jsxRuntimeExports.jsx("span",{children:"Search..."}),e.jsxRuntimeExports.jsxs("kbd",{className:"pointer-events-none ml-1 inline-flex h-5 select-none items-center gap-1 rounded border border-input bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:[e.jsxRuntimeExports.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),e.jsxRuntimeExports.jsx(c,{open:n,onOpenChange:t})]})}exports.CommandMenu=c;exports.CommandMenuDemo=d;
2
- //# sourceMappingURL=command-menu.js.map
1
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
+ import { CommandDialog as l, Command as a, CommandInput as i, CommandList as u, CommandEmpty as h, CommandGroup as s, CommandItem as d, CommandSeparator as p } from "./command.js";
3
+ import { useEffect as f, useCallback as g, useState as x } from "react";
4
+ import { Home as S, FileText as b, FolderOpen as N, Settings as C, Search as w } from "lucide-react";
5
+ function y({ open: t, onOpenChange: o }) {
6
+ f(() => {
7
+ const m = (c) => {
8
+ c.key === "k" && (c.metaKey || c.ctrlKey) && (c.preventDefault(), o(!t));
9
+ };
10
+ return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
11
+ }, [t, o]);
12
+ const r = g((m) => {
13
+ o(!1), m();
14
+ }, [o]);
15
+ return /* @__PURE__ */ e(l, { open: t, onOpenChange: o, children: /* @__PURE__ */ n(a, { className: "rounded-lg border shadow-md", children: [
16
+ /* @__PURE__ */ e(i, { placeholder: "Type a command or search..." }),
17
+ /* @__PURE__ */ n(u, { children: [
18
+ /* @__PURE__ */ e(h, { children: "No results found." }),
19
+ /* @__PURE__ */ n(s, { heading: "Suggestions", children: [
20
+ /* @__PURE__ */ n(
21
+ d,
22
+ {
23
+ onSelect: () => r(() => console.log("Home")),
24
+ children: [
25
+ /* @__PURE__ */ e(S, { className: "mr-2 h-4 w-4" }),
26
+ /* @__PURE__ */ e("span", { children: "Home" })
27
+ ]
28
+ }
29
+ ),
30
+ /* @__PURE__ */ n(
31
+ d,
32
+ {
33
+ onSelect: () => r(() => console.log("Documents")),
34
+ children: [
35
+ /* @__PURE__ */ e(b, { className: "mr-2 h-4 w-4" }),
36
+ /* @__PURE__ */ e("span", { children: "Documents" })
37
+ ]
38
+ }
39
+ ),
40
+ /* @__PURE__ */ n(
41
+ d,
42
+ {
43
+ onSelect: () => r(() => console.log("Projects")),
44
+ children: [
45
+ /* @__PURE__ */ e(N, { className: "mr-2 h-4 w-4" }),
46
+ /* @__PURE__ */ e("span", { children: "Projects" })
47
+ ]
48
+ }
49
+ )
50
+ ] }),
51
+ /* @__PURE__ */ e(p, {}),
52
+ /* @__PURE__ */ e(s, { heading: "Settings", children: /* @__PURE__ */ n(
53
+ d,
54
+ {
55
+ onSelect: () => r(() => console.log("Settings")),
56
+ children: [
57
+ /* @__PURE__ */ e(C, { className: "mr-2 h-4 w-4" }),
58
+ /* @__PURE__ */ e("span", { children: "Settings" })
59
+ ]
60
+ }
61
+ ) })
62
+ ] })
63
+ ] }) });
64
+ }
65
+ function E() {
66
+ const [t, o] = x(!1);
67
+ return /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-2", children: [
68
+ /* @__PURE__ */ n(
69
+ "button",
70
+ {
71
+ onClick: () => o(!0),
72
+ className: "inline-flex items-center justify-center gap-1 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground hover:bg-accent hover:text-accent-foreground",
73
+ children: [
74
+ /* @__PURE__ */ e(w, { className: "h-4 w-4" }),
75
+ /* @__PURE__ */ e("span", { children: "Search..." }),
76
+ /* @__PURE__ */ n("kbd", { className: "pointer-events-none ml-1 inline-flex h-5 select-none items-center gap-1 rounded border border-input bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground", children: [
77
+ /* @__PURE__ */ e("span", { className: "text-xs", children: "⌘" }),
78
+ "K"
79
+ ] })
80
+ ]
81
+ }
82
+ ),
83
+ /* @__PURE__ */ e(y, { open: t, onOpenChange: o })
84
+ ] });
85
+ }
86
+ export {
87
+ y as CommandMenu,
88
+ E as CommandMenuDemo
89
+ };
@@ -1,2 +1,115 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../jsx-runtime-BYECrxsp.cjs"),De=require("react"),$e=require("@radix-ui/react-dialog"),N=require("@radix-ui/react-primitive"),L=require("@radix-ui/react-id"),z=require("@radix-ui/react-compose-refs"),qe=require("lucide-react"),D=require("../utils-DSKoFOjv.cjs");function he(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const a=he(De),B=he($e);var pe=1,Oe=.9,Le=.8,Fe=.17,te=.1,re=.999,Ke=.9999,ze=.99,Ve=/[\\\/_+.#"@\[\(\{&]/,Ge=/[\\\/_+.#"@\[\(\{&]/g,Te=/[\s-]/,be=/[\s-]/g;function ae(e,n,t,s,o,d,c){if(d===n.length)return o===e.length?pe:ze;var f=`${o},${d}`;if(c[f]!==void 0)return c[f];for(var b=s.charAt(d),i=t.indexOf(b,o),v=0,g,C,w,S;i>=0;)g=ae(e,n,t,s,i+1,d+1,c),g>v&&(i===o?g*=pe:Ve.test(e.charAt(i-1))?(g*=Le,w=e.slice(o,i-1).match(Ge),w&&o>0&&(g*=Math.pow(re,w.length))):Te.test(e.charAt(i-1))?(g*=Oe,S=e.slice(o,i-1).match(be),S&&o>0&&(g*=Math.pow(re,S.length))):(g*=Fe,o>0&&(g*=Math.pow(re,i-o))),e.charAt(i)!==n.charAt(d)&&(g*=Ke)),(g<te&&t.charAt(i-1)===s.charAt(d+1)||s.charAt(d+1)===s.charAt(d)&&t.charAt(i-1)!==s.charAt(d))&&(C=ae(e,n,t,s,i+1,d+2,c),C*te>g&&(g=C*te)),g>v&&(v=g),i=t.indexOf(b,i+1);return c[f]=v,v}function ve(e){return e.toLowerCase().replace(be," ")}function Be(e,n,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,ae(e,n,ve(e),ve(n),0,0,{})}var K='[cmdk-group=""]',ne='[cmdk-group-items=""]',_e='[cmdk-group-heading=""]',xe='[cmdk-item=""]',ge=`${xe}:not([aria-disabled="true"])`,le="cmdk-item-select",q="data-value",Ue=(e,n,t)=>Be(e,n,t),ye=a.createContext(void 0),V=()=>a.useContext(ye),we=a.createContext(void 0),oe=()=>a.useContext(we),Ee=a.createContext(void 0),Re=a.forwardRef((e,n)=>{let t=O(()=>{var r,u;return{search:"",value:(u=(r=e.value)!=null?r:e.defaultValue)!=null?u:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=O(()=>new Set),o=O(()=>new Map),d=O(()=>new Map),c=O(()=>new Set),f=ke(e),{label:b,children:i,value:v,onValueChange:g,filter:C,shouldFilter:w,loop:S,disablePointerSelection:U=!1,vimBindings:A=!0,...G}=e,H=L.useId(),ie=L.useId(),W=L.useId(),P=a.useRef(null),x=nt();M(()=>{if(v!==void 0){let r=v.trim();t.current.value=r,E.emit()}},[v]),M(()=>{x(6,de)},[]);let E=a.useMemo(()=>({subscribe:r=>(c.current.add(r),()=>c.current.delete(r)),snapshot:()=>t.current,setState:(r,u,m)=>{var l,p,h,k;if(!Object.is(t.current[r],u)){if(t.current[r]=u,r==="search")Q(),X(),x(1,Y);else if(r==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(W);y?y.focus():(l=document.getElementById(H))==null||l.focus()}if(x(7,()=>{var y;t.current.selectedItemId=(y=$())==null?void 0:y.id,E.emit()}),m||x(5,de),((p=f.current)==null?void 0:p.value)!==void 0){let y=u??"";(k=(h=f.current).onValueChange)==null||k.call(h,y);return}}E.emit()}},emit:()=>{c.current.forEach(r=>r())}}),[]),J=a.useMemo(()=>({value:(r,u,m)=>{var l;u!==((l=d.current.get(r))==null?void 0:l.value)&&(d.current.set(r,{value:u,keywords:m}),t.current.filtered.items.set(r,ue(u,m)),x(2,()=>{X(),E.emit()}))},item:(r,u)=>(s.current.add(r),u&&(o.current.has(u)?o.current.get(u).add(r):o.current.set(u,new Set([r]))),x(3,()=>{Q(),X(),t.current.value||Y(),E.emit()}),()=>{d.current.delete(r),s.current.delete(r),t.current.filtered.items.delete(r);let m=$();x(4,()=>{Q(),(m==null?void 0:m.getAttribute("id"))===r&&Y(),E.emit()})}),group:r=>(o.current.has(r)||o.current.set(r,new Set),()=>{d.current.delete(r),o.current.delete(r)}),filter:()=>f.current.shouldFilter,label:b||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:H,inputId:W,labelId:ie,listInnerRef:P}),[]);function ue(r,u){var m,l;let p=(l=(m=f.current)==null?void 0:m.filter)!=null?l:Ue;return r?p(r,t.current.search,u):0}function X(){if(!t.current.search||f.current.shouldFilter===!1)return;let r=t.current.filtered.items,u=[];t.current.filtered.groups.forEach(l=>{let p=o.current.get(l),h=0;p.forEach(k=>{let y=r.get(k);h=Math.max(y,h)}),u.push([l,h])});let m=P.current;F().sort((l,p)=>{var h,k;let y=l.getAttribute("id"),T=p.getAttribute("id");return((h=r.get(T))!=null?h:0)-((k=r.get(y))!=null?k:0)}).forEach(l=>{let p=l.closest(ne);p?p.appendChild(l.parentElement===p?l:l.closest(`${ne} > *`)):m.appendChild(l.parentElement===m?l:l.closest(`${ne} > *`))}),u.sort((l,p)=>p[1]-l[1]).forEach(l=>{var p;let h=(p=P.current)==null?void 0:p.querySelector(`${K}[${q}="${encodeURIComponent(l[0])}"]`);h==null||h.parentElement.appendChild(h)})}function Y(){let r=F().find(m=>m.getAttribute("aria-disabled")!=="true"),u=r==null?void 0:r.getAttribute(q);E.setState("value",u||void 0)}function Q(){var r,u,m,l;if(!t.current.search||f.current.shouldFilter===!1){t.current.filtered.count=s.current.size;return}t.current.filtered.groups=new Set;let p=0;for(let h of s.current){let k=(u=(r=d.current.get(h))==null?void 0:r.value)!=null?u:"",y=(l=(m=d.current.get(h))==null?void 0:m.keywords)!=null?l:[],T=ue(k,y);t.current.filtered.items.set(h,T),T>0&&p++}for(let[h,k]of o.current)for(let y of k)if(t.current.filtered.items.get(y)>0){t.current.filtered.groups.add(h);break}t.current.filtered.count=p}function de(){var r,u,m;let l=$();l&&(((r=l.parentElement)==null?void 0:r.firstChild)===l&&((m=(u=l.closest(K))==null?void 0:u.querySelector(_e))==null||m.scrollIntoView({block:"nearest"})),l.scrollIntoView({block:"nearest"}))}function $(){var r;return(r=P.current)==null?void 0:r.querySelector(`${xe}[aria-selected="true"]`)}function F(){var r;return Array.from(((r=P.current)==null?void 0:r.querySelectorAll(ge))||[])}function Z(r){let u=F()[r];u&&E.setState("value",u.getAttribute(q))}function ee(r){var u;let m=$(),l=F(),p=l.findIndex(k=>k===m),h=l[p+r];(u=f.current)!=null&&u.loop&&(h=p+r<0?l[l.length-1]:p+r===l.length?l[0]:l[p+r]),h&&E.setState("value",h.getAttribute(q))}function se(r){let u=$(),m=u==null?void 0:u.closest(K),l;for(;m&&!l;)m=r>0?tt(m,K):rt(m,K),l=m==null?void 0:m.querySelector(ge);l?E.setState("value",l.getAttribute(q)):ee(r)}let ce=()=>Z(F().length-1),me=r=>{r.preventDefault(),r.metaKey?ce():r.altKey?se(1):ee(1)},fe=r=>{r.preventDefault(),r.metaKey?Z(0):r.altKey?se(-1):ee(-1)};return a.createElement(N.Primitive.div,{ref:n,tabIndex:-1,...G,"cmdk-root":"",onKeyDown:r=>{var u;(u=G.onKeyDown)==null||u.call(G,r);let m=r.nativeEvent.isComposing||r.keyCode===229;if(!(r.defaultPrevented||m))switch(r.key){case"n":case"j":{A&&r.ctrlKey&&me(r);break}case"ArrowDown":{me(r);break}case"p":case"k":{A&&r.ctrlKey&&fe(r);break}case"ArrowUp":{fe(r);break}case"Home":{r.preventDefault(),Z(0);break}case"End":{r.preventDefault(),ce();break}case"Enter":{r.preventDefault();let l=$();if(l){let p=new Event(le);l.dispatchEvent(p)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:J.inputId,id:J.labelId,style:lt},b),_(e,r=>a.createElement(we.Provider,{value:E},a.createElement(ye.Provider,{value:J},r))))}),He=a.forwardRef((e,n)=>{var t,s;let o=L.useId(),d=a.useRef(null),c=a.useContext(Ee),f=V(),b=ke(e),i=(s=(t=b.current)==null?void 0:t.forceMount)!=null?s:c==null?void 0:c.forceMount;M(()=>{if(!i)return f.item(o,c==null?void 0:c.id)},[i]);let v=Ce(o,d,[e.value,e.children,d],e.keywords),g=oe(),C=j(x=>x.value&&x.value===v.current),w=j(x=>i||f.filter()===!1?!0:x.search?x.filtered.items.get(o)>0:!0);a.useEffect(()=>{let x=d.current;if(!(!x||e.disabled))return x.addEventListener(le,S),()=>x.removeEventListener(le,S)},[w,e.onSelect,e.disabled]);function S(){var x,E;U(),(E=(x=b.current).onSelect)==null||E.call(x,v.current)}function U(){g.setState("value",v.current,!0)}if(!w)return null;let{disabled:A,value:G,onSelect:H,forceMount:ie,keywords:W,...P}=e;return a.createElement(N.Primitive.div,{ref:z.composeRefs(d,n),...P,id:o,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!C,"data-disabled":!!A,"data-selected":!!C,onPointerMove:A||f.getDisablePointerSelection()?void 0:U,onClick:A?void 0:S},e.children)}),We=a.forwardRef((e,n)=>{let{heading:t,children:s,forceMount:o,...d}=e,c=L.useId(),f=a.useRef(null),b=a.useRef(null),i=L.useId(),v=V(),g=j(w=>o||v.filter()===!1?!0:w.search?w.filtered.groups.has(c):!0);M(()=>v.group(c),[]),Ce(c,f,[e.value,e.heading,b]);let C=a.useMemo(()=>({id:c,forceMount:o}),[o]);return a.createElement(N.Primitive.div,{ref:z.composeRefs(f,n),...d,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},t&&a.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},t),_(e,w=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?i:void 0},a.createElement(Ee.Provider,{value:C},w))))}),Je=a.forwardRef((e,n)=>{let{alwaysRender:t,...s}=e,o=a.useRef(null),d=j(c=>!c.search);return!t&&!d?null:a.createElement(N.Primitive.div,{ref:z.composeRefs(o,n),...s,"cmdk-separator":"",role:"separator"})}),Xe=a.forwardRef((e,n)=>{let{onValueChange:t,...s}=e,o=e.value!=null,d=oe(),c=j(i=>i.search),f=j(i=>i.selectedItemId),b=V();return a.useEffect(()=>{e.value!=null&&d.setState("search",e.value)},[e.value]),a.createElement(N.Primitive.input,{ref:n,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":f,id:b.inputId,type:"text",value:o?e.value:c,onChange:i=>{o||d.setState("search",i.target.value),t==null||t(i.target.value)}})}),Ye=a.forwardRef((e,n)=>{let{children:t,label:s="Suggestions",...o}=e,d=a.useRef(null),c=a.useRef(null),f=j(i=>i.selectedItemId),b=V();return a.useEffect(()=>{if(c.current&&d.current){let i=c.current,v=d.current,g,C=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=i.offsetHeight;v.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return C.observe(i),()=>{cancelAnimationFrame(g),C.unobserve(i)}}},[]),a.createElement(N.Primitive.div,{ref:z.composeRefs(d,n),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":s,id:b.listId},_(e,i=>a.createElement("div",{ref:z.composeRefs(c,b.listInnerRef),"cmdk-list-sizer":""},i)))}),Qe=a.forwardRef((e,n)=>{let{open:t,onOpenChange:s,overlayClassName:o,contentClassName:d,container:c,...f}=e;return a.createElement(B.Root,{open:t,onOpenChange:s},a.createElement(B.Portal,{container:c},a.createElement(B.Overlay,{"cmdk-overlay":"",className:o}),a.createElement(B.Content,{"aria-label":e.label,"cmdk-dialog":"",className:d},a.createElement(Re,{ref:n,...f}))))}),Ze=a.forwardRef((e,n)=>j(t=>t.filtered.count===0)?a.createElement(N.Primitive.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),et=a.forwardRef((e,n)=>{let{progress:t,children:s,label:o="Loading...",...d}=e;return a.createElement(N.Primitive.div,{ref:n,...d,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},_(e,c=>a.createElement("div",{"aria-hidden":!0},c)))}),R=Object.assign(Re,{List:Ye,Item:He,Input:Xe,Group:We,Separator:Je,Dialog:Qe,Empty:Ze,Loading:et});function tt(e,n){let t=e.nextElementSibling;for(;t;){if(t.matches(n))return t;t=t.nextElementSibling}}function rt(e,n){let t=e.previousElementSibling;for(;t;){if(t.matches(n))return t;t=t.previousElementSibling}}function ke(e){let n=a.useRef(e);return M(()=>{n.current=e}),n}var M=typeof window>"u"?a.useEffect:a.useLayoutEffect;function O(e){let n=a.useRef();return n.current===void 0&&(n.current=e()),n}function j(e){let n=oe(),t=()=>e(n.snapshot());return a.useSyncExternalStore(n.subscribe,t,t)}function Ce(e,n,t,s=[]){let o=a.useRef(),d=V();return M(()=>{var c;let f=(()=>{var i;for(let v of t){if(typeof v=="string")return v.trim();if(typeof v=="object"&&"current"in v)return v.current?(i=v.current.textContent)==null?void 0:i.trim():o.current}})(),b=s.map(i=>i.trim());d.value(e,f,b),(c=n.current)==null||c.setAttribute(q,f),o.current=f}),o}var nt=()=>{let[e,n]=a.useState(),t=O(()=>new Map);return M(()=>{t.current.forEach(s=>s()),t.current=new Map},[e]),(s,o)=>{t.current.set(s,o),n({})}};function at(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function _({asChild:e,children:n},t){return e&&a.isValidElement(n)?a.cloneElement(at(n),{ref:n.ref},t(n.props.children)):t(n)}var lt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ie=a.forwardRef(({className:e,...n},t)=>I.jsxRuntimeExports.jsx(R,{ref:t,className:D.cn("flex h-full w-full flex-col overflow-hidden rounded-lg bg-popover text-popover-foreground",e),...n}));Ie.displayName=R.displayName;const ot=({children:e,open:n,onOpenChange:t})=>I.jsxRuntimeExports.jsx("div",{className:D.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n?"block":"hidden"),onClick:s=>{s.target===s.currentTarget&&t(!1)},children:I.jsxRuntimeExports.jsx("div",{className:"fixed left-[50%] top-[50%] z-50 w-full max-w-lg translate-x-[-50%] translate-y-[-50%] overflow-hidden rounded-lg border border-border bg-popover shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",children:e})}),Se=a.forwardRef(({className:e,...n},t)=>I.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b border-border px-3","cmdk-input-wrapper":"",children:[I.jsxRuntimeExports.jsx(qe.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),I.jsxRuntimeExports.jsx(R.Input,{ref:t,className:D.cn("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n})]}));Se.displayName=R.Input.displayName;const je=a.forwardRef(({className:e,...n},t)=>I.jsxRuntimeExports.jsx(R.List,{ref:t,className:D.cn("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n}));je.displayName=R.List.displayName;const Ne=a.forwardRef((e,n)=>I.jsxRuntimeExports.jsx(R.Empty,{ref:n,className:"py-6 text-center text-sm text-muted-foreground",...e}));Ne.displayName=R.Empty.displayName;const Ae=a.forwardRef(({className:e,...n},t)=>I.jsxRuntimeExports.jsx(R.Group,{ref:t,className:D.cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...n}));Ae.displayName=R.Group.displayName;const Pe=a.forwardRef(({className:e,...n},t)=>I.jsxRuntimeExports.jsx(R.Separator,{ref:t,className:D.cn("-mx-1 h-px bg-border",e),...n}));Pe.displayName=R.Separator.displayName;const Me=a.forwardRef(({className:e,...n},t)=>I.jsxRuntimeExports.jsx(R.Item,{ref:t,className:D.cn("relative flex cursor-default select-none items-center rounded-md px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n}));Me.displayName=R.Item.displayName;exports.Command=Ie;exports.CommandDialog=ot;exports.CommandEmpty=Ne;exports.CommandGroup=Ae;exports.CommandInput=Se;exports.CommandItem=Me;exports.CommandList=je;exports.CommandSeparator=Pe;
2
- //# sourceMappingURL=command.js.map
1
+ import { jsx as d, jsxs as m } from "react/jsx-runtime";
2
+ import * as r from "react";
3
+ import { Command as t } from "cmdk";
4
+ import { Search as l } from "lucide-react";
5
+ import { cn as s } from "../lib/utils.js";
6
+ const i = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ d(
7
+ t,
8
+ {
9
+ ref: o,
10
+ className: s(
11
+ "flex h-full w-full flex-col overflow-hidden rounded-lg bg-popover text-popover-foreground",
12
+ e
13
+ ),
14
+ ...a
15
+ }
16
+ ));
17
+ i.displayName = t.displayName;
18
+ const w = ({
19
+ children: e,
20
+ open: a,
21
+ onOpenChange: o
22
+ }) => /* @__PURE__ */ d(
23
+ "div",
24
+ {
25
+ className: s(
26
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
27
+ a ? "block" : "hidden"
28
+ ),
29
+ onClick: (n) => {
30
+ n.target === n.currentTarget && o(!1);
31
+ },
32
+ children: /* @__PURE__ */ d(
33
+ "div",
34
+ {
35
+ className: "fixed left-[50%] top-[50%] z-50 w-full max-w-lg translate-x-[-50%] translate-y-[-50%] overflow-hidden rounded-lg border border-border bg-popover shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
36
+ children: e
37
+ }
38
+ )
39
+ }
40
+ ), p = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ m("div", { className: "flex items-center border-b border-border px-3", "cmdk-input-wrapper": "", children: [
41
+ /* @__PURE__ */ d(l, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
42
+ /* @__PURE__ */ d(
43
+ t.Input,
44
+ {
45
+ ref: o,
46
+ className: s(
47
+ "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
48
+ e
49
+ ),
50
+ ...a
51
+ }
52
+ )
53
+ ] }));
54
+ p.displayName = t.Input.displayName;
55
+ const c = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ d(
56
+ t.List,
57
+ {
58
+ ref: o,
59
+ className: s("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
60
+ ...a
61
+ }
62
+ ));
63
+ c.displayName = t.List.displayName;
64
+ const f = r.forwardRef((e, a) => /* @__PURE__ */ d(
65
+ t.Empty,
66
+ {
67
+ ref: a,
68
+ className: "py-6 text-center text-sm text-muted-foreground",
69
+ ...e
70
+ }
71
+ ));
72
+ f.displayName = t.Empty.displayName;
73
+ const u = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ d(
74
+ t.Group,
75
+ {
76
+ ref: o,
77
+ className: s(
78
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
79
+ e
80
+ ),
81
+ ...a
82
+ }
83
+ ));
84
+ u.displayName = t.Group.displayName;
85
+ const x = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ d(
86
+ t.Separator,
87
+ {
88
+ ref: o,
89
+ className: s("-mx-1 h-px bg-border", e),
90
+ ...a
91
+ }
92
+ ));
93
+ x.displayName = t.Separator.displayName;
94
+ const g = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ d(
95
+ t.Item,
96
+ {
97
+ ref: o,
98
+ className: s(
99
+ "relative flex cursor-default select-none items-center rounded-md px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
100
+ e
101
+ ),
102
+ ...a
103
+ }
104
+ ));
105
+ g.displayName = t.Item.displayName;
106
+ export {
107
+ i as Command,
108
+ w as CommandDialog,
109
+ f as CommandEmpty,
110
+ u as CommandGroup,
111
+ p as CommandInput,
112
+ g as CommandItem,
113
+ c as CommandList,
114
+ x as CommandSeparator
115
+ };
@@ -1,2 +1,44 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../jsx-runtime-BYECrxsp.cjs"),d=require("lucide-react"),m=require("./modal.js"),s=require("./button.js");function l({isOpen:o,onClose:e,onConfirm:i,title:a,description:n,confirmText:u="Confirm",cancelText:x="Cancel",type:r="danger"}){const c=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(s.Button,{variant:"ghost",onClick:e,children:x}),t.jsxRuntimeExports.jsx(s.Button,{variant:r==="danger"?"destructive":"default",onClick:()=>{i(),e()},children:u})]});return t.jsxRuntimeExports.jsx(m.Modal,{isOpen:o,onClose:e,size:"md",zIndexClassName:"z-[1000]",title:a,description:n,icon:t.jsxRuntimeExports.jsx(d.AlertTriangle,{className:`h-5 w-5 ${r==="danger"?"text-destructive-foreground":"text-primary-foreground"}`}),footer:c,children:t.jsxRuntimeExports.jsx("div",{className:"p-4",children:t.jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:n})})})}exports.ConfirmationModal=l;
2
- //# sourceMappingURL=confirmation-modal.js.map
1
+ import { jsx as r, jsxs as l, Fragment as s } from "react/jsx-runtime";
2
+ import { AlertTriangle as f } from "lucide-react";
3
+ import { Modal as u } from "./modal.js";
4
+ import { Button as o } from "./button.js";
5
+ function C({
6
+ isOpen: a,
7
+ onClose: e,
8
+ onConfirm: i,
9
+ title: d,
10
+ description: t,
11
+ confirmText: m = "Confirm",
12
+ cancelText: c = "Cancel",
13
+ type: n = "danger"
14
+ }) {
15
+ return /* @__PURE__ */ r(
16
+ u,
17
+ {
18
+ isOpen: a,
19
+ onClose: e,
20
+ size: "md",
21
+ zIndexClassName: "z-[1000]",
22
+ title: d,
23
+ description: t,
24
+ icon: /* @__PURE__ */ r(f, { className: `h-5 w-5 ${n === "danger" ? "text-destructive-foreground" : "text-primary-foreground"}` }),
25
+ footer: /* @__PURE__ */ l(s, { children: [
26
+ /* @__PURE__ */ r(o, { variant: "ghost", onClick: e, children: c }),
27
+ /* @__PURE__ */ r(
28
+ o,
29
+ {
30
+ variant: n === "danger" ? "destructive" : "default",
31
+ onClick: () => {
32
+ i(), e();
33
+ },
34
+ children: m
35
+ }
36
+ )
37
+ ] }),
38
+ children: /* @__PURE__ */ r("div", { className: "p-4", children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: t }) })
39
+ }
40
+ );
41
+ }
42
+ export {
43
+ C as ConfirmationModal
44
+ };