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.
- package/README.md +23 -1
- package/dist/bin.d.ts +1 -2
- package/dist/bin.js +4 -0
- package/dist/bin.js.map +1 -1
- package/dist/build/index.d.ts +28 -0
- package/dist/build/index.js +51 -0
- package/dist/build/index.js.map +1 -0
- package/dist/cli.d.ts +15 -5
- package/dist/cli.js +2648 -3668
- package/dist/cli.js.map +1 -1
- package/dist/compiler/adapter.d.ts +14 -11
- package/dist/compiler/adapter.js +68 -93
- package/dist/compiler/adapter.js.map +1 -1
- package/dist/compiler/dev-warnings.d.ts +8 -5
- package/dist/compiler/dev-warnings.js +248 -321
- package/dist/compiler/dev-warnings.js.map +1 -1
- package/dist/compiler/directives.d.ts +3 -0
- package/dist/compiler/directives.js +124 -150
- package/dist/compiler/directives.js.map +1 -1
- package/dist/compiler/implementation.d.ts +96 -93
- package/dist/compiler/implementation.js +2967 -3430
- package/dist/compiler/index.d.ts +14 -11
- package/dist/compiler/index.js +68 -93
- package/dist/compiler/index.js.map +1 -1
- package/dist/core/config.d.ts +12 -5
- package/dist/core/config.js +42 -25
- package/dist/core/config.js.map +1 -1
- package/dist/core/hooks.d.ts +127 -126
- package/dist/core/hooks.js +45 -55
- package/dist/core/hooks.js.map +1 -1
- package/dist/core/index.d.ts +5 -4
- package/dist/core/index.js +5 -5
- package/dist/core/module-container.d.ts +76 -74
- package/dist/core/module-container.js +181 -186
- package/dist/core/module-container.js.map +1 -1
- package/dist/core/resux.d.ts +15 -12
- package/dist/core/resux.js +17 -13
- package/dist/core/resux.js.map +1 -1
- package/dist/create-bin.d.ts +1 -2
- package/dist/create-bin.js +4 -0
- package/dist/create-bin.js.map +1 -1
- package/dist/create.d.ts +3 -0
- package/dist/create.js +499 -638
- package/dist/create.js.map +1 -1
- package/dist/deploy/cloudflare.d.ts +4 -1
- package/dist/deploy/cloudflare.js +30 -34
- package/dist/deploy/cloudflare.js.map +1 -1
- package/dist/deploy/common.d.ts +6 -4
- package/dist/deploy/common.js +118 -188
- package/dist/deploy/common.js.map +1 -1
- package/dist/deploy/framework-runtime.d.ts +3 -0
- package/dist/deploy/framework-runtime.js +43 -48
- package/dist/deploy/framework-runtime.js.map +1 -1
- package/dist/deploy/index.d.ts +4 -1
- package/dist/deploy/index.js +58 -80
- package/dist/deploy/index.js.map +1 -1
- package/dist/deploy/netlify.d.ts +4 -1
- package/dist/deploy/netlify.js +40 -41
- package/dist/deploy/netlify.js.map +1 -1
- package/dist/deploy/node.d.ts +4 -1
- package/dist/deploy/node.js +24 -19
- package/dist/deploy/node.js.map +1 -1
- package/dist/deploy/production-report.d.ts +3 -0
- package/dist/deploy/production-report.js +14 -14
- package/dist/deploy/production-report.js.map +1 -1
- package/dist/deploy/runtime-dependencies.d.ts +3 -0
- package/dist/deploy/runtime-dependencies.js +158 -220
- package/dist/deploy/runtime-dependencies.js.map +1 -1
- package/dist/deploy/static.d.ts +4 -1
- package/dist/deploy/static.js +16 -14
- package/dist/deploy/static.js.map +1 -1
- package/dist/deploy/types.d.ts +25 -22
- package/dist/deploy/types.js +0 -1
- package/dist/deploy/vercel.d.ts +4 -1
- package/dist/deploy/vercel.js +137 -188
- package/dist/deploy/vercel.js.map +1 -1
- package/dist/fonts/index.d.ts +15 -11
- package/dist/fonts/index.js +114 -134
- package/dist/fonts/index.js.map +1 -1
- package/dist/globals.d.ts +79 -78
- package/dist/globals.js +0 -1
- package/dist/halal-core/ai/classifyProject.d.ts +4 -1
- package/dist/halal-core/ai/classifyProject.js +81 -95
- package/dist/halal-core/ai/classifyProject.js.map +1 -1
- package/dist/halal-core/ai/classifyRuntimeContent.d.ts +5 -2
- package/dist/halal-core/ai/classifyRuntimeContent.js +77 -95
- package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
- package/dist/halal-core/ai/createProjectSummary.d.ts +38 -35
- package/dist/halal-core/ai/createProjectSummary.js +38 -39
- package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
- package/dist/halal-core/ai/halalClassifierPrompt.d.ts +3 -0
- package/dist/halal-core/ai/halalClassifierPrompt.js +5 -1
- package/dist/halal-core/ai/halalClassifierPrompt.js.map +1 -1
- package/dist/halal-core/ai/redactSensitiveData.d.ts +3 -0
- package/dist/halal-core/ai/redactSensitiveData.js +82 -110
- package/dist/halal-core/ai/redactSensitiveData.js.map +1 -1
- package/dist/halal-core/ai/validateAiResponse.d.ts +4 -1
- package/dist/halal-core/ai/validateAiResponse.js +58 -85
- package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
- package/dist/halal-core/cli/check.d.ts +3 -0
- package/dist/halal-core/cli/check.js +28 -30
- package/dist/halal-core/cli/check.js.map +1 -1
- package/dist/halal-core/cli/explain.d.ts +3 -0
- package/dist/halal-core/cli/explain.js +27 -31
- package/dist/halal-core/cli/explain.js.map +1 -1
- package/dist/halal-core/cli/report.d.ts +3 -0
- package/dist/halal-core/cli/report.js +14 -10
- package/dist/halal-core/cli/report.js.map +1 -1
- package/dist/halal-core/cli/submitReview.d.ts +3 -0
- package/dist/halal-core/cli/submitReview.js +13 -9
- package/dist/halal-core/cli/submitReview.js.map +1 -1
- package/dist/halal-core/cli/verifyReview.d.ts +3 -0
- package/dist/halal-core/cli/verifyReview.js +18 -15
- package/dist/halal-core/cli/verifyReview.js.map +1 -1
- package/dist/halal-core/config.d.ts +30 -27
- package/dist/halal-core/config.js +76 -118
- package/dist/halal-core/config.js.map +1 -1
- package/dist/halal-core/crypto/integrity.d.ts +6 -3
- package/dist/halal-core/crypto/integrity.js +64 -87
- package/dist/halal-core/crypto/integrity.js.map +1 -1
- package/dist/halal-core/enforce.d.ts +3 -0
- package/dist/halal-core/enforce.js +92 -105
- package/dist/halal-core/enforce.js.map +1 -1
- package/dist/halal-core/index.d.ts +20 -16
- package/dist/halal-core/index.js +18 -19
- package/dist/halal-core/lifecycle.d.ts +3 -0
- package/dist/halal-core/lifecycle.js +15 -13
- package/dist/halal-core/lifecycle.js.map +1 -1
- package/dist/halal-core/policy.d.ts +4 -1
- package/dist/halal-core/policy.js +6 -2
- package/dist/halal-core/policy.js.map +1 -1
- package/dist/halal-core/report/formatBrowserOverlay.d.ts +4 -1
- package/dist/halal-core/report/formatBrowserOverlay.js +10 -8
- package/dist/halal-core/report/formatBrowserOverlay.js.map +1 -1
- package/dist/halal-core/report/formatTerminalReport.d.ts +4 -1
- package/dist/halal-core/report/formatTerminalReport.js +27 -37
- package/dist/halal-core/report/formatTerminalReport.js.map +1 -1
- package/dist/halal-core/report/generateHalalReport.d.ts +7 -4
- package/dist/halal-core/report/generateHalalReport.js +26 -26
- package/dist/halal-core/report/generateHalalReport.js.map +1 -1
- package/dist/halal-core/report/signReport.d.ts +4 -1
- package/dist/halal-core/report/signReport.js +16 -12
- package/dist/halal-core/report/signReport.js.map +1 -1
- package/dist/halal-core/report/verifyReport.d.ts +9 -6
- package/dist/halal-core/report/verifyReport.js +51 -41
- package/dist/halal-core/report/verifyReport.js.map +1 -1
- package/dist/halal-core/review/createReviewRequest.d.ts +4 -1
- package/dist/halal-core/review/createReviewRequest.js +21 -17
- package/dist/halal-core/review/createReviewRequest.js.map +1 -1
- package/dist/halal-core/review/reviewPolicy.d.ts +3 -0
- package/dist/halal-core/review/reviewPolicy.js +19 -17
- package/dist/halal-core/review/reviewPolicy.js.map +1 -1
- package/dist/halal-core/review/signedReviewFile.d.ts +11 -8
- package/dist/halal-core/review/signedReviewFile.js +24 -22
- package/dist/halal-core/review/signedReviewFile.js.map +1 -1
- package/dist/halal-core/review/verifyReviewApproval.d.ts +9 -6
- package/dist/halal-core/review/verifyReviewApproval.js +68 -62
- package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
- package/dist/halal-core/rules/adultContentRules.d.ts +3 -0
- package/dist/halal-core/rules/adultContentRules.js +23 -23
- package/dist/halal-core/rules/adultContentRules.js.map +1 -1
- package/dist/halal-core/rules/alcoholDrugVapeRules.d.ts +3 -0
- package/dist/halal-core/rules/alcoholDrugVapeRules.js +22 -22
- package/dist/halal-core/rules/alcoholDrugVapeRules.js.map +1 -1
- package/dist/halal-core/rules/childSafetyRules.d.ts +3 -0
- package/dist/halal-core/rules/childSafetyRules.js +19 -19
- package/dist/halal-core/rules/childSafetyRules.js.map +1 -1
- package/dist/halal-core/rules/coreCategories.d.ts +7 -4
- package/dist/halal-core/rules/coreCategories.js +237 -110
- package/dist/halal-core/rules/coreCategories.js.map +1 -1
- package/dist/halal-core/rules/cyberAbuseRules.d.ts +3 -0
- package/dist/halal-core/rules/cyberAbuseRules.js +27 -27
- package/dist/halal-core/rules/cyberAbuseRules.js.map +1 -1
- package/dist/halal-core/rules/defaultBlockedRules.d.ts +21 -18
- package/dist/halal-core/rules/defaultBlockedRules.js +158 -199
- package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
- package/dist/halal-core/rules/dependencyRules.d.ts +8 -5
- package/dist/halal-core/rules/dependencyRules.js +50 -56
- package/dist/halal-core/rules/dependencyRules.js.map +1 -1
- package/dist/halal-core/rules/endpointRules.d.ts +6 -3
- package/dist/halal-core/rules/endpointRules.js +21 -23
- package/dist/halal-core/rules/endpointRules.js.map +1 -1
- package/dist/halal-core/rules/environmentalHarmRules.d.ts +3 -0
- package/dist/halal-core/rules/environmentalHarmRules.js +17 -17
- package/dist/halal-core/rules/environmentalHarmRules.js.map +1 -1
- package/dist/halal-core/rules/financeRibaRules.d.ts +3 -0
- package/dist/halal-core/rules/financeRibaRules.js +20 -20
- package/dist/halal-core/rules/financeRibaRules.js.map +1 -1
- package/dist/halal-core/rules/gamblingRules.d.ts +3 -0
- package/dist/halal-core/rules/gamblingRules.js +22 -22
- package/dist/halal-core/rules/gamblingRules.js.map +1 -1
- package/dist/halal-core/rules/generalHarmRules.d.ts +3 -0
- package/dist/halal-core/rules/generalHarmRules.js +15 -15
- package/dist/halal-core/rules/generalHarmRules.js.map +1 -1
- package/dist/halal-core/rules/healthHarmRules.d.ts +3 -0
- package/dist/halal-core/rules/healthHarmRules.js +19 -19
- package/dist/halal-core/rules/healthHarmRules.js.map +1 -1
- package/dist/halal-core/rules/keywordRules.d.ts +11 -8
- package/dist/halal-core/rules/keywordRules.js +90 -39
- package/dist/halal-core/rules/keywordRules.js.map +1 -1
- package/dist/halal-core/rules/privacyAbuseRules.d.ts +3 -0
- package/dist/halal-core/rules/privacyAbuseRules.js +21 -21
- package/dist/halal-core/rules/privacyAbuseRules.js.map +1 -1
- package/dist/halal-core/rules/scamFraudRules.d.ts +3 -0
- package/dist/halal-core/rules/scamFraudRules.js +29 -29
- package/dist/halal-core/rules/scamFraudRules.js.map +1 -1
- package/dist/halal-core/rules/selfHarmRules.d.ts +3 -0
- package/dist/halal-core/rules/selfHarmRules.js +17 -17
- package/dist/halal-core/rules/selfHarmRules.js.map +1 -1
- package/dist/halal-core/rules/violenceExtremismRules.d.ts +3 -0
- package/dist/halal-core/rules/violenceExtremismRules.js +30 -30
- package/dist/halal-core/rules/violenceExtremismRules.js.map +1 -1
- package/dist/halal-core/runtime/guard.d.ts +17 -14
- package/dist/halal-core/runtime/guard.js +162 -183
- package/dist/halal-core/runtime/guard.js.map +1 -1
- package/dist/halal-core/runtime/index.d.ts +5 -4
- package/dist/halal-core/runtime/index.js +4 -5
- package/dist/halal-core/runtime/reviewedMemory.d.ts +4 -1
- package/dist/halal-core/runtime/reviewedMemory.js +74 -110
- package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
- package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +10 -7
- package/dist/halal-core/runtime/serializeRuntimeContent.js +132 -156
- package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
- package/dist/halal-core/runtime/types.d.ts +44 -41
- package/dist/halal-core/runtime/types.js +0 -1
- package/dist/halal-core/scanner/scanApiRoutes.d.ts +3 -0
- package/dist/halal-core/scanner/scanApiRoutes.js +32 -36
- package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
- package/dist/halal-core/scanner/scanComponents.d.ts +3 -0
- package/dist/halal-core/scanner/scanComponents.js +12 -13
- package/dist/halal-core/scanner/scanComponents.js.map +1 -1
- package/dist/halal-core/scanner/scanContent.d.ts +5 -2
- package/dist/halal-core/scanner/scanContent.js +193 -263
- package/dist/halal-core/scanner/scanContent.js.map +1 -1
- package/dist/halal-core/scanner/scanDependencies.d.ts +3 -0
- package/dist/halal-core/scanner/scanDependencies.js +16 -15
- package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
- package/dist/halal-core/scanner/scanDomains.d.ts +5 -2
- package/dist/halal-core/scanner/scanDomains.js +12 -12
- package/dist/halal-core/scanner/scanDomains.js.map +1 -1
- package/dist/halal-core/scanner/scanEnvNames.d.ts +3 -0
- package/dist/halal-core/scanner/scanEnvNames.js +23 -26
- package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
- package/dist/halal-core/scanner/scanMetadata.d.ts +6 -3
- package/dist/halal-core/scanner/scanMetadata.js +20 -29
- package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
- package/dist/halal-core/scanner/scanPages.d.ts +3 -0
- package/dist/halal-core/scanner/scanPages.js +12 -15
- package/dist/halal-core/scanner/scanPages.js.map +1 -1
- package/dist/halal-core/scanner/scanProject.d.ts +15 -10
- package/dist/halal-core/scanner/scanProject.js +43 -49
- package/dist/halal-core/scanner/scanProject.js.map +1 -1
- package/dist/halal-core/scanner/scanRoutes.d.ts +3 -0
- package/dist/halal-core/scanner/scanRoutes.js +32 -39
- package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
- package/dist/halal-core/scanner/scanTranslations.d.ts +3 -0
- package/dist/halal-core/scanner/scanTranslations.js +21 -29
- package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
- package/dist/halal-core/status.d.ts +14 -11
- package/dist/halal-core/status.js +0 -1
- package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +3 -0
- package/dist/halal-core/tamper/verifyCoreIntegrity.js +26 -24
- package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
- package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +3 -0
- package/dist/halal-core/tamper/verifyLifecycleHooks.js +13 -12
- package/dist/halal-core/tamper/verifyLifecycleHooks.js.map +1 -1
- package/dist/halal-core/tamper/verifyReportSignature.d.ts +6 -3
- package/dist/halal-core/tamper/verifyReportSignature.js +20 -14
- package/dist/halal-core/tamper/verifyReportSignature.js.map +1 -1
- package/dist/halal.d.ts +20 -1
- package/dist/halal.js +18 -2
- package/dist/i18n/index.d.ts +34 -31
- package/dist/i18n/index.js +219 -288
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/shared.d.ts +18 -15
- package/dist/i18n/shared.js +204 -266
- package/dist/i18n/shared.js.map +1 -1
- package/dist/icons/index.d.ts +143 -139
- package/dist/icons/index.js +322 -273
- package/dist/icons/index.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +7 -2
- package/dist/kit/index.d.ts +9 -6
- package/dist/kit/index.js +45 -43
- package/dist/kit/index.js.map +1 -1
- package/dist/nitro-server/index.d.ts +7 -4
- package/dist/nitro-server/index.js +6 -2
- package/dist/nitro-server/index.js.map +1 -1
- package/dist/node.d.ts +6 -3
- package/dist/node.js +88 -116
- package/dist/node.js.map +1 -1
- package/dist/reactivity/computed.d.ts +6 -3
- package/dist/reactivity/computed.js +46 -53
- package/dist/reactivity/computed.js.map +1 -1
- package/dist/reactivity/effect.d.ts +8 -5
- package/dist/reactivity/effect.js +105 -146
- package/dist/reactivity/effect.js.map +1 -1
- package/dist/reactivity/index.d.ts +8 -8
- package/dist/reactivity/index.js +7 -8
- package/dist/reactivity/reactive.d.ts +3 -0
- package/dist/reactivity/reactive.js +93 -133
- package/dist/reactivity/reactive.js.map +1 -1
- package/dist/reactivity/readonly.d.ts +2 -1
- package/dist/reactivity/readonly.js +2 -2
- package/dist/reactivity/ref.d.ts +15 -15
- package/dist/reactivity/ref.js +73 -81
- package/dist/reactivity/ref.js.map +1 -1
- package/dist/reactivity/scheduler.d.ts +3 -1
- package/dist/reactivity/scheduler.js +67 -69
- package/dist/reactivity/scheduler.js.map +1 -1
- package/dist/reactivity/types.d.ts +17 -14
- package/dist/reactivity/types.js +0 -1
- package/dist/reactivity/utils.d.ts +7 -4
- package/dist/reactivity/utils.js +25 -24
- package/dist/reactivity/utils.js.map +1 -1
- package/dist/reactivity/watch.d.ts +4 -2
- package/dist/reactivity/watch.js +75 -103
- package/dist/reactivity/watch.js.map +1 -1
- package/dist/runtime/core.d.ts +31 -0
- package/dist/runtime/core.js +156 -0
- package/dist/runtime/core.js.map +1 -0
- package/dist/runtime/index.d.ts +487 -461
- package/dist/runtime/index.js +4129 -5254
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/reactivity.d.ts +7 -0
- package/dist/runtime/reactivity.js +6 -0
- package/dist/runtime/resume.d.ts +79 -0
- package/dist/runtime/resume.js +482 -0
- package/dist/runtime/resume.js.map +1 -0
- package/dist/runtime/router.d.ts +20 -0
- package/dist/runtime/router.js +60 -0
- package/dist/runtime/router.js.map +1 -0
- package/dist/runtime/streaming.d.ts +24 -0
- package/dist/runtime/streaming.js +200 -0
- package/dist/runtime/streaming.js.map +1 -0
- package/dist/security/media-fetch.d.ts +32 -0
- package/dist/security/media-fetch.js +301 -0
- package/dist/security/media-fetch.js.map +1 -0
- package/dist/security/path-boundary.d.ts +7 -0
- package/dist/security/path-boundary.js +70 -0
- package/dist/security/path-boundary.js.map +1 -0
- package/dist/ui/index.d.ts +1580 -1576
- package/dist/ui/index.js +975 -674
- package/dist/ui/index.js.map +1 -1
- package/dist/vite-builder/index.d.ts +6 -3
- package/dist/vite-builder/index.js +6 -2
- package/dist/vite-builder/index.js.map +1 -1
- package/package.json +46 -86
- package/dist/compiler/implementation.js.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/deploy/types.js.map +0 -1
- package/dist/globals.js.map +0 -1
- package/dist/halal-core/index.js.map +0 -1
- package/dist/halal-core/runtime/index.js.map +0 -1
- package/dist/halal-core/runtime/types.js.map +0 -1
- package/dist/halal-core/status.js.map +0 -1
- package/dist/halal.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/reactivity/index.js.map +0 -1
- package/dist/reactivity/readonly.js.map +0 -1
- 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
|
-
|
|
3
|
-
|
|
2
|
+
//#region src/ui/index.ts
|
|
3
|
+
function defineUiTokens(tokens) {
|
|
4
|
+
return tokens;
|
|
4
5
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
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
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
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
|
-
|
|
312
|
-
|
|
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
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
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
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
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
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
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
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
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
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
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
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
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
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
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
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
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
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
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
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
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
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
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
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
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
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
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
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
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
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
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
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
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
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
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
|
-
|
|
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
|