astro-component-kit 0.3.0 → 0.4.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/README.md +159 -176
- package/package.json +2 -2
- package/src/components/index.ts +16 -202
- package/src/components/lib/buttons/NeonBorderButton.astro +162 -0
- package/src/components/lib/buttons/RippleButton.astro +199 -0
- package/src/components/lib/buttons/SlideRevealButton.astro +159 -0
- package/src/components/lib/buttons/index.ts +4 -0
- package/src/components/lib/cards/GithubRepoCard.astro +176 -0
- package/src/components/lib/cards/PricingCompareMiniCard.astro +196 -0
- package/src/components/lib/cards/StatsTrendCard.astro +149 -0
- package/src/components/lib/cards/index.ts +3 -0
- package/src/components/lib/charts/ActivityRings.astro +105 -0
- package/src/components/lib/charts/BoxPlotChart.astro +109 -0
- package/src/components/lib/charts/BubbleChart.astro +101 -0
- package/src/components/lib/charts/BulletChart.astro +160 -0
- package/src/components/lib/charts/BumpChart.astro +92 -0
- package/src/components/lib/charts/CandlestickChart.astro +105 -0
- package/src/components/lib/charts/ChartFrame.astro +373 -0
- package/src/components/lib/charts/DivergingBarChart.astro +98 -0
- package/src/components/lib/charts/DumbbellChart.astro +92 -0
- package/src/components/lib/charts/ForecastLineChart.astro +125 -0
- package/src/components/lib/charts/FunnelChart.astro +122 -0
- package/src/components/lib/charts/GaugeChart.astro +111 -0
- package/src/components/lib/charts/GoalProgressChart.astro +97 -0
- package/src/components/lib/charts/GroupedBarChart.astro +125 -0
- package/src/components/lib/charts/HeatmapChart.astro +131 -0
- package/src/components/lib/charts/HistogramChart.astro +111 -0
- package/src/components/lib/charts/HorizontalBarChart.astro +155 -0
- package/src/components/lib/charts/KpiStatTile.astro +116 -0
- package/src/components/lib/charts/KpiTrendGrid.astro +60 -0
- package/src/components/lib/charts/LineChart.astro +160 -0
- package/src/components/lib/charts/LinearProgressGauge.astro +136 -0
- package/src/components/lib/charts/LollipopChart.astro +100 -0
- package/src/components/lib/charts/MeterGauge.astro +122 -0
- package/src/components/lib/charts/MetricDeltaTable.astro +125 -0
- package/src/components/lib/charts/PieChart.astro +135 -0
- package/src/components/lib/charts/PolarAreaChart.astro +85 -0
- package/src/components/lib/charts/PopulationPyramid.astro +122 -0
- package/src/components/lib/charts/PunchCardChart.astro +89 -0
- package/src/components/lib/charts/RadarChart.astro +94 -0
- package/src/components/lib/charts/RadarMetricChart.astro +168 -0
- package/src/components/lib/charts/RadialBarChart.astro +124 -0
- package/src/components/lib/charts/RangeAreaChart.astro +113 -0
- package/src/components/lib/charts/RetentionCohortTable.astro +126 -0
- package/src/components/lib/charts/SankeyChart.astro +128 -0
- package/src/components/lib/charts/ScatterPlot.astro +139 -0
- package/src/components/lib/charts/SegmentedBarChart.astro +119 -0
- package/src/components/lib/charts/SlopeChart.astro +105 -0
- package/src/components/lib/charts/SparklineChart.astro +87 -0
- package/src/components/lib/charts/StackedAreaChart.astro +130 -0
- package/src/components/lib/charts/StackedBarChart.astro +136 -0
- package/src/components/lib/charts/SunburstChart.astro +103 -0
- package/src/components/lib/charts/TreemapChart.astro +94 -0
- package/src/components/lib/charts/WaffleChart.astro +121 -0
- package/src/components/lib/charts/WaterfallChart.astro +118 -0
- package/src/components/lib/charts/chart-tooltip.ts +75 -0
- package/src/components/lib/charts/chart-utils.ts +271 -0
- package/src/components/lib/charts/index.ts +46 -0
- package/src/components/lib/data/ActivityHeatmapGrid.astro +157 -0
- package/src/components/lib/data/MetricComparisonRow.astro +109 -0
- package/src/components/lib/data/StatusTimelineFeed.astro +168 -0
- package/src/components/lib/data/index.ts +3 -0
- package/src/components/lib/feedback/ProgressRingCounter.astro +118 -0
- package/src/components/lib/feedback/ToastNotificationGroup.astro +173 -0
- package/src/components/lib/feedback/index.ts +2 -0
- package/src/components/lib/forms/GlassInlineToggleGroup.astro +161 -0
- package/src/components/lib/forms/PasswordStrengthInput.astro +242 -0
- package/src/components/lib/forms/PhoneCountryInput.astro +145 -0
- package/src/components/lib/forms/TagsAutocompleteInput.astro +249 -0
- package/src/components/lib/forms/index.ts +5 -0
- package/src/components/lib/layout/DiagonalSectionDivider.astro +69 -0
- package/src/components/lib/layout/HolyGrailGrid.astro +125 -0
- package/src/components/lib/layout/index.ts +3 -1
- package/src/components/lib/navigation/QuickJumpDock.astro +125 -0
- package/src/components/lib/navigation/StepBreadcrumbBar.astro +151 -0
- package/src/components/lib/navigation/SubNavbarPills.astro +102 -0
- package/src/components/lib/navigation/index.ts +3 -0
- package/src/components/lib/overlays/CookiePreferencesDrawer.astro +226 -0
- package/src/components/lib/overlays/FloatingFeedbackWidget.astro +203 -0
- package/src/components/lib/overlays/ImageCompareSlider.astro +172 -0
- package/src/components/lib/overlays/index.ts +3 -0
- package/src/components/lib/sections/BlogGridSection.astro +131 -0
- package/src/components/lib/sections/CareersOpenings.astro +139 -0
- package/src/components/lib/sections/ChangelogSection.astro +144 -0
- package/src/components/lib/sections/ContactSplitMap.astro +139 -0
- package/src/components/lib/sections/CtaNewsletterSection.astro +163 -0
- package/src/components/lib/sections/CtaSplitImage.astro +147 -0
- package/src/components/lib/sections/FaqTwoColumn.astro +119 -0
- package/src/components/lib/sections/FeatureAlternatingRows.astro +190 -0
- package/src/components/lib/sections/FeatureIconGrid.astro +155 -0
- package/src/components/lib/sections/FeatureTabsShowcase.astro +180 -0
- package/src/components/lib/sections/FooterMegaSection.astro +155 -0
- package/src/components/lib/sections/HeroDashboardPreview.astro +180 -0
- package/src/components/lib/sections/HeroMinimalCentered.astro +175 -0
- package/src/components/lib/sections/HeroShowcaseSplit.astro +304 -0
- package/src/components/lib/sections/HeroTerminal.astro +251 -0
- package/src/components/lib/sections/HeroWaitlist.astro +229 -0
- package/src/components/lib/sections/HowItWorksSteps.astro +178 -0
- package/src/components/lib/sections/IntegrationsGrid.astro +167 -0
- package/src/components/lib/sections/LogoCloudSection.astro +96 -0
- package/src/components/lib/sections/LogoWallGrid.astro +91 -0
- package/src/components/lib/sections/PricingSinglePlan.astro +157 -0
- package/src/components/lib/sections/PricingToggleCards.astro +171 -0
- package/src/components/lib/sections/StatsCounterBand.astro +122 -0
- package/src/components/lib/sections/StatsDashboardSection.astro +83 -0
- package/src/components/lib/sections/TestimonialCarousel.astro +165 -0
- package/src/components/lib/sections/TestimonialFeatured.astro +120 -0
- package/src/components/lib/sections/TestimonialGridSection.astro +188 -0
- package/src/components/lib/sections/index.ts +29 -0
- package/src/components/lib/typography/AnimatedCounterText.astro +102 -0
- package/src/components/lib/typography/CurvedPathHeading.astro +86 -0
- package/src/components/lib/typography/GradientTextMarquee.astro +105 -0
- package/src/components/lib/typography/HackerDecodeText.astro +85 -0
- package/src/components/lib/typography/index.ts +4 -0
- package/src/styles/global.css +18 -1
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# ⬇ Astro Component Kit
|
|
2
2
|
|
|
3
|
-
> A
|
|
3
|
+
> A free, open-source accessible UI component library 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
|
|
|
7
7
|

