astro-component-kit 0.3.1 → 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 +33 -14
- 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
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* QuickJumpDock — Floating desktop navigation dock bar with hover magnification and tooltips.
|
|
4
|
+
*
|
|
5
|
+
* @param {Array<{label: string, icon: string, href: string}>} items - List of dock actions.
|
|
6
|
+
*/
|
|
7
|
+
interface Props {
|
|
8
|
+
items?: Array<{ label: string; icon: string; href: string }>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
items = [
|
|
13
|
+
{
|
|
14
|
+
label: 'Home',
|
|
15
|
+
href: '/',
|
|
16
|
+
icon: `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>`,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: 'Components',
|
|
20
|
+
href: '/docs/glass-button',
|
|
21
|
+
icon: `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/><path d="M9 21V9"/></svg>`,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: 'Sections',
|
|
25
|
+
href: '/sections',
|
|
26
|
+
icon: `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="7" height="9" x="3" y="3" rx="1"/><rect width="7" height="5" x="14" y="3" rx="1"/><rect width="7" height="9" x="14" y="12" rx="1"/><rect width="7" height="5" x="3" y="16" rx="1"/></svg>`,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: 'Search',
|
|
30
|
+
href: '#search',
|
|
31
|
+
icon: `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>`,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: 'GitHub',
|
|
35
|
+
href: 'https://github.com/konstantinWDK/astro-components',
|
|
36
|
+
icon: `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/></svg>`,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
} = Astro.props;
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
<nav class="quick-dock" aria-label="Quick dock navigation" data-dock>
|
|
43
|
+
{items.map((item) => (
|
|
44
|
+
<a href={item.href} class="quick-dock__item" aria-label={item.label}>
|
|
45
|
+
<span class="quick-dock__tooltip" aria-hidden="true">{item.label}</span>
|
|
46
|
+
<span class="quick-dock__icon" set:html={item.icon} />
|
|
47
|
+
</a>
|
|
48
|
+
))}
|
|
49
|
+
</nav>
|
|
50
|
+
|
|
51
|
+
<style>
|
|
52
|
+
.quick-dock {
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: 8px;
|
|
56
|
+
padding: 8px 12px;
|
|
57
|
+
background: rgba(14, 14, 18, 0.85);
|
|
58
|
+
backdrop-filter: blur(20px);
|
|
59
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
60
|
+
border-radius: var(--r-full, 9999px);
|
|
61
|
+
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.quick-dock__item {
|
|
65
|
+
position: relative;
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
width: 42px;
|
|
70
|
+
height: 42px;
|
|
71
|
+
border-radius: 50%;
|
|
72
|
+
background: rgba(255, 255, 255, 0.04);
|
|
73
|
+
border: 1px solid rgba(255, 255, 255, 0.06);
|
|
74
|
+
color: var(--c-text-2, #a3a3a3);
|
|
75
|
+
text-decoration: none;
|
|
76
|
+
transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, color 0.2s ease;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.quick-dock__item:hover {
|
|
80
|
+
transform: translateY(-8px) scale(1.15);
|
|
81
|
+
background: rgba(184, 134, 11, 0.2);
|
|
82
|
+
border-color: rgba(184, 134, 11, 0.4);
|
|
83
|
+
color: var(--c-primary-light, #d4a017);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.quick-dock__icon {
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.quick-dock__tooltip {
|
|
93
|
+
position: absolute;
|
|
94
|
+
bottom: calc(100% + 12px);
|
|
95
|
+
padding: 4px 10px;
|
|
96
|
+
background: #000000;
|
|
97
|
+
color: #ffffff;
|
|
98
|
+
font-family: var(--font-sans, system-ui, sans-serif);
|
|
99
|
+
font-size: 0.72rem;
|
|
100
|
+
font-weight: 700;
|
|
101
|
+
border-radius: 6px;
|
|
102
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
103
|
+
white-space: nowrap;
|
|
104
|
+
opacity: 0;
|
|
105
|
+
pointer-events: none;
|
|
106
|
+
transform: translateY(6px);
|
|
107
|
+
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.quick-dock__tooltip::after {
|
|
111
|
+
content: '';
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: 100%;
|
|
114
|
+
left: 50%;
|
|
115
|
+
transform: translateX(-50%);
|
|
116
|
+
border-width: 4px;
|
|
117
|
+
border-style: solid;
|
|
118
|
+
border-color: #000 transparent transparent transparent;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.quick-dock__item:hover .quick-dock__tooltip {
|
|
122
|
+
opacity: 1;
|
|
123
|
+
transform: translateY(0);
|
|
124
|
+
}
|
|
125
|
+
</style>
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* StepBreadcrumbBar — Stepped workflow breadcrumb indicator for checkout, multi-step forms, or wizards.
|
|
4
|
+
*
|
|
5
|
+
* @param {Array<{step: number, label: string, status: 'complete' | 'active' | 'upcoming', href?: string}>} steps - Step definitions.
|
|
6
|
+
*/
|
|
7
|
+
interface Props {
|
|
8
|
+
steps?: Array<{
|
|
9
|
+
step: number;
|
|
10
|
+
label: string;
|
|
11
|
+
status: 'complete' | 'active' | 'upcoming';
|
|
12
|
+
href?: string;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const {
|
|
17
|
+
steps = [
|
|
18
|
+
{ step: 1, label: 'Account', status: 'complete', href: '#step-1' },
|
|
19
|
+
{ step: 2, label: 'Plan & Billing', status: 'active', href: '#step-2' },
|
|
20
|
+
{ step: 3, label: 'Preferences', status: 'upcoming', href: '#step-3' },
|
|
21
|
+
{ step: 4, label: 'Review', status: 'upcoming', href: '#step-4' },
|
|
22
|
+
],
|
|
23
|
+
} = Astro.props;
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
<nav class="step-nav" aria-label="Workflow progress">
|
|
27
|
+
<ol class="step-nav__list">
|
|
28
|
+
{steps.map((st, i) => (
|
|
29
|
+
<li class:list={['step-nav__item', `step-nav__item--${st.status}`]}>
|
|
30
|
+
<a href={st.href || '#'} class="step-nav__link" aria-current={st.status === 'active' ? 'step' : undefined}>
|
|
31
|
+
<span class="step-nav__circle">
|
|
32
|
+
{st.status === 'complete' ? (
|
|
33
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
|
|
34
|
+
<polyline points="20 6 9 17 4 12" />
|
|
35
|
+
</svg>
|
|
36
|
+
) : (
|
|
37
|
+
st.step
|
|
38
|
+
)}
|
|
39
|
+
</span>
|
|
40
|
+
<span class="step-nav__label">{st.label}</span>
|
|
41
|
+
</a>
|
|
42
|
+
{i < steps.length - 1 && (
|
|
43
|
+
<div class="step-nav__line" aria-hidden="true"></div>
|
|
44
|
+
)}
|
|
45
|
+
</li>
|
|
46
|
+
))}
|
|
47
|
+
</ol>
|
|
48
|
+
</nav>
|
|
49
|
+
|
|
50
|
+
<style>
|
|
51
|
+
.step-nav {
|
|
52
|
+
width: 100%;
|
|
53
|
+
max-width: 680px;
|
|
54
|
+
font-family: var(--font-sans, system-ui, sans-serif);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.step-nav__list {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
list-style: none;
|
|
61
|
+
padding: 0;
|
|
62
|
+
margin: 0;
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.step-nav__item {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
flex: 1;
|
|
70
|
+
position: relative;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.step-nav__item:last-child {
|
|
74
|
+
flex: 0 0 auto;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.step-nav__link {
|
|
78
|
+
display: inline-flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
gap: 10px;
|
|
81
|
+
text-decoration: none;
|
|
82
|
+
color: var(--c-text-3, #737373);
|
|
83
|
+
font-size: 0.82rem;
|
|
84
|
+
font-weight: 600;
|
|
85
|
+
white-space: nowrap;
|
|
86
|
+
transition: color 0.2s ease;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.step-nav__link:hover {
|
|
90
|
+
color: var(--c-text-1, #ffffff);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.step-nav__circle {
|
|
94
|
+
display: grid;
|
|
95
|
+
place-items: center;
|
|
96
|
+
width: 28px;
|
|
97
|
+
height: 28px;
|
|
98
|
+
border-radius: 50%;
|
|
99
|
+
background: rgba(255, 255, 255, 0.04);
|
|
100
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
101
|
+
color: var(--c-text-2, #a3a3a3);
|
|
102
|
+
font-size: 0.78rem;
|
|
103
|
+
font-weight: 700;
|
|
104
|
+
flex-shrink: 0;
|
|
105
|
+
transition: all 0.25s ease;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Status modifiers */
|
|
109
|
+
.step-nav__item--complete .step-nav__circle {
|
|
110
|
+
background: rgba(16, 185, 129, 0.15);
|
|
111
|
+
border-color: #10b981;
|
|
112
|
+
color: #10b981;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.step-nav__item--complete .step-nav__label {
|
|
116
|
+
color: var(--c-text-1, #ffffff);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.step-nav__item--active .step-nav__circle {
|
|
120
|
+
background: linear-gradient(135deg, #d4a017, #b8860b);
|
|
121
|
+
border-color: #d4a017;
|
|
122
|
+
color: #050505;
|
|
123
|
+
box-shadow: 0 0 12px rgba(212, 160, 23, 0.4);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.step-nav__item--active .step-nav__label {
|
|
127
|
+
color: var(--c-primary-light, #d4a017);
|
|
128
|
+
font-weight: 700;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.step-nav__line {
|
|
132
|
+
flex: 1;
|
|
133
|
+
height: 2px;
|
|
134
|
+
background: rgba(255, 255, 255, 0.08);
|
|
135
|
+
margin: 0 12px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.step-nav__item--complete .step-nav__line {
|
|
139
|
+
background: #10b981;
|
|
140
|
+
opacity: 0.5;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@media (max-width: 640px) {
|
|
144
|
+
.step-nav__label {
|
|
145
|
+
display: none;
|
|
146
|
+
}
|
|
147
|
+
.step-nav__line {
|
|
148
|
+
margin: 0 6px;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
</style>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* SubNavbarPills — Secondary horizontal sub-navigation bar with scrollable pill links and badge counters.
|
|
4
|
+
*
|
|
5
|
+
* @param {Array<{label: string, href: string, count?: number, active?: boolean}>} items - Nav links list.
|
|
6
|
+
* @param {string} className - Optional CSS class.
|
|
7
|
+
*/
|
|
8
|
+
interface Props {
|
|
9
|
+
items?: Array<{ label: string; href: string; count?: number; active?: boolean }>;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
items = [
|
|
15
|
+
{ label: 'All Items', href: '#all', count: 124, active: true },
|
|
16
|
+
{ label: 'Components', href: '#components', count: 86 },
|
|
17
|
+
{ label: 'Templates', href: '#templates', count: 18 },
|
|
18
|
+
{ label: 'Icons', href: '#icons', count: 20 },
|
|
19
|
+
{ label: 'Guides', href: '#guides' },
|
|
20
|
+
],
|
|
21
|
+
className = '',
|
|
22
|
+
} = Astro.props;
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
<nav class:list={['subnav-pills', className]} aria-label="Sub navigation">
|
|
26
|
+
<div class="subnav-pills__track">
|
|
27
|
+
{items.map((item) => (
|
|
28
|
+
<a
|
|
29
|
+
href={item.href}
|
|
30
|
+
class:list={['subnav-pills__link', { 'is-active': item.active }]}
|
|
31
|
+
aria-current={item.active ? 'page' : undefined}
|
|
32
|
+
>
|
|
33
|
+
<span>{item.label}</span>
|
|
34
|
+
{item.count !== undefined && (
|
|
35
|
+
<span class="subnav-pills__count">{item.count}</span>
|
|
36
|
+
)}
|
|
37
|
+
</a>
|
|
38
|
+
))}
|
|
39
|
+
</div>
|
|
40
|
+
</nav>
|
|
41
|
+
|
|
42
|
+
<style>
|
|
43
|
+
.subnav-pills {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
width: 100%;
|
|
47
|
+
overflow-x: auto;
|
|
48
|
+
scrollbar-width: none;
|
|
49
|
+
-ms-overflow-style: none;
|
|
50
|
+
padding: 0.5rem 0;
|
|
51
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
|
52
|
+
font-family: var(--font-sans, system-ui, sans-serif);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.subnav-pills::-webkit-scrollbar {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.subnav-pills__track {
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: 8px;
|
|
63
|
+
padding: 2px 4px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.subnav-pills__link {
|
|
67
|
+
display: inline-flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 8px;
|
|
70
|
+
padding: 0.45rem 1rem;
|
|
71
|
+
background: rgba(255, 255, 255, 0.03);
|
|
72
|
+
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
73
|
+
border-radius: var(--r-full, 9999px);
|
|
74
|
+
color: var(--c-text-2, #a3a3a3);
|
|
75
|
+
font-size: 0.85rem;
|
|
76
|
+
font-weight: 600;
|
|
77
|
+
text-decoration: none;
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
transition: all 0.2s ease;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.subnav-pills__link:hover {
|
|
83
|
+
color: var(--c-text-1, #ffffff);
|
|
84
|
+
background: rgba(255, 255, 255, 0.08);
|
|
85
|
+
border-color: rgba(255, 255, 255, 0.15);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.subnav-pills__link.is-active {
|
|
89
|
+
background: linear-gradient(135deg, rgba(184, 134, 11, 0.25), rgba(212, 160, 23, 0.25));
|
|
90
|
+
border-color: rgba(184, 134, 11, 0.5);
|
|
91
|
+
color: var(--c-accent, #fef3c7);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.subnav-pills__count {
|
|
95
|
+
font-size: 0.7rem;
|
|
96
|
+
font-weight: 700;
|
|
97
|
+
background: rgba(0, 0, 0, 0.3);
|
|
98
|
+
padding: 1px 7px;
|
|
99
|
+
border-radius: var(--r-full, 9999px);
|
|
100
|
+
color: inherit;
|
|
101
|
+
}
|
|
102
|
+
</style>
|
|
@@ -21,3 +21,6 @@ export { default as SimpleFooterGlass } from './SimpleFooterGlass.astro';
|
|
|
21
21
|
export { default as TabUnderline } from './TabUnderline.astro';
|
|
22
22
|
export { default as UserProfileNav } from './UserProfileNav.astro';
|
|
23
23
|
export { default as VerticalTabs } from './VerticalTabs.astro';
|
|
24
|
+
export { default as SubNavbarPills } from './SubNavbarPills.astro';
|
|
25
|
+
export { default as QuickJumpDock } from './QuickJumpDock.astro';
|
|
26
|
+
export { default as StepBreadcrumbBar } from './StepBreadcrumbBar.astro';
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* CookiePreferencesDrawer — GDPR/CCPA consent drawer with frosted glass styling and category toggles.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} title - Header text. Default is 'Privacy Preferences'.
|
|
6
|
+
* @param {string} description - Explanation text for user privacy consent.
|
|
7
|
+
*/
|
|
8
|
+
interface Props {
|
|
9
|
+
title?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
title = 'Privacy & Cookie Settings',
|
|
15
|
+
description = 'We use cookies and telemetry to improve performance, analyze usage, and customize your experience.',
|
|
16
|
+
} = Astro.props;
|
|
17
|
+
|
|
18
|
+
const categories = [
|
|
19
|
+
{ id: 'necessary', name: 'Strictly Necessary', desc: 'Required for core authentication and security.', locked: true },
|
|
20
|
+
{ id: 'analytics', name: 'Performance & Analytics', desc: 'Anonymous traffic data to improve component reliability.', locked: false },
|
|
21
|
+
{ id: 'marketing', name: 'Targeted Experience', desc: 'Personalized recommendations based on library interactions.', locked: false },
|
|
22
|
+
];
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
<aside class="cookie-drawer" role="dialog" aria-modal="true" aria-label={title} data-cookie-drawer>
|
|
26
|
+
<div class="cookie-drawer__header">
|
|
27
|
+
<div class="cookie-drawer__icon">🍪</div>
|
|
28
|
+
<div class="cookie-drawer__titles">
|
|
29
|
+
<h4 class="cookie-drawer__title">{title}</h4>
|
|
30
|
+
<p class="cookie-drawer__desc">{description}</p>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="cookie-drawer__categories">
|
|
35
|
+
{categories.map((cat) => (
|
|
36
|
+
<div class="cookie-cat">
|
|
37
|
+
<div class="cookie-cat__info">
|
|
38
|
+
<span class="cookie-cat__name">{cat.name}</span>
|
|
39
|
+
<span class="cookie-cat__desc">{cat.desc}</span>
|
|
40
|
+
</div>
|
|
41
|
+
<label class="switch">
|
|
42
|
+
<input
|
|
43
|
+
type="checkbox"
|
|
44
|
+
checked={cat.locked}
|
|
45
|
+
disabled={cat.locked}
|
|
46
|
+
name={cat.id}
|
|
47
|
+
/>
|
|
48
|
+
<span class="slider"></span>
|
|
49
|
+
</label>
|
|
50
|
+
</div>
|
|
51
|
+
))}
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div class="cookie-drawer__actions">
|
|
55
|
+
<button type="button" class="btn btn--secondary" data-cookie-reject>Reject All</button>
|
|
56
|
+
<button type="button" class="btn btn--primary" data-cookie-accept>Accept Selected</button>
|
|
57
|
+
</div>
|
|
58
|
+
</aside>
|
|
59
|
+
|
|
60
|
+
<style>
|
|
61
|
+
.cookie-drawer {
|
|
62
|
+
position: fixed;
|
|
63
|
+
bottom: 1.5rem;
|
|
64
|
+
left: 1.5rem;
|
|
65
|
+
right: 1.5rem;
|
|
66
|
+
max-width: 520px;
|
|
67
|
+
z-index: 100;
|
|
68
|
+
margin: 0 auto;
|
|
69
|
+
padding: 1.4rem;
|
|
70
|
+
background: rgba(12, 12, 16, 0.94);
|
|
71
|
+
backdrop-filter: blur(24px);
|
|
72
|
+
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
73
|
+
border-radius: var(--r-xl, 24px);
|
|
74
|
+
box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
|
|
75
|
+
font-family: var(--font-sans, system-ui, sans-serif);
|
|
76
|
+
transition: transform 0.3s ease, opacity 0.3s ease;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.cookie-drawer__header {
|
|
80
|
+
display: flex;
|
|
81
|
+
gap: 12px;
|
|
82
|
+
margin-bottom: 16px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.cookie-drawer__icon {
|
|
86
|
+
font-size: 1.8rem;
|
|
87
|
+
line-height: 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.cookie-drawer__title {
|
|
91
|
+
font-size: 1rem;
|
|
92
|
+
font-weight: 800;
|
|
93
|
+
color: var(--c-text-1, #ffffff);
|
|
94
|
+
margin: 0 0 4px 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.cookie-drawer__desc {
|
|
98
|
+
font-size: 0.8rem;
|
|
99
|
+
color: var(--c-text-2, #a3a3a3);
|
|
100
|
+
margin: 0;
|
|
101
|
+
line-height: 1.45;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.cookie-drawer__categories {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
gap: 10px;
|
|
108
|
+
margin-bottom: 18px;
|
|
109
|
+
padding: 10px 0;
|
|
110
|
+
border-top: 1px solid rgba(255, 255, 255, 0.06);
|
|
111
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.cookie-cat {
|
|
115
|
+
display: flex;
|
|
116
|
+
justify-content: space-between;
|
|
117
|
+
align-items: center;
|
|
118
|
+
gap: 12px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.cookie-cat__name {
|
|
122
|
+
display: block;
|
|
123
|
+
font-size: 0.82rem;
|
|
124
|
+
font-weight: 700;
|
|
125
|
+
color: var(--c-text-1, #ffffff);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.cookie-cat__desc {
|
|
129
|
+
display: block;
|
|
130
|
+
font-size: 0.72rem;
|
|
131
|
+
color: var(--c-text-3, #737373);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* Switch toggle */
|
|
135
|
+
.switch {
|
|
136
|
+
position: relative;
|
|
137
|
+
display: inline-block;
|
|
138
|
+
width: 38px;
|
|
139
|
+
height: 22px;
|
|
140
|
+
flex-shrink: 0;
|
|
141
|
+
}
|
|
142
|
+
.switch input { opacity: 0; width: 0; height: 0; }
|
|
143
|
+
.slider {
|
|
144
|
+
position: absolute;
|
|
145
|
+
cursor: pointer;
|
|
146
|
+
inset: 0;
|
|
147
|
+
background-color: rgba(255, 255, 255, 0.15);
|
|
148
|
+
border-radius: 34px;
|
|
149
|
+
transition: 0.25s;
|
|
150
|
+
}
|
|
151
|
+
.slider:before {
|
|
152
|
+
position: absolute;
|
|
153
|
+
content: "";
|
|
154
|
+
height: 16px;
|
|
155
|
+
width: 16px;
|
|
156
|
+
left: 3px;
|
|
157
|
+
bottom: 3px;
|
|
158
|
+
background-color: white;
|
|
159
|
+
border-radius: 50%;
|
|
160
|
+
transition: 0.25s;
|
|
161
|
+
}
|
|
162
|
+
input:checked + .slider {
|
|
163
|
+
background-color: var(--c-primary-light, #d4a017);
|
|
164
|
+
}
|
|
165
|
+
input:checked + .slider:before {
|
|
166
|
+
transform: translateX(16px);
|
|
167
|
+
}
|
|
168
|
+
input:disabled + .slider {
|
|
169
|
+
opacity: 0.6;
|
|
170
|
+
cursor: not-allowed;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.cookie-drawer__actions {
|
|
174
|
+
display: flex;
|
|
175
|
+
justify-content: flex-end;
|
|
176
|
+
gap: 10px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.btn {
|
|
180
|
+
padding: 0.55rem 1.2rem;
|
|
181
|
+
font-size: 0.82rem;
|
|
182
|
+
font-weight: 700;
|
|
183
|
+
border-radius: var(--r-md, 10px);
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
transition: all 0.2s ease;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.btn--secondary {
|
|
189
|
+
background: rgba(255, 255, 255, 0.05);
|
|
190
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
191
|
+
color: var(--c-text-2, #a3a3a3);
|
|
192
|
+
}
|
|
193
|
+
.btn--secondary:hover {
|
|
194
|
+
color: var(--c-text-1, #ffffff);
|
|
195
|
+
background: rgba(255, 255, 255, 0.1);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.btn--primary {
|
|
199
|
+
background: linear-gradient(135deg, #d4a017, #b8860b);
|
|
200
|
+
border: none;
|
|
201
|
+
color: #050505;
|
|
202
|
+
box-shadow: 0 4px 14px rgba(184, 134, 11, 0.35);
|
|
203
|
+
}
|
|
204
|
+
.btn--primary:hover {
|
|
205
|
+
transform: translateY(-1px);
|
|
206
|
+
box-shadow: 0 6px 20px rgba(184, 134, 11, 0.45);
|
|
207
|
+
}
|
|
208
|
+
</style>
|
|
209
|
+
|
|
210
|
+
<script>
|
|
211
|
+
function setupCookieDrawers() {
|
|
212
|
+
document.querySelectorAll('[data-cookie-drawer]').forEach((drawer) => {
|
|
213
|
+
const dismiss = () => {
|
|
214
|
+
(drawer as HTMLElement).style.transform = 'translateY(120%)';
|
|
215
|
+
(drawer as HTMLElement).style.opacity = '0';
|
|
216
|
+
setTimeout(() => drawer.remove(), 350);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
drawer.querySelector('[data-cookie-reject]')?.addEventListener('click', dismiss);
|
|
220
|
+
drawer.querySelector('[data-cookie-accept]')?.addEventListener('click', dismiss);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
setupCookieDrawers();
|
|
225
|
+
document.addEventListener('astro:page-load', setupCookieDrawers);
|
|
226
|
+
</script>
|