@bzync/rui 0.0.4 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/README.md +10 -0
  2. package/dist/autocomplete-D6z5B-WU.cjs +1 -0
  3. package/dist/{autocomplete-BgKbj6M4.js → autocomplete-bgySuP8X.js} +149 -142
  4. package/dist/calendar-CQumLNgS.cjs +1 -0
  5. package/dist/{calendar-j2_zvum1.js → calendar-nkYCMEy3.js} +9 -9
  6. package/dist/charts-Cot5lCgC.cjs +1 -0
  7. package/dist/{charts-CxEy2c3M.js → charts-Dscl6UC3.js} +122 -145
  8. package/dist/cn-B6R3HKzx.cjs +1 -0
  9. package/dist/{cn-DpgY2leY.js → cn-BJyZJP-y.js} +389 -389
  10. package/dist/{component-styles-Bgy44fc8.js → component-styles-C2CbHEEA.js} +2 -2
  11. package/dist/component-styles-DY4wigiq.cjs +1 -0
  12. package/dist/components/accordion.cjs +1 -1
  13. package/dist/components/accordion.js +2 -2
  14. package/dist/components/alert.cjs +1 -1
  15. package/dist/components/alert.js +3 -3
  16. package/dist/components/aspect-ratio.cjs +1 -0
  17. package/dist/components/aspect-ratio.d.ts +5 -0
  18. package/dist/components/aspect-ratio.js +20 -0
  19. package/dist/components/auth-backdrop.cjs +1 -1
  20. package/dist/components/auth-backdrop.d.ts +4 -1
  21. package/dist/components/auth-backdrop.js +12 -8
  22. package/dist/components/autocomplete/dropdown.d.ts +4 -1
  23. package/dist/components/autocomplete/multi-trigger.d.ts +3 -1
  24. package/dist/components/autocomplete/single-trigger.d.ts +3 -1
  25. package/dist/components/autocomplete/types.d.ts +15 -0
  26. package/dist/components/autocomplete.cjs +1 -1
  27. package/dist/components/autocomplete.js +1 -1
  28. package/dist/components/avatar-group.cjs +1 -0
  29. package/dist/components/avatar-group.d.ts +14 -0
  30. package/dist/components/avatar-group.js +35 -0
  31. package/dist/components/avatar.cjs +1 -1
  32. package/dist/components/avatar.js +2 -2
  33. package/dist/components/badge.cjs +1 -1
  34. package/dist/components/badge.js +1 -1
  35. package/dist/components/billing-interval-toggle.cjs +1 -1
  36. package/dist/components/billing-interval-toggle.d.ts +4 -6
  37. package/dist/components/billing-interval-toggle.js +26 -19
  38. package/dist/components/blockquote.cjs +1 -0
  39. package/dist/components/blockquote.d.ts +10 -0
  40. package/dist/components/blockquote.js +32 -0
  41. package/dist/components/breadcrumb.cjs +1 -1
  42. package/dist/components/breadcrumb.js +2 -2
  43. package/dist/components/button-group.cjs +1 -0
  44. package/dist/components/button-group.d.ts +7 -0
  45. package/dist/components/button-group.js +26 -0
  46. package/dist/components/button.cjs +1 -1
  47. package/dist/components/button.d.ts +2 -0
  48. package/dist/components/button.js +79 -36
  49. package/dist/components/calendar.cjs +1 -1
  50. package/dist/components/calendar.js +1 -1
  51. package/dist/components/callout.cjs +1 -1
  52. package/dist/components/callout.js +14 -14
  53. package/dist/components/card.cjs +1 -1
  54. package/dist/components/card.js +1 -1
  55. package/dist/components/charts/shared.d.ts +15 -0
  56. package/dist/components/charts.cjs +1 -1
  57. package/dist/components/charts.js +1 -1
  58. package/dist/components/checkbox.cjs +1 -1
  59. package/dist/components/checkbox.js +3 -3
  60. package/dist/components/code.cjs +3 -3
  61. package/dist/components/code.d.ts +4 -4
  62. package/dist/components/code.js +62 -60
  63. package/dist/components/command.cjs +1 -1
  64. package/dist/components/command.d.ts +8 -1
  65. package/dist/components/command.js +84 -83
  66. package/dist/components/confirm-dialog.cjs +1 -1
  67. package/dist/components/confirm-dialog.d.ts +8 -1
  68. package/dist/components/confirm-dialog.js +37 -31
  69. package/dist/components/copy-button.cjs +1 -1
  70. package/dist/components/copy-button.js +5 -4
  71. package/dist/components/currency.cjs +1 -0
  72. package/dist/components/currency.d.ts +18 -0
  73. package/dist/components/currency.js +62 -0
  74. package/dist/components/datatable/types.d.ts +4 -0
  75. package/dist/components/datatable.cjs +1 -1
  76. package/dist/components/datatable.d.ts +1 -5
  77. package/dist/components/datatable.js +1 -1
  78. package/dist/components/datepicker.cjs +1 -1
  79. package/dist/components/datepicker.d.ts +3 -3
  80. package/dist/components/datepicker.js +234 -105
  81. package/dist/components/description-list.cjs +1 -0
  82. package/dist/components/description-list.d.ts +14 -0
  83. package/dist/components/description-list.js +38 -0
  84. package/dist/components/divider.cjs +1 -0
  85. package/dist/components/divider.d.ts +12 -0
  86. package/dist/components/divider.js +45 -0
  87. package/dist/components/drawer.cjs +1 -1
  88. package/dist/components/drawer.d.ts +6 -1
  89. package/dist/components/drawer.js +128 -2
  90. package/dist/components/dropdown-menu-panel.cjs +1 -0
  91. package/dist/components/dropdown-menu-panel.d.ts +24 -0
  92. package/dist/components/dropdown-menu-panel.js +84 -0
  93. package/dist/components/dropdown-menu.cjs +1 -1
  94. package/dist/components/dropdown-menu.d.ts +5 -1
  95. package/dist/components/dropdown-menu.js +38 -93
  96. package/dist/components/empty-state.cjs +1 -1
  97. package/dist/components/empty-state.d.ts +5 -1
  98. package/dist/components/empty-state.js +9 -9
  99. package/dist/components/error-state.cjs +1 -1
  100. package/dist/components/error-state.js +2 -2
  101. package/dist/components/file-upload.cjs +1 -1
  102. package/dist/components/file-upload.js +4 -4
  103. package/dist/components/form-field.cjs +1 -1
  104. package/dist/components/form-field.d.ts +9 -0
  105. package/dist/components/form-field.js +49 -14
  106. package/dist/components/info-button.cjs +1 -1
  107. package/dist/components/info-button.d.ts +5 -3
  108. package/dist/components/info-button.js +33 -29
  109. package/dist/components/input.cjs +1 -1
  110. package/dist/components/input.js +3 -3
  111. package/dist/components/kbd.cjs +1 -1
  112. package/dist/components/kbd.js +1 -1
  113. package/dist/components/label.cjs +1 -1
  114. package/dist/components/label.js +2 -2
  115. package/dist/components/layout.cjs +1 -1
  116. package/dist/components/layout.js +1 -1
  117. package/dist/components/link.cjs +1 -1
  118. package/dist/components/link.js +1 -1
  119. package/dist/components/list.cjs +1 -1
  120. package/dist/components/list.js +1 -1
  121. package/dist/components/modal.cjs +1 -1
  122. package/dist/components/modal.d.ts +8 -1
  123. package/dist/components/modal.js +74 -120
  124. package/dist/components/navigation.cjs +1 -1
  125. package/dist/components/navigation.js +2 -2
  126. package/dist/components/number-input.cjs +1 -1
  127. package/dist/components/number-input.js +3 -3
  128. package/dist/components/otp-input.cjs +1 -1
  129. package/dist/components/otp-input.js +2 -2
  130. package/dist/components/overlay.cjs +1 -0
  131. package/dist/components/overlay.d.ts +52 -0
  132. package/dist/components/overlay.js +87 -0
  133. package/dist/components/pagination.cjs +1 -1
  134. package/dist/components/pagination.js +2 -2
  135. package/dist/components/popover.cjs +1 -1
  136. package/dist/components/popover.d.ts +2 -1
  137. package/dist/components/popover.js +41 -40
  138. package/dist/components/progressbar.cjs +1 -1
  139. package/dist/components/progressbar.js +1 -1
  140. package/dist/components/radio.cjs +1 -1
  141. package/dist/components/radio.js +3 -3
  142. package/dist/components/rating.cjs +1 -0
  143. package/dist/components/rating.d.ts +15 -0
  144. package/dist/components/rating.js +75 -0
  145. package/dist/components/richtext.cjs +1 -1
  146. package/dist/components/richtext.js +2 -2
  147. package/dist/components/scroll-area.cjs +1 -0
  148. package/dist/components/scroll-area.d.ts +8 -0
  149. package/dist/components/scroll-area.js +19 -0
  150. package/dist/components/select/option-list.d.ts +3 -1
  151. package/dist/components/select/types.d.ts +4 -0
  152. package/dist/components/select.cjs +1 -1
  153. package/dist/components/select.js +1 -1
  154. package/dist/components/seo.cjs +1 -1
  155. package/dist/components/seo.js +1 -1
  156. package/dist/components/separator.cjs +1 -1
  157. package/dist/components/separator.js +1 -1
  158. package/dist/components/skeleton.cjs +1 -1
  159. package/dist/components/skeleton.d.ts +14 -1
  160. package/dist/components/skeleton.js +56 -4
  161. package/dist/components/slider.cjs +1 -1
  162. package/dist/components/slider.js +2 -2
  163. package/dist/components/slot.cjs +1 -0
  164. package/dist/components/slot.d.ts +12 -0
  165. package/dist/components/slot.js +16 -0
  166. package/dist/components/snackbar-viewport.cjs +1 -0
  167. package/dist/components/snackbar-viewport.d.ts +27 -0
  168. package/dist/components/snackbar-viewport.js +181 -0
  169. package/dist/components/snackbar.cjs +1 -1
  170. package/dist/components/snackbar.d.ts +5 -1
  171. package/dist/components/snackbar.js +36 -200
  172. package/dist/components/spinner.cjs +1 -1
  173. package/dist/components/spinner.js +1 -1
  174. package/dist/components/stat.cjs +1 -1
  175. package/dist/components/stat.js +1 -1
  176. package/dist/components/status-dot.cjs +1 -1
  177. package/dist/components/status-dot.js +1 -1
  178. package/dist/components/stepper.cjs +1 -1
  179. package/dist/components/stepper.js +5 -5
  180. package/dist/components/switch.cjs +1 -1
  181. package/dist/components/switch.js +37 -43
  182. package/dist/components/table.cjs +1 -1
  183. package/dist/components/table.js +1 -1
  184. package/dist/components/tabs.cjs +1 -1
  185. package/dist/components/tabs.d.ts +6 -4
  186. package/dist/components/tabs.js +51 -81
  187. package/dist/components/tag.cjs +1 -1
  188. package/dist/components/tag.js +1 -1
  189. package/dist/components/terminal.cjs +1 -1
  190. package/dist/components/terminal.js +1 -1
  191. package/dist/components/textarea.cjs +1 -1
  192. package/dist/components/textarea.js +3 -3
  193. package/dist/components/theme-provider.cjs +1 -1
  194. package/dist/components/theme-provider.js +1 -1
  195. package/dist/components/theme-toggle.cjs +1 -1
  196. package/dist/components/theme-toggle.js +27 -3
  197. package/dist/components/time-picker.cjs +1 -0
  198. package/dist/components/time-picker.d.ts +31 -0
  199. package/dist/components/time-picker.js +394 -0
  200. package/dist/components/timeline.cjs +1 -1
  201. package/dist/components/timeline.js +1 -1
  202. package/dist/components/toggle.cjs +1 -0
  203. package/dist/components/toggle.d.ts +42 -0
  204. package/dist/components/toggle.js +116 -0
  205. package/dist/components/tooltip.cjs +1 -1
  206. package/dist/components/tooltip.d.ts +2 -1
  207. package/dist/components/tooltip.js +37 -36
  208. package/dist/components/tree.cjs +1 -1
  209. package/dist/components/tree.js +1 -1
  210. package/dist/components/typography.cjs +1 -0
  211. package/dist/components/typography.d.ts +50 -0
  212. package/dist/components/typography.js +202 -0
  213. package/dist/components/visually-hidden.cjs +1 -0
  214. package/dist/components/visually-hidden.d.ts +16 -0
  215. package/dist/components/visually-hidden.js +13 -0
  216. package/dist/{datatable-yBN4M3UV.js → datatable-BJoZMrKI.js} +6 -6
  217. package/dist/datatable-t0U7t_xh.cjs +1 -0
  218. package/dist/icons-Dfetr1L2.cjs +1 -0
  219. package/dist/icons-Dk7VZ4Ph.js +51 -0
  220. package/dist/index.cjs +1 -1
  221. package/dist/index.d.ts +16 -0
  222. package/dist/index.js +125 -86
  223. package/dist/lib/cn.d.ts +13 -1
  224. package/dist/lib/component-styles.d.ts +14 -2
  225. package/dist/lib/icons.d.ts +12 -0
  226. package/dist/lib/motion.d.ts +58 -0
  227. package/dist/motion-B2shivEB.cjs +1 -0
  228. package/dist/motion-gnRzFS5f.js +62 -0
  229. package/dist/select-ByjnuEcE.cjs +1 -0
  230. package/dist/{select-ClWrcj3R.js → select-CiMzLhUK.js} +128 -122
  231. package/dist/styles.css +1 -1
  232. package/dist/{terminal-CpraMs50.cjs → terminal-1U0ftG3i.cjs} +2 -2
  233. package/dist/{terminal-BOR2cFi1.js → terminal-VXdxVoAv.js} +4 -4
  234. package/dist/use-focus-trap-CPLT49gN.cjs +1 -0
  235. package/dist/use-focus-trap-CS6BXJAB.js +77 -0
  236. package/dist/{utils-CQ8pvCtk.js → utils-DEw5mQrH.js} +1 -1
  237. package/dist/{utils-DOFJTw8o.cjs → utils-MnnCTelh.cjs} +1 -1
  238. package/package.json +56 -9
  239. package/dist/autocomplete-Bk4pRQ2R.cjs +0 -1
  240. package/dist/calendar-CUXpVrVE.cjs +0 -1
  241. package/dist/charts-UDqS1BH1.cjs +0 -1
  242. package/dist/cn-BdjraxxU.cjs +0 -1
  243. package/dist/component-styles-DOUctc8_.cjs +0 -1
  244. package/dist/createLucideIcon-DDY8HuQR.js +0 -42
  245. package/dist/createLucideIcon-b_X_3fj-.cjs +0 -1
  246. package/dist/datatable-rzDgQ3r6.cjs +0 -1
  247. package/dist/drawer-CTeBsYrO.cjs +0 -1
  248. package/dist/drawer-ixuzyLVS.js +0 -189
  249. package/dist/select-BFwx--uK.cjs +0 -1
  250. package/dist/theme-toggle-Bb0BYo51.js +0 -71
  251. package/dist/theme-toggle-Cld8tktJ.cjs +0 -1
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { t as e } from "../cn-DpgY2leY.js";
3
- import { useRef as t, useState as n } from "react";
4
- import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
2
+ import { t as e } from "../cn-BJyZJP-y.js";
3
+ import { forwardRef as t, useRef as n, useState as r } from "react";
4
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
5
5
  //#region src/components/code.tsx
