resuxjs 0.3.10 → 0.4.0-beta.2

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 (361) hide show
  1. package/README.md +23 -1
  2. package/dist/bin.d.ts +1 -2
  3. package/dist/bin.js +4 -0
  4. package/dist/bin.js.map +1 -1
  5. package/dist/build/index.d.ts +28 -0
  6. package/dist/build/index.js +51 -0
  7. package/dist/build/index.js.map +1 -0
  8. package/dist/cli.d.ts +15 -5
  9. package/dist/cli.js +2648 -3668
  10. package/dist/cli.js.map +1 -1
  11. package/dist/compiler/adapter.d.ts +14 -11
  12. package/dist/compiler/adapter.js +68 -93
  13. package/dist/compiler/adapter.js.map +1 -1
  14. package/dist/compiler/dev-warnings.d.ts +8 -5
  15. package/dist/compiler/dev-warnings.js +248 -321
  16. package/dist/compiler/dev-warnings.js.map +1 -1
  17. package/dist/compiler/directives.d.ts +3 -0
  18. package/dist/compiler/directives.js +124 -150
  19. package/dist/compiler/directives.js.map +1 -1
  20. package/dist/compiler/implementation.d.ts +96 -93
  21. package/dist/compiler/implementation.js +2967 -3430
  22. package/dist/compiler/index.d.ts +14 -11
  23. package/dist/compiler/index.js +68 -93
  24. package/dist/compiler/index.js.map +1 -1
  25. package/dist/core/config.d.ts +12 -5
  26. package/dist/core/config.js +42 -25
  27. package/dist/core/config.js.map +1 -1
  28. package/dist/core/hooks.d.ts +127 -126
  29. package/dist/core/hooks.js +45 -55
  30. package/dist/core/hooks.js.map +1 -1
  31. package/dist/core/index.d.ts +5 -4
  32. package/dist/core/index.js +5 -5
  33. package/dist/core/module-container.d.ts +76 -74
  34. package/dist/core/module-container.js +181 -186
  35. package/dist/core/module-container.js.map +1 -1
  36. package/dist/core/resux.d.ts +15 -12
  37. package/dist/core/resux.js +17 -13
  38. package/dist/core/resux.js.map +1 -1
  39. package/dist/create-bin.d.ts +1 -2
  40. package/dist/create-bin.js +4 -0
  41. package/dist/create-bin.js.map +1 -1
  42. package/dist/create.d.ts +3 -0
  43. package/dist/create.js +499 -638
  44. package/dist/create.js.map +1 -1
  45. package/dist/deploy/cloudflare.d.ts +4 -1
  46. package/dist/deploy/cloudflare.js +30 -34
  47. package/dist/deploy/cloudflare.js.map +1 -1
  48. package/dist/deploy/common.d.ts +6 -4
  49. package/dist/deploy/common.js +118 -188
  50. package/dist/deploy/common.js.map +1 -1
  51. package/dist/deploy/framework-runtime.d.ts +3 -0
  52. package/dist/deploy/framework-runtime.js +43 -48
  53. package/dist/deploy/framework-runtime.js.map +1 -1
  54. package/dist/deploy/index.d.ts +4 -1
  55. package/dist/deploy/index.js +58 -80
  56. package/dist/deploy/index.js.map +1 -1
  57. package/dist/deploy/netlify.d.ts +4 -1
  58. package/dist/deploy/netlify.js +40 -41
  59. package/dist/deploy/netlify.js.map +1 -1
  60. package/dist/deploy/node.d.ts +4 -1
  61. package/dist/deploy/node.js +24 -19
  62. package/dist/deploy/node.js.map +1 -1
  63. package/dist/deploy/production-report.d.ts +3 -0
  64. package/dist/deploy/production-report.js +14 -14
  65. package/dist/deploy/production-report.js.map +1 -1
  66. package/dist/deploy/runtime-dependencies.d.ts +3 -0
  67. package/dist/deploy/runtime-dependencies.js +158 -220
  68. package/dist/deploy/runtime-dependencies.js.map +1 -1
  69. package/dist/deploy/static.d.ts +4 -1
  70. package/dist/deploy/static.js +16 -14
  71. package/dist/deploy/static.js.map +1 -1
  72. package/dist/deploy/types.d.ts +25 -22
  73. package/dist/deploy/types.js +0 -1
  74. package/dist/deploy/vercel.d.ts +4 -1
  75. package/dist/deploy/vercel.js +137 -188
  76. package/dist/deploy/vercel.js.map +1 -1
  77. package/dist/fonts/index.d.ts +15 -11
  78. package/dist/fonts/index.js +114 -134
  79. package/dist/fonts/index.js.map +1 -1
  80. package/dist/globals.d.ts +79 -78
  81. package/dist/globals.js +0 -1
  82. package/dist/halal-core/ai/classifyProject.d.ts +4 -1
  83. package/dist/halal-core/ai/classifyProject.js +81 -95
  84. package/dist/halal-core/ai/classifyProject.js.map +1 -1
  85. package/dist/halal-core/ai/classifyRuntimeContent.d.ts +5 -2
  86. package/dist/halal-core/ai/classifyRuntimeContent.js +77 -95
  87. package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
  88. package/dist/halal-core/ai/createProjectSummary.d.ts +38 -35
  89. package/dist/halal-core/ai/createProjectSummary.js +38 -39
  90. package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
  91. package/dist/halal-core/ai/halalClassifierPrompt.d.ts +3 -0
  92. package/dist/halal-core/ai/halalClassifierPrompt.js +5 -1
  93. package/dist/halal-core/ai/halalClassifierPrompt.js.map +1 -1
  94. package/dist/halal-core/ai/redactSensitiveData.d.ts +3 -0
  95. package/dist/halal-core/ai/redactSensitiveData.js +82 -110
  96. package/dist/halal-core/ai/redactSensitiveData.js.map +1 -1
  97. package/dist/halal-core/ai/validateAiResponse.d.ts +4 -1
  98. package/dist/halal-core/ai/validateAiResponse.js +58 -85
  99. package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
  100. package/dist/halal-core/cli/check.d.ts +3 -0
  101. package/dist/halal-core/cli/check.js +28 -30
  102. package/dist/halal-core/cli/check.js.map +1 -1
  103. package/dist/halal-core/cli/explain.d.ts +3 -0
  104. package/dist/halal-core/cli/explain.js +27 -31
  105. package/dist/halal-core/cli/explain.js.map +1 -1
  106. package/dist/halal-core/cli/report.d.ts +3 -0
  107. package/dist/halal-core/cli/report.js +14 -10
  108. package/dist/halal-core/cli/report.js.map +1 -1
  109. package/dist/halal-core/cli/submitReview.d.ts +3 -0
  110. package/dist/halal-core/cli/submitReview.js +13 -9
  111. package/dist/halal-core/cli/submitReview.js.map +1 -1
  112. package/dist/halal-core/cli/verifyReview.d.ts +3 -0
  113. package/dist/halal-core/cli/verifyReview.js +18 -15
  114. package/dist/halal-core/cli/verifyReview.js.map +1 -1
  115. package/dist/halal-core/config.d.ts +30 -27
  116. package/dist/halal-core/config.js +76 -118
  117. package/dist/halal-core/config.js.map +1 -1
  118. package/dist/halal-core/crypto/integrity.d.ts +6 -3
  119. package/dist/halal-core/crypto/integrity.js +64 -87
  120. package/dist/halal-core/crypto/integrity.js.map +1 -1
  121. package/dist/halal-core/enforce.d.ts +3 -0
  122. package/dist/halal-core/enforce.js +92 -105
  123. package/dist/halal-core/enforce.js.map +1 -1
  124. package/dist/halal-core/index.d.ts +20 -16
  125. package/dist/halal-core/index.js +18 -19
  126. package/dist/halal-core/lifecycle.d.ts +3 -0
  127. package/dist/halal-core/lifecycle.js +15 -13
  128. package/dist/halal-core/lifecycle.js.map +1 -1
  129. package/dist/halal-core/policy.d.ts +4 -1
  130. package/dist/halal-core/policy.js +6 -2
  131. package/dist/halal-core/policy.js.map +1 -1
  132. package/dist/halal-core/report/formatBrowserOverlay.d.ts +4 -1
  133. package/dist/halal-core/report/formatBrowserOverlay.js +10 -8
  134. package/dist/halal-core/report/formatBrowserOverlay.js.map +1 -1
  135. package/dist/halal-core/report/formatTerminalReport.d.ts +4 -1
  136. package/dist/halal-core/report/formatTerminalReport.js +27 -37
  137. package/dist/halal-core/report/formatTerminalReport.js.map +1 -1
  138. package/dist/halal-core/report/generateHalalReport.d.ts +7 -4
  139. package/dist/halal-core/report/generateHalalReport.js +26 -26
  140. package/dist/halal-core/report/generateHalalReport.js.map +1 -1
  141. package/dist/halal-core/report/signReport.d.ts +4 -1
  142. package/dist/halal-core/report/signReport.js +16 -12
  143. package/dist/halal-core/report/signReport.js.map +1 -1
  144. package/dist/halal-core/report/verifyReport.d.ts +9 -6
  145. package/dist/halal-core/report/verifyReport.js +51 -41
  146. package/dist/halal-core/report/verifyReport.js.map +1 -1
  147. package/dist/halal-core/review/createReviewRequest.d.ts +4 -1
  148. package/dist/halal-core/review/createReviewRequest.js +21 -17
  149. package/dist/halal-core/review/createReviewRequest.js.map +1 -1
  150. package/dist/halal-core/review/reviewPolicy.d.ts +3 -0
  151. package/dist/halal-core/review/reviewPolicy.js +19 -17
  152. package/dist/halal-core/review/reviewPolicy.js.map +1 -1
  153. package/dist/halal-core/review/signedReviewFile.d.ts +11 -8
  154. package/dist/halal-core/review/signedReviewFile.js +24 -22
  155. package/dist/halal-core/review/signedReviewFile.js.map +1 -1
  156. package/dist/halal-core/review/verifyReviewApproval.d.ts +9 -6
  157. package/dist/halal-core/review/verifyReviewApproval.js +68 -62
  158. package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
  159. package/dist/halal-core/rules/adultContentRules.d.ts +3 -0
  160. package/dist/halal-core/rules/adultContentRules.js +23 -23
  161. package/dist/halal-core/rules/adultContentRules.js.map +1 -1
  162. package/dist/halal-core/rules/alcoholDrugVapeRules.d.ts +3 -0
  163. package/dist/halal-core/rules/alcoholDrugVapeRules.js +22 -22
  164. package/dist/halal-core/rules/alcoholDrugVapeRules.js.map +1 -1
  165. package/dist/halal-core/rules/childSafetyRules.d.ts +3 -0
  166. package/dist/halal-core/rules/childSafetyRules.js +19 -19
  167. package/dist/halal-core/rules/childSafetyRules.js.map +1 -1
  168. package/dist/halal-core/rules/coreCategories.d.ts +7 -4
  169. package/dist/halal-core/rules/coreCategories.js +237 -110
  170. package/dist/halal-core/rules/coreCategories.js.map +1 -1
  171. package/dist/halal-core/rules/cyberAbuseRules.d.ts +3 -0
  172. package/dist/halal-core/rules/cyberAbuseRules.js +27 -27
  173. package/dist/halal-core/rules/cyberAbuseRules.js.map +1 -1
  174. package/dist/halal-core/rules/defaultBlockedRules.d.ts +21 -18
  175. package/dist/halal-core/rules/defaultBlockedRules.js +158 -199
  176. package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
  177. package/dist/halal-core/rules/dependencyRules.d.ts +8 -5
  178. package/dist/halal-core/rules/dependencyRules.js +50 -56
  179. package/dist/halal-core/rules/dependencyRules.js.map +1 -1
  180. package/dist/halal-core/rules/endpointRules.d.ts +6 -3
  181. package/dist/halal-core/rules/endpointRules.js +21 -23
  182. package/dist/halal-core/rules/endpointRules.js.map +1 -1
  183. package/dist/halal-core/rules/environmentalHarmRules.d.ts +3 -0
  184. package/dist/halal-core/rules/environmentalHarmRules.js +17 -17
  185. package/dist/halal-core/rules/environmentalHarmRules.js.map +1 -1
  186. package/dist/halal-core/rules/financeRibaRules.d.ts +3 -0
  187. package/dist/halal-core/rules/financeRibaRules.js +20 -20
  188. package/dist/halal-core/rules/financeRibaRules.js.map +1 -1
  189. package/dist/halal-core/rules/gamblingRules.d.ts +3 -0
  190. package/dist/halal-core/rules/gamblingRules.js +22 -22
  191. package/dist/halal-core/rules/gamblingRules.js.map +1 -1
  192. package/dist/halal-core/rules/generalHarmRules.d.ts +3 -0
  193. package/dist/halal-core/rules/generalHarmRules.js +15 -15
  194. package/dist/halal-core/rules/generalHarmRules.js.map +1 -1
  195. package/dist/halal-core/rules/healthHarmRules.d.ts +3 -0
  196. package/dist/halal-core/rules/healthHarmRules.js +19 -19
  197. package/dist/halal-core/rules/healthHarmRules.js.map +1 -1
  198. package/dist/halal-core/rules/keywordRules.d.ts +11 -8
  199. package/dist/halal-core/rules/keywordRules.js +90 -39
  200. package/dist/halal-core/rules/keywordRules.js.map +1 -1
  201. package/dist/halal-core/rules/privacyAbuseRules.d.ts +3 -0
  202. package/dist/halal-core/rules/privacyAbuseRules.js +21 -21
  203. package/dist/halal-core/rules/privacyAbuseRules.js.map +1 -1
  204. package/dist/halal-core/rules/scamFraudRules.d.ts +3 -0
  205. package/dist/halal-core/rules/scamFraudRules.js +29 -29
  206. package/dist/halal-core/rules/scamFraudRules.js.map +1 -1
  207. package/dist/halal-core/rules/selfHarmRules.d.ts +3 -0
  208. package/dist/halal-core/rules/selfHarmRules.js +17 -17
  209. package/dist/halal-core/rules/selfHarmRules.js.map +1 -1
  210. package/dist/halal-core/rules/violenceExtremismRules.d.ts +3 -0
  211. package/dist/halal-core/rules/violenceExtremismRules.js +30 -30
  212. package/dist/halal-core/rules/violenceExtremismRules.js.map +1 -1
  213. package/dist/halal-core/runtime/guard.d.ts +17 -14
  214. package/dist/halal-core/runtime/guard.js +162 -183
  215. package/dist/halal-core/runtime/guard.js.map +1 -1
  216. package/dist/halal-core/runtime/index.d.ts +5 -4
  217. package/dist/halal-core/runtime/index.js +4 -5
  218. package/dist/halal-core/runtime/reviewedMemory.d.ts +4 -1
  219. package/dist/halal-core/runtime/reviewedMemory.js +74 -110
  220. package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
  221. package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +10 -7
  222. package/dist/halal-core/runtime/serializeRuntimeContent.js +132 -156
  223. package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
  224. package/dist/halal-core/runtime/types.d.ts +44 -41
  225. package/dist/halal-core/runtime/types.js +0 -1
  226. package/dist/halal-core/scanner/scanApiRoutes.d.ts +3 -0
  227. package/dist/halal-core/scanner/scanApiRoutes.js +32 -36
  228. package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
  229. package/dist/halal-core/scanner/scanComponents.d.ts +3 -0
  230. package/dist/halal-core/scanner/scanComponents.js +12 -13
  231. package/dist/halal-core/scanner/scanComponents.js.map +1 -1
  232. package/dist/halal-core/scanner/scanContent.d.ts +5 -2
  233. package/dist/halal-core/scanner/scanContent.js +193 -263
  234. package/dist/halal-core/scanner/scanContent.js.map +1 -1
  235. package/dist/halal-core/scanner/scanDependencies.d.ts +3 -0
  236. package/dist/halal-core/scanner/scanDependencies.js +16 -15
  237. package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
  238. package/dist/halal-core/scanner/scanDomains.d.ts +5 -2
  239. package/dist/halal-core/scanner/scanDomains.js +12 -12
  240. package/dist/halal-core/scanner/scanDomains.js.map +1 -1
  241. package/dist/halal-core/scanner/scanEnvNames.d.ts +3 -0
  242. package/dist/halal-core/scanner/scanEnvNames.js +23 -26
  243. package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
  244. package/dist/halal-core/scanner/scanMetadata.d.ts +6 -3
  245. package/dist/halal-core/scanner/scanMetadata.js +20 -29
  246. package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
  247. package/dist/halal-core/scanner/scanPages.d.ts +3 -0
  248. package/dist/halal-core/scanner/scanPages.js +12 -15
  249. package/dist/halal-core/scanner/scanPages.js.map +1 -1
  250. package/dist/halal-core/scanner/scanProject.d.ts +15 -10
  251. package/dist/halal-core/scanner/scanProject.js +43 -49
  252. package/dist/halal-core/scanner/scanProject.js.map +1 -1
  253. package/dist/halal-core/scanner/scanRoutes.d.ts +3 -0
  254. package/dist/halal-core/scanner/scanRoutes.js +32 -39
  255. package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
  256. package/dist/halal-core/scanner/scanTranslations.d.ts +3 -0
  257. package/dist/halal-core/scanner/scanTranslations.js +21 -29
  258. package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
  259. package/dist/halal-core/status.d.ts +14 -11
  260. package/dist/halal-core/status.js +0 -1
  261. package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +3 -0
  262. package/dist/halal-core/tamper/verifyCoreIntegrity.js +26 -24
  263. package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
  264. package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +3 -0
  265. package/dist/halal-core/tamper/verifyLifecycleHooks.js +13 -12
  266. package/dist/halal-core/tamper/verifyLifecycleHooks.js.map +1 -1
  267. package/dist/halal-core/tamper/verifyReportSignature.d.ts +6 -3
  268. package/dist/halal-core/tamper/verifyReportSignature.js +20 -14
  269. package/dist/halal-core/tamper/verifyReportSignature.js.map +1 -1
  270. package/dist/halal.d.ts +20 -1
  271. package/dist/halal.js +18 -2
  272. package/dist/i18n/index.d.ts +34 -31
  273. package/dist/i18n/index.js +219 -288
  274. package/dist/i18n/index.js.map +1 -1
  275. package/dist/i18n/shared.d.ts +18 -15
  276. package/dist/i18n/shared.js +204 -266
  277. package/dist/i18n/shared.js.map +1 -1
  278. package/dist/icons/index.d.ts +143 -139
  279. package/dist/icons/index.js +322 -273
  280. package/dist/icons/index.js.map +1 -1
  281. package/dist/index.d.ts +8 -1
  282. package/dist/index.js +7 -2
  283. package/dist/kit/index.d.ts +9 -6
  284. package/dist/kit/index.js +45 -43
  285. package/dist/kit/index.js.map +1 -1
  286. package/dist/nitro-server/index.d.ts +7 -4
  287. package/dist/nitro-server/index.js +6 -2
  288. package/dist/nitro-server/index.js.map +1 -1
  289. package/dist/node.d.ts +6 -3
  290. package/dist/node.js +88 -116
  291. package/dist/node.js.map +1 -1
  292. package/dist/reactivity/computed.d.ts +6 -3
  293. package/dist/reactivity/computed.js +46 -53
  294. package/dist/reactivity/computed.js.map +1 -1
  295. package/dist/reactivity/effect.d.ts +8 -5
  296. package/dist/reactivity/effect.js +105 -146
  297. package/dist/reactivity/effect.js.map +1 -1
  298. package/dist/reactivity/index.d.ts +8 -8
  299. package/dist/reactivity/index.js +7 -8
  300. package/dist/reactivity/reactive.d.ts +3 -0
  301. package/dist/reactivity/reactive.js +93 -133
  302. package/dist/reactivity/reactive.js.map +1 -1
  303. package/dist/reactivity/readonly.d.ts +2 -1
  304. package/dist/reactivity/readonly.js +2 -2
  305. package/dist/reactivity/ref.d.ts +15 -15
  306. package/dist/reactivity/ref.js +73 -81
  307. package/dist/reactivity/ref.js.map +1 -1
  308. package/dist/reactivity/scheduler.d.ts +3 -1
  309. package/dist/reactivity/scheduler.js +67 -69
  310. package/dist/reactivity/scheduler.js.map +1 -1
  311. package/dist/reactivity/types.d.ts +17 -14
  312. package/dist/reactivity/types.js +0 -1
  313. package/dist/reactivity/utils.d.ts +7 -4
  314. package/dist/reactivity/utils.js +25 -24
  315. package/dist/reactivity/utils.js.map +1 -1
  316. package/dist/reactivity/watch.d.ts +4 -2
  317. package/dist/reactivity/watch.js +75 -103
  318. package/dist/reactivity/watch.js.map +1 -1
  319. package/dist/runtime/core.d.ts +31 -0
  320. package/dist/runtime/core.js +156 -0
  321. package/dist/runtime/core.js.map +1 -0
  322. package/dist/runtime/index.d.ts +487 -461
  323. package/dist/runtime/index.js +4129 -5254
  324. package/dist/runtime/index.js.map +1 -1
  325. package/dist/runtime/reactivity.d.ts +7 -0
  326. package/dist/runtime/reactivity.js +6 -0
  327. package/dist/runtime/resume.d.ts +79 -0
  328. package/dist/runtime/resume.js +482 -0
  329. package/dist/runtime/resume.js.map +1 -0
  330. package/dist/runtime/router.d.ts +20 -0
  331. package/dist/runtime/router.js +60 -0
  332. package/dist/runtime/router.js.map +1 -0
  333. package/dist/runtime/streaming.d.ts +24 -0
  334. package/dist/runtime/streaming.js +200 -0
  335. package/dist/runtime/streaming.js.map +1 -0
  336. package/dist/security/media-fetch.d.ts +32 -0
  337. package/dist/security/media-fetch.js +301 -0
  338. package/dist/security/media-fetch.js.map +1 -0
  339. package/dist/security/path-boundary.d.ts +7 -0
  340. package/dist/security/path-boundary.js +70 -0
  341. package/dist/security/path-boundary.js.map +1 -0
  342. package/dist/ui/index.d.ts +1580 -1576
  343. package/dist/ui/index.js +975 -674
  344. package/dist/ui/index.js.map +1 -1
  345. package/dist/vite-builder/index.d.ts +6 -3
  346. package/dist/vite-builder/index.js +6 -2
  347. package/dist/vite-builder/index.js.map +1 -1
  348. package/package.json +46 -86
  349. package/dist/compiler/implementation.js.map +0 -1
  350. package/dist/core/index.js.map +0 -1
  351. package/dist/deploy/types.js.map +0 -1
  352. package/dist/globals.js.map +0 -1
  353. package/dist/halal-core/index.js.map +0 -1
  354. package/dist/halal-core/runtime/index.js.map +0 -1
  355. package/dist/halal-core/runtime/types.js.map +0 -1
  356. package/dist/halal-core/status.js.map +0 -1
  357. package/dist/halal.js.map +0 -1
  358. package/dist/index.js.map +0 -1
  359. package/dist/reactivity/index.js.map +0 -1
  360. package/dist/reactivity/readonly.js.map +0 -1
  361. package/dist/reactivity/types.js.map +0 -1
