@xbg.solutions/create-frontend 1.1.2 → 1.2.0
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/bin/xbg-frontend.cjs +32 -0
- package/package.json +17 -3
- package/src/commands/add.cjs +470 -0
- package/src/commands/generate.cjs +24 -0
- package/src/manifest.json +1578 -0
- package/src/registry/advanced/ChartWrapper.svelte +587 -0
- package/src/registry/advanced/DataTable.svelte +645 -0
- package/src/registry/advanced/FormWizard.svelte +546 -0
- package/src/registry/advanced/ImageUpload.svelte +663 -0
- package/src/registry/advanced/index.ts +33 -0
- package/src/registry/atoms/calendar/Calendar.svelte +181 -0
- package/src/registry/atoms/calendar/index.ts +1 -0
- package/src/registry/atoms/dialog/Dialog.svelte +179 -0
- package/src/registry/atoms/dialog/DialogDescription.svelte +16 -0
- package/src/registry/atoms/dialog/DialogFooter.svelte +16 -0
- package/src/registry/atoms/dialog/DialogHeader.svelte +16 -0
- package/src/registry/atoms/dialog/DialogTitle.svelte +16 -0
- package/src/registry/atoms/dialog/index.ts +10 -0
- package/src/registry/atoms/icon/BrandIcon.svelte +47 -0
- package/src/registry/atoms/icon/DynamicIcon.svelte +49 -0
- package/src/registry/atoms/icon/index.ts +2 -0
- package/src/registry/atoms/legend/Legend.svelte +32 -0
- package/src/registry/atoms/legend/index.ts +1 -0
- package/src/registry/atoms/menu/MenuItem.svelte +85 -0
- package/src/registry/atoms/menu/index.ts +1 -0
- package/src/registry/atoms/message/Message.svelte +62 -0
- package/src/registry/atoms/message/index.ts +1 -0
- package/src/registry/atoms/nav/NavItem.svelte +67 -0
- package/src/registry/atoms/nav/index.ts +1 -0
- package/src/registry/atoms/notification-badge/NotificationBadge.svelte +30 -0
- package/src/registry/atoms/notification-badge/index.ts +1 -0
- package/src/registry/atoms/otp-input/OtpInput.svelte +108 -0
- package/src/registry/atoms/otp-input/index.ts +1 -0
- package/src/registry/atoms/select/Select.svelte +216 -0
- package/src/registry/atoms/select/index.ts +6 -0
- package/src/registry/atoms/settings-card/SettingsCard.svelte +48 -0
- package/src/registry/atoms/settings-card/index.ts +1 -0
- package/src/registry/atoms/sidebar-item/SidebarItem.svelte +90 -0
- package/src/registry/atoms/sidebar-item/index.ts +1 -0
- package/src/registry/atoms/statistic-card/StatisticCard.svelte +53 -0
- package/src/registry/atoms/statistic-card/index.ts +1 -0
- package/src/registry/atoms/text-editor/TextEditor.svelte +77 -0
- package/src/registry/atoms/text-editor/index.ts +1 -0
- package/src/registry/atoms/uploader/Uploader.svelte +102 -0
- package/src/registry/atoms/uploader/index.ts +1 -0
- package/src/registry/atoms/user-item/UserItem.svelte +39 -0
- package/src/registry/atoms/user-item/index.ts +1 -0
- package/src/registry/blocks/account-section/AccountSection01.svelte +112 -0
- package/src/registry/blocks/account-section/AccountSection02.svelte +190 -0
- package/src/registry/blocks/account-section/AccountSection03.svelte +161 -0
- package/src/registry/blocks/account-section/AccountSection04.svelte +164 -0
- package/src/registry/blocks/account-section/AccountSection05.svelte +76 -0
- package/src/registry/blocks/account-section/index.ts +5 -0
- package/src/registry/blocks/app-shell/AppShell01.svelte +74 -0
- package/src/registry/blocks/app-shell/AppShell02.svelte +87 -0
- package/src/registry/blocks/app-shell/AppShell03.svelte +79 -0
- package/src/registry/blocks/app-shell/AppShell04.svelte +177 -0
- package/src/registry/blocks/app-shell/index.ts +4 -0
- package/src/registry/blocks/auth/AuthSplitScreen.svelte +132 -0
- package/src/registry/blocks/auth/LoginBlock01.svelte +94 -0
- package/src/registry/blocks/auth/LoginBlock02.svelte +103 -0
- package/src/registry/blocks/auth/LoginBlock03.svelte +53 -0
- package/src/registry/blocks/auth/LoginBlock04.svelte +99 -0
- package/src/registry/blocks/auth/LoginBlock05.svelte +101 -0
- package/src/registry/blocks/auth/OtpBlock01.svelte +115 -0
- package/src/registry/blocks/auth/OtpBlock02.svelte +113 -0
- package/src/registry/blocks/auth/OtpBlock03.svelte +143 -0
- package/src/registry/blocks/auth/OtpBlock04.svelte +122 -0
- package/src/registry/blocks/auth/OtpBlock05.svelte +81 -0
- package/src/registry/blocks/auth/SignupBlock01.svelte +103 -0
- package/src/registry/blocks/auth/SignupBlock02.svelte +94 -0
- package/src/registry/blocks/auth/SignupBlock03.svelte +120 -0
- package/src/registry/blocks/auth/SignupBlock04.svelte +112 -0
- package/src/registry/blocks/auth/SignupBlock05.svelte +77 -0
- package/src/registry/blocks/auth/index.ts +31 -0
- package/src/registry/blocks/banner/Banner01.svelte +67 -0
- package/src/registry/blocks/banner/Banner02.svelte +61 -0
- package/src/registry/blocks/banner/Banner03.svelte +54 -0
- package/src/registry/blocks/banner/Banner04.svelte +49 -0
- package/src/registry/blocks/banner/Banner05.svelte +47 -0
- package/src/registry/blocks/banner/index.ts +5 -0
- package/src/registry/blocks/bento-grid/BentoGrid01.svelte +92 -0
- package/src/registry/blocks/bento-grid/BentoGrid02.svelte +79 -0
- package/src/registry/blocks/bento-grid/BentoGrid03.svelte +79 -0
- package/src/registry/blocks/bento-grid/BentoGrid04.svelte +58 -0
- package/src/registry/blocks/bento-grid/BentoGrid05.svelte +92 -0
- package/src/registry/blocks/bento-grid/BentoGrid06.svelte +42 -0
- package/src/registry/blocks/bento-grid/index.ts +14 -0
- package/src/registry/blocks/blog-section/BlogSection01.svelte +100 -0
- package/src/registry/blocks/blog-section/BlogSection02.svelte +93 -0
- package/src/registry/blocks/blog-section/BlogSection03.svelte +92 -0
- package/src/registry/blocks/blog-section/BlogSection04.svelte +97 -0
- package/src/registry/blocks/blog-section/BlogSection05.svelte +120 -0
- package/src/registry/blocks/blog-section/index.ts +15 -0
- package/src/registry/blocks/buttons/ButtonBookmark.svelte +37 -0
- package/src/registry/blocks/buttons/ButtonLike.svelte +37 -0
- package/src/registry/blocks/buttons/ButtonMenu.svelte +37 -0
- package/src/registry/blocks/buttons/ButtonSplitDropdown.svelte +46 -0
- package/src/registry/blocks/buttons/ButtonStepper.svelte +55 -0
- package/src/registry/blocks/buttons/ButtonSteps.svelte +73 -0
- package/src/registry/blocks/buttons/ButtonToggleGroup.svelte +35 -0
- package/src/registry/blocks/buttons/ButtonsGroup.svelte +63 -0
- package/src/registry/blocks/buttons/SocialButtonsHorizontal.svelte +41 -0
- package/src/registry/blocks/buttons/SocialButtonsVertical.svelte +53 -0
- package/src/registry/blocks/buttons/index.ts +10 -0
- package/src/registry/blocks/calendar/CalendarBlock01.svelte +169 -0
- package/src/registry/blocks/calendar/CalendarBlock02.svelte +133 -0
- package/src/registry/blocks/calendar/CalendarBlock03.svelte +194 -0
- package/src/registry/blocks/calendar/CalendarBlock04.svelte +96 -0
- package/src/registry/blocks/calendar/CalendarBlock05.svelte +97 -0
- package/src/registry/blocks/calendar/CalendarBlock06.svelte +98 -0
- package/src/registry/blocks/calendar/CalendarBlock07.svelte +109 -0
- package/src/registry/blocks/calendar/CalendarBlock08.svelte +71 -0
- package/src/registry/blocks/calendar/CalendarBlock09.svelte +99 -0
- package/src/registry/blocks/calendar/CalendarBlock10.svelte +88 -0
- package/src/registry/blocks/calendar/CalendarBlock11.svelte +99 -0
- package/src/registry/blocks/calendar/CalendarBlock12.svelte +121 -0
- package/src/registry/blocks/calendar/CalendarBlock13.svelte +92 -0
- package/src/registry/blocks/calendar/CalendarBlock14.svelte +71 -0
- package/src/registry/blocks/calendar/CalendarBlock15.svelte +96 -0
- package/src/registry/blocks/calendar/CalendarBlock16.svelte +98 -0
- package/src/registry/blocks/calendar/CalendarBlock17.svelte +88 -0
- package/src/registry/blocks/calendar/CalendarBlock18.svelte +84 -0
- package/src/registry/blocks/calendar/CalendarBlock19.svelte +105 -0
- package/src/registry/blocks/calendar/CalendarBlock20.svelte +78 -0
- package/src/registry/blocks/calendar/CalendarBlock21.svelte +115 -0
- package/src/registry/blocks/calendar/CalendarBlock22.svelte +136 -0
- package/src/registry/blocks/calendar/CalendarBlock23.svelte +112 -0
- package/src/registry/blocks/calendar/CalendarBlock24.svelte +116 -0
- package/src/registry/blocks/calendar/CalendarBlock25.svelte +144 -0
- package/src/registry/blocks/calendar/CalendarBlock26.svelte +163 -0
- package/src/registry/blocks/calendar/CalendarBlock27.svelte +112 -0
- package/src/registry/blocks/calendar/CalendarBlock28.svelte +109 -0
- package/src/registry/blocks/calendar/CalendarBlock29.svelte +126 -0
- package/src/registry/blocks/calendar/CalendarBlock30.svelte +122 -0
- package/src/registry/blocks/calendar/CalendarBlock31.svelte +161 -0
- package/src/registry/blocks/calendar/CalendarBlock32.svelte +154 -0
- package/src/registry/blocks/calendar/index.ts +32 -0
- package/src/registry/blocks/card/Card01.svelte +69 -0
- package/src/registry/blocks/card/Card02.svelte +50 -0
- package/src/registry/blocks/card/Card03.svelte +60 -0
- package/src/registry/blocks/card/Card04.svelte +89 -0
- package/src/registry/blocks/card/Card05.svelte +51 -0
- package/src/registry/blocks/card/Card06.svelte +77 -0
- package/src/registry/blocks/card/Card07.svelte +35 -0
- package/src/registry/blocks/card/Card08.svelte +36 -0
- package/src/registry/blocks/card/index.ts +8 -0
- package/src/registry/blocks/cart/Cart01.svelte +183 -0
- package/src/registry/blocks/cart/Cart02.svelte +103 -0
- package/src/registry/blocks/cart/Cart03.svelte +38 -0
- package/src/registry/blocks/cart/Cart04.svelte +174 -0
- package/src/registry/blocks/cart/index.ts +4 -0
- package/src/registry/blocks/checkout/Checkout01.svelte +237 -0
- package/src/registry/blocks/checkout/Checkout02.svelte +205 -0
- package/src/registry/blocks/checkout/Checkout03.svelte +189 -0
- package/src/registry/blocks/checkout/Checkout04.svelte +109 -0
- package/src/registry/blocks/checkout/index.ts +4 -0
- package/src/registry/blocks/comparison-section/ComparisonSection01.svelte +116 -0
- package/src/registry/blocks/comparison-section/ComparisonSection02.svelte +98 -0
- package/src/registry/blocks/comparison-section/ComparisonSection03.svelte +93 -0
- package/src/registry/blocks/comparison-section/ComparisonSection04.svelte +98 -0
- package/src/registry/blocks/comparison-section/ComparisonSection05.svelte +119 -0
- package/src/registry/blocks/comparison-section/ComparisonSection06.svelte +154 -0
- package/src/registry/blocks/comparison-section/index.ts +6 -0
- package/src/registry/blocks/contact-section/ContactSection01.svelte +64 -0
- package/src/registry/blocks/contact-section/ContactSection02.svelte +108 -0
- package/src/registry/blocks/contact-section/ContactSection03.svelte +64 -0
- package/src/registry/blocks/contact-section/ContactSection04.svelte +30 -0
- package/src/registry/blocks/contact-section/ContactSection05.svelte +71 -0
- package/src/registry/blocks/contact-section/ContactSection06.svelte +88 -0
- package/src/registry/blocks/contact-section/index.ts +6 -0
- package/src/registry/blocks/cta/CTA01.svelte +44 -0
- package/src/registry/blocks/cta/CTA02.svelte +48 -0
- package/src/registry/blocks/cta/CTA03.svelte +53 -0
- package/src/registry/blocks/cta/CTA04.svelte +60 -0
- package/src/registry/blocks/cta/CTA05.svelte +53 -0
- package/src/registry/blocks/cta/CTA06.svelte +44 -0
- package/src/registry/blocks/cta/CTA07.svelte +39 -0
- package/src/registry/blocks/cta/index.ts +7 -0
- package/src/registry/blocks/dashboard/ChartsBlock01.svelte +275 -0
- package/src/registry/blocks/dashboard/DashboardBlock01.svelte +207 -0
- package/src/registry/blocks/dashboard/DashboardBlock02.svelte +259 -0
- package/src/registry/blocks/dashboard/DashboardBlock03.svelte +315 -0
- package/src/registry/blocks/dashboard/DashboardBlock04.svelte +220 -0
- package/src/registry/blocks/dashboard/DashboardBlock05.svelte +158 -0
- package/src/registry/blocks/dashboard/DashboardBlock06.svelte +173 -0
- package/src/registry/blocks/dashboard/DashboardBlock07.svelte +103 -0
- package/src/registry/blocks/dashboard/index.ts +16 -0
- package/src/registry/blocks/description-list/DescriptionList01.svelte +75 -0
- package/src/registry/blocks/description-list/DescriptionList02.svelte +50 -0
- package/src/registry/blocks/description-list/DescriptionList03.svelte +74 -0
- package/src/registry/blocks/description-list/DescriptionList04.svelte +88 -0
- package/src/registry/blocks/description-list/index.ts +4 -0
- package/src/registry/blocks/empty-lp/EmptyLP01.svelte +46 -0
- package/src/registry/blocks/empty-lp/EmptyLP02.svelte +49 -0
- package/src/registry/blocks/empty-lp/EmptyLP03.svelte +61 -0
- package/src/registry/blocks/empty-lp/EmptyLP04.svelte +37 -0
- package/src/registry/blocks/empty-lp/index.ts +4 -0
- package/src/registry/blocks/empty-section/EmptySection01.svelte +47 -0
- package/src/registry/blocks/empty-section/EmptySection02.svelte +93 -0
- package/src/registry/blocks/empty-section/EmptySection03.svelte +101 -0
- package/src/registry/blocks/empty-section/EmptySection04.svelte +76 -0
- package/src/registry/blocks/empty-section/index.ts +4 -0
- package/src/registry/blocks/faq-section/FaqSection01.svelte +114 -0
- package/src/registry/blocks/faq-section/FaqSection02.svelte +137 -0
- package/src/registry/blocks/faq-section/FaqSection03.svelte +107 -0
- package/src/registry/blocks/faq-section/FaqSection04.svelte +74 -0
- package/src/registry/blocks/faq-section/FaqSection05.svelte +69 -0
- package/src/registry/blocks/faq-section/index.ts +11 -0
- package/src/registry/blocks/feature-section/FeatureSection01.svelte +94 -0
- package/src/registry/blocks/feature-section/FeatureSection02.svelte +61 -0
- package/src/registry/blocks/feature-section/FeatureSection03.svelte +85 -0
- package/src/registry/blocks/feature-section/FeatureSection04.svelte +67 -0
- package/src/registry/blocks/feature-section/FeatureSection05.svelte +61 -0
- package/src/registry/blocks/feature-section/FeatureSection06.svelte +58 -0
- package/src/registry/blocks/feature-section/FeatureSection07.svelte +79 -0
- package/src/registry/blocks/feature-section/FeatureSection08.svelte +92 -0
- package/src/registry/blocks/feature-section/FeatureSection09.svelte +58 -0
- package/src/registry/blocks/feature-section/FeatureSection10.svelte +87 -0
- package/src/registry/blocks/feature-section/FeatureSection11.svelte +118 -0
- package/src/registry/blocks/feature-section/FeatureSection12.svelte +76 -0
- package/src/registry/blocks/feature-section/FeatureSection13.svelte +88 -0
- package/src/registry/blocks/feature-section/FeatureSection14.svelte +119 -0
- package/src/registry/blocks/feature-section/FeatureSection15.svelte +122 -0
- package/src/registry/blocks/feature-section/FeatureSection16.svelte +113 -0
- package/src/registry/blocks/feature-section/FeatureSection17.svelte +93 -0
- package/src/registry/blocks/feature-section/FeatureSection18.svelte +97 -0
- package/src/registry/blocks/feature-section/FeatureSection19.svelte +74 -0
- package/src/registry/blocks/feature-section/FeatureSection20.svelte +69 -0
- package/src/registry/blocks/feature-section/index.ts +20 -0
- package/src/registry/blocks/footer/Footer01.svelte +62 -0
- package/src/registry/blocks/footer/Footer02.svelte +67 -0
- package/src/registry/blocks/footer/Footer03.svelte +87 -0
- package/src/registry/blocks/footer/Footer04.svelte +67 -0
- package/src/registry/blocks/footer/Footer05.svelte +20 -0
- package/src/registry/blocks/footer/Footer06.svelte +107 -0
- package/src/registry/blocks/footer/Footer07.svelte +88 -0
- package/src/registry/blocks/footer/Footer08.svelte +84 -0
- package/src/registry/blocks/footer/Footer09.svelte +65 -0
- package/src/registry/blocks/footer/index.ts +19 -0
- package/src/registry/blocks/forms/SettingsBlock.svelte +329 -0
- package/src/registry/blocks/forms/index.ts +1 -0
- package/src/registry/blocks/gallery-section/GallerySection01.svelte +43 -0
- package/src/registry/blocks/gallery-section/GallerySection02.svelte +45 -0
- package/src/registry/blocks/gallery-section/GallerySection03.svelte +43 -0
- package/src/registry/blocks/gallery-section/GallerySection04.svelte +49 -0
- package/src/registry/blocks/gallery-section/GallerySection05.svelte +45 -0
- package/src/registry/blocks/gallery-section/GallerySection06.svelte +49 -0
- package/src/registry/blocks/gallery-section/GallerySection07.svelte +48 -0
- package/src/registry/blocks/gallery-section/GallerySection08.svelte +43 -0
- package/src/registry/blocks/gallery-section/GallerySection09.svelte +55 -0
- package/src/registry/blocks/gallery-section/GallerySection10.svelte +43 -0
- package/src/registry/blocks/gallery-section/GallerySection11.svelte +75 -0
- package/src/registry/blocks/gallery-section/GallerySection12.svelte +76 -0
- package/src/registry/blocks/gallery-section/index.ts +12 -0
- package/src/registry/blocks/header-section/HeaderSection01.svelte +53 -0
- package/src/registry/blocks/header-section/HeaderSection02.svelte +53 -0
- package/src/registry/blocks/header-section/HeaderSection03.svelte +61 -0
- package/src/registry/blocks/header-section/HeaderSection04.svelte +63 -0
- package/src/registry/blocks/header-section/HeaderSection05.svelte +53 -0
- package/src/registry/blocks/header-section/HeaderSection06.svelte +70 -0
- package/src/registry/blocks/header-section/HeaderSection07.svelte +97 -0
- package/src/registry/blocks/header-section/HeaderSection08.svelte +61 -0
- package/src/registry/blocks/header-section/HeaderSection09.svelte +53 -0
- package/src/registry/blocks/header-section/HeaderSection10.svelte +63 -0
- package/src/registry/blocks/header-section/HeaderSection11.svelte +68 -0
- package/src/registry/blocks/header-section/HeaderSection12.svelte +60 -0
- package/src/registry/blocks/header-section/HeaderSection13.svelte +92 -0
- package/src/registry/blocks/header-section/HeaderSection14.svelte +77 -0
- package/src/registry/blocks/header-section/HeaderSection15.svelte +49 -0
- package/src/registry/blocks/header-section/HeaderSection16.svelte +74 -0
- package/src/registry/blocks/header-section/HeaderSection17.svelte +58 -0
- package/src/registry/blocks/header-section/HeaderSection18.svelte +66 -0
- package/src/registry/blocks/header-section/HeaderSection19.svelte +47 -0
- package/src/registry/blocks/header-section/HeaderSection20.svelte +53 -0
- package/src/registry/blocks/header-section/index.ts +20 -0
- package/src/registry/blocks/hero-section/HeroSection01.svelte +69 -0
- package/src/registry/blocks/hero-section/HeroSection02.svelte +47 -0
- package/src/registry/blocks/hero-section/HeroSection03.svelte +56 -0
- package/src/registry/blocks/hero-section/HeroSection04.svelte +69 -0
- package/src/registry/blocks/hero-section/HeroSection05.svelte +73 -0
- package/src/registry/blocks/hero-section/HeroSection06.svelte +78 -0
- package/src/registry/blocks/hero-section/HeroSection07.svelte +48 -0
- package/src/registry/blocks/hero-section/HeroSection08.svelte +73 -0
- package/src/registry/blocks/hero-section/HeroSection09.svelte +51 -0
- package/src/registry/blocks/hero-section/HeroSection10.svelte +47 -0
- package/src/registry/blocks/hero-section/HeroSection11.svelte +60 -0
- package/src/registry/blocks/hero-section/HeroSection12.svelte +74 -0
- package/src/registry/blocks/hero-section/HeroSection13.svelte +86 -0
- package/src/registry/blocks/hero-section/HeroSection14.svelte +116 -0
- package/src/registry/blocks/hero-section/HeroSection15.svelte +75 -0
- package/src/registry/blocks/hero-section/HeroSection16.svelte +92 -0
- package/src/registry/blocks/hero-section/HeroSection17.svelte +78 -0
- package/src/registry/blocks/hero-section/HeroSection18.svelte +82 -0
- package/src/registry/blocks/hero-section/HeroSection19.svelte +72 -0
- package/src/registry/blocks/hero-section/HeroSection20.svelte +79 -0
- package/src/registry/blocks/hero-section/HeroSection21.svelte +75 -0
- package/src/registry/blocks/hero-section/HeroSection22.svelte +103 -0
- package/src/registry/blocks/hero-section/index.ts +22 -0
- package/src/registry/blocks/logo-section/LogoSection01.svelte +54 -0
- package/src/registry/blocks/logo-section/LogoSection02.svelte +56 -0
- package/src/registry/blocks/logo-section/LogoSection03.svelte +58 -0
- package/src/registry/blocks/logo-section/LogoSection04.svelte +58 -0
- package/src/registry/blocks/logo-section/LogoSection05.svelte +43 -0
- package/src/registry/blocks/logo-section/LogoSection06.svelte +43 -0
- package/src/registry/blocks/logo-section/LogoSection07.svelte +56 -0
- package/src/registry/blocks/logo-section/index.ts +7 -0
- package/src/registry/blocks/lp-navbar/LPNavbar01.svelte +94 -0
- package/src/registry/blocks/lp-navbar/LPNavbar02.svelte +96 -0
- package/src/registry/blocks/lp-navbar/LPNavbar03.svelte +97 -0
- package/src/registry/blocks/lp-navbar/LPNavbar04.svelte +103 -0
- package/src/registry/blocks/lp-navbar/LPNavbar05.svelte +173 -0
- package/src/registry/blocks/lp-navbar/LPNavbar06.svelte +200 -0
- package/src/registry/blocks/lp-navbar/LPNavbar07.svelte +202 -0
- package/src/registry/blocks/lp-navbar/index.ts +7 -0
- package/src/registry/blocks/mail/MailBlock.svelte +321 -0
- package/src/registry/blocks/mail/index.ts +2 -0
- package/src/registry/blocks/music/MusicBlock.svelte +239 -0
- package/src/registry/blocks/music/index.ts +1 -0
- package/src/registry/blocks/navbar/Navbar01.svelte +234 -0
- package/src/registry/blocks/navbar/Navbar02.svelte +111 -0
- package/src/registry/blocks/navbar/Navbar03.svelte +88 -0
- package/src/registry/blocks/navbar/index.ts +3 -0
- package/src/registry/blocks/not-found/NotFound01.svelte +29 -0
- package/src/registry/blocks/not-found/NotFound02.svelte +28 -0
- package/src/registry/blocks/not-found/NotFound03.svelte +25 -0
- package/src/registry/blocks/not-found/index.ts +3 -0
- package/src/registry/blocks/order-history/OrderHistory01.svelte +208 -0
- package/src/registry/blocks/order-history/OrderHistory02.svelte +131 -0
- package/src/registry/blocks/order-history/OrderHistory03.svelte +133 -0
- package/src/registry/blocks/order-history/index.ts +3 -0
- package/src/registry/blocks/page-header/PageHeader01.svelte +39 -0
- package/src/registry/blocks/page-header/PageHeader02.svelte +58 -0
- package/src/registry/blocks/page-header/PageHeader03.svelte +64 -0
- package/src/registry/blocks/page-header/PageHeader04.svelte +49 -0
- package/src/registry/blocks/page-header/PageHeader05.svelte +49 -0
- package/src/registry/blocks/page-header/PageHeader06.svelte +58 -0
- package/src/registry/blocks/page-header/PageHeader07.svelte +64 -0
- package/src/registry/blocks/page-header/PageHeader08.svelte +68 -0
- package/src/registry/blocks/page-header/index.ts +8 -0
- package/src/registry/blocks/playground/PlaygroundBlock01.svelte +162 -0
- package/src/registry/blocks/playground/PlaygroundBlock02.svelte +156 -0
- package/src/registry/blocks/playground/index.ts +2 -0
- package/src/registry/blocks/pricing-section/PricingSection01.svelte +109 -0
- package/src/registry/blocks/pricing-section/PricingSection02.svelte +145 -0
- package/src/registry/blocks/pricing-section/PricingSection03.svelte +94 -0
- package/src/registry/blocks/pricing-section/PricingSection04.svelte +103 -0
- package/src/registry/blocks/pricing-section/PricingSection05.svelte +128 -0
- package/src/registry/blocks/pricing-section/index.ts +20 -0
- package/src/registry/blocks/product-card/ProductCard01.svelte +74 -0
- package/src/registry/blocks/product-card/ProductCard02.svelte +108 -0
- package/src/registry/blocks/product-card/ProductCard03.svelte +80 -0
- package/src/registry/blocks/product-card/ProductCard04.svelte +50 -0
- package/src/registry/blocks/product-card/ProductCard05.svelte +107 -0
- package/src/registry/blocks/product-card/index.ts +5 -0
- package/src/registry/blocks/product-detail/ProductDetail01.svelte +174 -0
- package/src/registry/blocks/product-detail/ProductDetail02.svelte +170 -0
- package/src/registry/blocks/product-detail/ProductDetail03.svelte +159 -0
- package/src/registry/blocks/product-detail/ProductDetail04.svelte +106 -0
- package/src/registry/blocks/product-detail/ProductDetail05.svelte +181 -0
- package/src/registry/blocks/product-detail/index.ts +5 -0
- package/src/registry/blocks/product-listing/ProductListing01.svelte +194 -0
- package/src/registry/blocks/product-listing/ProductListing02.svelte +163 -0
- package/src/registry/blocks/product-listing/ProductListing03.svelte +173 -0
- package/src/registry/blocks/product-listing/ProductListing04.svelte +179 -0
- package/src/registry/blocks/product-listing/ProductListing05.svelte +126 -0
- package/src/registry/blocks/product-listing/index.ts +5 -0
- package/src/registry/blocks/product-reviews/ProductReviews01.svelte +156 -0
- package/src/registry/blocks/product-reviews/ProductReviews02.svelte +139 -0
- package/src/registry/blocks/product-reviews/ProductReviews03.svelte +137 -0
- package/src/registry/blocks/product-reviews/ProductReviews04.svelte +129 -0
- package/src/registry/blocks/product-reviews/index.ts +4 -0
- package/src/registry/blocks/promo-section/PromoSection01.svelte +72 -0
- package/src/registry/blocks/promo-section/PromoSection02.svelte +61 -0
- package/src/registry/blocks/promo-section/PromoSection03.svelte +110 -0
- package/src/registry/blocks/promo-section/PromoSection04.svelte +103 -0
- package/src/registry/blocks/promo-section/index.ts +4 -0
- package/src/registry/blocks/rich-text/RichText01.svelte +30 -0
- package/src/registry/blocks/rich-text/RichText02.svelte +72 -0
- package/src/registry/blocks/rich-text/RichText03.svelte +52 -0
- package/src/registry/blocks/rich-text/RichText04.svelte +44 -0
- package/src/registry/blocks/rich-text/RichText05.svelte +56 -0
- package/src/registry/blocks/rich-text/index.ts +5 -0
- package/src/registry/blocks/section/Section01.svelte +38 -0
- package/src/registry/blocks/section/Section02.svelte +90 -0
- package/src/registry/blocks/section/Section03.svelte +95 -0
- package/src/registry/blocks/section/Section04.svelte +117 -0
- package/src/registry/blocks/section/index.ts +4 -0
- package/src/registry/blocks/section-footer/SectionFooter01.svelte +39 -0
- package/src/registry/blocks/section-footer/SectionFooter02.svelte +33 -0
- package/src/registry/blocks/section-footer/SectionFooter03.svelte +33 -0
- package/src/registry/blocks/section-footer/SectionFooter04.svelte +34 -0
- package/src/registry/blocks/section-footer/SectionFooter05.svelte +69 -0
- package/src/registry/blocks/section-footer/index.ts +5 -0
- package/src/registry/blocks/section-header/SectionHeader01.svelte +39 -0
- package/src/registry/blocks/section-header/SectionHeader02.svelte +58 -0
- package/src/registry/blocks/section-header/SectionHeader03.svelte +88 -0
- package/src/registry/blocks/section-header/SectionHeader04.svelte +45 -0
- package/src/registry/blocks/section-header/SectionHeader05.svelte +64 -0
- package/src/registry/blocks/section-header/index.ts +5 -0
- package/src/registry/blocks/settings/Settings01.svelte +202 -0
- package/src/registry/blocks/settings/Settings02.svelte +201 -0
- package/src/registry/blocks/settings/Settings03.svelte +156 -0
- package/src/registry/blocks/settings/Settings04.svelte +175 -0
- package/src/registry/blocks/settings/Settings05.svelte +248 -0
- package/src/registry/blocks/settings/Settings06.svelte +120 -0
- package/src/registry/blocks/settings/Settings07.svelte +136 -0
- package/src/registry/blocks/settings/index.ts +7 -0
- package/src/registry/blocks/sidebar/SidebarLayout01.svelte +108 -0
- package/src/registry/blocks/sidebar/SidebarLayout02.svelte +75 -0
- package/src/registry/blocks/sidebar/SidebarLayout03.svelte +108 -0
- package/src/registry/blocks/sidebar/SidebarLayout04.svelte +111 -0
- package/src/registry/blocks/sidebar/SidebarLayout05.svelte +103 -0
- package/src/registry/blocks/sidebar/SidebarLayout06.svelte +122 -0
- package/src/registry/blocks/sidebar/SidebarLayout07.svelte +183 -0
- package/src/registry/blocks/sidebar/SidebarLayout08.svelte +162 -0
- package/src/registry/blocks/sidebar/SidebarLayout09.svelte +167 -0
- package/src/registry/blocks/sidebar/SidebarLayout10.svelte +159 -0
- package/src/registry/blocks/sidebar/SidebarLayout11.svelte +135 -0
- package/src/registry/blocks/sidebar/SidebarLayout12.svelte +159 -0
- package/src/registry/blocks/sidebar/SidebarLayout13.svelte +103 -0
- package/src/registry/blocks/sidebar/SidebarLayout14.svelte +87 -0
- package/src/registry/blocks/sidebar/SidebarLayout15.svelte +228 -0
- package/src/registry/blocks/sidebar/index.ts +15 -0
- package/src/registry/blocks/sign-in/SignIn01.svelte +140 -0
- package/src/registry/blocks/sign-in/SignIn02.svelte +155 -0
- package/src/registry/blocks/sign-in/SignIn03.svelte +214 -0
- package/src/registry/blocks/sign-in/SignIn04.svelte +163 -0
- package/src/registry/blocks/sign-in/SignIn05.svelte +209 -0
- package/src/registry/blocks/sign-in/SignIn06.svelte +233 -0
- package/src/registry/blocks/sign-in/SignIn07.svelte +268 -0
- package/src/registry/blocks/sign-in/SignIn08.svelte +125 -0
- package/src/registry/blocks/sign-in/SignIn09.svelte +93 -0
- package/src/registry/blocks/sign-in/SignIn10.svelte +74 -0
- package/src/registry/blocks/sign-in/index.ts +10 -0
- package/src/registry/blocks/sign-up/SignUp01.svelte +124 -0
- package/src/registry/blocks/sign-up/SignUp02.svelte +110 -0
- package/src/registry/blocks/sign-up/SignUp03.svelte +182 -0
- package/src/registry/blocks/sign-up/SignUp04.svelte +126 -0
- package/src/registry/blocks/sign-up/SignUp05.svelte +182 -0
- package/src/registry/blocks/sign-up/SignUp06.svelte +221 -0
- package/src/registry/blocks/sign-up/SignUp07.svelte +98 -0
- package/src/registry/blocks/sign-up/index.ts +7 -0
- package/src/registry/blocks/stats-section/StatsSection01.svelte +66 -0
- package/src/registry/blocks/stats-section/StatsSection02.svelte +60 -0
- package/src/registry/blocks/stats-section/StatsSection03.svelte +66 -0
- package/src/registry/blocks/stats-section/StatsSection04.svelte +66 -0
- package/src/registry/blocks/stats-section/StatsSection05.svelte +60 -0
- package/src/registry/blocks/stats-section/StatsSection06.svelte +48 -0
- package/src/registry/blocks/stats-section/StatsSection07.svelte +66 -0
- package/src/registry/blocks/stats-section/index.ts +7 -0
- package/src/registry/blocks/store-navbar/StoreNavbar01.svelte +101 -0
- package/src/registry/blocks/store-navbar/StoreNavbar02.svelte +65 -0
- package/src/registry/blocks/store-navbar/StoreNavbar03.svelte +83 -0
- package/src/registry/blocks/store-navbar/StoreNavbar04.svelte +110 -0
- package/src/registry/blocks/store-navbar/StoreNavbar05.svelte +80 -0
- package/src/registry/blocks/store-navbar/index.ts +5 -0
- package/src/registry/blocks/table-header/TableHeader01.svelte +96 -0
- package/src/registry/blocks/table-header/TableHeader02.svelte +86 -0
- package/src/registry/blocks/table-header/TableHeader03.svelte +99 -0
- package/src/registry/blocks/table-header/TableHeader04.svelte +107 -0
- package/src/registry/blocks/table-header/index.ts +4 -0
- package/src/registry/blocks/tasks/TasksBlock.svelte +286 -0
- package/src/registry/blocks/tasks/index.ts +1 -0
- package/src/registry/blocks/team-section/TeamSection01.svelte +80 -0
- package/src/registry/blocks/team-section/TeamSection02.svelte +102 -0
- package/src/registry/blocks/team-section/TeamSection03.svelte +76 -0
- package/src/registry/blocks/team-section/TeamSection04.svelte +106 -0
- package/src/registry/blocks/team-section/index.ts +13 -0
- package/src/registry/blocks/testimonials/Testimonial01.svelte +74 -0
- package/src/registry/blocks/testimonials/Testimonial02.svelte +74 -0
- package/src/registry/blocks/testimonials/Testimonial03.svelte +79 -0
- package/src/registry/blocks/testimonials/Testimonial04.svelte +113 -0
- package/src/registry/blocks/testimonials/Testimonial05.svelte +74 -0
- package/src/registry/blocks/testimonials/Testimonial06.svelte +114 -0
- package/src/registry/blocks/testimonials/Testimonial07.svelte +131 -0
- package/src/registry/blocks/testimonials/Testimonials01.svelte +60 -0
- package/src/registry/blocks/testimonials/Testimonials02.svelte +61 -0
- package/src/registry/blocks/testimonials/Testimonials03.svelte +79 -0
- package/src/registry/blocks/testimonials/Testimonials04.svelte +74 -0
- package/src/registry/blocks/testimonials/Testimonials05.svelte +68 -0
- package/src/registry/blocks/testimonials/Testimonials06.svelte +82 -0
- package/src/registry/blocks/testimonials/Testimonials07.svelte +98 -0
- package/src/registry/blocks/testimonials/index.ts +16 -0
- package/src/registry/templates/cn.ts +42 -0
- package/src/index.ts +0 -2
- package/tsconfig.json +0 -20
- /package/src/{generate-component.cjs → commands/generate-component.cjs} +0 -0
- /package/src/{generate-route.cjs → commands/generate-route.cjs} +0 -0
- /package/src/{generate-service.cjs → commands/generate-service.cjs} +0 -0
- /package/src/{manage-auth-users.cjs → commands/manage-auth-users.cjs} +0 -0
- /package/src/{setup.cjs → commands/setup.cjs} +0 -0
- /package/src/{validate-setup.cjs → commands/validate.cjs} +0 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '$lib/utils/cn';
|
|
3
|
+
import { Button } from '$lib/components/ui';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { class: className }: Props = $props();
|
|
10
|
+
|
|
11
|
+
interface CartItem {
|
|
12
|
+
id: number;
|
|
13
|
+
name: string;
|
|
14
|
+
price: number;
|
|
15
|
+
quantity: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface ProductCard {
|
|
19
|
+
id: number;
|
|
20
|
+
name: string;
|
|
21
|
+
price: number;
|
|
22
|
+
rating: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let cartItems = $state<CartItem[]>([
|
|
26
|
+
{ id: 1, name: 'Wireless Headphones', price: 129.99, quantity: 1 },
|
|
27
|
+
{ id: 2, name: 'Phone Case', price: 24.99, quantity: 1 }
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
let suggestedProducts = $state<ProductCard[]>([
|
|
31
|
+
{ id: 101, name: 'USB-C Hub', price: 34.99, rating: 4.8 },
|
|
32
|
+
{ id: 102, name: 'Portable Charger', price: 49.99, rating: 4.7 },
|
|
33
|
+
{ id: 103, name: 'Screen Protector', price: 9.99, rating: 4.9 }
|
|
34
|
+
]);
|
|
35
|
+
|
|
36
|
+
let subtotal = $derived(
|
|
37
|
+
cartItems.reduce((sum, item) => sum + item.price * item.quantity, 0)
|
|
38
|
+
);
|
|
39
|
+
let shipping = $derived(subtotal > 100 ? 0 : 9.99);
|
|
40
|
+
let tax = $derived(subtotal * 0.1);
|
|
41
|
+
let total = $derived(subtotal + shipping + tax);
|
|
42
|
+
|
|
43
|
+
function StarIcon(filled: boolean) {
|
|
44
|
+
if (filled) {
|
|
45
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2"><polygon points="12 2 15.09 10.26 24 10.35 17.77 16.01 20.16 24.02 12 18.35 3.84 24.02 6.23 16.01 0 10.35 8.91 10.26 12 2"/></polygon></svg>`;
|
|
46
|
+
}
|
|
47
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="12 2 15.09 10.26 24 10.35 17.77 16.01 20.16 24.02 12 18.35 3.84 24.02 6.23 16.01 0 10.35 8.91 10.26 12 2"/></polygon></svg>`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function TrashIcon() {
|
|
51
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function removeItem(id: number) {
|
|
55
|
+
cartItems = cartItems.filter((item) => item.id !== id);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function addToCart(product: ProductCard) {
|
|
59
|
+
const existing = cartItems.find((item) => item.id === product.id);
|
|
60
|
+
if (existing) {
|
|
61
|
+
existing.quantity += 1;
|
|
62
|
+
} else {
|
|
63
|
+
cartItems.push({
|
|
64
|
+
id: product.id,
|
|
65
|
+
name: product.name,
|
|
66
|
+
price: product.price,
|
|
67
|
+
quantity: 1
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<div class={cn('space-y-8', className)}>
|
|
74
|
+
<div>
|
|
75
|
+
<h1 class="text-3xl font-bold">Shopping Cart</h1>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<div class="grid gap-8 lg:grid-cols-3">
|
|
79
|
+
<!-- Left Column: Cart Items + Upsell -->
|
|
80
|
+
<div class="lg:col-span-2 space-y-8">
|
|
81
|
+
<!-- Cart Items -->
|
|
82
|
+
<div class="rounded-lg border bg-background overflow-hidden">
|
|
83
|
+
<div class="p-6 border-b">
|
|
84
|
+
<h2 class="text-lg font-semibold">Cart Items ({cartItems.length})</h2>
|
|
85
|
+
</div>
|
|
86
|
+
<div class="divide-y">
|
|
87
|
+
{#each cartItems as item (item.id)}
|
|
88
|
+
<div class="p-6 flex gap-4 items-start hover:bg-muted/30 transition">
|
|
89
|
+
<div class="aspect-square w-20 h-20 bg-gray-100 rounded flex-shrink-0">
|
|
90
|
+
</div>
|
|
91
|
+
<div class="flex-1 min-w-0">
|
|
92
|
+
<p class="font-medium">{item.name}</p>
|
|
93
|
+
<p class="text-sm text-muted-foreground mt-1">Qty: {item.quantity}</p>
|
|
94
|
+
<p class="font-semibold mt-2">${(item.price * item.quantity).toFixed(2)}</p>
|
|
95
|
+
</div>
|
|
96
|
+
<button
|
|
97
|
+
onclick={() => removeItem(item.id)}
|
|
98
|
+
class="p-2 hover:bg-destructive/10 text-destructive rounded transition flex-shrink-0"
|
|
99
|
+
>
|
|
100
|
+
{@html TrashIcon()}
|
|
101
|
+
</button>
|
|
102
|
+
</div>
|
|
103
|
+
{/each}
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<!-- Upsell Section -->
|
|
108
|
+
<div class="space-y-4">
|
|
109
|
+
<h2 class="text-lg font-semibold">You might also like</h2>
|
|
110
|
+
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
|
|
111
|
+
{#each suggestedProducts as product (product.id)}
|
|
112
|
+
<div class="rounded-lg border bg-background overflow-hidden hover:shadow-md transition">
|
|
113
|
+
<div class="aspect-square w-full bg-gray-100 flex items-center justify-center">
|
|
114
|
+
</div>
|
|
115
|
+
<div class="p-4 space-y-3">
|
|
116
|
+
<p class="font-medium text-sm line-clamp-2">{product.name}</p>
|
|
117
|
+
<div class="flex items-center gap-1">
|
|
118
|
+
{#each { length: 5 } as _, i}
|
|
119
|
+
<div class="text-yellow-400">
|
|
120
|
+
{@html StarIcon(i < Math.floor(product.rating))}
|
|
121
|
+
</div>
|
|
122
|
+
{/each}
|
|
123
|
+
<span class="text-xs text-muted-foreground ml-1">({product.rating})</span>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="flex items-center justify-between">
|
|
126
|
+
<p class="font-semibold">${product.price.toFixed(2)}</p>
|
|
127
|
+
<Button
|
|
128
|
+
size="sm"
|
|
129
|
+
onclick={() => addToCart(product)}
|
|
130
|
+
>
|
|
131
|
+
Add
|
|
132
|
+
</Button>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
{/each}
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
<!-- Right Column: Order Summary -->
|
|
142
|
+
<div class="lg:col-span-1">
|
|
143
|
+
<div class="rounded-lg border bg-background p-6 sticky top-6 space-y-6">
|
|
144
|
+
<div>
|
|
145
|
+
<h2 class="text-lg font-semibold mb-4">Order Summary</h2>
|
|
146
|
+
|
|
147
|
+
<div class="space-y-3 text-sm">
|
|
148
|
+
<div class="flex justify-between">
|
|
149
|
+
<span class="text-muted-foreground">Subtotal</span>
|
|
150
|
+
<span>${subtotal.toFixed(2)}</span>
|
|
151
|
+
</div>
|
|
152
|
+
<div class="flex justify-between">
|
|
153
|
+
<span class="text-muted-foreground">Shipping</span>
|
|
154
|
+
<span>{shipping === 0 ? 'FREE' : `$${shipping.toFixed(2)}`}</span>
|
|
155
|
+
</div>
|
|
156
|
+
<div class="flex justify-between">
|
|
157
|
+
<span class="text-muted-foreground">Tax</span>
|
|
158
|
+
<span>${tax.toFixed(2)}</span>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<div class="border-t mt-4 pt-4 flex justify-between font-semibold text-base">
|
|
163
|
+
<span>Total</span>
|
|
164
|
+
<span>${total.toFixed(2)}</span>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<Button class="w-full">
|
|
169
|
+
Proceed to checkout
|
|
170
|
+
</Button>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '$lib/utils/cn';
|
|
3
|
+
import { Button } from '$lib/components/ui';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { class: className }: Props = $props();
|
|
10
|
+
|
|
11
|
+
let email = $state('customer@example.com');
|
|
12
|
+
let firstName = $state('John');
|
|
13
|
+
let lastName = $state('Doe');
|
|
14
|
+
let address = $state('123 Main Street');
|
|
15
|
+
let city = $state('New York');
|
|
16
|
+
let state = $state('NY');
|
|
17
|
+
let zip = $state('10001');
|
|
18
|
+
let country = $state('United States');
|
|
19
|
+
let shippingMethod = $state('standard');
|
|
20
|
+
|
|
21
|
+
interface OrderItem {
|
|
22
|
+
id: number;
|
|
23
|
+
name: string;
|
|
24
|
+
price: number;
|
|
25
|
+
quantity: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let orderItems = $state<OrderItem[]>([
|
|
29
|
+
{ id: 1, name: 'Wireless Headphones', price: 129.99, quantity: 1 },
|
|
30
|
+
{ id: 2, name: 'Phone Case', price: 24.99, quantity: 1 }
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
let subtotal = $derived(
|
|
34
|
+
orderItems.reduce((sum, item) => sum + item.price * item.quantity, 0)
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
let shippingCost = $derived(shippingMethod === 'express' ? 24.99 : 9.99);
|
|
38
|
+
let tax = $derived(subtotal * 0.1);
|
|
39
|
+
let total = $derived(subtotal + shippingCost + tax);
|
|
40
|
+
|
|
41
|
+
function GlobeIcon() {
|
|
42
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 1 10 4M12 22a14.5 14.5 0 0 1-10-4M2 12h20M12 2a14.5 14.5 0 0 0 0 20M12 22a14.5 14.5 0 0 0 0-20"/></svg>`;
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<div class={cn('space-y-8', className)}>
|
|
47
|
+
<div>
|
|
48
|
+
<h1 class="text-3xl font-bold">Checkout</h1>
|
|
49
|
+
<p class="text-muted-foreground mt-2">Complete your purchase</p>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div class="grid gap-8 lg:grid-cols-3">
|
|
53
|
+
<!-- Left Column: Forms -->
|
|
54
|
+
<div class="lg:col-span-2 space-y-6">
|
|
55
|
+
<!-- Contact Info -->
|
|
56
|
+
<div class="rounded-lg border bg-background p-6">
|
|
57
|
+
<h2 class="text-lg font-semibold mb-4">Contact information</h2>
|
|
58
|
+
<div>
|
|
59
|
+
<label class="block text-sm font-medium mb-2">Email address</label>
|
|
60
|
+
<input
|
|
61
|
+
type="email"
|
|
62
|
+
bind:value={email}
|
|
63
|
+
placeholder="email@example.com"
|
|
64
|
+
class="w-full rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<!-- Delivery Address -->
|
|
70
|
+
<div class="rounded-lg border bg-background p-6">
|
|
71
|
+
<h2 class="text-lg font-semibold mb-4">Delivery address</h2>
|
|
72
|
+
<div class="space-y-4">
|
|
73
|
+
<div class="grid grid-cols-2 gap-4">
|
|
74
|
+
<div>
|
|
75
|
+
<label class="block text-sm font-medium mb-2">First name</label>
|
|
76
|
+
<input
|
|
77
|
+
type="text"
|
|
78
|
+
bind:value={firstName}
|
|
79
|
+
placeholder="John"
|
|
80
|
+
class="w-full rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
<div>
|
|
84
|
+
<label class="block text-sm font-medium mb-2">Last name</label>
|
|
85
|
+
<input
|
|
86
|
+
type="text"
|
|
87
|
+
bind:value={lastName}
|
|
88
|
+
placeholder="Doe"
|
|
89
|
+
class="w-full rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
|
|
90
|
+
/>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div>
|
|
95
|
+
<label class="block text-sm font-medium mb-2">Street address</label>
|
|
96
|
+
<input
|
|
97
|
+
type="text"
|
|
98
|
+
bind:value={address}
|
|
99
|
+
placeholder="Street address"
|
|
100
|
+
class="w-full rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
|
|
101
|
+
/>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<div class="grid grid-cols-2 gap-4">
|
|
105
|
+
<div>
|
|
106
|
+
<label class="block text-sm font-medium mb-2">City</label>
|
|
107
|
+
<input
|
|
108
|
+
type="text"
|
|
109
|
+
bind:value={city}
|
|
110
|
+
placeholder="City"
|
|
111
|
+
class="w-full rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
|
|
112
|
+
/>
|
|
113
|
+
</div>
|
|
114
|
+
<div>
|
|
115
|
+
<label class="block text-sm font-medium mb-2">State</label>
|
|
116
|
+
<input
|
|
117
|
+
type="text"
|
|
118
|
+
bind:value={state}
|
|
119
|
+
placeholder="State"
|
|
120
|
+
class="w-full rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<div class="grid grid-cols-2 gap-4">
|
|
126
|
+
<div>
|
|
127
|
+
<label class="block text-sm font-medium mb-2">Zip code</label>
|
|
128
|
+
<input
|
|
129
|
+
type="text"
|
|
130
|
+
bind:value={zip}
|
|
131
|
+
placeholder="Zip code"
|
|
132
|
+
class="w-full rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
|
|
133
|
+
/>
|
|
134
|
+
</div>
|
|
135
|
+
<div>
|
|
136
|
+
<label class="block text-sm font-medium mb-2">Country</label>
|
|
137
|
+
<div class="relative">
|
|
138
|
+
<select
|
|
139
|
+
bind:value={country}
|
|
140
|
+
class="w-full rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring appearance-none pr-8"
|
|
141
|
+
>
|
|
142
|
+
<option>United States</option>
|
|
143
|
+
<option>Canada</option>
|
|
144
|
+
<option>United Kingdom</option>
|
|
145
|
+
<option>Australia</option>
|
|
146
|
+
</select>
|
|
147
|
+
<div class="pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground">
|
|
148
|
+
{@html GlobeIcon()}
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<!-- Shipping Method -->
|
|
157
|
+
<div class="rounded-lg border bg-background p-6">
|
|
158
|
+
<h2 class="text-lg font-semibold mb-4">Shipping method</h2>
|
|
159
|
+
<div class="space-y-3">
|
|
160
|
+
<label class="flex items-center gap-3 p-3 border rounded-lg cursor-pointer hover:bg-muted/50 transition"
|
|
161
|
+
class:bg-muted={shippingMethod === 'standard'}
|
|
162
|
+
>
|
|
163
|
+
<input
|
|
164
|
+
type="radio"
|
|
165
|
+
bind:group={shippingMethod}
|
|
166
|
+
value="standard"
|
|
167
|
+
class="w-4 h-4"
|
|
168
|
+
/>
|
|
169
|
+
<div class="flex-1">
|
|
170
|
+
<p class="font-medium">Standard Shipping</p>
|
|
171
|
+
<p class="text-sm text-muted-foreground">Delivery in 5-7 business days</p>
|
|
172
|
+
</div>
|
|
173
|
+
<span class="font-semibold">$9.99</span>
|
|
174
|
+
</label>
|
|
175
|
+
|
|
176
|
+
<label class="flex items-center gap-3 p-3 border rounded-lg cursor-pointer hover:bg-muted/50 transition"
|
|
177
|
+
class:bg-muted={shippingMethod === 'express'}
|
|
178
|
+
>
|
|
179
|
+
<input
|
|
180
|
+
type="radio"
|
|
181
|
+
bind:group={shippingMethod}
|
|
182
|
+
value="express"
|
|
183
|
+
class="w-4 h-4"
|
|
184
|
+
/>
|
|
185
|
+
<div class="flex-1">
|
|
186
|
+
<p class="font-medium">Express Shipping</p>
|
|
187
|
+
<p class="text-sm text-muted-foreground">Delivery in 1-2 business days</p>
|
|
188
|
+
</div>
|
|
189
|
+
<span class="font-semibold">$24.99</span>
|
|
190
|
+
</label>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
<!-- Right Column: Order Summary -->
|
|
196
|
+
<div class="lg:col-span-1">
|
|
197
|
+
<div class="rounded-lg border bg-background p-6 sticky top-6 space-y-6">
|
|
198
|
+
<div>
|
|
199
|
+
<h2 class="text-lg font-semibold mb-4">Order summary</h2>
|
|
200
|
+
|
|
201
|
+
<div class="space-y-3 mb-4">
|
|
202
|
+
{#each orderItems as item (item.id)}
|
|
203
|
+
<div class="flex justify-between text-sm">
|
|
204
|
+
<span class="text-muted-foreground">{item.name} x {item.quantity}</span>
|
|
205
|
+
<span>${(item.price * item.quantity).toFixed(2)}</span>
|
|
206
|
+
</div>
|
|
207
|
+
{/each}
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<div class="border-t pt-4 space-y-2 text-sm">
|
|
211
|
+
<div class="flex justify-between">
|
|
212
|
+
<span class="text-muted-foreground">Subtotal</span>
|
|
213
|
+
<span>${subtotal.toFixed(2)}</span>
|
|
214
|
+
</div>
|
|
215
|
+
<div class="flex justify-between">
|
|
216
|
+
<span class="text-muted-foreground">Shipping</span>
|
|
217
|
+
<span>${shippingCost.toFixed(2)}</span>
|
|
218
|
+
</div>
|
|
219
|
+
<div class="flex justify-between">
|
|
220
|
+
<span class="text-muted-foreground">Tax</span>
|
|
221
|
+
<span>${tax.toFixed(2)}</span>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
<div class="border-t mt-4 pt-4 flex justify-between font-semibold text-base">
|
|
226
|
+
<span>Total</span>
|
|
227
|
+
<span>${total.toFixed(2)}</span>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
<Button class="w-full">
|
|
232
|
+
Place order
|
|
233
|
+
</Button>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '$lib/utils/cn';
|
|
3
|
+
import { Button } from '$lib/components/ui';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { class: className }: Props = $props();
|
|
10
|
+
|
|
11
|
+
let currentStep = $state(1);
|
|
12
|
+
let email = $state('customer@example.com');
|
|
13
|
+
let firstName = $state('John');
|
|
14
|
+
let lastName = $state('Doe');
|
|
15
|
+
|
|
16
|
+
const steps = [
|
|
17
|
+
{ number: 1, title: 'Cart', label: 'Cart' },
|
|
18
|
+
{ number: 2, title: 'Information', label: 'Information' },
|
|
19
|
+
{ number: 3, title: 'Shipping', label: 'Shipping' },
|
|
20
|
+
{ number: 4, title: 'Payment', label: 'Payment' }
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
function nextStep() {
|
|
24
|
+
if (currentStep < steps.length) {
|
|
25
|
+
currentStep += 1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function prevStep() {
|
|
30
|
+
if (currentStep > 1) {
|
|
31
|
+
currentStep -= 1;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function ChevronRightIcon() {
|
|
36
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>`;
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<div class={cn('space-y-8', className)}>
|
|
41
|
+
<div>
|
|
42
|
+
<h1 class="text-3xl font-bold">Checkout</h1>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<!-- Step Indicators -->
|
|
46
|
+
<div class="rounded-lg border bg-background p-6">
|
|
47
|
+
<div class="flex items-center justify-between">
|
|
48
|
+
{#each steps as step, idx}
|
|
49
|
+
<div class="flex items-center flex-1" key={step.number}>
|
|
50
|
+
<div
|
|
51
|
+
class={cn(
|
|
52
|
+
'w-10 h-10 rounded-full flex items-center justify-center font-semibold transition',
|
|
53
|
+
currentStep >= step.number
|
|
54
|
+
? 'bg-black text-white'
|
|
55
|
+
: 'bg-gray-200 text-gray-600'
|
|
56
|
+
)}
|
|
57
|
+
>
|
|
58
|
+
{step.number}
|
|
59
|
+
</div>
|
|
60
|
+
<p class="ml-3 text-sm font-medium">{step.title}</p>
|
|
61
|
+
{#if idx < steps.length - 1}
|
|
62
|
+
<div class="flex-1 h-0.5 mx-4 transition"
|
|
63
|
+
class:bg-black={currentStep > step.number}
|
|
64
|
+
class:bg-gray-200={currentStep <= step.number}
|
|
65
|
+
></div>
|
|
66
|
+
{/if}
|
|
67
|
+
</div>
|
|
68
|
+
{/each}
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<!-- Step Content -->
|
|
73
|
+
<div class="rounded-lg border bg-background p-8 min-h-[400px]">
|
|
74
|
+
{#if currentStep === 1}
|
|
75
|
+
<div class="space-y-4">
|
|
76
|
+
<h2 class="text-2xl font-semibold">Your Cart</h2>
|
|
77
|
+
<div class="space-y-3 mt-6">
|
|
78
|
+
<div class="flex justify-between p-4 border rounded-lg">
|
|
79
|
+
<span>Wireless Headphones x 1</span>
|
|
80
|
+
<span class="font-semibold">$129.99</span>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="flex justify-between p-4 border rounded-lg">
|
|
83
|
+
<span>Phone Case x 1</span>
|
|
84
|
+
<span class="font-semibold">$24.99</span>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="border-t pt-4 mt-6">
|
|
88
|
+
<div class="flex justify-between font-semibold text-lg">
|
|
89
|
+
<span>Total</span>
|
|
90
|
+
<span>$154.99</span>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
{:else if currentStep === 2}
|
|
95
|
+
<div class="space-y-4">
|
|
96
|
+
<h2 class="text-2xl font-semibold">Contact Information</h2>
|
|
97
|
+
<div class="mt-6 space-y-4">
|
|
98
|
+
<div>
|
|
99
|
+
<label class="block text-sm font-medium mb-2">Email address</label>
|
|
100
|
+
<input
|
|
101
|
+
type="email"
|
|
102
|
+
bind:value={email}
|
|
103
|
+
placeholder="email@example.com"
|
|
104
|
+
class="w-full max-w-md rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
|
|
105
|
+
/>
|
|
106
|
+
</div>
|
|
107
|
+
<div class="grid grid-cols-2 gap-4 max-w-md">
|
|
108
|
+
<div>
|
|
109
|
+
<label class="block text-sm font-medium mb-2">First name</label>
|
|
110
|
+
<input
|
|
111
|
+
type="text"
|
|
112
|
+
bind:value={firstName}
|
|
113
|
+
placeholder="John"
|
|
114
|
+
class="w-full rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
|
|
115
|
+
/>
|
|
116
|
+
</div>
|
|
117
|
+
<div>
|
|
118
|
+
<label class="block text-sm font-medium mb-2">Last name</label>
|
|
119
|
+
<input
|
|
120
|
+
type="text"
|
|
121
|
+
bind:value={lastName}
|
|
122
|
+
placeholder="Doe"
|
|
123
|
+
class="w-full rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
|
|
124
|
+
/>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
{:else if currentStep === 3}
|
|
130
|
+
<div class="space-y-4">
|
|
131
|
+
<h2 class="text-2xl font-semibold">Shipping Method</h2>
|
|
132
|
+
<div class="mt-6 space-y-3 max-w-md">
|
|
133
|
+
<label class="flex items-center gap-3 p-4 border rounded-lg cursor-pointer hover:bg-muted/50 transition">
|
|
134
|
+
<input type="radio" name="shipping" class="w-4 h-4" defaultChecked />
|
|
135
|
+
<div class="flex-1">
|
|
136
|
+
<p class="font-medium">Standard Shipping</p>
|
|
137
|
+
<p class="text-sm text-muted-foreground">5-7 business days</p>
|
|
138
|
+
</div>
|
|
139
|
+
<span class="font-semibold">$9.99</span>
|
|
140
|
+
</label>
|
|
141
|
+
<label class="flex items-center gap-3 p-4 border rounded-lg cursor-pointer hover:bg-muted/50 transition">
|
|
142
|
+
<input type="radio" name="shipping" class="w-4 h-4" />
|
|
143
|
+
<div class="flex-1">
|
|
144
|
+
<p class="font-medium">Express Shipping</p>
|
|
145
|
+
<p class="text-sm text-muted-foreground">1-2 business days</p>
|
|
146
|
+
</div>
|
|
147
|
+
<span class="font-semibold">$24.99</span>
|
|
148
|
+
</label>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
{:else if currentStep === 4}
|
|
152
|
+
<div class="space-y-4">
|
|
153
|
+
<h2 class="text-2xl font-semibold">Payment</h2>
|
|
154
|
+
<div class="mt-6 space-y-4 max-w-md">
|
|
155
|
+
<div>
|
|
156
|
+
<label class="block text-sm font-medium mb-2">Card number</label>
|
|
157
|
+
<input
|
|
158
|
+
type="text"
|
|
159
|
+
placeholder="•••• •••• •••• ••••"
|
|
160
|
+
class="w-full rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
|
|
161
|
+
/>
|
|
162
|
+
</div>
|
|
163
|
+
<div class="grid grid-cols-2 gap-4">
|
|
164
|
+
<div>
|
|
165
|
+
<label class="block text-sm font-medium mb-2">Expiry</label>
|
|
166
|
+
<input
|
|
167
|
+
type="text"
|
|
168
|
+
placeholder="MM/YY"
|
|
169
|
+
class="w-full rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
|
|
170
|
+
/>
|
|
171
|
+
</div>
|
|
172
|
+
<div>
|
|
173
|
+
<label class="block text-sm font-medium mb-2">CVV</label>
|
|
174
|
+
<input
|
|
175
|
+
type="text"
|
|
176
|
+
placeholder="•••"
|
|
177
|
+
class="w-full rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
|
|
178
|
+
/>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
{/if}
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
<!-- Navigation -->
|
|
187
|
+
<div class="flex gap-4 justify-between">
|
|
188
|
+
<Button
|
|
189
|
+
variant="outline"
|
|
190
|
+
onclick={prevStep}
|
|
191
|
+
disabled={currentStep === 1}
|
|
192
|
+
>
|
|
193
|
+
Back
|
|
194
|
+
</Button>
|
|
195
|
+
<Button
|
|
196
|
+
onclick={nextStep}
|
|
197
|
+
disabled={currentStep === steps.length}
|
|
198
|
+
>
|
|
199
|
+
{currentStep === steps.length ? 'Complete' : 'Continue'}
|
|
200
|
+
{#if currentStep < steps.length}
|
|
201
|
+
<span class="ml-2">{@html ChevronRightIcon()}</span>
|
|
202
|
+
{/if}
|
|
203
|
+
</Button>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|