6
- var o = {
6
+ var s = {
7
7
  js: /* @__PURE__ */ "const.let.var.function.return.if.else.for.while.class.import.export.default.from.async.await.new.typeof.instanceof.true.false.null.undefined.throw.try.catch.finally.switch.case.break.continue.extends.super.this.of.in.delete.void".split("."),
8
8
  python: /* @__PURE__ */ "def.return.if.else.elif.for.while.class.import.from.as.with.try.except.finally.raise.pass.break.continue.and.or.not.in.is.True.False.None.lambda.yield.global.nonlocal.del.print.async.await".split("."),
9
9
  bash: [
@@ -30,9 +30,9 @@ var o = {
30
30
  ],
31
31
  sql: /* @__PURE__ */ "SELECT.FROM.WHERE.AND.OR.NOT.INSERT.INTO.VALUES.UPDATE.SET.DELETE.CREATE.TABLE.DROP.ALTER.INDEX.JOIN.INNER.LEFT.RIGHT.ON.GROUP.BY.ORDER.HAVING.LIMIT.OFFSET.AS.DISTINCT.COUNT.SUM.AVG.MAX.MIN.NULL.IS.IN.LIKE.BETWEEN.EXISTS".split(".")
32
32
  };
33
- o.ts = o.js, o.tsx = o.js, o.jsx = o.js, o.json = [];
34
- function s(e, t) {
35
- let n = new Set(o[t.toLowerCase()] ?? o.js), r = [], i = 0;
33
+ s.ts = s.js, s.tsx = s.js, s.jsx = s.js, s.json = [];
34
+ function c(e, t) {
35
+ let n = new Set(s[t.toLowerCase()] ?? s.js), r = [], i = 0;
36
36
  for (; i < e.length;) {
37
37
  if (t === "bash" && e[i] === "#" || e.slice(i, i + 2) === "//" && t !== "bash") {
38
38
  let t = e.indexOf("\n", i), n = t === -1 ? e.slice(i) : e.slice(i, t);
@@ -110,7 +110,7 @@ function s(e, t) {
110
110
  }
111
111
  return r;
112
112
  }
113
- var c = {
113
+ var l = {
114
114
  keyword: "text-violet-500 dark:text-violet-400",
115
115
  string: "text-emerald-600 dark:text-emerald-400",
116
116
  comment: "text-slate-400 dark:text-slate-500 italic",
@@ -119,8 +119,8 @@ var c = {
119
119
  builtin: "text-sky-500 dark:text-sky-400",
120
120
  plain: "text-slate-800 dark:text-slate-200"
121
121
  };
122
- function l({ code: t, language: o = "js", filename: l, showLineNumbers: u = !1, className: d }) {
123
- let [f, p] = n(!1), m = t.replace(/^\n/, "").replace(/\n$/, ""), h = m.split("\n");
122
+ function u({ code: t, language: n = "js", filename: s, showLineNumbers: u = !1, className: d }) {
123
+ let [f, p] = r(!1), m = t.replace(/^\n/, "").replace(/\n$/, ""), h = m.split("\n");
124
124
  async function g() {
125
125
  let e = !1;
126
126
  try {
@@ -132,27 +132,28 @@ function l({ code: t, language: o = "js", filename: l, showLineNumbers: u = !1,
132
132
  }
133
133
  e && (p(!0), window.setTimeout(() => p(!1), 1500));
134
134
  }
135
- return /* @__PURE__ */ a("div", {
136
- className: e("group relative rounded-xl overflow-hidden border border-black/10 dark:border-white/10 bg-slate-50 dark:bg-[#0d1117]", d),
137
- children: [/* @__PURE__ */ a("div", {
135
+ return /* @__PURE__ */ o("div", {
136
+ className: e("group relative rounded-[var(--radius-xl)] overflow-hidden border border-border bg-surface-muted dark:bg-navy-900", d),
137
+ children: [/* @__PURE__ */ o("div", {
138
138
  className: "flex items-center justify-between px-4 py-2.5 border-b border-black/[0.07] dark:border-white/[0.07] bg-black/3 dark:bg-white/3",
139
- children: [/* @__PURE__ */ i("div", {
139
+ children: [/* @__PURE__ */ a("div", {
140
140
  className: "flex items-center gap-2",
141
- children: l && /* @__PURE__ */ i("span", {
141
+ children: s && /* @__PURE__ */ a("span", {
142
142
  className: "text-xs font-mono text-slate-500 dark:text-slate-400",
143
- children: l
143
+ children: s
144
144
  })
145
- }), /* @__PURE__ */ a("div", {
145
+ }), /* @__PURE__ */ o("div", {
146
146
  className: "flex items-center gap-2",
147
- children: [!l && /* @__PURE__ */ i("span", {
147
+ children: [!s && /* @__PURE__ */ a("span", {
148
148
  className: "text-xs font-mono text-slate-400 dark:text-slate-500 uppercase",
149
- children: o
150
- }), /* @__PURE__ */ i("button", {
149
+ children: n
150
+ }), /* @__PURE__ */ a("button", {
151
151
  type: "button",
152
152
  onClick: g,
153
153
  "aria-label": f ? "Copied code" : "Copy code",
154
- className: "h-6 px-2 flex items-center gap-1 rounded text-xs text-slate-500 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white hover:bg-black/6 dark:hover:bg-white/8 transition-colors",
155
- children: f ? /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("svg", {
154
+ className: "h-6 shrink-0 px-2 flex items-center gap-1 whitespace-nowrap rounded text-xs text-slate-500 dark:text-slate-400 hover:text-foreground hover:bg-black/6 dark:hover:bg-white/8 transition-colors",
155
+ children: f ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("svg", {
156
+ className: "shrink-0",
156
157
  width: "11",
157
158
  height: "11",
158
159
  viewBox: "0 0 24 24",
@@ -161,8 +162,9 @@ function l({ code: t, language: o = "js", filename: l, showLineNumbers: u = !1,
161
162
  strokeWidth: "2.5",
162
163
  strokeLinecap: "round",
163
164
  strokeLinejoin: "round",
164
- children: /* @__PURE__ */ i("path", { d: "M20 6 9 17l-5-5" })
165
- }), "Copied"] }) : /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ a("svg", {
165
+ children: /* @__PURE__ */ a("path", { d: "M20 6 9 17l-5-5" })
166
+ }), "Copied"] }) : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("svg", {
167
+ className: "shrink-0",
166
168
  width: "11",
167
169
  height: "11",
168
170
  viewBox: "0 0 24 24",
@@ -171,30 +173,30 @@ function l({ code: t, language: o = "js", filename: l, showLineNumbers: u = !1,
171
173
  strokeWidth: "2",
172
174
  strokeLinecap: "round",
173
175
  strokeLinejoin: "round",
174
- children: [/* @__PURE__ */ i("rect", {
176
+ children: [/* @__PURE__ */ a("rect", {
175
177
  width: "14",
176
178
  height: "14",
177
179
  x: "8",
178
180
  y: "8",
179
181
  rx: "2",
180
182
  ry: "2"
181
- }), /* @__PURE__ */ i("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })]
183
+ }), /* @__PURE__ */ a("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })]
182
184
  }), "Copy"] })
183
185
  })]
184
186
  })]
185
- }), /* @__PURE__ */ i("div", {
187
+ }), /* @__PURE__ */ a("div", {
186
188
  className: "overflow-x-auto",
187
- children: /* @__PURE__ */ i("table", {
189
+ children: /* @__PURE__ */ a("table", {
188
190
  className: "w-full border-collapse text-sm font-mono leading-6",
189
- children: /* @__PURE__ */ i("tbody", { children: h.map((e, t) => /* @__PURE__ */ a("tr", {
191
+ children: /* @__PURE__ */ a("tbody", { children: h.map((e, t) => /* @__PURE__ */ o("tr", {
190
192
  className: "hover:bg-black/3 dark:hover:bg-white/3",
191
- children: [u && /* @__PURE__ */ i("td", {
193
+ children: [u && /* @__PURE__ */ a("td", {
192
194
  className: "select-none w-10 pr-4 pl-4 text-right text-slate-400 dark:text-slate-600 border-r border-black/6 dark:border-white/6",
193
195
  children: t + 1
194
- }), /* @__PURE__ */ i("td", {
196
+ }), /* @__PURE__ */ a("td", {
195
197
  className: "px-4 py-0 whitespace-pre",
196
- children: s(e, o).map((e, t) => /* @__PURE__ */ i("span", {
197
- className: c[e.type],
198
+ children: c(e, n).map((e, t) => /* @__PURE__ */ a("span", {
199
+ className: l[e.type],
198
200
  children: e.value
199
201
  }, t))
200
202
  })]
@@ -203,29 +205,29 @@ function l({ code: t, language: o = "js", filename: l, showLineNumbers: u = !1,
203
205
  })]
204
206
  });
205
207
  }
206
- function u({ children: t, className: n }) {
207
- return /* @__PURE__ */ i("code", {
208
- className: e("font-mono text-[0.85em] px-1.5 py-0.5 rounded-md bg-black/6 dark:bg-white/8 border border-black/[0.07] dark:border-white/[0.07] text-slate-700 dark:text-slate-300", n),
209
- children: t
210
- });
211
- }
212
- function d({ value: n, onChange: r, language: o = "js", placeholder: s = "// Start typing…", minRows: c = 6, maxRows: l = 24, readOnly: u = !1, className: d }) {
213
- let f = t(null), p = Math.min(l, Math.max(c, n.split("\n").length));
208
+ var d = t(({ className: t, ...n }, r) => /* @__PURE__ */ a("code", {
209
+ ref: r,
210
+ className: e("break-words rounded-md border border-border bg-surface-muted px-1.5 py-0.5 font-mono text-[0.85em] text-foreground", t),
211
+ ...n
212
+ }));
213
+ d.displayName = "InlineCode";
214
+ function f({ value: t, onChange: r, language: i = "js", placeholder: s = "// Start typing…", minRows: c = 6, maxRows: l = 24, readOnly: u = !1, className: d }) {
215
+ let f = n(null), p = Math.min(l, Math.max(c, t.split("\n").length));
214
216
  function m(e) {
215
- let t = e.currentTarget, { selectionStart: i, selectionEnd: a } = t;
217
+ let n = e.currentTarget, { selectionStart: i, selectionEnd: a } = n;
216
218
  if (e.key === "Tab") {
217
219
  e.preventDefault();
218
- let o = n.slice(0, i) + " " + n.slice(a);
220
+ let o = t.slice(0, i) + " " + t.slice(a);
219
221
  r?.(o), requestAnimationFrame(() => {
220
- t.selectionStart = t.selectionEnd = i + 2;
222
+ n.selectionStart = n.selectionEnd = i + 2;
221
223
  });
222
224
  }
223
225
  if (e.key === "Enter") {
224
- let o = n.lastIndexOf("\n", i - 1) + 1, s = n.slice(o).match(/^(\s*)/)?.[1] ?? "";
226
+ let o = t.lastIndexOf("\n", i - 1) + 1, s = t.slice(o).match(/^(\s*)/)?.[1] ?? "";
225
227
  e.preventDefault();
226
- let c = n.slice(0, i) + "\n" + s + n.slice(a);
228
+ let c = t.slice(0, i) + "\n" + s + t.slice(a);
227
229
  r?.(c), requestAnimationFrame(() => {
228
- t.selectionStart = t.selectionEnd = i + 1 + s.length;
230
+ n.selectionStart = n.selectionEnd = i + 1 + s.length;
229
231
  });
230
232
  }
231
233
  let o = {
@@ -238,29 +240,29 @@ function d({ value: n, onChange: r, language: o = "js", placeholder: s = "// Sta
238
240
  };
239
241
  if (o[e.key] && i === a) {
240
242
  e.preventDefault();
241
- let s = n.slice(0, i) + e.key + o[e.key] + n.slice(a);
243
+ let s = t.slice(0, i) + e.key + o[e.key] + t.slice(a);
242
244
  r?.(s), requestAnimationFrame(() => {
243
- t.selectionStart = t.selectionEnd = i + 1;
245
+ n.selectionStart = n.selectionEnd = i + 1;
244
246
  });
245
247
  }
246
248
  }
247
- return /* @__PURE__ */ a("div", {
248
- className: e("relative rounded-xl overflow-hidden border border-black/10 dark:border-white/10 bg-slate-50 dark:bg-[#0d1117]", d),
249
- children: [/* @__PURE__ */ i("div", {
249
+ return /* @__PURE__ */ o("div", {
250
+ className: e("relative rounded-[var(--radius-xl)] overflow-hidden border border-border bg-surface-muted dark:bg-navy-900", d),
251
+ children: [/* @__PURE__ */ a("div", {
250
252
  className: "flex items-center gap-1.5 px-4 py-2.5 border-b border-black/[0.07] dark:border-white/[0.07] bg-black/3 dark:bg-white/3",
251
- children: /* @__PURE__ */ i("span", {
253
+ children: /* @__PURE__ */ a("span", {
252
254
  className: "text-xs font-mono text-slate-400 dark:text-slate-500 uppercase",
253
- children: o
255
+ children: i
254
256
  })
255
- }), /* @__PURE__ */ a("div", {
257
+ }), /* @__PURE__ */ o("div", {
256
258
  className: "relative flex",
257
- children: [/* @__PURE__ */ i("div", {
259
+ children: [/* @__PURE__ */ a("div", {
258
260
  className: "select-none shrink-0 py-3 px-3 text-right text-sm font-mono leading-6 text-slate-400 dark:text-slate-600 border-r border-black/6 dark:border-white/6 bg-black/2 dark:bg-black/20",
259
261
  "aria-hidden": !0,
260
- children: Array.from({ length: p }, (e, t) => /* @__PURE__ */ i("div", { children: t + 1 }, t))
261
- }), /* @__PURE__ */ i("textarea", {
262
+ children: Array.from({ length: p }, (e, t) => /* @__PURE__ */ a("div", { children: t + 1 }, t))
263
+ }), /* @__PURE__ */ a("textarea", {
262
264
  ref: f,
263
- value: n,
265
+ value: t,
264
266
  onChange: (e) => r?.(e.target.value),
265
267
  onKeyDown: m,
266
268
  readOnly: u,
@@ -273,4 +275,4 @@ function d({ value: n, onChange: r, language: o = "js", placeholder: s = "// Sta
273
275
  });
274
276
  }
275
277
  //#endregion
276
- export { l as CodeBlock, d as CodeEditor, u as InlineCode };
278
+ export { u as CodeBlock, f as CodeEditor, d as InlineCode };
@@ -1 +1 @@
1
- "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");require("../component-styles-DOUctc8_.cjs");const t=require("../focus-DmG6Ge7X.cjs");let n=require("framer-motion"),r=require("react"),i=require("react/jsx-runtime");var a=(0,r.createContext)(null);function o(){let e=(0,r.useContext)(a);if(!e)throw Error(`useCommand must be inside <CommandProvider>`);return e}function s({children:e,shortcut:t=`k`}){let[n,o]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&e.key===t&&(e.preventDefault(),o(e=>!e))}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]),(0,i.jsx)(a.Provider,{value:{open:n,setOpen:o},children:e})}function c({items:a,placeholder:s=`Search commands…`,emptyText:c=`No results found.`,ariaLabel:l=`Command palette`}){let{open:u,setOpen:d}=o(),[f,p]=(0,r.useState)(``),[m,h]=(0,r.useState)(0),g=(0,r.useRef)(null),_=(0,r.useRef)(null),v=(0,r.useRef)(null),y=(0,r.useId)();(0,r.useEffect)(()=>{if(!u)return;let e=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.body.style.overflow,r=window.setTimeout(()=>g.current?.focus(),0),i=e=>{if(e.key===`Escape`){e.preventDefault(),d(!1);return}if(e.key!==`Tab`||!v.current)return;let n=t.t(v.current);if(n.length===0){e.preventDefault(),v.current.focus();return}let r=n[0],i=n[n.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r.focus())};return p(``),h(0),document.body.style.overflow=`hidden`,document.addEventListener(`keydown`,i),()=>{window.clearTimeout(r),document.body.style.overflow=n,document.removeEventListener(`keydown`,i),e?.focus()}},[u,d]);let b=(0,r.useMemo)(()=>{if(!f)return a;let e=f.toLowerCase();return a.filter(t=>t.label.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e)||t.keywords?.some(t=>t.toLowerCase().includes(e)))},[f,a]),x=(0,r.useMemo)(()=>{let e=new Map;for(let t of b){let n=t.group??``;e.has(n)||e.set(n,[]),e.get(n).push(t)}return e},[b]),S=(0,r.useMemo)(()=>Array.from(x.values()).flat(),[x]);function C(e){e.key===`ArrowDown`?(e.preventDefault(),h(e=>Math.min(e+1,Math.max(S.length-1,0)))):e.key===`ArrowUp`?(e.preventDefault(),h(e=>Math.max(e-1,0))):e.key===`Enter`?(e.preventDefault(),S[m]?.onSelect(),d(!1)):e.key===`Escape`&&d(!1)}(0,r.useEffect)(()=>{_.current&&_.current.querySelector(`[data-active="true"]`)?.scrollIntoView({block:`nearest`})},[m]);let w=0;return(0,i.jsx)(n.AnimatePresence,{children:u&&(0,i.jsxs)(`div`,{className:`fixed inset-0 z-[200] flex items-start justify-center pt-[15vh] p-4`,children:[(0,i.jsx)(n.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`absolute inset-0 bg-overlay`,onClick:()=>d(!1),"aria-hidden":`true`}),(0,i.jsxs)(n.motion.div,{ref:v,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-label":l,initial:{opacity:0,scale:.96,y:-8},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:-8},transition:{type:`spring`,stiffness:400,damping:30},className:`relative w-full max-w-lg overflow-hidden rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-overlay`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4`,children:[(0,i.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-slate-400 shrink-0`,children:[(0,i.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,i.jsx)(`path`,{d:`m21 21-4.35-4.35`})]}),(0,i.jsx)(`input`,{ref:g,type:`search`,role:`combobox`,"aria-label":l,"aria-autocomplete":`list`,"aria-expanded":`true`,"aria-controls":y,"aria-activedescendant":S[m]?`${y}-option-${m}`:void 0,value:f,onChange:e=>{p(e.target.value),h(0)},onKeyDown:C,placeholder:s,className:`min-w-0 flex-1 bg-transparent py-3.5 text-sm text-foreground outline-none placeholder:text-muted-foreground`}),(0,i.jsx)(`kbd`,{className:`shrink-0 rounded-[var(--radius-sm)] border border-border-strong bg-surface-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`ESC`})]}),(0,i.jsx)(`div`,{id:y,ref:_,role:`listbox`,"aria-label":`Commands`,className:`max-h-80 overflow-y-auto py-1.5`,children:b.length===0?(0,i.jsx)(`p`,{className:`py-10 text-center text-sm text-muted-foreground`,children:c}):Array.from(x.entries()).map(([t,n])=>(0,i.jsxs)(`div`,{role:`group`,"aria-label":t||void 0,children:[t&&(0,i.jsx)(`p`,{className:`px-4 py-1 text-[10px] font-semibold text-slate-500 uppercase tracking-widest`,children:t}),n.map(t=>{let n=w++,r=n===m;return(0,i.jsxs)(`button`,{id:`${y}-option-${n}`,type:`button`,role:`option`,"aria-selected":r,"data-active":r,onClick:()=>{t.onSelect(),d(!1)},onMouseEnter:()=>h(n),className:e.t(`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg`,r?`bg-surface-muted`:`hover:bg-surface-muted/70`),children:[t.icon&&(0,i.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400 w-5 flex items-center justify-center`,children:t.icon}),(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,i.jsx)(`p`,{className:`truncate text-sm text-foreground`,children:t.label}),t.description&&(0,i.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:t.description})]}),t.shortcut&&(0,i.jsx)(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:t.shortcut.map((e,t)=>(0,i.jsx)(`kbd`,{className:`rounded-[var(--radius-sm)] border border-border bg-surface-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:e},t))})]},t.id)})]},t))})]})]})})}exports.CommandPalette=c,exports.CommandProvider=s,exports.useCommand=o;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs");require("../component-styles-DY4wigiq.cjs");const t=require("../focus-DmG6Ge7X.cjs"),n=require("../motion-B2shivEB.cjs");let r=require("framer-motion"),i=require("react"),a=require("react/jsx-runtime");var o=(0,i.createContext)(null);function s(){let e=(0,i.useContext)(o);if(!e)throw Error(`useCommand must be inside <CommandProvider>`);return e}function c({children:e,shortcut:t=`k`}){let[n,r]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&e.key===t&&(e.preventDefault(),r(e=>!e))}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]),(0,a.jsx)(o.Provider,{value:{open:n,setOpen:r},children:e})}function l({items:o,placeholder:c=`Search commands…`,emptyText:l=`No results found.`,ariaLabel:u=`Command palette`,className:d,overlayClassName:f,searchClassName:p,inputClassName:m,listClassName:h,itemClassName:g,emptyClassName:_}){let{open:v,setOpen:y}=s(),[b,x]=(0,i.useState)(``),[S,C]=(0,i.useState)(0),w=(0,i.useRef)(null),T=(0,i.useRef)(null),E=(0,i.useRef)(null),D=(0,i.useId)();(0,i.useEffect)(()=>{if(!v)return;let e=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.body.style.overflow,r=window.setTimeout(()=>w.current?.focus(),0),i=e=>{if(e.key===`Escape`){e.preventDefault(),y(!1);return}if(e.key!==`Tab`||!E.current)return;let n=t.t(E.current);if(n.length===0){e.preventDefault(),E.current.focus();return}let r=n[0],i=n[n.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r.focus())};return x(``),C(0),document.body.style.overflow=`hidden`,document.addEventListener(`keydown`,i),()=>{window.clearTimeout(r),document.body.style.overflow=n,document.removeEventListener(`keydown`,i),e?.focus()}},[v,y]);let O=(0,i.useMemo)(()=>{if(!b)return o;let e=b.toLowerCase();return o.filter(t=>t.label.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e)||t.keywords?.some(t=>t.toLowerCase().includes(e)))},[b,o]),k=(0,i.useMemo)(()=>{let e=new Map;for(let t of O){let n=t.group??``;e.has(n)||e.set(n,[]),e.get(n).push(t)}return e},[O]),A=(0,i.useMemo)(()=>Array.from(k.values()).flat(),[k]);function j(e){e.key===`ArrowDown`?(e.preventDefault(),C(e=>Math.min(e+1,Math.max(A.length-1,0)))):e.key===`ArrowUp`?(e.preventDefault(),C(e=>Math.max(e-1,0))):e.key===`Enter`?(e.preventDefault(),A[S]?.onSelect(),y(!1)):e.key===`Escape`&&y(!1)}(0,i.useEffect)(()=>{T.current&&T.current.querySelector(`[data-active="true"]`)?.scrollIntoView({block:`nearest`})},[S]);let M=0;return(0,a.jsx)(r.AnimatePresence,{children:v&&(0,a.jsxs)(`div`,{className:`fixed inset-0 z-[200] flex items-start justify-center pt-[15vh] p-4`,children:[(0,a.jsx)(r.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:n.n.fade,className:e.t(`absolute inset-0 bg-overlay`,f),onClick:()=>y(!1),"aria-hidden":`true`}),(0,a.jsxs)(r.motion.div,{ref:E,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-label":u,initial:{opacity:0,scale:.96,y:-8},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:-8},transition:{type:`spring`,stiffness:400,damping:30},className:e.t(`relative w-full max-w-lg overflow-hidden rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-overlay`,d),children:[(0,a.jsxs)(`div`,{className:e.t(`flex items-center gap-3 border-b border-border px-4`,p),children:[(0,a.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-slate-400 shrink-0`,children:[(0,a.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,a.jsx)(`path`,{d:`m21 21-4.35-4.35`})]}),(0,a.jsx)(`input`,{ref:w,type:`search`,role:`combobox`,"aria-label":u,"aria-autocomplete":`list`,"aria-expanded":`true`,"aria-controls":D,"aria-activedescendant":A[S]?`${D}-option-${S}`:void 0,value:b,onChange:e=>{x(e.target.value),C(0)},onKeyDown:j,placeholder:c,className:e.t(`min-w-0 flex-1 bg-transparent py-3.5 text-sm text-foreground outline-none placeholder:text-muted-foreground`,m)}),(0,a.jsx)(`kbd`,{className:`shrink-0 rounded-[var(--radius-sm)] border border-border-strong bg-surface-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`ESC`})]}),(0,a.jsx)(`div`,{id:D,ref:T,role:`listbox`,"aria-label":`Commands`,className:e.t(`max-h-80 overflow-y-auto py-1.5`,h),children:O.length===0?(0,a.jsx)(`p`,{className:e.t(`py-10 text-center text-sm text-muted-foreground`,_),children:l}):Array.from(k.entries()).map(([t,n])=>(0,a.jsxs)(`div`,{role:`group`,"aria-label":t||void 0,children:[t&&(0,a.jsx)(`p`,{className:`px-4 py-1 text-[10px] font-semibold text-slate-500 uppercase tracking-widest`,children:t}),n.map(t=>{let n=M++,r=n===S;return(0,a.jsxs)(`button`,{id:`${D}-option-${n}`,type:`button`,role:`option`,"aria-selected":r,"data-active":r,onClick:()=>{t.onSelect(),y(!1)},onMouseEnter:()=>C(n),className:e.t(`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors`,`focus-ring`,r?`bg-surface-muted`:`hover:bg-surface-muted/70`,g),children:[t.icon&&(0,a.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400 w-5 flex items-center justify-center`,children:t.icon}),(0,a.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,a.jsx)(`p`,{className:`truncate text-sm text-foreground`,children:t.label}),t.description&&(0,a.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:t.description})]}),t.shortcut&&(0,a.jsx)(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:t.shortcut.map((e,t)=>(0,a.jsx)(`kbd`,{className:`rounded-[var(--radius-sm)] border border-border bg-surface-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:e},t))})]},t.id)})]},t))})]})]})})}exports.CommandPalette=l,exports.CommandProvider=c,exports.useCommand=s;
@@ -24,6 +24,13 @@ export interface CommandPaletteProps {
24
24
  placeholder?: string;
25
25
  emptyText?: string;
26
26
  ariaLabel?: string;
27
+ className?: string;
28
+ overlayClassName?: string;
29
+ searchClassName?: string;
30
+ inputClassName?: string;
31
+ listClassName?: string;
32
+ itemClassName?: string;
33
+ emptyClassName?: string;
27
34
  }
28
- export declare function CommandPalette({ items, placeholder, emptyText, ariaLabel, }: CommandPaletteProps): import("react").JSX.Element;
35
+ export declare function CommandPalette({ items, placeholder, emptyText, ariaLabel, className, overlayClassName, searchClassName, inputClassName, listClassName, itemClassName, emptyClassName, }: CommandPaletteProps): import("react").JSX.Element;
29
36
  export {};
@@ -1,25 +1,26 @@
1
1
  "use client";
2
- import { t as e } from "../cn-DpgY2leY.js";
3
- import "../component-styles-Bgy44fc8.js";
2
+ import { t as e } from "../cn-BJyZJP-y.js";
3
+ import "../component-styles-C2CbHEEA.js";
4
4
  import { t } from "../focus-Dk1YWVPN.js";
5
- import { AnimatePresence as n, motion as r } from "framer-motion";
6
- import { createContext as i, useContext as a, useEffect as o, useId as s, useMemo as c, useRef as l, useState as u } from "react";
7
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
+ import { n } from "../motion-gnRzFS5f.js";
6
+ import { AnimatePresence as r, motion as i } from "framer-motion";
7
+ import { createContext as a, useContext as o, useEffect as s, useId as c, useMemo as l, useRef as u, useState as d } from "react";
8
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
8
9
  //#region src/components/command.tsx
9
- var p = i(null);
10
- function m() {
11
- let e = a(p);
10
+ var m = a(null);
11
+ function h() {
12
+ let e = o(m);
12
13
  if (!e) throw Error("useCommand must be inside <CommandProvider>");
13
14
  return e;
14
15
  }
15
- function h({ children: e, shortcut: t = "k" }) {
16
- let [n, r] = u(!1);
17
- return o(() => {
16
+ function g({ children: e, shortcut: t = "k" }) {
17
+ let [n, r] = d(!1);
18
+ return s(() => {
18
19
  function e(e) {
19
20
  (e.metaKey || e.ctrlKey) && e.key === t && (e.preventDefault(), r((e) => !e));
20
21
  }
21
22
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
22
- }, [t]), /* @__PURE__ */ d(p.Provider, {
23
+ }, [t]), /* @__PURE__ */ f(m.Provider, {
23
24
  value: {
24
25
  open: n,
25
26
  setOpen: r
@@ -27,63 +28,63 @@ function h({ children: e, shortcut: t = "k" }) {
27
28
  children: e
28
29
  });
29
30
  }
30
- function g({ items: i, placeholder: a = "Search commands…", emptyText: p = "No results found.", ariaLabel: h = "Command palette" }) {
31
- let { open: g, setOpen: _ } = m(), [v, y] = u(""), [b, x] = u(0), S = l(null), C = l(null), w = l(null), T = s();
32
- o(() => {
33
- if (!g) return;
34
- let e = document.activeElement instanceof HTMLElement ? document.activeElement : null, n = document.body.style.overflow, r = window.setTimeout(() => S.current?.focus(), 0), i = (e) => {
31
+ function _({ items: a, placeholder: o = "Search commands…", emptyText: m = "No results found.", ariaLabel: g = "Command palette", className: _, overlayClassName: v, searchClassName: y, inputClassName: b, listClassName: x, itemClassName: S, emptyClassName: C }) {
32
+ let { open: w, setOpen: T } = h(), [E, D] = d(""), [O, k] = d(0), A = u(null), j = u(null), M = u(null), N = c();
33
+ s(() => {
34
+ if (!w) return;
35
+ let e = document.activeElement instanceof HTMLElement ? document.activeElement : null, n = document.body.style.overflow, r = window.setTimeout(() => A.current?.focus(), 0), i = (e) => {
35
36
  if (e.key === "Escape") {
36
- e.preventDefault(), _(!1);
37
+ e.preventDefault(), T(!1);
37
38
  return;
38
39
  }
39
- if (e.key !== "Tab" || !w.current) return;
40
- let n = t(w.current);
40
+ if (e.key !== "Tab" || !M.current) return;
41
+ let n = t(M.current);
41
42
  if (n.length === 0) {
42
- e.preventDefault(), w.current.focus();
43
+ e.preventDefault(), M.current.focus();
43
44
  return;
44
45
  }
45
46
  let r = n[0], i = n[n.length - 1];
46
47
  e.shiftKey && document.activeElement === r ? (e.preventDefault(), i.focus()) : !e.shiftKey && document.activeElement === i && (e.preventDefault(), r.focus());
47
48
  };
48
- return y(""), x(0), document.body.style.overflow = "hidden", document.addEventListener("keydown", i), () => {
49
+ return D(""), k(0), document.body.style.overflow = "hidden", document.addEventListener("keydown", i), () => {
49
50
  window.clearTimeout(r), document.body.style.overflow = n, document.removeEventListener("keydown", i), e?.focus();
50
51
  };
51
- }, [g, _]);
52
- let E = c(() => {
53
- if (!v) return i;
54
- let e = v.toLowerCase();
55
- return i.filter((t) => t.label.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e) || t.keywords?.some((t) => t.toLowerCase().includes(e)));
56
- }, [v, i]), D = c(() => {
52
+ }, [w, T]);
53
+ let P = l(() => {
54
+ if (!E) return a;
55
+ let e = E.toLowerCase();
56
+ return a.filter((t) => t.label.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e) || t.keywords?.some((t) => t.toLowerCase().includes(e)));
57
+ }, [E, a]), F = l(() => {
57
58
  let e = /* @__PURE__ */ new Map();
58
- for (let t of E) {
59
+ for (let t of P) {
59
60
  let n = t.group ?? "";
60
61
  e.has(n) || e.set(n, []), e.get(n).push(t);
61
62
  }
62
63
  return e;
63
- }, [E]), O = c(() => Array.from(D.values()).flat(), [D]);
64
- function k(e) {
65
- e.key === "ArrowDown" ? (e.preventDefault(), x((e) => Math.min(e + 1, Math.max(O.length - 1, 0)))) : e.key === "ArrowUp" ? (e.preventDefault(), x((e) => Math.max(e - 1, 0))) : e.key === "Enter" ? (e.preventDefault(), O[b]?.onSelect(), _(!1)) : e.key === "Escape" && _(!1);
64
+ }, [P]), I = l(() => Array.from(F.values()).flat(), [F]);
65
+ function L(e) {
66
+ e.key === "ArrowDown" ? (e.preventDefault(), k((e) => Math.min(e + 1, Math.max(I.length - 1, 0)))) : e.key === "ArrowUp" ? (e.preventDefault(), k((e) => Math.max(e - 1, 0))) : e.key === "Enter" ? (e.preventDefault(), I[O]?.onSelect(), T(!1)) : e.key === "Escape" && T(!1);
66
67
  }
67
- o(() => {
68
- C.current && C.current.querySelector("[data-active=\"true\"]")?.scrollIntoView({ block: "nearest" });
69
- }, [b]);
70
- let A = 0;
71
- return /* @__PURE__ */ d(n, { children: g && /* @__PURE__ */ f("div", {
68
+ s(() => {
69
+ j.current && j.current.querySelector("[data-active=\"true\"]")?.scrollIntoView({ block: "nearest" });
70
+ }, [O]);
71
+ let R = 0;
72
+ return /* @__PURE__ */ f(r, { children: w && /* @__PURE__ */ p("div", {
72
73
  className: "fixed inset-0 z-[200] flex items-start justify-center pt-[15vh] p-4",
73
- children: [/* @__PURE__ */ d(r.div, {
74
+ children: [/* @__PURE__ */ f(i.div, {
74
75
  initial: { opacity: 0 },
75
76
  animate: { opacity: 1 },
76
77
  exit: { opacity: 0 },
77
- transition: { duration: .15 },
78
- className: "absolute inset-0 bg-overlay",
79
- onClick: () => _(!1),
78
+ transition: n.fade,
79
+ className: e("absolute inset-0 bg-overlay", v),
80
+ onClick: () => T(!1),
80
81
  "aria-hidden": "true"
81
- }), /* @__PURE__ */ f(r.div, {
82
- ref: w,
82
+ }), /* @__PURE__ */ p(i.div, {
83
+ ref: M,
83
84
  tabIndex: -1,
84
85
  role: "dialog",
85
86
  "aria-modal": "true",
86
- "aria-label": h,
87
+ "aria-label": g,
87
88
  initial: {
88
89
  opacity: 0,
89
90
  scale: .96,
@@ -104,11 +105,11 @@ function g({ items: i, placeholder: a = "Search commands…", emptyText: p = "No
104
105
  stiffness: 400,
105
106
  damping: 30
106
107
  },
107
- className: "relative w-full max-w-lg overflow-hidden rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-overlay",
108
- children: [/* @__PURE__ */ f("div", {
109
- className: "flex items-center gap-3 border-b border-border px-4",
108
+ className: e("relative w-full max-w-lg overflow-hidden rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-overlay", _),
109
+ children: [/* @__PURE__ */ p("div", {
110
+ className: e("flex items-center gap-3 border-b border-border px-4", y),
110
111
  children: [
111
- /* @__PURE__ */ f("svg", {
112
+ /* @__PURE__ */ p("svg", {
112
113
  width: "16",
113
114
  height: "16",
114
115
  viewBox: "0 0 24 24",
@@ -118,80 +119,80 @@ function g({ items: i, placeholder: a = "Search commands…", emptyText: p = "No
118
119
  strokeLinecap: "round",
119
120
  strokeLinejoin: "round",
120
121
  className: "text-slate-400 shrink-0",
121
- children: [/* @__PURE__ */ d("circle", {
122
+ children: [/* @__PURE__ */ f("circle", {
122
123
  cx: "11",
123
124
  cy: "11",
124
125
  r: "8"
125
- }), /* @__PURE__ */ d("path", { d: "m21 21-4.35-4.35" })]
126
+ }), /* @__PURE__ */ f("path", { d: "m21 21-4.35-4.35" })]
126
127
  }),
127
- /* @__PURE__ */ d("input", {
128
- ref: S,
128
+ /* @__PURE__ */ f("input", {
129
+ ref: A,
129
130
  type: "search",
130
131
  role: "combobox",
131
- "aria-label": h,
132
+ "aria-label": g,
132
133
  "aria-autocomplete": "list",
133
134
  "aria-expanded": "true",
134
- "aria-controls": T,
135
- "aria-activedescendant": O[b] ? `${T}-option-${b}` : void 0,
136
- value: v,
135
+ "aria-controls": N,
136
+ "aria-activedescendant": I[O] ? `${N}-option-${O}` : void 0,
137
+ value: E,
137
138
  onChange: (e) => {
138
- y(e.target.value), x(0);
139
+ D(e.target.value), k(0);
139
140
  },
140
- onKeyDown: k,
141
- placeholder: a,
142
- className: "min-w-0 flex-1 bg-transparent py-3.5 text-sm text-foreground outline-none placeholder:text-muted-foreground"
141
+ onKeyDown: L,
142
+ placeholder: o,
143
+ className: e("min-w-0 flex-1 bg-transparent py-3.5 text-sm text-foreground outline-none placeholder:text-muted-foreground", b)
143
144
  }),
144
- /* @__PURE__ */ d("kbd", {
145
+ /* @__PURE__ */ f("kbd", {
145
146
  className: "shrink-0 rounded-[var(--radius-sm)] border border-border-strong bg-surface-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",
146
147
  children: "ESC"
147
148
  })
148
149
  ]
149
- }), /* @__PURE__ */ d("div", {
150
- id: T,
151
- ref: C,
150
+ }), /* @__PURE__ */ f("div", {
151
+ id: N,
152
+ ref: j,
152
153
  role: "listbox",
153
154
  "aria-label": "Commands",
154
- className: "max-h-80 overflow-y-auto py-1.5",
155
- children: E.length === 0 ? /* @__PURE__ */ d("p", {
156
- className: "py-10 text-center text-sm text-muted-foreground",
157
- children: p
158
- }) : Array.from(D.entries()).map(([t, n]) => /* @__PURE__ */ f("div", {
155
+ className: e("max-h-80 overflow-y-auto py-1.5", x),
156
+ children: P.length === 0 ? /* @__PURE__ */ f("p", {
157
+ className: e("py-10 text-center text-sm text-muted-foreground", C),
158
+ children: m
159
+ }) : Array.from(F.entries()).map(([t, n]) => /* @__PURE__ */ p("div", {
159
160
  role: "group",
160
161
  "aria-label": t || void 0,
161
- children: [t && /* @__PURE__ */ d("p", {
162
+ children: [t && /* @__PURE__ */ f("p", {
162
163
  className: "px-4 py-1 text-[10px] font-semibold text-slate-500 uppercase tracking-widest",
163
164
  children: t
164
165
  }), n.map((t) => {
165
- let n = A++, r = n === b;
166
- return /* @__PURE__ */ f("button", {
167
- id: `${T}-option-${n}`,
166
+ let n = R++, r = n === O;
167
+ return /* @__PURE__ */ p("button", {
168
+ id: `${N}-option-${n}`,
168
169
  type: "button",
169
170
  role: "option",
170
171
  "aria-selected": r,
171
172
  "data-active": r,
172
173
  onClick: () => {
173
- t.onSelect(), _(!1);
174
+ t.onSelect(), T(!1);
174
175
  },
175
- onMouseEnter: () => x(n),
176
- className: e("flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg", r ? "bg-surface-muted" : "hover:bg-surface-muted/70"),
176
+ onMouseEnter: () => k(n),
177
+ className: e("flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors", "focus-ring", r ? "bg-surface-muted" : "hover:bg-surface-muted/70", S),
177
178
  children: [
178
- t.icon && /* @__PURE__ */ d("span", {
179
+ t.icon && /* @__PURE__ */ f("span", {
179
180
  className: "shrink-0 text-slate-500 dark:text-slate-400 w-5 flex items-center justify-center",
180
181
  children: t.icon
181
182
  }),
182
- /* @__PURE__ */ f("div", {
183
+ /* @__PURE__ */ p("div", {
183
184
  className: "flex-1 min-w-0",
184
- children: [/* @__PURE__ */ d("p", {
185
+ children: [/* @__PURE__ */ f("p", {
185
186
  className: "truncate text-sm text-foreground",
186
187
  children: t.label
187
- }), t.description && /* @__PURE__ */ d("p", {
188
+ }), t.description && /* @__PURE__ */ f("p", {
188
189
  className: "truncate text-xs text-muted-foreground",
189
190
  children: t.description
190
191
  })]
191
192
  }),
192
- t.shortcut && /* @__PURE__ */ d("div", {
193
+ t.shortcut && /* @__PURE__ */ f("div", {
193
194
  className: "flex items-center gap-0.5 shrink-0",
194
- children: t.shortcut.map((e, t) => /* @__PURE__ */ d("kbd", {
195
+ children: t.shortcut.map((e, t) => /* @__PURE__ */ f("kbd", {
195
196
  className: "rounded-[var(--radius-sm)] border border-border bg-surface-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",
196
197
  children: e
197
198
  }, t))
@@ -205,4 +206,4 @@ function g({ items: i, placeholder: a = "Search commands…", emptyText: p = "No
205
206
  }) });
206
207
  }
207
208
  //#endregion
208
- export { g as CommandPalette, h as CommandProvider, m as useCommand };
209
+ export { _ as CommandPalette, g as CommandProvider, h as useCommand };
@@ -1 +1 @@
1
- "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./button.cjs"),t=require("./modal.cjs");let n=require("react/jsx-runtime");function r({open:r,onClose:i,onConfirm:a,title:o=`Are you sure?`,description:s,confirmLabel:c=`Confirm`,cancelLabel:l=`Cancel`,destructive:u=!1,loading:d=!1,icon:f}){return(0,n.jsxs)(t.Modal,{open:r,onClose:i,size:`sm`,title:o,description:typeof s==`string`?s:void 0,icon:f??(u?(0,n.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-red-600 dark:text-red-400`,children:[(0,n.jsx)(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z`}),(0,n.jsx)(`path`,{d:`M12 9v4`}),(0,n.jsx)(`path`,{d:`M12 17h.01`})]}):(0,n.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-info`,children:[(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,n.jsx)(`path`,{d:`M12 16v-4`}),(0,n.jsx)(`path`,{d:`M12 8h.01`})]})),children:[typeof s!=`string`&&s&&(0,n.jsx)(`div`,{className:`text-sm leading-relaxed text-slate-600 dark:text-slate-400`,children:s}),(0,n.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2.5 pt-2`,children:[(0,n.jsx)(e.Button,{variant:`ghost`,onClick:i,disabled:d,children:l}),(0,n.jsx)(e.Button,{variant:u?`destructive`:`primary`,onClick:a,loading:d,autoFocus:!0,children:c})]})]})}exports.ConfirmDialog=r;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs"),t=require("./button.cjs"),n=require("./modal.cjs");let r=require("react/jsx-runtime");function i({open:i,onClose:a,onConfirm:o,title:s=`Are you sure?`,description:c,confirmLabel:l=`Confirm`,cancelLabel:u=`Cancel`,destructive:d=!1,loading:f=!1,icon:p,className:m,overlayClassName:h,panelClassName:g,contentClassName:_,actionsClassName:v,cancelButtonClassName:y,confirmButtonClassName:b}){return(0,r.jsxs)(n.Modal,{open:i,onClose:a,size:`sm`,title:s,description:typeof c==`string`?c:void 0,icon:p??(d?(0,r.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-red-600 dark:text-red-400`,children:[(0,r.jsx)(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z`}),(0,r.jsx)(`path`,{d:`M12 9v4`}),(0,r.jsx)(`path`,{d:`M12 17h.01`})]}):(0,r.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-info`,children:[(0,r.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,r.jsx)(`path`,{d:`M12 16v-4`}),(0,r.jsx)(`path`,{d:`M12 8h.01`})]})),className:m,overlayClassName:h,panelClassName:g,children:[typeof c!=`string`&&c&&(0,r.jsx)(`div`,{className:e.t(`text-sm leading-relaxed text-slate-600 dark:text-slate-400`,_),children:c}),(0,r.jsxs)(`div`,{className:e.t(`flex flex-wrap justify-end gap-2.5 pt-2`,v),children:[(0,r.jsx)(t.Button,{variant:`ghost`,onClick:a,disabled:f,className:y,children:u}),(0,r.jsx)(t.Button,{variant:d?`destructive`:`primary`,onClick:o,loading:f,autoFocus:!0,className:b,children:l})]})]})}exports.ConfirmDialog=i;
@@ -10,5 +10,12 @@ export interface ConfirmDialogProps {
10
10
  destructive?: boolean;
11
11
  loading?: boolean;
12
12
  icon?: ReactNode;
13
+ className?: string;
14
+ overlayClassName?: string;
15
+ panelClassName?: string;
16
+ contentClassName?: string;
17
+ actionsClassName?: string;
18
+ cancelButtonClassName?: string;
19
+ confirmButtonClassName?: string;
13
20
  }
14
- export declare function ConfirmDialog({ open, onClose, onConfirm, title, description, confirmLabel, cancelLabel, destructive, loading, icon, }: ConfirmDialogProps): import("react").JSX.Element;
21
+ export declare function ConfirmDialog({ open, onClose, onConfirm, title, description, confirmLabel, cancelLabel, destructive, loading, icon, className, overlayClassName, panelClassName, contentClassName, actionsClassName, cancelButtonClassName, confirmButtonClassName, }: ConfirmDialogProps): import("react").JSX.Element;