@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,162 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
SidebarLayout08.svelte
|
|
3
|
+
Collapsible tree nav with platform/projects sections, footer quick-links, and user avatar.
|
|
4
|
+
-->
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
|
+
import { cn } from '$lib/utils/cn';
|
|
8
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbSeparator } from '$lib/components/ui';
|
|
9
|
+
|
|
10
|
+
type NavChild = { label: string; href: string; active?: boolean };
|
|
11
|
+
type NavItem = { label: string; href?: string; active?: boolean; children?: NavChild[] };
|
|
12
|
+
type FooterLink = { label: string; href: string; icon?: string };
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
class: className = '',
|
|
16
|
+
platformItems = [],
|
|
17
|
+
projectItems = [],
|
|
18
|
+
footerLinks = [],
|
|
19
|
+
breadcrumbs = [],
|
|
20
|
+
logo = 'Documentation',
|
|
21
|
+
version = 'v1.0.1',
|
|
22
|
+
user = { name: 'shadcn', email: 'm@example.com' },
|
|
23
|
+
children
|
|
24
|
+
}: {
|
|
25
|
+
class?: string;
|
|
26
|
+
platformItems?: NavItem[];
|
|
27
|
+
projectItems?: NavItem[];
|
|
28
|
+
footerLinks?: FooterLink[];
|
|
29
|
+
breadcrumbs?: Array<{ label: string; href?: string }>;
|
|
30
|
+
logo?: string;
|
|
31
|
+
version?: string;
|
|
32
|
+
user?: { name: string; email: string };
|
|
33
|
+
children?: Snippet;
|
|
34
|
+
} = $props();
|
|
35
|
+
|
|
36
|
+
let openItems = $state<Set<string>>(new Set());
|
|
37
|
+
|
|
38
|
+
function toggle(label: string) {
|
|
39
|
+
openItems = openItems.has(label)
|
|
40
|
+
? new Set([...openItems].filter(i => i !== label))
|
|
41
|
+
: new Set([...openItems, label]);
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<div class={cn('flex h-screen', className)}>
|
|
46
|
+
<aside class="flex w-64 flex-col border-r bg-background">
|
|
47
|
+
<!-- Logo -->
|
|
48
|
+
<div class="flex items-center gap-2 border-b px-4 py-3">
|
|
49
|
+
<span class="flex h-6 w-6 items-center justify-center rounded bg-primary text-xs font-bold text-primary-foreground">D</span>
|
|
50
|
+
<span class="font-semibold text-sm">{logo}</span>
|
|
51
|
+
<span class="ml-auto text-xs text-muted-foreground">{version}</span>
|
|
52
|
+
<button type="button" class="text-muted-foreground hover:text-foreground">
|
|
53
|
+
<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="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>
|
|
54
|
+
</button>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<nav class="flex-1 overflow-y-auto px-2 py-3">
|
|
58
|
+
{#if platformItems.length > 0}
|
|
59
|
+
<p class="mb-1 px-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground">Platform</p>
|
|
60
|
+
<ul class="mb-4 space-y-0.5">
|
|
61
|
+
{#each platformItems as item}
|
|
62
|
+
<li>
|
|
63
|
+
{#if item.children}
|
|
64
|
+
<button
|
|
65
|
+
type="button"
|
|
66
|
+
class="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
|
|
67
|
+
onclick={() => toggle(item.label)}
|
|
68
|
+
>
|
|
69
|
+
<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 width="7" height="7" x="3" y="3" rx="1"/><rect width="7" height="7" x="14" y="3" rx="1"/><rect width="7" height="7" x="14" y="14" rx="1"/><rect width="7" height="7" x="3" y="14" rx="1"/></svg>
|
|
70
|
+
<span class="flex-1 text-left">{item.label}</span>
|
|
71
|
+
<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={cn('transition-transform', openItems.has(item.label) && 'rotate-90')}><path d="m9 18 6-6-6-6"/></svg>
|
|
72
|
+
</button>
|
|
73
|
+
{#if openItems.has(item.label)}
|
|
74
|
+
<ul class="ml-4 mt-0.5 space-y-0.5 border-l pl-2">
|
|
75
|
+
{#each item.children as child}
|
|
76
|
+
<li>
|
|
77
|
+
<a href={child.href} class={cn('block rounded-md px-2 py-1.5 text-sm transition-colors', child.active ? 'font-medium text-foreground' : 'text-muted-foreground hover:text-foreground')}>{child.label}</a>
|
|
78
|
+
</li>
|
|
79
|
+
{/each}
|
|
80
|
+
</ul>
|
|
81
|
+
{/if}
|
|
82
|
+
{:else}
|
|
83
|
+
<a href={item.href ?? '#'} class={cn('flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors', item.active ? 'bg-muted font-medium text-foreground' : 'text-muted-foreground hover:bg-muted hover:text-foreground')}>
|
|
84
|
+
<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 width="7" height="7" x="3" y="3" rx="1"/><rect width="7" height="7" x="14" y="3" rx="1"/><rect width="7" height="7" x="14" y="14" rx="1"/><rect width="7" height="7" x="3" y="14" rx="1"/></svg>
|
|
85
|
+
<span class="flex-1">{item.label}</span>
|
|
86
|
+
<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="m9 18 6-6-6-6"/></svg>
|
|
87
|
+
</a>
|
|
88
|
+
{/if}
|
|
89
|
+
</li>
|
|
90
|
+
{/each}
|
|
91
|
+
</ul>
|
|
92
|
+
{/if}
|
|
93
|
+
|
|
94
|
+
{#if projectItems.length > 0}
|
|
95
|
+
<p class="mb-1 px-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground">Projects</p>
|
|
96
|
+
<ul class="space-y-0.5">
|
|
97
|
+
{#each projectItems as item}
|
|
98
|
+
<li>
|
|
99
|
+
<a href={item.href ?? '#'} class={cn('flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors', item.active ? 'bg-muted font-medium text-foreground' : 'text-muted-foreground hover:bg-muted hover:text-foreground')}>
|
|
100
|
+
<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="M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3"/></svg>
|
|
101
|
+
<span class="flex-1">{item.label}</span>
|
|
102
|
+
</a>
|
|
103
|
+
</li>
|
|
104
|
+
{/each}
|
|
105
|
+
</ul>
|
|
106
|
+
{/if}
|
|
107
|
+
</nav>
|
|
108
|
+
|
|
109
|
+
<!-- Footer quick links -->
|
|
110
|
+
{#if footerLinks.length > 0}
|
|
111
|
+
<div class="border-t px-2 py-2">
|
|
112
|
+
<ul class="space-y-0.5">
|
|
113
|
+
{#each footerLinks as link}
|
|
114
|
+
<li>
|
|
115
|
+
<a href={link.href} class="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground">
|
|
116
|
+
<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"><circle cx="12" cy="12" r="10"/><path d="M12 8v4"/><path d="M12 16h.01"/></svg>
|
|
117
|
+
{link.label}
|
|
118
|
+
</a>
|
|
119
|
+
</li>
|
|
120
|
+
{/each}
|
|
121
|
+
</ul>
|
|
122
|
+
</div>
|
|
123
|
+
{/if}
|
|
124
|
+
|
|
125
|
+
<!-- User Footer -->
|
|
126
|
+
<div class="flex items-center gap-3 border-t px-4 py-3">
|
|
127
|
+
<div class="flex h-8 w-8 items-center justify-center rounded-full bg-muted text-xs font-medium">
|
|
128
|
+
{user.name.slice(0, 2).toUpperCase()}
|
|
129
|
+
</div>
|
|
130
|
+
<div class="flex-1 overflow-hidden">
|
|
131
|
+
<p class="truncate text-sm font-medium">{user.name}</p>
|
|
132
|
+
<p class="truncate text-xs text-muted-foreground">{user.email}</p>
|
|
133
|
+
</div>
|
|
134
|
+
<button type="button" class="text-muted-foreground hover:text-foreground">
|
|
135
|
+
<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="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>
|
|
136
|
+
</button>
|
|
137
|
+
</div>
|
|
138
|
+
</aside>
|
|
139
|
+
|
|
140
|
+
<main class="flex flex-1 flex-col overflow-hidden">
|
|
141
|
+
{#if breadcrumbs.length > 0}
|
|
142
|
+
<div class="flex items-center gap-2 border-b px-6 py-3">
|
|
143
|
+
<button type="button" class="text-muted-foreground hover:text-foreground">
|
|
144
|
+
<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"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/></svg>
|
|
145
|
+
</button>
|
|
146
|
+
<Breadcrumb>
|
|
147
|
+
{#each breadcrumbs as crumb, i}
|
|
148
|
+
<BreadcrumbItem>
|
|
149
|
+
{#if crumb.href}
|
|
150
|
+
<BreadcrumbLink href={crumb.href}>{crumb.label}</BreadcrumbLink>
|
|
151
|
+
{:else}
|
|
152
|
+
<span class="text-sm text-foreground">{crumb.label}</span>
|
|
153
|
+
{/if}
|
|
154
|
+
</BreadcrumbItem>
|
|
155
|
+
{#if i < breadcrumbs.length - 1}<BreadcrumbSeparator />{/if}
|
|
156
|
+
{/each}
|
|
157
|
+
</Breadcrumb>
|
|
158
|
+
</div>
|
|
159
|
+
{/if}
|
|
160
|
+
<div class="flex-1 overflow-y-auto p-6">{@render children?.()}</div>
|
|
161
|
+
</main>
|
|
162
|
+
</div>
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
SidebarLayout09.svelte
|
|
3
|
+
Three-panel inbox layout: email list left, content center, account/folder nav right.
|
|
4
|
+
-->
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
|
+
import { cn } from '$lib/utils/cn';
|
|
8
|
+
import { Input } from '$lib/components/ui';
|
|
9
|
+
|
|
10
|
+
type Email = {
|
|
11
|
+
id: string;
|
|
12
|
+
from: string;
|
|
13
|
+
subject: string;
|
|
14
|
+
preview: string;
|
|
15
|
+
time: string;
|
|
16
|
+
read?: boolean;
|
|
17
|
+
};
|
|
18
|
+
type Folder = { label: string; href: string; active?: boolean };
|
|
19
|
+
|
|
20
|
+
let {
|
|
21
|
+
class: className = '',
|
|
22
|
+
emails = [],
|
|
23
|
+
folders = [],
|
|
24
|
+
accountName = 'Acme Inc',
|
|
25
|
+
accountType = 'Enterprise',
|
|
26
|
+
inboxLabel = 'Inbox',
|
|
27
|
+
showUnreadsToggle = true,
|
|
28
|
+
user = { name: 'shadcn', email: 'm@example.com' },
|
|
29
|
+
selectedEmailId = null,
|
|
30
|
+
children
|
|
31
|
+
}: {
|
|
32
|
+
class?: string;
|
|
33
|
+
emails?: Email[];
|
|
34
|
+
folders?: Folder[];
|
|
35
|
+
accountName?: string;
|
|
36
|
+
accountType?: string;
|
|
37
|
+
inboxLabel?: string;
|
|
38
|
+
showUnreadsToggle?: boolean;
|
|
39
|
+
user?: { name: string; email: string };
|
|
40
|
+
selectedEmailId?: string | null;
|
|
41
|
+
children?: Snippet;
|
|
42
|
+
} = $props();
|
|
43
|
+
|
|
44
|
+
let showUnreads = $state(false);
|
|
45
|
+
let search = $state('');
|
|
46
|
+
let activeEmailId = $state(selectedEmailId);
|
|
47
|
+
|
|
48
|
+
let filteredEmails = $derived(
|
|
49
|
+
emails.filter(e =>
|
|
50
|
+
(!showUnreads || !e.read) &&
|
|
51
|
+
(!search || e.from.toLowerCase().includes(search.toLowerCase()) || e.subject.toLowerCase().includes(search.toLowerCase()))
|
|
52
|
+
)
|
|
53
|
+
);
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<div class={cn('flex h-screen', className)}>
|
|
57
|
+
<!-- Email list panel -->
|
|
58
|
+
<aside class="flex w-72 flex-col border-r bg-background">
|
|
59
|
+
<!-- Header -->
|
|
60
|
+
<div class="flex items-center justify-between border-b px-4 py-3">
|
|
61
|
+
<h2 class="font-semibold">{inboxLabel}</h2>
|
|
62
|
+
{#if showUnreadsToggle}
|
|
63
|
+
<div class="flex items-center gap-2">
|
|
64
|
+
<span class="text-xs text-muted-foreground">Unreads</span>
|
|
65
|
+
<button
|
|
66
|
+
type="button"
|
|
67
|
+
role="switch"
|
|
68
|
+
aria-checked={showUnreads}
|
|
69
|
+
class={cn('relative inline-flex h-5 w-9 items-center rounded-full transition-colors', showUnreads ? 'bg-primary' : 'bg-muted')}
|
|
70
|
+
onclick={() => (showUnreads = !showUnreads)}
|
|
71
|
+
>
|
|
72
|
+
<span class={cn('inline-block h-3.5 w-3.5 rounded-full bg-white shadow transition-transform', showUnreads ? 'translate-x-4' : 'translate-x-1')}></span>
|
|
73
|
+
</button>
|
|
74
|
+
</div>
|
|
75
|
+
{/if}
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<!-- Search -->
|
|
79
|
+
<div class="px-3 py-2">
|
|
80
|
+
<Input type="search" placeholder="Search" bind:value={search} class="h-8 text-sm" />
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<!-- Email threads -->
|
|
84
|
+
<ul class="flex-1 overflow-y-auto divide-y">
|
|
85
|
+
{#each filteredEmails as email}
|
|
86
|
+
<li>
|
|
87
|
+
<button
|
|
88
|
+
type="button"
|
|
89
|
+
class={cn(
|
|
90
|
+
'w-full px-4 py-3 text-left transition-colors hover:bg-muted',
|
|
91
|
+
activeEmailId === email.id && 'bg-muted'
|
|
92
|
+
)}
|
|
93
|
+
onclick={() => (activeEmailId = email.id)}
|
|
94
|
+
>
|
|
95
|
+
<div class="mb-1 flex items-center justify-between">
|
|
96
|
+
<span class={cn('text-sm', !email.read && 'font-semibold')}>{email.from}</span>
|
|
97
|
+
<span class="text-xs text-muted-foreground">{email.time}</span>
|
|
98
|
+
</div>
|
|
99
|
+
<p class={cn('mb-1 text-sm', !email.read && 'font-medium')}>{email.subject}</p>
|
|
100
|
+
<p class="line-clamp-2 text-xs text-muted-foreground">{email.preview}</p>
|
|
101
|
+
</button>
|
|
102
|
+
</li>
|
|
103
|
+
{/each}
|
|
104
|
+
</ul>
|
|
105
|
+
</aside>
|
|
106
|
+
|
|
107
|
+
<!-- Main content -->
|
|
108
|
+
<main class="flex flex-1 flex-col overflow-hidden">
|
|
109
|
+
<div class="flex items-center gap-2 border-b px-4 py-3">
|
|
110
|
+
<span class="text-sm text-muted-foreground">All Inboxes</span>
|
|
111
|
+
<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="m9 18 6-6-6-6"/></svg>
|
|
112
|
+
<span class="text-sm font-medium">{inboxLabel}</span>
|
|
113
|
+
</div>
|
|
114
|
+
<div class="flex-1 overflow-y-auto">
|
|
115
|
+
{@render children?.()}
|
|
116
|
+
</div>
|
|
117
|
+
</main>
|
|
118
|
+
|
|
119
|
+
<!-- Right account/folder nav -->
|
|
120
|
+
<aside class="flex w-56 flex-col border-l bg-background">
|
|
121
|
+
<!-- Account header -->
|
|
122
|
+
<div class="flex items-center gap-2 border-b px-4 py-3">
|
|
123
|
+
<div class="flex h-7 w-7 items-center justify-center rounded bg-primary text-xs font-bold text-primary-foreground">
|
|
124
|
+
{accountName.slice(0, 1)}
|
|
125
|
+
</div>
|
|
126
|
+
<div>
|
|
127
|
+
<p class="text-sm font-semibold">{accountName}</p>
|
|
128
|
+
<p class="text-xs text-muted-foreground">{accountType}</p>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<!-- Folders -->
|
|
133
|
+
<nav class="flex-1 overflow-y-auto px-2 py-2">
|
|
134
|
+
<ul class="space-y-0.5">
|
|
135
|
+
{#each folders as folder}
|
|
136
|
+
<li>
|
|
137
|
+
<a
|
|
138
|
+
href={folder.href}
|
|
139
|
+
class={cn(
|
|
140
|
+
'flex items-center gap-3 rounded-md px-3 py-1.5 text-sm transition-colors',
|
|
141
|
+
folder.active ? 'bg-muted font-medium text-foreground' : 'text-muted-foreground hover:bg-muted hover:text-foreground'
|
|
142
|
+
)}
|
|
143
|
+
>
|
|
144
|
+
<!-- Generic folder icon -->
|
|
145
|
+
<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="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/></svg>
|
|
146
|
+
{folder.label}
|
|
147
|
+
</a>
|
|
148
|
+
</li>
|
|
149
|
+
{/each}
|
|
150
|
+
</ul>
|
|
151
|
+
</nav>
|
|
152
|
+
|
|
153
|
+
<!-- User footer -->
|
|
154
|
+
<div class="flex items-center gap-3 border-t px-4 py-3">
|
|
155
|
+
<div class="flex h-8 w-8 items-center justify-center rounded-full bg-muted text-xs font-medium">
|
|
156
|
+
{user.name.slice(0, 2).toUpperCase()}
|
|
157
|
+
</div>
|
|
158
|
+
<div class="flex-1 overflow-hidden">
|
|
159
|
+
<p class="truncate text-sm font-medium">{user.name}</p>
|
|
160
|
+
<p class="truncate text-xs text-muted-foreground">{user.email}</p>
|
|
161
|
+
</div>
|
|
162
|
+
<button type="button" class="text-muted-foreground hover:text-foreground">
|
|
163
|
+
<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="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>
|
|
164
|
+
</button>
|
|
165
|
+
</div>
|
|
166
|
+
</aside>
|
|
167
|
+
</div>
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
SidebarLayout10.svelte
|
|
3
|
+
Notion-style workspace sidebar: account header, quick links, grouped pages, footer utilities.
|
|
4
|
+
-->
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
|
+
import { cn } from '$lib/utils/cn';
|
|
8
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbSeparator } from '$lib/components/ui';
|
|
9
|
+
|
|
10
|
+
type PageItem = { label: string; href: string; icon?: string; active?: boolean };
|
|
11
|
+
type PageGroup = { title: string; items: PageItem[]; showMore?: boolean };
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
class: className = '',
|
|
15
|
+
workspace = 'Acme Inc',
|
|
16
|
+
quickLinks = [],
|
|
17
|
+
groups = [],
|
|
18
|
+
footerLinks = [],
|
|
19
|
+
breadcrumbs = [],
|
|
20
|
+
children
|
|
21
|
+
}: {
|
|
22
|
+
class?: string;
|
|
23
|
+
workspace?: string;
|
|
24
|
+
quickLinks?: Array<{ label: string; href: string; icon: string }>;
|
|
25
|
+
groups?: PageGroup[];
|
|
26
|
+
footerLinks?: Array<{ label: string; href: string; icon: string }>;
|
|
27
|
+
breadcrumbs?: Array<{ label: string; href?: string }>;
|
|
28
|
+
children?: Snippet;
|
|
29
|
+
} = $props();
|
|
30
|
+
|
|
31
|
+
const ICON_MAP: Record<string, string> = {
|
|
32
|
+
search: 'M21 21l-4.35-4.35M11 19A8 8 0 1 0 11 3a8 8 0 0 0 0 16z',
|
|
33
|
+
ai: 'M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 6v4l3 3',
|
|
34
|
+
home: 'M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z M9 22V12h6v10',
|
|
35
|
+
inbox: 'M22 12h-6l-2 3h-4l-2-3H2 M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z',
|
|
36
|
+
calendar: 'M8 2v4 M16 2v4 M3 10h18 M21 8H3a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2z',
|
|
37
|
+
settings: 'M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z',
|
|
38
|
+
trash: 'M3 6h18 M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6 M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2',
|
|
39
|
+
template: 'M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2v-4M9 21H5a2 2 0 0 1-2-2v-4m0 0h18',
|
|
40
|
+
help: 'M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3 M12 17h.01',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
function getIconPath(icon: string): string {
|
|
44
|
+
return ICON_MAP[icon] ?? 'M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20z';
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<div class={cn('flex h-screen', className)}>
|
|
49
|
+
<aside class="flex w-60 flex-col border-r bg-background">
|
|
50
|
+
<!-- Workspace header -->
|
|
51
|
+
<div class="flex items-center justify-between border-b px-3 py-3">
|
|
52
|
+
<button type="button" class="flex items-center gap-2 rounded-md px-2 py-1 text-sm font-semibold hover:bg-muted">
|
|
53
|
+
<div class="flex h-5 w-5 items-center justify-center rounded bg-primary text-xs font-bold text-primary-foreground">
|
|
54
|
+
{workspace.slice(0, 1)}
|
|
55
|
+
</div>
|
|
56
|
+
{workspace}
|
|
57
|
+
<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="m6 9 6 6 6-6"/></svg>
|
|
58
|
+
</button>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<!-- Quick links -->
|
|
62
|
+
{#if quickLinks.length > 0}
|
|
63
|
+
<nav class="border-b px-2 py-2">
|
|
64
|
+
<ul class="space-y-0.5">
|
|
65
|
+
{#each quickLinks as link}
|
|
66
|
+
<li>
|
|
67
|
+
<a href={link.href} class="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground">
|
|
68
|
+
<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">
|
|
69
|
+
<path d={getIconPath(link.icon)} />
|
|
70
|
+
</svg>
|
|
71
|
+
{link.label}
|
|
72
|
+
</a>
|
|
73
|
+
</li>
|
|
74
|
+
{/each}
|
|
75
|
+
</ul>
|
|
76
|
+
</nav>
|
|
77
|
+
{/if}
|
|
78
|
+
|
|
79
|
+
<!-- Page groups -->
|
|
80
|
+
<div class="flex-1 overflow-y-auto px-2 py-2">
|
|
81
|
+
{#each groups as group}
|
|
82
|
+
<div class="mb-3">
|
|
83
|
+
<p class="mb-1 px-2 text-xs font-semibold text-muted-foreground">{group.title}</p>
|
|
84
|
+
<ul class="space-y-0.5">
|
|
85
|
+
{#each group.items as item}
|
|
86
|
+
<li>
|
|
87
|
+
<a
|
|
88
|
+
href={item.href}
|
|
89
|
+
class={cn(
|
|
90
|
+
'flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors',
|
|
91
|
+
item.active ? 'bg-muted font-medium text-foreground' : 'text-muted-foreground hover:bg-muted hover:text-foreground'
|
|
92
|
+
)}
|
|
93
|
+
>
|
|
94
|
+
{#if item.icon}
|
|
95
|
+
<span class="text-base leading-none">{item.icon}</span>
|
|
96
|
+
{:else}
|
|
97
|
+
<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="M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3"/></svg>
|
|
98
|
+
{/if}
|
|
99
|
+
<span class="flex-1 truncate">{item.label}</span>
|
|
100
|
+
<button type="button" class="opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-foreground" onclick={(e) => e.preventDefault()}>
|
|
101
|
+
<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"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg>
|
|
102
|
+
</button>
|
|
103
|
+
</a>
|
|
104
|
+
</li>
|
|
105
|
+
{/each}
|
|
106
|
+
{#if group.showMore}
|
|
107
|
+
<li>
|
|
108
|
+
<button type="button" class="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground">
|
|
109
|
+
<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"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg>
|
|
110
|
+
More
|
|
111
|
+
</button>
|
|
112
|
+
</li>
|
|
113
|
+
{/if}
|
|
114
|
+
</ul>
|
|
115
|
+
</div>
|
|
116
|
+
{/each}
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
<!-- Footer utilities -->
|
|
120
|
+
{#if footerLinks.length > 0}
|
|
121
|
+
<nav class="border-t px-2 py-2">
|
|
122
|
+
<ul class="space-y-0.5">
|
|
123
|
+
{#each footerLinks as link}
|
|
124
|
+
<li>
|
|
125
|
+
<a href={link.href} class="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground">
|
|
126
|
+
<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">
|
|
127
|
+
<path d={getIconPath(link.icon)} />
|
|
128
|
+
</svg>
|
|
129
|
+
{link.label}
|
|
130
|
+
</a>
|
|
131
|
+
</li>
|
|
132
|
+
{/each}
|
|
133
|
+
</ul>
|
|
134
|
+
</nav>
|
|
135
|
+
{/if}
|
|
136
|
+
</aside>
|
|
137
|
+
|
|
138
|
+
<!-- Main content -->
|
|
139
|
+
<main class="flex flex-1 flex-col overflow-hidden">
|
|
140
|
+
{#if breadcrumbs.length > 0}
|
|
141
|
+
<div class="flex items-center gap-2 border-b px-6 py-3">
|
|
142
|
+
<button type="button" class="text-muted-foreground hover:text-foreground">
|
|
143
|
+
<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"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/></svg>
|
|
144
|
+
</button>
|
|
145
|
+
<Breadcrumb>
|
|
146
|
+
{#each breadcrumbs as crumb, i}
|
|
147
|
+
<BreadcrumbItem>
|
|
148
|
+
{#if crumb.href}<BreadcrumbLink href={crumb.href}>{crumb.label}</BreadcrumbLink>
|
|
149
|
+
{:else}<span class="text-sm text-foreground">{crumb.label}</span>
|
|
150
|
+
{/if}
|
|
151
|
+
</BreadcrumbItem>
|
|
152
|
+
{#if i < breadcrumbs.length - 1}<BreadcrumbSeparator />{/if}
|
|
153
|
+
{/each}
|
|
154
|
+
</Breadcrumb>
|
|
155
|
+
</div>
|
|
156
|
+
{/if}
|
|
157
|
+
<div class="flex-1 overflow-y-auto p-6">{@render children?.()}</div>
|
|
158
|
+
</main>
|
|
159
|
+
</div>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
SidebarLayout11.svelte
|
|
3
|
+
File explorer sidebar (VS Code-style): Changes section and expandable Files tree.
|
|
4
|
+
-->
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
|
+
import { cn } from '$lib/utils/cn';
|
|
8
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbSeparator } from '$lib/components/ui';
|
|
9
|
+
|
|
10
|
+
type FileStatus = 'modified' | 'untracked' | 'added' | 'deleted';
|
|
11
|
+
type ChangedFile = { path: string; status: FileStatus };
|
|
12
|
+
type FileNode = { name: string; type: 'file' | 'dir'; children?: FileNode[] };
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
class: className = '',
|
|
16
|
+
changes = [],
|
|
17
|
+
files = [],
|
|
18
|
+
breadcrumbs = [],
|
|
19
|
+
children
|
|
20
|
+
}: {
|
|
21
|
+
class?: string;
|
|
22
|
+
changes?: ChangedFile[];
|
|
23
|
+
files?: FileNode[];
|
|
24
|
+
breadcrumbs?: Array<{ label: string; href?: string }>;
|
|
25
|
+
children?: Snippet;
|
|
26
|
+
} = $props();
|
|
27
|
+
|
|
28
|
+
let openDirs = $state<Set<string>>(new Set(['app', 'components']));
|
|
29
|
+
|
|
30
|
+
function toggleDir(path: string) {
|
|
31
|
+
openDirs = openDirs.has(path)
|
|
32
|
+
? new Set([...openDirs].filter(p => p !== path))
|
|
33
|
+
: new Set([...openDirs, path]);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const STATUS_BADGE: Record<FileStatus, { label: string; color: string }> = {
|
|
37
|
+
modified: { label: 'M', color: 'text-amber-500' },
|
|
38
|
+
untracked: { label: 'U', color: 'text-green-500' },
|
|
39
|
+
added: { label: 'A', color: 'text-green-500' },
|
|
40
|
+
deleted: { label: 'D', color: 'text-red-500' },
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
{#snippet fileTree(nodes: FileNode[], depth: number, parentPath: string)}
|
|
45
|
+
{#each nodes as node}
|
|
46
|
+
{@const path = `${parentPath}/${node.name}`}
|
|
47
|
+
{#if node.type === 'dir'}
|
|
48
|
+
<li>
|
|
49
|
+
<button
|
|
50
|
+
type="button"
|
|
51
|
+
class="flex w-full items-center gap-1 rounded px-2 py-0.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
52
|
+
style="padding-left: {8 + depth * 12}px"
|
|
53
|
+
onclick={() => toggleDir(path)}
|
|
54
|
+
>
|
|
55
|
+
<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" class={cn('shrink-0 transition-transform', openDirs.has(path) && 'rotate-90')}>
|
|
56
|
+
<path d="m9 18 6-6-6-6"/>
|
|
57
|
+
</svg>
|
|
58
|
+
<!-- Folder icon -->
|
|
59
|
+
<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" class="shrink-0">
|
|
60
|
+
<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"/>
|
|
61
|
+
</svg>
|
|
62
|
+
<span>{node.name}</span>
|
|
63
|
+
</button>
|
|
64
|
+
{#if openDirs.has(path) && node.children}
|
|
65
|
+
<ul>{@render fileTree(node.children, depth + 1, path)}</ul>
|
|
66
|
+
{/if}
|
|
67
|
+
</li>
|
|
68
|
+
{:else}
|
|
69
|
+
<li>
|
|
70
|
+
<a
|
|
71
|
+
href="#"
|
|
72
|
+
class="flex items-center gap-1 rounded px-2 py-0.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
73
|
+
style="padding-left: {8 + depth * 12 + 13}px"
|
|
74
|
+
>
|
|
75
|
+
<!-- File icon -->
|
|
76
|
+
<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" class="shrink-0">
|
|
77
|
+
<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/>
|
|
78
|
+
</svg>
|
|
79
|
+
<span>{node.name}</span>
|
|
80
|
+
</a>
|
|
81
|
+
</li>
|
|
82
|
+
{/if}
|
|
83
|
+
{/each}
|
|
84
|
+
{/snippet}
|
|
85
|
+
|
|
86
|
+
<div class={cn('flex h-screen', className)}>
|
|
87
|
+
<aside class="flex w-64 flex-col border-r bg-background text-sm">
|
|
88
|
+
<!-- Changes -->
|
|
89
|
+
{#if changes.length > 0}
|
|
90
|
+
<div class="border-b">
|
|
91
|
+
<div class="flex items-center justify-between px-3 py-2">
|
|
92
|
+
<span class="text-xs font-semibold uppercase tracking-wider text-muted-foreground">Changes</span>
|
|
93
|
+
</div>
|
|
94
|
+
<ul class="pb-2">
|
|
95
|
+
{#each changes as file}
|
|
96
|
+
<li class="flex items-center justify-between px-3 py-0.5 hover:bg-muted">
|
|
97
|
+
<span class="truncate text-xs text-foreground">{file.path}</span>
|
|
98
|
+
<span class={cn('ml-2 shrink-0 text-xs font-semibold', STATUS_BADGE[file.status].color)}>
|
|
99
|
+
{STATUS_BADGE[file.status].label}
|
|
100
|
+
</span>
|
|
101
|
+
</li>
|
|
102
|
+
{/each}
|
|
103
|
+
</ul>
|
|
104
|
+
</div>
|
|
105
|
+
{/if}
|
|
106
|
+
|
|
107
|
+
<!-- Files tree -->
|
|
108
|
+
<div class="flex-1 overflow-y-auto">
|
|
109
|
+
<div class="flex items-center justify-between px-3 py-2">
|
|
110
|
+
<span class="text-xs font-semibold uppercase tracking-wider text-muted-foreground">Files</span>
|
|
111
|
+
</div>
|
|
112
|
+
<ul>
|
|
113
|
+
{@render fileTree(files, 0, '')}
|
|
114
|
+
</ul>
|
|
115
|
+
</div>
|
|
116
|
+
</aside>
|
|
117
|
+
|
|
118
|
+
<main class="flex flex-1 flex-col overflow-hidden">
|
|
119
|
+
{#if breadcrumbs.length > 0}
|
|
120
|
+
<div class="flex items-center gap-2 border-b px-6 py-3">
|
|
121
|
+
<Breadcrumb>
|
|
122
|
+
{#each breadcrumbs as crumb, i}
|
|
123
|
+
<BreadcrumbItem>
|
|
124
|
+
{#if crumb.href}<BreadcrumbLink href={crumb.href}>{crumb.label}</BreadcrumbLink>
|
|
125
|
+
{:else}<span class="text-sm text-foreground">{crumb.label}</span>
|
|
126
|
+
{/if}
|
|
127
|
+
</BreadcrumbItem>
|
|
128
|
+
{#if i < breadcrumbs.length - 1}<BreadcrumbSeparator />{/if}
|
|
129
|
+
{/each}
|
|
130
|
+
</Breadcrumb>
|
|
131
|
+
</div>
|
|
132
|
+
{/if}
|
|
133
|
+
<div class="flex-1 overflow-y-auto p-6">{@render children?.()}</div>
|
|
134
|
+
</main>
|
|
135
|
+
</div>
|