negodesign 0.0.56 → 0.0.57
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/core/banner/AdCardBanner.svelte +74 -74
- package/dist/components/core/banner/CtaCardBanner.svelte +118 -118
- package/dist/components/core/breadcrumb/breadcrumb-list.svelte +31 -31
- package/dist/components/core/button/ButtonBack.svelte +18 -18
- package/dist/components/core/button/ButtonLogin.svelte +15 -15
- package/dist/components/core/button/ButtonLoginWith.svelte +57 -57
- package/dist/components/core/button/ButtonSend.svelte +15 -15
- package/dist/components/core/card/highlight/01/CardHighlight01.svelte +103 -103
- package/dist/components/core/card/highlight/02/CardHighlight02.svelte +99 -99
- package/dist/components/core/card/highlight/CardHighlight.svelte +22 -22
- package/dist/components/core/card/media/01/CardMedia01.svelte +133 -133
- package/dist/components/core/card/media/02/CardMedia02.svelte +127 -127
- package/dist/components/core/card/media/CardMedia.svelte +18 -18
- package/dist/components/core/card/product/01/CardProduct01.svelte +136 -136
- package/dist/components/core/card/product/02/CardProduct02.svelte +124 -124
- package/dist/components/core/card/product/CardProduct.svelte +22 -22
- package/dist/components/core/card/profile/01/CardProfile01.svelte +134 -134
- package/dist/components/core/card/profile/02/CardProfile02.svelte +132 -132
- package/dist/components/core/card/profile/CardProfile.svelte +18 -18
- package/dist/components/core/card/promotion/CardPromotion.svelte +139 -139
- package/dist/components/core/card/promotion/CardPromotionPrice.svelte +32 -32
- package/dist/components/core/card/shared/CardButton.svelte +42 -42
- package/dist/components/core/card/shared/CardCart.svelte +36 -36
- package/dist/components/core/card/shared/CardDescription.svelte +41 -41
- package/dist/components/core/card/shared/CardFavorite.svelte +33 -33
- package/dist/components/core/card/shared/CardLogo.svelte +19 -19
- package/dist/components/core/card/shared/CardPhoneOrWhatsapp.svelte +45 -45
- package/dist/components/core/card/shared/CardStarRating.svelte +24 -24
- package/dist/components/core/card/shared/CardTags.svelte +95 -95
- package/dist/components/core/card/shared/CardThumbnailVideo.svelte +232 -232
- package/dist/components/core/card/shared/CardTitlePrice.svelte +24 -24
- package/dist/components/core/card/shared/TruncatableText.svelte +49 -49
- package/dist/components/core/card/types.d.ts +4 -0
- package/dist/components/core/carousel/badge/type.d.ts +27 -0
- package/dist/components/core/carousel/badge/ui/CarouselBadge.svelte +109 -109
- package/dist/components/core/carousel/grid/media/types.d.ts +3 -0
- package/dist/components/core/carousel/grid/media/ui/CarouselGridMedia.svelte +2 -1
- package/dist/components/core/carousel/grid/product/types.d.ts +3 -0
- package/dist/components/core/carousel/grid/product/ui/CarouselGridProduct.svelte +5 -4
- package/dist/components/core/carousel/grid/profile/ui/CarouselGridProfile.svelte +1 -1
- package/dist/components/core/carousel/grid/promotion/ui/CarouselGridPromotion.svelte +1 -1
- package/dist/components/core/carousel/grid/shared/ui/CarouselGridSlot.svelte +8 -3
- package/dist/components/core/carousel/grid/shared/ui/CarouselGridSlot.svelte.d.ts +2 -1
- package/dist/components/core/carousel/hero/types.d.ts +30 -0
- package/dist/components/core/carousel/hero/{CarouselHero.svelte → ui/CarouselHero.svelte} +163 -161
- package/dist/components/core/carousel/shared/ui/CarouselHeader.svelte +60 -60
- package/dist/components/core/carousel/types.d.ts +2 -56
- package/dist/components/core/datatable/ui/DataTableActions.svelte +28 -28
- package/dist/components/core/datatable/ui/DataTableCheckbox.svelte +22 -22
- package/dist/components/core/datatable/ui/DataTableContent.svelte +59 -59
- package/dist/components/core/datatable/ui/DataTableCore.svelte +151 -151
- package/dist/components/core/datatable/ui/DataTableDragHandle.svelte +8 -8
- package/dist/components/core/datatable/ui/DataTableListFilter.svelte +59 -59
- package/dist/components/core/datatable/ui/DataTableListPagination.svelte +35 -35
- package/dist/components/core/footer/ui/Footer.svelte +18 -18
- package/dist/components/core/form/ui/input-base.svelte +81 -81
- package/dist/components/core/form/ui/input-email-or-phone.svelte +23 -23
- package/dist/components/core/form/ui/input-email.svelte +23 -23
- package/dist/components/core/form/ui/input-password-confirm.svelte +23 -23
- package/dist/components/core/form/ui/input-password.svelte +23 -23
- package/dist/components/core/form/ui/input-phone.svelte +33 -33
- package/dist/components/core/form/ui/input-username.svelte +22 -22
- package/dist/components/core/grid/data/types.d.ts +16 -0
- package/dist/components/core/grid/ui/01/Grid01.svelte +27 -0
- package/dist/components/core/grid/ui/01/Grid01.svelte.d.ts +4 -0
- package/dist/components/core/grid/ui/02/Grid02.svelte +27 -0
- package/dist/components/core/grid/ui/02/Grid02.svelte.d.ts +4 -0
- package/dist/components/core/grid/ui/PanelGrid.svelte +27 -0
- package/dist/components/core/grid/ui/PanelGrid.svelte.d.ts +4 -0
- package/dist/components/core/grid/ui/SimpleGrid.svelte +35 -0
- package/dist/components/core/grid/ui/SimpleGrid.svelte.d.ts +4 -0
- package/dist/components/core/grid/ui/shared/DescriptionGrid.svelte +17 -0
- package/dist/components/core/grid/ui/shared/DescriptionGrid.svelte.d.ts +7 -0
- package/dist/components/core/grid/ui/shared/IconRenderGrid.svelte +16 -0
- package/dist/components/core/grid/ui/shared/IconRenderGrid.svelte.d.ts +7 -0
- package/dist/components/core/grid/ui/shared/TitleGrid.svelte +11 -0
- package/dist/components/core/grid/ui/shared/TitleGrid.svelte.d.ts +7 -0
- package/dist/components/core/hero/SimpleHero.svelte +65 -65
- package/dist/components/core/label/LabelOr.svelte +25 -25
- package/dist/components/core/link/link-forget-password.svelte +12 -12
- package/dist/components/core/link/link-privacy-polity.svelte +12 -12
- package/dist/components/core/link/link-terms-of-service.svelte +12 -12
- package/dist/components/core/nav/data/complex-menu-utils.d.ts +7 -0
- package/dist/components/core/nav/data/complex-menu-utils.js +15 -0
- package/dist/components/core/nav/data/nav-menu.d.ts +21 -7
- package/dist/components/core/nav/{ui/shared → data}/types.d.ts +15 -2
- package/dist/components/core/nav/ui/ComplexMenu.svelte +36 -0
- package/dist/components/core/nav/ui/ComplexMenu.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/Menu.svelte +70 -66
- package/dist/components/core/nav/ui/Menu.svelte.d.ts +1 -1
- package/dist/components/core/nav/ui/SimpleMenu.svelte +14 -0
- package/dist/components/core/nav/ui/SimpleMenu.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/mobile/ComplexMenuMobile.svelte +98 -0
- package/dist/components/core/nav/ui/mobile/ComplexMenuMobile.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/mobile/MenuMobile.svelte +54 -0
- package/dist/components/core/nav/ui/mobile/MenuMobile.svelte.d.ts +11 -0
- package/dist/components/core/nav/ui/mobile/SimpleMenuMobile.svelte +42 -0
- package/dist/components/core/nav/ui/mobile/{nav-menu-drawer.svelte.d.ts → SimpleMenuMobile.svelte.d.ts} +3 -3
- package/dist/components/core/nav/ui/shared/CollapsibleNavMenu.svelte +24 -0
- package/dist/components/core/nav/ui/shared/CollapsibleNavMenu.svelte.d.ts +8 -0
- package/dist/components/core/nav/ui/shared/MenuButton.svelte +51 -0
- package/dist/components/core/nav/ui/shared/MenuButton.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/MenuLinks.svelte +40 -40
- package/dist/components/core/nav/ui/shared/MenuListItem.svelte +48 -48
- package/dist/components/core/nav/ui/shared/MenuListItem.svelte.d.ts +1 -1
- package/dist/components/core/nav/ui/shared/MenuLogo.svelte +13 -0
- package/dist/components/core/nav/ui/shared/MenuLogo.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/NavMenuItem.svelte +28 -0
- package/dist/components/core/nav/ui/shared/NavMenuItem.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/dropdown/DropdownMenuListItem.svelte +40 -0
- package/dist/components/core/nav/ui/shared/dropdown/DropdownMenuListItem.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/dropdown/DropdownNavigationMenuItem.svelte +12 -0
- package/dist/components/core/nav/ui/shared/dropdown/DropdownNavigationMenuItem.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/dropdown/DropdownNavigationMenuItemCard.svelte +49 -0
- package/dist/components/core/nav/ui/shared/dropdown/DropdownNavigationMenuItemCard.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/dropdown/DropdownNavigationMenuItemGrid.svelte +30 -0
- package/dist/components/core/nav/ui/shared/dropdown/DropdownNavigationMenuItemGrid.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/dropdown/DropdownNavigationMenuItemList.svelte +24 -0
- package/dist/components/core/nav/ui/shared/dropdown/DropdownNavigationMenuItemList.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/dropdown/DropdownNavigationMenuItems.svelte +24 -0
- package/dist/components/core/nav/ui/shared/dropdown/DropdownNavigationMenuItems.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/{NavigationMenuItem.svelte → navigation/NavigationMenuItem.svelte} +15 -15
- package/dist/components/core/nav/ui/shared/{NavigationMenuItem.svelte.d.ts → navigation/NavigationMenuItem.svelte.d.ts} +1 -1
- package/dist/components/core/nav/ui/shared/{NavigationMenuItemCard.svelte → navigation/NavigationMenuItemCard.svelte} +62 -62
- package/dist/components/core/nav/ui/shared/{NavigationMenuItemCard.svelte.d.ts → navigation/NavigationMenuItemCard.svelte.d.ts} +1 -1
- package/dist/components/core/nav/ui/shared/{NavigationMenuItemGrid.svelte → navigation/NavigationMenuItemGrid.svelte} +32 -32
- package/dist/components/core/nav/ui/shared/{NavigationMenuItemGrid.svelte.d.ts → navigation/NavigationMenuItemGrid.svelte.d.ts} +1 -1
- package/dist/components/core/nav/ui/shared/{NavigationMenuItemList.svelte → navigation/NavigationMenuItemList.svelte} +24 -24
- package/dist/components/core/nav/ui/shared/{NavigationMenuItemList.svelte.d.ts → navigation/NavigationMenuItemList.svelte.d.ts} +1 -1
- package/dist/components/core/nav/ui/shared/{NavigationMenuItems.svelte → navigation/NavigationMenuItems.svelte} +21 -21
- package/dist/components/core/nav/ui/shared/{NavigationMenuItems.svelte.d.ts → navigation/NavigationMenuItems.svelte.d.ts} +1 -1
- package/dist/components/core/panel/CarouselSlot.svelte +57 -57
- package/dist/components/core/panel/LeftHero.svelte +117 -117
- package/dist/components/core/search/SearchInput.svelte +32 -32
- package/dist/components/core/search/shared/SearchInputCore.svelte +66 -66
- package/dist/components/core/sidebar/MenuBarSidebar.svelte +70 -70
- package/dist/components/core/sidebar/MenuBarSidebar.svelte.d.ts +2 -2
- package/dist/components/core/sidebar/data/nav-menu-sidebar.js +1 -0
- package/dist/components/core/sidebar/data/nav-top-bar-sidebar.js +1 -0
- package/dist/components/core/sidebar/data/nav-user-sidebar.js +1 -0
- package/dist/components/core/sidebar/types.d.ts +2 -2
- package/dist/components/core/sidebar/ui/navbar/NavMenuBarSidebar.svelte +97 -97
- package/dist/components/core/sidebar/ui/navbar/NavMenuBarSidebar.svelte.d.ts +1 -1
- package/dist/components/core/sidebar/ui/navbar/NavMenuBottomSidebar.svelte +33 -33
- package/dist/components/core/sidebar/ui/navbar/NavMenuBottomSidebar.svelte.d.ts +1 -1
- package/dist/components/core/sidebar/ui/navbar/NavMenuTopBarSidebar.svelte +103 -103
- package/dist/components/core/sidebar/ui/navbar/NavMenuTopBarSidebar.svelte.d.ts +1 -1
- package/dist/components/core/tabs/ui/tab-underline.svelte +43 -43
- package/dist/components/pages/admin/01/ui/AdminContent.svelte +14 -14
- package/dist/components/pages/admin/01/ui/AdminPanel.svelte +46 -46
- package/dist/components/pages/privacy-policy-or-terms-of-use/types.d.ts +2 -0
- package/dist/components/pages/security/login/01/ui/FormRegister.svelte +28 -28
- package/dist/components/pages/security/login/01/ui/LoginCard.svelte +107 -107
- package/dist/components/pages/security/login/PageLogin.svelte +22 -22
- package/dist/components/ui/badge/badge.svelte +49 -49
- package/dist/components/ui/button/button.svelte +82 -82
- package/dist/components/ui/chart/chart-container.svelte +80 -80
- package/dist/components/ui/chart/chart-style.svelte +37 -37
- package/dist/components/ui/chart/chart-tooltip.svelte +184 -184
- package/dist/components/ui/checkbox/checkbox.svelte +40 -40
- package/dist/components/ui/data-table/flex-render.svelte +40 -40
- package/dist/components/ui/drawer/drawer-close.svelte +7 -7
- package/dist/components/ui/drawer/drawer-content.svelte +33 -33
- package/dist/components/ui/drawer/drawer-description.svelte +17 -17
- package/dist/components/ui/drawer/drawer-footer.svelte +20 -20
- package/dist/components/ui/drawer/drawer-header.svelte +20 -20
- package/dist/components/ui/drawer/drawer-nested.svelte +12 -12
- package/dist/components/ui/drawer/drawer-overlay.svelte +17 -17
- package/dist/components/ui/drawer/drawer-portal.svelte +7 -7
- package/dist/components/ui/drawer/drawer-title.svelte +17 -17
- package/dist/components/ui/drawer/drawer-trigger.svelte +7 -7
- package/dist/components/ui/drawer/drawer.svelte +12 -12
- package/dist/components/ui/select/select-content.svelte +45 -45
- package/dist/components/ui/select/select-group-heading.svelte +21 -21
- package/dist/components/ui/select/select-group.svelte +17 -17
- package/dist/components/ui/select/select-item.svelte +41 -41
- package/dist/components/ui/select/select-label.svelte +20 -20
- package/dist/components/ui/select/select-portal.svelte +7 -7
- package/dist/components/ui/select/select-scroll-down-button.svelte +21 -21
- package/dist/components/ui/select/select-scroll-up-button.svelte +21 -21
- package/dist/components/ui/select/select-separator.svelte +18 -18
- package/dist/components/ui/select/select-trigger.svelte +30 -30
- package/dist/components/ui/select/select.svelte +11 -11
- package/dist/components/ui/sidebar/sidebar-menu-sub-button.svelte +39 -39
- package/dist/components/ui/star-rating/star-rating-star.svelte +41 -41
- package/dist/components/ui/star-rating/star-rating.svelte +20 -20
- package/dist/components/ui/table/table-body.svelte +15 -15
- package/dist/components/ui/table/table-caption.svelte +20 -20
- package/dist/components/ui/table/table-cell.svelte +15 -15
- package/dist/components/ui/table/table-footer.svelte +20 -20
- package/dist/components/ui/table/table-head.svelte +15 -15
- package/dist/components/ui/table/table-header.svelte +20 -20
- package/dist/components/ui/table/table-row.svelte +15 -15
- package/dist/components/ui/table/table.svelte +17 -17
- package/dist/components/ui/tabs/tabs-content.svelte +17 -17
- package/dist/components/ui/tabs/tabs-list.svelte +40 -40
- package/dist/components/ui/tabs/tabs-trigger.svelte +23 -23
- package/dist/components/ui/tabs/tabs.svelte +19 -19
- package/dist/globals.css +56 -2
- package/dist/index.d.ts +1 -8
- package/dist/index.js +1 -8
- package/dist/styles/globals.css +149 -149
- package/dist/styles/hgi-stroke-rounded.css +1 -1
- package/dist/types/index.d.ts +9 -7
- package/package.json +113 -113
- package/dist/components/core/nav/ui/NavMenu.svelte +0 -122
- package/dist/components/core/nav/ui/NavMenu.svelte.d.ts +0 -4
- package/dist/components/core/nav/ui/mobile/nav-menu-drawer.svelte +0 -85
- package/dist/components/core/{nav/data/nav-menu-sidebar.js → carousel/badge/type.js} +0 -0
- package/dist/components/core/{nav/ui/shared → carousel/hero}/types.js +0 -0
- package/dist/components/core/carousel/hero/{CarouselHero.svelte.d.ts → ui/CarouselHero.svelte.d.ts} +1 -1
- /package/dist/components/core/{nav/data/nav-top-bar-sidebar.js → grid/data/types.js} +0 -0
- /package/dist/components/core/nav/data/{nav-user-sidebar.js → types.js} +0 -0
- /package/dist/components/core/{nav → sidebar}/data/nav-menu-sidebar.d.ts +0 -0
- /package/dist/components/core/{nav → sidebar}/data/nav-top-bar-sidebar.d.ts +0 -0
- /package/dist/components/core/{nav → sidebar}/data/nav-user-sidebar.d.ts +0 -0
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
3
|
-
import Button from "../../ui/button/button.svelte";
|
|
4
|
-
import type { BannerProps } from "./types";
|
|
5
|
-
import { AdvertisimentIcon } from "@hugeicons/core-free-icons";
|
|
6
|
-
|
|
7
|
-
let {
|
|
8
|
-
tagText,
|
|
9
|
-
titleHighlight,
|
|
10
|
-
titleMain,
|
|
11
|
-
buttonText = "Saiba mais",
|
|
12
|
-
onClickButton,
|
|
13
|
-
href,
|
|
14
|
-
class: className = "",
|
|
15
|
-
titleHighlightClass,
|
|
16
|
-
titleMainClass,
|
|
17
|
-
tagTextClass,
|
|
18
|
-
buttonClass,
|
|
19
|
-
titleBgClass,
|
|
20
|
-
tagBgClass,
|
|
21
|
-
}: BannerProps = $props();
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
{#snippet content()}
|
|
25
|
-
<article
|
|
26
|
-
class="relative flex w-full items-stretch overflow-hidden rounded-lg border border-transparent {className}"
|
|
27
|
-
>
|
|
28
|
-
<!-- Left accent strip -->
|
|
29
|
-
<aside
|
|
30
|
-
class="flex w-28 shrink-0 flex-col justify-center gap-1 {tagBgClass ||
|
|
31
|
-
'bg-blue-400'} px-3 py-2 sm:w-32"
|
|
32
|
-
>
|
|
33
|
-
<HugeiconsIcon
|
|
34
|
-
icon={AdvertisimentIcon}
|
|
35
|
-
size={30}
|
|
36
|
-
color="#ffffff"
|
|
37
|
-
strokeWidth={1}
|
|
38
|
-
/>
|
|
39
|
-
<p
|
|
40
|
-
class={`text-sm leading-tight font-bold ${tagTextClass || "text-[#dce9e7]"}`}
|
|
41
|
-
>
|
|
42
|
-
{tagText}
|
|
43
|
-
</p>
|
|
44
|
-
</aside>
|
|
45
|
-
|
|
46
|
-
<!-- Main content -->
|
|
47
|
-
<div
|
|
48
|
-
class="flex flex-1 flex-wrap items-center justify-between gap-3 {titleBgClass ||
|
|
49
|
-
'bg-[#dabc16]'} px-4 py-3 sm:px-6"
|
|
50
|
-
>
|
|
51
|
-
<h3 class="text-lg font-extrabold tracking-tight sm:text-2xl">
|
|
52
|
-
<span class="{titleHighlightClass || 'text-white'} pr-2"
|
|
53
|
-
>{titleHighlight}</span
|
|
54
|
-
>
|
|
55
|
-
<span class={titleMainClass || "text-gray-200"}>{titleMain}</span>
|
|
56
|
-
</h3>
|
|
57
|
-
|
|
58
|
-
<Button
|
|
59
|
-
onclick={() => onClickButton?.()}
|
|
60
|
-
class="shrink-0 rounded-md bg-white px-4 py-2 text-sm font-medium text-indigo-600 hover:bg-white/90 {buttonClass}"
|
|
61
|
-
>
|
|
62
|
-
{buttonText}
|
|
63
|
-
</Button>
|
|
64
|
-
</div>
|
|
65
|
-
</article>
|
|
66
|
-
{/snippet}
|
|
67
|
-
|
|
68
|
-
{#if href}
|
|
69
|
-
<a {href} class="block">
|
|
70
|
-
{@render content()}
|
|
71
|
-
</a>
|
|
72
|
-
{:else}
|
|
73
|
-
{@render content()}
|
|
74
|
-
{/if}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
3
|
+
import Button from "../../ui/button/button.svelte";
|
|
4
|
+
import type { BannerProps } from "./types";
|
|
5
|
+
import { AdvertisimentIcon } from "@hugeicons/core-free-icons";
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
tagText,
|
|
9
|
+
titleHighlight,
|
|
10
|
+
titleMain,
|
|
11
|
+
buttonText = "Saiba mais",
|
|
12
|
+
onClickButton,
|
|
13
|
+
href,
|
|
14
|
+
class: className = "",
|
|
15
|
+
titleHighlightClass,
|
|
16
|
+
titleMainClass,
|
|
17
|
+
tagTextClass,
|
|
18
|
+
buttonClass,
|
|
19
|
+
titleBgClass,
|
|
20
|
+
tagBgClass,
|
|
21
|
+
}: BannerProps = $props();
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
{#snippet content()}
|
|
25
|
+
<article
|
|
26
|
+
class="relative flex w-full items-stretch overflow-hidden rounded-lg border border-transparent {className}"
|
|
27
|
+
>
|
|
28
|
+
<!-- Left accent strip -->
|
|
29
|
+
<aside
|
|
30
|
+
class="flex w-28 shrink-0 flex-col justify-center gap-1 {tagBgClass ||
|
|
31
|
+
'bg-blue-400'} px-3 py-2 sm:w-32"
|
|
32
|
+
>
|
|
33
|
+
<HugeiconsIcon
|
|
34
|
+
icon={AdvertisimentIcon}
|
|
35
|
+
size={30}
|
|
36
|
+
color="#ffffff"
|
|
37
|
+
strokeWidth={1}
|
|
38
|
+
/>
|
|
39
|
+
<p
|
|
40
|
+
class={`text-sm leading-tight font-bold ${tagTextClass || "text-[#dce9e7]"}`}
|
|
41
|
+
>
|
|
42
|
+
{tagText}
|
|
43
|
+
</p>
|
|
44
|
+
</aside>
|
|
45
|
+
|
|
46
|
+
<!-- Main content -->
|
|
47
|
+
<div
|
|
48
|
+
class="flex flex-1 flex-wrap items-center justify-between gap-3 {titleBgClass ||
|
|
49
|
+
'bg-[#dabc16]'} px-4 py-3 sm:px-6"
|
|
50
|
+
>
|
|
51
|
+
<h3 class="text-lg font-extrabold tracking-tight sm:text-2xl">
|
|
52
|
+
<span class="{titleHighlightClass || 'text-white'} pr-2"
|
|
53
|
+
>{titleHighlight}</span
|
|
54
|
+
>
|
|
55
|
+
<span class={titleMainClass || "text-gray-200"}>{titleMain}</span>
|
|
56
|
+
</h3>
|
|
57
|
+
|
|
58
|
+
<Button
|
|
59
|
+
onclick={() => onClickButton?.()}
|
|
60
|
+
class="shrink-0 rounded-md bg-white px-4 py-2 text-sm font-medium text-indigo-600 hover:bg-white/90 {buttonClass}"
|
|
61
|
+
>
|
|
62
|
+
{buttonText}
|
|
63
|
+
</Button>
|
|
64
|
+
</div>
|
|
65
|
+
</article>
|
|
66
|
+
{/snippet}
|
|
67
|
+
|
|
68
|
+
{#if href}
|
|
69
|
+
<a {href} class="block">
|
|
70
|
+
{@render content()}
|
|
71
|
+
</a>
|
|
72
|
+
{:else}
|
|
73
|
+
{@render content()}
|
|
74
|
+
{/if}
|
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { CtaCardBannerProps } from "./types";
|
|
3
|
-
|
|
4
|
-
let {
|
|
5
|
-
title,
|
|
6
|
-
description,
|
|
7
|
-
primaryText,
|
|
8
|
-
secondaryText,
|
|
9
|
-
onClickPrimary,
|
|
10
|
-
onClickSecondary,
|
|
11
|
-
primaryHref,
|
|
12
|
-
secondaryHref,
|
|
13
|
-
class: className = "",
|
|
14
|
-
rings: customRings = [],
|
|
15
|
-
}: CtaCardBannerProps = $props();
|
|
16
|
-
|
|
17
|
-
// Painter's-algorithm rings: largest/darkest first, smallest/lightest last.
|
|
18
|
-
const rings = $derived(
|
|
19
|
-
customRings && customRings.length > 0
|
|
20
|
-
? customRings
|
|
21
|
-
: [
|
|
22
|
-
{ size: 920, color: "#2563EB" },
|
|
23
|
-
{ size: 760, color: "#3B76ED" },
|
|
24
|
-
{ size: 610, color: "#548BF0" },
|
|
25
|
-
{ size: 470, color: "#7FA6F3" },
|
|
26
|
-
{ size: 340, color: "#A9C2F6" },
|
|
27
|
-
{ size: 220, color: "#CFDEFA" },
|
|
28
|
-
{ size: 110, color: "#EEF3FD" },
|
|
29
|
-
],
|
|
30
|
-
);
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
|
-
{#snippet pill(
|
|
34
|
-
label: string,
|
|
35
|
-
onClick: (() => void) | undefined,
|
|
36
|
-
href: string | undefined,
|
|
37
|
-
)}
|
|
38
|
-
{#snippet inner()}
|
|
39
|
-
<span class="whitespace-nowrap">{label}</span>
|
|
40
|
-
<span
|
|
41
|
-
class="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-white"
|
|
42
|
-
>
|
|
43
|
-
<svg
|
|
44
|
-
width="12"
|
|
45
|
-
height="12"
|
|
46
|
-
viewBox="0 0 24 24"
|
|
47
|
-
fill="none"
|
|
48
|
-
stroke="#111"
|
|
49
|
-
stroke-width="2.2"
|
|
50
|
-
stroke-linecap="round"
|
|
51
|
-
stroke-linejoin="round"
|
|
52
|
-
aria-hidden="true"
|
|
53
|
-
>
|
|
54
|
-
<path d="M7 17 L17 7" />
|
|
55
|
-
<path d="M8 7 L17 7 L17 16" />
|
|
56
|
-
</svg>
|
|
57
|
-
</span>
|
|
58
|
-
{/snippet}
|
|
59
|
-
|
|
60
|
-
{#if href}
|
|
61
|
-
<a
|
|
62
|
-
{href}
|
|
63
|
-
class="inline-flex items-center gap-3 rounded-full bg-neutral-900 py-3 pr-2 pl-5 text-sm font-medium text-white transition-colors hover:bg-neutral-800"
|
|
64
|
-
>
|
|
65
|
-
{@render inner()}
|
|
66
|
-
</a>
|
|
67
|
-
{:else}
|
|
68
|
-
<button
|
|
69
|
-
type="button"
|
|
70
|
-
onclick={() => onClick?.()}
|
|
71
|
-
class="inline-flex items-center gap-3 rounded-full bg-neutral-900 py-3 pr-2 pl-5 text-sm font-medium text-white transition-colors hover:bg-neutral-800"
|
|
72
|
-
>
|
|
73
|
-
{@render inner()}
|
|
74
|
-
</button>
|
|
75
|
-
{/if}
|
|
76
|
-
{/snippet}
|
|
77
|
-
|
|
78
|
-
<article
|
|
79
|
-
class="relative isolate overflow-hidden rounded-lg bg-gradient p-1 shadow-sm {className}"
|
|
80
|
-
>
|
|
81
|
-
<div
|
|
82
|
-
class="relative overflow-hidden rounded-[1.35rem] px-6 py-10 sm:px-10 sm:py-12"
|
|
83
|
-
>
|
|
84
|
-
<!-- Concentric ring decoration -->
|
|
85
|
-
<div class="pointer-events-none absolute inset-0 -z-10" aria-hidden="true">
|
|
86
|
-
{#each rings as ring (ring.size)}
|
|
87
|
-
<div
|
|
88
|
-
class="absolute top-1/2 right-0 rounded-full"
|
|
89
|
-
style="
|
|
90
|
-
width: {ring.size}px;
|
|
91
|
-
height: {ring.size}px;
|
|
92
|
-
background: {ring.color};
|
|
93
|
-
transform: translate(45%, -50%);
|
|
94
|
-
"
|
|
95
|
-
></div>
|
|
96
|
-
{/each}
|
|
97
|
-
</div>
|
|
98
|
-
|
|
99
|
-
<div class="relative z-10 max-w-md">
|
|
100
|
-
<h2 class="text-3xl font-extrabold text-white sm:text-4xl">
|
|
101
|
-
{title}
|
|
102
|
-
</h2>
|
|
103
|
-
|
|
104
|
-
{#if description}
|
|
105
|
-
<p class="mt-3 text-sm leading-relaxed text-white/85 sm:text-base">
|
|
106
|
-
{description}
|
|
107
|
-
</p>
|
|
108
|
-
{/if}
|
|
109
|
-
|
|
110
|
-
<div class="mt-7 flex flex-wrap items-center gap-3">
|
|
111
|
-
{@render pill(primaryText, onClickPrimary, primaryHref)}
|
|
112
|
-
{#if secondaryText}
|
|
113
|
-
{@render pill(secondaryText, onClickSecondary, secondaryHref)}
|
|
114
|
-
{/if}
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
</article>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { CtaCardBannerProps } from "./types";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
title,
|
|
6
|
+
description,
|
|
7
|
+
primaryText,
|
|
8
|
+
secondaryText,
|
|
9
|
+
onClickPrimary,
|
|
10
|
+
onClickSecondary,
|
|
11
|
+
primaryHref,
|
|
12
|
+
secondaryHref,
|
|
13
|
+
class: className = "",
|
|
14
|
+
rings: customRings = [],
|
|
15
|
+
}: CtaCardBannerProps = $props();
|
|
16
|
+
|
|
17
|
+
// Painter's-algorithm rings: largest/darkest first, smallest/lightest last.
|
|
18
|
+
const rings = $derived(
|
|
19
|
+
customRings && customRings.length > 0
|
|
20
|
+
? customRings
|
|
21
|
+
: [
|
|
22
|
+
{ size: 920, color: "#2563EB" },
|
|
23
|
+
{ size: 760, color: "#3B76ED" },
|
|
24
|
+
{ size: 610, color: "#548BF0" },
|
|
25
|
+
{ size: 470, color: "#7FA6F3" },
|
|
26
|
+
{ size: 340, color: "#A9C2F6" },
|
|
27
|
+
{ size: 220, color: "#CFDEFA" },
|
|
28
|
+
{ size: 110, color: "#EEF3FD" },
|
|
29
|
+
],
|
|
30
|
+
);
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
{#snippet pill(
|
|
34
|
+
label: string,
|
|
35
|
+
onClick: (() => void) | undefined,
|
|
36
|
+
href: string | undefined,
|
|
37
|
+
)}
|
|
38
|
+
{#snippet inner()}
|
|
39
|
+
<span class="whitespace-nowrap">{label}</span>
|
|
40
|
+
<span
|
|
41
|
+
class="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-white"
|
|
42
|
+
>
|
|
43
|
+
<svg
|
|
44
|
+
width="12"
|
|
45
|
+
height="12"
|
|
46
|
+
viewBox="0 0 24 24"
|
|
47
|
+
fill="none"
|
|
48
|
+
stroke="#111"
|
|
49
|
+
stroke-width="2.2"
|
|
50
|
+
stroke-linecap="round"
|
|
51
|
+
stroke-linejoin="round"
|
|
52
|
+
aria-hidden="true"
|
|
53
|
+
>
|
|
54
|
+
<path d="M7 17 L17 7" />
|
|
55
|
+
<path d="M8 7 L17 7 L17 16" />
|
|
56
|
+
</svg>
|
|
57
|
+
</span>
|
|
58
|
+
{/snippet}
|
|
59
|
+
|
|
60
|
+
{#if href}
|
|
61
|
+
<a
|
|
62
|
+
{href}
|
|
63
|
+
class="inline-flex items-center gap-3 rounded-full bg-neutral-900 py-3 pr-2 pl-5 text-sm font-medium text-white transition-colors hover:bg-neutral-800"
|
|
64
|
+
>
|
|
65
|
+
{@render inner()}
|
|
66
|
+
</a>
|
|
67
|
+
{:else}
|
|
68
|
+
<button
|
|
69
|
+
type="button"
|
|
70
|
+
onclick={() => onClick?.()}
|
|
71
|
+
class="inline-flex items-center gap-3 rounded-full bg-neutral-900 py-3 pr-2 pl-5 text-sm font-medium text-white transition-colors hover:bg-neutral-800"
|
|
72
|
+
>
|
|
73
|
+
{@render inner()}
|
|
74
|
+
</button>
|
|
75
|
+
{/if}
|
|
76
|
+
{/snippet}
|
|
77
|
+
|
|
78
|
+
<article
|
|
79
|
+
class="relative isolate overflow-hidden rounded-lg bg-gradient p-1 shadow-sm {className}"
|
|
80
|
+
>
|
|
81
|
+
<div
|
|
82
|
+
class="relative overflow-hidden rounded-[1.35rem] px-6 py-10 sm:px-10 sm:py-12"
|
|
83
|
+
>
|
|
84
|
+
<!-- Concentric ring decoration -->
|
|
85
|
+
<div class="pointer-events-none absolute inset-0 -z-10" aria-hidden="true">
|
|
86
|
+
{#each rings as ring (ring.size)}
|
|
87
|
+
<div
|
|
88
|
+
class="absolute top-1/2 right-0 rounded-full"
|
|
89
|
+
style="
|
|
90
|
+
width: {ring.size}px;
|
|
91
|
+
height: {ring.size}px;
|
|
92
|
+
background: {ring.color};
|
|
93
|
+
transform: translate(45%, -50%);
|
|
94
|
+
"
|
|
95
|
+
></div>
|
|
96
|
+
{/each}
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div class="relative z-10 max-w-md">
|
|
100
|
+
<h2 class="text-3xl font-extrabold text-white sm:text-4xl">
|
|
101
|
+
{title}
|
|
102
|
+
</h2>
|
|
103
|
+
|
|
104
|
+
{#if description}
|
|
105
|
+
<p class="mt-3 text-sm leading-relaxed text-white/85 sm:text-base">
|
|
106
|
+
{description}
|
|
107
|
+
</p>
|
|
108
|
+
{/if}
|
|
109
|
+
|
|
110
|
+
<div class="mt-7 flex flex-wrap items-center gap-3">
|
|
111
|
+
{@render pill(primaryText, onClickPrimary, primaryHref)}
|
|
112
|
+
{#if secondaryText}
|
|
113
|
+
{@render pill(secondaryText, onClickSecondary, secondaryHref)}
|
|
114
|
+
{/if}
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</article>
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import * as Breadcrumb from "../../ui/breadcrumb/index.js";
|
|
3
|
-
|
|
4
|
-
type Props = {
|
|
5
|
-
items: {
|
|
6
|
-
url?: string;
|
|
7
|
-
label: string;
|
|
8
|
-
}[];
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
let { items }: Props = $props();
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<Breadcrumb.Root>
|
|
15
|
-
<Breadcrumb.List>
|
|
16
|
-
{#each items as item, i (item.label)}
|
|
17
|
-
{@const isLast = i === items.length - 1}
|
|
18
|
-
|
|
19
|
-
<Breadcrumb.Item class={isLast ? "" : "hidden md:block"}>
|
|
20
|
-
{#if isLast}
|
|
21
|
-
<Breadcrumb.Page>{item.label}</Breadcrumb.Page>
|
|
22
|
-
{:else}
|
|
23
|
-
<Breadcrumb.Link href={item.url ?? "##"}>{item.label}</Breadcrumb.Link>
|
|
24
|
-
{/if}
|
|
25
|
-
</Breadcrumb.Item>
|
|
26
|
-
|
|
27
|
-
{#if !isLast}
|
|
28
|
-
<Breadcrumb.Separator class="hidden md:block" />
|
|
29
|
-
{/if}
|
|
30
|
-
{/each}
|
|
31
|
-
</Breadcrumb.List>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as Breadcrumb from "../../ui/breadcrumb/index.js";
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
items: {
|
|
6
|
+
url?: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
let { items }: Props = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Breadcrumb.Root>
|
|
15
|
+
<Breadcrumb.List>
|
|
16
|
+
{#each items as item, i (item.label)}
|
|
17
|
+
{@const isLast = i === items.length - 1}
|
|
18
|
+
|
|
19
|
+
<Breadcrumb.Item class={isLast ? "" : "hidden md:block"}>
|
|
20
|
+
{#if isLast}
|
|
21
|
+
<Breadcrumb.Page>{item.label}</Breadcrumb.Page>
|
|
22
|
+
{:else}
|
|
23
|
+
<Breadcrumb.Link href={item.url ?? "##"}>{item.label}</Breadcrumb.Link>
|
|
24
|
+
{/if}
|
|
25
|
+
</Breadcrumb.Item>
|
|
26
|
+
|
|
27
|
+
{#if !isLast}
|
|
28
|
+
<Breadcrumb.Separator class="hidden md:block" />
|
|
29
|
+
{/if}
|
|
30
|
+
{/each}
|
|
31
|
+
</Breadcrumb.List>
|
|
32
32
|
</Breadcrumb.Root>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Button from "../../ui/button/button.svelte";
|
|
3
|
-
import { ArrowLeft01Icon } from "@hugeicons/core-free-icons";
|
|
4
|
-
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
5
|
-
import { t } from "../../../i18n";
|
|
6
|
-
import type { ButtonProps } from "../../ui/button";
|
|
7
|
-
|
|
8
|
-
let { ...restProps }: ButtonProps = $props();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<Button
|
|
12
|
-
variant="outline"
|
|
13
|
-
class="inline-flex items-center gap-1 text-sm text-slate-600 hover:text-slate-900 transition-colors rounded-full bg-input"
|
|
14
|
-
{...restProps}
|
|
15
|
-
>
|
|
16
|
-
<HugeiconsIcon icon={ArrowLeft01Icon} size={16} />
|
|
17
|
-
<span class="sr-only">{$t("label.back")}</span>
|
|
18
|
-
</Button>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Button from "../../ui/button/button.svelte";
|
|
3
|
+
import { ArrowLeft01Icon } from "@hugeicons/core-free-icons";
|
|
4
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
5
|
+
import { t } from "../../../i18n";
|
|
6
|
+
import type { ButtonProps } from "../../ui/button";
|
|
7
|
+
|
|
8
|
+
let { ...restProps }: ButtonProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<Button
|
|
12
|
+
variant="outline"
|
|
13
|
+
class="inline-flex items-center gap-1 text-sm text-slate-600 hover:text-slate-900 transition-colors rounded-full bg-input"
|
|
14
|
+
{...restProps}
|
|
15
|
+
>
|
|
16
|
+
<HugeiconsIcon icon={ArrowLeft01Icon} size={16} />
|
|
17
|
+
<span class="sr-only">{$t("label.back")}</span>
|
|
18
|
+
</Button>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Button, {
|
|
3
|
-
type ButtonProps,
|
|
4
|
-
} from "../../ui/button/button.svelte";
|
|
5
|
-
import { t } from "../../../i18n";
|
|
6
|
-
import { Login02Icon } from "@hugeicons/core-free-icons";
|
|
7
|
-
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
8
|
-
|
|
9
|
-
let { ...restProps }: ButtonProps = $props();
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<Button class="w-full flex items-center gap-2" {...restProps}>
|
|
13
|
-
<HugeiconsIcon icon={Login02Icon} size={16} />
|
|
14
|
-
{$t("label.login")}
|
|
15
|
-
</Button>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Button, {
|
|
3
|
+
type ButtonProps,
|
|
4
|
+
} from "../../ui/button/button.svelte";
|
|
5
|
+
import { t } from "../../../i18n";
|
|
6
|
+
import { Login02Icon } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
8
|
+
|
|
9
|
+
let { ...restProps }: ButtonProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Button class="w-full flex items-center gap-2" {...restProps}>
|
|
13
|
+
<HugeiconsIcon icon={Login02Icon} size={16} />
|
|
14
|
+
{$t("label.login")}
|
|
15
|
+
</Button>
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Button, {
|
|
3
|
-
type ButtonProps,
|
|
4
|
-
} from "../../ui/button/button.svelte";
|
|
5
|
-
import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/svelte";
|
|
6
|
-
import { t } from "../../../i18n";
|
|
7
|
-
import {
|
|
8
|
-
GoogleIcon,
|
|
9
|
-
Facebook01Icon as Facebook,
|
|
10
|
-
Linkedin01Icon as Linkedin,
|
|
11
|
-
} from "@hugeicons/core-free-icons";
|
|
12
|
-
import type { Snippet } from "svelte";
|
|
13
|
-
|
|
14
|
-
type IconDefault = "GOOGLE" | "FACEBOOK" | "LINKEDLN";
|
|
15
|
-
|
|
16
|
-
type Props = {
|
|
17
|
-
icon?: IconSvgElement | IconDefault | Snippet;
|
|
18
|
-
label?: string;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
let { icon, label, ...restProps }: Props & ButtonProps = $props();
|
|
22
|
-
|
|
23
|
-
const defaultIconMap: Record<IconDefault, IconSvgElement> = {
|
|
24
|
-
GOOGLE: GoogleIcon,
|
|
25
|
-
FACEBOOK: Facebook,
|
|
26
|
-
LINKEDLN: Linkedin,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const defaultLabelMap: Record<IconDefault, string> = {
|
|
30
|
-
GOOGLE: "Google",
|
|
31
|
-
FACEBOOK: "Facebook",
|
|
32
|
-
LINKEDLN: "Linkedin",
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
function isIconDefault(value: unknown): value is IconDefault {
|
|
36
|
-
return typeof value === "string" && value in defaultLabelMap;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
let resolvedIcon = $derived(
|
|
40
|
-
isIconDefault(icon) ? defaultIconMap[icon] : icon,
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
let resolvedLabel = $derived(
|
|
44
|
-
label ?? (isIconDefault(icon) ? defaultLabelMap[icon] : ""),
|
|
45
|
-
);
|
|
46
|
-
</script>
|
|
47
|
-
|
|
48
|
-
<Button variant="outline" class="w-full flex items-center gap-2" {...restProps}>
|
|
49
|
-
{#if resolvedIcon}
|
|
50
|
-
{#if typeof resolvedIcon === "function"}
|
|
51
|
-
{@render resolvedIcon()}
|
|
52
|
-
{:else}
|
|
53
|
-
<HugeiconsIcon icon={resolvedIcon} size={16} />
|
|
54
|
-
{/if}
|
|
55
|
-
{/if}
|
|
56
|
-
{$t("label.login.with", { name: resolvedLabel })}
|
|
57
|
-
</Button>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Button, {
|
|
3
|
+
type ButtonProps,
|
|
4
|
+
} from "../../ui/button/button.svelte";
|
|
5
|
+
import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/svelte";
|
|
6
|
+
import { t } from "../../../i18n";
|
|
7
|
+
import {
|
|
8
|
+
GoogleIcon,
|
|
9
|
+
Facebook01Icon as Facebook,
|
|
10
|
+
Linkedin01Icon as Linkedin,
|
|
11
|
+
} from "@hugeicons/core-free-icons";
|
|
12
|
+
import type { Snippet } from "svelte";
|
|
13
|
+
|
|
14
|
+
type IconDefault = "GOOGLE" | "FACEBOOK" | "LINKEDLN";
|
|
15
|
+
|
|
16
|
+
type Props = {
|
|
17
|
+
icon?: IconSvgElement | IconDefault | Snippet;
|
|
18
|
+
label?: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
let { icon, label, ...restProps }: Props & ButtonProps = $props();
|
|
22
|
+
|
|
23
|
+
const defaultIconMap: Record<IconDefault, IconSvgElement> = {
|
|
24
|
+
GOOGLE: GoogleIcon,
|
|
25
|
+
FACEBOOK: Facebook,
|
|
26
|
+
LINKEDLN: Linkedin,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const defaultLabelMap: Record<IconDefault, string> = {
|
|
30
|
+
GOOGLE: "Google",
|
|
31
|
+
FACEBOOK: "Facebook",
|
|
32
|
+
LINKEDLN: "Linkedin",
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
function isIconDefault(value: unknown): value is IconDefault {
|
|
36
|
+
return typeof value === "string" && value in defaultLabelMap;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let resolvedIcon = $derived(
|
|
40
|
+
isIconDefault(icon) ? defaultIconMap[icon] : icon,
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
let resolvedLabel = $derived(
|
|
44
|
+
label ?? (isIconDefault(icon) ? defaultLabelMap[icon] : ""),
|
|
45
|
+
);
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<Button variant="outline" class="w-full flex items-center gap-2" {...restProps}>
|
|
49
|
+
{#if resolvedIcon}
|
|
50
|
+
{#if typeof resolvedIcon === "function"}
|
|
51
|
+
{@render resolvedIcon()}
|
|
52
|
+
{:else}
|
|
53
|
+
<HugeiconsIcon icon={resolvedIcon} size={16} />
|
|
54
|
+
{/if}
|
|
55
|
+
{/if}
|
|
56
|
+
{$t("label.login.with", { name: resolvedLabel })}
|
|
57
|
+
</Button>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Button, {
|
|
3
|
-
type ButtonProps,
|
|
4
|
-
} from "../../ui/button/button.svelte";
|
|
5
|
-
import { t } from "../../../i18n";
|
|
6
|
-
import { Login02Icon } from "@hugeicons/core-free-icons";
|
|
7
|
-
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
8
|
-
|
|
9
|
-
let { ...restProps }: ButtonProps = $props();
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<Button class="w-full flex items-center gap-2" {...restProps}>
|
|
13
|
-
<HugeiconsIcon icon={Login02Icon} size={16} />
|
|
14
|
-
{$t("label.send")}
|
|
15
|
-
</Button>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Button, {
|
|
3
|
+
type ButtonProps,
|
|
4
|
+
} from "../../ui/button/button.svelte";
|
|
5
|
+
import { t } from "../../../i18n";
|
|
6
|
+
import { Login02Icon } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
8
|
+
|
|
9
|
+
let { ...restProps }: ButtonProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Button class="w-full flex items-center gap-2" {...restProps}>
|
|
13
|
+
<HugeiconsIcon icon={Login02Icon} size={16} />
|
|
14
|
+
{$t("label.send")}
|
|
15
|
+
</Button>
|