@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,161 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
CalendarBlock31.svelte
|
|
3
|
+
Bottom-sheet / drawer calendar — dark overlay behind a white card that slides up
|
|
4
|
+
from the bottom, with a drag handle and a single-month range picker.
|
|
5
|
+
-->
|
|
6
|
+
<script lang="ts">
|
|
7
|
+
import { cn } from '$lib/utils/cn';
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
class: className = '',
|
|
11
|
+
open = false,
|
|
12
|
+
startDate = null,
|
|
13
|
+
endDate = null,
|
|
14
|
+
title = 'Select Dates',
|
|
15
|
+
onclose = () => {}
|
|
16
|
+
}: {
|
|
17
|
+
class?: string;
|
|
18
|
+
open?: boolean;
|
|
19
|
+
startDate?: Date | null;
|
|
20
|
+
endDate?: Date | null;
|
|
21
|
+
title?: string;
|
|
22
|
+
onclose?: () => void;
|
|
23
|
+
} = $props();
|
|
24
|
+
|
|
25
|
+
const today = new Date();
|
|
26
|
+
let viewYear = $state(today.getFullYear());
|
|
27
|
+
let viewMonth = $state(today.getMonth());
|
|
28
|
+
|
|
29
|
+
const DAYS = ['Su','Mo','Tu','We','Th','Fr','Sa'];
|
|
30
|
+
const MONTHS = ['January','February','March','April','May','June','July','August','September','October','November','December'];
|
|
31
|
+
|
|
32
|
+
function getDim(y: number, m: number) { return new Date(y, m + 1, 0).getDate(); }
|
|
33
|
+
function getCalDays(y: number, m: number) {
|
|
34
|
+
const dim = getDim(y, m), fd = new Date(y, m, 1).getDay(), prev = getDim(y, m - 1);
|
|
35
|
+
const days: Array<{ day: number; cur: boolean }> = [];
|
|
36
|
+
for (let i = fd - 1; i >= 0; i--) days.push({ day: prev - i, cur: false });
|
|
37
|
+
for (let i = 1; i <= dim; i++) days.push({ day: i, cur: true });
|
|
38
|
+
while (days.length < 42) days.push({ day: days.length - dim - fd + 2, cur: false });
|
|
39
|
+
return days;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function inRange(d: number) {
|
|
43
|
+
const n = new Date(viewYear, viewMonth, d).getTime();
|
|
44
|
+
const s = startDate?.getTime(), e = endDate?.getTime();
|
|
45
|
+
if (!s || !e) return false;
|
|
46
|
+
const [lo, hi] = s <= e ? [s, e] : [e, s];
|
|
47
|
+
return n >= lo && n <= hi;
|
|
48
|
+
}
|
|
49
|
+
function isEdge(d: number) {
|
|
50
|
+
const n = new Date(viewYear, viewMonth, d).getTime();
|
|
51
|
+
return n === startDate?.getTime() || n === endDate?.getTime();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function handleClick(day: number) {
|
|
55
|
+
const clicked = new Date(viewYear, viewMonth, day);
|
|
56
|
+
if (!startDate || endDate) { startDate = clicked; endDate = null; }
|
|
57
|
+
else endDate = clicked;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function formatRange() {
|
|
61
|
+
if (!startDate && !endDate) return 'No dates selected';
|
|
62
|
+
const fmt = (d: Date) => d.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
|
|
63
|
+
if (startDate && !endDate) return fmt(startDate);
|
|
64
|
+
const [a, b] = (startDate! <= endDate!) ? [startDate!, endDate!] : [endDate!, startDate!];
|
|
65
|
+
return `${fmt(a)} – ${fmt(b)}`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function prev() { if (viewMonth === 0) { viewMonth = 11; viewYear--; } else viewMonth--; }
|
|
69
|
+
function next() { if (viewMonth === 11) { viewMonth = 0; viewYear++; } else viewMonth++; }
|
|
70
|
+
let calDays = $derived(getCalDays(viewYear, viewMonth));
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<!-- This component renders as a bottom-sheet overlay -->
|
|
74
|
+
<div class={cn('relative', className)}>
|
|
75
|
+
<!-- Trigger button (preview) -->
|
|
76
|
+
<button
|
|
77
|
+
type="button"
|
|
78
|
+
onclick={() => (open = true)}
|
|
79
|
+
class="flex w-full items-center justify-between rounded-md border px-4 py-3 text-sm hover:bg-muted"
|
|
80
|
+
>
|
|
81
|
+
<div class="flex items-center gap-2">
|
|
82
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-muted-foreground"><rect width="18" height="18" x="3" y="4" rx="2"/><line x1="16" x2="16" y1="2" y2="6"/><line x1="8" x2="8" y1="2" y2="6"/><line x1="3" x2="21" y1="10" y2="10"/></svg>
|
|
83
|
+
<span class={startDate ? '' : 'text-muted-foreground'}>{formatRange()}</span>
|
|
84
|
+
</div>
|
|
85
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-muted-foreground"><path d="m18 15-6-6-6 6"/></svg>
|
|
86
|
+
</button>
|
|
87
|
+
|
|
88
|
+
<!-- Bottom sheet overlay -->
|
|
89
|
+
{#if open}
|
|
90
|
+
<!-- Dark backdrop -->
|
|
91
|
+
<div
|
|
92
|
+
class="fixed inset-0 z-40 bg-black/50"
|
|
93
|
+
onclick={() => { open = false; onclose(); }}
|
|
94
|
+
role="presentation"
|
|
95
|
+
></div>
|
|
96
|
+
|
|
97
|
+
<!-- Sheet -->
|
|
98
|
+
<div class="fixed bottom-0 left-0 right-0 z-50 flex flex-col rounded-t-2xl bg-background shadow-xl">
|
|
99
|
+
<!-- Drag handle -->
|
|
100
|
+
<div class="flex justify-center pt-3 pb-1">
|
|
101
|
+
<div class="h-1 w-10 rounded-full bg-muted-foreground/30"></div>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<div class="p-5">
|
|
105
|
+
<!-- Header -->
|
|
106
|
+
<div class="mb-4 flex items-center justify-between">
|
|
107
|
+
<h2 class="text-base font-semibold">{title}</h2>
|
|
108
|
+
<button
|
|
109
|
+
type="button"
|
|
110
|
+
onclick={() => { open = false; onclose(); }}
|
|
111
|
+
class="flex h-7 w-7 items-center justify-center rounded-full hover:bg-muted"
|
|
112
|
+
>
|
|
113
|
+
<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"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>
|
|
114
|
+
</button>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<!-- Month nav -->
|
|
118
|
+
<div class="mb-3 flex items-center justify-between">
|
|
119
|
+
<button type="button" onclick={prev} class="flex h-8 w-8 items-center justify-center rounded-full hover:bg-muted">
|
|
120
|
+
<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"><path d="m15 18-6-6 6-6"/></svg>
|
|
121
|
+
</button>
|
|
122
|
+
<span class="text-sm font-medium">{MONTHS[viewMonth]} {viewYear}</span>
|
|
123
|
+
<button type="button" onclick={next} class="flex h-8 w-8 items-center justify-center rounded-full hover:bg-muted">
|
|
124
|
+
<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"><path d="m9 18 6-6-6-6"/></svg>
|
|
125
|
+
</button>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
<!-- Calendar grid -->
|
|
129
|
+
<div class="grid grid-cols-7">
|
|
130
|
+
{#each DAYS as d}
|
|
131
|
+
<div class="flex h-10 items-center justify-center text-xs font-medium text-muted-foreground">{d}</div>
|
|
132
|
+
{/each}
|
|
133
|
+
{#each calDays as { day, cur }}
|
|
134
|
+
<button
|
|
135
|
+
type="button"
|
|
136
|
+
class={cn(
|
|
137
|
+
'flex h-10 items-center justify-center text-sm transition-colors',
|
|
138
|
+
!cur && 'text-muted-foreground/40 pointer-events-none',
|
|
139
|
+
cur && inRange(day) && !isEdge(day) && 'bg-muted',
|
|
140
|
+
cur && isEdge(day) && 'rounded-full bg-primary text-primary-foreground',
|
|
141
|
+
cur && !inRange(day) && 'rounded-full hover:bg-muted'
|
|
142
|
+
)}
|
|
143
|
+
onclick={() => cur && handleClick(day)}
|
|
144
|
+
disabled={!cur}
|
|
145
|
+
>{day}</button>
|
|
146
|
+
{/each}
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<!-- Range summary + actions -->
|
|
150
|
+
<div class="mt-4 flex items-center justify-between border-t pt-4">
|
|
151
|
+
<span class="text-sm text-muted-foreground">{formatRange()}</span>
|
|
152
|
+
<button
|
|
153
|
+
type="button"
|
|
154
|
+
onclick={() => { open = false; onclose(); }}
|
|
155
|
+
class="rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90"
|
|
156
|
+
>Apply</button>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
{/if}
|
|
161
|
+
</div>
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
CalendarBlock32.svelte
|
|
3
|
+
Side-by-side appointment booking — single month calendar on the left,
|
|
4
|
+
scrollable 15-min time slot list on the right, with a booking confirmation
|
|
5
|
+
summary and a Continue button at the bottom.
|
|
6
|
+
-->
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { cn } from '$lib/utils/cn';
|
|
9
|
+
import { Button } from '$lib/components/ui';
|
|
10
|
+
|
|
11
|
+
let {
|
|
12
|
+
class: className = '',
|
|
13
|
+
selectedDate = null,
|
|
14
|
+
selectedSlot = null as string | null,
|
|
15
|
+
title = 'Book a time',
|
|
16
|
+
subtitle = 'Select a date and time slot',
|
|
17
|
+
slots = generateSlots(),
|
|
18
|
+
oncontinue = (_date: Date | null, _slot: string | null) => {}
|
|
19
|
+
}: {
|
|
20
|
+
class?: string;
|
|
21
|
+
selectedDate?: Date | null;
|
|
22
|
+
selectedSlot?: string | null;
|
|
23
|
+
title?: string;
|
|
24
|
+
subtitle?: string;
|
|
25
|
+
slots?: string[];
|
|
26
|
+
oncontinue?: (date: Date | null, slot: string | null) => void;
|
|
27
|
+
} = $props();
|
|
28
|
+
|
|
29
|
+
function generateSlots(): string[] {
|
|
30
|
+
const result: string[] = [];
|
|
31
|
+
for (let h = 9; h < 18; h++) {
|
|
32
|
+
for (let m = 0; m < 60; m += 15) {
|
|
33
|
+
result.push(`${String(h).padStart(2,'0')}:${String(m).padStart(2,'0')}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const today = new Date();
|
|
40
|
+
let month = $state(selectedDate?.getMonth() ?? today.getMonth());
|
|
41
|
+
let year = $state(selectedDate?.getFullYear() ?? today.getFullYear());
|
|
42
|
+
|
|
43
|
+
const DAYS = ['Su','Mo','Tu','We','Th','Fr','Sa'];
|
|
44
|
+
const MONTHS = ['January','February','March','April','May','June','July','August','September','October','November','December'];
|
|
45
|
+
|
|
46
|
+
function getDim(y: number, m: number) { return new Date(y, m + 1, 0).getDate(); }
|
|
47
|
+
function getCalDays(y: number, m: number) {
|
|
48
|
+
const dim = getDim(y, m), fd = new Date(y, m, 1).getDay(), prev = getDim(y, m - 1);
|
|
49
|
+
const days: Array<{ day: number; cur: boolean }> = [];
|
|
50
|
+
for (let i = fd - 1; i >= 0; i--) days.push({ day: prev - i, cur: false });
|
|
51
|
+
for (let i = 1; i <= dim; i++) days.push({ day: i, cur: true });
|
|
52
|
+
while (days.length < 42) days.push({ day: days.length - dim - fd + 2, cur: false });
|
|
53
|
+
return days;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function isSelected(d: number) { return selectedDate?.getFullYear() === year && selectedDate?.getMonth() === month && selectedDate?.getDate() === d; }
|
|
57
|
+
function isToday(d: number) { return today.getFullYear() === year && today.getMonth() === month && today.getDate() === d; }
|
|
58
|
+
function isPast(d: number) {
|
|
59
|
+
const t = new Date(year, month, d);
|
|
60
|
+
t.setHours(23,59,59,999);
|
|
61
|
+
return t < today;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function formatBooking() {
|
|
65
|
+
if (!selectedDate || !selectedSlot) return null;
|
|
66
|
+
return `${selectedDate.toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric' })} at ${selectedSlot}`;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function prev() { if (month === 0) { month = 11; year--; } else month--; }
|
|
70
|
+
function next() { if (month === 11) { month = 0; year++; } else month++; }
|
|
71
|
+
let calDays = $derived(getCalDays(year, month));
|
|
72
|
+
let booking = $derived(formatBooking());
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<div class={cn('flex flex-col gap-4 rounded-xl border bg-background p-5', className)}>
|
|
76
|
+
<!-- Header -->
|
|
77
|
+
<div>
|
|
78
|
+
<h2 class="text-base font-semibold">{title}</h2>
|
|
79
|
+
<p class="text-sm text-muted-foreground">{subtitle}</p>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<!-- Calendar + time slots side by side -->
|
|
83
|
+
<div class="flex gap-4">
|
|
84
|
+
<!-- Calendar -->
|
|
85
|
+
<div class="flex flex-col">
|
|
86
|
+
<div class="mb-3 flex items-center justify-between">
|
|
87
|
+
<button type="button" onclick={prev} class="flex h-7 w-7 items-center justify-center rounded hover:bg-muted">
|
|
88
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg>
|
|
89
|
+
</button>
|
|
90
|
+
<span class="text-xs font-medium">{MONTHS[month]} {year}</span>
|
|
91
|
+
<button type="button" onclick={next} class="flex h-7 w-7 items-center justify-center rounded hover:bg-muted">
|
|
92
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6"/></svg>
|
|
93
|
+
</button>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<div class="grid grid-cols-7">
|
|
97
|
+
{#each DAYS as d}
|
|
98
|
+
<div class="flex h-7 w-7 items-center justify-center text-[10px] font-medium text-muted-foreground">{d}</div>
|
|
99
|
+
{/each}
|
|
100
|
+
{#each calDays as { day, cur }}
|
|
101
|
+
<button
|
|
102
|
+
type="button"
|
|
103
|
+
class={cn(
|
|
104
|
+
'flex h-7 w-7 items-center justify-center rounded-full text-xs transition-colors',
|
|
105
|
+
(!cur || isPast(day)) && 'text-muted-foreground/40 pointer-events-none',
|
|
106
|
+
cur && !isPast(day) && 'hover:bg-muted',
|
|
107
|
+
cur && !isPast(day) && isToday(day) && !isSelected(day) && 'border border-primary text-primary',
|
|
108
|
+
cur && !isPast(day) && isSelected(day) && 'bg-primary text-primary-foreground hover:bg-primary'
|
|
109
|
+
)}
|
|
110
|
+
onclick={() => { if (cur && !isPast(day)) { selectedDate = new Date(year, month, day); selectedSlot = null; } }}
|
|
111
|
+
disabled={!cur || isPast(day)}
|
|
112
|
+
>{day}</button>
|
|
113
|
+
{/each}
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<!-- Time slots -->
|
|
118
|
+
<div class="flex flex-col gap-1 overflow-y-auto" style="max-height: 260px; min-width: 90px;">
|
|
119
|
+
<p class="mb-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground">
|
|
120
|
+
{selectedDate ? selectedDate.toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric' }) : 'Select a date'}
|
|
121
|
+
</p>
|
|
122
|
+
{#if selectedDate}
|
|
123
|
+
{#each slots as slot}
|
|
124
|
+
<button
|
|
125
|
+
type="button"
|
|
126
|
+
onclick={() => (selectedSlot = slot)}
|
|
127
|
+
class={cn(
|
|
128
|
+
'rounded-md border px-3 py-1.5 text-xs font-medium transition-colors hover:bg-muted',
|
|
129
|
+
selectedSlot === slot && 'border-primary bg-primary text-primary-foreground hover:bg-primary'
|
|
130
|
+
)}
|
|
131
|
+
>{slot}</button>
|
|
132
|
+
{/each}
|
|
133
|
+
{:else}
|
|
134
|
+
<p class="text-xs text-muted-foreground">Pick a date first</p>
|
|
135
|
+
{/if}
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<!-- Booking summary + CTA -->
|
|
140
|
+
<div class="flex items-center justify-between border-t pt-4">
|
|
141
|
+
<div class="text-sm">
|
|
142
|
+
{#if booking}
|
|
143
|
+
<p class="font-medium">{booking}</p>
|
|
144
|
+
<p class="text-xs text-muted-foreground">Tap Continue to confirm</p>
|
|
145
|
+
{:else}
|
|
146
|
+
<p class="text-muted-foreground">No time selected yet</p>
|
|
147
|
+
{/if}
|
|
148
|
+
</div>
|
|
149
|
+
<Button
|
|
150
|
+
onclick={() => oncontinue(selectedDate, selectedSlot)}
|
|
151
|
+
disabled={!selectedDate || !selectedSlot}
|
|
152
|
+
>Continue</Button>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export { default as CalendarBlock01 } from './CalendarBlock01.svelte';
|
|
2
|
+
export { default as CalendarBlock02 } from './CalendarBlock02.svelte';
|
|
3
|
+
export { default as CalendarBlock03 } from './CalendarBlock03.svelte';
|
|
4
|
+
export { default as CalendarBlock04 } from './CalendarBlock04.svelte';
|
|
5
|
+
export { default as CalendarBlock05 } from './CalendarBlock05.svelte';
|
|
6
|
+
export { default as CalendarBlock06 } from './CalendarBlock06.svelte';
|
|
7
|
+
export { default as CalendarBlock07 } from './CalendarBlock07.svelte';
|
|
8
|
+
export { default as CalendarBlock08 } from './CalendarBlock08.svelte';
|
|
9
|
+
export { default as CalendarBlock09 } from './CalendarBlock09.svelte';
|
|
10
|
+
export { default as CalendarBlock10 } from './CalendarBlock10.svelte';
|
|
11
|
+
export { default as CalendarBlock11 } from './CalendarBlock11.svelte';
|
|
12
|
+
export { default as CalendarBlock12 } from './CalendarBlock12.svelte';
|
|
13
|
+
export { default as CalendarBlock13 } from './CalendarBlock13.svelte';
|
|
14
|
+
export { default as CalendarBlock14 } from './CalendarBlock14.svelte';
|
|
15
|
+
export { default as CalendarBlock15 } from './CalendarBlock15.svelte';
|
|
16
|
+
export { default as CalendarBlock16 } from './CalendarBlock16.svelte';
|
|
17
|
+
export { default as CalendarBlock17 } from './CalendarBlock17.svelte';
|
|
18
|
+
export { default as CalendarBlock18 } from './CalendarBlock18.svelte';
|
|
19
|
+
export { default as CalendarBlock19 } from './CalendarBlock19.svelte';
|
|
20
|
+
export { default as CalendarBlock20 } from './CalendarBlock20.svelte';
|
|
21
|
+
export { default as CalendarBlock21 } from './CalendarBlock21.svelte';
|
|
22
|
+
export { default as CalendarBlock22 } from './CalendarBlock22.svelte';
|
|
23
|
+
export { default as CalendarBlock23 } from './CalendarBlock23.svelte';
|
|
24
|
+
export { default as CalendarBlock24 } from './CalendarBlock24.svelte';
|
|
25
|
+
export { default as CalendarBlock25 } from './CalendarBlock25.svelte';
|
|
26
|
+
export { default as CalendarBlock26 } from './CalendarBlock26.svelte';
|
|
27
|
+
export { default as CalendarBlock27 } from './CalendarBlock27.svelte';
|
|
28
|
+
export { default as CalendarBlock28 } from './CalendarBlock28.svelte';
|
|
29
|
+
export { default as CalendarBlock29 } from './CalendarBlock29.svelte';
|
|
30
|
+
export { default as CalendarBlock30 } from './CalendarBlock30.svelte';
|
|
31
|
+
export { default as CalendarBlock31 } from './CalendarBlock31.svelte';
|
|
32
|
+
export { default as CalendarBlock32 } from './CalendarBlock32.svelte';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Card01.svelte
|
|
3
|
+
Person card: avatar (circle) + name + badge + description + Email/Call action buttons.
|
|
4
|
+
Desktop: horizontal layout. Mobile: stacked.
|
|
5
|
+
-->
|
|
6
|
+
<script lang="ts">
|
|
7
|
+
import { cn } from '$lib/utils/cn';
|
|
8
|
+
import { Button } from '$lib/components/ui';
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
class: className = '',
|
|
12
|
+
name = 'Title Text',
|
|
13
|
+
badge = 'Admin',
|
|
14
|
+
description = 'This is a card description.',
|
|
15
|
+
avatar = '',
|
|
16
|
+
onemail = () => {},
|
|
17
|
+
oncall = () => {}
|
|
18
|
+
}: {
|
|
19
|
+
class?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
badge?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
avatar?: string;
|
|
24
|
+
onemail?: () => void;
|
|
25
|
+
oncall?: () => void;
|
|
26
|
+
} = $props();
|
|
27
|
+
|
|
28
|
+
function initials(n: string) {
|
|
29
|
+
return n.split(' ').map(w => w[0]).join('').slice(0, 2).toUpperCase();
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<div class={cn('rounded-lg border bg-background p-4', className)}>
|
|
34
|
+
<!-- Header row -->
|
|
35
|
+
<div class="flex items-start gap-3">
|
|
36
|
+
<div class="relative h-10 w-10 shrink-0 overflow-hidden rounded-full">
|
|
37
|
+
{#if avatar}
|
|
38
|
+
<img src={avatar} alt={name} class="h-full w-full object-cover" />
|
|
39
|
+
{:else}
|
|
40
|
+
<div class="flex h-full w-full items-center justify-center bg-muted text-xs font-semibold">
|
|
41
|
+
{initials(name)}
|
|
42
|
+
</div>
|
|
43
|
+
{/if}
|
|
44
|
+
</div>
|
|
45
|
+
<div class="flex-1 min-w-0">
|
|
46
|
+
<div class="flex items-center gap-2">
|
|
47
|
+
<p class="font-semibold truncate">{name}</p>
|
|
48
|
+
{#if badge}
|
|
49
|
+
<span class="shrink-0 rounded-full bg-foreground px-2 py-0.5 text-[10px] font-semibold text-background">{badge}</span>
|
|
50
|
+
{/if}
|
|
51
|
+
</div>
|
|
52
|
+
{#if description}
|
|
53
|
+
<p class="mt-0.5 text-sm text-muted-foreground">{description}</p>
|
|
54
|
+
{/if}
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<!-- Actions -->
|
|
59
|
+
<div class="mt-4 flex items-center gap-0 divide-x rounded-md border">
|
|
60
|
+
<Button variant="ghost" size="sm" onclick={onemail} class="flex-1 gap-1.5 rounded-r-none">
|
|
61
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="4" width="20" height="16" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/></svg>
|
|
62
|
+
Email
|
|
63
|
+
</Button>
|
|
64
|
+
<Button variant="ghost" size="sm" onclick={oncall} class="flex-1 gap-1.5 rounded-l-none">
|
|
65
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 12a19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 3.56 2h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z"/></svg>
|
|
66
|
+
Call
|
|
67
|
+
</Button>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Card02.svelte
|
|
3
|
+
Person card: avatar + name + badge + description. No action buttons.
|
|
4
|
+
-->
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { cn } from '$lib/utils/cn';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
class: className = '',
|
|
10
|
+
name = 'Title Text',
|
|
11
|
+
badge = 'Admin',
|
|
12
|
+
description = 'This is a card description.',
|
|
13
|
+
avatar = ''
|
|
14
|
+
}: {
|
|
15
|
+
class?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
badge?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
avatar?: string;
|
|
20
|
+
} = $props();
|
|
21
|
+
|
|
22
|
+
function initials(n: string) {
|
|
23
|
+
return n.split(' ').map(w => w[0]).join('').slice(0, 2).toUpperCase();
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<div class={cn('rounded-lg border bg-background p-4', className)}>
|
|
28
|
+
<div class="flex items-start gap-3">
|
|
29
|
+
<div class="relative h-10 w-10 shrink-0 overflow-hidden rounded-full">
|
|
30
|
+
{#if avatar}
|
|
31
|
+
<img src={avatar} alt={name} class="h-full w-full object-cover" />
|
|
32
|
+
{:else}
|
|
33
|
+
<div class="flex h-full w-full items-center justify-center bg-muted text-xs font-semibold">
|
|
34
|
+
{initials(name)}
|
|
35
|
+
</div>
|
|
36
|
+
{/if}
|
|
37
|
+
</div>
|
|
38
|
+
<div class="flex-1 min-w-0">
|
|
39
|
+
<div class="flex items-center gap-2">
|
|
40
|
+
<p class="font-semibold truncate">{name}</p>
|
|
41
|
+
{#if badge}
|
|
42
|
+
<span class="shrink-0 rounded-full bg-foreground px-2 py-0.5 text-[10px] font-semibold text-background">{badge}</span>
|
|
43
|
+
{/if}
|
|
44
|
+
</div>
|
|
45
|
+
{#if description}
|
|
46
|
+
<p class="mt-0.5 text-sm text-muted-foreground">{description}</p>
|
|
47
|
+
{/if}
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Card03.svelte
|
|
3
|
+
Person card: centered layout — large rounded-xl avatar at top, name + description centered,
|
|
4
|
+
Email/Call buttons at bottom.
|
|
5
|
+
-->
|
|
6
|
+
<script lang="ts">
|
|
7
|
+
import { cn } from '$lib/utils/cn';
|
|
8
|
+
import { Button } from '$lib/components/ui';
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
class: className = '',
|
|
12
|
+
name = 'Title Text',
|
|
13
|
+
description = 'This is a card description.',
|
|
14
|
+
avatar = '',
|
|
15
|
+
onemail = () => {},
|
|
16
|
+
oncall = () => {}
|
|
17
|
+
}: {
|
|
18
|
+
class?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
avatar?: string;
|
|
22
|
+
onemail?: () => void;
|
|
23
|
+
oncall?: () => void;
|
|
24
|
+
} = $props();
|
|
25
|
+
|
|
26
|
+
function initials(n: string) {
|
|
27
|
+
return n.split(' ').map(w => w[0]).join('').slice(0, 2).toUpperCase();
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<div class={cn('rounded-lg border bg-background p-6', className)}>
|
|
32
|
+
<!-- Centered avatar + info -->
|
|
33
|
+
<div class="flex flex-col items-center text-center">
|
|
34
|
+
<div class="mb-3 h-16 w-16 overflow-hidden rounded-xl">
|
|
35
|
+
{#if avatar}
|
|
36
|
+
<img src={avatar} alt={name} class="h-full w-full object-cover" />
|
|
37
|
+
{:else}
|
|
38
|
+
<div class="flex h-full w-full items-center justify-center bg-muted text-sm font-semibold">
|
|
39
|
+
{initials(name)}
|
|
40
|
+
</div>
|
|
41
|
+
{/if}
|
|
42
|
+
</div>
|
|
43
|
+
<p class="font-bold">{name}</p>
|
|
44
|
+
{#if description}
|
|
45
|
+
<p class="mt-1 text-sm text-muted-foreground">{description}</p>
|
|
46
|
+
{/if}
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<!-- Actions -->
|
|
50
|
+
<div class="mt-4 flex items-center gap-0 divide-x rounded-md border">
|
|
51
|
+
<Button variant="ghost" size="sm" onclick={onemail} class="flex-1 gap-1.5 rounded-r-none">
|
|
52
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="4" width="20" height="16" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/></svg>
|
|
53
|
+
Email
|
|
54
|
+
</Button>
|
|
55
|
+
<Button variant="ghost" size="sm" onclick={oncall} class="flex-1 gap-1.5 rounded-l-none">
|
|
56
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 12a19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 3.56 2h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z"/></svg>
|
|
57
|
+
Call
|
|
58
|
+
</Button>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Card04.svelte
|
|
3
|
+
Project card: status badge + title + avatar stack top-right + metadata row
|
|
4
|
+
(category, location, assignee) + status/stage footer + updated timestamp.
|
|
5
|
+
-->
|
|
6
|
+
<script lang="ts">
|
|
7
|
+
import { cn } from '$lib/utils/cn';
|
|
8
|
+
|
|
9
|
+
interface Assignee { name: string; avatar?: string; }
|
|
10
|
+
|
|
11
|
+
let {
|
|
12
|
+
class: className = '',
|
|
13
|
+
status = 'In progress',
|
|
14
|
+
title = 'Summer Camp',
|
|
15
|
+
category = 'Camp',
|
|
16
|
+
location = 'London, Great Britain',
|
|
17
|
+
assignee = 'Alex Johnson',
|
|
18
|
+
stage = 'Pre-Production (2/4)',
|
|
19
|
+
updatedAt = 'Updated 4h ago',
|
|
20
|
+
assignees = [] as Assignee[]
|
|
21
|
+
}: {
|
|
22
|
+
class?: string;
|
|
23
|
+
status?: string;
|
|
24
|
+
title?: string;
|
|
25
|
+
category?: string;
|
|
26
|
+
location?: string;
|
|
27
|
+
assignee?: string;
|
|
28
|
+
stage?: string;
|
|
29
|
+
updatedAt?: string;
|
|
30
|
+
assignees?: Assignee[];
|
|
31
|
+
} = $props();
|
|
32
|
+
|
|
33
|
+
function initials(n: string) {
|
|
34
|
+
return n.split(' ').map(w => w[0]).join('').slice(0, 2).toUpperCase();
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<div class={cn('rounded-lg border bg-background p-4', className)}>
|
|
39
|
+
<!-- Top row: status + avatar stack -->
|
|
40
|
+
<div class="flex items-start justify-between gap-2">
|
|
41
|
+
<span class="inline-flex items-center rounded-full bg-foreground px-2.5 py-0.5 text-xs font-medium text-background">{status}</span>
|
|
42
|
+
<!-- Avatar stack -->
|
|
43
|
+
{#if assignees.length}
|
|
44
|
+
<div class="flex -space-x-2">
|
|
45
|
+
{#each assignees.slice(0, 5) as a}
|
|
46
|
+
<div class="h-6 w-6 overflow-hidden rounded-full border-2 border-background">
|
|
47
|
+
{#if a.avatar}
|
|
48
|
+
<img src={a.avatar} alt={a.name} class="h-full w-full object-cover" />
|
|
49
|
+
{:else}
|
|
50
|
+
<div class="flex h-full w-full items-center justify-center bg-muted text-[8px] font-semibold">{initials(a.name)}</div>
|
|
51
|
+
{/if}
|
|
52
|
+
</div>
|
|
53
|
+
{/each}
|
|
54
|
+
</div>
|
|
55
|
+
{/if}
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<!-- Title -->
|
|
59
|
+
<p class="mt-2 font-bold">{title}</p>
|
|
60
|
+
|
|
61
|
+
<!-- Metadata row -->
|
|
62
|
+
<div class="mt-1 flex flex-wrap items-center gap-3 text-xs text-muted-foreground">
|
|
63
|
+
{#if category}
|
|
64
|
+
<span class="flex items-center gap-1">
|
|
65
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2z"/></svg>
|
|
66
|
+
{category}
|
|
67
|
+
</span>
|
|
68
|
+
{/if}
|
|
69
|
+
{#if location}
|
|
70
|
+
<span class="flex items-center gap-1">
|
|
71
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0z"/><circle cx="12" cy="10" r="3"/></svg>
|
|
72
|
+
{location}
|
|
73
|
+
</span>
|
|
74
|
+
{/if}
|
|
75
|
+
{#if assignee}
|
|
76
|
+
<span class="flex items-center gap-1">
|
|
77
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
|
|
78
|
+
{assignee}
|
|
79
|
+
</span>
|
|
80
|
+
{/if}
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<!-- Footer -->
|
|
84
|
+
<div class="mt-3 flex items-center gap-2 border-t pt-3 text-xs text-muted-foreground">
|
|
85
|
+
{#if stage}<span class="font-medium text-foreground">{stage}</span>{/if}
|
|
86
|
+
{#if stage && updatedAt}<span>|</span>{/if}
|
|
87
|
+
{#if updatedAt}<span>{updatedAt}</span>{/if}
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|