asta-ui 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/dist/base/checkbox-aui-052.d.ts +2 -0
  2. package/dist/base/checkbox-aui-052.js +9 -0
  3. package/dist/base/checkbox-aui-053.d.ts +2 -0
  4. package/dist/base/checkbox-aui-053.js +9 -0
  5. package/dist/base/checkbox-aui-054.d.ts +2 -0
  6. package/dist/base/checkbox-aui-054.js +9 -0
  7. package/dist/base/combobox-aui-046.d.ts +2 -0
  8. package/dist/base/combobox-aui-046.js +9 -0
  9. package/dist/base/combobox-aui-047.d.ts +2 -0
  10. package/dist/base/combobox-aui-047.js +9 -0
  11. package/dist/base/date-picker-aui-050.d.ts +2 -0
  12. package/dist/base/date-picker-aui-050.js +9 -0
  13. package/dist/base/date-picker-aui-051.d.ts +2 -0
  14. package/dist/base/date-picker-aui-051.js +9 -0
  15. package/dist/base/input-aui-029.d.ts +2 -0
  16. package/dist/base/input-aui-029.js +9 -0
  17. package/dist/base/input-aui-030.d.ts +2 -0
  18. package/dist/base/input-aui-030.js +9 -0
  19. package/dist/base/input-aui-031.d.ts +2 -0
  20. package/dist/base/input-aui-031.js +9 -0
  21. package/dist/base/input-aui-032.d.ts +2 -0
  22. package/dist/base/input-aui-032.js +11 -0
  23. package/dist/base/input-aui-033.d.ts +2 -0
  24. package/dist/base/input-aui-033.js +11 -0
  25. package/dist/base/input-aui-034.d.ts +2 -0
  26. package/dist/base/input-aui-034.js +9 -0
  27. package/dist/base/otp-input-aui-041.d.ts +2 -0
  28. package/dist/base/otp-input-aui-041.js +9 -0
  29. package/dist/base/otp-input-aui-042.d.ts +2 -0
  30. package/dist/base/otp-input-aui-042.js +9 -0
  31. package/dist/base/password-input-aui-039.d.ts +2 -0
  32. package/dist/base/password-input-aui-039.js +9 -0
  33. package/dist/base/password-input-aui-040.d.ts +2 -0
  34. package/dist/base/password-input-aui-040.js +11 -0
  35. package/dist/base/radio-group-aui-055.d.ts +2 -0
  36. package/dist/base/radio-group-aui-055.js +9 -0
  37. package/dist/base/radio-group-aui-056.d.ts +2 -0
  38. package/dist/base/radio-group-aui-056.js +9 -0
  39. package/dist/base/radio-group-aui-057.d.ts +2 -0
  40. package/dist/base/radio-group-aui-057.js +9 -0
  41. package/dist/base/select-aui-043.d.ts +2 -0
  42. package/dist/base/select-aui-043.js +9 -0
  43. package/dist/base/select-aui-044.d.ts +2 -0
  44. package/dist/base/select-aui-044.js +9 -0
  45. package/dist/base/select-aui-045.d.ts +2 -0
  46. package/dist/base/select-aui-045.js +9 -0
  47. package/dist/base/slider-aui-061.d.ts +2 -0
  48. package/dist/base/slider-aui-061.js +9 -0
  49. package/dist/base/slider-aui-062.d.ts +2 -0
  50. package/dist/base/slider-aui-062.js +9 -0
  51. package/dist/base/slider-aui-063.d.ts +2 -0
  52. package/dist/base/slider-aui-063.js +9 -0
  53. package/dist/base/switch-aui-058.d.ts +2 -0
  54. package/dist/base/switch-aui-058.js +9 -0
  55. package/dist/base/switch-aui-059.d.ts +2 -0
  56. package/dist/base/switch-aui-059.js +9 -0
  57. package/dist/base/switch-aui-060.d.ts +2 -0
  58. package/dist/base/switch-aui-060.js +9 -0
  59. package/dist/base/tag-input-aui-048.d.ts +2 -0
  60. package/dist/base/tag-input-aui-048.js +9 -0
  61. package/dist/base/tag-input-aui-049.d.ts +2 -0
  62. package/dist/base/tag-input-aui-049.js +9 -0
  63. package/dist/base/textarea-aui-035.d.ts +2 -0
  64. package/dist/base/textarea-aui-035.js +9 -0
  65. package/dist/base/textarea-aui-036.d.ts +2 -0
  66. package/dist/base/textarea-aui-036.js +9 -0
  67. package/dist/base/textarea-aui-037.d.ts +2 -0
  68. package/dist/base/textarea-aui-037.js +9 -0
  69. package/dist/base/textarea-aui-038.d.ts +2 -0
  70. package/dist/base/textarea-aui-038.js +11 -0
  71. package/dist/base.js +239 -21
  72. package/dist/checkbox-aui-052.d.ts +2 -0
  73. package/dist/checkbox-aui-052.js +9 -0
  74. package/dist/checkbox-aui-053.d.ts +2 -0
  75. package/dist/checkbox-aui-053.js +9 -0
  76. package/dist/checkbox-aui-054.d.ts +2 -0
  77. package/dist/checkbox-aui-054.js +9 -0
  78. package/dist/chunk-2LSUWI2Z.js +180 -0
  79. package/dist/chunk-3XMVXIOF.js +267 -0
  80. package/dist/chunk-4YNUJFTL.js +165 -0
  81. package/dist/chunk-5OHHGQV6.js +175 -0
  82. package/dist/chunk-5TMFFW3Y.js +149 -0
  83. package/dist/chunk-ANZANDQM.js +107 -0
  84. package/dist/chunk-BIYNJDPD.js +158 -0
  85. package/dist/chunk-BV5HEXB5.js +339 -0
  86. package/dist/chunk-CDQNLDO6.js +156 -0
  87. package/dist/chunk-CZCZB5YP.js +142 -0
  88. package/dist/chunk-D6LGKFZH.js +140 -0
  89. package/dist/chunk-EKPTPTKK.js +93 -0
  90. package/dist/chunk-EVCUN45S.js +167 -0
  91. package/dist/chunk-FGQPCDXI.js +136 -0
  92. package/dist/chunk-GERWW3CA.js +311 -0
  93. package/dist/chunk-GJ3R6IZL.js +232 -0
  94. package/dist/chunk-HVFB44HO.js +219 -0
  95. package/dist/chunk-I2WXKWTQ.js +151 -0
  96. package/dist/chunk-J6GK2V2C.js +252 -0
  97. package/dist/chunk-JVTDNOHQ.js +173 -0
  98. package/dist/chunk-K5PWBSVO.js +200 -0
  99. package/dist/chunk-KQCXQY5K.js +155 -0
  100. package/dist/chunk-KXWC2UHE.js +308 -0
  101. package/dist/chunk-NICNFGHT.js +138 -0
  102. package/dist/chunk-P3USWDWR.js +331 -0
  103. package/dist/chunk-QYI7LQBQ.js +208 -0
  104. package/dist/chunk-U6N7CZYN.js +305 -0
  105. package/dist/chunk-UMDVPRJW.js +117 -0
  106. package/dist/chunk-VPZP6TCT.js +155 -0
  107. package/dist/chunk-VVAL2JZJ.js +332 -0
  108. package/dist/chunk-VWYHP4SB.js +154 -0
  109. package/dist/chunk-W7RITVDV.js +182 -0
  110. package/dist/chunk-WSTQ6WZO.js +193 -0
  111. package/dist/chunk-Z5GNX2S3.js +171 -0
  112. package/dist/chunk-ZBF2UYXP.js +225 -0
  113. package/dist/combobox-aui-046.d.ts +2 -0
  114. package/dist/combobox-aui-046.js +9 -0
  115. package/dist/combobox-aui-047.d.ts +2 -0
  116. package/dist/combobox-aui-047.js +9 -0
  117. package/dist/date-picker-aui-050.d.ts +2 -0
  118. package/dist/date-picker-aui-050.js +9 -0
  119. package/dist/date-picker-aui-051.d.ts +2 -0
  120. package/dist/date-picker-aui-051.js +9 -0
  121. package/dist/index.js +239 -21
  122. package/dist/input-aui-029.d.ts +2 -0
  123. package/dist/input-aui-029.js +9 -0
  124. package/dist/input-aui-030.d.ts +2 -0
  125. package/dist/input-aui-030.js +9 -0
  126. package/dist/input-aui-031.d.ts +2 -0
  127. package/dist/input-aui-031.js +9 -0
  128. package/dist/input-aui-032.d.ts +2 -0
  129. package/dist/input-aui-032.js +11 -0
  130. package/dist/input-aui-033.d.ts +2 -0
  131. package/dist/input-aui-033.js +11 -0
  132. package/dist/input-aui-034.d.ts +2 -0
  133. package/dist/input-aui-034.js +9 -0
  134. package/dist/otp-input-aui-041.d.ts +2 -0
  135. package/dist/otp-input-aui-041.js +9 -0
  136. package/dist/otp-input-aui-042.d.ts +2 -0
  137. package/dist/otp-input-aui-042.js +9 -0
  138. package/dist/password-input-aui-039.d.ts +2 -0
  139. package/dist/password-input-aui-039.js +9 -0
  140. package/dist/password-input-aui-040.d.ts +2 -0
  141. package/dist/password-input-aui-040.js +11 -0
  142. package/dist/radio-group-aui-055.d.ts +2 -0
  143. package/dist/radio-group-aui-055.js +9 -0
  144. package/dist/radio-group-aui-056.d.ts +2 -0
  145. package/dist/radio-group-aui-056.js +9 -0
  146. package/dist/radio-group-aui-057.d.ts +2 -0
  147. package/dist/radio-group-aui-057.js +9 -0
  148. package/dist/select-aui-043.d.ts +2 -0
  149. package/dist/select-aui-043.js +9 -0
  150. package/dist/select-aui-044.d.ts +2 -0
  151. package/dist/select-aui-044.js +9 -0
  152. package/dist/select-aui-045.d.ts +2 -0
  153. package/dist/select-aui-045.js +9 -0
  154. package/dist/slider-aui-061.d.ts +2 -0
  155. package/dist/slider-aui-061.js +9 -0
  156. package/dist/slider-aui-062.d.ts +2 -0
  157. package/dist/slider-aui-062.js +9 -0
  158. package/dist/slider-aui-063.d.ts +2 -0
  159. package/dist/slider-aui-063.js +9 -0
  160. package/dist/switch-aui-058.d.ts +2 -0
  161. package/dist/switch-aui-058.js +9 -0
  162. package/dist/switch-aui-059.d.ts +2 -0
  163. package/dist/switch-aui-059.js +9 -0
  164. package/dist/switch-aui-060.d.ts +2 -0
  165. package/dist/switch-aui-060.js +9 -0
  166. package/dist/tag-input-aui-048.d.ts +2 -0
  167. package/dist/tag-input-aui-048.js +9 -0
  168. package/dist/tag-input-aui-049.d.ts +2 -0
  169. package/dist/tag-input-aui-049.js +9 -0
  170. package/dist/textarea-aui-035.d.ts +2 -0
  171. package/dist/textarea-aui-035.js +9 -0
  172. package/dist/textarea-aui-036.d.ts +2 -0
  173. package/dist/textarea-aui-036.js +9 -0
  174. package/dist/textarea-aui-037.d.ts +2 -0
  175. package/dist/textarea-aui-037.js +9 -0
  176. package/dist/textarea-aui-038.d.ts +2 -0
  177. package/dist/textarea-aui-038.js +11 -0
  178. package/dist/types/components/kit/variants/checkbox-aui-052.d.ts +29 -0
  179. package/dist/types/components/kit/variants/checkbox-aui-053.d.ts +24 -0
  180. package/dist/types/components/kit/variants/checkbox-aui-054.d.ts +33 -0
  181. package/dist/types/components/kit/variants/combobox-aui-046.d.ts +23 -0
  182. package/dist/types/components/kit/variants/combobox-aui-047.d.ts +24 -0
  183. package/dist/types/components/kit/variants/date-picker-aui-050.d.ts +26 -0
  184. package/dist/types/components/kit/variants/date-picker-aui-051.d.ts +23 -0
  185. package/dist/types/components/kit/variants/input-aui-029.d.ts +21 -0
  186. package/dist/types/components/kit/variants/input-aui-030.d.ts +29 -0
  187. package/dist/types/components/kit/variants/input-aui-031.d.ts +24 -0
  188. package/dist/types/components/kit/variants/input-aui-032.d.ts +36 -0
  189. package/dist/types/components/kit/variants/input-aui-033.d.ts +23 -0
  190. package/dist/types/components/kit/variants/input-aui-034.d.ts +29 -0
  191. package/dist/types/components/kit/variants/otp-input-aui-041.d.ts +20 -0
  192. package/dist/types/components/kit/variants/otp-input-aui-042.d.ts +23 -0
  193. package/dist/types/components/kit/variants/password-input-aui-039.d.ts +16 -0
  194. package/dist/types/components/kit/variants/password-input-aui-040.d.ts +24 -0
  195. package/dist/types/components/kit/variants/radio-group-aui-055.d.ts +27 -0
  196. package/dist/types/components/kit/variants/radio-group-aui-056.d.ts +28 -0
  197. package/dist/types/components/kit/variants/radio-group-aui-057.d.ts +26 -0
  198. package/dist/types/components/kit/variants/select-aui-043.d.ts +29 -0
  199. package/dist/types/components/kit/variants/select-aui-044.d.ts +24 -0
  200. package/dist/types/components/kit/variants/select-aui-045.d.ts +29 -0
  201. package/dist/types/components/kit/variants/slider-aui-061.d.ts +20 -0
  202. package/dist/types/components/kit/variants/slider-aui-062.d.ts +24 -0
  203. package/dist/types/components/kit/variants/slider-aui-063.d.ts +17 -0
  204. package/dist/types/components/kit/variants/switch-aui-058.d.ts +24 -0
  205. package/dist/types/components/kit/variants/switch-aui-059.d.ts +20 -0
  206. package/dist/types/components/kit/variants/switch-aui-060.d.ts +15 -0
  207. package/dist/types/components/kit/variants/tag-input-aui-048.d.ts +16 -0
  208. package/dist/types/components/kit/variants/tag-input-aui-049.d.ts +15 -0
  209. package/dist/types/components/kit/variants/textarea-aui-035.d.ts +19 -0
  210. package/dist/types/components/kit/variants/textarea-aui-036.d.ts +23 -0
  211. package/dist/types/components/kit/variants/textarea-aui-037.d.ts +30 -0
  212. package/dist/types/components/kit/variants/textarea-aui-038.d.ts +28 -0
  213. package/dist/types/packages/asta-ui/src/base/checkbox-aui-052.d.ts +2 -0
  214. package/dist/types/packages/asta-ui/src/base/checkbox-aui-053.d.ts +2 -0
  215. package/dist/types/packages/asta-ui/src/base/checkbox-aui-054.d.ts +2 -0
  216. package/dist/types/packages/asta-ui/src/base/combobox-aui-046.d.ts +2 -0
  217. package/dist/types/packages/asta-ui/src/base/combobox-aui-047.d.ts +2 -0
  218. package/dist/types/packages/asta-ui/src/base/date-picker-aui-050.d.ts +2 -0
  219. package/dist/types/packages/asta-ui/src/base/date-picker-aui-051.d.ts +2 -0
  220. package/dist/types/packages/asta-ui/src/base/input-aui-029.d.ts +2 -0
  221. package/dist/types/packages/asta-ui/src/base/input-aui-030.d.ts +2 -0
  222. package/dist/types/packages/asta-ui/src/base/input-aui-031.d.ts +2 -0
  223. package/dist/types/packages/asta-ui/src/base/input-aui-032.d.ts +2 -0
  224. package/dist/types/packages/asta-ui/src/base/input-aui-033.d.ts +2 -0
  225. package/dist/types/packages/asta-ui/src/base/input-aui-034.d.ts +2 -0
  226. package/dist/types/packages/asta-ui/src/base/otp-input-aui-041.d.ts +2 -0
  227. package/dist/types/packages/asta-ui/src/base/otp-input-aui-042.d.ts +2 -0
  228. package/dist/types/packages/asta-ui/src/base/password-input-aui-039.d.ts +2 -0
  229. package/dist/types/packages/asta-ui/src/base/password-input-aui-040.d.ts +2 -0
  230. package/dist/types/packages/asta-ui/src/base/radio-group-aui-055.d.ts +2 -0
  231. package/dist/types/packages/asta-ui/src/base/radio-group-aui-056.d.ts +2 -0
  232. package/dist/types/packages/asta-ui/src/base/radio-group-aui-057.d.ts +2 -0
  233. package/dist/types/packages/asta-ui/src/base/select-aui-043.d.ts +2 -0
  234. package/dist/types/packages/asta-ui/src/base/select-aui-044.d.ts +2 -0
  235. package/dist/types/packages/asta-ui/src/base/select-aui-045.d.ts +2 -0
  236. package/dist/types/packages/asta-ui/src/base/slider-aui-061.d.ts +2 -0
  237. package/dist/types/packages/asta-ui/src/base/slider-aui-062.d.ts +2 -0
  238. package/dist/types/packages/asta-ui/src/base/slider-aui-063.d.ts +2 -0
  239. package/dist/types/packages/asta-ui/src/base/switch-aui-058.d.ts +2 -0
  240. package/dist/types/packages/asta-ui/src/base/switch-aui-059.d.ts +2 -0
  241. package/dist/types/packages/asta-ui/src/base/switch-aui-060.d.ts +2 -0
  242. package/dist/types/packages/asta-ui/src/base/tag-input-aui-048.d.ts +2 -0
  243. package/dist/types/packages/asta-ui/src/base/tag-input-aui-049.d.ts +2 -0
  244. package/dist/types/packages/asta-ui/src/base/textarea-aui-035.d.ts +2 -0
  245. package/dist/types/packages/asta-ui/src/base/textarea-aui-036.d.ts +2 -0
  246. package/dist/types/packages/asta-ui/src/base/textarea-aui-037.d.ts +2 -0
  247. package/dist/types/packages/asta-ui/src/base/textarea-aui-038.d.ts +2 -0
  248. package/dist/types/packages/asta-ui/src/base.d.ts +70 -0
  249. package/dist/types/packages/asta-ui/src/checkbox-aui-052.d.ts +2 -0
  250. package/dist/types/packages/asta-ui/src/checkbox-aui-053.d.ts +2 -0
  251. package/dist/types/packages/asta-ui/src/checkbox-aui-054.d.ts +2 -0
  252. package/dist/types/packages/asta-ui/src/combobox-aui-046.d.ts +2 -0
  253. package/dist/types/packages/asta-ui/src/combobox-aui-047.d.ts +2 -0
  254. package/dist/types/packages/asta-ui/src/date-picker-aui-050.d.ts +2 -0
  255. package/dist/types/packages/asta-ui/src/date-picker-aui-051.d.ts +2 -0
  256. package/dist/types/packages/asta-ui/src/index.d.ts +70 -0
  257. package/dist/types/packages/asta-ui/src/input-aui-029.d.ts +2 -0
  258. package/dist/types/packages/asta-ui/src/input-aui-030.d.ts +2 -0
  259. package/dist/types/packages/asta-ui/src/input-aui-031.d.ts +2 -0
  260. package/dist/types/packages/asta-ui/src/input-aui-032.d.ts +2 -0
  261. package/dist/types/packages/asta-ui/src/input-aui-033.d.ts +2 -0
  262. package/dist/types/packages/asta-ui/src/input-aui-034.d.ts +2 -0
  263. package/dist/types/packages/asta-ui/src/otp-input-aui-041.d.ts +2 -0
  264. package/dist/types/packages/asta-ui/src/otp-input-aui-042.d.ts +2 -0
  265. package/dist/types/packages/asta-ui/src/password-input-aui-039.d.ts +2 -0
  266. package/dist/types/packages/asta-ui/src/password-input-aui-040.d.ts +2 -0
  267. package/dist/types/packages/asta-ui/src/radio-group-aui-055.d.ts +2 -0
  268. package/dist/types/packages/asta-ui/src/radio-group-aui-056.d.ts +2 -0
  269. package/dist/types/packages/asta-ui/src/radio-group-aui-057.d.ts +2 -0
  270. package/dist/types/packages/asta-ui/src/select-aui-043.d.ts +2 -0
  271. package/dist/types/packages/asta-ui/src/select-aui-044.d.ts +2 -0
  272. package/dist/types/packages/asta-ui/src/select-aui-045.d.ts +2 -0
  273. package/dist/types/packages/asta-ui/src/slider-aui-061.d.ts +2 -0
  274. package/dist/types/packages/asta-ui/src/slider-aui-062.d.ts +2 -0
  275. package/dist/types/packages/asta-ui/src/slider-aui-063.d.ts +2 -0
  276. package/dist/types/packages/asta-ui/src/switch-aui-058.d.ts +2 -0
  277. package/dist/types/packages/asta-ui/src/switch-aui-059.d.ts +2 -0
  278. package/dist/types/packages/asta-ui/src/switch-aui-060.d.ts +2 -0
  279. package/dist/types/packages/asta-ui/src/tag-input-aui-048.d.ts +2 -0
  280. package/dist/types/packages/asta-ui/src/tag-input-aui-049.d.ts +2 -0
  281. package/dist/types/packages/asta-ui/src/textarea-aui-035.d.ts +2 -0
  282. package/dist/types/packages/asta-ui/src/textarea-aui-036.d.ts +2 -0
  283. package/dist/types/packages/asta-ui/src/textarea-aui-037.d.ts +2 -0
  284. package/dist/types/packages/asta-ui/src/textarea-aui-038.d.ts +2 -0
  285. package/package.json +1 -1
