negodesign 0.0.11 → 0.0.13
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/dist/components/NegoDesign.svelte +1 -1
- package/dist/components/NegoDesign.svelte.d.ts +1 -1
- package/dist/components/core/button/ButtonBack.svelte +1 -1
- package/dist/components/core/button/ButtonLogin.svelte +1 -1
- package/dist/components/core/button/ButtonLoginWith.svelte +1 -1
- package/dist/components/core/button/ButtonSend.svelte +1 -1
- package/dist/components/core/card/media/01/CardMedia01.svelte +114 -0
- package/dist/components/core/card/media/01/CardMedia01.svelte.d.ts +4 -0
- package/dist/components/core/card/media/02/CardMedia02.svelte +113 -0
- package/dist/components/core/card/media/02/CardMedia02.svelte.d.ts +4 -0
- package/dist/components/core/card/media/CardMedia.svelte +17 -0
- package/dist/components/core/card/media/CardMedia.svelte.d.ts +8 -0
- package/dist/components/core/card/media/data.d.ts +3 -0
- package/dist/components/core/card/media/data.js +117 -0
- package/dist/components/core/card/profile/01/CardProfile01.svelte +101 -0
- package/dist/components/core/card/profile/01/CardProfile01.svelte.d.ts +4 -0
- package/dist/components/core/card/profile/02/CardProfile02.svelte +97 -0
- package/dist/components/core/card/profile/02/CardProfile02.svelte.d.ts +4 -0
- package/dist/components/core/card/profile/CardProfile.svelte +17 -0
- package/dist/components/core/card/profile/CardProfile.svelte.d.ts +8 -0
- package/dist/components/core/card/profile/data.d.ts +3 -0
- package/dist/components/core/card/profile/data.js +107 -0
- package/dist/components/core/card/promotion/CardPromotion.svelte +44 -0
- package/dist/components/core/card/promotion/CardPromotion.svelte.d.ts +8 -0
- package/dist/components/core/card/promotion/data.d.ts +3 -0
- package/dist/components/core/card/promotion/data.js +31 -0
- package/dist/components/core/card/shared/CardButton.svelte +30 -0
- package/dist/components/core/card/shared/CardButton.svelte.d.ts +12 -0
- package/dist/components/core/card/shared/CardDescription.svelte +23 -0
- package/dist/components/core/card/shared/CardDescription.svelte.d.ts +6 -0
- package/dist/components/core/card/shared/CardFavorite.svelte +28 -0
- package/dist/components/core/card/shared/CardFavorite.svelte.d.ts +7 -0
- package/dist/components/core/card/shared/CardStarRating.svelte +20 -0
- package/dist/components/core/card/shared/CardStarRating.svelte.d.ts +7 -0
- package/dist/components/core/card/shared/CardTags.svelte +56 -0
- package/dist/components/core/card/shared/CardTags.svelte.d.ts +10 -0
- package/dist/components/core/card/shared/CardThumbnailVideo.svelte +170 -0
- package/dist/components/core/card/shared/CardThumbnailVideo.svelte.d.ts +10 -0
- package/dist/components/core/card/shared/TruncatableText.svelte +56 -0
- package/dist/components/core/card/shared/TruncatableText.svelte.d.ts +8 -0
- package/dist/components/core/card/types.d.ts +54 -0
- package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte +53 -0
- package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte.d.ts +4 -0
- package/dist/components/core/carousel/shared/ui/SimpleBadgeCarousel.svelte +59 -0
- package/dist/components/core/carousel/shared/ui/SimpleBadgeCarousel.svelte.d.ts +4 -0
- package/dist/components/core/carousel/types.d.ts +34 -0
- package/dist/components/core/datatable/ui/DataTableCore.svelte +5 -5
- package/dist/components/core/form/ui/input-code-otp.svelte +3 -3
- package/dist/components/core/form/ui/input-code-otp.svelte.d.ts +2 -2
- package/dist/components/core/form/ui/input-email-or-phone.svelte +1 -1
- package/dist/components/core/form/ui/input-email.svelte +1 -1
- package/dist/components/core/form/ui/input-password-confirm.svelte +1 -1
- package/dist/components/core/form/ui/input-password.svelte +1 -1
- package/dist/components/core/form/ui/input-phone.svelte +1 -1
- package/dist/components/core/form/ui/input-username.svelte +2 -2
- package/dist/components/core/nav/data/nav-menu-sidebar.d.ts +7 -7
- package/dist/components/core/nav/data/nav-menu.d.ts +31 -0
- package/dist/components/core/nav/data/nav-user-sidebar.d.ts +1 -1
- package/dist/components/core/nav/ui/menu-links.svelte +28 -0
- package/dist/components/core/nav/ui/menu-links.svelte.d.ts +10 -0
- package/dist/components/core/nav/ui/mobile/nav-menu-drawer.svelte +85 -0
- package/dist/components/core/nav/ui/mobile/nav-menu-drawer.svelte.d.ts +9 -0
- package/dist/components/core/nav/ui/{nav-menu-bottom-bar.svelte → nav-menu-bottom-sidebar.svelte} +2 -2
- package/dist/components/core/nav/ui/nav-menu-bottom-sidebar.svelte.d.ts +10 -0
- package/dist/components/core/nav/ui/nav-menu-header-sidebar.svelte.d.ts +10 -0
- package/dist/components/core/nav/ui/{nav-menu-bar.svelte → nav-menu-sidebar.svelte} +7 -7
- package/dist/components/core/nav/ui/nav-menu-sidebar.svelte.d.ts +7 -0
- package/dist/components/core/nav/ui/nav-menu-top-bar-sidebar.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/nav-menu.svelte +98 -0
- package/dist/components/core/nav/ui/nav-menu.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/nav-user-sidebar.svelte +2 -2
- package/dist/components/core/nav/ui/nav-user-sidebar.svelte.d.ts +2 -2
- package/dist/components/core/panel/CarouselSlot.svelte +38 -0
- package/dist/components/core/panel/CarouselSlot.svelte.d.ts +11 -0
- package/dist/components/core/panel/LeftHero.svelte +3 -3
- package/dist/components/core/panel/LeftHero.svelte.d.ts +2 -2
- package/dist/components/core/search/01/Search01.svelte +15 -0
- package/dist/components/core/search/01/Search01.svelte.d.ts +4 -0
- package/dist/components/core/search/02/Search02.svelte +15 -0
- package/dist/components/core/search/02/Search02.svelte.d.ts +4 -0
- package/dist/components/core/search/SearchInput.svelte +32 -0
- package/dist/components/core/search/SearchInput.svelte.d.ts +4 -0
- package/dist/components/core/search/shared/SearchInputCore.svelte +66 -0
- package/dist/components/core/search/shared/SearchInputCore.svelte.d.ts +4 -0
- package/dist/components/core/search/types.d.ts +15 -0
- package/dist/components/core/sidebar/MenuBarSidebar.svelte +14 -14
- package/dist/components/core/sidebar/MenuBarSidebar.svelte.d.ts +8 -8
- package/dist/components/pages/admin/{ui → 01/ui}/AdminContent.svelte +1 -1
- package/dist/components/pages/admin/{ui → 01/ui}/AdminContent.svelte.d.ts +1 -1
- package/dist/components/pages/admin/{ui → 01/ui}/AdminPanel.svelte +8 -8
- package/dist/components/pages/admin/{ui → 01/ui}/AdminPanel.svelte.d.ts +4 -4
- package/dist/components/pages/privacy-policy-or-terms-of-use/01/DocsSidebar.svelte +69 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/01/DocsSidebar.svelte.d.ts +10 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/01/PrivacyPolicyOrTermsOfUse01.svelte +73 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/01/PrivacyPolicyOrTermsOfUse01.svelte.d.ts +7 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/01/TableOfContents.svelte +37 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/01/TableOfContents.svelte.d.ts +8 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/02/DocsPageHero.svelte +59 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/02/DocsPageHero.svelte.d.ts +10 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/02/PageHero.svelte +51 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/02/PageHero.svelte.d.ts +14 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/02/PrivacyPolicyOrTermsOfUse02.svelte +24 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/02/PrivacyPolicyOrTermsOfUse02.svelte.d.ts +7 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/PrivacyPolicyOrTermsOfUse.svelte +32 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/PrivacyPolicyOrTermsOfUse.svelte.d.ts +4 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/shared/ContentBlockView.svelte +26 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/shared/ContentBlockView.svelte.d.ts +7 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/shared/DocSectionView.svelte +44 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/shared/DocSectionView.svelte.d.ts +7 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/shared/PrivacyPolicyOrTermsOfUseBreadcrumb.svelte +34 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/shared/PrivacyPolicyOrTermsOfUseBreadcrumb.svelte.d.ts +7 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/shared/toc.d.ts +8 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/shared/toc.js +14 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/types.d.ts +62 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/types.js +5 -0
- package/dist/components/pages/{forget-password → security/forget-password}/01/ui/ForgetPasswordCard.svelte +15 -10
- package/dist/components/pages/{forget-password → security/forget-password}/01/ui/ForgetPasswordCard.svelte.d.ts +0 -5
- package/dist/components/pages/{forget-password → security/forget-password}/01/ui/FormForgetPassword.svelte +15 -5
- package/dist/components/pages/{forget-password → security/forget-password}/01/ui/PageForgetPassword01.svelte +6 -6
- package/dist/components/pages/{forget-password → security/forget-password}/PageForgetPassword.svelte +10 -7
- package/dist/components/pages/{forget-password → security/forget-password}/PageForgetPassword.svelte.d.ts +0 -7
- package/dist/components/pages/{forget-password → security/forget-password}/types.d.ts +3 -3
- package/dist/components/pages/{login → security/login}/01/ui/FormLogin.svelte +19 -15
- package/dist/components/pages/{login → security/login}/01/ui/FormLogin.svelte.d.ts +0 -6
- package/dist/components/pages/{login → security/login}/01/ui/FormLoginEmailPassword.svelte +10 -1
- package/dist/components/pages/{login → security/login}/01/ui/FormLoginEmailPassword.svelte.d.ts +0 -1
- package/dist/components/pages/{login → security/login}/01/ui/FormLoginPhonePassword.svelte +10 -1
- package/dist/components/pages/{login → security/login}/01/ui/FormLoginPhonePassword.svelte.d.ts +0 -1
- package/dist/components/pages/{login → security/login}/01/ui/FormLoginUsernamePassword.svelte +10 -1
- package/dist/components/pages/{login → security/login}/01/ui/FormLoginUsernamePassword.svelte.d.ts +0 -1
- package/dist/components/pages/{login → security/login}/01/ui/FormRegister.svelte +5 -5
- package/dist/components/pages/{login → security/login}/01/ui/LoginCard.svelte +28 -20
- package/dist/components/pages/security/login/01/ui/LoginCard.svelte.d.ts +13 -0
- package/dist/components/pages/{login → security/login}/01/ui/PageLogin01.svelte +12 -11
- package/dist/components/pages/security/login/PageLogin.svelte +22 -0
- package/dist/components/pages/security/login/PageLogin.svelte.d.ts +8 -0
- package/dist/components/pages/security/login/types.d.ts +33 -0
- package/dist/components/pages/security/login/types.js +1 -0
- package/dist/components/pages/{otp-verification → security/otp-verification}/01/ui/FormOtpVerification.svelte +13 -3
- package/dist/components/pages/{otp-verification → security/otp-verification}/01/ui/OtpVerificationCard.svelte +15 -10
- package/dist/components/pages/{otp-verification → security/otp-verification}/01/ui/OtpVerificationCard.svelte.d.ts +0 -5
- package/dist/components/pages/{otp-verification → security/otp-verification}/01/ui/PageOtpVerification01.svelte +12 -6
- package/dist/components/pages/{otp-verification → security/otp-verification}/PageOtpVerification.svelte +10 -4
- package/dist/components/pages/{otp-verification → security/otp-verification}/PageOtpVerification.svelte.d.ts +0 -4
- package/dist/components/pages/{otp-verification → security/otp-verification}/types.d.ts +3 -3
- package/dist/components/pages/security/otp-verification/types.js +1 -0
- package/dist/components/pages/{reset-password → security/reset-password}/01/ui/FormResetPassword.svelte +15 -5
- package/dist/components/pages/{reset-password → security/reset-password}/01/ui/PageResetPassword01.svelte +12 -6
- package/dist/components/pages/{reset-password → security/reset-password}/01/ui/ResetPasswordCard.svelte +15 -10
- package/dist/components/pages/{reset-password → security/reset-password}/01/ui/ResetPasswordCard.svelte.d.ts +0 -5
- package/dist/components/pages/{reset-password → security/reset-password}/PageResetPassword.svelte +10 -4
- package/dist/components/pages/{reset-password → security/reset-password}/PageResetPassword.svelte.d.ts +0 -4
- package/dist/components/pages/{reset-password → security/reset-password}/types.d.ts +3 -3
- package/dist/components/pages/security/reset-password/types.js +1 -0
- package/dist/components/ui/button/button.svelte +82 -101
- package/dist/components/ui/button/button.svelte.d.ts +36 -63
- package/dist/components/ui/button/index.d.ts +2 -2
- package/dist/components/ui/button/index.js +2 -2
- package/dist/components/ui/carousel/carousel-content.svelte +43 -0
- package/dist/components/ui/carousel/carousel-content.svelte.d.ts +5 -0
- package/dist/components/ui/carousel/carousel-item.svelte +30 -0
- package/dist/components/ui/carousel/carousel-item.svelte.d.ts +5 -0
- package/dist/components/ui/carousel/carousel-next.svelte +40 -0
- package/dist/components/ui/carousel/carousel-next.svelte.d.ts +4 -0
- package/dist/components/ui/carousel/carousel-previous.svelte +40 -0
- package/dist/components/ui/carousel/carousel-previous.svelte.d.ts +4 -0
- package/dist/components/ui/carousel/carousel.svelte +94 -0
- package/dist/components/ui/carousel/carousel.svelte.d.ts +5 -0
- package/dist/components/ui/carousel/context.d.ts +31 -0
- package/dist/components/ui/carousel/context.js +12 -0
- package/dist/components/ui/carousel/index.d.ts +6 -0
- package/dist/components/ui/carousel/index.js +8 -0
- package/dist/components/ui/input-group/input-group-addon.svelte +6 -0
- package/dist/components/ui/input-group/input-group-addon.svelte.d.ts +6 -0
- package/dist/components/ui/light-switch/light-switch.svelte +17 -6
- package/dist/components/ui/light-switch/light-switch.svelte.d.ts +2 -2
- package/dist/components/ui/star-rating/index.d.ts +2 -0
- package/dist/components/ui/star-rating/index.js +2 -0
- package/dist/components/ui/star-rating/star-rating-star.svelte +41 -0
- package/dist/components/ui/star-rating/star-rating-star.svelte.d.ts +4 -0
- package/dist/components/ui/star-rating/star-rating.svelte +20 -0
- package/dist/components/ui/star-rating/star-rating.svelte.d.ts +4 -0
- package/dist/components/ui/star-rating/types.d.ts +5 -0
- package/dist/components/ui/star-rating/types.js +1 -0
- package/dist/globals.css +645 -36
- package/dist/hooks/responsive.svelte.d.ts +3 -0
- package/dist/hooks/responsive.svelte.js +18 -0
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/langs/en.d.ts +23 -8
- package/dist/i18n/langs/en.js +23 -8
- package/dist/i18n/langs/pt.d.ts +23 -8
- package/dist/i18n/langs/pt.js +23 -8
- package/dist/i18n/translations.d.ts +46 -16
- package/dist/index.d.ts +15 -9
- package/dist/index.js +15 -9
- package/dist/styles/globals.css +147 -141
- package/dist/types/index.d.ts +4 -4
- package/package.json +11 -9
- package/dist/components/core/carousel/data/CarouselModel.d.ts +0 -11
- package/dist/components/core/nav/ui/nav-menu-bar.svelte.d.ts +0 -7
- package/dist/components/core/nav/ui/nav-menu-bottom-bar.svelte.d.ts +0 -10
- package/dist/components/core/nav/ui/nav-menu-header.svelte.d.ts +0 -10
- package/dist/components/core/nav/ui/nav-menu-top-bar.svelte.d.ts +0 -4
- package/dist/components/pages/login/01/ui/LoginCard.svelte.d.ts +0 -21
- package/dist/components/pages/login/PageLogin.svelte +0 -21
- package/dist/components/pages/login/PageLogin.svelte.d.ts +0 -17
- package/dist/components/pages/login/types.d.ts +0 -23
- /package/dist/components/{pages/forget-password → core/card}/types.js +0 -0
- /package/dist/components/{pages/login → core/carousel}/types.js +0 -0
- /package/dist/components/core/{carousel/data/CarouselModel.js → nav/data/nav-menu.js} +0 -0
- /package/dist/components/core/nav/ui/{nav-menu-header.svelte → nav-menu-header-sidebar.svelte} +0 -0
- /package/dist/components/core/nav/ui/{nav-menu-top-bar.svelte → nav-menu-top-bar-sidebar.svelte} +0 -0
- /package/dist/components/{pages/otp-verification → core/search}/types.js +0 -0
- /package/dist/components/pages/{forget-password → security/forget-password}/01/ui/FormForgetPassword.svelte.d.ts +0 -0
- /package/dist/components/pages/{forget-password → security/forget-password}/01/ui/PageForgetPassword01.svelte.d.ts +0 -0
- /package/dist/components/pages/{reset-password → security/forget-password}/types.js +0 -0
- /package/dist/components/pages/{login → security/login}/01/ui/FormRegister.svelte.d.ts +0 -0
- /package/dist/components/pages/{login → security/login}/01/ui/PageLogin01.svelte.d.ts +0 -0
- /package/dist/components/pages/{otp-verification → security/otp-verification}/01/ui/FormOtpVerification.svelte.d.ts +0 -0
- /package/dist/components/pages/{otp-verification → security/otp-verification}/01/ui/PageOtpVerification01.svelte.d.ts +0 -0
- /package/dist/components/pages/{reset-password → security/reset-password}/01/ui/FormResetPassword.svelte.d.ts +0 -0
- /package/dist/components/pages/{reset-password → security/reset-password}/01/ui/PageResetPassword01.svelte.d.ts +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from "../../../utils.js";
|
|
3
|
+
import {
|
|
4
|
+
type CarouselAPI,
|
|
5
|
+
type CarouselProps,
|
|
6
|
+
type EmblaContext,
|
|
7
|
+
setEmblaContext,
|
|
8
|
+
} from "./context.js";
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
ref = $bindable(null),
|
|
12
|
+
opts = {},
|
|
13
|
+
plugins = [],
|
|
14
|
+
setApi = () => {},
|
|
15
|
+
orientation = "horizontal",
|
|
16
|
+
class: className,
|
|
17
|
+
children,
|
|
18
|
+
...restProps
|
|
19
|
+
}: WithElementRef<CarouselProps> = $props();
|
|
20
|
+
|
|
21
|
+
// svelte-ignore state_referenced_locally
|
|
22
|
+
let carouselState = $state<EmblaContext>({
|
|
23
|
+
api: undefined,
|
|
24
|
+
scrollPrev,
|
|
25
|
+
scrollNext,
|
|
26
|
+
orientation,
|
|
27
|
+
canScrollNext: false,
|
|
28
|
+
canScrollPrev: false,
|
|
29
|
+
handleKeyDown,
|
|
30
|
+
options: opts,
|
|
31
|
+
plugins,
|
|
32
|
+
onInit,
|
|
33
|
+
scrollSnaps: [],
|
|
34
|
+
selectedIndex: 0,
|
|
35
|
+
scrollTo,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
setEmblaContext(carouselState);
|
|
39
|
+
|
|
40
|
+
function scrollPrev() {
|
|
41
|
+
carouselState.api?.scrollPrev();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function scrollNext() {
|
|
45
|
+
carouselState.api?.scrollNext();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function scrollTo(index: number, jump?: boolean) {
|
|
49
|
+
carouselState.api?.scrollTo(index, jump);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function onSelect() {
|
|
53
|
+
if (!carouselState.api) return;
|
|
54
|
+
carouselState.selectedIndex = carouselState.api.selectedScrollSnap();
|
|
55
|
+
carouselState.canScrollNext = carouselState.api.canScrollNext();
|
|
56
|
+
carouselState.canScrollPrev = carouselState.api.canScrollPrev();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function handleKeyDown(e: KeyboardEvent) {
|
|
60
|
+
if (e.key === "ArrowLeft") {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
scrollPrev();
|
|
63
|
+
} else if (e.key === "ArrowRight") {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
scrollNext();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function onInit(event: CustomEvent<CarouselAPI>) {
|
|
70
|
+
carouselState.api = event.detail;
|
|
71
|
+
setApi(carouselState.api);
|
|
72
|
+
|
|
73
|
+
carouselState.scrollSnaps = carouselState.api.scrollSnapList();
|
|
74
|
+
carouselState.api.on("select", onSelect);
|
|
75
|
+
onSelect();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
$effect(() => {
|
|
79
|
+
return () => {
|
|
80
|
+
carouselState.api?.off("select", onSelect);
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<div
|
|
86
|
+
bind:this={ref}
|
|
87
|
+
data-slot="carousel"
|
|
88
|
+
class={cn("relative", className)}
|
|
89
|
+
role="region"
|
|
90
|
+
aria-roledescription="carousel"
|
|
91
|
+
{...restProps}
|
|
92
|
+
>
|
|
93
|
+
{@render children?.()}
|
|
94
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type WithElementRef } from "../../../utils.js";
|
|
2
|
+
import { type CarouselProps } from "./context.js";
|
|
3
|
+
declare const Carousel: import("svelte").Component<WithElementRef<CarouselProps>, {}, "ref">;
|
|
4
|
+
type Carousel = ReturnType<typeof Carousel>;
|
|
5
|
+
export default Carousel;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { WithElementRef } from "../../../utils.js";
|
|
2
|
+
import type { EmblaCarouselSvelteType, default as emblaCarouselSvelte } from "embla-carousel-svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
export type CarouselAPI = NonNullable<NonNullable<EmblaCarouselSvelteType["$$_attributes"]>["on:emblaInit"]> extends (evt: CustomEvent<infer CarouselAPI>) => void ? CarouselAPI : never;
|
|
5
|
+
type EmblaCarouselConfig = NonNullable<Parameters<typeof emblaCarouselSvelte>[1]>;
|
|
6
|
+
export type CarouselOptions = EmblaCarouselConfig["options"];
|
|
7
|
+
export type CarouselPlugins = EmblaCarouselConfig["plugins"];
|
|
8
|
+
export type CarouselProps = {
|
|
9
|
+
opts?: CarouselOptions;
|
|
10
|
+
plugins?: CarouselPlugins;
|
|
11
|
+
setApi?: (api: CarouselAPI | undefined) => void;
|
|
12
|
+
orientation?: "horizontal" | "vertical";
|
|
13
|
+
} & WithElementRef<HTMLAttributes<HTMLDivElement>>;
|
|
14
|
+
export type EmblaContext = {
|
|
15
|
+
api: CarouselAPI | undefined;
|
|
16
|
+
orientation: "horizontal" | "vertical";
|
|
17
|
+
scrollNext: () => void;
|
|
18
|
+
scrollPrev: () => void;
|
|
19
|
+
canScrollNext: boolean;
|
|
20
|
+
canScrollPrev: boolean;
|
|
21
|
+
handleKeyDown: (e: KeyboardEvent) => void;
|
|
22
|
+
options: CarouselOptions;
|
|
23
|
+
plugins: CarouselPlugins;
|
|
24
|
+
onInit: (e: CustomEvent<CarouselAPI>) => void;
|
|
25
|
+
scrollTo: (index: number, jump?: boolean) => void;
|
|
26
|
+
scrollSnaps: number[];
|
|
27
|
+
selectedIndex: number;
|
|
28
|
+
};
|
|
29
|
+
export declare function setEmblaContext(config: EmblaContext): EmblaContext;
|
|
30
|
+
export declare function getEmblaContext(name?: string): EmblaContext;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getContext, hasContext, setContext } from "svelte";
|
|
2
|
+
const EMBLA_CAROUSEL_CONTEXT = Symbol("EMBLA_CAROUSEL_CONTEXT");
|
|
3
|
+
export function setEmblaContext(config) {
|
|
4
|
+
setContext(EMBLA_CAROUSEL_CONTEXT, config);
|
|
5
|
+
return config;
|
|
6
|
+
}
|
|
7
|
+
export function getEmblaContext(name = "This component") {
|
|
8
|
+
if (!hasContext(EMBLA_CAROUSEL_CONTEXT)) {
|
|
9
|
+
throw new Error(`${name} must be used within a <Carousel.Root> component`);
|
|
10
|
+
}
|
|
11
|
+
return getContext(EMBLA_CAROUSEL_CONTEXT);
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import Content from "./carousel-content.svelte";
|
|
2
|
+
import Item from "./carousel-item.svelte";
|
|
3
|
+
import Next from "./carousel-next.svelte";
|
|
4
|
+
import Previous from "./carousel-previous.svelte";
|
|
5
|
+
import Root from "./carousel.svelte";
|
|
6
|
+
export { Root, Content, Item, Previous, Next, Root as Carousel, Content as CarouselContent, Item as CarouselItem, Previous as CarouselPrevious, Next as CarouselNext, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Content from "./carousel-content.svelte";
|
|
2
|
+
import Item from "./carousel-item.svelte";
|
|
3
|
+
import Next from "./carousel-next.svelte";
|
|
4
|
+
import Previous from "./carousel-previous.svelte";
|
|
5
|
+
import Root from "./carousel.svelte";
|
|
6
|
+
export { Root, Content, Item, Previous, Next,
|
|
7
|
+
//
|
|
8
|
+
Root as Carousel, Content as CarouselContent, Item as CarouselItem, Previous as CarouselPrevious, Next as CarouselNext, };
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
+
/**
|
|
3
|
+
* An addon component for input groups, used to display labels, icons, or actions
|
|
4
|
+
* adjacent to input fields. Supports inline and block alignment options.
|
|
5
|
+
*
|
|
6
|
+
* @component
|
|
7
|
+
*/
|
|
2
8
|
import { tv, type VariantProps } from 'tailwind-variants';
|
|
3
9
|
export const inputGroupAddonVariants = tv({
|
|
4
10
|
base: "text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An addon component for input groups, used to display labels, icons, or actions
|
|
3
|
+
* adjacent to input fields. Supports inline and block alignment options.
|
|
4
|
+
*
|
|
5
|
+
* @component
|
|
6
|
+
*/
|
|
1
7
|
import { type VariantProps } from 'tailwind-variants';
|
|
2
8
|
export declare const inputGroupAddonVariants: import("tailwind-variants").TVReturnType<{
|
|
3
9
|
align: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
import type {
|
|
2
|
+
import type { ButtonSize } from "../button/button.svelte";
|
|
3
3
|
|
|
4
4
|
export type LightSwitchProps = {
|
|
5
5
|
variant?: "outline" | "ghost";
|
|
6
|
-
size?:
|
|
6
|
+
size?: ButtonSize;
|
|
7
7
|
};
|
|
8
8
|
</script>
|
|
9
9
|
|
|
@@ -11,16 +11,27 @@
|
|
|
11
11
|
import SunIcon from "@lucide/svelte/icons/sun";
|
|
12
12
|
import MoonIcon from "@lucide/svelte/icons/moon";
|
|
13
13
|
import { toggleMode } from "mode-watcher";
|
|
14
|
-
import Button
|
|
14
|
+
import Button from "../button/button.svelte";
|
|
15
15
|
|
|
16
16
|
let { variant = "outline", size = "default" }: LightSwitchProps = $props();
|
|
17
|
+
|
|
18
|
+
const sizeMap = {
|
|
19
|
+
default: "icon",
|
|
20
|
+
xs: "icon-xs",
|
|
21
|
+
sm: "icon-sm",
|
|
22
|
+
lg: "icon-lg",
|
|
23
|
+
icon: "icon",
|
|
24
|
+
"icon-xs": "icon-xs",
|
|
25
|
+
"icon-sm": "icon-sm",
|
|
26
|
+
"icon-lg": "icon-lg",
|
|
27
|
+
};
|
|
17
28
|
</script>
|
|
18
29
|
|
|
19
30
|
<Button
|
|
20
31
|
onclick={toggleMode}
|
|
21
32
|
{variant}
|
|
22
|
-
size={sizeMap[size]
|
|
23
|
-
class="rounded-full bg-input"
|
|
33
|
+
size={sizeMap[size] as ButtonSize}
|
|
34
|
+
class="relative rounded-full bg-input"
|
|
24
35
|
>
|
|
25
36
|
<SunIcon
|
|
26
37
|
class="scale-100 rotate-0 transition-all! dark:scale-0 dark:-rotate-90"
|
|
@@ -29,4 +40,4 @@
|
|
|
29
40
|
class="absolute scale-0 rotate-90 transition-all! dark:scale-100 dark:rotate-0"
|
|
30
41
|
/>
|
|
31
42
|
<span class="sr-only">Toggle theme</span>
|
|
32
|
-
</Button>
|
|
43
|
+
</Button>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ButtonSize } from "../button/button.svelte";
|
|
2
2
|
export type LightSwitchProps = {
|
|
3
3
|
variant?: "outline" | "ghost";
|
|
4
|
-
size?:
|
|
4
|
+
size?: ButtonSize;
|
|
5
5
|
};
|
|
6
6
|
declare const LightSwitch: import("svelte").Component<LightSwitchProps, {}, "">;
|
|
7
7
|
type LightSwitch = ReturnType<typeof LightSwitch>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../../utils.js';
|
|
3
|
+
import StarHalfIcon from '@lucide/svelte/icons/star-half';
|
|
4
|
+
import StarIcon from '@lucide/svelte/icons/star';
|
|
5
|
+
import { RatingGroup } from 'bits-ui';
|
|
6
|
+
import type { StarRatingStarProps } from './types';
|
|
7
|
+
|
|
8
|
+
let { index, state, class: className }: StarRatingStarProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<RatingGroup.Item
|
|
12
|
+
{index}
|
|
13
|
+
class={cn(
|
|
14
|
+
'ring-ring text-primary ring-offset-background group/item size-5 rounded-md ring-offset-2 outline-hidden group-aria-disabled:opacity-50 focus-visible:ring-2',
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
>
|
|
18
|
+
<div class="relative size-full">
|
|
19
|
+
<StarIcon
|
|
20
|
+
class={cn('size-full fill-transparent transition-all', {
|
|
21
|
+
'fill-current': state === 'active'
|
|
22
|
+
})}
|
|
23
|
+
/>
|
|
24
|
+
<StarHalfIcon
|
|
25
|
+
class={cn(
|
|
26
|
+
'absolute top-0 left-0 size-full fill-transparent transition-all group-data-[state=active]/item:fill-current',
|
|
27
|
+
{
|
|
28
|
+
'ltr:fill-current': state === 'partial'
|
|
29
|
+
}
|
|
30
|
+
)}
|
|
31
|
+
/>
|
|
32
|
+
<StarHalfIcon
|
|
33
|
+
class={cn(
|
|
34
|
+
'absolute top-0 right-0 size-full scale-x-[-1] fill-transparent transition-all group-data-[state=active]/item:fill-current',
|
|
35
|
+
{
|
|
36
|
+
'rtl:fill-current': state === 'partial'
|
|
37
|
+
}
|
|
38
|
+
)}
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
</RatingGroup.Item>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../../utils.js';
|
|
3
|
+
import { RatingGroup, type RatingGroupRootProps } from 'bits-ui';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
value = $bindable(0),
|
|
7
|
+
max = 5,
|
|
8
|
+
orientation = 'horizontal',
|
|
9
|
+
class: className,
|
|
10
|
+
...rest
|
|
11
|
+
}: RatingGroupRootProps = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<RatingGroup.Root
|
|
15
|
+
class={cn('group flex w-fit place-items-center gap-1 rounded-md outline-hidden', className)}
|
|
16
|
+
bind:value
|
|
17
|
+
{max}
|
|
18
|
+
{orientation}
|
|
19
|
+
{...rest}
|
|
20
|
+
/>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|