@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,62 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
src/lib/components/ui/message/Message.svelte
|
|
3
|
+
Message list item with sender, subject, preview, and time.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
<Message
|
|
7
|
+
sender="Jane Smith"
|
|
8
|
+
subject="Meeting Tomorrow"
|
|
9
|
+
preview="Hey, just wanted to confirm our meeting..."
|
|
10
|
+
time="2:30 PM"
|
|
11
|
+
state="active"
|
|
12
|
+
/>
|
|
13
|
+
-->
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import { tv, type VariantProps } from 'tailwind-variants';
|
|
16
|
+
import { cn } from '$lib/utils/cn';
|
|
17
|
+
|
|
18
|
+
const messageVariants = tv({
|
|
19
|
+
base: 'flex flex-col gap-1 px-4 py-3 transition-colors cursor-pointer',
|
|
20
|
+
variants: {
|
|
21
|
+
state: {
|
|
22
|
+
default: 'hover:bg-muted/50',
|
|
23
|
+
hover: 'bg-muted/50',
|
|
24
|
+
active: 'bg-muted border-l-2 border-primary'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
state: 'default'
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
type State = VariantProps<typeof messageVariants>['state'];
|
|
33
|
+
|
|
34
|
+
let {
|
|
35
|
+
sender,
|
|
36
|
+
subject,
|
|
37
|
+
preview,
|
|
38
|
+
time,
|
|
39
|
+
state = 'default',
|
|
40
|
+
class: className = '',
|
|
41
|
+
...rest
|
|
42
|
+
}: {
|
|
43
|
+
sender: string;
|
|
44
|
+
subject: string;
|
|
45
|
+
preview: string;
|
|
46
|
+
time: string;
|
|
47
|
+
state?: State;
|
|
48
|
+
class?: string;
|
|
49
|
+
[key: string]: unknown;
|
|
50
|
+
} = $props();
|
|
51
|
+
|
|
52
|
+
let classes = $derived(cn(messageVariants({ state }), className));
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<div class={classes} {...rest}>
|
|
56
|
+
<div class="flex items-center justify-between gap-2">
|
|
57
|
+
<span class="text-sm font-semibold text-foreground truncate">{sender}</span>
|
|
58
|
+
<span class="text-xs text-muted-foreground flex-shrink-0">{time}</span>
|
|
59
|
+
</div>
|
|
60
|
+
<p class="text-sm font-medium text-foreground truncate">{subject}</p>
|
|
61
|
+
<p class="text-xs text-muted-foreground line-clamp-2">{preview}</p>
|
|
62
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Message } from './Message.svelte';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
src/lib/components/ui/nav/NavItem.svelte
|
|
3
|
+
Icon-based navigation item with states.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
<NavItem state="current" href="/dashboard">
|
|
7
|
+
{#snippet icon()}<HomeIcon />{/snippet}
|
|
8
|
+
</NavItem>
|
|
9
|
+
-->
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { tv, type VariantProps } from 'tailwind-variants';
|
|
12
|
+
import { cn } from '$lib/utils/cn';
|
|
13
|
+
import type { Snippet } from 'svelte';
|
|
14
|
+
|
|
15
|
+
const navItemVariants = tv({
|
|
16
|
+
base: 'inline-flex items-center justify-center h-8 w-8 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
|
|
17
|
+
variants: {
|
|
18
|
+
state: {
|
|
19
|
+
default: 'rounded-lg bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground',
|
|
20
|
+
hover: 'rounded-lg bg-accent text-accent-foreground',
|
|
21
|
+
current: 'rounded-full bg-primary text-primary-foreground',
|
|
22
|
+
focused: 'rounded-lg bg-accent text-accent-foreground ring-2 ring-ring ring-offset-2'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
state: 'default'
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
type State = VariantProps<typeof navItemVariants>['state'];
|
|
31
|
+
|
|
32
|
+
let {
|
|
33
|
+
state = 'default',
|
|
34
|
+
href = undefined,
|
|
35
|
+
class: className = '',
|
|
36
|
+
icon,
|
|
37
|
+
...rest
|
|
38
|
+
}: {
|
|
39
|
+
state?: State;
|
|
40
|
+
href?: string | undefined;
|
|
41
|
+
class?: string;
|
|
42
|
+
icon?: Snippet;
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
} = $props();
|
|
45
|
+
|
|
46
|
+
let classes = $derived(cn(navItemVariants({ state }), className));
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
{#if href}
|
|
50
|
+
<a
|
|
51
|
+
{href}
|
|
52
|
+
class={classes}
|
|
53
|
+
aria-current={state === 'current' ? 'page' : undefined}
|
|
54
|
+
{...rest}
|
|
55
|
+
>
|
|
56
|
+
{@render icon?.()}
|
|
57
|
+
</a>
|
|
58
|
+
{:else}
|
|
59
|
+
<button
|
|
60
|
+
type="button"
|
|
61
|
+
class={classes}
|
|
62
|
+
aria-current={state === 'current' ? 'page' : undefined}
|
|
63
|
+
{...rest}
|
|
64
|
+
>
|
|
65
|
+
{@render icon?.()}
|
|
66
|
+
</button>
|
|
67
|
+
{/if}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NavItem } from './NavItem.svelte';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
src/lib/components/ui/notification-badge/NotificationBadge.svelte
|
|
3
|
+
Small circular count badge.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
<NotificationBadge count={5} />
|
|
7
|
+
-->
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { cn } from '$lib/utils/cn';
|
|
10
|
+
|
|
11
|
+
let {
|
|
12
|
+
count,
|
|
13
|
+
class: className = '',
|
|
14
|
+
...rest
|
|
15
|
+
}: {
|
|
16
|
+
count: number;
|
|
17
|
+
class?: string;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
} = $props();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<span
|
|
23
|
+
class={cn(
|
|
24
|
+
'inline-flex items-center justify-center h-6 w-6 rounded-full bg-primary text-primary-foreground text-xs font-semibold',
|
|
25
|
+
className
|
|
26
|
+
)}
|
|
27
|
+
{...rest}
|
|
28
|
+
>
|
|
29
|
+
{count}
|
|
30
|
+
</span>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NotificationBadge } from './NotificationBadge.svelte';
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
src/lib/components/ui/otp-input/OtpInput.svelte
|
|
3
|
+
OTP code entry with auto-focus behavior.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
<OtpInput bind:value length={6} onComplete={handleComplete} />
|
|
7
|
+
-->
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { cn } from '$lib/utils/cn';
|
|
10
|
+
|
|
11
|
+
let {
|
|
12
|
+
length = 6,
|
|
13
|
+
value = $bindable(''),
|
|
14
|
+
class: className = '',
|
|
15
|
+
onComplete,
|
|
16
|
+
onfocus,
|
|
17
|
+
onblur,
|
|
18
|
+
...rest
|
|
19
|
+
}: {
|
|
20
|
+
length?: number;
|
|
21
|
+
value?: string;
|
|
22
|
+
class?: string;
|
|
23
|
+
onComplete?: (value: string) => void;
|
|
24
|
+
onfocus?: (e: FocusEvent) => void;
|
|
25
|
+
onblur?: (e: FocusEvent) => void;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
} = $props();
|
|
28
|
+
|
|
29
|
+
let inputs: HTMLInputElement[] = $state([]);
|
|
30
|
+
let digits: string[] = $state([]);
|
|
31
|
+
|
|
32
|
+
// Initialize digits from value
|
|
33
|
+
$effect(() => {
|
|
34
|
+
digits = value.split('').slice(0, length);
|
|
35
|
+
while (digits.length < length) digits.push('');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Sync value from digits
|
|
39
|
+
function updateValue() {
|
|
40
|
+
value = digits.join('');
|
|
41
|
+
if (value.length === length && !digits.includes('')) {
|
|
42
|
+
onComplete?.(value);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function handleInput(index: number, e: Event) {
|
|
47
|
+
const target = e.target as HTMLInputElement;
|
|
48
|
+
const char = target.value.replace(/\D/g, '').slice(-1);
|
|
49
|
+
|
|
50
|
+
digits[index] = char;
|
|
51
|
+
digits = digits;
|
|
52
|
+
updateValue();
|
|
53
|
+
|
|
54
|
+
if (char && index < length - 1) {
|
|
55
|
+
inputs[index + 1]?.focus();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function handleKeyDown(index: number, e: KeyboardEvent) {
|
|
60
|
+
if (e.key === 'Backspace') {
|
|
61
|
+
if (!digits[index] && index > 0) {
|
|
62
|
+
inputs[index - 1]?.focus();
|
|
63
|
+
digits[index - 1] = '';
|
|
64
|
+
digits = digits;
|
|
65
|
+
updateValue();
|
|
66
|
+
} else {
|
|
67
|
+
digits[index] = '';
|
|
68
|
+
digits = digits;
|
|
69
|
+
updateValue();
|
|
70
|
+
}
|
|
71
|
+
} else if (e.key === 'ArrowLeft' && index > 0) {
|
|
72
|
+
inputs[index - 1]?.focus();
|
|
73
|
+
} else if (e.key === 'ArrowRight' && index < length - 1) {
|
|
74
|
+
inputs[index + 1]?.focus();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function handlePaste(e: ClipboardEvent) {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
const pasted = (e.clipboardData?.getData('text') || '').replace(/\D/g, '').slice(0, length);
|
|
81
|
+
for (let i = 0; i < length; i++) {
|
|
82
|
+
digits[i] = pasted[i] || '';
|
|
83
|
+
}
|
|
84
|
+
digits = digits;
|
|
85
|
+
updateValue();
|
|
86
|
+
|
|
87
|
+
const focusIndex = Math.min(pasted.length, length - 1);
|
|
88
|
+
inputs[focusIndex]?.focus();
|
|
89
|
+
}
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<div class={cn('flex items-center gap-2', className)} {...rest}>
|
|
93
|
+
{#each Array(length) as _, i}
|
|
94
|
+
<input
|
|
95
|
+
bind:this={inputs[i]}
|
|
96
|
+
type="text"
|
|
97
|
+
inputmode="numeric"
|
|
98
|
+
maxlength="1"
|
|
99
|
+
value={digits[i] || ''}
|
|
100
|
+
class="h-10 w-10 rounded-md border border-input bg-background text-center text-sm font-medium shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
101
|
+
oninput={(e) => handleInput(i, e)}
|
|
102
|
+
onkeydown={(e) => handleKeyDown(i, e)}
|
|
103
|
+
onpaste={handlePaste}
|
|
104
|
+
{onfocus}
|
|
105
|
+
{onblur}
|
|
106
|
+
/>
|
|
107
|
+
{/each}
|
|
108
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OtpInput } from './OtpInput.svelte';
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
src/lib/components/ui/select/Select.svelte
|
|
3
|
+
SHADCN-Svelte Select Component
|
|
4
|
+
|
|
5
|
+
AI SYSTEMS: Use this component for dropdown selections.
|
|
6
|
+
Supports single selection with keyboard navigation and proper accessibility.
|
|
7
|
+
-->
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { ChevronDown, Check } from 'lucide-svelte';
|
|
10
|
+
import { cn } from '$lib/utils/cn';
|
|
11
|
+
import { tv, type VariantProps } from 'tailwind-variants';
|
|
12
|
+
|
|
13
|
+
const selectTriggerVariants = tv({
|
|
14
|
+
base: 'flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
15
|
+
variants: {
|
|
16
|
+
size: {
|
|
17
|
+
sm: 'h-8 px-2 text-xs',
|
|
18
|
+
md: 'h-10 px-3 text-sm',
|
|
19
|
+
lg: 'h-12 px-4 text-base'
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
size: 'md'
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
type SelectSize = VariantProps<typeof selectTriggerVariants>['size'];
|
|
28
|
+
|
|
29
|
+
// Component props
|
|
30
|
+
let {
|
|
31
|
+
value = $bindable(undefined),
|
|
32
|
+
placeholder = 'Select an option...',
|
|
33
|
+
disabled = false,
|
|
34
|
+
size = 'md',
|
|
35
|
+
options = [],
|
|
36
|
+
name = undefined,
|
|
37
|
+
id = undefined,
|
|
38
|
+
onchange,
|
|
39
|
+
}: {
|
|
40
|
+
value?: string | undefined;
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
size?: SelectSize;
|
|
44
|
+
options?: Array<{ value: string; label: string; disabled?: boolean }>;
|
|
45
|
+
name?: string | undefined;
|
|
46
|
+
id?: string | undefined;
|
|
47
|
+
onchange?: (detail: { value: string; option: { value: string; label: string } }) => void;
|
|
48
|
+
} = $props();
|
|
49
|
+
|
|
50
|
+
// Local state
|
|
51
|
+
let isOpen = $state(false);
|
|
52
|
+
let triggerElement: HTMLButtonElement;
|
|
53
|
+
let contentElement: HTMLDivElement;
|
|
54
|
+
|
|
55
|
+
// Generate unique ID for accessibility
|
|
56
|
+
const listboxId = `select-listbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
57
|
+
|
|
58
|
+
// Get selected option
|
|
59
|
+
let selectedOption = $derived(options.find(option => option.value === value));
|
|
60
|
+
|
|
61
|
+
// Handle option selection
|
|
62
|
+
function selectOption(option: { value: string; label: string; disabled?: boolean }) {
|
|
63
|
+
if (option.disabled) return;
|
|
64
|
+
|
|
65
|
+
value = option.value;
|
|
66
|
+
isOpen = false;
|
|
67
|
+
onchange?.({ value: option.value, option });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Handle keyboard navigation
|
|
71
|
+
function handleKeydown(event: KeyboardEvent) {
|
|
72
|
+
if (disabled) return;
|
|
73
|
+
|
|
74
|
+
switch (event.key) {
|
|
75
|
+
case 'Enter':
|
|
76
|
+
case ' ':
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
isOpen = !isOpen;
|
|
79
|
+
break;
|
|
80
|
+
case 'Escape':
|
|
81
|
+
isOpen = false;
|
|
82
|
+
triggerElement?.focus();
|
|
83
|
+
break;
|
|
84
|
+
case 'ArrowDown':
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
if (isOpen) {
|
|
87
|
+
// Focus first non-disabled option
|
|
88
|
+
const firstOption = contentElement?.querySelector('[role="option"]:not([data-disabled="true"])') as HTMLElement;
|
|
89
|
+
firstOption?.focus();
|
|
90
|
+
} else {
|
|
91
|
+
isOpen = true;
|
|
92
|
+
}
|
|
93
|
+
break;
|
|
94
|
+
case 'ArrowUp':
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
if (isOpen) {
|
|
97
|
+
// Focus last non-disabled option
|
|
98
|
+
const opts = contentElement?.querySelectorAll('[role="option"]:not([data-disabled="true"])');
|
|
99
|
+
const lastOption = opts?.[opts.length - 1] as HTMLElement;
|
|
100
|
+
lastOption?.focus();
|
|
101
|
+
} else {
|
|
102
|
+
isOpen = true;
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Handle option keyboard navigation
|
|
109
|
+
function handleOptionKeydown(event: KeyboardEvent, option: { value: string; label: string; disabled?: boolean }) {
|
|
110
|
+
if (option.disabled) return;
|
|
111
|
+
|
|
112
|
+
switch (event.key) {
|
|
113
|
+
case 'Enter':
|
|
114
|
+
case ' ':
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
selectOption(option);
|
|
117
|
+
triggerElement?.focus();
|
|
118
|
+
break;
|
|
119
|
+
case 'Escape':
|
|
120
|
+
isOpen = false;
|
|
121
|
+
triggerElement?.focus();
|
|
122
|
+
break;
|
|
123
|
+
case 'ArrowDown':
|
|
124
|
+
event.preventDefault();
|
|
125
|
+
const nextOption = (event.target as HTMLElement)?.nextElementSibling as HTMLElement;
|
|
126
|
+
if (nextOption && !nextOption.dataset.disabled) {
|
|
127
|
+
nextOption.focus();
|
|
128
|
+
}
|
|
129
|
+
break;
|
|
130
|
+
case 'ArrowUp':
|
|
131
|
+
event.preventDefault();
|
|
132
|
+
const prevOption = (event.target as HTMLElement)?.previousElementSibling as HTMLElement;
|
|
133
|
+
if (prevOption && !prevOption.dataset.disabled) {
|
|
134
|
+
prevOption.focus();
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Close dropdown when clicking outside
|
|
141
|
+
function handleClickOutside(event: MouseEvent) {
|
|
142
|
+
if (!triggerElement?.contains(event.target as Node) && !contentElement?.contains(event.target as Node)) {
|
|
143
|
+
isOpen = false;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
</script>
|
|
147
|
+
|
|
148
|
+
<svelte:window onclick={handleClickOutside} />
|
|
149
|
+
|
|
150
|
+
<div class="relative">
|
|
151
|
+
<!-- Hidden select for form submission -->
|
|
152
|
+
{#if name}
|
|
153
|
+
<select {name} {id} bind:value class="sr-only" tabindex="-1" aria-hidden="true">
|
|
154
|
+
<option value="">Choose...</option>
|
|
155
|
+
{#each options as option}
|
|
156
|
+
<option value={option.value} disabled={option.disabled}>{option.label}</option>
|
|
157
|
+
{/each}
|
|
158
|
+
</select>
|
|
159
|
+
{/if}
|
|
160
|
+
|
|
161
|
+
<!-- Select Trigger -->
|
|
162
|
+
<button
|
|
163
|
+
bind:this={triggerElement}
|
|
164
|
+
type="button"
|
|
165
|
+
class={cn(selectTriggerVariants({ size }))}
|
|
166
|
+
{disabled}
|
|
167
|
+
role="combobox"
|
|
168
|
+
aria-expanded={isOpen}
|
|
169
|
+
aria-controls={listboxId}
|
|
170
|
+
aria-haspopup="listbox"
|
|
171
|
+
aria-label={placeholder}
|
|
172
|
+
onclick={() => !disabled && (isOpen = !isOpen)}
|
|
173
|
+
onkeydown={handleKeydown}
|
|
174
|
+
>
|
|
175
|
+
<span class="block truncate">
|
|
176
|
+
{selectedOption?.label || placeholder}
|
|
177
|
+
</span>
|
|
178
|
+
<ChevronDown class="h-4 w-4 opacity-50" />
|
|
179
|
+
</button>
|
|
180
|
+
|
|
181
|
+
<!-- Select Content -->
|
|
182
|
+
{#if isOpen}
|
|
183
|
+
<div
|
|
184
|
+
bind:this={contentElement}
|
|
185
|
+
id={listboxId}
|
|
186
|
+
class="absolute z-50 min-w-[8rem] w-full overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 top-full mt-1"
|
|
187
|
+
role="listbox"
|
|
188
|
+
data-side="bottom"
|
|
189
|
+
>
|
|
190
|
+
{#each options as option}
|
|
191
|
+
<div
|
|
192
|
+
role="option"
|
|
193
|
+
tabindex={option.disabled ? -1 : 0}
|
|
194
|
+
data-disabled={option.disabled || undefined}
|
|
195
|
+
data-selected={option.value === value || undefined}
|
|
196
|
+
aria-selected={option.value === value}
|
|
197
|
+
class={cn(
|
|
198
|
+
'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none',
|
|
199
|
+
'hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground',
|
|
200
|
+
option.disabled && 'pointer-events-none opacity-50',
|
|
201
|
+
option.value === value && 'bg-accent text-accent-foreground'
|
|
202
|
+
)}
|
|
203
|
+
onclick={() => selectOption(option)}
|
|
204
|
+
onkeydown={(e) => handleOptionKeydown(e, option)}
|
|
205
|
+
>
|
|
206
|
+
{#if option.value === value}
|
|
207
|
+
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
208
|
+
<Check class="h-4 w-4" />
|
|
209
|
+
</span>
|
|
210
|
+
{/if}
|
|
211
|
+
<span class="block truncate">{option.label}</span>
|
|
212
|
+
</div>
|
|
213
|
+
{/each}
|
|
214
|
+
</div>
|
|
215
|
+
{/if}
|
|
216
|
+
</div>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
src/lib/components/ui/settings-card/SettingsCard.svelte
|
|
3
|
+
Settings form card with title, description, content slot, and optional footer.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
<SettingsCard title="Profile" description="Manage your profile settings.">
|
|
7
|
+
<Input label="Name" value="John" />
|
|
8
|
+
{#snippet footer()}<Button>Save changes</Button>{/snippet}
|
|
9
|
+
</SettingsCard>
|
|
10
|
+
-->
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { cn } from '$lib/utils/cn';
|
|
13
|
+
import { Card, CardHeader, CardContent, CardTitle, CardDescription, CardFooter } from '$lib/components/ui/card';
|
|
14
|
+
import type { Snippet } from 'svelte';
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
title,
|
|
18
|
+
description = '',
|
|
19
|
+
class: className = '',
|
|
20
|
+
children,
|
|
21
|
+
footer,
|
|
22
|
+
...rest
|
|
23
|
+
}: {
|
|
24
|
+
title: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
class?: string;
|
|
27
|
+
children?: Snippet;
|
|
28
|
+
footer?: Snippet;
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
} = $props();
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<Card class={className} {...rest}>
|
|
34
|
+
<CardHeader>
|
|
35
|
+
<CardTitle>{title}</CardTitle>
|
|
36
|
+
{#if description}
|
|
37
|
+
<CardDescription>{description}</CardDescription>
|
|
38
|
+
{/if}
|
|
39
|
+
</CardHeader>
|
|
40
|
+
<CardContent>
|
|
41
|
+
{@render children?.()}
|
|
42
|
+
</CardContent>
|
|
43
|
+
{#if footer}
|
|
44
|
+
<CardFooter>
|
|
45
|
+
{@render footer?.()}
|
|
46
|
+
</CardFooter>
|
|
47
|
+
{/if}
|
|
48
|
+
</Card>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SettingsCard } from './SettingsCard.svelte';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
src/lib/components/ui/sidebar-item/SidebarItem.svelte
|
|
3
|
+
Sidebar navigation item with icon, text, and optional notification badge.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
<SidebarItem href="/inbox" state="current" notificationCount={5}>
|
|
7
|
+
{#snippet icon()}<InboxIcon />{/snippet}
|
|
8
|
+
Inbox
|
|
9
|
+
</SidebarItem>
|
|
10
|
+
-->
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { tv, type VariantProps } from 'tailwind-variants';
|
|
13
|
+
import { cn } from '$lib/utils/cn';
|
|
14
|
+
import type { Snippet } from 'svelte';
|
|
15
|
+
|
|
16
|
+
const sidebarItemVariants = tv({
|
|
17
|
+
base: 'flex items-center gap-3 px-3 py-2 rounded-lg font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
|
|
18
|
+
variants: {
|
|
19
|
+
state: {
|
|
20
|
+
default: 'text-muted-foreground hover:bg-muted hover:text-foreground',
|
|
21
|
+
hover: 'bg-muted text-foreground',
|
|
22
|
+
current: 'bg-muted text-primary'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
state: 'default'
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
type State = VariantProps<typeof sidebarItemVariants>['state'];
|
|
31
|
+
|
|
32
|
+
let {
|
|
33
|
+
state = 'default',
|
|
34
|
+
notificationCount = undefined,
|
|
35
|
+
href = undefined,
|
|
36
|
+
class: className = '',
|
|
37
|
+
icon,
|
|
38
|
+
children,
|
|
39
|
+
...rest
|
|
40
|
+
}: {
|
|
41
|
+
state?: State;
|
|
42
|
+
notificationCount?: number | undefined;
|
|
43
|
+
href?: string | undefined;
|
|
44
|
+
class?: string;
|
|
45
|
+
icon?: Snippet;
|
|
46
|
+
children?: Snippet;
|
|
47
|
+
[key: string]: unknown;
|
|
48
|
+
} = $props();
|
|
49
|
+
|
|
50
|
+
let classes = $derived(cn(sidebarItemVariants({ state }), className));
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
{#if href}
|
|
54
|
+
<a
|
|
55
|
+
{href}
|
|
56
|
+
class={classes}
|
|
57
|
+
aria-current={state === 'current' ? 'page' : undefined}
|
|
58
|
+
{...rest}
|
|
59
|
+
>
|
|
60
|
+
<span class="flex-shrink-0 w-4 h-4">
|
|
61
|
+
{@render icon?.()}
|
|
62
|
+
</span>
|
|
63
|
+
<span class="flex-1 truncate">
|
|
64
|
+
{@render children?.()}
|
|
65
|
+
</span>
|
|
66
|
+
{#if notificationCount !== undefined && notificationCount > 0}
|
|
67
|
+
<span class="flex-shrink-0 flex items-center justify-center h-6 w-6 rounded-full bg-primary text-primary-foreground text-xs font-semibold">
|
|
68
|
+
{notificationCount}
|
|
69
|
+
</span>
|
|
70
|
+
{/if}
|
|
71
|
+
</a>
|
|
72
|
+
{:else}
|
|
73
|
+
<button
|
|
74
|
+
type="button"
|
|
75
|
+
class={classes}
|
|
76
|
+
{...rest}
|
|
77
|
+
>
|
|
78
|
+
<span class="flex-shrink-0 w-4 h-4">
|
|
79
|
+
{@render icon?.()}
|
|
80
|
+
</span>
|
|
81
|
+
<span class="flex-1 truncate text-left">
|
|
82
|
+
{@render children?.()}
|
|
83
|
+
</span>
|
|
84
|
+
{#if notificationCount !== undefined && notificationCount > 0}
|
|
85
|
+
<span class="flex-shrink-0 flex items-center justify-center h-6 w-6 rounded-full bg-primary text-primary-foreground text-xs font-semibold">
|
|
86
|
+
{notificationCount}
|
|
87
|
+
</span>
|
|
88
|
+
{/if}
|
|
89
|
+
</button>
|
|
90
|
+
{/if}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SidebarItem } from './SidebarItem.svelte';
|