@veluai/velu 0.1.13 → 0.1.14
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 +80 -80
- package/dist/cli.js +18 -18
- package/package.json +3 -2
- package/runtime/velu-ui/components/Accordion.jsx +64 -64
- package/runtime/velu-ui/components/ApiClient.jsx +121 -121
- package/runtime/velu-ui/components/ApiField.jsx +87 -87
- package/runtime/velu-ui/components/ApiPath.jsx +63 -63
- package/runtime/velu-ui/components/ApiSidebar.jsx +122 -122
- package/runtime/velu-ui/components/AskBar.jsx +71 -71
- package/runtime/velu-ui/components/Callout.jsx +114 -114
- package/runtime/velu-ui/components/Card.jsx +131 -131
- package/runtime/velu-ui/components/Chatbot.jsx +596 -596
- package/runtime/velu-ui/components/CodeBlock.jsx +375 -375
- package/runtime/velu-ui/components/Columns.jsx +56 -56
- package/runtime/velu-ui/components/ErrorCard.jsx +138 -138
- package/runtime/velu-ui/components/Field.jsx +81 -81
- package/runtime/velu-ui/components/Image.jsx +163 -163
- package/runtime/velu-ui/components/MethodBadge.jsx +31 -31
- package/runtime/velu-ui/components/NavSelect.jsx +108 -108
- package/runtime/velu-ui/components/PageFeedback.jsx +219 -219
- package/runtime/velu-ui/components/PageFooter.jsx +213 -213
- package/runtime/velu-ui/components/PageHeader.jsx +414 -414
- package/runtime/velu-ui/components/PageNav.jsx +77 -77
- package/runtime/velu-ui/components/PoweredBy.jsx +51 -51
- package/runtime/velu-ui/components/Prompt.jsx +115 -115
- package/runtime/velu-ui/components/Search.jsx +411 -366
- package/runtime/velu-ui/components/Sidebar.jsx +191 -191
- package/runtime/velu-ui/components/Steps.jsx +65 -65
- package/runtime/velu-ui/components/ThemeToggle.jsx +48 -48
- package/runtime/velu-ui/components/Toc.jsx +537 -537
- package/runtime/velu-ui/components/TocBar.jsx +195 -195
- package/runtime/velu-ui/components/Tree.jsx +87 -87
- package/runtime/velu-ui/components/TryItBar.jsx +90 -90
- package/runtime/velu-ui/components/accordion.css +92 -92
- package/runtime/velu-ui/components/api.css +479 -479
- package/runtime/velu-ui/components/ask-bar.css +94 -94
- package/runtime/velu-ui/components/card.css +105 -105
- package/runtime/velu-ui/components/chatbot.css +617 -617
- package/runtime/velu-ui/components/code-block.css +263 -263
- package/runtime/velu-ui/components/docs-layout.css +784 -775
- package/runtime/velu-ui/components/field.css +82 -82
- package/runtime/velu-ui/components/image.css +237 -237
- package/runtime/velu-ui/components/nav-select.css +157 -157
- package/runtime/velu-ui/components/page-feedback.css +241 -241
- package/runtime/velu-ui/components/page-footer.css +130 -130
- package/runtime/velu-ui/components/page-header.css +520 -520
- package/runtime/velu-ui/components/page-nav.css +50 -50
- package/runtime/velu-ui/components/powered-by.css +66 -66
- package/runtime/velu-ui/components/prompt.css +99 -99
- package/runtime/velu-ui/components/search.css +307 -307
- package/runtime/velu-ui/components/sidebar.css +144 -144
- package/runtime/velu-ui/components/steps.css +77 -77
- package/runtime/velu-ui/components/theme-toggle.css +101 -101
- package/runtime/velu-ui/components/toc-bar.css +234 -234
- package/runtime/velu-ui/components/tree.css +49 -49
- package/runtime/velu-ui/index.js +46 -46
- package/runtime/velu-ui/lib/component-schemas.js +100 -100
- package/runtime/velu-ui/lib/copyText.js +64 -64
- package/runtime/velu-ui/lib/lang-icons.jsx +147 -147
- package/runtime/velu-ui/lib/prism-langs.js +957 -957
- package/runtime/velu-ui/lib/prism-loader.js +74 -74
- package/runtime/velu-ui/lib/resolveIcon.jsx +29 -29
- package/runtime/velu-ui/lib/scrollIntoNearestView.js +66 -66
- package/runtime/velu-ui/mdx-components.jsx +105 -105
- package/runtime/velu-ui/primitives/Cluster.jsx +49 -49
- package/runtime/velu-ui/primitives/Stack.jsx +63 -63
- package/runtime/velu-ui/primitives/Switcher.jsx +57 -57
- package/runtime/velu-ui/primitives/stack.css +3 -3
- package/runtime/velu-ui/primitives/switcher.css +25 -25
- package/runtime/velu-ui/styles.css +43 -43
- package/runtime/velu-ui/tokens.css +4 -4
- package/schema/velu.schema.json +167 -167
- package/src/lib/extract-mdx-error.js +170 -170
- package/src/lib/issues.js +159 -159
- package/src/lib/known-components.js +34 -34
- package/src/navigation.js +434 -434
- package/src/runtime/App.jsx +1490 -1476
- package/src/runtime/ErrorBoundary.jsx +54 -54
- package/src/runtime/client-entry.jsx +22 -22
- package/src/runtime/server-entry.jsx +16 -16
- package/src/template.html +48 -48
- package/templates/starter/ai-tools/claude-code.mdx +26 -26
- package/templates/starter/ai-tools/cursor.mdx +17 -17
- package/templates/starter/api-reference/endpoint/create.mdx +24 -24
- package/templates/starter/api-reference/endpoint/get.mdx +27 -27
- package/templates/starter/api-reference/introduction.mdx +28 -28
- package/templates/starter/development.mdx +19 -19
- package/templates/starter/essentials/code.mdx +29 -29
- package/templates/starter/essentials/images.mdx +29 -29
- package/templates/starter/essentials/markdown.mdx +25 -25
- package/templates/starter/essentials/navigation.mdx +39 -39
- package/templates/starter/essentials/settings.mdx +30 -30
- package/templates/starter/favicon.svg +6 -6
- package/templates/starter/index.mdx +31 -31
- package/templates/starter/quickstart.mdx +31 -31
- package/templates/starter/velu.json +33 -33
|
@@ -1,213 +1,213 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Stack from '../primitives/Stack.jsx';
|
|
3
|
-
import Cluster from '../primitives/Cluster.jsx';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* PageFooter — the docs site's footer.
|
|
7
|
-
*
|
|
8
|
-
* <PageFooter
|
|
9
|
-
* linkComponent={RouterLink}
|
|
10
|
-
* columns={[
|
|
11
|
-
* { title: 'Resources', items: [
|
|
12
|
-
* { label: 'Showcase', href: '/showcase' },
|
|
13
|
-
* { label: 'Enterprise', href: '/enterprise' },
|
|
14
|
-
* { label: 'Status', href: '/status' },
|
|
15
|
-
* ]},
|
|
16
|
-
* { title: 'Company', items: […] },
|
|
17
|
-
* { title: 'Policies', items: […] },
|
|
18
|
-
* ]}
|
|
19
|
-
* socials={[
|
|
20
|
-
* { kind: 'github', href: 'https://github.com/…' },
|
|
21
|
-
* { kind: 'x', href: 'https://x.com/…' },
|
|
22
|
-
* { kind: 'youtube', href: 'https://youtube.com/…' },
|
|
23
|
-
* { kind: 'linkedin', href: 'https://linkedin.com/…' },
|
|
24
|
-
* ]}
|
|
25
|
-
* />
|
|
26
|
-
*
|
|
27
|
-
* Layout: a Switcher row of [brand | columns…] that flips to a vertical
|
|
28
|
-
* stack on narrow widths, with a centered social-icon row below. The
|
|
29
|
-
* number of link columns is whatever you pass — fully data-driven.
|
|
30
|
-
*
|
|
31
|
-
* @typedef {Object} FooterLink
|
|
32
|
-
* @property {string} label
|
|
33
|
-
* @property {string} [href]
|
|
34
|
-
*
|
|
35
|
-
* @typedef {Object} FooterColumn
|
|
36
|
-
* @property {string} title
|
|
37
|
-
* @property {FooterLink[]} items
|
|
38
|
-
*
|
|
39
|
-
* @typedef {Object} FooterSocial
|
|
40
|
-
* @property {'github'|'x'|'youtube'|'linkedin'} kind
|
|
41
|
-
* @property {string} href
|
|
42
|
-
*
|
|
43
|
-
* @param {{ columns?: FooterColumn[], socials?: FooterSocial[],
|
|
44
|
-
* brand?: { label?: string, href?: string },
|
|
45
|
-
* linkComponent?: React.ElementType, className?: string }} props
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
/* ── Brand mark — the Velu double-hook logo. Color: currentColor for
|
|
49
|
-
the surrounding wordmark; the mark itself uses --accent-color via
|
|
50
|
-
the wrapping span. ───────────────────────────────────────────────── */
|
|
51
|
-
function VeluMark() {
|
|
52
|
-
return (
|
|
53
|
-
<svg
|
|
54
|
-
className="velu-footer__mark"
|
|
55
|
-
viewBox="0 0 32 24"
|
|
56
|
-
fill="currentColor"
|
|
57
|
-
aria-hidden="true"
|
|
58
|
-
>
|
|
59
|
-
<path
|
|
60
|
-
fillRule="evenodd"
|
|
61
|
-
clipRule="evenodd"
|
|
62
|
-
d="M29.6564 14.1534C29.5739 14.5616 29.3507 14.9288 29.0248 15.1926C28.699 15.4565 28.2907 15.6007 27.8694 15.6006H21.3702C20.5341 15.6006 19.8051 16.1627 19.6031 16.9638L18.1671 22.6368C18.0685 23.0263 17.8409 23.372 17.5205 23.619C17.2002 23.866 16.8054 24.0001 16.399 24H10.4378C10.1609 24.0001 9.88759 23.9378 9.63868 23.8179C9.38976 23.6979 9.1718 23.5235 9.00135 23.3079C8.8309 23.0923 8.71245 22.8412 8.65499 22.5736C8.59754 22.306 8.6026 22.029 8.66978 21.7636L10.1888 15.7636C10.2874 15.3743 10.5148 15.0287 10.835 14.7817C11.1551 14.5347 11.5496 14.4005 11.9559 14.4004H18.3931C19.2621 14.4004 20.0101 13.7949 20.1801 12.9532L22.3882 2.04774C22.4705 1.63945 22.6936 1.27198 23.0195 1.00793C23.3453 0.74388 23.7538 0.599578 24.1752 0.599605H30.1774C30.4471 0.599529 30.7134 0.658587 30.9572 0.772515C31.201 0.886444 31.4161 1.0524 31.5871 1.25842C31.758 1.46443 31.8806 1.70537 31.9458 1.96383C32.0111 2.2223 32.0175 2.49185 31.9645 2.75305L29.6564 14.1534ZM9.61081 13.5538C9.52825 13.962 9.30507 14.3292 8.97924 14.593C8.65341 14.857 8.24508 15.0011 7.82375 15.001H1.82257C1.55289 15.0011 1.28656 14.942 1.04279 14.8281C0.79902 14.7141 0.583892 14.5482 0.412928 14.3422C0.241965 14.1362 0.11943 13.8952 0.0541639 13.6368C-0.0111017 13.3783 -0.0174699 13.1087 0.0355186 12.8475L2.34359 1.44715C2.42614 1.03904 2.64933 0.671798 2.97516 0.407944C3.30099 0.144089 3.70932 -7.24082e-05 4.13064 7.25899e-08H10.1318C10.4015 -7.55792e-05 10.6678 0.0589818 10.9116 0.172911C11.1554 0.286839 11.3705 0.453799 11.5415 0.659813C11.7124 0.864828 11.835 1.10576 11.9002 1.36423C11.9655 1.62269 11.9719 1.89225 11.9189 2.15344L9.61081 13.553L9.61081 13.5538Z"
|
|
63
|
-
/>
|
|
64
|
-
</svg>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/* ── Social glyphs — inline SVGs with fill: currentColor so they
|
|
69
|
-
inherit color (themed) and flip with light/dark. ─────────────────── */
|
|
70
|
-
function GithubIcon() {
|
|
71
|
-
return (
|
|
72
|
-
<svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
73
|
-
<path
|
|
74
|
-
fillRule="evenodd"
|
|
75
|
-
clipRule="evenodd"
|
|
76
|
-
d="M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z"
|
|
77
|
-
/>
|
|
78
|
-
</svg>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
function XIcon() {
|
|
82
|
-
return (
|
|
83
|
-
<svg viewBox="0 0 1200 1227" fill="currentColor" aria-hidden="true">
|
|
84
|
-
<path d="M714.163 519.284 1160.89 0h-105.86L667.137 450.887 357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152 327.181 476.152H1200L714.137 519.284h.026ZM569.165 687.828l-47.468-67.894-377.686-540.24h162.604l304.797 435.991 47.468 67.894 396.2 566.721H892.476L569.165 687.854v-.026Z" />
|
|
85
|
-
</svg>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
function YoutubeIcon() {
|
|
89
|
-
return (
|
|
90
|
-
<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
91
|
-
<path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" />
|
|
92
|
-
</svg>
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
function LinkedinIcon() {
|
|
96
|
-
return (
|
|
97
|
-
<svg viewBox="0 0 256 256" fill="currentColor" aria-hidden="true">
|
|
98
|
-
<path d="M218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453" />
|
|
99
|
-
</svg>
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const SOCIAL_ICONS = {
|
|
104
|
-
github: GithubIcon,
|
|
105
|
-
x: XIcon,
|
|
106
|
-
youtube: YoutubeIcon,
|
|
107
|
-
linkedin: LinkedinIcon,
|
|
108
|
-
};
|
|
109
|
-
const SOCIAL_LABELS = {
|
|
110
|
-
github: 'GitHub',
|
|
111
|
-
x: 'X',
|
|
112
|
-
youtube: 'YouTube',
|
|
113
|
-
linkedin: 'LinkedIn',
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export default function PageFooter({
|
|
117
|
-
brand,
|
|
118
|
-
columns = [],
|
|
119
|
-
socials = [],
|
|
120
|
-
linkComponent = 'a',
|
|
121
|
-
className = '',
|
|
122
|
-
...rest
|
|
123
|
-
}) {
|
|
124
|
-
const Link = linkComponent;
|
|
125
|
-
const brandLabel = brand?.label ?? 'Velu';
|
|
126
|
-
const brandHref = brand?.href;
|
|
127
|
-
|
|
128
|
-
const brandNode = (
|
|
129
|
-
<Cluster space="var(--s-3)" align="center" className="velu-footer__brand">
|
|
130
|
-
<VeluMark />
|
|
131
|
-
<span className="velu-footer__wordmark">{brandLabel}</span>
|
|
132
|
-
</Cluster>
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
return (
|
|
136
|
-
<Stack
|
|
137
|
-
as="footer"
|
|
138
|
-
space="var(--s2)"
|
|
139
|
-
className={`velu-footer ${className}`.trim()}
|
|
140
|
-
{...rest}
|
|
141
|
-
>
|
|
142
|
-
{/* Container groups the brand row and the columns row. */}
|
|
143
|
-
<Stack space="var(--s2)" className="velu-footer__container">
|
|
144
|
-
{/* Row 1: brand */}
|
|
145
|
-
<div className="velu-footer__row velu-footer__row--brand">
|
|
146
|
-
{brandHref ? (
|
|
147
|
-
<Link href={brandHref} className="velu-footer__brand-link">
|
|
148
|
-
{brandNode}
|
|
149
|
-
</Link>
|
|
150
|
-
) : (
|
|
151
|
-
brandNode
|
|
152
|
-
)}
|
|
153
|
-
</div>
|
|
154
|
-
|
|
155
|
-
{/* Row 2: link columns — each column hugs its content. Plain
|
|
156
|
-
flex row (not Cluster) so column-gap (large, between
|
|
157
|
-
columns) and row-gap (small, when columns wrap onto a new
|
|
158
|
-
line) can be set independently. CSS owns the gaps. */}
|
|
159
|
-
<div className="velu-footer__row velu-footer__row--columns">
|
|
160
|
-
{columns.map((col, i) => (
|
|
161
|
-
<Stack
|
|
162
|
-
key={i}
|
|
163
|
-
space="var(--s-2)"
|
|
164
|
-
className="velu-footer__column"
|
|
165
|
-
>
|
|
166
|
-
<span className="velu-footer__column-title">{col.title}</span>
|
|
167
|
-
<Stack space="var(--s-5)" as="ul" className="velu-footer__list">
|
|
168
|
-
{(col.items ?? []).map((it, j) => (
|
|
169
|
-
<li key={j}>
|
|
170
|
-
<Link
|
|
171
|
-
href={it.href ?? '#'}
|
|
172
|
-
className="velu-footer__link"
|
|
173
|
-
>
|
|
174
|
-
{it.label}
|
|
175
|
-
</Link>
|
|
176
|
-
</li>
|
|
177
|
-
))}
|
|
178
|
-
</Stack>
|
|
179
|
-
</Stack>
|
|
180
|
-
))}
|
|
181
|
-
</div>
|
|
182
|
-
</Stack>
|
|
183
|
-
|
|
184
|
-
{/* Socials sit OUTSIDE the container, at the bottom of the footer. */}
|
|
185
|
-
{socials.length > 0 && (
|
|
186
|
-
<Cluster
|
|
187
|
-
space="var(--s-2)"
|
|
188
|
-
justify="center"
|
|
189
|
-
align="center"
|
|
190
|
-
className="velu-footer__socials"
|
|
191
|
-
>
|
|
192
|
-
{socials.map((s, i) => {
|
|
193
|
-
const Icon = SOCIAL_ICONS[s.kind];
|
|
194
|
-
if (!Icon) return null;
|
|
195
|
-
return (
|
|
196
|
-
<a
|
|
197
|
-
key={i}
|
|
198
|
-
href={s.href}
|
|
199
|
-
target="_blank"
|
|
200
|
-
rel="noreferrer"
|
|
201
|
-
aria-label={SOCIAL_LABELS[s.kind] ?? s.kind}
|
|
202
|
-
className="velu-footer__social"
|
|
203
|
-
data-kind={s.kind}
|
|
204
|
-
>
|
|
205
|
-
<Icon />
|
|
206
|
-
</a>
|
|
207
|
-
);
|
|
208
|
-
})}
|
|
209
|
-
</Cluster>
|
|
210
|
-
)}
|
|
211
|
-
</Stack>
|
|
212
|
-
);
|
|
213
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Stack from '../primitives/Stack.jsx';
|
|
3
|
+
import Cluster from '../primitives/Cluster.jsx';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* PageFooter — the docs site's footer.
|
|
7
|
+
*
|
|
8
|
+
* <PageFooter
|
|
9
|
+
* linkComponent={RouterLink}
|
|
10
|
+
* columns={[
|
|
11
|
+
* { title: 'Resources', items: [
|
|
12
|
+
* { label: 'Showcase', href: '/showcase' },
|
|
13
|
+
* { label: 'Enterprise', href: '/enterprise' },
|
|
14
|
+
* { label: 'Status', href: '/status' },
|
|
15
|
+
* ]},
|
|
16
|
+
* { title: 'Company', items: […] },
|
|
17
|
+
* { title: 'Policies', items: […] },
|
|
18
|
+
* ]}
|
|
19
|
+
* socials={[
|
|
20
|
+
* { kind: 'github', href: 'https://github.com/…' },
|
|
21
|
+
* { kind: 'x', href: 'https://x.com/…' },
|
|
22
|
+
* { kind: 'youtube', href: 'https://youtube.com/…' },
|
|
23
|
+
* { kind: 'linkedin', href: 'https://linkedin.com/…' },
|
|
24
|
+
* ]}
|
|
25
|
+
* />
|
|
26
|
+
*
|
|
27
|
+
* Layout: a Switcher row of [brand | columns…] that flips to a vertical
|
|
28
|
+
* stack on narrow widths, with a centered social-icon row below. The
|
|
29
|
+
* number of link columns is whatever you pass — fully data-driven.
|
|
30
|
+
*
|
|
31
|
+
* @typedef {Object} FooterLink
|
|
32
|
+
* @property {string} label
|
|
33
|
+
* @property {string} [href]
|
|
34
|
+
*
|
|
35
|
+
* @typedef {Object} FooterColumn
|
|
36
|
+
* @property {string} title
|
|
37
|
+
* @property {FooterLink[]} items
|
|
38
|
+
*
|
|
39
|
+
* @typedef {Object} FooterSocial
|
|
40
|
+
* @property {'github'|'x'|'youtube'|'linkedin'} kind
|
|
41
|
+
* @property {string} href
|
|
42
|
+
*
|
|
43
|
+
* @param {{ columns?: FooterColumn[], socials?: FooterSocial[],
|
|
44
|
+
* brand?: { label?: string, href?: string },
|
|
45
|
+
* linkComponent?: React.ElementType, className?: string }} props
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/* ── Brand mark — the Velu double-hook logo. Color: currentColor for
|
|
49
|
+
the surrounding wordmark; the mark itself uses --accent-color via
|
|
50
|
+
the wrapping span. ───────────────────────────────────────────────── */
|
|
51
|
+
function VeluMark() {
|
|
52
|
+
return (
|
|
53
|
+
<svg
|
|
54
|
+
className="velu-footer__mark"
|
|
55
|
+
viewBox="0 0 32 24"
|
|
56
|
+
fill="currentColor"
|
|
57
|
+
aria-hidden="true"
|
|
58
|
+
>
|
|
59
|
+
<path
|
|
60
|
+
fillRule="evenodd"
|
|
61
|
+
clipRule="evenodd"
|
|
62
|
+
d="M29.6564 14.1534C29.5739 14.5616 29.3507 14.9288 29.0248 15.1926C28.699 15.4565 28.2907 15.6007 27.8694 15.6006H21.3702C20.5341 15.6006 19.8051 16.1627 19.6031 16.9638L18.1671 22.6368C18.0685 23.0263 17.8409 23.372 17.5205 23.619C17.2002 23.866 16.8054 24.0001 16.399 24H10.4378C10.1609 24.0001 9.88759 23.9378 9.63868 23.8179C9.38976 23.6979 9.1718 23.5235 9.00135 23.3079C8.8309 23.0923 8.71245 22.8412 8.65499 22.5736C8.59754 22.306 8.6026 22.029 8.66978 21.7636L10.1888 15.7636C10.2874 15.3743 10.5148 15.0287 10.835 14.7817C11.1551 14.5347 11.5496 14.4005 11.9559 14.4004H18.3931C19.2621 14.4004 20.0101 13.7949 20.1801 12.9532L22.3882 2.04774C22.4705 1.63945 22.6936 1.27198 23.0195 1.00793C23.3453 0.74388 23.7538 0.599578 24.1752 0.599605H30.1774C30.4471 0.599529 30.7134 0.658587 30.9572 0.772515C31.201 0.886444 31.4161 1.0524 31.5871 1.25842C31.758 1.46443 31.8806 1.70537 31.9458 1.96383C32.0111 2.2223 32.0175 2.49185 31.9645 2.75305L29.6564 14.1534ZM9.61081 13.5538C9.52825 13.962 9.30507 14.3292 8.97924 14.593C8.65341 14.857 8.24508 15.0011 7.82375 15.001H1.82257C1.55289 15.0011 1.28656 14.942 1.04279 14.8281C0.79902 14.7141 0.583892 14.5482 0.412928 14.3422C0.241965 14.1362 0.11943 13.8952 0.0541639 13.6368C-0.0111017 13.3783 -0.0174699 13.1087 0.0355186 12.8475L2.34359 1.44715C2.42614 1.03904 2.64933 0.671798 2.97516 0.407944C3.30099 0.144089 3.70932 -7.24082e-05 4.13064 7.25899e-08H10.1318C10.4015 -7.55792e-05 10.6678 0.0589818 10.9116 0.172911C11.1554 0.286839 11.3705 0.453799 11.5415 0.659813C11.7124 0.864828 11.835 1.10576 11.9002 1.36423C11.9655 1.62269 11.9719 1.89225 11.9189 2.15344L9.61081 13.553L9.61081 13.5538Z"
|
|
63
|
+
/>
|
|
64
|
+
</svg>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* ── Social glyphs — inline SVGs with fill: currentColor so they
|
|
69
|
+
inherit color (themed) and flip with light/dark. ─────────────────── */
|
|
70
|
+
function GithubIcon() {
|
|
71
|
+
return (
|
|
72
|
+
<svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
73
|
+
<path
|
|
74
|
+
fillRule="evenodd"
|
|
75
|
+
clipRule="evenodd"
|
|
76
|
+
d="M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z"
|
|
77
|
+
/>
|
|
78
|
+
</svg>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
function XIcon() {
|
|
82
|
+
return (
|
|
83
|
+
<svg viewBox="0 0 1200 1227" fill="currentColor" aria-hidden="true">
|
|
84
|
+
<path d="M714.163 519.284 1160.89 0h-105.86L667.137 450.887 357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152 327.181 476.152H1200L714.137 519.284h.026ZM569.165 687.828l-47.468-67.894-377.686-540.24h162.604l304.797 435.991 47.468 67.894 396.2 566.721H892.476L569.165 687.854v-.026Z" />
|
|
85
|
+
</svg>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
function YoutubeIcon() {
|
|
89
|
+
return (
|
|
90
|
+
<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
91
|
+
<path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" />
|
|
92
|
+
</svg>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
function LinkedinIcon() {
|
|
96
|
+
return (
|
|
97
|
+
<svg viewBox="0 0 256 256" fill="currentColor" aria-hidden="true">
|
|
98
|
+
<path d="M218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453" />
|
|
99
|
+
</svg>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const SOCIAL_ICONS = {
|
|
104
|
+
github: GithubIcon,
|
|
105
|
+
x: XIcon,
|
|
106
|
+
youtube: YoutubeIcon,
|
|
107
|
+
linkedin: LinkedinIcon,
|
|
108
|
+
};
|
|
109
|
+
const SOCIAL_LABELS = {
|
|
110
|
+
github: 'GitHub',
|
|
111
|
+
x: 'X',
|
|
112
|
+
youtube: 'YouTube',
|
|
113
|
+
linkedin: 'LinkedIn',
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export default function PageFooter({
|
|
117
|
+
brand,
|
|
118
|
+
columns = [],
|
|
119
|
+
socials = [],
|
|
120
|
+
linkComponent = 'a',
|
|
121
|
+
className = '',
|
|
122
|
+
...rest
|
|
123
|
+
}) {
|
|
124
|
+
const Link = linkComponent;
|
|
125
|
+
const brandLabel = brand?.label ?? 'Velu';
|
|
126
|
+
const brandHref = brand?.href;
|
|
127
|
+
|
|
128
|
+
const brandNode = (
|
|
129
|
+
<Cluster space="var(--s-3)" align="center" className="velu-footer__brand">
|
|
130
|
+
<VeluMark />
|
|
131
|
+
<span className="velu-footer__wordmark">{brandLabel}</span>
|
|
132
|
+
</Cluster>
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<Stack
|
|
137
|
+
as="footer"
|
|
138
|
+
space="var(--s2)"
|
|
139
|
+
className={`velu-footer ${className}`.trim()}
|
|
140
|
+
{...rest}
|
|
141
|
+
>
|
|
142
|
+
{/* Container groups the brand row and the columns row. */}
|
|
143
|
+
<Stack space="var(--s2)" className="velu-footer__container">
|
|
144
|
+
{/* Row 1: brand */}
|
|
145
|
+
<div className="velu-footer__row velu-footer__row--brand">
|
|
146
|
+
{brandHref ? (
|
|
147
|
+
<Link href={brandHref} className="velu-footer__brand-link">
|
|
148
|
+
{brandNode}
|
|
149
|
+
</Link>
|
|
150
|
+
) : (
|
|
151
|
+
brandNode
|
|
152
|
+
)}
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
{/* Row 2: link columns — each column hugs its content. Plain
|
|
156
|
+
flex row (not Cluster) so column-gap (large, between
|
|
157
|
+
columns) and row-gap (small, when columns wrap onto a new
|
|
158
|
+
line) can be set independently. CSS owns the gaps. */}
|
|
159
|
+
<div className="velu-footer__row velu-footer__row--columns">
|
|
160
|
+
{columns.map((col, i) => (
|
|
161
|
+
<Stack
|
|
162
|
+
key={i}
|
|
163
|
+
space="var(--s-2)"
|
|
164
|
+
className="velu-footer__column"
|
|
165
|
+
>
|
|
166
|
+
<span className="velu-footer__column-title">{col.title}</span>
|
|
167
|
+
<Stack space="var(--s-5)" as="ul" className="velu-footer__list">
|
|
168
|
+
{(col.items ?? []).map((it, j) => (
|
|
169
|
+
<li key={j}>
|
|
170
|
+
<Link
|
|
171
|
+
href={it.href ?? '#'}
|
|
172
|
+
className="velu-footer__link"
|
|
173
|
+
>
|
|
174
|
+
{it.label}
|
|
175
|
+
</Link>
|
|
176
|
+
</li>
|
|
177
|
+
))}
|
|
178
|
+
</Stack>
|
|
179
|
+
</Stack>
|
|
180
|
+
))}
|
|
181
|
+
</div>
|
|
182
|
+
</Stack>
|
|
183
|
+
|
|
184
|
+
{/* Socials sit OUTSIDE the container, at the bottom of the footer. */}
|
|
185
|
+
{socials.length > 0 && (
|
|
186
|
+
<Cluster
|
|
187
|
+
space="var(--s-2)"
|
|
188
|
+
justify="center"
|
|
189
|
+
align="center"
|
|
190
|
+
className="velu-footer__socials"
|
|
191
|
+
>
|
|
192
|
+
{socials.map((s, i) => {
|
|
193
|
+
const Icon = SOCIAL_ICONS[s.kind];
|
|
194
|
+
if (!Icon) return null;
|
|
195
|
+
return (
|
|
196
|
+
<a
|
|
197
|
+
key={i}
|
|
198
|
+
href={s.href}
|
|
199
|
+
target="_blank"
|
|
200
|
+
rel="noreferrer"
|
|
201
|
+
aria-label={SOCIAL_LABELS[s.kind] ?? s.kind}
|
|
202
|
+
className="velu-footer__social"
|
|
203
|
+
data-kind={s.kind}
|
|
204
|
+
>
|
|
205
|
+
<Icon />
|
|
206
|
+
</a>
|
|
207
|
+
);
|
|
208
|
+
})}
|
|
209
|
+
</Cluster>
|
|
210
|
+
)}
|
|
211
|
+
</Stack>
|
|
212
|
+
);
|
|
213
|
+
}
|