resuxjs 0.3.11 → 0.4.0-beta.3

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