@@ -0,0 +1,308 @@
1
+ "use client";
2
+
3
+ // components/kit/variants/input-aui-030.tsx
4
+ import { useEffect, useId, useMemo, useRef, useState } from "react";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ var cx = (...c) => c.filter(Boolean).join(" ");
7
+ var EASE = "cubic-bezier(.16,1,.3,1)";
8
+ var ROW = 36;
9
+ var HEAD = 28;
10
+ var CSS = `
11
+ @keyframes aui030-pop { from { opacity: 0; transform: translateY(-6px) scale(.985) } to { opacity: 1; transform: none } }
12
+ @keyframes aui030-row { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }
13
+ @media (prefers-reduced-motion: reduce) { .aui030 * { animation: none !important; transition: none !important } }
14
+ `;
15
+ var RECENT = ["invoice template", "brand guidelines", "q4 roadmap"];
16
+ var PAGES = [
17
+ { label: "Projects", meta: "Workspace", kind: "page" },
18
+ { label: "Team members", meta: "Settings", kind: "page" },
19
+ { label: "Billing and invoices", meta: "Settings", kind: "page" }
20
+ ];
21
+ function Mark({ text, q }) {
22
+ const i = q ? text.toLowerCase().indexOf(q.toLowerCase()) : -1;
23
+ if (i < 0) return /* @__PURE__ */ jsx(Fragment, { children: text });
24
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
25
+ text.slice(0, i),
26
+ /* @__PURE__ */ jsx("span", { className: "text-[var(--aui030-fg)] underline decoration-brand decoration-2 underline-offset-[3px]", children: text.slice(i, i + q.length) }),
27
+ text.slice(i + q.length)
28
+ ] });
29
+ }
30
+ var Icon = ({ d, className }) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: cx("h-4 w-4 shrink-0", className), fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: d });
31
+ function SearchField({
32
+ placeholder = "Search Astabyte",
33
+ recent: recentProp = RECENT,
34
+ pages = PAGES,
35
+ onSearch,
36
+ shortcut = true,
37
+ defaultOpen = false,
38
+ tone = "dark",
39
+ className
40
+ }) {
41
+ const id = useId();
42
+ const input = useRef(null);
43
+ const root = useRef(null);
44
+ const [q, setQ] = useState("");
45
+ const [open, setOpen] = useState(defaultOpen);
46
+ const [active, setActive] = useState(0);
47
+ const [recent, setRecent] = useState(recentProp);
48
+ const dark = tone === "dark";
49
+ const items = useMemo(() => {
50
+ const s = q.trim().toLowerCase();
51
+ const r = recent.filter((x) => !s || x.includes(s)).map((label) => ({ label, kind: "recent" }));
52
+ const p = pages.filter((x) => !s || x.label.toLowerCase().includes(s));
53
+ return { r, p, all: [...r, ...p] };
54
+ }, [q, recent, pages]);
55
+ const y = (i) => (items.r.length && i >= 0 ? HEAD : 0) + i * ROW + (i >= items.r.length && items.p.length ? HEAD : 0);
56
+ const idx = Math.min(active, items.all.length - 1);
57
+ useEffect(() => {
58
+ if (!shortcut) return;
59
+ const onKey = (e) => {
60
+ const t = e.target;
61
+ const typing = t && (t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName));
62
+ if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k" || e.key === "/" && !typing) {
63
+ e.preventDefault();
64
+ input.current?.focus();
65
+ }
66
+ };
67
+ window.addEventListener("keydown", onKey);
68
+ return () => window.removeEventListener("keydown", onKey);
69
+ }, [shortcut]);
70
+ useEffect(() => {
71
+ if (!open) return;
72
+ const onDown = (e) => !root.current?.contains(e.target) && setOpen(false);
73
+ document.addEventListener("pointerdown", onDown);
74
+ return () => document.removeEventListener("pointerdown", onDown);
75
+ }, [open]);
76
+ const pick = (item) => {
77
+ const query = item?.label ?? q.trim();
78
+ if (!query) return;
79
+ if (!item || item.kind === "recent") setRecent((r) => [query, ...r.filter((x) => x !== query)].slice(0, 5));
80
+ onSearch?.(query, item);
81
+ setQ(item?.kind === "page" ? "" : query);
82
+ setOpen(false);
83
+ };
84
+ const onKeyDown = (e) => {
85
+ const n = items.all.length;
86
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
87
+ e.preventDefault();
88
+ if (!open) return setOpen(true);
89
+ if (n) setActive((a) => (Math.min(a, n - 1) + (e.key === "ArrowDown" ? 1 : n - 1)) % n);
90
+ } else if (e.key === "Enter") {
91
+ e.preventDefault();
92
+ pick(open && n && idx >= 0 ? items.all[idx] : void 0);
93
+ } else if (e.key === "Escape") {
94
+ if (open) setOpen(false);
95
+ else if (q) setQ("");
96
+ else input.current?.blur();
97
+ } else if (e.key === "Tab") setOpen(false);
98
+ };
99
+ const clear = () => {
100
+ setQ("");
101
+ setActive(0);
102
+ input.current?.focus();
103
+ };
104
+ const show = open && items.all.length > 0;
105
+ const listH = items.all.length * ROW + (items.r.length ? HEAD : 0) + (items.p.length ? HEAD : 0);
106
+ const optId = (i) => `${id}-o${i}`;
107
+ const head = (label, action) => /* @__PURE__ */ jsxs("li", { role: "presentation", className: "flex items-center justify-between px-3 font-mono text-[10.5px] uppercase tracking-[0.08em] text-mute", style: { height: HEAD }, children: [
108
+ label,
109
+ action
110
+ ] });
111
+ const row = (item, i) => /* @__PURE__ */ jsxs(
112
+ "li",
113
+ {
114
+ id: optId(i),
115
+ role: "option",
116
+ "aria-selected": i === idx,
117
+ onPointerMove: () => setActive(i),
118
+ onPointerDown: (e) => e.preventDefault(),
119
+ onClick: () => pick(item),
120
+ className: cx(
121
+ "group/r relative flex cursor-pointer items-center gap-3 rounded-[8px] px-3 text-[14px] transition-colors duration-200",
122
+ i === idx ? "text-[var(--aui030-fg)]" : "text-[var(--aui030-dim)]"
123
+ ),
124
+ style: { height: ROW, animation: `aui030-row .45s ${EASE} ${60 + i * 35}ms both` },
125
+ children: [
126
+ item.kind === "recent" ? /* @__PURE__ */ jsx(Icon, { d: /* @__PURE__ */ jsxs(Fragment, { children: [
127
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "5.75" }),
128
+ /* @__PURE__ */ jsx("path", { d: "M8 5v3l2 1.25" })
129
+ ] }), className: "text-mute" }) : /* @__PURE__ */ jsx(Icon, { d: /* @__PURE__ */ jsxs(Fragment, { children: [
130
+ /* @__PURE__ */ jsx("rect", { x: "2.25", y: "2.25", width: "11.5", height: "11.5", rx: "2.5" }),
131
+ /* @__PURE__ */ jsx("path", { d: "M6 8h4M8.5 6 10.5 8l-2 2" })
132
+ ] }), className: "text-mute" }),
133
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: /* @__PURE__ */ jsx(Mark, { text: item.label, q: q.trim() }) }),
134
+ item.kind === "recent" ? /* @__PURE__ */ jsx(
135
+ "button",
136
+ {
137
+ type: "button",
138
+ tabIndex: -1,
139
+ "aria-label": `Remove ${item.label}`,
140
+ onClick: (e) => {
141
+ e.stopPropagation();
142
+ setRecent((r) => r.filter((x) => x !== item.label));
143
+ },
144
+ className: "grid h-6 w-6 place-items-center rounded-[6px] text-mute opacity-0 transition-opacity duration-200 hover:text-[var(--aui030-fg)] group-hover/r:opacity-100",
145
+ children: /* @__PURE__ */ jsx(Icon, { d: /* @__PURE__ */ jsx("path", { d: "M4.5 4.5l7 7M11.5 4.5l-7 7" }), className: "h-3 w-3" })
146
+ }
147
+ ) : /* @__PURE__ */ jsx("span", { className: "text-[12px] text-mute", children: item.meta }),
148
+ /* @__PURE__ */ jsx(
149
+ Icon,
150
+ {
151
+ d: /* @__PURE__ */ jsx("path", { d: "M3 8h9M8.5 4.5 12 8l-3.5 3.5" }),
152
+ className: cx("h-3.5 w-3.5 transition-[transform,opacity] duration-300", i === idx ? "translate-x-0 opacity-100" : "-translate-x-1 opacity-0")
153
+ }
154
+ )
155
+ ]
156
+ },
157
+ item.kind + item.label
158
+ );
159
+ return /* @__PURE__ */ jsxs(
160
+ "div",
161
+ {
162
+ ref: root,
163
+ className: cx("aui030 relative w-full", className),
164
+ style: {
165
+ "--aui030-fg": dark ? "var(--paper)" : "var(--ink)",
166
+ "--aui030-dim": dark ? "color-mix(in srgb, var(--paper) 70%, transparent)" : "var(--ink-2)"
167
+ },
168
+ children: [
169
+ /* @__PURE__ */ jsx("style", { href: "asta-input-aui-030", precedence: "asta", children: CSS }),
170
+ /* @__PURE__ */ jsxs(
171
+ "div",
172
+ {
173
+ onPointerDown: (e) => {
174
+ if (e.target === e.currentTarget) {
175
+ e.preventDefault();
176
+ input.current?.focus();
177
+ }
178
+ },
179
+ className: cx(
180
+ "group/s flex h-11 items-center gap-2.5 rounded-[10px] px-3.5 transition-[box-shadow,background-color] duration-300",
181
+ dark ? "bg-[color-mix(in_srgb,var(--paper)_7%,transparent)] text-paper shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--paper)_10%,transparent)] hover:bg-[color-mix(in_srgb,var(--paper)_10%,transparent)] focus-within:shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_28%,transparent)]" : "bg-paper text-ink shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)] focus-within:shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_14%,transparent)]"
182
+ ),
183
+ children: [
184
+ /* @__PURE__ */ jsx(Icon, { d: /* @__PURE__ */ jsxs(Fragment, { children: [
185
+ /* @__PURE__ */ jsx("circle", { cx: "7", cy: "7", r: "4.75" }),
186
+ /* @__PURE__ */ jsx("path", { d: "m10.5 10.5 3 3" })
187
+ ] }), className: "text-mute transition-colors group-focus-within/s:text-[var(--aui030-fg)]" }),
188
+ /* @__PURE__ */ jsx(
189
+ "input",
190
+ {
191
+ ref: input,
192
+ type: "search",
193
+ role: "combobox",
194
+ "aria-label": placeholder,
195
+ "aria-expanded": show,
196
+ "aria-controls": `${id}-list`,
197
+ "aria-autocomplete": "list",
198
+ "aria-activedescendant": show && idx >= 0 ? optId(idx) : void 0,
199
+ value: q,
200
+ placeholder,
201
+ onFocus: () => setOpen(true),
202
+ onChange: (e) => {
203
+ setQ(e.target.value);
204
+ setActive(0);
205
+ setOpen(true);
206
+ },
207
+ onKeyDown,
208
+ className: "h-full min-w-0 flex-1 bg-transparent text-[14px] tracking-[-0.01em] outline-none placeholder:text-mute [&::-webkit-search-cancel-button]:hidden"
209
+ }
210
+ ),
211
+ /* @__PURE__ */ jsxs("span", { className: "relative grid h-6 w-8 shrink-0 place-items-center", children: [
212
+ /* @__PURE__ */ jsx(
213
+ "kbd",
214
+ {
215
+ "aria-hidden": true,
216
+ className: cx(
217
+ "absolute inset-0 grid place-items-center rounded-[6px] font-mono text-[11.5px] text-mute shadow-[inset_0_0_0_1px_color-mix(in_srgb,currentColor_45%,transparent)] transition-[transform,opacity] duration-300",
218
+ q ? "rotate-45 scale-50 opacity-0" : "opacity-100"
219
+ ),
220
+ style: { transitionTimingFunction: EASE },
221
+ children: "/"
222
+ }
223
+ ),
224
+ /* @__PURE__ */ jsx(
225
+ "button",
226
+ {
227
+ type: "button",
228
+ "aria-label": "Clear search",
229
+ tabIndex: q ? 0 : -1,
230
+ onClick: clear,
231
+ className: cx(
232
+ "absolute inset-y-0 right-1 grid w-6 place-items-center rounded-full text-[var(--aui030-fg)] outline-none transition-[transform,opacity] duration-300 focus-visible:ring-2 focus-visible:ring-brand/60",
233
+ dark ? "bg-[color-mix(in_srgb,var(--paper)_14%,transparent)]" : "bg-paper-2",
234
+ q ? "rotate-0 scale-100 opacity-100" : "pointer-events-none -rotate-90 scale-50 opacity-0"
235
+ ),
236
+ style: { transitionTimingFunction: EASE },
237
+ children: /* @__PURE__ */ jsx(Icon, { d: /* @__PURE__ */ jsx("path", { d: "M5 5l6 6M11 5l-6 6" }), className: "h-3 w-3" })
238
+ }
239
+ )
240
+ ] })
241
+ ]
242
+ }
243
+ ),
244
+ show && /* @__PURE__ */ jsxs(
245
+ "div",
246
+ {
247
+ className: cx(
248
+ "absolute inset-x-0 top-[calc(100%+8px)] z-20 origin-top rounded-[12px] p-1.5",
249
+ dark ? "bg-[color-mix(in_srgb,var(--ink)_92%,var(--paper))] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--paper)_10%,transparent),0_24px_48px_-16px_rgb(0_0_0/0.6)]" : "bg-paper shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_18px_40px_-20px_rgb(0_0_0/0.3)]"
250
+ ),
251
+ style: { animation: `aui030-pop .4s ${EASE} both` },
252
+ children: [
253
+ /* @__PURE__ */ jsxs("ul", { id: `${id}-list`, role: "listbox", "aria-label": "Suggestions", className: "relative", style: { height: listH }, children: [
254
+ /* @__PURE__ */ jsx(
255
+ "span",
256
+ {
257
+ "aria-hidden": true,
258
+ className: cx(
259
+ "pointer-events-none absolute inset-x-0 top-0 rounded-[8px] transition-transform duration-300",
260
+ dark ? "bg-[color-mix(in_srgb,var(--paper)_9%,transparent)]" : "bg-paper-2"
261
+ ),
262
+ style: { height: ROW, transform: `translateY(${y(idx)}px)`, transitionTimingFunction: EASE }
263
+ }
264
+ ),
265
+ items.r.length > 0 && head(
266
+ "Recent",
267
+ /* @__PURE__ */ jsx(
268
+ "button",
269
+ {
270
+ type: "button",
271
+ onPointerDown: (e) => e.preventDefault(),
272
+ onClick: () => setRecent([]),
273
+ className: "rounded font-sans text-[11.5px] normal-case tracking-normal text-mute outline-none transition-colors hover:text-[var(--aui030-fg)] focus-visible:ring-2 focus-visible:ring-brand/60",
274
+ children: "Clear"
275
+ }
276
+ )
277
+ ),
278
+ items.r.map((it, i) => row(it, i)),
279
+ items.p.length > 0 && head("Jump to"),
280
+ items.p.map((it, i) => row(it, items.r.length + i))
281
+ ] }),
282
+ /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center gap-3 px-3 pb-1 pt-2 text-[11.5px] text-mute", children: [
283
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
284
+ /* @__PURE__ */ jsx("kbd", { className: "font-mono", children: "\u2191\u2193" }),
285
+ " to move"
286
+ ] }),
287
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
288
+ /* @__PURE__ */ jsx("kbd", { className: "font-mono", children: "\u21B5" }),
289
+ " to open"
290
+ ] }),
291
+ /* @__PURE__ */ jsxs("span", { className: "ml-auto flex items-center gap-1", children: [
292
+ /* @__PURE__ */ jsx("kbd", { className: "font-mono", children: "esc" }),
293
+ " to close"
294
+ ] })
295
+ ] })
296
+ ]
297
+ }
298
+ )
299
+ ]
300
+ }
301
+ );
302
+ }
303
+ var input_aui_030_default = SearchField;
304
+
305
+ export {
306
+ SearchField,
307
+ input_aui_030_default
308
+ };
@@ -0,0 +1,138 @@
1
+ "use client";
2
+
3
+ // components/kit/variants/textarea-aui-035.tsx
4
+ import { useId, useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var cx = (...c) => c.filter(Boolean).join(" ");
7
+ var EASE = "cubic-bezier(.16,1,.3,1)";
8
+ var CSS = `
9
+ @keyframes aui035-rise { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
10
+ @keyframes aui035-pop { 0% { transform: scale(1) } 40% { transform: scale(1.2) } 100% { transform: scale(1) } }
11
+ @keyframes aui035-num { from { opacity: 0; transform: translateY(5px) } to { opacity: 1; transform: none } }
12
+ @media (prefers-reduced-motion: reduce) { .aui035 * { animation: none !important; transition: none !important } }
13
+ `;
14
+ var rise = (i) => ({ animation: `aui035-rise .6s ${EASE} ${i * 50}ms both` });
15
+ function BudgetTextarea({
16
+ value,
17
+ defaultValue = "",
18
+ onChange,
19
+ limit = 160,
20
+ warnAt = 20,
21
+ label = "Status update",
22
+ placeholder = "What changed this week?",
23
+ rows = 4,
24
+ className
25
+ }) {
26
+ const id = useId();
27
+ const [inner, setInner] = useState(defaultValue);
28
+ const text = value ?? inner;
29
+ const mirror = useRef(null);
30
+ const chars = [...text];
31
+ const n = chars.length;
32
+ const left = limit - n;
33
+ const over = left < 0;
34
+ const near = !over && left <= warnAt;
35
+ const R = 9;
36
+ const C = 2 * Math.PI * R;
37
+ const ratio = Math.min(n / limit, 1);
38
+ const head = chars.slice(0, limit).join("");
39
+ const tail = chars.slice(limit).join("");
40
+ return /* @__PURE__ */ jsxs("div", { className: cx("aui035 w-full max-w-[460px]", className), children: [
41
+ /* @__PURE__ */ jsx("style", { href: "asta-textarea-aui-035", precedence: "asta", children: CSS }),
42
+ /* @__PURE__ */ jsxs("label", { htmlFor: id, className: "mb-2 flex items-baseline justify-between text-[13px] font-medium text-ink", style: rise(0), children: [
43
+ label,
44
+ /* @__PURE__ */ jsxs("span", { className: "font-mono text-[11px] font-normal uppercase tracking-[0.08em] text-mute", children: [
45
+ limit,
46
+ " chars"
47
+ ] })
48
+ ] }),
49
+ /* @__PURE__ */ jsxs(
50
+ "div",
51
+ {
52
+ className: cx(
53
+ "relative rounded-[12px] bg-paper transition-shadow duration-300",
54
+ "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_12%,transparent),0_1px_2px_rgb(0_0_0/0.04)] hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_22%,transparent),0_1px_2px_rgb(0_0_0/0.04)]",
55
+ "focus-within:!shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_12%,transparent)]"
56
+ ),
57
+ style: rise(1),
58
+ children: [
59
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
60
+ /* @__PURE__ */ jsxs(
61
+ "div",
62
+ {
63
+ ref: mirror,
64
+ "aria-hidden": true,
65
+ className: "pointer-events-none absolute inset-0 overflow-hidden whitespace-pre-wrap break-words px-4 pb-2 pt-3.5 text-[14.5px] leading-[1.6] text-transparent",
66
+ children: [
67
+ head,
68
+ /* @__PURE__ */ jsx("mark", { className: "rounded-[3px] bg-[color-mix(in_srgb,var(--brand)_16%,transparent)] text-transparent shadow-[0_1.5px_0_var(--brand)]", children: tail }),
69
+ "\u200B"
70
+ ]
71
+ }
72
+ ),
73
+ /* @__PURE__ */ jsx(
74
+ "textarea",
75
+ {
76
+ id,
77
+ rows,
78
+ value: text,
79
+ placeholder,
80
+ "aria-describedby": `${id}-count`,
81
+ onScroll: (e) => {
82
+ if (mirror.current) mirror.current.scrollTop = e.currentTarget.scrollTop;
83
+ },
84
+ onChange: (e) => {
85
+ if (value === void 0) setInner(e.target.value);
86
+ onChange?.(e.target.value);
87
+ },
88
+ className: "relative block w-full resize-none bg-transparent px-4 pb-2 pt-3.5 text-[14.5px] leading-[1.6] text-ink outline-none placeholder:text-mute"
89
+ }
90
+ )
91
+ ] }),
92
+ /* @__PURE__ */ jsxs("div", { className: "pointer-events-none flex items-center justify-end gap-2.5 px-3 pb-2.5", children: [
93
+ /* @__PURE__ */ jsxs(
94
+ "span",
95
+ {
96
+ className: cx("text-[12px] transition-[opacity,transform] duration-300", over ? "opacity-100" : "translate-x-1 opacity-0"),
97
+ style: { transitionTimingFunction: EASE },
98
+ children: [
99
+ /* @__PURE__ */ jsx("span", { className: "font-medium tabular-nums text-ink", children: Math.max(-left, 0) }),
100
+ " ",
101
+ /* @__PURE__ */ jsx("span", { className: "text-mute", children: "over the soft limit" })
102
+ ]
103
+ }
104
+ ),
105
+ /* @__PURE__ */ jsxs("span", { className: "relative grid h-7 w-7 place-items-center", style: over ? { animation: `aui035-pop .45s ${EASE} both` } : void 0, children: [
106
+ /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: "absolute inset-0 h-7 w-7 -rotate-90", "aria-hidden": true, children: [
107
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: R, strokeWidth: "2.25", className: cx("stroke-[color-mix(in_srgb,var(--ink)_10%,transparent)] transition-colors duration-300", over ? "fill-ink" : "fill-transparent") }),
108
+ /* @__PURE__ */ jsx(
109
+ "circle",
110
+ {
111
+ cx: "12",
112
+ cy: "12",
113
+ r: R,
114
+ fill: "none",
115
+ strokeWidth: "2.25",
116
+ strokeLinecap: "round",
117
+ strokeDasharray: C,
118
+ strokeDashoffset: C * (1 - ratio),
119
+ className: cx(over ? "stroke-ink" : near ? "stroke-brand" : "stroke-[color-mix(in_srgb,var(--ink)_45%,transparent)]", n === 0 && "opacity-0")
120
+ }
121
+ )
122
+ ] }),
123
+ over && /* @__PURE__ */ jsx("span", { className: "relative text-[12px] font-semibold leading-none text-paper", style: { animation: `aui035-num .25s ${EASE} both` }, children: "!" }),
124
+ near && /* @__PURE__ */ jsx("span", { className: "relative text-[10px] font-semibold tabular-nums text-brand", style: { animation: `aui035-num .25s ${EASE} both` }, children: left }, left)
125
+ ] }, over ? "over" : "ok")
126
+ ] })
127
+ ]
128
+ }
129
+ ),
130
+ /* @__PURE__ */ jsx("p", { id: `${id}-count`, className: "sr-only", "aria-live": "polite", children: over ? `${-left} characters over the limit` : near ? `${left} characters left` : "" })
131
+ ] });
132
+ }
133
+ var textarea_aui_035_default = BudgetTextarea;
134
+
135
+ export {
136
+ BudgetTextarea,
137
+ textarea_aui_035_default
138
+ };