negodesign 0.0.77 → 0.0.79
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 +133 -133
- package/dist/components/NegoDesign.svelte +21 -21
- 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/product-details/shared/ProductDetailFilesVertical.svelte +103 -103
- package/dist/components/pages/profile-user/shared/ProfileUserAddress.svelte +83 -83
- package/dist/components/pages/profile-user/shared/ProfileUserTabs.svelte +80 -80
- package/dist/components/pages/security/auth/PageAuth01.svelte +21 -24
- package/dist/components/pages/security/auth/PageAuth02.svelte +11 -16
- package/dist/components/pages/security/auth/PageAuth03.svelte +11 -16
- package/dist/components/pages/security/login/01/ui/FormLogin.svelte +7 -5
- package/dist/components/pages/security/login/01/ui/FormLogin.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/01/ui/FormLoginEmailPassword.svelte +4 -2
- package/dist/components/pages/security/login/01/ui/FormLoginEmailPassword.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/01/ui/FormLoginPhonePassword.svelte +4 -2
- package/dist/components/pages/security/login/01/ui/FormLoginPhonePassword.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/01/ui/FormLoginUsernamePassword.svelte +4 -2
- package/dist/components/pages/security/login/01/ui/FormLoginUsernamePassword.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/01/ui/{LoginCard.svelte → LoginCard01.svelte} +132 -109
- package/dist/components/pages/security/login/01/ui/{LoginCard.svelte.d.ts → LoginCard01.svelte.d.ts} +3 -3
- package/dist/components/pages/security/login/01/ui/PageLogin01.svelte +2 -2
- package/dist/components/pages/security/login/02/ui/FormLogin02.svelte +7 -5
- package/dist/components/pages/security/login/02/ui/FormLogin02.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/02/ui/FormLoginEmailPassword02.svelte +4 -2
- package/dist/components/pages/security/login/02/ui/FormLoginEmailPassword02.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/02/ui/FormLoginPhonePassword02.svelte +4 -2
- package/dist/components/pages/security/login/02/ui/FormLoginPhonePassword02.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/02/ui/FormLoginUsernamePassword02.svelte +4 -2
- package/dist/components/pages/security/login/02/ui/FormLoginUsernamePassword02.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/03/ui/FormLogin03.svelte +8 -4
- package/dist/components/pages/security/login/03/ui/FormLogin03.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/03/ui/FormLoginEmailPassword03.svelte +4 -2
- package/dist/components/pages/security/login/03/ui/FormLoginEmailPassword03.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/03/ui/FormLoginPhonePassword03.svelte +4 -2
- package/dist/components/pages/security/login/03/ui/FormLoginPhonePassword03.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/03/ui/FormLoginUsernamePassword03.svelte +4 -2
- package/dist/components/pages/security/login/03/ui/FormLoginUsernamePassword03.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/PageLogin.svelte +30 -30
- package/dist/components/pages/security/register/01/ui/PageRegister01.svelte +21 -9
- package/dist/components/pages/security/register/01/ui/PageRegister01.svelte.d.ts +1 -0
- package/dist/components/pages/security/register/01/ui/{RegisterCard.svelte → RegisterCard01.svelte} +26 -22
- package/dist/components/pages/security/register/01/ui/{RegisterCard.svelte.d.ts → RegisterCard01.svelte.d.ts} +3 -3
- package/dist/components/pages/security/register/FormRegister.svelte +40 -14
- package/dist/components/pages/security/register/FormRegister.svelte.d.ts +3 -0
- package/dist/components/ui/avatar/avatar-fallback.svelte +29 -29
- package/dist/components/ui/avatar/avatar-image.svelte +38 -38
- package/dist/components/ui/avatar/avatar.svelte +39 -39
- package/dist/components/ui/badge/badge.svelte +46 -46
- package/dist/components/ui/banner/AdCardBanner.svelte +74 -74
- package/dist/components/ui/banner/CtaCardBanner.svelte +118 -118
- package/dist/components/ui/banner/CtaCardImageBanner.svelte +94 -94
- package/dist/components/ui/breadcrumb/core/breadcrumb-list.svelte +31 -31
- package/dist/components/ui/button/ButtonBack.svelte +18 -18
- package/dist/components/ui/button/ButtonLogin.svelte +15 -15
- package/dist/components/ui/button/ButtonLoginWith.svelte +57 -57
- package/dist/components/ui/button/ButtonSend.svelte +15 -15
- package/dist/components/ui/button/button.svelte +85 -85
- package/dist/components/ui/card/core/highlight/01/CardHighlight01.svelte +103 -103
- package/dist/components/ui/card/core/highlight/02/CardHighlight02.svelte +99 -99
- package/dist/components/ui/card/core/highlight/CardHighlight.svelte +22 -22
- package/dist/components/ui/card/core/media/01/CardMedia01.svelte +133 -133
- package/dist/components/ui/card/core/media/02/CardMedia02.svelte +127 -127
- package/dist/components/ui/card/core/media/CardMedia.svelte +18 -18
- package/dist/components/ui/card/core/product/01/CardProduct01.svelte +136 -136
- package/dist/components/ui/card/core/product/02/CardProduct02.svelte +124 -124
- package/dist/components/ui/card/core/product/CardProduct.svelte +22 -22
- package/dist/components/ui/card/core/profile/01/CardProfile01.svelte +134 -134
- package/dist/components/ui/card/core/profile/02/CardProfile02.svelte +132 -132
- package/dist/components/ui/card/core/profile/CardProfile.svelte +18 -18
- package/dist/components/ui/card/core/promotion/CardPromotion.svelte +139 -139
- package/dist/components/ui/card/core/promotion/CardPromotionPrice.svelte +32 -32
- package/dist/components/ui/card/core/shared/CardButton.svelte +42 -42
- package/dist/components/ui/card/core/shared/CardCart.svelte +36 -36
- package/dist/components/ui/card/core/shared/CardDescription.svelte +41 -41
- package/dist/components/ui/card/core/shared/CardFavorite.svelte +33 -33
- package/dist/components/ui/card/core/shared/CardLogo.svelte +19 -19
- package/dist/components/ui/card/core/shared/CardPhoneOrWhatsapp.svelte +45 -45
- package/dist/components/ui/card/core/shared/CardStarRating.svelte +24 -24
- package/dist/components/ui/card/core/shared/CardTags.svelte +95 -95
- package/dist/components/ui/card/core/shared/CardThumbnailVideo.svelte +232 -232
- package/dist/components/ui/card/core/shared/CardTitlePrice.svelte +24 -24
- package/dist/components/ui/card/core/shared/TruncatableText.svelte +49 -49
- package/dist/components/ui/carousel/carousel-content.svelte +56 -56
- package/dist/components/ui/carousel/carousel-item.svelte +29 -29
- package/dist/components/ui/carousel/carousel-next.svelte +40 -40
- package/dist/components/ui/carousel/carousel-previous.svelte +40 -40
- package/dist/components/ui/carousel/carousel.svelte +225 -225
- package/dist/components/ui/carousel/core/badge/ui/CarouselBadge.svelte +108 -108
- package/dist/components/ui/carousel/core/grid/shared/ui/CarouselGridSlot.svelte +38 -38
- package/dist/components/ui/carousel/core/hero/ui/CarouselHero.svelte +181 -181
- package/dist/components/ui/carousel/core/highlights/ui/CarouselHighlights.svelte +67 -67
- package/dist/components/ui/carousel/core/product/ui/CarouselProduct.svelte +57 -57
- package/dist/components/ui/carousel/core/promotion/ui/CarouselPromotion.svelte +67 -67
- package/dist/components/ui/carousel/core/shared/ui/CarouselHeader.svelte +59 -59
- package/dist/components/ui/checkbox/checkbox.svelte +96 -96
- package/dist/components/ui/collapsible/collapsible-content.svelte +30 -30
- package/dist/components/ui/collapsible/collapsible-trigger.svelte +51 -51
- package/dist/components/ui/collapsible/collapsible.svelte +66 -66
- package/dist/components/ui/data-table/flex-render.svelte +40 -40
- package/dist/components/ui/datatable/ui/DataTableActions.svelte +28 -28
- package/dist/components/ui/datatable/ui/DataTableCheckbox.svelte +22 -22
- package/dist/components/ui/datatable/ui/DataTableContent.svelte +59 -59
- package/dist/components/ui/datatable/ui/DataTableCore.svelte +148 -148
- package/dist/components/ui/datatable/ui/DataTableDragHandle.svelte +8 -8
- package/dist/components/ui/datatable/ui/DataTableListFilter.svelte +60 -60
- package/dist/components/ui/datatable/ui/DataTableListPagination.svelte +35 -35
- package/dist/components/ui/drawer/drawer-close.svelte +41 -41
- package/dist/components/ui/drawer/drawer-content.svelte +81 -81
- package/dist/components/ui/drawer/drawer-description.svelte +19 -19
- 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 +34 -34
- package/dist/components/ui/drawer/drawer-overlay.svelte +25 -25
- package/dist/components/ui/drawer/drawer-portal.svelte +19 -19
- package/dist/components/ui/drawer/drawer-title.svelte +19 -19
- package/dist/components/ui/drawer/drawer-trigger.svelte +42 -42
- package/dist/components/ui/drawer/drawer.svelte +74 -74
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte +25 -25
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +69 -69
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +106 -106
- package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +27 -27
- package/dist/components/ui/dropdown-menu/dropdown-menu-group.svelte +21 -21
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +60 -60
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +27 -27
- package/dist/components/ui/dropdown-menu/dropdown-menu-portal.svelte +6 -6
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +43 -43
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +70 -70
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte +20 -20
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +33 -33
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +57 -57
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub.svelte +76 -76
- package/dist/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +68 -68
- package/dist/components/ui/dropdown-menu/dropdown-menu.svelte +53 -53
- package/dist/components/ui/empty/empty-content.svelte +19 -19
- package/dist/components/ui/empty/empty-description.svelte +19 -19
- package/dist/components/ui/empty/empty-header.svelte +19 -19
- package/dist/components/ui/empty/empty-media.svelte +41 -41
- package/dist/components/ui/empty/empty-title.svelte +19 -19
- package/dist/components/ui/empty/empty.svelte +19 -19
- package/dist/components/ui/footer/ui/Footer.svelte +18 -18
- package/dist/components/ui/form/data/InputIconDefault.svelte.js +2 -1
- package/dist/components/ui/form/data/InputLabel.svelte.d.ts +3 -0
- package/dist/components/ui/form/ui/calendar/Calendar.svelte +194 -0
- package/dist/components/ui/form/ui/calendar/Calendar.svelte.d.ts +15 -0
- package/dist/components/ui/form/ui/calendar/CalendarCard.svelte +90 -0
- package/dist/components/ui/form/ui/calendar/CalendarCard.svelte.d.ts +20 -0
- package/dist/components/ui/form/ui/calendar/DaysGrid.svelte +76 -0
- package/dist/components/ui/form/ui/calendar/DaysGrid.svelte.d.ts +17 -0
- package/dist/components/ui/form/ui/calendar/MonthSelect.svelte +50 -0
- package/dist/components/ui/form/ui/calendar/MonthSelect.svelte.d.ts +10 -0
- package/dist/components/ui/form/ui/calendar/YearSelect.svelte +117 -0
- package/dist/components/ui/form/ui/calendar/YearSelect.svelte.d.ts +15 -0
- package/dist/components/ui/form/ui/calendar/index.d.ts +5 -0
- package/dist/components/ui/form/ui/calendar/index.js +5 -0
- package/dist/components/ui/form/ui/calendar/utils.d.ts +26 -0
- package/dist/components/ui/form/ui/calendar/utils.js +89 -0
- package/dist/components/ui/form/ui/input-base.svelte +83 -81
- package/dist/components/ui/form/ui/input-calendar-interval.svelte +179 -0
- package/dist/components/ui/form/ui/input-calendar-interval.svelte.d.ts +14 -0
- package/dist/components/ui/form/ui/input-calendar.svelte +110 -0
- package/dist/components/ui/form/ui/input-calendar.svelte.d.ts +9 -0
- package/dist/components/ui/form/ui/input-email-or-phone.svelte +23 -23
- package/dist/components/ui/form/ui/input-email.svelte +23 -23
- package/dist/components/ui/form/ui/input-password-confirm.svelte +23 -23
- package/dist/components/ui/form/ui/input-password.svelte +23 -23
- package/dist/components/ui/form/ui/input-phone.svelte +37 -33
- package/dist/components/ui/form/ui/input-select.svelte +210 -158
- package/dist/components/ui/form/ui/input-select.svelte.d.ts +5 -9
- package/dist/components/ui/form/ui/input-username.svelte +22 -22
- package/dist/components/ui/grid/core/ui/01/Grid01.svelte +30 -30
- package/dist/components/ui/grid/core/ui/02/Grid02.svelte +30 -30
- package/dist/components/ui/grid/core/ui/ItemsPanel.svelte +26 -26
- package/dist/components/ui/grid/core/ui/ItemsPanelCarousel.svelte +37 -37
- package/dist/components/ui/grid/core/ui/ItemsPanelGrid.svelte +43 -43
- package/dist/components/ui/grid/core/ui/ItemsSimpleGrid.svelte +45 -45
- package/dist/components/ui/grid/core/ui/shared/DescriptionGrid.svelte +23 -23
- package/dist/components/ui/grid/core/ui/shared/IconRenderGrid.svelte +23 -23
- package/dist/components/ui/grid/core/ui/shared/TitleGrid.svelte +19 -19
- package/dist/components/ui/hero/SimpleHero.svelte +65 -65
- package/dist/components/ui/input-otp/input-otp-group.svelte +22 -22
- package/dist/components/ui/input-otp/input-otp-separator.svelte +27 -27
- package/dist/components/ui/input-otp/input-otp-slot.svelte +63 -63
- package/dist/components/ui/input-otp/input-otp.svelte +181 -181
- package/dist/components/ui/label/core/LabelOr.svelte +25 -25
- package/dist/components/ui/label/label.svelte +19 -19
- package/dist/components/ui/language-switcher/language-switcher.svelte +48 -48
- package/dist/components/ui/light-switch/light-switch.svelte +48 -48
- package/dist/components/ui/link/link-forget-password.svelte +12 -12
- package/dist/components/ui/link/link-privacy-polity.svelte +12 -12
- package/dist/components/ui/link/link-terms-of-service.svelte +12 -12
- package/dist/components/ui/modal/core/index.d.ts +1 -1
- package/dist/components/ui/modal/core/types.d.ts +2 -1
- package/dist/components/ui/modal/core/ui/ModalCore.svelte +132 -132
- package/dist/components/ui/modal/grid/types.d.ts +6 -5
- package/dist/components/ui/modal/grid/ui/02/ModalGridSelection02.svelte +146 -146
- package/dist/components/ui/modal/share/ui/ModalShareSelection.svelte +156 -156
- package/dist/components/ui/nav/ui/ComplexMenu.svelte +51 -51
- package/dist/components/ui/nav/ui/Menu.svelte +72 -72
- package/dist/components/ui/nav/ui/SimpleMenu.svelte +14 -14
- package/dist/components/ui/nav/ui/mobile/ComplexMenuMobile.svelte +125 -125
- package/dist/components/ui/nav/ui/mobile/MenuMobile.svelte +54 -54
- package/dist/components/ui/nav/ui/shared/MenuButton.svelte +51 -51
- package/dist/components/ui/nav/ui/shared/MenuLinks.svelte +40 -40
- package/dist/components/ui/nav/ui/shared/MenuListItem.svelte +44 -44
- package/dist/components/ui/nav/ui/shared/MenuLogo.svelte +13 -13
- package/dist/components/ui/nav/ui/shared/dropdown/DropdownNavigationMenuItemGrid.svelte +30 -30
- package/dist/components/ui/nav/ui/shared/navigation/NavDropdown.svelte +87 -87
- package/dist/components/ui/nav/ui/shared/navigation/NavigationMenuItem.svelte +17 -17
- package/dist/components/ui/nav/ui/shared/navigation/NavigationMenuItemCard.svelte +53 -53
- package/dist/components/ui/nav/ui/shared/navigation/NavigationMenuItemGrid.svelte +36 -36
- package/dist/components/ui/nav/ui/shared/navigation/NavigationMenuItemList.svelte +24 -24
- package/dist/components/ui/nav/ui/shared/navigation/NavigationMenuItems.svelte +21 -21
- package/dist/components/ui/panel/CarouselSlot.svelte +57 -57
- package/dist/components/ui/panel/LeftHero.svelte +114 -114
- package/dist/components/ui/panel/NotFoundEmpty.svelte +66 -66
- package/dist/components/ui/phone-input/country-selector.svelte +87 -87
- package/dist/components/ui/phone-input/country-selector.svelte.d.ts +2 -2
- package/dist/components/ui/phone-input/flag.svelte +11 -11
- package/dist/components/ui/phone-input/phone-input.svelte +163 -148
- package/dist/components/ui/phone-input/phone-input.svelte.d.ts +2 -2
- package/dist/components/ui/popover/popover-close.svelte +25 -25
- package/dist/components/ui/popover/popover-content.svelte +92 -92
- package/dist/components/ui/popover/popover-portal.svelte +6 -6
- package/dist/components/ui/popover/popover-trigger.svelte +68 -68
- package/dist/components/ui/popover/popover.svelte +53 -53
- package/dist/components/ui/search/SearchInput.svelte +32 -32
- package/dist/components/ui/search/shared/SearchInputCore.svelte +66 -66
- package/dist/components/ui/separator/separator.svelte +28 -28
- package/dist/components/ui/sidebar/core/MenuBarSidebar.svelte +70 -70
- package/dist/components/ui/sidebar/core/ui/navbar/NavMenuBarSidebar.svelte +97 -97
- package/dist/components/ui/sidebar/core/ui/navbar/NavMenuBottomSidebar.svelte +33 -33
- package/dist/components/ui/sidebar/core/ui/navbar/NavMenuTopBarSidebar.svelte +101 -101
- package/dist/components/ui/sidebar/core/ui/navbar/nav-menu-header-sidebar.svelte +77 -77
- package/dist/components/ui/sidebar/sidebar-content.svelte +24 -24
- package/dist/components/ui/sidebar/sidebar-footer.svelte +21 -21
- package/dist/components/ui/sidebar/sidebar-group-content.svelte +21 -21
- package/dist/components/ui/sidebar/sidebar-menu-action.svelte +38 -38
- package/dist/components/ui/sidebar/sidebar-menu-button.svelte +70 -70
- package/dist/components/ui/sidebar/sidebar-menu-sub-button.svelte +39 -39
- package/dist/components/ui/sidebar/sidebar-provider.svelte +62 -62
- package/dist/components/ui/sidebar/sidebar-rail.svelte +36 -36
- package/dist/components/ui/sidebar/sidebar-separator.svelte +21 -21
- package/dist/components/ui/sidebar/sidebar-trigger.svelte +36 -36
- package/dist/components/ui/sidebar/sidebar.svelte +118 -118
- package/dist/components/ui/skeleton/skeleton.svelte +19 -19
- package/dist/components/ui/star-rating/star-rating-star.svelte +66 -66
- package/dist/components/ui/star-rating/star-rating.svelte +149 -149
- 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/ui/tab-underline.svelte +43 -43
- package/dist/components/ui/underline-tabs/underline-tabs-content.svelte +33 -33
- package/dist/components/ui/underline-tabs/underline-tabs-list.svelte +40 -40
- package/dist/components/ui/underline-tabs/underline-tabs-trigger.svelte +91 -91
- package/dist/components/ui/underline-tabs/underline-tabs.svelte +61 -61
- package/dist/docs/ApiTable.svelte +42 -42
- package/dist/docs/CodeBlock.svelte +26 -26
- package/dist/docs/DocsHeader.svelte +25 -25
- package/dist/docs/DocsSidebar.svelte +108 -156
- package/dist/docs/components.js +638 -563
- package/dist/globals.css +68 -10
- package/dist/i18n/langs/en.d.ts +7 -0
- package/dist/i18n/langs/en.js +7 -0
- package/dist/i18n/langs/pt.d.ts +7 -0
- package/dist/i18n/langs/pt.js +7 -0
- package/dist/i18n/translations.d.ts +14 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +23 -0
- package/dist/styles/globals.css +283 -283
- package/dist/types/index.d.ts +3 -1
- package/package.json +81 -81
- package/dist/components/pages/security/login/01/ui/FormRegister.svelte +0 -28
- package/dist/components/pages/security/login/01/ui/FormRegister.svelte.d.ts +0 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { t } from "../../../i18n";
|
|
3
|
-
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
4
|
-
|
|
5
|
-
type Props = HTMLAnchorAttributes;
|
|
6
|
-
|
|
7
|
-
let { ...restProps }: Props = $props();
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<a {...restProps} class="text-xs text-slate-500 hover:text-slate-800 z-10">
|
|
11
|
-
{$t("link.privacy-policy.label")}
|
|
12
|
-
</a>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { t } from "../../../i18n";
|
|
3
|
+
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAnchorAttributes;
|
|
6
|
+
|
|
7
|
+
let { ...restProps }: Props = $props();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<a {...restProps} class="text-xs text-slate-500 hover:text-slate-800 z-10">
|
|
11
|
+
{$t("link.privacy-policy.label")}
|
|
12
|
+
</a>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { t } from "../../../i18n";
|
|
3
|
-
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
4
|
-
|
|
5
|
-
type Props = HTMLAnchorAttributes;
|
|
6
|
-
|
|
7
|
-
let { ...restProps }: Props = $props();
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<a {...restProps} class="text-xs text-slate-500 hover:text-slate-800 z-10">
|
|
11
|
-
{$t("link.terms-of-service.label")}
|
|
12
|
-
</a>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { t } from "../../../i18n";
|
|
3
|
+
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAnchorAttributes;
|
|
6
|
+
|
|
7
|
+
let { ...restProps }: Props = $props();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<a {...restProps} class="text-xs text-slate-500 hover:text-slate-800 z-10">
|
|
11
|
+
{$t("link.terms-of-service.label")}
|
|
12
|
+
</a>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import Root from "./ui/ModalCore.svelte";
|
|
2
2
|
export { Root, Root as ModalCore, };
|
|
3
|
-
export type { ModalCoreProps, ModelBadge, ModelGridCard, ModelSocialShare } from "./types";
|
|
3
|
+
export type { ModalCoreProps, ModelBadge, ModelGridCardProps as ModelGridCard, ModelSocialShare } from "./types";
|
|
@@ -61,10 +61,11 @@ export type ModelBadge = {
|
|
|
61
61
|
* @property description - Descrição curta exibida abaixo do título.
|
|
62
62
|
* @property icon - Ícone exibido no topo do card (string CSS ou HugeIcons).
|
|
63
63
|
*/
|
|
64
|
-
export type
|
|
64
|
+
export type ModelGridCardProps = {
|
|
65
65
|
title: string;
|
|
66
66
|
description?: string;
|
|
67
67
|
icon: string | IconSvgElement;
|
|
68
|
+
url?: string;
|
|
68
69
|
};
|
|
69
70
|
/**
|
|
70
71
|
* Modelo de dados para uma rede social no modal de partilha.
|
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cn } from "../../../../../utils";
|
|
3
|
-
import {
|
|
4
|
-
ArrowLeft01Icon,
|
|
5
|
-
ArrowRight01Icon,
|
|
6
|
-
} from "@hugeicons/core-free-icons";
|
|
7
|
-
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
8
|
-
import type { ModalCoreProps } from "../types";
|
|
9
|
-
|
|
10
|
-
let {
|
|
11
|
-
isOpen = $bindable(false),
|
|
12
|
-
title,
|
|
13
|
-
subtitle,
|
|
14
|
-
totalSteps = 1,
|
|
15
|
-
currentStep = 1,
|
|
16
|
-
showProgress = true,
|
|
17
|
-
showBack = true,
|
|
18
|
-
showSkip = false,
|
|
19
|
-
skipText = "Skip This Step",
|
|
20
|
-
continueText = "Continue",
|
|
21
|
-
backText = "Back",
|
|
22
|
-
onBack,
|
|
23
|
-
onContinue,
|
|
24
|
-
onSkip,
|
|
25
|
-
onClose,
|
|
26
|
-
content,
|
|
27
|
-
footer,
|
|
28
|
-
class: className,
|
|
29
|
-
}: ModalCoreProps = $props();
|
|
30
|
-
|
|
31
|
-
function handleClose() {
|
|
32
|
-
isOpen = false;
|
|
33
|
-
onClose?.();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const progressPercent = $derived(
|
|
37
|
-
totalSteps > 0 ? (currentStep / totalSteps) * 100 : 0,
|
|
38
|
-
);
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
{#if isOpen}
|
|
42
|
-
<div class="fixed inset-0 z-50 flex items-center justify-center">
|
|
43
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
44
|
-
<div
|
|
45
|
-
class="absolute inset-0 bg-black/50 backdrop-blur-sm"
|
|
46
|
-
onclick={handleClose}
|
|
47
|
-
onkeydown={(e) => {
|
|
48
|
-
if (e.key === "Escape") handleClose();
|
|
49
|
-
}}
|
|
50
|
-
></div>
|
|
51
|
-
|
|
52
|
-
<div
|
|
53
|
-
class={cn(
|
|
54
|
-
"relative z-10 mx-4 flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-3xl border border-border shadow-lg bg-background",
|
|
55
|
-
"before:absolute before:-inset-px before:z-[-1] before:rounded-3xl",
|
|
56
|
-
"animate-in fade-in zoom-in-95 duration-200",
|
|
57
|
-
className,
|
|
58
|
-
)}
|
|
59
|
-
>
|
|
60
|
-
<!-- Header -->
|
|
61
|
-
<div class="px-8 pt-8">
|
|
62
|
-
<h2 class="text-2xl font-semibold tracking-tight">
|
|
63
|
-
{title}
|
|
64
|
-
</h2>
|
|
65
|
-
{#if subtitle}
|
|
66
|
-
<p class="mt-2 text-sm text-muted-foreground">{subtitle}</p>
|
|
67
|
-
{/if}
|
|
68
|
-
</div>
|
|
69
|
-
|
|
70
|
-
<!-- Content -->
|
|
71
|
-
<div class="flex-1 overflow-y-auto px-8 py-6">
|
|
72
|
-
{#if content}
|
|
73
|
-
{@render content()}
|
|
74
|
-
{/if}
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<!-- Footer -->
|
|
78
|
-
{#if footer}
|
|
79
|
-
<div class="border-t border-border px-8 py-5">
|
|
80
|
-
{@render footer()}
|
|
81
|
-
</div>
|
|
82
|
-
{:else}
|
|
83
|
-
<div class="border-t border-border px-8 py-5">
|
|
84
|
-
{#if showProgress}
|
|
85
|
-
<div class="mb-5 h-1.5 w-full overflow-hidden rounded-full">
|
|
86
|
-
<div
|
|
87
|
-
class="h-full rounded-full transition-all duration-300"
|
|
88
|
-
style="width: {progressPercent}%"
|
|
89
|
-
></div>
|
|
90
|
-
</div>
|
|
91
|
-
{/if}
|
|
92
|
-
|
|
93
|
-
<div class="flex items-center justify-between">
|
|
94
|
-
<div class="flex items-center gap-4">
|
|
95
|
-
{#if showSkip}
|
|
96
|
-
<button
|
|
97
|
-
type="button"
|
|
98
|
-
class="text-sm font-medium text-muted-foreground transition hover:text-foreground"
|
|
99
|
-
onclick={onSkip}
|
|
100
|
-
>
|
|
101
|
-
{skipText}
|
|
102
|
-
</button>
|
|
103
|
-
{/if}
|
|
104
|
-
</div>
|
|
105
|
-
|
|
106
|
-
<div class="flex items-center gap-3">
|
|
107
|
-
{#if showBack && currentStep > 1}
|
|
108
|
-
<button
|
|
109
|
-
type="button"
|
|
110
|
-
class="inline-flex items-center gap-2 rounded-full border border-border px-5 py-2.5 text-sm font-semibold transition"
|
|
111
|
-
onclick={onBack}
|
|
112
|
-
>
|
|
113
|
-
<HugeiconsIcon icon={ArrowLeft01Icon} class="size-4" />
|
|
114
|
-
{backText}
|
|
115
|
-
</button>
|
|
116
|
-
{/if}
|
|
117
|
-
|
|
118
|
-
<button
|
|
119
|
-
type="button"
|
|
120
|
-
class="inline-flex items-center gap-2 rounded-full px-6 py-2.5 text-sm font-semibold bg-primary transition"
|
|
121
|
-
onclick={onContinue}
|
|
122
|
-
>
|
|
123
|
-
{continueText}
|
|
124
|
-
<HugeiconsIcon icon={ArrowRight01Icon} class="size-4" />
|
|
125
|
-
</button>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
</div>
|
|
129
|
-
{/if}
|
|
130
|
-
</div>
|
|
131
|
-
</div>
|
|
132
|
-
{/if}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../../../utils";
|
|
3
|
+
import {
|
|
4
|
+
ArrowLeft01Icon,
|
|
5
|
+
ArrowRight01Icon,
|
|
6
|
+
} from "@hugeicons/core-free-icons";
|
|
7
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
8
|
+
import type { ModalCoreProps } from "../types";
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
isOpen = $bindable(false),
|
|
12
|
+
title,
|
|
13
|
+
subtitle,
|
|
14
|
+
totalSteps = 1,
|
|
15
|
+
currentStep = 1,
|
|
16
|
+
showProgress = true,
|
|
17
|
+
showBack = true,
|
|
18
|
+
showSkip = false,
|
|
19
|
+
skipText = "Skip This Step",
|
|
20
|
+
continueText = "Continue",
|
|
21
|
+
backText = "Back",
|
|
22
|
+
onBack,
|
|
23
|
+
onContinue,
|
|
24
|
+
onSkip,
|
|
25
|
+
onClose,
|
|
26
|
+
content,
|
|
27
|
+
footer,
|
|
28
|
+
class: className,
|
|
29
|
+
}: ModalCoreProps = $props();
|
|
30
|
+
|
|
31
|
+
function handleClose() {
|
|
32
|
+
isOpen = false;
|
|
33
|
+
onClose?.();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const progressPercent = $derived(
|
|
37
|
+
totalSteps > 0 ? (currentStep / totalSteps) * 100 : 0,
|
|
38
|
+
);
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
{#if isOpen}
|
|
42
|
+
<div class="fixed inset-0 z-50 flex items-center justify-center">
|
|
43
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
44
|
+
<div
|
|
45
|
+
class="absolute inset-0 bg-black/50 backdrop-blur-sm"
|
|
46
|
+
onclick={handleClose}
|
|
47
|
+
onkeydown={(e) => {
|
|
48
|
+
if (e.key === "Escape") handleClose();
|
|
49
|
+
}}
|
|
50
|
+
></div>
|
|
51
|
+
|
|
52
|
+
<div
|
|
53
|
+
class={cn(
|
|
54
|
+
"relative z-10 mx-4 flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-3xl border border-border shadow-lg bg-background",
|
|
55
|
+
"before:absolute before:-inset-px before:z-[-1] before:rounded-3xl",
|
|
56
|
+
"animate-in fade-in zoom-in-95 duration-200",
|
|
57
|
+
className,
|
|
58
|
+
)}
|
|
59
|
+
>
|
|
60
|
+
<!-- Header -->
|
|
61
|
+
<div class="px-8 pt-8">
|
|
62
|
+
<h2 class="text-2xl font-semibold tracking-tight">
|
|
63
|
+
{title}
|
|
64
|
+
</h2>
|
|
65
|
+
{#if subtitle}
|
|
66
|
+
<p class="mt-2 text-sm text-muted-foreground">{subtitle}</p>
|
|
67
|
+
{/if}
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<!-- Content -->
|
|
71
|
+
<div class="flex-1 overflow-y-auto px-8 py-6">
|
|
72
|
+
{#if content}
|
|
73
|
+
{@render content()}
|
|
74
|
+
{/if}
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<!-- Footer -->
|
|
78
|
+
{#if footer}
|
|
79
|
+
<div class="border-t border-border px-8 py-5">
|
|
80
|
+
{@render footer()}
|
|
81
|
+
</div>
|
|
82
|
+
{:else}
|
|
83
|
+
<div class="border-t border-border px-8 py-5">
|
|
84
|
+
{#if showProgress}
|
|
85
|
+
<div class="mb-5 h-1.5 w-full overflow-hidden rounded-full">
|
|
86
|
+
<div
|
|
87
|
+
class="h-full rounded-full transition-all duration-300"
|
|
88
|
+
style="width: {progressPercent}%"
|
|
89
|
+
></div>
|
|
90
|
+
</div>
|
|
91
|
+
{/if}
|
|
92
|
+
|
|
93
|
+
<div class="flex items-center justify-between">
|
|
94
|
+
<div class="flex items-center gap-4">
|
|
95
|
+
{#if showSkip}
|
|
96
|
+
<button
|
|
97
|
+
type="button"
|
|
98
|
+
class="text-sm font-medium text-muted-foreground transition hover:text-foreground"
|
|
99
|
+
onclick={onSkip}
|
|
100
|
+
>
|
|
101
|
+
{skipText}
|
|
102
|
+
</button>
|
|
103
|
+
{/if}
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<div class="flex items-center gap-3">
|
|
107
|
+
{#if showBack && currentStep > 1}
|
|
108
|
+
<button
|
|
109
|
+
type="button"
|
|
110
|
+
class="inline-flex items-center gap-2 rounded-full border border-border px-5 py-2.5 text-sm font-semibold transition"
|
|
111
|
+
onclick={onBack}
|
|
112
|
+
>
|
|
113
|
+
<HugeiconsIcon icon={ArrowLeft01Icon} class="size-4" />
|
|
114
|
+
{backText}
|
|
115
|
+
</button>
|
|
116
|
+
{/if}
|
|
117
|
+
|
|
118
|
+
<button
|
|
119
|
+
type="button"
|
|
120
|
+
class="inline-flex items-center gap-2 rounded-full px-6 py-2.5 text-sm font-semibold bg-primary text-white transition"
|
|
121
|
+
onclick={onContinue}
|
|
122
|
+
>
|
|
123
|
+
{continueText}
|
|
124
|
+
<HugeiconsIcon icon={ArrowRight01Icon} class="size-4" />
|
|
125
|
+
</button>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
{/if}
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
{/if}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ModelGridCardProps } from "../core/types";
|
|
2
|
+
export type { ModelGridCardProps as ModelGridCard } from "../core/types";
|
|
2
3
|
/**
|
|
3
4
|
* Modelo de dados para uma categoria/selecção no topo do modal (variante 2).
|
|
4
5
|
* Cada categoria filtra ou indica o contexto dos cards.
|
|
@@ -36,14 +37,14 @@ export type ModalGridSelectionProps = {
|
|
|
36
37
|
subtitle?: string;
|
|
37
38
|
categories?: ModelGridCategory[];
|
|
38
39
|
selectedCategory?: ModelGridCategory | null;
|
|
39
|
-
cards:
|
|
40
|
-
selectedCard?:
|
|
41
|
-
selectedCards?:
|
|
40
|
+
cards: ModelGridCardProps[];
|
|
41
|
+
selectedCard?: ModelGridCardProps | null;
|
|
42
|
+
selectedCards?: ModelGridCardProps[];
|
|
42
43
|
multiple?: boolean;
|
|
43
44
|
totalSteps?: number;
|
|
44
45
|
currentStep?: number;
|
|
45
46
|
isOpen?: boolean;
|
|
46
|
-
onSelect?: (card:
|
|
47
|
+
onSelect?: (card: ModelGridCardProps) => void;
|
|
47
48
|
onSelectCategory?: (category: ModelGridCategory) => void;
|
|
48
49
|
onBack?: () => void;
|
|
49
50
|
onContinue?: () => void;
|
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cn } from "../../../../../../utils";
|
|
3
|
-
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
4
|
-
import { CheckmarkCircle02Icon } from "@hugeicons/core-free-icons";
|
|
5
|
-
import ModalCore from "../../../core/ui/ModalCore.svelte";
|
|
6
|
-
import type {
|
|
7
|
-
ModalGridSelectionProps,
|
|
8
|
-
ModelGridCard,
|
|
9
|
-
ModelGridCategory,
|
|
10
|
-
} from "../../types";
|
|
11
|
-
|
|
12
|
-
let {
|
|
13
|
-
title,
|
|
14
|
-
subtitle,
|
|
15
|
-
categories = [],
|
|
16
|
-
selectedCategory = $bindable(null),
|
|
17
|
-
cards = [],
|
|
18
|
-
selectedCard = $bindable(null),
|
|
19
|
-
selectedCards = $bindable([]),
|
|
20
|
-
multiple = false,
|
|
21
|
-
totalSteps = 1,
|
|
22
|
-
currentStep = 1,
|
|
23
|
-
isOpen = $bindable(false),
|
|
24
|
-
onSelect,
|
|
25
|
-
onSelectCategory,
|
|
26
|
-
onBack,
|
|
27
|
-
onContinue,
|
|
28
|
-
class: className,
|
|
29
|
-
}: ModalGridSelectionProps = $props();
|
|
30
|
-
|
|
31
|
-
function handleSelectCard(card: ModelGridCard) {
|
|
32
|
-
if (multiple) {
|
|
33
|
-
const exists = selectedCards.some(
|
|
34
|
-
(c: ModelGridCard) => c.title === card.title,
|
|
35
|
-
);
|
|
36
|
-
if (exists) {
|
|
37
|
-
selectedCards = selectedCards.filter(
|
|
38
|
-
(c: ModelGridCard) => c.title !== card.title,
|
|
39
|
-
);
|
|
40
|
-
} else {
|
|
41
|
-
selectedCards = [...selectedCards, card];
|
|
42
|
-
}
|
|
43
|
-
onSelect?.(card);
|
|
44
|
-
} else {
|
|
45
|
-
selectedCard = card;
|
|
46
|
-
onSelect?.(card);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function handleSelectCategory(category: ModelGridCategory) {
|
|
51
|
-
selectedCategory = category;
|
|
52
|
-
onSelectCategory?.(category);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function isSelectedCard(card: ModelGridCard): boolean {
|
|
56
|
-
if (multiple) {
|
|
57
|
-
return selectedCards.some((c: ModelGridCard) => c.title === card.title);
|
|
58
|
-
}
|
|
59
|
-
return selectedCard?.title === card.title;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function isSelectedCategory(category: ModelGridCategory): boolean {
|
|
63
|
-
return selectedCategory?.value === category.value;
|
|
64
|
-
}
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<ModalCore
|
|
68
|
-
bind:isOpen
|
|
69
|
-
{title}
|
|
70
|
-
{subtitle}
|
|
71
|
-
{totalSteps}
|
|
72
|
-
{currentStep}
|
|
73
|
-
showProgress={false}
|
|
74
|
-
showBack={currentStep > 1}
|
|
75
|
-
{onBack}
|
|
76
|
-
{onContinue}
|
|
77
|
-
class={cn(className)}
|
|
78
|
-
>
|
|
79
|
-
{#snippet content()}
|
|
80
|
-
<!-- Categories -->
|
|
81
|
-
{#if categories.length > 0}
|
|
82
|
-
<div class="mb-6 flex flex-wrap gap-2">
|
|
83
|
-
{#each categories as cat (cat.value)}
|
|
84
|
-
{@const active = isSelectedCategory(cat)}
|
|
85
|
-
<button
|
|
86
|
-
type="button"
|
|
87
|
-
class={cn(
|
|
88
|
-
"rounded-full border px-4 py-1.5 text-sm font-medium transition-all duration-200",
|
|
89
|
-
active ? "" : "",
|
|
90
|
-
)}
|
|
91
|
-
onclick={() => handleSelectCategory(cat)}
|
|
92
|
-
>
|
|
93
|
-
{cat.label}
|
|
94
|
-
</button>
|
|
95
|
-
{/each}
|
|
96
|
-
</div>
|
|
97
|
-
{/if}
|
|
98
|
-
|
|
99
|
-
<!-- Cards Grid -->
|
|
100
|
-
<div class="grid grid-cols-1 gap-3 md:grid-cols-2">
|
|
101
|
-
{#each cards as card, i (i)}
|
|
102
|
-
{@const selected = isSelectedCard(card)}
|
|
103
|
-
<button
|
|
104
|
-
type="button"
|
|
105
|
-
class={cn(
|
|
106
|
-
"relative flex items-center gap-4 rounded-xl border p-4 text-left transition-all duration-200",
|
|
107
|
-
selected ? "" : "",
|
|
108
|
-
)}
|
|
109
|
-
onclick={() => handleSelectCard(card)}
|
|
110
|
-
>
|
|
111
|
-
<!-- Icon -->
|
|
112
|
-
<div
|
|
113
|
-
class={cn(
|
|
114
|
-
"flex size-10 shrink-0 items-center justify-center rounded-lg",
|
|
115
|
-
selected ? "bg-primary/20" : "bg-primary/40",
|
|
116
|
-
)}
|
|
117
|
-
>
|
|
118
|
-
{#if typeof card.icon === "string"}
|
|
119
|
-
<i class="{card.icon} text-lg"></i>
|
|
120
|
-
{:else}
|
|
121
|
-
<HugeiconsIcon icon={card.icon} class="size-5" />
|
|
122
|
-
{/if}
|
|
123
|
-
</div>
|
|
124
|
-
|
|
125
|
-
<!-- Text -->
|
|
126
|
-
<div class="min-w-0 flex-1">
|
|
127
|
-
<p class="text-sm font-bold">{card.title}</p>
|
|
128
|
-
{#if card.description}
|
|
129
|
-
<p class="mt-0.5 line-clamp-1 text-xs">
|
|
130
|
-
{card.description}
|
|
131
|
-
</p>
|
|
132
|
-
{/if}
|
|
133
|
-
</div>
|
|
134
|
-
|
|
135
|
-
<!-- Checkmark -->
|
|
136
|
-
{#if selected}
|
|
137
|
-
<HugeiconsIcon
|
|
138
|
-
icon={CheckmarkCircle02Icon}
|
|
139
|
-
class="size-5 shrink-0 text-primary"
|
|
140
|
-
/>
|
|
141
|
-
{/if}
|
|
142
|
-
</button>
|
|
143
|
-
{/each}
|
|
144
|
-
</div>
|
|
145
|
-
{/snippet}
|
|
146
|
-
</ModalCore>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../../../../utils";
|
|
3
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
4
|
+
import { CheckmarkCircle02Icon } from "@hugeicons/core-free-icons";
|
|
5
|
+
import ModalCore from "../../../core/ui/ModalCore.svelte";
|
|
6
|
+
import type {
|
|
7
|
+
ModalGridSelectionProps,
|
|
8
|
+
ModelGridCard,
|
|
9
|
+
ModelGridCategory,
|
|
10
|
+
} from "../../types";
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
title,
|
|
14
|
+
subtitle,
|
|
15
|
+
categories = [],
|
|
16
|
+
selectedCategory = $bindable(null),
|
|
17
|
+
cards = [],
|
|
18
|
+
selectedCard = $bindable(null),
|
|
19
|
+
selectedCards = $bindable([]),
|
|
20
|
+
multiple = false,
|
|
21
|
+
totalSteps = 1,
|
|
22
|
+
currentStep = 1,
|
|
23
|
+
isOpen = $bindable(false),
|
|
24
|
+
onSelect,
|
|
25
|
+
onSelectCategory,
|
|
26
|
+
onBack,
|
|
27
|
+
onContinue,
|
|
28
|
+
class: className,
|
|
29
|
+
}: ModalGridSelectionProps = $props();
|
|
30
|
+
|
|
31
|
+
function handleSelectCard(card: ModelGridCard) {
|
|
32
|
+
if (multiple) {
|
|
33
|
+
const exists = selectedCards.some(
|
|
34
|
+
(c: ModelGridCard) => c.title === card.title,
|
|
35
|
+
);
|
|
36
|
+
if (exists) {
|
|
37
|
+
selectedCards = selectedCards.filter(
|
|
38
|
+
(c: ModelGridCard) => c.title !== card.title,
|
|
39
|
+
);
|
|
40
|
+
} else {
|
|
41
|
+
selectedCards = [...selectedCards, card];
|
|
42
|
+
}
|
|
43
|
+
onSelect?.(card);
|
|
44
|
+
} else {
|
|
45
|
+
selectedCard = card;
|
|
46
|
+
onSelect?.(card);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function handleSelectCategory(category: ModelGridCategory) {
|
|
51
|
+
selectedCategory = category;
|
|
52
|
+
onSelectCategory?.(category);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function isSelectedCard(card: ModelGridCard): boolean {
|
|
56
|
+
if (multiple) {
|
|
57
|
+
return selectedCards.some((c: ModelGridCard) => c.title === card.title);
|
|
58
|
+
}
|
|
59
|
+
return selectedCard?.title === card.title;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function isSelectedCategory(category: ModelGridCategory): boolean {
|
|
63
|
+
return selectedCategory?.value === category.value;
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<ModalCore
|
|
68
|
+
bind:isOpen
|
|
69
|
+
{title}
|
|
70
|
+
{subtitle}
|
|
71
|
+
{totalSteps}
|
|
72
|
+
{currentStep}
|
|
73
|
+
showProgress={false}
|
|
74
|
+
showBack={currentStep > 1}
|
|
75
|
+
{onBack}
|
|
76
|
+
{onContinue}
|
|
77
|
+
class={cn(className)}
|
|
78
|
+
>
|
|
79
|
+
{#snippet content()}
|
|
80
|
+
<!-- Categories -->
|
|
81
|
+
{#if categories.length > 0}
|
|
82
|
+
<div class="mb-6 flex flex-wrap gap-2">
|
|
83
|
+
{#each categories as cat (cat.value)}
|
|
84
|
+
{@const active = isSelectedCategory(cat)}
|
|
85
|
+
<button
|
|
86
|
+
type="button"
|
|
87
|
+
class={cn(
|
|
88
|
+
"rounded-full border px-4 py-1.5 text-sm font-medium transition-all duration-200",
|
|
89
|
+
active ? "" : "",
|
|
90
|
+
)}
|
|
91
|
+
onclick={() => handleSelectCategory(cat)}
|
|
92
|
+
>
|
|
93
|
+
{cat.label}
|
|
94
|
+
</button>
|
|
95
|
+
{/each}
|
|
96
|
+
</div>
|
|
97
|
+
{/if}
|
|
98
|
+
|
|
99
|
+
<!-- Cards Grid -->
|
|
100
|
+
<div class="grid grid-cols-1 gap-3 md:grid-cols-2">
|
|
101
|
+
{#each cards as card, i (i)}
|
|
102
|
+
{@const selected = isSelectedCard(card)}
|
|
103
|
+
<button
|
|
104
|
+
type="button"
|
|
105
|
+
class={cn(
|
|
106
|
+
"relative flex items-center gap-4 rounded-xl border p-4 text-left transition-all duration-200",
|
|
107
|
+
selected ? "" : "",
|
|
108
|
+
)}
|
|
109
|
+
onclick={() => handleSelectCard(card)}
|
|
110
|
+
>
|
|
111
|
+
<!-- Icon -->
|
|
112
|
+
<div
|
|
113
|
+
class={cn(
|
|
114
|
+
"flex size-10 shrink-0 items-center justify-center rounded-lg",
|
|
115
|
+
selected ? "bg-primary/20" : "bg-primary/40",
|
|
116
|
+
)}
|
|
117
|
+
>
|
|
118
|
+
{#if typeof card.icon === "string"}
|
|
119
|
+
<i class="{card.icon} text-lg"></i>
|
|
120
|
+
{:else}
|
|
121
|
+
<HugeiconsIcon icon={card.icon} class="size-5" />
|
|
122
|
+
{/if}
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<!-- Text -->
|
|
126
|
+
<div class="min-w-0 flex-1">
|
|
127
|
+
<p class="text-sm font-bold">{card.title}</p>
|
|
128
|
+
{#if card.description}
|
|
129
|
+
<p class="mt-0.5 line-clamp-1 text-xs">
|
|
130
|
+
{card.description}
|
|
131
|
+
</p>
|
|
132
|
+
{/if}
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<!-- Checkmark -->
|
|
136
|
+
{#if selected}
|
|
137
|
+
<HugeiconsIcon
|
|
138
|
+
icon={CheckmarkCircle02Icon}
|
|
139
|
+
class="size-5 shrink-0 text-primary"
|
|
140
|
+
/>
|
|
141
|
+
{/if}
|
|
142
|
+
</button>
|
|
143
|
+
{/each}
|
|
144
|
+
</div>
|
|
145
|
+
{/snippet}
|
|
146
|
+
</ModalCore>
|