astro-component-kit 0.4.0 → 0.5.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.
Files changed (208) hide show
  1. package/README.md +139 -27
  2. package/bin/cli.js +67 -0
  3. package/bin/installer.js +179 -0
  4. package/package.json +35 -5
  5. package/src/components/index.ts +2 -0
  6. package/src/components/lib/Galaxy3D.astro +249 -137
  7. package/src/components/lib/app/AppSidebar.astro +249 -0
  8. package/src/components/lib/app/AppTopbar.astro +284 -0
  9. package/src/components/lib/app/ArrivalsBoard.astro +176 -0
  10. package/src/components/lib/app/AuthCard.astro +213 -0
  11. package/src/components/lib/app/DataTable.astro +346 -0
  12. package/src/components/lib/app/GuestProfileCard.astro +133 -0
  13. package/src/components/lib/app/HousekeepingBoard.astro +189 -0
  14. package/src/components/lib/app/PageHeader.astro +157 -0
  15. package/src/components/lib/app/PlanUsageCard.astro +112 -0
  16. package/src/components/lib/app/RoomRack.astro +207 -0
  17. package/src/components/lib/app/SettingsSection.astro +96 -0
  18. package/src/components/lib/app/SwitchRow.astro +71 -0
  19. package/src/components/lib/app/TeamMembers.astro +190 -0
  20. package/src/components/lib/app/app-icons.ts +52 -0
  21. package/src/components/lib/app/index.ts +19 -0
  22. package/src/components/lib/charts/AreaChart.astro +4 -4
  23. package/src/components/lib/charts/BarChart.astro +3 -3
  24. package/src/components/lib/charts/ChartFrame.astro +10 -10
  25. package/src/components/lib/charts/DonutChart.astro +2 -2
  26. package/src/components/lib/charts/DumbbellChart.astro +1 -1
  27. package/src/components/lib/charts/ForecastLineChart.astro +1 -1
  28. package/src/components/lib/charts/GaugeChart.astro +1 -1
  29. package/src/components/lib/charts/HeatmapChart.astro +1 -1
  30. package/src/components/lib/charts/HorizontalBarChart.astro +2 -2
  31. package/src/components/lib/charts/KpiStatTile.astro +4 -4
  32. package/src/components/lib/charts/LinearProgressGauge.astro +4 -4
  33. package/src/components/lib/charts/MetricDeltaTable.astro +3 -3
  34. package/src/components/lib/charts/RadarMetricChart.astro +4 -4
  35. package/src/components/lib/charts/RadialBarChart.astro +1 -1
  36. package/src/components/lib/charts/RetentionCohortTable.astro +2 -2
  37. package/src/components/lib/charts/TreemapChart.astro +1 -1
  38. package/src/components/lib/ecommerce/CartDrawer.astro +483 -0
  39. package/src/components/lib/ecommerce/CartPageList.astro +290 -0
  40. package/src/components/lib/ecommerce/CartToast.astro +276 -0
  41. package/src/components/lib/ecommerce/CategoryTiles.astro +143 -0
  42. package/src/components/lib/ecommerce/CheckoutForm.astro +423 -0
  43. package/src/components/lib/ecommerce/CountdownBanner.astro +230 -0
  44. package/src/components/lib/ecommerce/FilterBar.astro +278 -0
  45. package/src/components/lib/ecommerce/FilterSidebar.astro +405 -0
  46. package/src/components/lib/ecommerce/LiveActivityToast.astro +213 -0
  47. package/src/components/lib/ecommerce/OrderSummary.astro +295 -0
  48. package/src/components/lib/ecommerce/ProductBuyBox.astro +247 -0
  49. package/src/components/lib/ecommerce/ProductCardMinimal.astro +229 -0
  50. package/src/components/lib/ecommerce/ProductGallery.astro +145 -0
  51. package/src/components/lib/ecommerce/ProductGrid.astro +118 -0
  52. package/src/components/lib/ecommerce/ProductMedia.astro +113 -0
  53. package/src/components/lib/ecommerce/ProductRating.astro +78 -0
  54. package/src/components/lib/ecommerce/ProductToolbar.astro +93 -0
  55. package/src/components/lib/ecommerce/PromoBar.astro +145 -0
  56. package/src/components/lib/ecommerce/StockIndicator.astro +127 -0
  57. package/src/components/lib/ecommerce/StoreHeader.astro +446 -0
  58. package/src/components/lib/ecommerce/StoreHero.astro +260 -0
  59. package/src/components/lib/ecommerce/StoreProductCard.astro +307 -0
  60. package/src/components/lib/ecommerce/TrustBadges.astro +101 -0
  61. package/src/components/lib/ecommerce/VariantPicker.astro +145 -0
  62. package/src/components/lib/ecommerce/cart-store.ts +151 -0
  63. package/src/components/lib/ecommerce/catalog-filter.ts +62 -0
  64. package/src/components/lib/ecommerce/index.ts +34 -0
  65. package/src/components/lib/ecommerce/product-icons.ts +28 -0
  66. package/src/components/lib/ecommerce/types.ts +70 -0
  67. package/src/components/lib/forms/AnimatedInput.astro +4 -2
  68. package/src/components/lib/forms/CustomRadioGroup.astro +3 -1
  69. package/src/components/lib/index.ts +2 -0
  70. package/src/components/lib/layout/BentoGrid3.astro +6 -4
  71. package/src/components/lib/layout/CenterFixedBox.astro +2 -2
  72. package/src/components/lib/layout/CenteredContainer.astro +4 -2
  73. package/src/components/lib/layout/ClusterHorizontal.astro +2 -2
  74. package/src/components/lib/layout/FeatureHero.astro +4 -2
  75. package/src/components/lib/layout/FooterCenteredMinimal.astro +4 -2
  76. package/src/components/lib/layout/FullBleedSection.astro +2 -2
  77. package/src/components/lib/layout/GalleryGrid4.astro +2 -2
  78. package/src/components/lib/layout/HolyGrailGrid.astro +11 -9
  79. package/src/components/lib/layout/LandingSectionSplit.astro +5 -3
  80. package/src/components/lib/layout/MasonryGrid.astro +2 -2
  81. package/src/components/lib/layout/MinimalFooterGrid.astro +1 -1
  82. package/src/components/lib/layout/ScrollSnapSection.astro +1 -1
  83. package/src/components/lib/layout/SidebarLayoutWrapper.astro +4 -2
  84. package/src/components/lib/layout/SplitScreenLayout.astro +3 -3
  85. package/src/components/lib/layout/StepLayoutVertical.astro +1 -1
  86. package/src/components/lib/layout/StickySidebarWrapper.astro +4 -2
  87. package/src/components/lib/sections/AgencyContactBrief.astro +194 -0
  88. package/src/components/lib/sections/AgencyFooterCta.astro +94 -0
  89. package/src/components/lib/sections/AgencyHeader.astro +161 -0
  90. package/src/components/lib/sections/AgencyHeroKinetic.astro +172 -0
  91. package/src/components/lib/sections/AgencyServicesList.astro +113 -0
  92. package/src/components/lib/sections/AgencyTeamGrid.astro +111 -0
  93. package/src/components/lib/sections/AgencyWorkGrid.astro +147 -0
  94. package/src/components/lib/sections/BlogGridSection.astro +9 -7
  95. package/src/components/lib/sections/ButtonsShowcase.astro +20 -18
  96. package/src/components/lib/sections/CardsShowcase.astro +28 -26
  97. package/src/components/lib/sections/CareersOpenings.astro +10 -8
  98. package/src/components/lib/sections/ChangelogSection.astro +20 -7
  99. package/src/components/lib/sections/ContactGlassForm.astro +10 -8
  100. package/src/components/lib/sections/ContactSplitMap.astro +11 -9
  101. package/src/components/lib/sections/CtaAppDownload.astro +13 -11
  102. package/src/components/lib/sections/CtaGlowBanner.astro +12 -10
  103. package/src/components/lib/sections/CtaNewsletterSection.astro +13 -11
  104. package/src/components/lib/sections/CtaSplitImage.astro +13 -11
  105. package/src/components/lib/sections/DataShowcase.astro +23 -21
  106. package/src/components/lib/sections/FaqAccordionSection.astro +8 -8
  107. package/src/components/lib/sections/FaqTwoColumn.astro +9 -7
  108. package/src/components/lib/sections/FeatureAlternatingRows.astro +10 -8
  109. package/src/components/lib/sections/FeatureBentoGrid.astro +13 -11
  110. package/src/components/lib/sections/FeatureIconGrid.astro +6 -6
  111. package/src/components/lib/sections/FeatureTabsShowcase.astro +13 -11
  112. package/src/components/lib/sections/FeatureTimelineFlow.astro +8 -6
  113. package/src/components/lib/sections/FeedbackShowcase.astro +15 -13
  114. package/src/components/lib/sections/FooterMegaSection.astro +13 -11
  115. package/src/components/lib/sections/FormsShowcase.astro +22 -20
  116. package/src/components/lib/sections/HeroDashboardPreview.astro +11 -9
  117. package/src/components/lib/sections/HeroGlass.astro +22 -20
  118. package/src/components/lib/sections/HeroGradient.astro +15 -13
  119. package/src/components/lib/sections/HeroMinimalCentered.astro +10 -10
  120. package/src/components/lib/sections/HeroShowcaseSplit.astro +18 -16
  121. package/src/components/lib/sections/HeroSplit.astro +13 -11
  122. package/src/components/lib/sections/HeroTerminal.astro +14 -12
  123. package/src/components/lib/sections/HeroWaitlist.astro +10 -8
  124. package/src/components/lib/sections/HowItWorksSteps.astro +12 -10
  125. package/src/components/lib/sections/IntegrationsGrid.astro +7 -7
  126. package/src/components/lib/sections/LayoutShowcase.astro +21 -19
  127. package/src/components/lib/sections/LogoCloudSection.astro +4 -4
  128. package/src/components/lib/sections/LogoWallGrid.astro +6 -4
  129. package/src/components/lib/sections/NavigationShowcase.astro +15 -13
  130. package/src/components/lib/sections/OverlaysShowcase.astro +21 -19
  131. package/src/components/lib/sections/PricingComparisonMatrix.astro +15 -13
  132. package/src/components/lib/sections/PricingSinglePlan.astro +13 -11
  133. package/src/components/lib/sections/PricingTierCards.astro +11 -9
  134. package/src/components/lib/sections/PricingToggleCards.astro +13 -13
  135. package/src/components/lib/sections/ShopCategoryHero.astro +103 -0
  136. package/src/components/lib/sections/ShopCollectionMosaic.astro +131 -0
  137. package/src/components/lib/sections/ShopFooterWordmark.astro +100 -0
  138. package/src/components/lib/sections/ShopHeaderEditorial.astro +396 -0
  139. package/src/components/lib/sections/ShopHeroEditorial.astro +151 -0
  140. package/src/components/lib/sections/ShopLookbook.astro +250 -0
  141. package/src/components/lib/sections/ShopNewsletterEditorial.astro +128 -0
  142. package/src/components/lib/sections/ShopProductRail.astro +150 -0
  143. package/src/components/lib/sections/ShopReviewsEditorial.astro +133 -0
  144. package/src/components/lib/sections/ShopValuesMarquee.astro +91 -0
  145. package/src/components/lib/sections/StatsCounterBand.astro +9 -7
  146. package/src/components/lib/sections/StatsDashboardSection.astro +4 -2
  147. package/src/components/lib/sections/StatsMetricShowcase.astro +9 -7
  148. package/src/components/lib/sections/TeamGridSection.astro +12 -10
  149. package/src/components/lib/sections/TestimonialCarousel.astro +10 -8
  150. package/src/components/lib/sections/TestimonialFeatured.astro +7 -5
  151. package/src/components/lib/sections/TestimonialGridSection.astro +7 -7
  152. package/src/components/lib/sections/TestimonialWallGlass.astro +11 -9
  153. package/src/components/lib/sections/TypographyShowcase.astro +10 -8
  154. package/src/components/lib/sections/index.ts +10 -0
  155. package/src/components/lib/templates/ecommerce/StoreCategoryPage.astro +160 -0
  156. package/src/components/lib/templates/ecommerce/StoreCheckoutPage.astro +98 -0
  157. package/src/components/lib/templates/ecommerce/StoreHomePage.astro +191 -0
  158. package/src/components/lib/templates/ecommerce/StoreLayout.astro +169 -0
  159. package/src/components/lib/templates/ecommerce/StoreProductPage.astro +165 -0
  160. package/src/components/lib/templates/ecommerce/data.ts +187 -0
  161. package/src/components/lib/templates/ecommerce/index.ts +14 -0
  162. package/src/components/lib/templates/ecommerce-editorial/EditorialBagPage.astro +52 -0
  163. package/src/components/lib/templates/ecommerce-editorial/EditorialCheckoutPage.astro +123 -0
  164. package/src/components/lib/templates/ecommerce-editorial/EditorialHomePage.astro +102 -0
  165. package/src/components/lib/templates/ecommerce-editorial/EditorialLayout.astro +216 -0
  166. package/src/components/lib/templates/ecommerce-editorial/EditorialProductPage.astro +205 -0
  167. package/src/components/lib/templates/ecommerce-editorial/EditorialShopPage.astro +112 -0
  168. package/src/components/lib/templates/ecommerce-editorial/data.ts +125 -0
  169. package/src/components/lib/templates/ecommerce-editorial/index.ts +16 -0
  170. package/src/components/lib/templates/saas-hotel/AppLayout.astro +83 -0
  171. package/src/components/lib/templates/saas-hotel/DashboardPage.astro +66 -0
  172. package/src/components/lib/templates/saas-hotel/GuestsPage.astro +65 -0
  173. package/src/components/lib/templates/saas-hotel/LandingPage.astro +213 -0
  174. package/src/components/lib/templates/saas-hotel/ReportsPage.astro +63 -0
  175. package/src/components/lib/templates/saas-hotel/ReservationsPage.astro +49 -0
  176. package/src/components/lib/templates/saas-hotel/RoomsPage.astro +48 -0
  177. package/src/components/lib/templates/saas-hotel/SettingsPage.astro +115 -0
  178. package/src/components/lib/templates/saas-hotel/SignInPage.astro +50 -0
  179. package/src/components/lib/templates/saas-hotel/data.ts +229 -0
  180. package/src/components/lib/templates/saas-hotel/index.ts +19 -0
  181. package/src/components/lib/templates/saas-hotel/lobby-theme.css +90 -0
  182. package/src/data/registry/app.ts +93 -0
  183. package/src/data/registry/buttons.ts +3279 -0
  184. package/src/data/registry/cards.ts +1753 -0
  185. package/src/data/registry/charts-svg.ts +557 -0
  186. package/src/data/registry/charts.ts +500 -0
  187. package/src/data/registry/data.ts +986 -0
  188. package/src/data/registry/ecommerce.ts +269 -0
  189. package/src/data/registry/feedback.ts +1824 -0
  190. package/src/data/registry/forms.ts +2513 -0
  191. package/src/data/registry/index.ts +64 -0
  192. package/src/data/registry/layout.ts +206 -0
  193. package/src/data/registry/navigation.ts +936 -0
  194. package/src/data/registry/overlays.ts +1133 -0
  195. package/src/data/registry/sections-extra.ts +397 -0
  196. package/src/data/registry/sections.ts +361 -0
  197. package/src/data/registry/sources.ts +41 -0
  198. package/src/data/registry/templates.ts +414 -0
  199. package/src/data/registry/types.ts +30 -0
  200. package/src/data/registry/typography.ts +777 -0
  201. package/src/mcp/http-server.ts +324 -0
  202. package/src/mcp/index.ts +67 -0
  203. package/src/mcp/installer.ts +178 -0
  204. package/src/mcp/registry-adapter.ts +278 -0
  205. package/src/mcp/stdio-server.ts +11 -0
  206. package/src/mcp/tools.ts +247 -0
  207. package/src/mcp/types.ts +53 -0
  208. package/src/styles/global.css +95 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ⬇ Astro Component Kit