package/dist/ui/index.js CHANGED
@@ -1,665 +1,980 @@
1
1
  import { defineComponent, h, onMounted, ref } from "vue";
2
- export function defineUiTokens(tokens) {
3
- return tokens;
2
+ //#region src/ui/index.ts
3
+ function defineUiTokens(tokens) {
4
+ return tokens;
4
5
  }
5
- export function isReducedMotion() {
6
- if (typeof window === "undefined" || typeof window.matchMedia !== "function")
7
- return false;
8
- return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
6
+ function isReducedMotion() {
7
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") return false;
8
+ return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
9
9
  }
10
- export function useAnimate(target, options = {}) {
11
- const element = target && "animate" in target && typeof target.animate === "function"
12
- ? target
13
- : target && "value" in target
14
- ? target.value
15
- : null;
16
- if (!element || typeof window === "undefined")
17
- return null;
18
- if (isReducedMotion())
19
- return null;
20
- const type = options.type || "fade-up";
21
- const duration = options.duration ?? 400;
22
- const delay = options.delay ?? 0;
23
- const easing = options.easing || "cubic-bezier(0.16, 1, 0.3, 1)";
24
- let keyframes = [];
25
- switch (type) {
26
- case "fade-up":
27
- keyframes = [
28
- { opacity: 0, transform: "translate3d(0, 30px, 0)" },
29
- { opacity: 1, transform: "translate3d(0, 0, 0)" }
30
- ];
31
- break;
32
- case "fade-down":
33
- keyframes = [
34
- { opacity: 0, transform: "translate3d(0, -30px, 0)" },
35
- { opacity: 1, transform: "translate3d(0, 0, 0)" }
36
- ];
37
- break;
38
- case "scale-in":
39
- keyframes = [
40
- { opacity: 0, transform: "scale3d(0.92, 0.92, 1)" },
41
- { opacity: 1, transform: "scale3d(1, 1, 1)" }
42
- ];
43
- break;
44
- case "slide-in-left":
45
- keyframes = [
46
- { opacity: 0, transform: "translate3d(-40px, 0, 0)" },
47
- { opacity: 1, transform: "translate3d(0, 0, 0)" }
48
- ];
49
- break;
50
- case "slide-in-right":
51
- keyframes = [
52
- { opacity: 0, transform: "translate3d(40px, 0, 0)" },
53
- { opacity: 1, transform: "translate3d(0, 0, 0)" }
54
- ];
55
- break;
56
- case "pulse-glow":
57
- keyframes = [
58
- { transform: "scale(1)", boxShadow: "0 0 0 0 rgba(3, 200, 191, 0.4)" },
59
- { transform: "scale(1.03)", boxShadow: "0 0 20px 10px rgba(3, 200, 191, 0)" },
60
- { transform: "scale(1)", boxShadow: "0 0 0 0 rgba(3, 200, 191, 0)" }
61
- ];
62
- break;
63
- case "bounce-in":
64
- keyframes = [
65
- { opacity: 0, transform: "scale3d(0.3, 0.3, 0.3)" },
66
- { opacity: 0.9, transform: "scale3d(1.05, 1.05, 1.05)" },
67
- { opacity: 1, transform: "scale3d(1, 1, 1)" }
68
- ];
69
- break;
70
- default:
71
- keyframes = [
72
- { opacity: 0, transform: "translate3d(0, 20px, 0)" },
73
- { opacity: 1, transform: "translate3d(0, 0, 0)" }
74
- ];
75
- }
76
- if ("animate" in element && typeof element.animate === "function") {
77
- return element.animate(keyframes, {
78
- duration,
79
- delay,
80
- easing,
81
- fill: options.fill || "forwards"
82
- });
83
- }
84
- return null;
10
+ function useAnimate(target, options = {}) {
11
+ const element = target && "animate" in target && typeof target.animate === "function" ? target : target && "value" in target ? target.value : null;
12
+ if (!element || typeof window === "undefined") return null;
13
+ if (isReducedMotion()) return null;
14
+ const type = options.type || "fade-up";
15
+ const duration = options.duration ?? 400;
16
+ const delay = options.delay ?? 0;
17
+ const easing = options.easing || "cubic-bezier(0.16, 1, 0.3, 1)";
18
+ let keyframes = [];
19
+ switch (type) {
20
+ case "fade-up":
21
+ keyframes = [{
22
+ opacity: 0,
23
+ transform: "translate3d(0, 30px, 0)"
24
+ }, {
25
+ opacity: 1,
26
+ transform: "translate3d(0, 0, 0)"
27
+ }];
28
+ break;
29
+ case "fade-down":
30
+ keyframes = [{
31
+ opacity: 0,
32
+ transform: "translate3d(0, -30px, 0)"
33
+ }, {
34
+ opacity: 1,
35
+ transform: "translate3d(0, 0, 0)"
36
+ }];
37
+ break;
38
+ case "scale-in":
39
+ keyframes = [{
40
+ opacity: 0,
41
+ transform: "scale3d(0.92, 0.92, 1)"
42
+ }, {
43
+ opacity: 1,
44
+ transform: "scale3d(1, 1, 1)"
45
+ }];
46
+ break;
47
+ case "slide-in-left":
48
+ keyframes = [{
49
+ opacity: 0,
50
+ transform: "translate3d(-40px, 0, 0)"
51
+ }, {
52
+ opacity: 1,
53
+ transform: "translate3d(0, 0, 0)"
54
+ }];
55
+ break;
56
+ case "slide-in-right":
57
+ keyframes = [{
58
+ opacity: 0,
59
+ transform: "translate3d(40px, 0, 0)"
60
+ }, {
61
+ opacity: 1,
62
+ transform: "translate3d(0, 0, 0)"
63
+ }];
64
+ break;
65
+ case "pulse-glow":
66
+ keyframes = [
67
+ {
68
+ transform: "scale(1)",
69
+ boxShadow: "0 0 0 0 rgba(3, 200, 191, 0.4)"
70
+ },
71
+ {
72
+ transform: "scale(1.03)",
73
+ boxShadow: "0 0 20px 10px rgba(3, 200, 191, 0)"
74
+ },
75
+ {
76
+ transform: "scale(1)",
77
+ boxShadow: "0 0 0 0 rgba(3, 200, 191, 0)"
78
+ }
79
+ ];
80
+ break;
81
+ case "bounce-in":
82
+ keyframes = [
83
+ {
84
+ opacity: 0,
85
+ transform: "scale3d(0.3, 0.3, 0.3)"
86
+ },
87
+ {
88
+ opacity: .9,
89
+ transform: "scale3d(1.05, 1.05, 1.05)"
90
+ },
91
+ {
92
+ opacity: 1,
93
+ transform: "scale3d(1, 1, 1)"
94
+ }
95
+ ];
96
+ break;
97
+ default: keyframes = [{
98
+ opacity: 0,
99
+ transform: "translate3d(0, 20px, 0)"
100
+ }, {
101
+ opacity: 1,
102
+ transform: "translate3d(0, 0, 0)"
103
+ }];
104
+ }
105
+ if ("animate" in element && typeof element.animate === "function") return element.animate(keyframes, {
106
+ duration,
107
+ delay,
108
+ easing,
109
+ fill: options.fill || "forwards"
110
+ });
111
+ return null;
85
112
  }
86
- const animeDirectiveState = new WeakMap();
87
- export const vAnime = {
88
- mounted(el, binding) {
89
- if (typeof window === "undefined" || isReducedMotion())
90
- return;
91
- const config = typeof binding.value === "string"
92
- ? { type: binding.value }
93
- : binding.value || { type: "fade-up" };
94
- const state = {};
95
- animeDirectiveState.set(el, state);
96
- const triggerAnimation = () => {
97
- const animation = useAnimate(el, { ...config, fill: config.fill ?? "both" });
98
- if (animation) {
99
- state.animation = animation;
100
- }
101
- };
102
- if ("IntersectionObserver" in window) {
103
- const observer = new IntersectionObserver((entries) => {
104
- if (entries.some((entry) => entry.isIntersecting)) {
105
- triggerAnimation();
106
- observer.unobserve(el);
107
- state.observer = undefined;
108
- }
109
- }, { rootMargin: "50px" });
110
- state.observer = observer;
111
- observer.observe(el);
112
- }
113
- else {
114
- triggerAnimation();
115
- }
116
- },
117
- unmounted(el) {
118
- const state = animeDirectiveState.get(el);
119
- state?.observer?.disconnect();
120
- state?.animation?.cancel();
121
- animeDirectiveState.delete(el);
122
- }
113
+ const animeDirectiveState = /* @__PURE__ */ new WeakMap();
114
+ const vAnime = {
115
+ mounted(el, binding) {
116
+ if (typeof window === "undefined" || isReducedMotion()) return;
117
+ const config = typeof binding.value === "string" ? { type: binding.value } : binding.value || { type: "fade-up" };
118
+ const state = {};
119
+ animeDirectiveState.set(el, state);
120
+ const triggerAnimation = () => {
121
+ const animation = useAnimate(el, {
122
+ ...config,
123
+ fill: config.fill ?? "both"
124
+ });
125
+ if (animation) state.animation = animation;
126
+ };
127
+ if ("IntersectionObserver" in window) {
128
+ const observer = new IntersectionObserver((entries) => {
129
+ if (entries.some((entry) => entry.isIntersecting)) {
130
+ triggerAnimation();
131
+ observer.unobserve(el);
132
+ state.observer = void 0;
133
+ }
134
+ }, { rootMargin: "50px" });
135
+ state.observer = observer;
136
+ observer.observe(el);
137
+ } else triggerAnimation();
138
+ },
139
+ unmounted(el) {
140
+ const state = animeDirectiveState.get(el);
141
+ state?.observer?.disconnect();
142
+ state?.animation?.cancel();
143
+ animeDirectiveState.delete(el);
144
+ }
123
145
  };
124
- export const vAnimate = vAnime;
125
- // --- UI & Motion Primitive Components ---
126
- export const RxMotion = defineComponent({
127
- name: "RxMotion",
128
- props: {
129
- tag: { type: String, default: "div" },
130
- preset: { type: String, default: "fade-up" },
131
- duration: { type: Number, default: 400 },
132
- delay: { type: Number, default: 0 },
133
- easing: { type: String, default: "cubic-bezier(0.16, 1, 0.3, 1)" },
134
- unstyled: { type: Boolean, default: false }
135
- },
136
- setup(props, { slots, attrs }) {
137
- const elRef = ref(null);
138
- onMounted(() => {
139
- if (elRef.value && !props.unstyled && !isReducedMotion()) {
140
- useAnimate(elRef.value, {
141
- type: props.preset,
142
- duration: props.duration,
143
- delay: props.delay,
144
- easing: props.easing
145
- });
146
- }
147
- });
148
- return () => h(props.tag, { ref: elRef, ...attrs }, slots.default ? slots.default() : []);
149
- }
146
+ const vAnimate = vAnime;
147
+ const RxMotion = defineComponent({
148
+ name: "RxMotion",
149
+ props: {
150
+ tag: {
151
+ type: String,
152
+ default: "div"
153
+ },
154
+ preset: {
155
+ type: String,
156
+ default: "fade-up"
157
+ },
158
+ duration: {
159
+ type: Number,
160
+ default: 400
161
+ },
162
+ delay: {
163
+ type: Number,
164
+ default: 0
165
+ },
166
+ easing: {
167
+ type: String,
168
+ default: "cubic-bezier(0.16, 1, 0.3, 1)"
169
+ },
170
+ unstyled: {
171
+ type: Boolean,
172
+ default: false
173
+ }
174
+ },
175
+ setup(props, { slots, attrs }) {
176
+ const elRef = ref(null);
177
+ onMounted(() => {
178
+ if (elRef.value && !props.unstyled && !isReducedMotion()) useAnimate(elRef.value, {
179
+ type: props.preset,
180
+ duration: props.duration,
181
+ delay: props.delay,
182
+ easing: props.easing
183
+ });
184
+ });
185
+ return () => h(props.tag, {
186
+ ref: elRef,
187
+ ...attrs
188
+ }, slots.default ? slots.default() : []);
189
+ }
150
190
  });
151
- export const RxReveal = defineComponent({
152
- name: "RxReveal",
153
- props: {
154
- preset: { type: String, default: "fade-up" },
155
- duration: { type: Number, default: 400 },
156
- unstyled: { type: Boolean, default: false }
157
- },
158
- setup(props, { slots, attrs }) {
159
- const elRef = ref(null);
160
- onMounted(() => {
161
- if (elRef.value && !props.unstyled && !isReducedMotion()) {
162
- useAnimate(elRef.value, { type: props.preset, duration: props.duration });
163
- }
164
- });
165
- return () => h("div", { ref: elRef, ...attrs }, slots.default ? slots.default() : []);
166
- }
191
+ const RxReveal = defineComponent({
192
+ name: "RxReveal",
193
+ props: {
194
+ preset: {
195
+ type: String,
196
+ default: "fade-up"
197
+ },
198
+ duration: {
199
+ type: Number,
200
+ default: 400
201
+ },
202
+ unstyled: {
203
+ type: Boolean,
204
+ default: false
205
+ }
206
+ },
207
+ setup(props, { slots, attrs }) {
208
+ const elRef = ref(null);
209
+ onMounted(() => {
210
+ if (elRef.value && !props.unstyled && !isReducedMotion()) useAnimate(elRef.value, {
211
+ type: props.preset,
212
+ duration: props.duration
213
+ });
214
+ });
215
+ return () => h("div", {
216
+ ref: elRef,
217
+ ...attrs
218
+ }, slots.default ? slots.default() : []);
219
+ }
167
220
  });
168
- export const RxAutoAnimate = defineComponent({
169
- name: "RxAutoAnimate",
170
- props: {
171
- duration: { type: Number, default: 300 },
172
- unstyled: { type: Boolean, default: false }
173
- },
174
- setup(props, { slots, attrs }) {
175
- const elRef = ref(null);
176
- onMounted(() => {
177
- if (elRef.value && !props.unstyled && !isReducedMotion()) {
178
- useAnimate(elRef.value, { type: "scale-in", duration: props.duration });
179
- }
180
- });
181
- return () => h("div", { ref: elRef, ...attrs }, slots.default ? slots.default() : []);
182
- }
221
+ const RxAutoAnimate = defineComponent({
222
+ name: "RxAutoAnimate",
223
+ props: {
224
+ duration: {
225
+ type: Number,
226
+ default: 300
227
+ },
228
+ unstyled: {
229
+ type: Boolean,
230
+ default: false
231
+ }
232
+ },
233
+ setup(props, { slots, attrs }) {
234
+ const elRef = ref(null);
235
+ onMounted(() => {
236
+ if (elRef.value && !props.unstyled && !isReducedMotion()) useAnimate(elRef.value, {
237
+ type: "scale-in",
238
+ duration: props.duration
239
+ });
240
+ });
241
+ return () => h("div", {
242
+ ref: elRef,
243
+ ...attrs
244
+ }, slots.default ? slots.default() : []);
245
+ }
183
246
  });
184
- export const RxButton = defineComponent({
185
- name: "RxButton",
186
- props: {
187
- variant: { type: String, default: "primary" },
188
- size: { type: String, default: "md" },
189
- type: { type: String, default: "button" },
190
- disabled: { type: Boolean, default: false },
191
- unstyled: { type: Boolean, default: false }
192
- },
193
- setup(props, { slots, attrs }) {
194
- return () => {
195
- const classes = props.unstyled
196
- ? (attrs.class || "")
197
- : ["rx-btn", `rx-btn-${props.variant}`, `rx-btn-${props.size}`, attrs.class].filter(Boolean).join(" ");
198
- return h("button", { ...attrs, type: props.type, disabled: props.disabled, class: classes }, slots.default ? slots.default() : []);
199
- };
200
- }
247
+ const RxButton = defineComponent({
248
+ name: "RxButton",
249
+ props: {
250
+ variant: {
251
+ type: String,
252
+ default: "primary"
253
+ },
254
+ size: {
255
+ type: String,
256
+ default: "md"
257
+ },
258
+ type: {
259
+ type: String,
260
+ default: "button"
261
+ },
262
+ disabled: {
263
+ type: Boolean,
264
+ default: false
265
+ },
266
+ unstyled: {
267
+ type: Boolean,
268
+ default: false
269
+ }
270
+ },
271
+ setup(props, { slots, attrs }) {
272
+ return () => {
273
+ const classes = props.unstyled ? attrs.class || "" : [
274
+ "rx-btn",
275
+ `rx-btn-${props.variant}`,
276
+ `rx-btn-${props.size}`,
277
+ attrs.class
278
+ ].filter(Boolean).join(" ");
279
+ return h("button", {
280
+ ...attrs,
281
+ type: props.type,
282
+ disabled: props.disabled,
283
+ class: classes
284
+ }, slots.default ? slots.default() : []);
285
+ };
286
+ }
201
287
  });
202
- export const RxCard = defineComponent({
203
- name: "RxCard",
204
- props: {
205
- variant: { type: String, default: "default" },
206
- unstyled: { type: Boolean, default: false }
207
- },
208
- setup(props, { slots, attrs }) {
209
- return () => {
210
- const classes = props.unstyled
211
- ? (attrs.class || "")
212
- : ["rx-card", props.variant !== "default" ? `rx-card-${props.variant}` : "", attrs.class].filter(Boolean).join(" ");
213
- return h("div", { ...attrs, class: classes }, slots.default ? slots.default() : []);
214
- };
215
- }
288
+ const RxCard = defineComponent({
289
+ name: "RxCard",
290
+ props: {
291
+ variant: {
292
+ type: String,
293
+ default: "default"
294
+ },
295
+ unstyled: {
296
+ type: Boolean,
297
+ default: false
298
+ }
299
+ },
300
+ setup(props, { slots, attrs }) {
301
+ return () => {
302
+ const classes = props.unstyled ? attrs.class || "" : [
303
+ "rx-card",
304
+ props.variant !== "default" ? `rx-card-${props.variant}` : "",
305
+ attrs.class
306
+ ].filter(Boolean).join(" ");
307
+ return h("div", {
308
+ ...attrs,
309
+ class: classes
310
+ }, slots.default ? slots.default() : []);
311
+ };
312
+ }
216
313
  });
217
- export const RxBadge = defineComponent({
218
- name: "RxBadge",
219
- props: {
220
- variant: { type: String, default: "default" },
221
- unstyled: { type: Boolean, default: false }
222
- },
223
- setup(props, { slots, attrs }) {
224
- return () => {
225
- const classes = props.unstyled
226
- ? (attrs.class || "")
227
- : ["rx-badge", `rx-badge-${props.variant}`, attrs.class].filter(Boolean).join(" ");
228
- return h("span", { ...attrs, class: classes }, slots.default ? slots.default() : []);
229
- };
230
- }
314
+ const RxBadge = defineComponent({
315
+ name: "RxBadge",
316
+ props: {
317
+ variant: {
318
+ type: String,
319
+ default: "default"
320
+ },
321
+ unstyled: {
322
+ type: Boolean,
323
+ default: false
324
+ }
325
+ },
326
+ setup(props, { slots, attrs }) {
327
+ return () => {
328
+ const classes = props.unstyled ? attrs.class || "" : [
329
+ "rx-badge",
330
+ `rx-badge-${props.variant}`,
331
+ attrs.class
332
+ ].filter(Boolean).join(" ");
333
+ return h("span", {
334
+ ...attrs,
335
+ class: classes
336
+ }, slots.default ? slots.default() : []);
337
+ };
338
+ }
231
339
  });
232
- export const RxInput = defineComponent({
233
- name: "RxInput",
234
- props: {
235
- modelValue: { type: [String, Number], default: "" },
236
- type: { type: String, default: "text" },
237
- placeholder: { type: String, default: "" },
238
- disabled: { type: Boolean, default: false },
239
- unstyled: { type: Boolean, default: false }
240
- },
241
- emits: ["update:modelValue"],
242
- setup(props, { emit, attrs }) {
243
- return () => {
244
- const classes = props.unstyled
245
- ? (attrs.class || "")
246
- : ["rx-input", attrs.class].filter(Boolean).join(" ");
247
- return h("input", {
248
- ...attrs,
249
- type: props.type,
250
- value: props.modelValue,
251
- placeholder: props.placeholder,
252
- disabled: props.disabled,
253
- class: classes,
254
- onInput: (e) => emit("update:modelValue", e.target.value)
255
- });
256
- };
257
- }
340
+ const RxInput = defineComponent({
341
+ name: "RxInput",
342
+ props: {
343
+ modelValue: {
344
+ type: [String, Number],
345
+ default: ""
346
+ },
347
+ type: {
348
+ type: String,
349
+ default: "text"
350
+ },
351
+ placeholder: {
352
+ type: String,
353
+ default: ""
354
+ },
355
+ disabled: {
356
+ type: Boolean,
357
+ default: false
358
+ },
359
+ unstyled: {
360
+ type: Boolean,
361
+ default: false
362
+ }
363
+ },
364
+ emits: ["update:modelValue"],
365
+ setup(props, { emit, attrs }) {
366
+ return () => {
367
+ const classes = props.unstyled ? attrs.class || "" : ["rx-input", attrs.class].filter(Boolean).join(" ");
368
+ return h("input", {
369
+ ...attrs,
370
+ type: props.type,
371
+ value: props.modelValue,
372
+ placeholder: props.placeholder,
373
+ disabled: props.disabled,
374
+ class: classes,
375
+ onInput: (e) => emit("update:modelValue", e.target.value)
376
+ });
377
+ };
378
+ }
258
379
  });
259
- export const RxSelect = defineComponent({
260
- name: "RxSelect",
261
- props: {
262
- modelValue: { type: [String, Number], default: "" },
263
- options: { type: Array, default: () => [] },
264
- placeholder: { type: String, default: "Select an option" },
265
- disabled: { type: Boolean, default: false },
266
- unstyled: { type: Boolean, default: false }
267
- },
268
- emits: ["update:modelValue"],
269
- setup(props, { emit, attrs }) {
270
- const isOpen = ref(false);
271
- const toggle = () => {
272
- if (!props.disabled)
273
- isOpen.value = !isOpen.value;
274
- };
275
- const selectOption = (val) => {
276
- emit("update:modelValue", val);
277
- isOpen.value = false;
278
- };
279
- const handleKeyDown = (e) => {
280
- if (e.key === "Enter" || e.key === " ") {
281
- e.preventDefault();
282
- toggle();
283
- }
284
- else if (e.key === "Escape") {
285
- isOpen.value = false;
286
- }
287
- };
288
- return () => {
289
- const classes = props.unstyled ? (attrs.class || "") : ["rx-select", attrs.class].filter(Boolean).join(" ");
290
- const normalizedOpts = props.options.map((opt) => typeof opt === "string" ? { label: opt, value: opt } : opt);
291
- const selectedObj = normalizedOpts.find((o) => o.value === props.modelValue);
292
- return h("div", { class: classes, tabindex: props.disabled ? -1 : 0, onKeydown: handleKeyDown }, [
293
- h("div", { class: props.unstyled ? "" : "rx-select-trigger", onClick: toggle }, [
294
- h("span", selectedObj ? selectedObj.label : props.placeholder),
295
- h("span", { class: props.unstyled ? "" : "rx-select-arrow" }, "▾")
296
- ]),
297
- isOpen.value
298
- ? h("ul", { class: props.unstyled ? "" : "rx-select-dropdown", role: "listbox" }, normalizedOpts.map((opt) => h("li", {
299
- class: [props.unstyled ? "" : "rx-select-option", opt.value === props.modelValue ? "selected" : ""]
300
- .filter(Boolean)
301
- .join(" "),
302
- role: "option",
303
- onClick: () => selectOption(opt.value)
304
- }, opt.label)))
305
- : null
306
- ]);
307
- };
308
- }
380
+ const RxSelect = defineComponent({
381
+ name: "RxSelect",
382
+ props: {
383
+ modelValue: {
384
+ type: [String, Number],
385
+ default: ""
386
+ },
387
+ options: {
388
+ type: Array,
389
+ default: () => []
390
+ },
391
+ placeholder: {
392
+ type: String,
393
+ default: "Select an option"
394
+ },
395
+ disabled: {
396
+ type: Boolean,
397
+ default: false
398
+ },
399
+ unstyled: {
400
+ type: Boolean,
401
+ default: false
402
+ }
403
+ },
404
+ emits: ["update:modelValue"],
405
+ setup(props, { emit, attrs }) {
406
+ const isOpen = ref(false);
407
+ const toggle = () => {
408
+ if (!props.disabled) isOpen.value = !isOpen.value;
409
+ };
410
+ const selectOption = (val) => {
411
+ emit("update:modelValue", val);
412
+ isOpen.value = false;
413
+ };
414
+ const handleKeyDown = (e) => {
415
+ if (e.key === "Enter" || e.key === " ") {
416
+ e.preventDefault();
417
+ toggle();
418
+ } else if (e.key === "Escape") isOpen.value = false;
419
+ };
420
+ return () => {
421
+ const classes = props.unstyled ? attrs.class || "" : ["rx-select", attrs.class].filter(Boolean).join(" ");
422
+ const normalizedOpts = props.options.map((opt) => typeof opt === "string" ? {
423
+ label: opt,
424
+ value: opt
425
+ } : opt);
426
+ const selectedObj = normalizedOpts.find((o) => o.value === props.modelValue);
427
+ return h("div", {
428
+ class: classes,
429
+ tabindex: props.disabled ? -1 : 0,
430
+ onKeydown: handleKeyDown
431
+ }, [h("div", {
432
+ class: props.unstyled ? "" : "rx-select-trigger",
433
+ onClick: toggle
434
+ }, [h("span", selectedObj ? selectedObj.label : props.placeholder), h("span", { class: props.unstyled ? "" : "rx-select-arrow" }, "▾")]), isOpen.value ? h("ul", {
435
+ class: props.unstyled ? "" : "rx-select-dropdown",
436
+ role: "listbox"
437
+ }, normalizedOpts.map((opt) => h("li", {
438
+ class: [props.unstyled ? "" : "rx-select-option", opt.value === props.modelValue ? "selected" : ""].filter(Boolean).join(" "),
439
+ role: "option",
440
+ onClick: () => selectOption(opt.value)
441
+ }, opt.label))) : null]);
442
+ };
443
+ }
309
444
  });
310
445
  function formatDatePickerValue(value) {
311
- if (value instanceof Date) {
312
- return Number.isFinite(value.getTime()) ? value.toISOString().split("T")[0] : "";
313
- }
314
- return String(value || "");
446
+ if (value instanceof Date) return Number.isFinite(value.getTime()) ? value.toISOString().split("T")[0] : "";
447
+ return String(value || "");
315
448
  }
316
- export const RxDatePicker = defineComponent({
317
- name: "RxDatePicker",
318
- props: {
319
- modelValue: { type: [String, Date], default: "" },
320
- placeholder: { type: String, default: "Select date" },
321
- unstyled: { type: Boolean, default: false }
322
- },
323
- emits: ["update:modelValue"],
324
- setup(props, { emit, attrs }) {
325
- return () => {
326
- const classes = props.unstyled ? (attrs.class || "") : ["rx-input", "rx-datepicker", attrs.class].filter(Boolean).join(" ");
327
- return h("input", {
328
- ...attrs,
329
- type: "date",
330
- value: formatDatePickerValue(props.modelValue),
331
- placeholder: props.placeholder,
332
- class: classes,
333
- onInput: (e) => emit("update:modelValue", e.target.value)
334
- });
335
- };
336
- }
449
+ const RxDatePicker = defineComponent({
450
+ name: "RxDatePicker",
451
+ props: {
452
+ modelValue: {
453
+ type: [String, Date],
454
+ default: ""
455
+ },
456
+ placeholder: {
457
+ type: String,
458
+ default: "Select date"
459
+ },
460
+ unstyled: {
461
+ type: Boolean,
462
+ default: false
463
+ }
464
+ },
465
+ emits: ["update:modelValue"],
466
+ setup(props, { emit, attrs }) {
467
+ return () => {
468
+ const classes = props.unstyled ? attrs.class || "" : [
469
+ "rx-input",
470
+ "rx-datepicker",
471
+ attrs.class
472
+ ].filter(Boolean).join(" ");
473
+ return h("input", {
474
+ ...attrs,
475
+ type: "date",
476
+ value: formatDatePickerValue(props.modelValue),
477
+ placeholder: props.placeholder,
478
+ class: classes,
479
+ onInput: (e) => emit("update:modelValue", e.target.value)
480
+ });
481
+ };
482
+ }
337
483
  });
338
- export const RxPopover = defineComponent({
339
- name: "RxPopover",
340
- props: {
341
- open: { type: Boolean, default: false },
342
- unstyled: { type: Boolean, default: false }
343
- },
344
- emits: ["update:open"],
345
- setup(props, { slots, emit, attrs }) {
346
- const toggle = () => emit("update:open", !props.open);
347
- return () => {
348
- const classes = props.unstyled ? (attrs.class || "") : ["rx-popover", attrs.class].filter(Boolean).join(" ");
349
- return h("div", { class: classes }, [
350
- h("div", { onClick: toggle }, slots.trigger ? slots.trigger() : [h("button", "Toggle")]),
351
- props.open ? h("div", { class: props.unstyled ? "" : "rx-popover-content", ...attrs }, slots.default ? slots.default() : []) : null
352
- ]);
353
- };
354
- }
484
+ const RxPopover = defineComponent({
485
+ name: "RxPopover",
486
+ props: {
487
+ open: {
488
+ type: Boolean,
489
+ default: false
490
+ },
491
+ unstyled: {
492
+ type: Boolean,
493
+ default: false
494
+ }
495
+ },
496
+ emits: ["update:open"],
497
+ setup(props, { slots, emit, attrs }) {
498
+ const toggle = () => emit("update:open", !props.open);
499
+ return () => {
500
+ const classes = props.unstyled ? attrs.class || "" : ["rx-popover", attrs.class].filter(Boolean).join(" ");
501
+ return h("div", { class: classes }, [h("div", { onClick: toggle }, slots.trigger ? slots.trigger() : [h("button", "Toggle")]), props.open ? h("div", {
502
+ class: props.unstyled ? "" : "rx-popover-content",
503
+ ...attrs
504
+ }, slots.default ? slots.default() : []) : null]);
505
+ };
506
+ }
355
507
  });
356
- export const RxIcon = defineComponent({
357
- name: "RxIcon",
358
- props: {
359
- name: { type: String, default: "check" },
360
- size: { type: [String, Number], default: "1.25rem" },
361
- color: { type: String, default: "currentColor" },
362
- unstyled: { type: Boolean, default: false }
363
- },
364
- setup(props, { attrs }) {
365
- return () => {
366
- const classes = props.unstyled ? (attrs.class || "") : ["rx-icon", attrs.class].filter(Boolean).join(" ");
367
- return h("span", {
368
- ...attrs,
369
- class: classes,
370
- style: { fontSize: typeof props.size === "number" ? `${props.size}px` : props.size, color: props.color }
371
- }, `[${props.name}]`);
372
- };
373
- }
508
+ const RxIcon = defineComponent({
509
+ name: "RxIcon",
510
+ props: {
511
+ name: {
512
+ type: String,
513
+ default: "check"
514
+ },
515
+ size: {
516
+ type: [String, Number],
517
+ default: "1.25rem"
518
+ },
519
+ color: {
520
+ type: String,
521
+ default: "currentColor"
522
+ },
523
+ unstyled: {
524
+ type: Boolean,
525
+ default: false
526
+ }
527
+ },
528
+ setup(props, { attrs }) {
529
+ return () => {
530
+ const classes = props.unstyled ? attrs.class || "" : ["rx-icon", attrs.class].filter(Boolean).join(" ");
531
+ return h("span", {
532
+ ...attrs,
533
+ class: classes,
534
+ style: {
535
+ fontSize: typeof props.size === "number" ? `${props.size}px` : props.size,
536
+ color: props.color
537
+ }
538
+ }, `[${props.name}]`);
539
+ };
540
+ }
374
541
  });
375
- export const RxAvatar = defineComponent({
376
- name: "RxAvatar",
377
- props: {
378
- src: { type: String, default: "" },
379
- alt: { type: String, default: "Avatar" },
380
- size: { type: String, default: "md" },
381
- status: { type: String, default: "" },
382
- unstyled: { type: Boolean, default: false }
383
- },
384
- setup(props, { attrs }) {
385
- return () => {
386
- const classes = props.unstyled ? (attrs.class || "") : ["rx-avatar", `rx-avatar-${props.size}`, attrs.class].filter(Boolean).join(" ");
387
- const initials = props.alt ? props.alt.slice(0, 2).toUpperCase() : "RX";
388
- return h("div", { ...attrs, class: classes }, [
389
- props.src
390
- ? h("img", { src: props.src, alt: props.alt, class: props.unstyled ? "" : "rx-avatar-img" })
391
- : h("span", { class: props.unstyled ? "" : "rx-avatar-fallback" }, initials),
392
- props.status ? h("span", { class: props.unstyled ? "" : `rx-avatar-status rx-status-${props.status}` }) : null
393
- ]);
394
- };
395
- }
542
+ const RxAvatar = defineComponent({
543
+ name: "RxAvatar",
544
+ props: {
545
+ src: {
546
+ type: String,
547
+ default: ""
548
+ },
549
+ alt: {
550
+ type: String,
551
+ default: "Avatar"
552
+ },
553
+ size: {
554
+ type: String,
555
+ default: "md"
556
+ },
557
+ status: {
558
+ type: String,
559
+ default: ""
560
+ },
561
+ unstyled: {
562
+ type: Boolean,
563
+ default: false
564
+ }
565
+ },
566
+ setup(props, { attrs }) {
567
+ return () => {
568
+ const classes = props.unstyled ? attrs.class || "" : [
569
+ "rx-avatar",
570
+ `rx-avatar-${props.size}`,
571
+ attrs.class
572
+ ].filter(Boolean).join(" ");
573
+ const initials = props.alt ? props.alt.slice(0, 2).toUpperCase() : "RX";
574
+ return h("div", {
575
+ ...attrs,
576
+ class: classes
577
+ }, [props.src ? h("img", {
578
+ src: props.src,
579
+ alt: props.alt,
580
+ class: props.unstyled ? "" : "rx-avatar-img"
581
+ }) : h("span", { class: props.unstyled ? "" : "rx-avatar-fallback" }, initials), props.status ? h("span", { class: props.unstyled ? "" : `rx-avatar-status rx-status-${props.status}` }) : null]);
582
+ };
583
+ }
396
584
  });
397
- export const RxAlert = defineComponent({
398
- name: "RxAlert",
399
- props: {
400
- variant: { type: String, default: "info" },
401
- title: { type: String, default: "" },
402
- dismissible: { type: Boolean, default: false },
403
- unstyled: { type: Boolean, default: false }
404
- },
405
- emits: ["dismiss"],
406
- setup(props, { slots, emit, attrs }) {
407
- return () => {
408
- const classes = props.unstyled ? (attrs.class || "") : ["rx-alert", `rx-alert-${props.variant}`, attrs.class].filter(Boolean).join(" ");
409
- return h("div", { ...attrs, class: classes, role: "alert" }, [
410
- props.title ? h("div", { class: props.unstyled ? "" : "rx-alert-title" }, props.title) : null,
411
- h("div", { class: props.unstyled ? "" : "rx-alert-content" }, slots.default ? slots.default() : []),
412
- props.dismissible ? h("button", { class: props.unstyled ? "" : "rx-alert-close", onClick: () => emit("dismiss") }, "×") : null
413
- ]);
414
- };
415
- }
585
+ const RxAlert = defineComponent({
586
+ name: "RxAlert",
587
+ props: {
588
+ variant: {
589
+ type: String,
590
+ default: "info"
591
+ },
592
+ title: {
593
+ type: String,
594
+ default: ""
595
+ },
596
+ dismissible: {
597
+ type: Boolean,
598
+ default: false
599
+ },
600
+ unstyled: {
601
+ type: Boolean,
602
+ default: false
603
+ }
604
+ },
605
+ emits: ["dismiss"],
606
+ setup(props, { slots, emit, attrs }) {
607
+ return () => {
608
+ const classes = props.unstyled ? attrs.class || "" : [
609
+ "rx-alert",
610
+ `rx-alert-${props.variant}`,
611
+ attrs.class
612
+ ].filter(Boolean).join(" ");
613
+ return h("div", {
614
+ ...attrs,
615
+ class: classes,
616
+ role: "alert"
617
+ }, [
618
+ props.title ? h("div", { class: props.unstyled ? "" : "rx-alert-title" }, props.title) : null,
619
+ h("div", { class: props.unstyled ? "" : "rx-alert-content" }, slots.default ? slots.default() : []),
620
+ props.dismissible ? h("button", {
621
+ class: props.unstyled ? "" : "rx-alert-close",
622
+ onClick: () => emit("dismiss")
623
+ }, "×") : null
624
+ ]);
625
+ };
626
+ }
416
627
  });
417
- export const RxAccordion = defineComponent({
418
- name: "RxAccordion",
419
- props: {
420
- title: { type: String, default: "Accordion Title" },
421
- open: { type: Boolean, default: false },
422
- unstyled: { type: Boolean, default: false }
423
- },
424
- setup(props, { slots, attrs }) {
425
- const isOpen = ref(props.open);
426
- const toggle = () => (isOpen.value = !isOpen.value);
427
- return () => {
428
- const classes = props.unstyled ? (attrs.class || "") : ["rx-accordion", attrs.class].filter(Boolean).join(" ");
429
- return h("div", { ...attrs, class: classes }, [
430
- h("button", { class: props.unstyled ? "" : "rx-accordion-header", onClick: toggle }, [
431
- h("span", props.title),
432
- h("span", isOpen.value ? "−" : "+")
433
- ]),
434
- isOpen.value ? h("div", { class: props.unstyled ? "" : "rx-accordion-body" }, slots.default ? slots.default() : []) : null
435
- ]);
436
- };
437
- }
628
+ const RxAccordion = defineComponent({
629
+ name: "RxAccordion",
630
+ props: {
631
+ title: {
632
+ type: String,
633
+ default: "Accordion Title"
634
+ },
635
+ open: {
636
+ type: Boolean,
637
+ default: false
638
+ },
639
+ unstyled: {
640
+ type: Boolean,
641
+ default: false
642
+ }
643
+ },
644
+ setup(props, { slots, attrs }) {
645
+ const isOpen = ref(props.open);
646
+ const toggle = () => isOpen.value = !isOpen.value;
647
+ return () => {
648
+ const classes = props.unstyled ? attrs.class || "" : ["rx-accordion", attrs.class].filter(Boolean).join(" ");
649
+ return h("div", {
650
+ ...attrs,
651
+ class: classes
652
+ }, [h("button", {
653
+ class: props.unstyled ? "" : "rx-accordion-header",
654
+ onClick: toggle
655
+ }, [h("span", props.title), h("span", isOpen.value ? "−" : "+")]), isOpen.value ? h("div", { class: props.unstyled ? "" : "rx-accordion-body" }, slots.default ? slots.default() : []) : null]);
656
+ };
657
+ }
438
658
  });
439
- export const RxTooltip = defineComponent({
440
- name: "RxTooltip",
441
- props: {
442
- text: { type: String, default: "" },
443
- placement: { type: String, default: "top" },
444
- unstyled: { type: Boolean, default: false }
445
- },
446
- setup(props, { slots, attrs }) {
447
- const visible = ref(false);
448
- return () => {
449
- const classes = props.unstyled ? (attrs.class || "") : ["rx-tooltip-wrapper", attrs.class].filter(Boolean).join(" ");
450
- return h("div", {
451
- class: classes,
452
- onMouseenter: () => (visible.value = true),
453
- onMouseleave: () => (visible.value = false)
454
- }, [
455
- slots.default ? slots.default() : null,
456
- visible.value && props.text
457
- ? h("div", { class: props.unstyled ? "" : `rx-tooltip rx-tooltip-${props.placement}`, ...attrs }, props.text)
458
- : null
459
- ]);
460
- };
461
- }
659
+ const RxTooltip = defineComponent({
660
+ name: "RxTooltip",
661
+ props: {
662
+ text: {
663
+ type: String,
664
+ default: ""
665
+ },
666
+ placement: {
667
+ type: String,
668
+ default: "top"
669
+ },
670
+ unstyled: {
671
+ type: Boolean,
672
+ default: false
673
+ }
674
+ },
675
+ setup(props, { slots, attrs }) {
676
+ const visible = ref(false);
677
+ return () => {
678
+ const classes = props.unstyled ? attrs.class || "" : ["rx-tooltip-wrapper", attrs.class].filter(Boolean).join(" ");
679
+ return h("div", {
680
+ class: classes,
681
+ onMouseenter: () => visible.value = true,
682
+ onMouseleave: () => visible.value = false
683
+ }, [slots.default ? slots.default() : null, visible.value && props.text ? h("div", {
684
+ class: props.unstyled ? "" : `rx-tooltip rx-tooltip-${props.placement}`,
685
+ ...attrs
686
+ }, props.text) : null]);
687
+ };
688
+ }
462
689
  });
463
- export const RxDropdown = defineComponent({
464
- name: "RxDropdown",
465
- props: {
466
- items: { type: Array, default: () => [] },
467
- open: { type: Boolean, default: false },
468
- unstyled: { type: Boolean, default: false }
469
- },
470
- emits: ["update:open"],
471
- setup(props, { slots, emit, attrs }) {
472
- const toggle = () => emit("update:open", !props.open);
473
- return () => {
474
- const classes = props.unstyled ? (attrs.class || "") : ["rx-dropdown", attrs.class].filter(Boolean).join(" ");
475
- return h("div", { class: classes }, [
476
- h("div", { onClick: toggle }, slots.trigger ? slots.trigger() : [h("button", "Menu")]),
477
- props.open
478
- ? h("ul", { class: props.unstyled ? "" : "rx-dropdown-menu", ...attrs }, props.items.map((item) => h("li", {
479
- class: props.unstyled ? "" : "rx-dropdown-item",
480
- onClick: () => {
481
- if (item.action)
482
- item.action();
483
- emit("update:open", false);
484
- }
485
- }, item.label)))
486
- : null
487
- ]);
488
- };
489
- }
690
+ const RxDropdown = defineComponent({
691
+ name: "RxDropdown",
692
+ props: {
693
+ items: {
694
+ type: Array,
695
+ default: () => []
696
+ },
697
+ open: {
698
+ type: Boolean,
699
+ default: false
700
+ },
701
+ unstyled: {
702
+ type: Boolean,
703
+ default: false
704
+ }
705
+ },
706
+ emits: ["update:open"],
707
+ setup(props, { slots, emit, attrs }) {
708
+ const toggle = () => emit("update:open", !props.open);
709
+ return () => {
710
+ const classes = props.unstyled ? attrs.class || "" : ["rx-dropdown", attrs.class].filter(Boolean).join(" ");
711
+ return h("div", { class: classes }, [h("div", { onClick: toggle }, slots.trigger ? slots.trigger() : [h("button", "Menu")]), props.open ? h("ul", {
712
+ class: props.unstyled ? "" : "rx-dropdown-menu",
713
+ ...attrs
714
+ }, props.items.map((item) => h("li", {
715
+ class: props.unstyled ? "" : "rx-dropdown-item",
716
+ onClick: () => {
717
+ if (item.action) item.action();
718
+ emit("update:open", false);
719
+ }
720
+ }, item.label))) : null]);
721
+ };
722
+ }
490
723
  });
491
- export const RxTabs = defineComponent({
492
- name: "RxTabs",
493
- props: {
494
- items: { type: Array, default: () => [] },
495
- modelValue: { type: String, default: "" },
496
- unstyled: { type: Boolean, default: false }
497
- },
498
- emits: ["update:modelValue"],
499
- setup(props, { emit, attrs }) {
500
- return () => {
501
- const classes = props.unstyled ? (attrs.class || "") : ["rx-tabs", attrs.class].filter(Boolean).join(" ");
502
- return h("div", { ...attrs, class: classes }, [
503
- h("div", { class: props.unstyled ? "" : "rx-tabs-header" }, props.items.map((item) => h("button", {
504
- class: [props.unstyled ? "" : "rx-tab-btn", item.key === props.modelValue ? "active" : ""].filter(Boolean).join(" "),
505
- onClick: () => emit("update:modelValue", item.key)
506
- }, item.label)))
507
- ]);
508
- };
509
- }
724
+ const RxTabs = defineComponent({
725
+ name: "RxTabs",
726
+ props: {
727
+ items: {
728
+ type: Array,
729
+ default: () => []
730
+ },
731
+ modelValue: {
732
+ type: String,
733
+ default: ""
734
+ },
735
+ unstyled: {
736
+ type: Boolean,
737
+ default: false
738
+ }
739
+ },
740
+ emits: ["update:modelValue"],
741
+ setup(props, { emit, attrs }) {
742
+ return () => {
743
+ const classes = props.unstyled ? attrs.class || "" : ["rx-tabs", attrs.class].filter(Boolean).join(" ");
744
+ return h("div", {
745
+ ...attrs,
746
+ class: classes
747
+ }, [h("div", { class: props.unstyled ? "" : "rx-tabs-header" }, props.items.map((item) => h("button", {
748
+ class: [props.unstyled ? "" : "rx-tab-btn", item.key === props.modelValue ? "active" : ""].filter(Boolean).join(" "),
749
+ onClick: () => emit("update:modelValue", item.key)
750
+ }, item.label)))]);
751
+ };
752
+ }
510
753
  });
511
- export const RxTextarea = defineComponent({
512
- name: "RxTextarea",
513
- props: {
514
- modelValue: { type: String, default: "" },
515
- rows: { type: Number, default: 3 },
516
- placeholder: { type: String, default: "" },
517
- disabled: { type: Boolean, default: false },
518
- unstyled: { type: Boolean, default: false }
519
- },
520
- emits: ["update:modelValue"],
521
- setup(props, { emit, attrs }) {
522
- return () => {
523
- const classes = props.unstyled ? (attrs.class || "") : ["rx-input", "rx-textarea", attrs.class].filter(Boolean).join(" ");
524
- return h("textarea", {
525
- ...attrs,
526
- rows: props.rows,
527
- value: props.modelValue,
528
- placeholder: props.placeholder,
529
- disabled: props.disabled,
530
- class: classes,
531
- onInput: (e) => emit("update:modelValue", e.target.value)
532
- });
533
- };
534
- }
754
+ const RxTextarea = defineComponent({
755
+ name: "RxTextarea",
756
+ props: {
757
+ modelValue: {
758
+ type: String,
759
+ default: ""
760
+ },
761
+ rows: {
762
+ type: Number,
763
+ default: 3
764
+ },
765
+ placeholder: {
766
+ type: String,
767
+ default: ""
768
+ },
769
+ disabled: {
770
+ type: Boolean,
771
+ default: false
772
+ },
773
+ unstyled: {
774
+ type: Boolean,
775
+ default: false
776
+ }
777
+ },
778
+ emits: ["update:modelValue"],
779
+ setup(props, { emit, attrs }) {
780
+ return () => {
781
+ const classes = props.unstyled ? attrs.class || "" : [
782
+ "rx-input",
783
+ "rx-textarea",
784
+ attrs.class
785
+ ].filter(Boolean).join(" ");
786
+ return h("textarea", {
787
+ ...attrs,
788
+ rows: props.rows,
789
+ value: props.modelValue,
790
+ placeholder: props.placeholder,
791
+ disabled: props.disabled,
792
+ class: classes,
793
+ onInput: (e) => emit("update:modelValue", e.target.value)
794
+ });
795
+ };
796
+ }
535
797
  });
536
- export const RxSwitch = defineComponent({
537
- name: "RxSwitch",
538
- props: {
539
- modelValue: { type: Boolean, default: false },
540
- disabled: { type: Boolean, default: false },
541
- unstyled: { type: Boolean, default: false }
542
- },
543
- emits: ["update:modelValue"],
544
- setup(props, { emit, attrs }) {
545
- const toggle = () => {
546
- if (!props.disabled)
547
- emit("update:modelValue", !props.modelValue);
548
- };
549
- return () => {
550
- const classes = props.unstyled ? (attrs.class || "") : ["rx-switch", props.modelValue ? "checked" : "", attrs.class].filter(Boolean).join(" ");
551
- return h("button", {
552
- ...attrs,
553
- type: "button",
554
- role: "switch",
555
- "aria-checked": props.modelValue,
556
- disabled: props.disabled,
557
- class: classes,
558
- onClick: toggle
559
- }, [
560
- h("span", { class: props.unstyled ? "" : "rx-switch-thumb" })
561
- ]);
562
- };
563
- }
798
+ const RxSwitch = defineComponent({
799
+ name: "RxSwitch",
800
+ props: {
801
+ modelValue: {
802
+ type: Boolean,
803
+ default: false
804
+ },
805
+ disabled: {
806
+ type: Boolean,
807
+ default: false
808
+ },
809
+ unstyled: {
810
+ type: Boolean,
811
+ default: false
812
+ }
813
+ },
814
+ emits: ["update:modelValue"],
815
+ setup(props, { emit, attrs }) {
816
+ const toggle = () => {
817
+ if (!props.disabled) emit("update:modelValue", !props.modelValue);
818
+ };
819
+ return () => {
820
+ const classes = props.unstyled ? attrs.class || "" : [
821
+ "rx-switch",
822
+ props.modelValue ? "checked" : "",
823
+ attrs.class
824
+ ].filter(Boolean).join(" ");
825
+ return h("button", {
826
+ ...attrs,
827
+ type: "button",
828
+ role: "switch",
829
+ "aria-checked": props.modelValue,
830
+ disabled: props.disabled,
831
+ class: classes,
832
+ onClick: toggle
833
+ }, [h("span", { class: props.unstyled ? "" : "rx-switch-thumb" })]);
834
+ };
835
+ }
564
836
  });
565
- export const RxSkeleton = defineComponent({
566
- name: "RxSkeleton",
567
- props: {
568
- width: { type: String, default: "100%" },
569
- height: { type: String, default: "1rem" },
570
- rounded: { type: String, default: "0.375rem" },
571
- unstyled: { type: Boolean, default: false }
572
- },
573
- setup(props, { attrs }) {
574
- return () => {
575
- const classes = props.unstyled ? (attrs.class || "") : ["rx-skeleton", attrs.class].filter(Boolean).join(" ");
576
- return h("div", {
577
- ...attrs,
578
- class: classes,
579
- style: { width: props.width, height: props.height, borderRadius: props.rounded }
580
- });
581
- };
582
- }
837
+ const RxSkeleton = defineComponent({
838
+ name: "RxSkeleton",
839
+ props: {
840
+ width: {
841
+ type: String,
842
+ default: "100%"
843
+ },
844
+ height: {
845
+ type: String,
846
+ default: "1rem"
847
+ },
848
+ rounded: {
849
+ type: String,
850
+ default: "0.375rem"
851
+ },
852
+ unstyled: {
853
+ type: Boolean,
854
+ default: false
855
+ }
856
+ },
857
+ setup(props, { attrs }) {
858
+ return () => {
859
+ const classes = props.unstyled ? attrs.class || "" : ["rx-skeleton", attrs.class].filter(Boolean).join(" ");
860
+ return h("div", {
861
+ ...attrs,
862
+ class: classes,
863
+ style: {
864
+ width: props.width,
865
+ height: props.height,
866
+ borderRadius: props.rounded
867
+ }
868
+ });
869
+ };
870
+ }
583
871
  });
584
- export const RxDivider = defineComponent({
585
- name: "RxDivider",
586
- props: {
587
- label: { type: String, default: "" },
588
- orientation: { type: String, default: "horizontal" },
589
- unstyled: { type: Boolean, default: false }
590
- },
591
- setup(props, { attrs }) {
592
- return () => {
593
- const classes = props.unstyled ? (attrs.class || "") : ["rx-divider", `rx-divider-${props.orientation}`, attrs.class].filter(Boolean).join(" ");
594
- return h("div", { ...attrs, class: classes }, [
595
- props.label ? h("span", { class: props.unstyled ? "" : "rx-divider-label" }, props.label) : null
596
- ]);
597
- };
598
- }
872
+ const RxDivider = defineComponent({
873
+ name: "RxDivider",
874
+ props: {
875
+ label: {
876
+ type: String,
877
+ default: ""
878
+ },
879
+ orientation: {
880
+ type: String,
881
+ default: "horizontal"
882
+ },
883
+ unstyled: {
884
+ type: Boolean,
885
+ default: false
886
+ }
887
+ },
888
+ setup(props, { attrs }) {
889
+ return () => {
890
+ const classes = props.unstyled ? attrs.class || "" : [
891
+ "rx-divider",
892
+ `rx-divider-${props.orientation}`,
893
+ attrs.class
894
+ ].filter(Boolean).join(" ");
895
+ return h("div", {
896
+ ...attrs,
897
+ class: classes
898
+ }, [props.label ? h("span", { class: props.unstyled ? "" : "rx-divider-label" }, props.label) : null]);
899
+ };
900
+ }
599
901
  });
600
- export const RxKbd = defineComponent({
601
- name: "RxKbd",
602
- props: {
603
- unstyled: { type: Boolean, default: false }
604
- },
605
- setup(props, { slots, attrs }) {
606
- return () => {
607
- const classes = props.unstyled ? (attrs.class || "") : ["rx-kbd", attrs.class].filter(Boolean).join(" ");
608
- return h("kbd", { ...attrs, class: classes }, slots.default ? slots.default() : []);
609
- };
610
- }
902
+ const RxKbd = defineComponent({
903
+ name: "RxKbd",
904
+ props: { unstyled: {
905
+ type: Boolean,
906
+ default: false
907
+ } },
908
+ setup(props, { slots, attrs }) {
909
+ return () => {
910
+ const classes = props.unstyled ? attrs.class || "" : ["rx-kbd", attrs.class].filter(Boolean).join(" ");
911
+ return h("kbd", {
912
+ ...attrs,
913
+ class: classes
914
+ }, slots.default ? slots.default() : []);
915
+ };
916
+ }
611
917
  });
612
- export const RxModal = defineComponent({
613
- name: "RxModal",
614
- props: {
615
- open: { type: Boolean, default: false },
616
- title: { type: String, default: "" },
617
- unstyled: { type: Boolean, default: false }
618
- },
619
- emits: ["update:open", "close"],
620
- setup(props, { slots, emit, attrs }) {
621
- const close = () => {
622
- emit("update:open", false);
623
- emit("close");
624
- };
625
- return () => {
626
- if (!props.open)
627
- return null;
628
- const backdropClasses = props.unstyled ? "" : "rx-modal-backdrop";
629
- const contentClasses = props.unstyled ? "" : "rx-modal-content";
630
- return h("div", { class: backdropClasses, onClick: close }, [
631
- h("div", { class: contentClasses, onClick: (e) => e.stopPropagation(), ...attrs }, [
632
- props.title ? h("h3", { style: { marginTop: 0 } }, props.title) : null,
633
- slots.default ? slots.default() : null
634
- ])
635
- ]);
636
- };
637
- }
918
+ const RxModal = defineComponent({
919
+ name: "RxModal",
920
+ props: {
921
+ open: {
922
+ type: Boolean,
923
+ default: false
924
+ },
925
+ title: {
926
+ type: String,
927
+ default: ""
928
+ },
929
+ unstyled: {
930
+ type: Boolean,
931
+ default: false
932
+ }
933
+ },
934
+ emits: ["update:open", "close"],
935
+ setup(props, { slots, emit, attrs }) {
936
+ const close = () => {
937
+ emit("update:open", false);
938
+ emit("close");
939
+ };
940
+ return () => {
941
+ if (!props.open) return null;
942
+ const backdropClasses = props.unstyled ? "" : "rx-modal-backdrop";
943
+ const contentClasses = props.unstyled ? "" : "rx-modal-content";
944
+ return h("div", {
945
+ class: backdropClasses,
946
+ onClick: close
947
+ }, [h("div", {
948
+ class: contentClasses,
949
+ onClick: (e) => e.stopPropagation(),
950
+ ...attrs
951
+ }, [props.title ? h("h3", { style: { marginTop: 0 } }, props.title) : null, slots.default ? slots.default() : null])]);
952
+ };
953
+ }
638
954
  });
639
- // --- Resux* Aliases ---
640
- export const ResuxMotion = RxMotion;
641
- export const ResuxReveal = RxReveal;
642
- export const ResuxAutoAnimate = RxAutoAnimate;
643
- export const ResuxButton = RxButton;
644
- export const ResuxCard = RxCard;
645
- export const ResuxBadge = RxBadge;
646
- export const ResuxInput = RxInput;
647
- export const ResuxSelect = RxSelect;
648
- export const ResuxDatePicker = RxDatePicker;
649
- export const ResuxPopover = RxPopover;
650
- export const ResuxIcon = RxIcon;
651
- export const ResuxAvatar = RxAvatar;
652
- export const ResuxAlert = RxAlert;
653
- export const ResuxAccordion = RxAccordion;
654
- export const ResuxTooltip = RxTooltip;
655
- export const ResuxDropdown = RxDropdown;
656
- export const ResuxTabs = RxTabs;
657
- export const ResuxTextarea = RxTextarea;
658
- export const ResuxSwitch = RxSwitch;
659
- export const ResuxSkeleton = RxSkeleton;
660
- export const ResuxDivider = RxDivider;
661
- export const ResuxKbd = RxKbd;
662
- export const ResuxModal = RxModal;
955
+ const ResuxMotion = RxMotion;
956
+ const ResuxReveal = RxReveal;
957
+ const ResuxAutoAnimate = RxAutoAnimate;
958
+ const ResuxButton = RxButton;
959
+ const ResuxCard = RxCard;
960
+ const ResuxBadge = RxBadge;
961
+ const ResuxInput = RxInput;
962
+ const ResuxSelect = RxSelect;
963
+ const ResuxDatePicker = RxDatePicker;
964
+ const ResuxPopover = RxPopover;
965
+ const ResuxIcon = RxIcon;
966
+ const ResuxAvatar = RxAvatar;
967
+ const ResuxAlert = RxAlert;
968
+ const ResuxAccordion = RxAccordion;
969
+ const ResuxTooltip = RxTooltip;
970
+ const ResuxDropdown = RxDropdown;
971
+ const ResuxTabs = RxTabs;
972
+ const ResuxTextarea = RxTextarea;
973
+ const ResuxSwitch = RxSwitch;
974
+ const ResuxSkeleton = RxSkeleton;
975
+ const ResuxDivider = RxDivider;
976
+ const ResuxKbd = RxKbd;
977
+ const ResuxModal = RxModal;
663
978
  const uiStyles = `
664
979
  @keyframes rxFadeUp {
665
980
  from { opacity: 0; transform: translate3d(0, 30px, 0); }
@@ -912,47 +1227,33 @@ const uiPrimitiveStyles = `
912
1227
  }
913
1228
  `;
914
1229
  const resuxUiModule = {
915
- defaults: {
916
- css: [],
917
- tokens: {},
918
- defaultStyles: true,
919
- animations: {
920
- enabled: true,
921
- defaultPreset: "fade-up"
922
- }
923
- },
924
- setup(options, resux) {
925
- const css = Array.isArray(options.css) ? options.css : [];
926
- for (const href of css) {
927
- if (typeof href === "string" && href.trim()) {
928
- resux.addCss(href);
929
- }
930
- }
931
- const stylesToInject = [];
932
- if (options.animations?.enabled !== false) {
933
- stylesToInject.push(uiStyles);
934
- }
935
- if (options.defaultStyles !== false) {
936
- stylesToInject.push(uiPrimitiveStyles);
937
- }
938
- if (stylesToInject.length > 0) {
939
- resux.addHead({
940
- style: stylesToInject.map((children) => ({ children }))
941
- });
942
- }
943
- resux.extendRuntimeConfig({
944
- public: {
945
- ui: {
946
- tokens: options.tokens && typeof options.tokens === "object" ? options.tokens : {},
947
- defaultStyles: options.defaultStyles !== false,
948
- animations: {
949
- enabled: options.animations?.enabled !== false,
950
- defaultPreset: options.animations?.defaultPreset || "fade-up"
951
- }
952
- }
953
- }
954
- });
955
- }
1230
+ defaults: {
1231
+ css: [],
1232
+ tokens: {},
1233
+ defaultStyles: true,
1234
+ animations: {
1235
+ enabled: true,
1236
+ defaultPreset: "fade-up"
1237
+ }
1238
+ },
1239
+ setup(options, resux) {
1240
+ const css = Array.isArray(options.css) ? options.css : [];
1241
+ for (const href of css) if (typeof href === "string" && href.trim()) resux.addCss(href);
1242
+ const stylesToInject = [];
1243
+ if (options.animations?.enabled !== false) stylesToInject.push(uiStyles);
1244
+ if (options.defaultStyles !== false) stylesToInject.push(uiPrimitiveStyles);
1245
+ if (stylesToInject.length > 0) resux.addHead({ style: stylesToInject.map((children) => ({ children })) });
1246
+ resux.extendRuntimeConfig({ public: { ui: {
1247
+ tokens: options.tokens && typeof options.tokens === "object" ? options.tokens : {},
1248
+ defaultStyles: options.defaultStyles !== false,
1249
+ animations: {
1250
+ enabled: options.animations?.enabled !== false,
1251
+ defaultPreset: options.animations?.defaultPreset || "fade-up"
1252
+ }
1253
+ } } });
1254
+ }
956
1255
  };
957
- export default resuxUiModule;
1256
+ //#endregion
1257
+ export { ResuxAccordion, ResuxAlert, ResuxAutoAnimate, ResuxAvatar, ResuxBadge, ResuxButton, ResuxCard, ResuxDatePicker, ResuxDivider, ResuxDropdown, ResuxIcon, ResuxInput, ResuxKbd, ResuxModal, ResuxMotion, ResuxPopover, ResuxReveal, ResuxSelect, ResuxSkeleton, ResuxSwitch, ResuxTabs, ResuxTextarea, ResuxTooltip, RxAccordion, RxAlert, RxAutoAnimate, RxAvatar, RxBadge, RxButton, RxCard, RxDatePicker, RxDivider, RxDropdown, RxIcon, RxInput, RxKbd, RxModal, RxMotion, RxPopover, RxReveal, RxSelect, RxSkeleton, RxSwitch, RxTabs, RxTextarea, RxTooltip, resuxUiModule as default, defineUiTokens, isReducedMotion, useAnimate, vAnimate, vAnime };
1258
+
958
1259
  //# sourceMappingURL=index.js.map