|
|
8
|
-

|
|
9
9
|

|
|
10
10
|

|
|
11
11
|
|
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
|
|
14
14
|
## ✨ Features
|
|
15
15
|
|
|
16
|
-
- 🎨 **Premium design** — glassmorphism,
|
|
17
|
-
-
|
|
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
|
|
18
19
|
- 📋 **Copy & paste** — browse [astrocomponents.dev](https://astrocomponents.dev) and copy components directly
|
|
19
20
|
- 📦 **npm installable** — `npm install astro-component-kit` for direct imports
|
|
20
|
-
- ♻️ **Zero dependencies** — pure `.astro` components + Vanilla CSS
|
|
21
|
-
- 🌑 **Dark mode first** —
|
|
21
|
+
- ♻️ **Zero runtime dependencies** — pure `.astro` components + Vanilla CSS
|
|
22
|
+
- 🌑 **Dark mode first** — crafted for modern, dark-themed developer interfaces
|
|
22
23
|
- 🔓 **Open Source** — MIT license, contributions welcome
|
|
23
24
|
|
|
24
25
|
---
|
|
@@ -35,23 +36,42 @@ Then import and use components in your Astro pages:
|
|
|
35
36
|
|
|
36
37
|
```astro
|
|
37
38
|
---
|
|
38
|
-
// Root import — all components
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
// Root import — all components and sections
|
|
40
|
+
import {
|
|
41
|
+
GlassButton,
|
|
42
|
+
GlassCard,
|
|
43
|
+
FeatureBentoGrid,
|
|
44
|
+
PricingComparisonMatrix,
|
|
45
|
+
CtaGlowBanner
|
|
46
|
+
} from 'astro-component-kit';
|
|
47
|
+
|
|
48
|
+
// Or import by category (recommended for modularity)
|
|
49
|
+
import { GlassButton, GlowButton, ThreeDPushButton } from 'astro-component-kit/buttons';
|
|
43
50
|
import { GlassCard, ProfileCard, PricingCard } from 'astro-component-kit/cards';
|
|
44
|
-
import { GlassAlert, Badge } from 'astro-component-kit/feedback';
|
|
45
|
-
import { GlassNavbar, BreadcrumbsMinimal } from 'astro-component-kit/navigation';
|
|
46
|
-
import {
|
|
47
|
-
import { AnimatedInput, OTPInput } from 'astro-component-kit/forms';
|
|
48
|
-
import { MasonryGrid, BentoGrid3 } from 'astro-component-kit/layout';
|
|
49
|
-
import { GradientHeading, GlassBlockQuote } from 'astro-component-kit/typography';
|
|
50
|
-
import {
|
|
51
|
+
import { GlassAlert, Badge, ConfettiFeedback } from 'astro-component-kit/feedback';
|
|
52
|
+
import { GlassNavbar, MegaMenuGlass, BreadcrumbsMinimal } from 'astro-component-kit/navigation';
|
|
53
|
+
import { OverlayModal, CommandDialog, BottomSheetMobile } from 'astro-component-kit/overlays';
|
|
54
|
+
import { AnimatedInput, OTPInput, GlassSlider } from 'astro-component-kit/forms';
|
|
55
|
+
import { GlassCardGrid, SplitScreenLayout, MasonryGrid, BentoGrid3 } from 'astro-component-kit/layout';
|
|
56
|
+
import { GradientHeading, GlassBlockQuote, CyberpunkGlitchText } from 'astro-component-kit/typography';
|
|
57
|
+
import { AreaChart, DonutChart, BarChart } from 'astro-component-kit/charts';
|
|
58
|
+
import {
|
|
59
|
+
FeatureBentoGrid,
|
|
60
|
+
PricingComparisonMatrix,
|
|
61
|
+
TestimonialWallGlass,
|
|
62
|
+
CtaGlowBanner,
|
|
63
|
+
FaqAccordionSection,
|
|
64
|
+
StatsMetricShowcase,
|
|
65
|
+
TeamGridSection,
|
|
66
|
+
ContactGlassForm
|
|
67
|
+
} from 'astro-component-kit/sections';
|
|
51
68
|
---
|
|
52
69
|
|
|
53
70
|
<GlassButton variant="primary">Click me</GlassButton>
|
|
54
71
|
<GlassCard title="Welcome">Content here</GlassCard>
|
|
72
|
+
|
|
73
|
+
<!-- Drop-in full section -->
|
|
74
|
+
<FeatureBentoGrid />
|
|
55
75
|
```
|
|
56
76
|
|
|
57
77
|
**Import global design tokens** (optional but recommended):
|
|
@@ -74,7 +94,7 @@ import 'astro-component-kit/global.css';
|
|
|
74
94
|
|
|
75
95
|
```bash
|
|
76
96
|
git clone https://github.com/konstantinwdk/astro-components.git
|
|
77
|
-
cd astro-
|
|
97
|
+
cd astro-components
|
|
78
98
|
npm install
|
|
79
99
|
npm run dev
|
|
80
100
|
```
|
|
@@ -83,92 +103,104 @@ Open [http://localhost:4321](http://localhost:4321) to browse components locally
|
|
|
83
103
|
|
|
84
104
|
---
|
|
85
105
|
|
|
86
|
-
## 📚 Component Library
|
|
106
|
+
## 📚 Component & Section Library
|
|
87
107
|
|
|
88
|
-
**
|
|
108
|
+
**290+ components & full-page sections** across 11 categories:
|
|
89
109
|
|
|
90
110
|
| Category | Components | Description |
|
|
91
|
-
|
|
92
|
-
| **
|
|
93
|
-
| **
|
|
94
|
-
| **
|
|
95
|
-
| **
|
|
96
|
-
| **
|
|
97
|
-
| **
|
|
98
|
-
| **Navigation** |
|
|
99
|
-
| **Overlays** |
|
|
100
|
-
| **
|
|
101
|
-
| **
|
|
111
|
+
|----------|:----------:|-------------|
|
|
112
|
+
| **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 |
|
|
114
|
+
| **Buttons** | 22 | Glass, glow, neumorphic, 3D push, magnetic, cyberpunk, and animated |
|
|
115
|
+
| **Cards** | 22 | Ecommerce, profile, pricing, weather, tilt, portfolio, kanban |
|
|
116
|
+
| **Layout** | 22 | Bento grids, masonry, split screens, sticky sidebars, card grids, full-bleed sections |
|
|
117
|
+
| **Forms** | 24 | Floating inputs, OTP, currency, tags, custom select, color picker, rating stars |
|
|
118
|
+
| **Navigation** | 23 | Glass navbars, mega menus, breadcrumbs, vertical tabs, command palettes |
|
|
119
|
+
| **Overlays** | 23 | Modals, drawers, lightboxes, popovers, bottom sheets, age verifications |
|
|
120
|
+
| **Feedback** | 22 | Alerts, modal dialogs, toasts, spinners, progress bars, confetti |
|
|
121
|
+
| **Data Display** | 23 | Tables, vertical/horizontal timelines, stats grids, sparklines, tree views |
|
|
122
|
+
| **Typography** | 24 | Gradient headings, glitch text, typewriter, 3D text layers, drop caps |
|
|
123
|
+
|
|
124
|
+
### SVG charts — zero dependencies
|
|
125
|
+
|
|
126
|
+
```astro
|
|
127
|
+
---
|
|
128
|
+
import 'astro-component-kit/global.css';
|
|
129
|
+
import { LineChart, PieChart, KpiStatTile } from 'astro-component-kit/charts';
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
<KpiStatTile label="Revenue" value="$48.2k" change={24} period="vs last month" />
|
|
133
|
+
<LineChart
|
|
134
|
+
title="Monthly active users"
|
|
135
|
+
categories={['Jan', 'Feb', 'Mar', 'Apr']}
|
|
136
|
+
series={[{ name: 'Web', data: [120, 180, 160, 240] }]}
|
|
137
|
+
/>
|
|
138
|
+
<PieChart />
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Every chart ships with a legend, keyboard-focusable marks with tooltips and a "View data" table fallback for screen readers. Colors come from the `--chart-1…8` tokens in `global.css`.
|
|
102
142
|
|
|
103
143
|
---
|
|
104
144
|
|
|
105
145
|
## 📖 Usage Examples
|
|
106
146
|
|
|
107
|
-
### Building a Landing Page
|
|
147
|
+
### Building a Complete Landing Page in Minutes
|
|
108
148
|
|
|
109
149
|
```astro
|
|
110
150
|
---
|
|
111
|
-
import { GlassNavbar } from 'astro-component-kit/navigation';
|
|
112
|
-
import { FeatureHero, SplitScreenLayout, BentoGrid3 } from 'astro-component-kit/layout';
|
|
113
|
-
import { GlassButton, GlowButton, ShimmerButton } from 'astro-component-kit/buttons';
|
|
114
|
-
import { GlassCard, PricingCard, ProfileCard } from 'astro-component-kit/cards';
|
|
115
|
-
import { GlassAlert } from 'astro-component-kit/feedback';
|
|
116
|
-
import { GradientHeading } from 'astro-component-kit/typography';
|
|
117
|
-
import { FadeInWrapper } from 'astro-component-kit/utilities';
|
|
118
151
|
import 'astro-component-kit/global.css';
|
|
152
|
+
import { GlassNavbar } from 'astro-component-kit/navigation';
|
|
153
|
+
import {
|
|
154
|
+
HeroGradient,
|
|
155
|
+
FeatureBentoGrid,
|
|
156
|
+
PricingComparisonMatrix,
|
|
157
|
+
TestimonialWallGlass,
|
|
158
|
+
FaqAccordionSection,
|
|
159
|
+
CtaGlowBanner
|
|
160
|
+
} from 'astro-component-kit/sections';
|
|
161
|
+
import { MinimalFooterGrid } from 'astro-component-kit/layout';
|
|
119
162
|
---
|
|
120
163
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
</div>
|
|
149
|
-
<div slot="3">
|
|
150
|
-
<GlassCard title="Feature C" padding="lg">
|
|
151
|
-
<p>Third feature details.</p>
|
|
152
|
-
</GlassCard>
|
|
153
|
-
</div>
|
|
154
|
-
<div slot="4">
|
|
155
|
-
<GlassCard title="Stats" padding="lg">
|
|
156
|
-
<p>200+ components available.</p>
|
|
157
|
-
</GlassCard>
|
|
158
|
-
</div>
|
|
159
|
-
</BentoGrid3>
|
|
160
|
-
</FadeInWrapper>
|
|
164
|
+
<!-- 1. Navigation -->
|
|
165
|
+
<GlassNavbar brand="AstroApp" brandHref="/" />
|
|
166
|
+
|
|
167
|
+
<!-- 2. Hero Header -->
|
|
168
|
+
<HeroGradient
|
|
169
|
+
badge="New Release v0.3.0"
|
|
170
|
+
title="Build Production Websites at Lightning Speed"
|
|
171
|
+
subtitle="Zero client JavaScript runtime, accessible UI, and modern dark glassmorphism."
|
|
172
|
+
/>
|
|
173
|
+
|
|
174
|
+
<!-- 3. Feature Showcase -->
|
|
175
|
+
<FeatureBentoGrid />
|
|
176
|
+
|
|
177
|
+
<!-- 4. Pricing Matrix with Interactive Billing Toggle -->
|
|
178
|
+
<PricingComparisonMatrix />
|
|
179
|
+
|
|
180
|
+
<!-- 5. Social Proof & Testimonials -->
|
|
181
|
+
<TestimonialWallGlass />
|
|
182
|
+
|
|
183
|
+
<!-- 6. FAQ Accordion with Category Filters -->
|
|
184
|
+
<FaqAccordionSection />
|
|
185
|
+
|
|
186
|
+
<!-- 7. High-Converting CTA Banner -->
|
|
187
|
+
<CtaGlowBanner />
|
|
188
|
+
|
|
189
|
+
<!-- 8. Footer -->
|
|
190
|
+
<MinimalFooterGrid />
|
|
161
191
|
```
|
|
162
192
|
|
|
163
|
-
### Building a Dashboard
|
|
193
|
+
### Building a Dashboard Layout
|
|
164
194
|
|
|
165
195
|
```astro
|
|
166
196
|
---
|
|
167
|
-
import { GlassNavbar } from 'astro-component-kit/navigation';
|
|
168
|
-
import { SidebarLayoutWrapper, StatsGridDashboard, GlassTable } from 'astro-component-kit/layout';
|
|
169
|
-
import { GlassCard } from 'astro-component-kit/cards';
|
|
170
|
-
import { Badge, GlassProgress } from 'astro-component-kit/feedback';
|
|
171
197
|
import 'astro-component-kit/global.css';
|
|
198
|
+
import { GlassNavbar } from 'astro-component-kit/navigation';
|
|
199
|
+
import { SidebarLayoutWrapper, GlassCardGrid } from 'astro-component-kit/layout';
|
|
200
|
+
import { GlassCard, StatCard } from 'astro-component-kit/cards';
|
|
201
|
+
import { AreaChart, DonutChart } from 'astro-component-kit/charts';
|
|
202
|
+
import { GlassTable } from 'astro-component-kit/data';
|
|
203
|
+
import { Badge } from 'astro-component-kit/feedback';
|
|
172
204
|
---
|
|
173
205
|
|
|
174
206
|
<SidebarLayoutWrapper>
|
|
@@ -183,73 +215,30 @@ import 'astro-component-kit/global.css';
|
|
|
183
215
|
<div slot="main">
|
|
184
216
|
<GlassNavbar brand="Dashboard" />
|
|
185
217
|
|
|
186
|
-
<
|
|
187
|
-
<
|
|
188
|
-
|
|
189
|
-
|
|
218
|
+
<GlassCardGrid columns={3}>
|
|
219
|
+
<StatCard label="Total Revenue" value="$84,290" icon="📈" />
|
|
220
|
+
<StatCard label="Active Users" value="14,210" icon="👥" />
|
|
221
|
+
<StatCard label="Conversion Rate" value="4.8%" icon="⚡" />
|
|
222
|
+
</GlassCardGrid>
|
|
223
|
+
|
|
224
|
+
<div style="display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; margin-top: 1.5rem;">
|
|
225
|
+
<GlassCard title="Traffic Overview">
|
|
226
|
+
<AreaChart />
|
|
190
227
|
</GlassCard>
|
|
191
|
-
<GlassCard title="
|
|
192
|
-
<
|
|
193
|
-
<Badge variant="info">This month</Badge>
|
|
228
|
+
<GlassCard title="Traffic Distribution">
|
|
229
|
+
<DonutChart />
|
|
194
230
|
</GlassCard>
|
|
195
|
-
</
|
|
231
|
+
</div>
|
|
196
232
|
|
|
197
|
-
<
|
|
198
|
-
<
|
|
199
|
-
|
|
233
|
+
<div style="margin-top: 1.5rem;">
|
|
234
|
+
<GlassCard title="Recent Transactions">
|
|
235
|
+
<GlassTable />
|
|
236
|
+
</GlassCard>
|
|
237
|
+
</div>
|
|
200
238
|
</div>
|
|
201
239
|
</SidebarLayoutWrapper>
|
|
202
240
|
```
|
|
203
241
|
|
|
204
|
-
### Building a Form Page
|
|
205
|
-
|
|
206
|
-
```astro
|
|
207
|
-
---
|
|
208
|
-
import { AnimatedInput, OTPInput, GlassSlider, NeumorphicSwitch } from 'astro-component-kit/forms';
|
|
209
|
-
import { GlassButton } from 'astro-component-kit/buttons';
|
|
210
|
-
import { GlassAlert } from 'astro-component-kit/feedback';
|
|
211
|
-
import { GlassCard } from 'astro-component-kit/cards';
|
|
212
|
-
import 'astro-component-kit/global.css';
|
|
213
|
-
---
|
|
214
|
-
|
|
215
|
-
<form>
|
|
216
|
-
<GlassCard title="Account Settings" padding="lg">
|
|
217
|
-
<AnimatedInput id="email" name="email" label="Email" type="email" />
|
|
218
|
-
<AnimatedInput id="name" name="name" label="Full Name" />
|
|
219
|
-
|
|
220
|
-
<NeumorphicSwitch id="notifications" label="Enable notifications" />
|
|
221
|
-
|
|
222
|
-
<GlassSlider id="volume" min="0" max="100" value="50" label="Volume" />
|
|
223
|
-
|
|
224
|
-
<div style="display: flex; gap: 1rem; margin-top: 1.5rem;">
|
|
225
|
-
<GlassButton variant="primary" type="submit">Save Changes</GlassButton>
|
|
226
|
-
<GlassButton variant="ghost">Cancel</GlassButton>
|
|
227
|
-
</div>
|
|
228
|
-
</GlassCard>
|
|
229
|
-
</form>
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
### Using Overlays and Feedback
|
|
233
|
-
|
|
234
|
-
```astro
|
|
235
|
-
---
|
|
236
|
-
import { OverlayModal } from 'astro-component-kit/overlays';
|
|
237
|
-
import { GlassAlert, ToastNotif, Badge } from 'astro-component-kit/feedback';
|
|
238
|
-
import { GlassButton } from 'astro-component-kit/buttons';
|
|
239
|
-
import 'astro-component-kit/global.css';
|
|
240
|
-
---
|
|
241
|
-
|
|
242
|
-
<GlassAlert type="success" title="Success!">
|
|
243
|
-
Your changes have been saved.
|
|
244
|
-
</GlassAlert>
|
|
245
|
-
|
|
246
|
-
<GlassAlert type="warning" title="Warning">
|
|
247
|
-
Please review your settings before continuing.
|
|
248
|
-
</GlassAlert>
|
|
249
|
-
|
|
250
|
-
<ToastNotif />
|
|
251
|
-
```
|
|
252
|
-
|
|
253
242
|
---
|
|
254
243
|
|
|
255
244
|
## 🗂️ Project Structure
|
|
@@ -258,21 +247,22 @@ import 'astro-component-kit/global.css';
|
|
|
258
247
|
astro-component-kit/
|
|
259
248
|
├── src/
|
|
260
249
|
│ ├── components/
|
|
261
|
-
│ │ ├── lib/ ←
|
|
250
|
+
│ │ ├── lib/ ← 290+ component source files
|
|
251
|
+
│ │ │ ├── sections/ ← 14 full-page landing sections
|
|
262
252
|
│ │ │ ├── buttons/ ← 19 button components
|
|
263
253
|
│ │ │ ├── cards/ ← 19 card components
|
|
264
|
-
│ │ │ ├──
|
|
265
|
-
│ │ │ ├──
|
|
266
|
-
│ │ │ ├──
|
|
267
|
-
│ │ │ ├──
|
|
268
|
-
│ │ │ ├──
|
|
269
|
-
│ │ │ ├──
|
|
270
|
-
│ │ │ ├── typography/ ←
|
|
271
|
-
│ │ │ └──
|
|
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
|
|
272
262
|
│ │ └── index.ts ← Main barrel export
|
|
273
263
|
│ └── types.d.ts ← TypeScript declarations
|
|
274
264
|
├── src/styles/
|
|
275
|
-
│ └── global.css ← Design tokens & global
|
|
265
|
+
│ └── global.css ← Design tokens & global CSS
|
|
276
266
|
└── package.json
|
|
277
267
|
```
|
|
278
268
|
|
|
@@ -292,12 +282,12 @@ import 'astro-component-kit/global.css';
|
|
|
292
282
|
|
|
293
283
|
| Token | Values |
|
|
294
284
|
|-------|--------|
|
|
295
|
-
| **Colors** | Dark palette with gold primary (`#
|
|
296
|
-
| **Spacing** | `--sp-1` (4px) to `--sp-
|
|
285
|
+
| **Colors** | Dark palette with amber/gold primary (`#eab308`), cyan, emerald, purple accents |
|
|
286
|
+
| **Spacing** | `--sp-1` (4px) to `--sp-20` (80px) |
|
|
297
287
|
| **Typography** | `--font-sans` (Inter), `--font-mono` (JetBrains Mono) |
|
|
298
|
-
| **Radii** | `--r-sm` (8px), `--r-md` (12px), `--r-lg` (20px), `--r-xl` (28px) |
|
|
299
|
-
| **Shadows** | Predefined elevation system for cards and overlays |
|
|
300
|
-
| **Transitions** | Smooth animation timings for all interactions |
|
|
288
|
+
| **Radii** | `--r-sm` (8px), `--r-md` (12px), `--r-lg` (20px), `--r-xl` (28px), `--r-full` (9999px) |
|
|
289
|
+
| **Shadows** | Predefined elevation system for cards, buttons, and overlays |
|
|
290
|
+
| **Transitions** | Smooth cubic-bezier animation timings for all interactions |
|
|
301
291
|
|
|
302
292
|
---
|
|
303
293
|
|
|
@@ -305,12 +295,12 @@ import 'astro-component-kit/global.css';
|
|
|
305
295
|
|
|
306
296
|
Every component is built with accessibility as a first-class concern:
|
|
307
297
|
|
|
308
|
-
- ✅ Semantic HTML (`<button>`, `<nav>`, `<main>`, `<
|
|
309
|
-
- ✅ ARIA attributes and roles where appropriate
|
|
310
|
-
- ✅
|
|
298
|
+
- ✅ Semantic HTML (`<section>`, `<article>`, `<button>`, `<nav>`, `<main>`, `<dialog>`, etc.)
|
|
299
|
+
- ✅ ARIA attributes and roles where appropriate (`role="switch"`, `aria-label`, `aria-checked`)
|
|
300
|
+
- ✅ Full keyboard navigation support (Tab, Enter, Space, Escape, Arrow keys)
|
|
311
301
|
- ✅ Visible focus indicators on all interactive elements
|
|
312
302
|
- ✅ Screen reader utilities (`.sr-only` class in global.css)
|
|
313
|
-
- ✅ Color contrast meeting WCAG AA standards
|
|
303
|
+
- ✅ Color contrast meeting WCAG AA standards (≥ 4.5:1)
|
|
314
304
|
- ✅ Reduced motion media queries for animations
|
|
315
305
|
|
|
316
306
|
---
|
|
@@ -322,17 +312,10 @@ Every component is built with accessibility as a first-class concern:
|
|
|
322
312
|
| Command | Description |
|
|
323
313
|
|---------|-------------|
|
|
324
314
|
| `npm run dev` | Start the docs site dev server (`http://localhost:4321`) |
|
|
325
|
-
| `npm run build` | Build the docs site for production (
|
|
315
|
+
| `npm run build` | Build the docs site for production (`dist/` static output) |
|
|
326
316
|
| `npm run preview` | Preview the built docs site locally |
|
|
327
|
-
| `npm run typecheck` | Run Astro & TypeScript
|
|
328
|
-
| `
|
|
329
|
-
|
|
330
|
-
### Adding a New Component
|
|
331
|
-
|
|
332
|
-
1. Create your component in `src/components/lib/{category}/ComponentName.astro`
|
|
333
|
-
2. Add metadata to `src/data/registry/{category}.ts`
|
|
334
|
-
3. Add barrel export in `src/components/lib/{category}/index.ts`
|
|
335
|
-
4. Add to main export in `src/components/index.ts`
|
|
317
|
+
| `npm run typecheck` | Run Astro & TypeScript validation across all files |
|
|
318
|
+
| `node scripts/audit-components-playwright.mjs` | Automated headless browser audit across all 197+ pages |
|
|
336
319
|
|
|
337
320
|
---
|
|
338
321
|
|
|
@@ -341,7 +324,7 @@ Every component is built with accessibility as a first-class concern:
|
|
|
341
324
|
Contributions are warmly welcomed!
|
|
342
325
|
|
|
343
326
|
1. Fork the repository
|
|
344
|
-
2. Create a branch: `git checkout -b feat/my-
|
|
327
|
+
2. Create a branch: `git checkout -b feat/my-new-section`
|
|
345
328
|
3. Add your component to `src/components/lib/{category}/`
|
|
346
329
|
4. Update the registry in `src/data/registry/{category}.ts`
|
|
347
330
|
5. Add barrel exports to the category `index.ts`
|
|
@@ -358,4 +341,4 @@ MIT © [konstantinwdk](https://github.com/konstantinwdk)
|
|
|
358
341
|
- **Documentation**: [astrocomponents.dev](https://astrocomponents.dev)
|
|
359
342
|
- **npm Package**: [npmjs.com/package/astro-component-kit](https://www.npmjs.com/package/astro-component-kit)
|
|
360
343
|
- **GitHub**: [github.com/konstantinwdk/astro-components](https://github.com/konstantinwdk/astro-components)
|
|
361
|
-
- **Issues**: [GitHub Issues](https://github.com/
|
|
344
|
+
- **Issues**: [GitHub Issues](https://github.com/konstantinwdk/astro-components/issues)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-component-kit",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A
|
|
3
|
+
"version": "0.4.0",
|
|
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",
|