2
2
 
3
- > A free, open-source accessible UI component library built for [Astro 5.x](https://astro.build).
3
+ > A free, open-source accessible UI component library and production templates built for [Astro 5.x](https://astro.build).
4
4
  > **🌐 Browse & copy components** at [astrocomponents.dev](https://astrocomponents.dev)
5
5
  > **šŸ“¦ Install via npm** or **copy-paste** — your choice!
6
6
 
@@ -13,13 +13,15 @@
13
13
 
14
14
  ## ✨ Features
15
15
 
16
- - šŸŽØ **Premium design** — dark mode first, glassmorphism, fluid typography, and subtle micro-animations
17
- - ⚔ **Full-page sections** — 14 production-ready landing sections (Heroes, Bento Grids, Pricing Matrices, Testimonials, CTAs, FAQs, Teams)
18
- - ♿ **Accessible** — strictly WCAG 2.1 AA compliant with ARIA roles and keyboard navigation
16
+ - šŸ¤– **Official MCP Server & AI development** — connect Cursor, Claude, Codex, Lovable, or any MCP client (`https://mcp.astrocomponents.dev/sse` or `npx astro-component-kit mcp install <client>`)
17
+ - šŸ›ļø **Multi-page production templates** — 3 complete templates (E-commerce Store, Editorial Boutique, SaaS Hotel) with state management, cart persistence, and live previews
18
+ - šŸŽØ **Dark & Light theme** — dark mode first with official `[data-theme="light"]` support, adaptive tokens, and glassmorphism
19
+ - ⚔ **Full-page sections** — 41+ production-ready landing sections (Heroes, Bento Grids, Pricing Matrices, Testimonials, CTAs, FAQs, Teams, Footers)
20
+ - šŸ“ˆ **Zero-dependency SVG charts** — 41 pure-SVG data visualization components rendered at build time with keyboard tooltips and data table fallbacks
21
+ - ♿ **Strictly Accessible** — WCAG 2.1 AA compliant with ARIA roles and full keyboard navigation
19
22
  - šŸ“‹ **Copy & paste** — browse [astrocomponents.dev](https://astrocomponents.dev) and copy components directly
20
- - šŸ“¦ **npm installable** — `npm install astro-component-kit` for direct imports
23
+ - šŸ“¦ **npm installable** — `npm install astro-component-kit` for direct modular imports
21
24
  - ā™»ļø **Zero runtime dependencies** — pure `.astro` components + Vanilla CSS
22
- - šŸŒ‘ **Dark mode first** — crafted for modern, dark-themed developer interfaces
23
25
  - šŸ”“ **Open Source** — MIT license, contributions welcome
24
26
 
25
27
  ---
@@ -45,7 +47,10 @@ import {
45
47
  CtaGlowBanner
46
48
  } from 'astro-component-kit';
47
49
 
48
- // Or import by category (recommended for modularity)
50
+ // Or import by category (recommended for tree-shaking & modularity)
51
+ import { StoreProductCard, ProductBuyBox, VariantPicker, CartDrawer } from 'astro-component-kit/ecommerce';
52
+ import { DataTable, AppSidebar, AppTopbar, RoomRack } from 'astro-component-kit/app';
53
+ import { LineChart, BarChart, DonutChart, KpiStatTile } from 'astro-component-kit/charts';
49
54
  import { GlassButton, GlowButton, ThreeDPushButton } from 'astro-component-kit/buttons';
50
55
  import { GlassCard, ProfileCard, PricingCard } from 'astro-component-kit/cards';
51
56
  import { GlassAlert, Badge, ConfettiFeedback } from 'astro-component-kit/feedback';
@@ -54,7 +59,6 @@ import { OverlayModal, CommandDialog, BottomSheetMobile } from 'astro-component-
54
59
  import { AnimatedInput, OTPInput, GlassSlider } from 'astro-component-kit/forms';
55
60
  import { GlassCardGrid, SplitScreenLayout, MasonryGrid, BentoGrid3 } from 'astro-component-kit/layout';
56
61
  import { GradientHeading, GlassBlockQuote, CyberpunkGlitchText } from 'astro-component-kit/typography';
57
- import { AreaChart, DonutChart, BarChart } from 'astro-component-kit/charts';
58
62
  import {
59
63
  FeatureBentoGrid,
60
64
  PricingComparisonMatrix,
@@ -74,7 +78,7 @@ import {
74
78
  <FeatureBentoGrid />
75
79
  ```
76
80
 
77
- **Import global design tokens** (optional but recommended):
81
+ **Import global design tokens** (required for theme colors, spacing and typography):
78
82
 
79
83
  ```astro
80
84
  ---
@@ -85,7 +89,7 @@ import 'astro-component-kit/global.css';
85
89
  ### Option 2: Copy & Paste from Docs
86
90
 
87
91
  1. Visit [astrocomponents.dev](https://astrocomponents.dev)
88
- 2. Browse the component library
92
+ 2. Browse the component library or templates
89
93
  3. Click **Copy** on the component code
90
94
  4. Paste into your `src/components/` directory
91
95
  5. Import and use in your Astro pages
@@ -103,14 +107,49 @@ Open [http://localhost:4321](http://localhost:4321) to browse components locally
103
107
 
104
108
  ---
105
109
 
110
+ ## šŸ¤– Build with AI via MCP (Model Context Protocol)
111
+
112
+ Astro Components Kit provides an official **Model Context Protocol (MCP)** server. Connect it to **Cursor, Claude Desktop, Windsurf, or Antigravity** so your AI assistant can discover components, check TypeScript props, and generate production Astro code directly in your project.
113
+
114
+ ### Remote SSE Connection (Recommended — Zero install)
115
+
116
+ Add this endpoint to your editor's MCP settings (`claude_desktop_config.json`, Cursor Settings -> Features -> MCP, etc.):
117
+
118
+ ```json
119
+ {
120
+ "mcpServers": {
121
+ "astro-components": {
122
+ "url": "https://mcp.astrocomponents.dev/sse"
123
+ }
124
+ }
125
+ }
126
+ ```
127
+
128
+ ### Available MCP Tools
129
+
130
+ | Tool | Purpose |
131
+ |------|---------|
132
+ | `search_components` | Search by keyword, category, or tag (e.g. `"buy box"`, `"kpi chart"`, `"pricing"`) |
133
+ | `get_component` | Detailed component metadata, TypeScript `Props`, import statements, and usage code |
134
+ | `get_component_code` | Raw `.astro` source code ready to inject into your project |
135
+ | `list_categories` | Overview of all 13 component categories with item counts |
136
+ | `list_templates` | Overview of the 3 multi-page production templates (Nova Store, Forma Studio, The Lobby) |
137
+ | `get_template` | Complete template architecture, pages, store configuration, and routing guide |
138
+ | `get_design_tokens` | CSS tokens, color variables, spacing scale, and dark/light theme setup |
139
+ | `get_library_info` | High-level overview, active version, total counts, and quickstart guide |
140
+
141
+ ---
142
+
106
143
  ## šŸ“š Component & Section Library
107
144
 
108
- **290+ components & full-page sections** across 11 categories:
145
+ **320+ components & full-page sections** across 13 categories plus 3 complete templates:
109
146
 
110
147
  | Category | Components | Description |
111
148
  |----------|:----------:|-------------|
149
+ | **E-commerce** | 29 | Shop building blocks: product cards, cart drawer, buy box, variant picker, order summary, checkout, stock indicators |
150
+ | **App & Dashboard** | 15 | SaaS building blocks: DataTable, collapsible AppSidebar, AppTopbar, RoomRack, ArrivalsBoard, HousekeepingBoard, AuthCard |
112
151
  | **Charts & Stats** | 47 | 41 zero-dependency SVG charts rendered at build time (line, area, bars, waterfall, pie, gauge, treemap, sankey, radar, heatmap, candlestick, KPI tiles…) plus 3 ApexCharts wrappers |
113
- | **Sections** | 41 | Heroes, features, pricing, testimonials, CTAs, stats dashboards, careers, FAQs, contact, logo walls, blog, changelog, footers |
152
+ | **Sections** | 41 | Heroes, features, pricing, testimonials, CTAs, stats dashboards, careers, FAQs, contact, logo walls, shop sections, blog, footers |
114
153
  | **Buttons** | 22 | Glass, glow, neumorphic, 3D push, magnetic, cyberpunk, and animated |
115
154
  | **Cards** | 22 | Ecommerce, profile, pricing, weather, tilt, portfolio, kanban |
116
155
  | **Layout** | 22 | Bento grids, masonry, split screens, sticky sidebars, card grids, full-bleed sections |
@@ -121,7 +160,64 @@ Open [http://localhost:4321](http://localhost:4321) to browse components locally
121
160
  | **Data Display** | 23 | Tables, vertical/horizontal timelines, stats grids, sparklines, tree views |
122
161
  | **Typography** | 24 | Gradient headings, glitch text, typewriter, 3D text layers, drop caps |
123
162
 
124
- ### SVG charts — zero dependencies
163
+ ---
164
+
165
+ ## šŸ›ļø Production Templates
166
+
167
+ Complete multi-page sites built exclusively with library components. Live interactive previews are available at [astrocomponents.dev/templates](https://astrocomponents.dev/templates/).
168
+
169
+ ### 1. E-Commerce Store (Nova Store)
170
+ A production-ready digital storefront with 5 pages, client-side filtering without backend, and a browser-persistent cart:
171
+
172
+ ```astro
173
+ ---
174
+ // src/pages/index.astro
175
+ import 'astro-component-kit/global.css';
176
+ import { StoreHomePage } from 'astro-component-kit/templates/ecommerce';
177
+ ---
178
+
179
+ <StoreHomePage />
180
+ ```
181
+
182
+ - **Pages included:** `StoreHomePage`, `StoreCategoryPage`, `StoreProductPage`, `StoreCheckoutPage` and `StoreLayout`.
183
+ - **Persistent Cart:** `cart-store.ts` handles cart items, quantities, promo codes, tax, and cross-tab synchronization.
184
+ - **Import path:** `astro-component-kit/templates/ecommerce`
185
+
186
+ ### 2. E-Commerce Editorial (Forma Studio)
187
+ High-fashion boutique aesthetic with serif typography, square lines, warm terracotta tones, and light theme default:
188
+
189
+ ```astro
190
+ ---
191
+ // src/pages/index.astro
192
+ import 'astro-component-kit/global.css';
193
+ import { EditorialHomePage } from 'astro-component-kit/templates/ecommerce-editorial';
194
+ ---
195
+
196
+ <EditorialHomePage />
197
+ ```
198
+
199
+ - **Pages included:** `EditorialHomePage`, `EditorialShopPage`, `EditorialProductPage`, `EditorialBagPage`, `EditorialCheckoutPage` and `EditorialLayout`.
200
+ - **Import path:** `astro-component-kit/templates/ecommerce-editorial`
201
+
202
+ ### 3. SaaS Hotel & Hospitality App (The Lobby)
203
+ A dense, full-featured management dashboard:
204
+
205
+ ```astro
206
+ ---
207
+ // src/pages/app/index.astro
208
+ import 'astro-component-kit/global.css';
209
+ import { DashboardPage } from 'astro-component-kit/templates/saas-hotel';
210
+ ---
211
+
212
+ <DashboardPage />
213
+ ```
214
+
215
+ - **Pages included:** `DashboardPage`, `RoomsPage` (Room Rack timeline), `ReservationsPage`, `GuestsPage`, `ReportsPage`, `SettingsPage`, `SignInPage`, and `LandingPage`.
216
+ - **Import path:** `astro-component-kit/templates/saas-hotel`
217
+
218
+ ---
219
+
220
+ ## šŸ“ˆ SVG Charts — Zero Dependencies
125
221
 
126
222
  ```astro
127
223
  ---
@@ -142,6 +238,19 @@ Every chart ships with a legend, keyboard-focusable marks with tooltips and a "V
142
238
 
143
239
  ---
144
240
 
241
+ ## šŸŒ“ Theming & Dark / Light Mode
242
+
243
+ Components are built dark-mode first with full support for light mode via the `[data-theme="light"]` attribute:
244
+
245
+ ```html
246
+ <!-- Apply on html or body element -->
247
+ <html data-theme="light">
248
+ ```
249
+
250
+ All design tokens (`--ink-rgb`, `--paper-rgb`, `--c-on-primary`, and `--chart-*`) adapt automatically, preserving high contrast and accessible readability.
251
+
252
+ ---
253
+
145
254
  ## šŸ“– Usage Examples
146
255
 
147
256
  ### Building a Complete Landing Page in Minutes
@@ -166,7 +275,7 @@ import { MinimalFooterGrid } from 'astro-component-kit/layout';
166
275
 
167
276
  <!-- 2. Hero Header -->
168
277
  <HeroGradient
169
- badge="New Release v0.3.0"
278
+ badge="New Release v0.5.0"
170
279
  title="Build Production Websites at Lightning Speed"
171
280
  subtitle="Zero client JavaScript runtime, accessible UI, and modern dark glassmorphism."
172
281
  />
@@ -247,22 +356,25 @@ import { Badge } from 'astro-component-kit/feedback';
247
356
  astro-component-kit/
248
357
  ā”œā”€ā”€ src/
249
358
  │ ā”œā”€ā”€ components/
250
- │ │ ā”œā”€ā”€ lib/ ← 290+ component source files
251
- │ │ │ ā”œā”€ā”€ sections/ ← 14 full-page landing sections
252
- │ │ │ ā”œā”€ā”€ buttons/ ← 19 button components
253
- │ │ │ ā”œā”€ā”€ cards/ ← 19 card components
254
- │ │ │ ā”œā”€ā”€ layout/ ← 19 layout & grid components
255
- │ │ │ ā”œā”€ā”€ forms/ ← 18 form controls & inputs
256
- │ │ │ ā”œā”€ā”€ navigation/ ← 17 navbar & menu components
257
- │ │ │ ā”œā”€ā”€ overlays/ ← 20 overlay & modal components
258
- │ │ │ ā”œā”€ā”€ feedback/ ← 17 alert & feedback components
259
- │ │ │ ā”œā”€ā”€ data/ ← 19 data visualization & tables
260
- │ │ │ ā”œā”€ā”€ typography/ ← 19 typography components
261
- │ │ │ └── charts/ ← 3 interactive data charts
359
+ │ │ ā”œā”€ā”€ lib/ ← 320+ component source files & templates
360
+ │ │ │ ā”œā”€ā”€ templates/ ← Multi-page templates (ecommerce, editorial, saas-hotel)
361
+ │ │ │ ā”œā”€ā”€ ecommerce/ ← 29 e-commerce components & cart-store
362
+ │ │ │ ā”œā”€ā”€ app/ ← 15 SaaS & dashboard components
363
+ │ │ │ ā”œā”€ā”€ charts/ ← 47 SVG & interactive charts and KPI tiles
364
+ │ │ │ ā”œā”€ā”€ sections/ ← 41 full-page landing & shop sections
365
+ │ │ │ ā”œā”€ā”€ buttons/ ← 22 button components
366
+ │ │ │ ā”œā”€ā”€ cards/ ← 22 card components
367
+ │ │ │ ā”œā”€ā”€ layout/ ← 22 layout & grid components
368
+ │ │ │ ā”œā”€ā”€ forms/ ← 24 form controls & inputs
369
+ │ │ │ ā”œā”€ā”€ navigation/ ← 23 navbar & menu components
370
+ │ │ │ ā”œā”€ā”€ overlays/ ← 23 overlay & modal components
371
+ │ │ │ ā”œā”€ā”€ feedback/ ← 22 alert & feedback components
372
+ │ │ │ ā”œā”€ā”€ data/ ← 23 data visualization & tables
373
+ │ │ │ └── typography/ ← 24 typography components
262
374
  │ │ └── index.ts ← Main barrel export
263
375
  │ └── types.d.ts ← TypeScript declarations
264
376
  ā”œā”€ā”€ src/styles/
265
- │ └── global.css ← Design tokens & global CSS
377
+ │ └── global.css ← Design tokens & theme styles (dark/light)
266
378
  └── package.json
267
379
  ```
268
380
 
package/bin/cli.js ADDED
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env node
2
+ // bin/cli.js
3
+ // Direct CLI runner for astro-component-kit.
4
+ import { spawn } from 'node:child_process';
5
+ import path from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+ import { installMcpForClient } from './installer.js';
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = path.dirname(__filename);
11
+ const rootDir = path.resolve(__dirname, '..');
12
+
13
+ const args = process.argv.slice(2);
14
+ const first = args[0]?.toLowerCase();
15
+
16
+ async function main() {
17
+ // 1. Fast-path: 1-click install command runs natively in pure Node.js
18
+ if (first === 'install' || (first === 'mcp' && args[1]?.toLowerCase() === 'install')) {
19
+ const client = first === 'install' ? args[1] : args[2];
20
+ if (!client) {
21
+ console.log(`\nšŸš€ Astro Components Kit — 1-Click MCP Installer\n`);
22
+ console.log(`Usage:`);
23
+ console.log(` npx astro-component-kit mcp install <cursor|claude|codex|lovable|mcp>\n`);
24
+ console.log(`Example:`);
25
+ console.log(` npx astro-component-kit mcp install cursor\n`);
26
+ process.exit(1);
27
+ }
28
+
29
+ const success = await installMcpForClient(client);
30
+ process.exit(success ? 0 : 1);
31
+ }
32
+
33
+ // 2. Help command
34
+ if (!first || first === 'help' || first === '--help' || first === '-h') {
35
+ console.log(`
36
+ šŸš€ Astro Components Kit (astro-component-kit)
37
+
38
+ Usage:
39
+ npx astro-component-kit mcp install <cursor|claude|codex|lovable|mcp>
40
+ → Automatically configure your AI editor/agent to connect to the MCP server
41
+
42
+ npx astro-component-kit mcp serve
43
+ → Start local HTTP/SSE MCP server (default port 3000)
44
+
45
+ npx astro-component-kit mcp --stdio
46
+ → Run in stdio mode for local MCP integrations
47
+
48
+ Remote SSE Endpoint:
49
+ https://mcp.astrocomponents.dev/sse
50
+ `);
51
+ process.exit(0);
52
+ }
53
+
54
+ // 3. For serve / stdio modes, invoke MCP runner
55
+ const tsxPath = path.resolve(rootDir, 'node_modules/.bin/tsx');
56
+ const mcpEntry = path.resolve(rootDir, 'src/mcp/index.ts');
57
+ const proc = spawn(process.execPath, [tsxPath, mcpEntry, ...args], {
58
+ stdio: 'inherit',
59
+ cwd: process.cwd(),
60
+ });
61
+ proc.on('exit', (code) => process.exit(code || 0));
62
+ }
63
+
64
+ main().catch((err) => {
65
+ console.error('[cli] Error:', err);
66
+ process.exit(1);
67
+ });
@@ -0,0 +1,179 @@
1
+ // bin/installer.js
2
+ // Pure Node.js automated 1-click CLI installer with zero dependencies.
3
+ import fs from 'node:fs';
4
+ import path from 'node:path';
5
+ import os from 'node:os';
6
+
7
+ const MCP_SERVER_URL = 'https://mcp.astrocomponents.dev/sse';
8
+
9
+ const SERVER_CONFIG = {
10
+ url: MCP_SERVER_URL,
11
+ };
12
+
13
+ function getHomeDir() {
14
+ return os.homedir();
15
+ }
16
+
17
+ export function normalizeClient(input) {
18
+ if (!input || typeof input !== 'string') return null;
19
+ const c = input.toLowerCase().trim();
20
+ if (c === 'cursor' || c === 'cursos') return 'cursor';
21
+ if (c === 'claude' || c === 'claude-desktop' || c === 'claude-code') return 'claude';
22
+ if (c === 'codex' || c === 'openai-codex' || c === 'copilot') return 'codex';
23
+ if (c === 'lovable' || c === 'lovable-dev') return 'lovable';
24
+ if (c === 'mcp' || c === 'universal' || c === 'generic') return 'mcp';
25
+ if (c === 'windsurf') return 'windsurf';
26
+ if (c === 'cline') return 'cline';
27
+ return null;
28
+ }
29
+
30
+ /**
31
+ * Returns the candidate configuration paths for each supported client.
32
+ */
33
+ function getClientConfigPaths(client) {
34
+ const home = getHomeDir();
35
+ const platform = os.platform();
36
+
37
+ switch (client) {
38
+ case 'cursor': {
39
+ const localCursor = path.resolve(process.cwd(), '.cursor/mcp.json');
40
+ const globalCursor = path.resolve(home, '.cursor/mcp.json');
41
+ return { primary: localCursor, fallback: globalCursor };
42
+ }
43
+ case 'claude': {
44
+ if (platform === 'darwin') {
45
+ return { primary: path.resolve(home, 'Library/Application Support/Claude/claude_desktop_config.json') };
46
+ }
47
+ if (platform === 'win32') {
48
+ const appData = process.env.APPDATA || path.resolve(home, 'AppData/Roaming');
49
+ return { primary: path.resolve(appData, 'Claude/claude_desktop_config.json') };
50
+ }
51
+ return { primary: path.resolve(home, '.config/Claude/claude_desktop_config.json') };
52
+ }
53
+ case 'codex': {
54
+ const localCodex = path.resolve(process.cwd(), '.codex/mcp.json');
55
+ const globalCodex = path.resolve(home, '.codex/config.json');
56
+ return { primary: localCodex, fallback: globalCodex };
57
+ }
58
+ case 'lovable': {
59
+ const localLovable = path.resolve(process.cwd(), '.lovable/mcp.json');
60
+ const globalLovable = path.resolve(home, '.lovable/config.json');
61
+ return { primary: localLovable, fallback: globalLovable };
62
+ }
63
+ case 'mcp': {
64
+ const localMcp = path.resolve(process.cwd(), 'mcp.json');
65
+ const globalMcp = path.resolve(home, '.mcp/config.json');
66
+ return { primary: localMcp, fallback: globalMcp };
67
+ }
68
+ case 'windsurf': {
69
+ return { primary: path.resolve(home, '.codeium/windsurf/mcp_config.json') };
70
+ }
71
+ case 'cline': {
72
+ if (platform === 'darwin') {
73
+ return {
74
+ primary: path.resolve(
75
+ home,
76
+ 'Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json'
77
+ ),
78
+ };
79
+ }
80
+ if (platform === 'win32') {
81
+ const appData = process.env.APPDATA || path.resolve(home, 'AppData/Roaming');
82
+ return {
83
+ primary: path.resolve(
84
+ appData,
85
+ 'Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json'
86
+ ),
87
+ };
88
+ }
89
+ return {
90
+ primary: path.resolve(
91
+ home,
92
+ '.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json'
93
+ ),
94
+ };
95
+ }
96
+ default:
97
+ return { primary: path.resolve(process.cwd(), 'mcp.json') };
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Installs or updates the astro-components MCP server in the target client's configuration.
103
+ */
104
+ export async function installMcpForClient(targetClient) {
105
+ const client = normalizeClient(targetClient);
106
+ const validClients = ['cursor', 'claude', 'codex', 'lovable', 'mcp', 'windsurf', 'cline'];
107
+
108
+ if (!client) {
109
+ console.error(`\nāŒ Unknown client "${targetClient}".`);
110
+ console.log(` Supported clients: ${validClients.join(', ')}`);
111
+ console.log(`\nExamples:`);
112
+ console.log(` npx astro-component-kit mcp install cursor`);
113
+ console.log(` npx astro-component-kit mcp install claude`);
114
+ console.log(` npx astro-component-kit mcp install codex`);
115
+ console.log(` npx astro-component-kit mcp install lovable`);
116
+ console.log(` npx astro-component-kit mcp install mcp\n`);
117
+ return false;
118
+ }
119
+
120
+ const { primary } = getClientConfigPaths(client);
121
+ const targetDir = path.dirname(primary);
122
+
123
+ console.log(`\nšŸ“¦ Configuring Astro Components Kit MCP for [${client}]...`);
124
+ console.log(` Target config: ${primary}`);
125
+
126
+ try {
127
+ if (!fs.existsSync(targetDir)) {
128
+ fs.mkdirSync(targetDir, { recursive: true });
129
+ }
130
+
131
+ let config = {};
132
+ if (fs.existsSync(primary)) {
133
+ try {
134
+ const raw = fs.readFileSync(primary, 'utf8');
135
+ config = JSON.parse(raw);
136
+ } catch {
137
+ config = {};
138
+ }
139
+ }
140
+
141
+ if (!config || typeof config !== 'object') {
142
+ config = {};
143
+ }
144
+
145
+ if (!config.mcpServers || typeof config.mcpServers !== 'object') {
146
+ config.mcpServers = {};
147
+ }
148
+
149
+ // Add or update astro-components server
150
+ config.mcpServers['astro-components'] = SERVER_CONFIG;
151
+
152
+ fs.writeFileSync(primary, JSON.stringify(config, null, 2) + '\n', 'utf8');
153
+
154
+ console.log(`\nāœ… Successfully installed!`);
155
+ console.log(` Server name: "astro-components"`);
156
+ console.log(` Endpoint: ${MCP_SERVER_URL}`);
157
+ console.log(`\nšŸ’” What to do next:`);
158
+ console.log(` Restart ${client.toUpperCase()} (or reload MCP servers), then prompt your AI:`);
159
+ console.log(` > "Search astro-components for ecommerce cards and buy box"`);
160
+ console.log(` > "Insert a KPI stat tile chart from astro-components"\n`);
161
+ return true;
162
+ } catch (err) {
163
+ console.error(`\nāŒ Failed to write configuration: ${err?.message || err}`);
164
+ console.log(`\nYou can configure it manually by adding this JSON:`);
165
+ console.log(
166
+ JSON.stringify(
167
+ {
168
+ mcpServers: {
169
+ 'astro-components': SERVER_CONFIG,
170
+ },
171
+ },
172
+ null,
173
+ 2
174
+ )
175
+ );
176
+ return false;
177
+ }
178
+ }
179
+
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "astro-component-kit",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "A free, open-source accessible UI component library for Astro",
5
5
  "type": "module",
6
6
  "main": "./src/components/index.ts",
7
7
  "module": "./src/components/index.ts",
8
8
  "types": "./src/components/types.d.ts",
9
+ "bin": {
10
+ "astro-component-kit": "./bin/cli.js"
11
+ },
9
12
  "exports": {
10
13
  ".": "./src/components/index.ts",
11
14
  "./buttons": "./src/components/lib/buttons/index.ts",
@@ -19,13 +22,21 @@
19
22
  "./typography": "./src/components/lib/typography/index.ts",
20
23
  "./sections": "./src/components/lib/sections/index.ts",
21
24
  "./charts": "./src/components/lib/charts/index.ts",
25
+ "./ecommerce": "./src/components/lib/ecommerce/index.ts",
26
+ "./app": "./src/components/lib/app/index.ts",
27
+ "./templates/ecommerce": "./src/components/lib/templates/ecommerce/index.ts",
28
+ "./templates/ecommerce-editorial": "./src/components/lib/templates/ecommerce-editorial/index.ts",
29
+ "./templates/saas-hotel": "./src/components/lib/templates/saas-hotel/index.ts",
22
30
  "./global.css": "./src/styles/global.css"
23
31
  },
24
32
  "files": [
33
+ "bin/",
25
34
  "src/components/lib/",
26
35
  "src/components/index.ts",
27
36
  "src/components/types.d.ts",
28
37
  "src/styles/global.css",
38
+ "src/mcp/",
39
+ "src/data/registry/",
29
40
  "LICENSE",
30
41
  "README.md"
31
42
  ],
@@ -35,9 +46,13 @@
35
46
  "build": "astro build",
36
47
  "preview": "astro preview",
37
48
  "astro": "astro",
38
- "typecheck": "astro check",
49
+ "typecheck": "ASTRO_TELEMETRY_DISABLED=1 astro check",
39
50
  "registry:generate": "node scripts/generate-registry.mjs",
40
- "prepublishOnly": "astro check"
51
+ "prepublishOnly": "ASTRO_TELEMETRY_DISABLED=1 astro check",
52
+ "indexnow:dry": "node scripts/indexnow.mjs --dry-run",
53
+ "mcp:start": "tsx src/mcp/index.ts",
54
+ "mcp:dev": "tsx watch src/mcp/index.ts",
55
+ "mcp:stdio": "tsx src/mcp/index.ts --stdio"
41
56
  },
42
57
  "keywords": [
43
58
  "astro",
@@ -48,7 +63,14 @@
48
63
  "a11y",
49
64
  "glassmorphism",
50
65
  "frontend",
51
- "web"
66
+ "web",
67
+ "ecommerce",
68
+ "shop",
69
+ "cart",
70
+ "templates",
71
+ "dashboard",
72
+ "saas",
73
+ "admin"
52
74
  ],
53
75
  "author": "konstantinwdk <entiplay@gmail.com>",
54
76
  "license": "MIT",
@@ -80,10 +102,18 @@
80
102
  "node": ">=22.12.0"
81
103
  },
82
104
  "dependencies": {
83
- "@astrojs/sitemap": "^3.7.2"
105
+ "@astrojs/sitemap": "^3.7.2",
106
+ "@modelcontextprotocol/sdk": "^1.32.2",
107
+ "cors": "^2.8.6",
108
+ "express": "^5.3.0",
109
+ "express-rate-limit": "^8.7.3",
110
+ "tsx": "^4.23.15",
111
+ "zod": "^4.6.7"
84
112
  },
85
113
  "devDependencies": {
86
114
  "@astrojs/check": "^0.9.10",
115
+ "@types/cors": "^2.8.19",
116
+ "@types/express": "^5.0.6",
87
117
  "@types/three": "^0.184.0",
88
118
  "apexcharts": "^3.45.1",
89
119
  "astro": ">=5.0.0",
@@ -18,6 +18,8 @@ export * from './lib/buttons';
18
18
  export * from './lib/cards';
19
19
  export * from './lib/charts';
20
20
  export * from './lib/data';
21
+ export * from './lib/ecommerce';
22
+ export * from './lib/app';
21
23
  export * from './lib/feedback';
22
24
  export * from './lib/forms';
23
25
  export * from './lib/layout';